playbook_ui 12.37.0.pre.alpha.PLAY951collapsiblenav31062 → 12.37.0.pre.alpha.PLAYaddingdatapropselectkit1071
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.scss +0 -6
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +3 -3
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +9 -10
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_color.jsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.jsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +8 -4
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.jsx +5 -5
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +6 -7
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_date/_date.tsx +7 -8
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +29 -5
- 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 +45 -31
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +5 -3
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +24 -21
- 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 +6 -8
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +146 -63
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +52 -31
- data/app/pb_kits/playbook/pb_message/_message.tsx +24 -24
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +16 -141
- data/app/pb_kits/playbook/pb_nav/_item.tsx +22 -33
- data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +6 -6
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +58 -79
- data/app/pb_kits/playbook/pb_nav/docs/{_collapsible_nav_emphasize.jsx → _collapsible_nav_custom_icons.jsx} +3 -5
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +3 -5
- data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_nav/item.html.erb +4 -5
- data/app/pb_kits/playbook/pb_nav/item.rb +2 -17
- data/app/pb_kits/playbook/pb_select/docs/_select_data_attributes.html.erb +24 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_data_attributes.md +1 -0
- data/app/pb_kits/playbook/pb_select/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_time/_time.tsx +9 -11
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +46 -49
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +4 -6
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +11 -11
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +8 -11
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +1 -1
- metadata +5 -11
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +0 -75
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.md +0 -3
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +0 -120
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx +0 -57
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.md +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb +0 -23
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md +0 -1
@@ -1,152 +1,27 @@
|
|
1
1
|
@import "../tokens/spacing";
|
2
2
|
@import "../tokens/colors";
|
3
3
|
@import "../tokens/border_radius";
|
4
|
-
@import "../tokens/titles";
|
5
|
-
@import "../tokens/typography";
|
6
4
|
|
7
5
|
[class^="pb_nav_list"] {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
|
16
|
-
@mixin bold_class {
|
17
|
-
.pb_collapsible_main_kit {
|
18
|
-
.pb_nav_list_item_text_collapsible {
|
19
|
-
@include pb_title_4;
|
20
|
-
font-weight: $bolder !important;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
}
|
24
|
-
|
25
|
-
&[class*="_active"] {
|
26
|
-
background-color: unset !important;
|
27
|
-
.pb_nav_list_item_link {
|
28
|
-
color: unset !important;
|
29
|
-
}
|
30
|
-
.pb_collapsible_main_kit {
|
31
|
-
background-color: $primary !important;
|
32
|
-
border-radius: $border_rad_heavier;
|
33
|
-
.pb_nav_list_item_text_collapsible,
|
34
|
-
.pb_nav_list_item_icon_collapsible,
|
35
|
-
.icon_wrapper,
|
36
|
-
.pb_icon_kit {
|
37
|
-
color: $white !important;
|
38
|
-
}
|
39
|
-
}
|
40
|
-
|
41
|
-
&:hover {
|
42
|
-
background-color: unset;
|
43
|
-
}
|
44
|
-
.pb_collapsible_main_kit:hover {
|
45
|
-
.pb_nav_list_item_text_collapsible {
|
46
|
-
color: $white !important;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
.icon_wrapper {
|
51
|
-
&:hover {
|
52
|
-
background-color: mix($primary, $card_light, 40%);
|
53
|
-
.pb_icon_kit {
|
54
|
-
color: $primary !important;
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
58
|
-
}
|
6
|
+
.pb_collapsible_nav_item {
|
7
|
+
.pb_collapsible_main_kit,
|
8
|
+
.pb_collapsible_content_kit,
|
9
|
+
.pb_collapsible_kit {
|
10
|
+
padding: 0 !important;
|
11
|
+
}
|
59
12
|
|
13
|
+
.icon_wrapper {
|
14
|
+
border-radius: $border_radius_rounded;
|
15
|
+
width: 19px;
|
16
|
+
height: 19px;
|
17
|
+
display:flex;
|
18
|
+
align-items: center;
|
19
|
+
justify-content: center;
|
20
|
+
margin-right: $space_xs;
|
60
21
|
&:hover {
|
61
|
-
|
62
|
-
background-color: unset !important;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
.pb_collapsible_main_kit:hover {
|
67
|
-
border-radius: $border_rad_heavier;
|
68
|
-
background-color: mix($primary, $card_light, 10%);
|
69
|
-
.pb_nav_list_item_text_collapsible,
|
70
|
-
svg {
|
71
|
-
color: $primary !important;
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
.pb_collapsible_main_kit,
|
76
|
-
.pb_collapsible_content_kit,
|
77
|
-
.pb_collapsible_kit {
|
78
|
-
padding: 0 !important;
|
79
|
-
}
|
22
|
+
background-color: rgba($primary_action, $opacity_3);
|
80
23
|
|
81
|
-
&[class*="_collapsible_trail"] {
|
82
|
-
@include collapsible_trail_class;
|
83
|
-
}
|
84
|
-
|
85
|
-
&[class*="_bold_text"] {
|
86
|
-
@include bold_class;
|
87
|
-
}
|
88
|
-
|
89
|
-
&[class*="_emphasized"] {
|
90
|
-
@include collapsible_trail_class;
|
91
|
-
@include bold_class;
|
92
|
-
}
|
93
|
-
|
94
|
-
.icon_wrapper {
|
95
|
-
border-radius: $border_radius_rounded;
|
96
|
-
width: $space_sm + 3;
|
97
|
-
height: $space_sm + 3;
|
98
|
-
display: flex;
|
99
|
-
align-items: center;
|
100
|
-
justify-content: center;
|
101
|
-
margin-right: $space_xs;
|
102
|
-
&:hover {
|
103
|
-
background-color: mix($primary, $card_light, 40%);
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
&.dark {
|
108
|
-
&[class*="pb_nav_list_kit_item"] [class*="_link"]:hover {
|
109
|
-
.pb_nav_list_item_text {
|
110
|
-
color: $white !important;
|
111
|
-
}
|
112
|
-
}
|
113
|
-
|
114
|
-
.pb_nav_list_item_text_collapsible {
|
115
|
-
color: $white !important;
|
116
|
-
}
|
117
|
-
.pb_nav_list_item_text {
|
118
|
-
color: $text_dk_light;
|
119
|
-
}
|
120
|
-
.pb_nav_list_kit_item:hover {
|
121
|
-
background-color: #ffffff33;
|
122
|
-
color: $white;
|
123
|
-
}
|
124
|
-
.pb_icon_kit {
|
125
|
-
color: $text_dk_light;
|
126
|
-
}
|
127
|
-
|
128
|
-
.pb_collapsible_main_kit:hover {
|
129
|
-
background-color: mix($white, $card_dark, 20%);
|
130
|
-
.pb_nav_list_item_text_collapsible,
|
131
|
-
svg {
|
132
|
-
color: $white !important;
|
133
|
-
}
|
134
|
-
}
|
135
|
-
.icon_wrapper:hover {
|
136
|
-
background-color: mix($white, $card_dark, 40%);
|
137
|
-
}
|
138
|
-
&[class*="_active"] {
|
139
|
-
.icon_wrapper:hover {
|
140
|
-
background-color: mix($primary, $card_light, 40%);
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
|
-
&[class*="pb_collapsible_nav_item"][class*="_emphasized"],
|
145
|
-
&[class*="pb_collapsible_nav_item"][class*="_collapsible_trail"] {
|
146
|
-
.pb_collapsible_content_kit {
|
147
|
-
border-color: $border_dark;
|
148
|
-
}
|
149
|
-
}
|
150
24
|
}
|
151
25
|
}
|
152
26
|
}
|
27
|
+
}
|
@@ -11,69 +11,57 @@ import Collapsible from '../pb_collapsible/_collapsible'
|
|
11
11
|
type NavItemProps = {
|
12
12
|
active?: boolean,
|
13
13
|
aria?: { [key: string]: string },
|
14
|
-
bold?: boolean,
|
15
|
-
emphasized?: boolean,
|
16
14
|
children?: React.ReactNode[] | React.ReactNode,
|
17
15
|
className?: string,
|
18
16
|
collapsible?: boolean,
|
17
|
+
collapsibleClick?: () => void,
|
19
18
|
data?: object,
|
20
|
-
dark?: boolean,
|
21
19
|
iconLeft?: string,
|
22
20
|
iconRight?: string | string[],
|
23
|
-
|
24
|
-
|
21
|
+
iconRightClick?: () => void,
|
22
|
+
iconLeftClick?: () => void,
|
25
23
|
id?: string,
|
26
24
|
imageUrl?: string,
|
27
25
|
link?: string,
|
28
|
-
onClick?:
|
26
|
+
onClick?: React.MouseEventHandler<HTMLElement>,
|
29
27
|
target?: '_blank' | '_self' | '_parent' | '_top',
|
30
28
|
text: string,
|
31
|
-
|
32
|
-
collapsed?: boolean
|
29
|
+
toggleCollapsed?: any
|
33
30
|
} & GlobalProps
|
34
31
|
|
35
32
|
const NavItem = (props: NavItemProps) => {
|
36
33
|
const {
|
37
34
|
active = false,
|
38
35
|
aria = {},
|
39
|
-
bold,
|
40
|
-
emphasized,
|
41
36
|
children,
|
42
37
|
className,
|
43
38
|
collapsible,
|
39
|
+
collapsibleClick,
|
44
40
|
data = {},
|
45
|
-
dark = false,
|
46
41
|
iconLeft,
|
47
42
|
iconRight,
|
48
|
-
|
49
|
-
|
43
|
+
iconRightClick,
|
44
|
+
iconLeftClick,
|
50
45
|
id,
|
51
46
|
imageUrl,
|
52
47
|
link,
|
53
48
|
onClick = () => { },
|
54
49
|
target = '_self',
|
55
50
|
text = '',
|
56
|
-
|
57
|
-
collapsed
|
51
|
+
toggleCollapsed
|
58
52
|
} = props
|
59
53
|
|
60
54
|
const Tag = link ? 'a' : 'div'
|
61
55
|
const activeClass = active === true ? 'active' : ''
|
62
|
-
const collapsibleTrailClass = collapsible && collapsibleTrail ? 'collapsible_trail' : ''
|
63
|
-
const boldClass = collapsible && bold ? 'bold' : ''
|
64
|
-
const emphasizedClass = collapsible && emphasized ? 'emphasized' : ''
|
65
56
|
const ariaProps = buildAriaProps(aria)
|
66
57
|
const dataProps = buildDataProps(data)
|
67
|
-
const classes = classnames(buildCss('pb_nav_list_kit_item', activeClass),
|
68
|
-
collapsible ? buildCss('pb_collapsible_nav_item', activeClass, collapsibleTrailClass, boldClass, emphasizedClass) : '',
|
69
|
-
globalProps(props),
|
70
|
-
className)
|
58
|
+
const classes = classnames(buildCss('pb_nav_list_kit_item', activeClass), collapsible ? 'pb_collapsible_nav_item' : '', globalProps(props), className)
|
71
59
|
|
72
60
|
|
73
61
|
const handleIconClick = (e:any) => {
|
74
|
-
if (
|
62
|
+
if (iconLeftClick) {
|
75
63
|
e.stopPropagation();
|
76
|
-
|
64
|
+
iconLeftClick()
|
77
65
|
}
|
78
66
|
}
|
79
67
|
|
@@ -89,19 +77,20 @@ const NavItem = (props: NavItemProps) => {
|
|
89
77
|
<Collapsible icon={iconRight ? iconRight : ['plus','minus']}
|
90
78
|
iconSize="xs"
|
91
79
|
id={id}
|
92
|
-
collapsed={
|
93
|
-
|
94
|
-
onClick={
|
80
|
+
collapsed={toggleCollapsed}
|
81
|
+
iconClick={iconRightClick}
|
82
|
+
onClick={collapsibleClick}
|
95
83
|
>
|
96
|
-
<Collapsible.Main
|
84
|
+
<Collapsible.Main>
|
97
85
|
<Tag
|
98
|
-
className="
|
86
|
+
className="pb_nav_list_item_link"
|
99
87
|
href={link}
|
88
|
+
onClick={onClick}
|
100
89
|
target={target}
|
101
90
|
>
|
102
91
|
{imageUrl &&
|
103
92
|
<div
|
104
|
-
className="
|
93
|
+
className="pb_nav_list_item_icon_section"
|
105
94
|
key={imageUrl}
|
106
95
|
onClick={(e)=>handleIconClick(e)}
|
107
96
|
>
|
@@ -114,18 +103,18 @@ const NavItem = (props: NavItemProps) => {
|
|
114
103
|
|
115
104
|
{iconLeft &&
|
116
105
|
<div
|
117
|
-
className="
|
106
|
+
className="pb_nav_list_item_icon_section"
|
118
107
|
key={iconLeft}
|
119
108
|
onClick={(e)=>handleIconClick(e)}
|
120
109
|
>
|
121
110
|
<Icon
|
122
|
-
className="
|
111
|
+
className="pb_nav_list_item_icon_left"
|
123
112
|
fixedWidth
|
124
113
|
icon={iconLeft}
|
125
114
|
/>
|
126
115
|
</div>
|
127
116
|
}
|
128
|
-
<span className="
|
117
|
+
<span className="pb_nav_list_item_text">
|
129
118
|
{text}
|
130
119
|
</span>
|
131
120
|
</Tag>
|
@@ -29,6 +29,12 @@
|
|
29
29
|
flex: 1;
|
30
30
|
font-weight: $regular;
|
31
31
|
}
|
32
|
+
}
|
33
|
+
&[class*=_active] [class*=_link] {
|
34
|
+
@include pb_title_4;
|
35
|
+
color: $primary;
|
36
|
+
letter-spacing: normal;
|
37
|
+
}
|
32
38
|
&:hover {
|
33
39
|
background-color: rgba($primary, 0.03);
|
34
40
|
[class*=_icon] {
|
@@ -38,11 +44,5 @@
|
|
38
44
|
color: $primary;
|
39
45
|
}
|
40
46
|
}
|
41
|
-
}
|
42
|
-
&[class*=_active] [class*=_link] {
|
43
|
-
@include pb_title_4;
|
44
|
-
color: $primary;
|
45
|
-
letter-spacing: normal;
|
46
|
-
}
|
47
47
|
}
|
48
48
|
}
|
@@ -1,84 +1,63 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import { Nav, NavItem } from
|
1
|
+
import React from "react"
|
2
|
+
import { Nav, NavItem, useCollapsible } from "../.."
|
3
3
|
|
4
4
|
const CollapsibleNav = (props) => {
|
5
|
+
const navItems = ["Overview", "Albums", "Similar Artists"]
|
6
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
7
|
+
const collapsibles = navItems.map(() => useCollapsible(true))
|
8
|
+
|
9
|
+
const handleMainClick = (index) => {
|
10
|
+
collapsibles.forEach(([, , setCollapsed], idx) => {
|
11
|
+
if (idx === index) {
|
12
|
+
setCollapsed(false)
|
13
|
+
} else {
|
14
|
+
setCollapsed(true)
|
15
|
+
}
|
16
|
+
})
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
const handleIconRightClick = (index) => {
|
21
|
+
const [isCollapsed, setCollapsed] = collapsibles[index]
|
22
|
+
setCollapsed(!isCollapsed)
|
23
|
+
}
|
24
|
+
|
5
25
|
return (
|
6
|
-
|
7
|
-
<
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
iconRight={["plus", "minus"]}
|
60
|
-
link="#"
|
61
|
-
text="Similar Artists"
|
62
|
-
{...props}
|
63
|
-
>
|
64
|
-
<NavItem
|
65
|
-
link="#"
|
66
|
-
text="City"
|
67
|
-
{...props}
|
68
|
-
/>
|
69
|
-
<NavItem
|
70
|
-
link="#"
|
71
|
-
text="People"
|
72
|
-
{...props}
|
73
|
-
/>
|
74
|
-
<NavItem
|
75
|
-
link="#"
|
76
|
-
text="Business"
|
77
|
-
{...props}
|
78
|
-
/>
|
79
|
-
</NavItem>
|
80
|
-
</Nav>
|
81
|
-
);
|
82
|
-
};
|
26
|
+
<>
|
27
|
+
<Nav variant='subtle'>
|
28
|
+
{navItems.map((text, index) => {
|
29
|
+
const [collapsed] = collapsibles[index]
|
30
|
+
return (
|
31
|
+
<NavItem
|
32
|
+
collapsible
|
33
|
+
collapsibleClick={() => handleMainClick(index)}
|
34
|
+
iconLeft="chevron-down"
|
35
|
+
iconRightClick={() => handleIconRightClick(index)}
|
36
|
+
id={`collapsible-nav-item-${index + 1}`}
|
37
|
+
key={index}
|
38
|
+
link="#"
|
39
|
+
text={text}
|
40
|
+
toggleCollapsed={collapsed}
|
41
|
+
{...props}
|
42
|
+
>
|
43
|
+
<NavItem link="#"
|
44
|
+
text="City"
|
45
|
+
{...props}
|
46
|
+
/>
|
47
|
+
<NavItem link="#"
|
48
|
+
text="People"
|
49
|
+
{...props}
|
50
|
+
/>
|
51
|
+
<NavItem link="#"
|
52
|
+
text="Business"
|
53
|
+
{...props}
|
54
|
+
/>
|
55
|
+
</NavItem>
|
56
|
+
);
|
57
|
+
})}
|
58
|
+
</Nav>
|
59
|
+
</>
|
60
|
+
)
|
61
|
+
}
|
83
62
|
|
84
63
|
export default CollapsibleNav
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Nav, NavItem } from '../..'
|
3
3
|
|
4
|
-
const
|
4
|
+
const CollapsibleNavCustomIcons = (props) => {
|
5
5
|
return (
|
6
6
|
<Nav variant="subtle">
|
7
7
|
<NavItem
|
8
8
|
collapsible
|
9
|
-
emphasized
|
10
9
|
iconLeft="city"
|
11
10
|
iconRight={["plus", "minus"]}
|
12
11
|
link="#"
|
@@ -30,8 +29,8 @@ const CollapsibleNavEmphasize = (props) => {
|
|
30
29
|
/>
|
31
30
|
</NavItem>
|
32
31
|
<NavItem
|
32
|
+
active
|
33
33
|
collapsible
|
34
|
-
emphasized
|
35
34
|
iconLeft="theater-masks"
|
36
35
|
iconRight={["plus", "minus"]}
|
37
36
|
link="#"
|
@@ -56,7 +55,6 @@ const CollapsibleNavEmphasize = (props) => {
|
|
56
55
|
</NavItem>
|
57
56
|
<NavItem
|
58
57
|
collapsible
|
59
|
-
emphasized
|
60
58
|
iconLeft="city"
|
61
59
|
iconRight={["plus", "minus"]}
|
62
60
|
link="#"
|
@@ -83,4 +81,4 @@ const CollapsibleNavEmphasize = (props) => {
|
|
83
81
|
);
|
84
82
|
};
|
85
83
|
|
86
|
-
export default
|
84
|
+
export default CollapsibleNavCustomIcons;
|
@@ -7,8 +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: Collapsible
|
11
|
-
- collapsible_nav_emphasize: Collapsible Nav with Emphasize Styling
|
10
|
+
# - collapsible_nav: Subtle With Collapsible
|
12
11
|
- subtle_no_highlight_nav: Subtle No Highlight
|
13
12
|
- bold_vertical_nav: Bold Variant
|
14
13
|
- horizontal_nav: Horizontal Nav
|
@@ -26,9 +25,8 @@ examples:
|
|
26
25
|
- borderless_nav: No Borders
|
27
26
|
- subtle_nav: Subtle Variant
|
28
27
|
- subtle_with_icons_nav: Subtle With Icons
|
29
|
-
- collapsible_nav: Collapsible
|
30
|
-
-
|
31
|
-
- collapsible_nav_custom: Collapsible Nav With Custom Toggling
|
28
|
+
# - collapsible_nav: Subtle With Collapsible
|
29
|
+
# - collapsible_nav_custom_icons: Subtle With Collapsible (No custom toggling)
|
32
30
|
- subtle_no_highlight_nav: Subtle No Highlight
|
33
31
|
- bold_vertical_nav: Bold Variant
|
34
32
|
- horizontal_nav: Horizontal Nav
|
@@ -14,5 +14,4 @@ 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
16
|
export { default as CollapsibleNav } from './_collapsible_nav.jsx'
|
17
|
-
export { default as
|
18
|
-
export { default as CollapsibleNavEmphasize } from "./_collapsible_nav_emphasize.jsx"
|
17
|
+
export { default as CollapsibleNavCustomIcons } from './_collapsible_nav_custom_icons.jsx'
|
@@ -2,20 +2,19 @@
|
|
2
2
|
aria: object.aria,
|
3
3
|
class: object.classname,
|
4
4
|
data: object.data,
|
5
|
-
dark: object.dark,
|
6
5
|
id: object.id) do %>
|
7
6
|
<% if object.collapsible %>
|
8
7
|
<%= pb_rails("collapsible", props: { name: "collapsible-nav-example" }) do %>
|
9
|
-
<%= pb_rails("collapsible/collapsible_main", props: { name: "default-collapsible-nav", icon: object.collapsible_icons, size: "xs"
|
8
|
+
<%= pb_rails("collapsible/collapsible_main", props: { name: "default-collapsible-nav", icon: object.collapsible_icons, size: "xs" }) do %>
|
10
9
|
<%= content_tag(object.tag,
|
11
10
|
object.link ? object.link_options : object.options) do %>
|
12
11
|
<% if object.image_url %>
|
13
|
-
<%= pb_rails("image", props: { url: object.image_url, classname: "
|
12
|
+
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
|
14
13
|
<% end %>
|
15
14
|
<% if object.icon_left %>
|
16
|
-
<%= pb_rails("icon", props: { icon: object.icon_left, classname: "
|
15
|
+
<%= pb_rails("icon", props: { icon: object.icon_left, classname: "pb_nav_list_item_icon_left", fixed_width: true}) %>
|
17
16
|
<% end %>
|
18
|
-
<span class="
|
17
|
+
<span class="pb_nav_list_item_text">
|
19
18
|
<%= object.text %>
|
20
19
|
</span>
|
21
20
|
<% end %>
|
@@ -4,12 +4,9 @@ module Playbook
|
|
4
4
|
module PbNav
|
5
5
|
class Item < Playbook::KitBase
|
6
6
|
prop :active, type: Playbook::Props::Boolean, default: false
|
7
|
-
prop :bold, type: Playbook::Props::Boolean, default: false
|
8
7
|
prop :collapsible, type: Playbook::Props::Boolean, default: false
|
9
|
-
prop :emphasized, type: Playbook::Props::Boolean, default: false
|
10
8
|
prop :link
|
11
9
|
prop :text
|
12
|
-
prop :collapsible_trail, type: Playbook::Props::Boolean, default: false
|
13
10
|
prop :icon_left
|
14
11
|
prop :icon_right
|
15
12
|
prop :image_url
|
@@ -18,7 +15,7 @@ module Playbook
|
|
18
15
|
default: "_self"
|
19
16
|
def classname
|
20
17
|
if collapsible
|
21
|
-
"pb_collapsible_nav_item #{generate_classname('pb_nav_list_kit_item', active_class
|
18
|
+
"pb_collapsible_nav_item #{generate_classname('pb_nav_list_kit_item', active_class)}"
|
22
19
|
else
|
23
20
|
generate_classname("pb_nav_list_kit_item", active_class)
|
24
21
|
end
|
@@ -30,7 +27,7 @@ module Playbook
|
|
30
27
|
|
31
28
|
def options
|
32
29
|
{
|
33
|
-
class:
|
30
|
+
class: "pb_nav_list_item_link",
|
34
31
|
}.compact
|
35
32
|
end
|
36
33
|
|
@@ -50,18 +47,6 @@ module Playbook
|
|
50
47
|
def active_class
|
51
48
|
active ? "active" : nil
|
52
49
|
end
|
53
|
-
|
54
|
-
def bold_class
|
55
|
-
bold ? "bold" : nil
|
56
|
-
end
|
57
|
-
|
58
|
-
def collapsible_trail_class
|
59
|
-
collapsible_trail ? "collapsible_trail" : nil
|
60
|
-
end
|
61
|
-
|
62
|
-
def emphasized_class
|
63
|
-
emphasized ? "emphasized" : nil
|
64
|
-
end
|
65
50
|
end
|
66
51
|
end
|
67
52
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= pb_rails("select", props: {
|
2
|
+
data: { options: "data_attribute" },
|
3
|
+
label: "Favorite Food",
|
4
|
+
name: "food",
|
5
|
+
options: [
|
6
|
+
{
|
7
|
+
value: "1",
|
8
|
+
value_text: "Burgers",
|
9
|
+
},
|
10
|
+
{
|
11
|
+
value: "2",
|
12
|
+
selected: true,
|
13
|
+
value_text: "Pizza",
|
14
|
+
},
|
15
|
+
{
|
16
|
+
value: "3",
|
17
|
+
value_text: "Tacos",
|
18
|
+
},
|
19
|
+
{
|
20
|
+
value: "4",
|
21
|
+
value_text: "BBQ",
|
22
|
+
},
|
23
|
+
]
|
24
|
+
}) %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Inspect the element and notice the data-attribute being added to the `<select>` element
|
@@ -1,5 +1,4 @@
|
|
1
1
|
<%= content_tag(:div,
|
2
|
-
data: object.data,
|
3
2
|
aria: object.aria,
|
4
3
|
class: object.classnames) do %>
|
5
4
|
<% if object.label %>
|
@@ -24,6 +23,7 @@
|
|
24
23
|
disabled: object.disabled,
|
25
24
|
required: object.required,
|
26
25
|
multiple: object.multiple,
|
26
|
+
data: object.data,
|
27
27
|
onchange: object.onchange,
|
28
28
|
include_blank: object.include_blank,
|
29
29
|
)
|