playbook_ui 12.39.0.pre.alpha.salesbookmismatchingdate1117 → 13.0.0.pre.alpha.PLAY966collapsiblenav41126
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/child_kits/CollapsibleMain.tsx +1 -1
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +41 -48
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +16 -14
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +86 -115
- data/app/pb_kits/playbook/pb_nav/_collapsible_trail_mixin.scss +14 -0
- data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +58 -57
- data/app/pb_kits/playbook/pb_nav/_item.tsx +234 -138
- data/app/pb_kits/playbook/pb_nav/_nav.scss +38 -0
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +17 -1
- data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +9 -11
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +50 -58
- data/app/pb_kits/playbook/pb_nav/docs/_block_no_title_nav.jsx +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_borderless_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +4 -4
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +4 -10
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx +5 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb +12 -12
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.jsx +13 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_no_highlight_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/_subtle_with_icons_nav.jsx +4 -1
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +5 -5
- data/app/pb_kits/playbook/pb_nav/item.html.erb +19 -12
- data/app/pb_kits/playbook/pb_nav/item.rb +55 -14
- data/app/pb_kits/playbook/pb_nav/nav.html.erb +3 -1
- data/app/pb_kits/playbook/pb_nav/navTypes.ts +25 -0
- data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
- data/dist/playbook-rails.js +2 -2
- data/lib/playbook/version.rb +2 -2
- metadata +4 -3
- data/app/pb_kits/playbook/pb_nav/_mixins.scss +0 -5
@@ -8,8 +8,8 @@
|
|
8
8
|
|
9
9
|
$selector: ".pb_nav_list";
|
10
10
|
|
11
|
-
[class^=pb_nav_list][class*=_horizontal] {
|
12
|
-
|
11
|
+
[class^="pb_nav_list"][class*="_horizontal"] {
|
12
|
+
.pb_nav_wrapper {
|
13
13
|
display: flex;
|
14
14
|
align-items: center;
|
15
15
|
padding: 0;
|
@@ -17,13 +17,13 @@ $selector: ".pb_nav_list";
|
|
17
17
|
list-style: none;
|
18
18
|
}
|
19
19
|
|
20
|
-
[class*=pb_nav_list_kit_item] {
|
20
|
+
[class*="pb_nav_list_kit_item"][class*="pb_nav_list_item"] {
|
21
21
|
transition-property: border-color;
|
22
22
|
transition-duration: 0.15s;
|
23
23
|
transition-timing-function: $bezier;
|
24
24
|
padding: 0;
|
25
25
|
|
26
|
-
[class*=_link] {
|
26
|
+
&[class*="_link"] {
|
27
27
|
text-decoration: none;
|
28
28
|
display: flex;
|
29
29
|
align-items: center;
|
@@ -36,19 +36,19 @@ $selector: ".pb_nav_list";
|
|
36
36
|
transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
|
37
37
|
color: $text_lt_default;
|
38
38
|
|
39
|
-
[class*=_icon_left] {
|
39
|
+
[class*="_icon_left"] {
|
40
40
|
font-size: $font_large;
|
41
41
|
margin-right: $space_sm;
|
42
42
|
color: $text_lt_lighter;
|
43
43
|
}
|
44
44
|
|
45
|
-
[class*=_text] {
|
45
|
+
[class*="_text"] {
|
46
46
|
font-size: $font_base;
|
47
|
-
font-weight: $bold;
|
48
47
|
color: $text_lt_default;
|
48
|
+
font-weight: $bold;
|
49
49
|
}
|
50
50
|
|
51
|
-
@media (hover:hover) {
|
51
|
+
@media (hover: hover) {
|
52
52
|
&:hover {
|
53
53
|
color: $primary;
|
54
54
|
#{$selector}_item_icon,
|
@@ -57,84 +57,85 @@ $selector: ".pb_nav_list";
|
|
57
57
|
}
|
58
58
|
}
|
59
59
|
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
60
|
+
&[class*="_active"] {
|
61
|
+
border-color: $primary;
|
62
|
+
[class*="_item_icon"] {
|
63
|
+
color: $text_lt_default;
|
64
|
+
}
|
65
|
+
[class*="_item_text"] {
|
66
|
+
color: $text_lt_default;
|
67
|
+
font-weight: $bold;
|
68
|
+
}
|
69
|
+
&:hover {
|
70
|
+
#{$selector}_item_icon,
|
71
|
+
#{$selector}_item_text {
|
72
|
+
color: $primary;
|
73
|
+
}
|
74
|
+
}
|
74
75
|
}
|
75
76
|
}
|
76
77
|
}
|
77
78
|
|
78
79
|
// Subtle Variant
|
79
|
-
&[class*=_subtle] {
|
80
|
+
&[class*="_subtle"] {
|
80
81
|
@include subtle;
|
81
82
|
// Horizontal Overrides
|
82
|
-
[class*=pb_nav_list_kit_item] {
|
83
|
+
[class*="pb_nav_list_kit_item"][class*="pb_nav_list_item"] {
|
83
84
|
margin: 0;
|
84
|
-
[class*=_item_text]{
|
85
|
-
font-weight: $regular;
|
86
|
-
}
|
87
|
-
}
|
88
|
-
[class*=_active] {
|
89
|
-
background-color: $active_light;
|
90
|
-
&[class*=dark] {
|
91
|
-
background-color: rgba($white, $opacity_1);
|
85
|
+
[class*="_item_text"] {
|
86
|
+
font-weight: $regular !important;
|
92
87
|
}
|
93
|
-
[class*=
|
94
|
-
|
95
|
-
|
88
|
+
&[class*="_active"] {
|
89
|
+
background-color: $active_light;
|
90
|
+
&[class*="dark"] {
|
91
|
+
background-color: rgba($white, $opacity_1);
|
92
|
+
[class*="_item_text"] {
|
93
|
+
color: $white !important;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
[class*="_item_text"] {
|
97
|
+
color: $primary !important;
|
96
98
|
}
|
97
99
|
}
|
98
100
|
}
|
99
101
|
}
|
100
102
|
|
101
103
|
// Bold Variant
|
102
|
-
&[class*=_bold] {
|
104
|
+
&[class*="_bold"] {
|
103
105
|
@include bold;
|
104
106
|
// Horizontal Overrides
|
105
|
-
[class*=pb_nav_list_kit_item] {
|
107
|
+
[class*="pb_nav_list_kit_item"][class*="pb_nav_list_item"] {
|
106
108
|
margin: 0;
|
107
|
-
[class*=_item_text]{
|
109
|
+
[class*="_item_text"] {
|
108
110
|
font-weight: $regular;
|
109
111
|
}
|
110
112
|
}
|
111
|
-
[class*=_active] {
|
112
|
-
[class*=_text] {
|
113
|
-
color: $white;
|
113
|
+
[class*="_active"] {
|
114
|
+
[class*="_text"] {
|
115
|
+
color: $white !important;
|
114
116
|
}
|
115
117
|
}
|
116
118
|
}
|
117
119
|
|
118
|
-
&[class*=dark]{
|
119
|
-
[class*=pb_nav_list_kit_item]{
|
120
|
-
|
121
|
-
|
122
|
-
}
|
123
|
-
&[class*=_active] [class*=_link]{
|
120
|
+
&[class*="dark"] {
|
121
|
+
[class*="pb_nav_list_kit_item"][class*="pb_nav_list_item"] {
|
122
|
+
border-color: rgba($white, $opacity_3);
|
123
|
+
&[class*="_active"] {
|
124
124
|
border-color: $active_dark;
|
125
|
-
[class*=_text],
|
125
|
+
[class*="_text"],
|
126
|
+
[class*="_icon"] {
|
126
127
|
color: $text_dk_default;
|
127
128
|
}
|
128
129
|
}
|
129
|
-
[class*=
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
130
|
+
[class*="_text"],
|
131
|
+
[class*="_icon"] {
|
132
|
+
color: $text_dk_lighter;
|
133
|
+
}
|
134
|
+
&:hover {
|
135
|
+
background-color: rgba($white, $opacity_1);
|
136
|
+
[class*="_icon"],
|
137
|
+
[class*="_text"] {
|
138
|
+
color: $white !important;
|
138
139
|
}
|
139
140
|
}
|
140
141
|
}
|
@@ -1,42 +1,64 @@
|
|
1
|
-
import React from
|
2
|
-
import classnames from
|
1
|
+
import React from "react";
|
2
|
+
import classnames from "classnames";
|
3
3
|
|
4
|
-
import { buildAriaProps, buildCss, buildDataProps } from
|
5
|
-
import { globalProps, GlobalProps } from
|
4
|
+
import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props";
|
5
|
+
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
6
6
|
|
7
|
-
import Icon from
|
8
|
-
import Image from
|
9
|
-
import Collapsible from
|
7
|
+
import Icon from "../pb_icon/_icon";
|
8
|
+
import Image from "../pb_image/_image";
|
9
|
+
import Collapsible from "../pb_collapsible/_collapsible";
|
10
|
+
import { NavChildProps } from "./navTypes";
|
11
|
+
import { Spacing } from "../types";
|
10
12
|
|
11
13
|
type NavItemProps = {
|
12
|
-
active?: boolean
|
13
|
-
aria?: { [key: string]: string }
|
14
|
-
fontWeight?: "regular" | "bold" | "bolder"
|
15
|
-
children?: React.ReactNode[] | React.ReactNode
|
16
|
-
className?: string
|
17
|
-
collapsible?: boolean
|
18
|
-
data?: object
|
19
|
-
dark?: boolean
|
20
|
-
fontSize?: "normal" | "small"
|
21
|
-
iconLeft?: string
|
22
|
-
iconRight?: string | string[]
|
23
|
-
onIconRightClick?: () => void
|
24
|
-
onIconLeftClick?: () => void
|
25
|
-
id?: string
|
26
|
-
imageUrl?: string
|
27
|
-
link?: string
|
28
|
-
onClick?: () => void
|
29
|
-
target?:
|
30
|
-
text: string
|
31
|
-
collapsibleTrail?: boolean
|
32
|
-
collapsed?: boolean
|
33
|
-
|
14
|
+
active?: boolean;
|
15
|
+
aria?: { [key: string]: string };
|
16
|
+
fontWeight?: "regular" | "bold" | "bolder";
|
17
|
+
children?: React.ReactNode[] | React.ReactNode;
|
18
|
+
className?: string;
|
19
|
+
collapsible?: boolean;
|
20
|
+
data?: object;
|
21
|
+
dark?: boolean;
|
22
|
+
fontSize?: "normal" | "small";
|
23
|
+
iconLeft?: string;
|
24
|
+
iconRight?: string | string[];
|
25
|
+
onIconRightClick?: () => void;
|
26
|
+
onIconLeftClick?: () => void;
|
27
|
+
id?: string;
|
28
|
+
imageUrl?: string;
|
29
|
+
link?: string;
|
30
|
+
onClick?: () => void;
|
31
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
32
|
+
text: string;
|
33
|
+
collapsibleTrail?: boolean;
|
34
|
+
collapsed?: boolean;
|
35
|
+
orientation?: "vertical" | "horizontal";
|
36
|
+
variant?: "normal" | "subtle";
|
37
|
+
margin?: Spacing;
|
38
|
+
marginBottom?: Spacing;
|
39
|
+
marginTop?: Spacing;
|
40
|
+
marginRight?: Spacing;
|
41
|
+
marginLeft?: Spacing;
|
42
|
+
marginX?: Spacing;
|
43
|
+
marginY?: Spacing;
|
44
|
+
} & GlobalProps;
|
34
45
|
|
35
46
|
const NavItem = (props: NavItemProps) => {
|
47
|
+
|
48
|
+
const fontWeightDefault = (orientation: string, variant: string) => {
|
49
|
+
return orientation === "horizontal" && variant === "subtle"
|
50
|
+
? "regular "
|
51
|
+
: orientation === "horizontal" && variant === "normal"
|
52
|
+
? "bold"
|
53
|
+
: "regular";
|
54
|
+
};
|
55
|
+
|
36
56
|
const {
|
37
57
|
active = false,
|
38
58
|
aria = {},
|
39
|
-
|
59
|
+
orientation,
|
60
|
+
variant,
|
61
|
+
fontWeight = fontWeightDefault(orientation, variant),
|
40
62
|
children,
|
41
63
|
className,
|
42
64
|
collapsible,
|
@@ -50,129 +72,204 @@ const NavItem = (props: NavItemProps) => {
|
|
50
72
|
id,
|
51
73
|
imageUrl,
|
52
74
|
link,
|
53
|
-
onClick = () => {
|
54
|
-
target =
|
55
|
-
text =
|
75
|
+
onClick = () => {},
|
76
|
+
target = "_self",
|
77
|
+
text = "",
|
56
78
|
collapsibleTrail,
|
57
|
-
collapsed
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
+
collapsed,
|
80
|
+
itemSpacing,
|
81
|
+
margin,
|
82
|
+
marginBottom,
|
83
|
+
marginTop,
|
84
|
+
marginRight,
|
85
|
+
marginLeft,
|
86
|
+
marginX,
|
87
|
+
marginY,
|
88
|
+
} = props;
|
89
|
+
|
90
|
+
const spacingMarginProps = {
|
91
|
+
margin,
|
92
|
+
marginBottom,
|
93
|
+
marginTop,
|
94
|
+
marginRight,
|
95
|
+
marginLeft,
|
96
|
+
marginX,
|
97
|
+
marginY,
|
98
|
+
};
|
99
|
+
|
100
|
+
//separate margin props and padding props in itemSpacing object
|
101
|
+
const filterItemSpacing = (obj: { [key: string]: string }) => {
|
102
|
+
const filteredPadding: { [key: string]: string } = {};
|
103
|
+
const filteredMargin: { [key: string]: string } = {};
|
104
|
+
for (const key in obj) {
|
105
|
+
if (key.startsWith('padding')) {
|
106
|
+
filteredPadding[key] = obj[key];
|
107
|
+
} else if (key.startsWith('margin')) {
|
108
|
+
filteredMargin[key] = obj[key];
|
79
109
|
}
|
80
110
|
}
|
111
|
+
return { filteredPadding, filteredMargin };
|
112
|
+
};
|
113
|
+
|
114
|
+
//deconstruct itemSpacing
|
115
|
+
const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
116
|
+
|
117
|
+
//if itemSpacing has margin props, apply those, if margin global props passed to navItem itself, navItem props take precendence
|
118
|
+
const finalItemSpacing = {
|
119
|
+
...(filteredMargin || {}),
|
120
|
+
...Object.entries(spacingMarginProps).reduce((acc: any, [prop, value]) => {
|
121
|
+
if (value) {
|
122
|
+
acc[prop] = value;
|
123
|
+
}
|
124
|
+
return acc;
|
125
|
+
}, {}),
|
126
|
+
};
|
127
|
+
|
128
|
+
//custom for collapsible only, to apply margin to correct div
|
129
|
+
const filteredProps = { ...props };
|
130
|
+
delete filteredProps?.margin;
|
131
|
+
delete filteredProps?.marginX;
|
132
|
+
delete filteredProps?.marginY;
|
133
|
+
delete filteredProps?.marginBottom;
|
134
|
+
delete filteredProps?.marginTop;
|
135
|
+
delete filteredProps?.marginRight;
|
136
|
+
delete filteredProps?.marginLeft;
|
137
|
+
|
138
|
+
|
139
|
+
const Tag = link ? "a" : "div";
|
140
|
+
const activeClass = active === true ? "active" : "";
|
141
|
+
const collapsibleTrailClass =
|
142
|
+
collapsible && collapsibleTrail ? "collapsible_trail" : "";
|
143
|
+
const fontSizeClass =
|
144
|
+
fontSize === "small" ? "font_size_small" : "font_size_normal";
|
145
|
+
const fontWeightClass =
|
146
|
+
fontWeight === "bold"
|
147
|
+
? "font_bold"
|
148
|
+
: fontWeight === "bolder"
|
149
|
+
? "font_bolder"
|
150
|
+
: "font_regular";
|
151
|
+
const ariaProps = buildAriaProps(aria);
|
152
|
+
const dataProps = buildDataProps(data);
|
153
|
+
|
154
|
+
const tagClasses = classnames(
|
155
|
+
collapsible ? "pb_nav_list_item_link_collapsible" : "pb_nav_list_item_link",
|
156
|
+
);
|
157
|
+
|
158
|
+
const classes = classnames(
|
159
|
+
buildCss("pb_nav_list_kit_item", activeClass),
|
160
|
+
collapsible
|
161
|
+
? buildCss("pb_collapsible_nav_item", activeClass)
|
162
|
+
: "",
|
163
|
+
fontSizeClass,
|
164
|
+
fontWeightClass,
|
165
|
+
tagClasses,
|
166
|
+
collapsible ? globalProps(filteredProps, {...filteredPadding}) : globalProps(props, {...itemSpacing}),
|
167
|
+
className
|
168
|
+
);
|
169
|
+
|
170
|
+
const handleIconClick = (e: any) => {
|
171
|
+
if (onIconLeftClick) {
|
172
|
+
e.stopPropagation();
|
173
|
+
onIconLeftClick();
|
174
|
+
}
|
175
|
+
};
|
176
|
+
|
177
|
+
|
178
|
+
// Map over the children and clone them with itemSpacing prop so nested navItems all get itemSpacing
|
179
|
+
const childrenWithProps = React.Children.map(children, (child) => {
|
180
|
+
if (React.isValidElement(child)) {
|
181
|
+
const childProps: NavChildProps = {
|
182
|
+
itemSpacing: itemSpacing,
|
183
|
+
};
|
184
|
+
return React.cloneElement(child, childProps);
|
185
|
+
}
|
186
|
+
return child;
|
187
|
+
});
|
81
188
|
|
82
189
|
return (
|
83
|
-
|
84
|
-
{
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
collapsible ? (
|
91
|
-
<Collapsible icon={iconRight ? iconRight : ['plus','minus']}
|
92
|
-
iconSize="xs"
|
190
|
+
<>
|
191
|
+
{collapsible ? (
|
192
|
+
<>
|
193
|
+
<Collapsible
|
194
|
+
className={`collapsible_nav_wrapper_${activeClass}_${collapsibleTrailClass}`}
|
195
|
+
icon={iconRight && iconRight}
|
196
|
+
iconSize="xs"
|
93
197
|
id={id}
|
94
198
|
collapsed={collapsed}
|
95
199
|
onIconClick={onIconRightClick}
|
96
200
|
onClick={onClick}
|
97
201
|
>
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
202
|
+
<Collapsible.Main
|
203
|
+
className={globalProps({ ...finalItemSpacing })}
|
204
|
+
dark={dark}>
|
205
|
+
<Tag
|
206
|
+
{...ariaProps}
|
207
|
+
{...dataProps}
|
208
|
+
className={classes}
|
209
|
+
id={id}
|
210
|
+
href={link}
|
211
|
+
target={target}
|
212
|
+
>
|
213
|
+
{imageUrl && (
|
214
|
+
<div
|
215
|
+
className="pb_nav_list_item_icon_section_collapsible"
|
216
|
+
key={imageUrl}
|
217
|
+
onClick={(e) => handleIconClick(e)}
|
218
|
+
>
|
219
|
+
<Image className="pb_nav_img_wrapper" url={imageUrl} />
|
220
|
+
</div>
|
221
|
+
)}
|
222
|
+
|
223
|
+
{iconLeft && (
|
224
|
+
<div
|
225
|
+
className="pb_nav_list_item_icon_section_collapsible"
|
226
|
+
key={iconLeft}
|
227
|
+
onClick={(e) => handleIconClick(e)}
|
228
|
+
>
|
229
|
+
<Icon
|
230
|
+
className="pb_nav_list_item_icon_left_collapsible"
|
231
|
+
fixedWidth
|
232
|
+
icon={iconLeft}
|
233
|
+
/>
|
234
|
+
</div>
|
235
|
+
)}
|
236
|
+
<span className="pb_nav_list_item_text_collapsible">
|
237
|
+
{text}
|
238
|
+
</span>
|
239
|
+
</Tag>
|
240
|
+
</Collapsible.Main>
|
241
|
+
<Collapsible.Content>{childrenWithProps}</Collapsible.Content>
|
242
|
+
</Collapsible>
|
243
|
+
</>
|
244
|
+
) : (
|
140
245
|
<Tag
|
141
|
-
|
246
|
+
{...ariaProps}
|
247
|
+
{...dataProps}
|
248
|
+
className={classes}
|
249
|
+
id={id}
|
142
250
|
href={link}
|
143
251
|
onClick={onClick}
|
144
252
|
target={target}
|
145
253
|
>
|
146
|
-
{imageUrl &&
|
147
|
-
<div
|
148
|
-
className="
|
149
|
-
key={imageUrl}
|
150
|
-
>
|
151
|
-
<Image
|
152
|
-
className="pb_nav_img_wrapper"
|
153
|
-
url={imageUrl}
|
154
|
-
/>
|
254
|
+
{imageUrl && (
|
255
|
+
<div className="pb_nav_list_item_icon_section" key={imageUrl}>
|
256
|
+
<Image className="pb_nav_img_wrapper" url={imageUrl} />
|
155
257
|
</div>
|
156
|
-
}
|
157
|
-
|
158
|
-
{iconLeft &&
|
159
|
-
<div
|
160
|
-
className="pb_nav_list_item_icon_section"
|
161
|
-
key={iconLeft}
|
162
|
-
>
|
258
|
+
)}
|
259
|
+
|
260
|
+
{iconLeft && (
|
261
|
+
<div className="pb_nav_list_item_icon_section" key={iconLeft}>
|
163
262
|
<Icon
|
164
263
|
className="pb_nav_list_item_icon_left"
|
165
264
|
fixedWidth
|
166
265
|
icon={iconLeft}
|
167
266
|
/>
|
168
267
|
</div>
|
169
|
-
}
|
170
|
-
|
171
|
-
<span className="pb_nav_list_item_text">
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
{iconRight &&
|
268
|
+
)}
|
269
|
+
|
270
|
+
<span className="pb_nav_list_item_text">{text || children}</span>
|
271
|
+
|
272
|
+
{iconRight && (
|
176
273
|
<div
|
177
274
|
className="pb_nav_list_item_icon_section"
|
178
275
|
key={iconRight as string}
|
@@ -183,12 +280,11 @@ const NavItem = (props: NavItemProps) => {
|
|
183
280
|
icon={iconRight as string}
|
184
281
|
/>
|
185
282
|
</div>
|
186
|
-
}
|
283
|
+
)}
|
187
284
|
</Tag>
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
}
|
285
|
+
)}
|
286
|
+
</>
|
287
|
+
);
|
288
|
+
};
|
193
289
|
|
194
|
-
export default NavItem
|
290
|
+
export default NavItem;
|
@@ -5,3 +5,41 @@
|
|
5
5
|
@import "./vertical_nav";
|
6
6
|
@import "./horizontal_nav";
|
7
7
|
@import "./collapsible_nav";
|
8
|
+
|
9
|
+
[class^="pb_nav_list"] {
|
10
|
+
//classes for fontSize and fontWeight props
|
11
|
+
.font_size_small {
|
12
|
+
.pb_nav_list_item_text,
|
13
|
+
.pb_nav_list_item_text_collapsible {
|
14
|
+
font-size: $font_small !important;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.font_size_normal {
|
19
|
+
.pb_nav_list_item_text,
|
20
|
+
.pb_nav_list_item_text_collapsible {
|
21
|
+
font-size: $font_normal !important;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
.font_bolder {
|
26
|
+
.pb_nav_list_item_text,
|
27
|
+
.pb_nav_list_item_text_collapsible {
|
28
|
+
font-weight: $bolder !important;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
.font_bold {
|
33
|
+
.pb_nav_list_item_text,
|
34
|
+
.pb_nav_list_item_text_collapsible {
|
35
|
+
font-weight: $bold !important;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
.font_regular {
|
40
|
+
.pb_nav_list_item_text,
|
41
|
+
.pb_nav_list_item_text_collapsible {
|
42
|
+
font-weight: $regular;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|