playbook_ui 12.33.0 → 12.33.1.pre.alpha.PLAY933navkitcollapsible994
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +6 -4
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +25 -0
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +19 -11
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +27 -14
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +7 -2
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.rb +2 -7
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.html.erb +10 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +19 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.md +2 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_collapsible/index.js +3 -3
- data/app/pb_kits/playbook/pb_date/_date.tsx +8 -7
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +4 -4
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +5 -5
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +31 -45
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +3 -5
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +21 -24
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_time/dateTime.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +8 -6
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +67 -139
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +31 -52
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +120 -0
- data/app/pb_kits/playbook/pb_message/_message.tsx +24 -24
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +6 -0
- data/app/pb_kits/playbook/pb_nav/_item.tsx +98 -49
- data/app/pb_kits/playbook/pb_nav/_nav.scss +1 -0
- data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +9 -11
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +24 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +83 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx +86 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_nav/item.html.erb +34 -12
- data/app/pb_kits/playbook/pb_nav/item.rb +5 -0
- data/app/pb_kits/playbook/pb_time/_time.tsx +11 -9
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +49 -46
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +6 -4
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +11 -11
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +11 -8
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +2 -2
- metadata +16 -8
- data/app/pb_kits/playbook/pb_collapsible/types.d.ts +0 -1
@@ -24,7 +24,7 @@ type MessageProps = {
|
|
24
24
|
label?: string,
|
25
25
|
message: string,
|
26
26
|
timestamp?: string,
|
27
|
-
timestampObject?:
|
27
|
+
timestampObject?: string,
|
28
28
|
timezone?: string,
|
29
29
|
alignTimestamp?: string,
|
30
30
|
}
|
@@ -61,50 +61,50 @@ const Message = (props: MessageProps) => {
|
|
61
61
|
|
62
62
|
return (
|
63
63
|
<div
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
{...ariaProps}
|
65
|
+
{...dataProps}
|
66
|
+
className={classes}
|
67
|
+
id={id}
|
68
68
|
>
|
69
69
|
{shouldDisplayAvatar &&
|
70
70
|
<Avatar
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
imageUrl={avatarUrl}
|
72
|
+
name={avatarName}
|
73
|
+
size="xs"
|
74
|
+
status={avatarStatus}
|
75
75
|
/>
|
76
76
|
}
|
77
77
|
<div className="content_wrapper">
|
78
78
|
<Flex
|
79
|
-
|
80
|
-
|
79
|
+
justify={alignTimestamp === 'left' ? 'none' : 'between'}
|
80
|
+
orientation="row"
|
81
81
|
>
|
82
82
|
{label &&
|
83
83
|
<Title
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
className="message_title"
|
85
|
+
size={4}
|
86
|
+
text={label}
|
87
87
|
/>
|
88
88
|
}
|
89
89
|
<Timestamp
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
className={`pull-${alignTimestamp} ${timestampObject ? 'message_humanized_time' : null}`}
|
91
|
+
text={timestamp}
|
92
|
+
timestamp={''}
|
93
|
+
timezone={timezone}
|
94
94
|
/>
|
95
95
|
{timestampObject &&
|
96
96
|
<Timestamp
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
className={`pull-${alignTimestamp} message_timestamp`}
|
98
|
+
text={''}
|
99
|
+
timestamp={timestampObject}
|
100
|
+
timezone={timezone}
|
101
101
|
/>
|
102
102
|
}
|
103
103
|
</Flex>
|
104
104
|
{message &&
|
105
105
|
<Body
|
106
|
-
|
107
|
-
|
106
|
+
className="pb_message_body"
|
107
|
+
text={message}
|
108
108
|
/>
|
109
109
|
}
|
110
110
|
{children}
|
@@ -6,15 +6,17 @@ import { globalProps, GlobalProps } from '../utilities/globalProps'
|
|
6
6
|
|
7
7
|
import Icon from '../pb_icon/_icon'
|
8
8
|
import Image from '../pb_image/_image'
|
9
|
+
import Collapsible from '../pb_collapsible/_collapsible'
|
9
10
|
|
10
11
|
type NavItemProps = {
|
11
12
|
active?: boolean,
|
12
13
|
aria?: { [key: string]: string },
|
13
14
|
children?: React.ReactNode[] | React.ReactNode,
|
14
15
|
className?: string,
|
16
|
+
collapsible?: boolean,
|
15
17
|
data?: object,
|
16
18
|
iconLeft?: string,
|
17
|
-
iconRight?: string,
|
19
|
+
iconRight?: string | string[],
|
18
20
|
id?: string,
|
19
21
|
imageUrl?: string,
|
20
22
|
link?: string,
|
@@ -29,6 +31,7 @@ const NavItem = (props: NavItemProps) => {
|
|
29
31
|
aria = {},
|
30
32
|
children,
|
31
33
|
className,
|
34
|
+
collapsible,
|
32
35
|
data = {},
|
33
36
|
iconLeft,
|
34
37
|
iconRight,
|
@@ -53,54 +56,100 @@ const NavItem = (props: NavItemProps) => {
|
|
53
56
|
className={classes}
|
54
57
|
id={id}
|
55
58
|
>
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
<
|
68
|
-
className="
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
<
|
80
|
-
className="
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
59
|
+
{
|
60
|
+
collapsible ? (
|
61
|
+
<Collapsible icon={iconRight ? iconRight : ['plus','minus']} iconSize="xs" padding="none">
|
62
|
+
<Collapsible.Main>
|
63
|
+
<Tag
|
64
|
+
className="pb_nav_list_item_link"
|
65
|
+
href={link}
|
66
|
+
onClick={onClick}
|
67
|
+
target={target}
|
68
|
+
>
|
69
|
+
{imageUrl &&
|
70
|
+
<div
|
71
|
+
className="pb_nav_list_item_icon_section"
|
72
|
+
key={imageUrl}
|
73
|
+
>
|
74
|
+
<Image
|
75
|
+
className="pb_nav_img_wrapper"
|
76
|
+
url={imageUrl}
|
77
|
+
/>
|
78
|
+
</div>
|
79
|
+
}
|
80
|
+
|
81
|
+
{iconLeft &&
|
82
|
+
<div
|
83
|
+
className="pb_nav_list_item_icon_section"
|
84
|
+
key={iconLeft}
|
85
|
+
>
|
86
|
+
<Icon
|
87
|
+
className="pb_nav_list_item_icon_left"
|
88
|
+
fixedWidth
|
89
|
+
icon={iconLeft}
|
90
|
+
/>
|
91
|
+
</div>
|
92
|
+
}
|
93
|
+
<span className="pb_nav_list_item_text">
|
94
|
+
{text}
|
95
|
+
</span>
|
96
|
+
</Tag>
|
97
|
+
</Collapsible.Main>
|
98
|
+
<Collapsible.Content>
|
99
|
+
{children}
|
100
|
+
</Collapsible.Content>
|
101
|
+
</Collapsible>
|
102
|
+
) : (
|
103
|
+
<Tag
|
104
|
+
className="pb_nav_list_item_link"
|
105
|
+
href={link}
|
106
|
+
onClick={onClick}
|
107
|
+
target={target}
|
108
|
+
>
|
109
|
+
{imageUrl &&
|
110
|
+
<div
|
111
|
+
className="pb_nav_list_item_icon_section"
|
112
|
+
key={imageUrl}
|
113
|
+
>
|
114
|
+
<Image
|
115
|
+
className="pb_nav_img_wrapper"
|
116
|
+
url={imageUrl}
|
117
|
+
/>
|
118
|
+
</div>
|
119
|
+
}
|
120
|
+
|
121
|
+
{iconLeft &&
|
122
|
+
<div
|
123
|
+
className="pb_nav_list_item_icon_section"
|
124
|
+
key={iconLeft}
|
125
|
+
>
|
126
|
+
<Icon
|
127
|
+
className="pb_nav_list_item_icon_left"
|
128
|
+
fixedWidth
|
129
|
+
icon={iconLeft}
|
130
|
+
/>
|
131
|
+
</div>
|
132
|
+
}
|
133
|
+
|
134
|
+
<span className="pb_nav_list_item_text">
|
135
|
+
{text || children}
|
136
|
+
</span>
|
137
|
+
|
138
|
+
{iconRight &&
|
139
|
+
<div
|
140
|
+
className="pb_nav_list_item_icon_section"
|
141
|
+
key={iconRight as string}
|
142
|
+
>
|
143
|
+
<Icon
|
144
|
+
className="pb_nav_list_item_icon_right"
|
145
|
+
fixedWidth
|
146
|
+
icon={iconRight as string}
|
147
|
+
/>
|
148
|
+
</div>
|
149
|
+
}
|
150
|
+
</Tag>
|
151
|
+
)
|
152
|
+
}
|
104
153
|
</li>
|
105
154
|
)
|
106
155
|
}
|
@@ -29,22 +29,20 @@
|
|
29
29
|
flex: 1;
|
30
30
|
font-weight: $regular;
|
31
31
|
}
|
32
|
-
@media (hover:hover) {
|
33
|
-
&:hover {
|
34
|
-
background-color: rgba($primary, 0.03);
|
35
|
-
[class*=_icon] {
|
36
|
-
color: $primary;
|
37
|
-
}
|
38
|
-
[class*=_text] {
|
39
|
-
color: $primary;
|
40
|
-
}
|
41
|
-
}
|
42
|
-
}
|
43
32
|
}
|
44
33
|
&[class*=_active] [class*=_link] {
|
45
34
|
@include pb_title_4;
|
46
35
|
color: $primary;
|
47
36
|
letter-spacing: normal;
|
48
37
|
}
|
38
|
+
&:hover {
|
39
|
+
background-color: rgba($primary, 0.03);
|
40
|
+
[class*=_icon] {
|
41
|
+
color: $primary;
|
42
|
+
}
|
43
|
+
[class*=_text] {
|
44
|
+
color: $primary;
|
45
|
+
}
|
46
|
+
}
|
49
47
|
}
|
50
48
|
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
2
|
+
<%= pb_rails("nav/item", props: { text: "Overview", link: "#", collapsible: true, icon_left:"city" }) do %>
|
3
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
4
|
+
<%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
|
5
|
+
<%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
|
6
|
+
<%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
9
|
+
<%= pb_rails("nav/item", props: { text: "Albums", link: "#", active: true, collapsible: true, icon_left: "theater-masks" }) do %>
|
10
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
11
|
+
<%= pb_rails("nav/item", props: { text: "Entertainment", link: "#" }) %>
|
12
|
+
<%= pb_rails("nav/item", props: { text: "Food", link: "#" }) %>
|
13
|
+
<%= pb_rails("nav/item", props: { text: "Style", link: "#" }) %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<%= pb_rails("nav/item", props: { text: "Similar Artists", link: "#", collapsible: true, icon_left: "city" }) do %>
|
17
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
18
|
+
<%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
|
19
|
+
<%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
|
20
|
+
<%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
24
|
+
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import React from "react";
|
2
|
+
|
3
|
+
import Nav from "../_nav";
|
4
|
+
import NavItem from "../_item";
|
5
|
+
|
6
|
+
const CollapsibleNav = (props) => {
|
7
|
+
return (
|
8
|
+
<Nav variant="subtle">
|
9
|
+
<NavItem
|
10
|
+
collapsible
|
11
|
+
iconLeft="city"
|
12
|
+
link="#"
|
13
|
+
text="Overview"
|
14
|
+
{...props}
|
15
|
+
>
|
16
|
+
<NavItem
|
17
|
+
link="#"
|
18
|
+
text="City"
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
<NavItem
|
22
|
+
link="#"
|
23
|
+
text="People"
|
24
|
+
{...props}
|
25
|
+
/>
|
26
|
+
<NavItem
|
27
|
+
link="#"
|
28
|
+
text="Business"
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
</NavItem>
|
32
|
+
<NavItem
|
33
|
+
active
|
34
|
+
collapsible
|
35
|
+
iconLeft="theater-masks"
|
36
|
+
link="#"
|
37
|
+
text="Albums"
|
38
|
+
{...props}
|
39
|
+
>
|
40
|
+
<NavItem
|
41
|
+
link="#"
|
42
|
+
text="Entertainment"
|
43
|
+
{...props}
|
44
|
+
/>
|
45
|
+
<NavItem
|
46
|
+
link="#"
|
47
|
+
text="Food"
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<NavItem
|
51
|
+
link="#"
|
52
|
+
text="Style"
|
53
|
+
{...props}
|
54
|
+
/>
|
55
|
+
</NavItem>
|
56
|
+
<NavItem
|
57
|
+
collapsible
|
58
|
+
iconLeft="city"
|
59
|
+
link="#"
|
60
|
+
text="Similar Artists"
|
61
|
+
{...props}
|
62
|
+
>
|
63
|
+
<NavItem
|
64
|
+
link="#"
|
65
|
+
text="City"
|
66
|
+
{...props}
|
67
|
+
/>
|
68
|
+
<NavItem
|
69
|
+
link="#"
|
70
|
+
text="People"
|
71
|
+
{...props}
|
72
|
+
/>
|
73
|
+
<NavItem
|
74
|
+
link="#"
|
75
|
+
text="Business"
|
76
|
+
{...props}
|
77
|
+
/>
|
78
|
+
</NavItem>
|
79
|
+
</Nav>
|
80
|
+
);
|
81
|
+
};
|
82
|
+
|
83
|
+
export default CollapsibleNav;
|
@@ -0,0 +1,86 @@
|
|
1
|
+
import React from "react";
|
2
|
+
|
3
|
+
import Nav from "../_nav";
|
4
|
+
import NavItem from "../_item";
|
5
|
+
|
6
|
+
const CollapsibleNavCustomIcons = (props) => {
|
7
|
+
return (
|
8
|
+
<Nav variant="subtle">
|
9
|
+
<NavItem
|
10
|
+
collapsible
|
11
|
+
iconLeft="city"
|
12
|
+
iconRight={["chevron-down", "chevron-up"]}
|
13
|
+
link="#"
|
14
|
+
text="Overview"
|
15
|
+
{...props}
|
16
|
+
>
|
17
|
+
<NavItem
|
18
|
+
link="#"
|
19
|
+
text="City"
|
20
|
+
{...props}
|
21
|
+
/>
|
22
|
+
<NavItem
|
23
|
+
link="#"
|
24
|
+
text="People"
|
25
|
+
{...props}
|
26
|
+
/>
|
27
|
+
<NavItem
|
28
|
+
link="#"
|
29
|
+
text="Business"
|
30
|
+
{...props}
|
31
|
+
/>
|
32
|
+
</NavItem>
|
33
|
+
<NavItem
|
34
|
+
active
|
35
|
+
collapsible
|
36
|
+
iconLeft="theater-masks"
|
37
|
+
iconRight={["chevron-down", "chevron-up"]}
|
38
|
+
link="#"
|
39
|
+
text="Albums"
|
40
|
+
{...props}
|
41
|
+
>
|
42
|
+
<NavItem
|
43
|
+
link="#"
|
44
|
+
text="Entertainment"
|
45
|
+
{...props}
|
46
|
+
/>
|
47
|
+
<NavItem
|
48
|
+
link="#"
|
49
|
+
text="Food"
|
50
|
+
{...props}
|
51
|
+
/>
|
52
|
+
<NavItem
|
53
|
+
link="#"
|
54
|
+
text="Style"
|
55
|
+
{...props}
|
56
|
+
/>
|
57
|
+
</NavItem>
|
58
|
+
<NavItem
|
59
|
+
collapsible
|
60
|
+
iconLeft="city"
|
61
|
+
iconRight={["chevron-down", "chevron-up"]}
|
62
|
+
link="#"
|
63
|
+
text="Similar Artists"
|
64
|
+
{...props}
|
65
|
+
>
|
66
|
+
<NavItem
|
67
|
+
link="#"
|
68
|
+
text="City"
|
69
|
+
{...props}
|
70
|
+
/>
|
71
|
+
<NavItem
|
72
|
+
link="#"
|
73
|
+
text="People"
|
74
|
+
{...props}
|
75
|
+
/>
|
76
|
+
<NavItem
|
77
|
+
link="#"
|
78
|
+
text="Business"
|
79
|
+
{...props}
|
80
|
+
/>
|
81
|
+
</NavItem>
|
82
|
+
</Nav>
|
83
|
+
);
|
84
|
+
};
|
85
|
+
|
86
|
+
export default CollapsibleNavCustomIcons;
|
@@ -7,6 +7,7 @@ examples:
|
|
7
7
|
- borderless_nav: No Borders
|
8
8
|
- subtle_nav: Subtle Variant
|
9
9
|
- subtle_with_icons_nav: Subtle With Icons
|
10
|
+
- collapsible_nav: Subtle With Collapsible
|
10
11
|
- subtle_no_highlight_nav: Subtle No Highlight
|
11
12
|
- bold_vertical_nav: Bold Variant
|
12
13
|
- horizontal_nav: Horizontal Nav
|
@@ -24,6 +25,8 @@ examples:
|
|
24
25
|
- borderless_nav: No Borders
|
25
26
|
- subtle_nav: Subtle Variant
|
26
27
|
- subtle_with_icons_nav: Subtle With Icons
|
28
|
+
- collapsible_nav: Subtle With Collapsible
|
29
|
+
- collapsible_nav_custom_icons: Subtle With Collapsible (Custom Toggle Icons)
|
27
30
|
- subtle_no_highlight_nav: Subtle No Highlight
|
28
31
|
- bold_vertical_nav: Bold Variant
|
29
32
|
- horizontal_nav: Horizontal Nav
|
@@ -13,3 +13,5 @@ export { default as WithImgNav } from './_with_img_nav.jsx'
|
|
13
13
|
export { default as NewTab } from './_new_tab.jsx'
|
14
14
|
export { default as BoldHorizontalNav } from './_bold_horizontal_nav.jsx'
|
15
15
|
export { default as BoldVerticalNav } from './_bold_vertical_nav.jsx'
|
16
|
+
export { default as CollapsibleNav } from './_collapsible_nav.jsx'
|
17
|
+
export { default as CollapsibleNavCustomIcons } from './_collapsible_nav_custom_icons.jsx'
|
@@ -3,19 +3,41 @@
|
|
3
3
|
class: object.classname,
|
4
4
|
data: object.data,
|
5
5
|
id: object.id) do %>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<% if object.collapsible %>
|
7
|
+
<%= pb_rails("collapsible", props: { name: "collapsible-nav-example" }) do %>
|
8
|
+
<%= pb_rails("collapsible/collapsible_main", props: { name: "default-collapsible-nav", icon: object.collapsible_icons, size: "xs" }) do %>
|
9
|
+
<%= content_tag(object.tag,
|
10
|
+
object.link ? object.link_options : object.options) do %>
|
11
|
+
<% if object.image_url %>
|
12
|
+
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
|
13
|
+
<% end %>
|
14
|
+
<% if object.icon_left %>
|
15
|
+
<%= pb_rails("icon", props: { icon: object.icon_left, classname: "pb_nav_list_item_icon_left", fixed_width: true}) %>
|
16
|
+
<% end %>
|
17
|
+
<span class="pb_nav_list_item_text">
|
18
|
+
<%= object.text %>
|
19
|
+
</span>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
<%= pb_rails("collapsible/collapsible_content") do %>
|
23
|
+
<%= content.presence %>
|
24
|
+
<% end %>
|
10
25
|
<% end %>
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
26
|
+
<% else %>
|
27
|
+
<%= content_tag(object.tag,
|
28
|
+
object.link ? object.link_options : object.options) do %>
|
29
|
+
<% if object.image_url %>
|
30
|
+
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
|
31
|
+
<% end %>
|
32
|
+
<% if object.icon_left %>
|
33
|
+
<%= pb_rails("icon", props: { icon: object.icon_left, classname: "pb_nav_list_item_icon_left", fixed_width: true}) %>
|
34
|
+
<% end %>
|
35
|
+
<span class="pb_nav_list_item_text">
|
36
|
+
<%= object.text %><%= content.presence %>
|
37
|
+
</span>
|
38
|
+
<% if object.icon_right %>
|
39
|
+
<%= pb_rails("icon", props: { icon: object.icon_right, classname: "pb_nav_list_item_icon_right", fixed_width: true}) %>
|
40
|
+
<% end %>
|
19
41
|
<% end %>
|
20
42
|
<% end %>
|
21
43
|
<% end %>
|
@@ -4,6 +4,7 @@ module Playbook
|
|
4
4
|
module PbNav
|
5
5
|
class Item < Playbook::KitBase
|
6
6
|
prop :active, type: Playbook::Props::Boolean, default: false
|
7
|
+
prop :collapsible, type: Playbook::Props::Boolean, default: false
|
7
8
|
prop :link
|
8
9
|
prop :text
|
9
10
|
prop :icon_left
|
@@ -33,6 +34,10 @@ module Playbook
|
|
33
34
|
)
|
34
35
|
end
|
35
36
|
|
37
|
+
def collapsible_icons
|
38
|
+
icon_right.present? ? icon_right : %w[plus minus]
|
39
|
+
end
|
40
|
+
|
36
41
|
private
|
37
42
|
|
38
43
|
def active_class
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import classnames from "classnames";
|
3
3
|
|
4
|
+
import DateTime from "../pb_kit/dateTime";
|
4
5
|
import { buildCss } from "../utilities/props";
|
5
6
|
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
6
|
-
import DateTime from '../pb_kit/dateTime';
|
7
7
|
|
8
8
|
import Body from "../pb_body/_body";
|
9
9
|
import Caption from "../pb_caption/_caption";
|
@@ -13,7 +13,7 @@ type TimeProps = {
|
|
13
13
|
align?: "left" | "center" | "right";
|
14
14
|
className?: string | string[];
|
15
15
|
data?: string;
|
16
|
-
date:
|
16
|
+
date: string;
|
17
17
|
dark?: boolean;
|
18
18
|
id?: string;
|
19
19
|
showIcon?: boolean;
|
@@ -41,6 +41,8 @@ const Time = (props: TimeProps) => {
|
|
41
41
|
className
|
42
42
|
);
|
43
43
|
|
44
|
+
const dateTimestamp = new DateTime({ value: date, zone: timeZone });
|
45
|
+
|
44
46
|
return (
|
45
47
|
<div className={classes}>
|
46
48
|
{showIcon && (
|
@@ -68,18 +70,18 @@ const Time = (props: TimeProps) => {
|
|
68
70
|
)
|
69
71
|
)}
|
70
72
|
|
71
|
-
<time dateTime={date
|
73
|
+
<time dateTime={date}>
|
72
74
|
<span>
|
73
75
|
{unstyled
|
74
76
|
? (
|
75
77
|
<>
|
76
78
|
<span>
|
77
|
-
{
|
79
|
+
{dateTimestamp.toTimeWithMeridian()}
|
78
80
|
</span>
|
79
81
|
{" "}
|
80
82
|
{showTimezone && (
|
81
83
|
<span>
|
82
|
-
{
|
84
|
+
{dateTimestamp.toTimezone()}
|
83
85
|
</span>
|
84
86
|
)}
|
85
87
|
</>
|
@@ -90,13 +92,13 @@ const Time = (props: TimeProps) => {
|
|
90
92
|
<Body
|
91
93
|
className="pb_time"
|
92
94
|
tag="span"
|
93
|
-
text={
|
95
|
+
text={dateTimestamp.toTimeWithMeridian()}
|
94
96
|
/>{" "}
|
95
97
|
{showTimezone && (
|
96
98
|
<Body
|
97
99
|
color="light"
|
98
100
|
tag="span"
|
99
|
-
text={
|
101
|
+
text={dateTimestamp.toTimezone()}
|
100
102
|
/>
|
101
103
|
)}
|
102
104
|
</>
|
@@ -106,13 +108,13 @@ const Time = (props: TimeProps) => {
|
|
106
108
|
<Caption
|
107
109
|
color="light"
|
108
110
|
tag="span"
|
109
|
-
text={
|
111
|
+
text={dateTimestamp.toTimeWithMeridian()}
|
110
112
|
/>{" "}
|
111
113
|
{showTimezone && (
|
112
114
|
<Caption
|
113
115
|
color="light"
|
114
116
|
tag="span"
|
115
|
-
text={
|
117
|
+
text={dateTimestamp.toTimezone()}
|
116
118
|
/>
|
117
119
|
)}
|
118
120
|
</>
|