playbook_ui 15.4.0.pre.alpha.PLAY1541responsivefloorPOC12370 → 15.4.0.pre.alpha.PLAY2429datepickeropenonscreenstatic12263
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +11 -25
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +13 -20
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +4 -6
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +0 -17
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_date_range_inline/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +4 -6
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +3 -2
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +5 -11
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.test.js +9 -26
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year.html.erb +5 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/{_date_stacked_current_year.jsx → _date_stacked_not_current_year.jsx} +5 -6
- data/app/pb_kits/playbook/pb_date_stacked/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/index.js +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +9 -31
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +5 -12
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.jsx +0 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +4 -18
- data/app/pb_kits/playbook/pb_nav/_nav.scss +5 -30
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +0 -192
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -3
- data/app/pb_kits/playbook/pb_nav/item.html.erb +4 -6
- data/app/pb_kits/playbook/pb_nav/item.rb +2 -11
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +1 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +1 -3
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +8 -61
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +2 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +11 -19
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +7 -16
- data/app/pb_kits/playbook/tokens/_screen_sizes.scss +0 -24
- data/app/pb_kits/playbook/utilities/_mixins.scss +4 -19
- data/dist/chunks/{_line_graph-8BUASxIP.js → _line_graph-W9CX7Xbp.js} +1 -1
- data/dist/chunks/_typeahead-L4SF9E6a.js +6 -0
- data/dist/chunks/{_weekday_stacked-EQMaMJvC.js → _weekday_stacked-DOs7l1vE.js} +3 -3
- data/dist/chunks/{lib-CzQFzKzw.js → lib-COXg9aPA.js} +1 -1
- data/dist/chunks/{pb_form_validation-Bf9TK15t.js → pb_form_validation-DR765aoq.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +19 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +9 -27
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.jsx +0 -43
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.html.erb +0 -12
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.html.erb +0 -21
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.jsx +0 -113
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.md +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.html.erb +0 -30
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.jsx +0 -117
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +0 -11
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +0 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +0 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default_rails.md +0 -7
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline_rails.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky_rails.md +0 -1
- data/dist/chunks/_typeahead-DESMSfUO.js +0 -24
|
@@ -2,7 +2,6 @@ import React from 'react'
|
|
|
2
2
|
import classnames from 'classnames'
|
|
3
3
|
import { buildCss, buildHtmlProps } from '../utilities/props'
|
|
4
4
|
import { globalProps, GlobalProps, globalInlineProps} from '../utilities/globalProps'
|
|
5
|
-
|
|
6
5
|
type FlexItemPropTypes = {
|
|
7
6
|
children: React.ReactNode[] | React.ReactNode,
|
|
8
7
|
fixedSize?: string,
|
|
@@ -29,28 +28,22 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
|
|
|
29
28
|
alignSelf,
|
|
30
29
|
displayFlex
|
|
31
30
|
} = props
|
|
32
|
-
|
|
33
31
|
const growClass = grow === true ? 'pb_flex_item_kit_grow' : ''
|
|
34
32
|
const displayFlexClass = displayFlex === true ? 'pb_flex_item_kit_display_flex' : ''
|
|
35
33
|
const flexClass = flex !== 'none' ? `pb_flex_item_kit_flex_${flex}` : ''
|
|
36
34
|
const shrinkClass = shrink === true ? 'pb_flex_item_kit_shrink' : ''
|
|
37
35
|
const alignSelfClass = alignSelf ? `pb_flex_item_kit_align_self_${alignSelf}` : ''
|
|
38
|
-
const fixedStyle =
|
|
36
|
+
const fixedStyle =
|
|
37
|
+
fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null
|
|
39
38
|
const orderClass = order !== 'none' ? `pb_flex_item_kit_order_${order}` : ''
|
|
40
39
|
const dynamicInlineProps = globalInlineProps(props)
|
|
41
|
-
|
|
42
|
-
// Extract style from htmlOptions and remove it
|
|
43
|
-
const { style: htmlStyle, ...htmlOptionsWithoutStyle } = htmlOptions
|
|
44
|
-
const htmlStyleObj = htmlStyle && typeof htmlStyle === 'object' ? htmlStyle : {}
|
|
45
|
-
|
|
46
|
-
// Merge all styles
|
|
47
40
|
const combinedStyles = {
|
|
48
|
-
...htmlStyleObj,
|
|
49
41
|
...fixedStyle,
|
|
50
42
|
...dynamicInlineProps
|
|
51
43
|
}
|
|
52
44
|
|
|
53
|
-
const htmlProps = buildHtmlProps(
|
|
45
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
|
46
|
+
|
|
54
47
|
|
|
55
48
|
return (
|
|
56
49
|
<div
|
|
@@ -73,4 +66,4 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
|
|
|
73
66
|
)
|
|
74
67
|
}
|
|
75
68
|
|
|
76
|
-
export default FlexItem
|
|
69
|
+
export default FlexItem
|
|
@@ -43,7 +43,6 @@ type NavItemProps = {
|
|
|
43
43
|
marginLeft?: Spacing;
|
|
44
44
|
marginX?: Spacing;
|
|
45
45
|
marginY?: Spacing;
|
|
46
|
-
disabled?: boolean;
|
|
47
46
|
} & GlobalProps;
|
|
48
47
|
|
|
49
48
|
const NavItem = (props: NavItemProps) => {
|
|
@@ -90,7 +89,6 @@ const NavItem = (props: NavItemProps) => {
|
|
|
90
89
|
marginLeft,
|
|
91
90
|
marginX,
|
|
92
91
|
marginY,
|
|
93
|
-
disabled = false,
|
|
94
92
|
} = props;
|
|
95
93
|
|
|
96
94
|
const spacingMarginProps = {
|
|
@@ -142,12 +140,11 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
|
142
140
|
delete filteredProps?.marginLeft;
|
|
143
141
|
|
|
144
142
|
|
|
145
|
-
const isLink = !!link
|
|
143
|
+
const isLink = !!link
|
|
146
144
|
const Tag = isLink ? "a" : "div"
|
|
147
145
|
const activeClass = active === true ? "active" : "";
|
|
148
146
|
const highlightedBorderClass = active === true && highlighted_border === false ? "highlighted_border_none" : "";
|
|
149
147
|
const collapsibleTrailClass = collapsible && collapsibleTrail ? "collapsible_trail" : "";
|
|
150
|
-
const disabledClass = disabled ? "pb_nav_item_disabled" : "";
|
|
151
148
|
|
|
152
149
|
const fontSizeMapping = {
|
|
153
150
|
"small": "font_size_small",
|
|
@@ -180,7 +177,6 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
|
180
177
|
fontWeightClass,
|
|
181
178
|
tagClasses,
|
|
182
179
|
collapsible ? globalProps(filteredProps, {...filteredPadding}) : globalProps(props, {...itemSpacing}),
|
|
183
|
-
disabledClass,
|
|
184
180
|
className
|
|
185
181
|
);
|
|
186
182
|
|
|
@@ -206,21 +202,12 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
|
206
202
|
const collapsibleClasses = buildCss("collapsible_nav_wrapper", activeClass, highlightedBorderClass, collapsibleTrailClass)
|
|
207
203
|
|
|
208
204
|
const handleKeyDown = (e: React.KeyboardEvent) => {
|
|
209
|
-
if (!
|
|
205
|
+
if (!isLink && (e.key === "Enter" || e.key === " ")) {
|
|
210
206
|
e.preventDefault()
|
|
211
207
|
onClick?.()
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
210
|
|
|
215
|
-
const handleClick = (e: React.MouseEvent) => {
|
|
216
|
-
if (disabled) {
|
|
217
|
-
e.preventDefault()
|
|
218
|
-
e.stopPropagation()
|
|
219
|
-
return
|
|
220
|
-
}
|
|
221
|
-
onClick?.()
|
|
222
|
-
}
|
|
223
|
-
|
|
224
211
|
return (
|
|
225
212
|
<>
|
|
226
213
|
{collapsible ? (
|
|
@@ -288,14 +275,13 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
|
288
275
|
{...ariaProps}
|
|
289
276
|
{...dataProps}
|
|
290
277
|
{...htmlProps}
|
|
291
|
-
aria-disabled={disabled}
|
|
292
278
|
className={classes}
|
|
293
279
|
href={isLink ? link : undefined}
|
|
294
280
|
id={id}
|
|
295
|
-
onClick={
|
|
281
|
+
onClick={onClick}
|
|
296
282
|
onKeyDown={!isLink ? handleKeyDown : undefined}
|
|
297
283
|
role={!isLink ? "button" : undefined}
|
|
298
|
-
tabIndex={
|
|
284
|
+
tabIndex={!isLink ? 0 : undefined}
|
|
299
285
|
target={isLink ? target : undefined}
|
|
300
286
|
>
|
|
301
287
|
{imageUrl && (
|
|
@@ -45,18 +45,16 @@
|
|
|
45
45
|
|
|
46
46
|
[class*="pb_nav_list_kit_item"],
|
|
47
47
|
[class*="pb_nav_list_item"] {
|
|
48
|
-
&:hover {
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
}
|
|
48
|
+
&:hover { cursor: pointer; }
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
|
|
54
52
|
.pb_nav_extended_underline {
|
|
55
53
|
position: relative;
|
|
56
|
-
|
|
54
|
+
|
|
57
55
|
// Add full-width border using pseudo-element so as not to break the active item border
|
|
58
56
|
&::after {
|
|
59
|
-
content:
|
|
57
|
+
content: '';
|
|
60
58
|
position: absolute;
|
|
61
59
|
bottom: 0;
|
|
62
60
|
left: 0;
|
|
@@ -67,8 +65,8 @@
|
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
.pb_nav_list_kit_item_active.pb_nav_list_item_link {
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
position: relative;
|
|
69
|
+
z-index: 2;
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
&.dark {
|
|
@@ -77,26 +75,3 @@
|
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
}
|
|
80
|
-
|
|
81
|
-
// Disabled scss
|
|
82
|
-
.pb_nav_item_disabled {
|
|
83
|
-
cursor: not-allowed !important;
|
|
84
|
-
.pb_nav_list_item_text,
|
|
85
|
-
.pb_nav_list_item_icon_left,
|
|
86
|
-
.pb_nav_list_item_icon_right,
|
|
87
|
-
.pb_nav_list_item_icon_section {
|
|
88
|
-
color: $text_lt_lighter !important;
|
|
89
|
-
cursor: not-allowed !important;
|
|
90
|
-
}
|
|
91
|
-
@media (hover: hover) {
|
|
92
|
-
&:hover {
|
|
93
|
-
background-color: unset !important;
|
|
94
|
-
color: $text_lt_lighter !important;
|
|
95
|
-
.pb_nav_list_item_text,
|
|
96
|
-
.pb_nav_list_item_icon_left,
|
|
97
|
-
.pb_nav_list_item_icon_right {
|
|
98
|
-
color: $text_lt_lighter !important;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -5,8 +5,6 @@ import Nav from './_nav'
|
|
|
5
5
|
import NavItem from './_item'
|
|
6
6
|
|
|
7
7
|
const navTestId = 'nav'
|
|
8
|
-
const navDisabledTestId = 'nav-disabled'
|
|
9
|
-
const itemDisabledTestId = 'item-disabled'
|
|
10
8
|
const itemTestId = 'item'
|
|
11
9
|
const activeTestBorderlessId = 'activeborderless'
|
|
12
10
|
const activeTestBorderId = 'active'
|
|
@@ -107,193 +105,3 @@ test('should have a left icon', () => {
|
|
|
107
105
|
const icon = kit.querySelector(".pb_custom_icon.pb_nav_list_item_icon_left")
|
|
108
106
|
expect(icon).toBeInTheDocument()
|
|
109
107
|
})
|
|
110
|
-
|
|
111
|
-
test('should apply disabled class when disabled (horizontal nav)', () => {
|
|
112
|
-
[
|
|
113
|
-
"default",
|
|
114
|
-
"subtle",
|
|
115
|
-
"bold"
|
|
116
|
-
].forEach((variant) => {
|
|
117
|
-
render(
|
|
118
|
-
<Nav
|
|
119
|
-
aria={{ label: navDisabledTestId }}
|
|
120
|
-
className={navClassName}
|
|
121
|
-
data={{ testid: navDisabledTestId }}
|
|
122
|
-
orientation="horizontal"
|
|
123
|
-
variant={variant}
|
|
124
|
-
>
|
|
125
|
-
<NavItem
|
|
126
|
-
aria={{ label: `${itemDisabledTestId}-${variant}` }}
|
|
127
|
-
className={itemClassName}
|
|
128
|
-
data={{ testid: `${itemDisabledTestId}-${variant}` }}
|
|
129
|
-
disabled
|
|
130
|
-
link="#"
|
|
131
|
-
text="Files"
|
|
132
|
-
/>
|
|
133
|
-
</Nav>
|
|
134
|
-
)
|
|
135
|
-
const kit = screen.getByTestId(`${itemDisabledTestId}-${variant}`)
|
|
136
|
-
expect(kit).toHaveClass('pb_nav_item_disabled')
|
|
137
|
-
})
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
test('should set aria-disabled when disabled (horizontal nav)', () => {
|
|
141
|
-
[
|
|
142
|
-
"default",
|
|
143
|
-
"subtle",
|
|
144
|
-
"bold"
|
|
145
|
-
].forEach((variant) => {
|
|
146
|
-
render(
|
|
147
|
-
<Nav
|
|
148
|
-
aria={{ label: navDisabledTestId }}
|
|
149
|
-
className={navClassName}
|
|
150
|
-
data={{ testid: navDisabledTestId }}
|
|
151
|
-
orientation="horizontal"
|
|
152
|
-
variant={variant}
|
|
153
|
-
>
|
|
154
|
-
<NavItem
|
|
155
|
-
aria={{ label: `${itemDisabledTestId}-${variant}` }}
|
|
156
|
-
className={itemClassName}
|
|
157
|
-
data={{ testid: `${itemDisabledTestId}-${variant}` }}
|
|
158
|
-
disabled
|
|
159
|
-
link="#"
|
|
160
|
-
text="Files"
|
|
161
|
-
/>
|
|
162
|
-
</Nav>
|
|
163
|
-
)
|
|
164
|
-
const item = screen.getByTestId(`${itemDisabledTestId}-${variant}`)
|
|
165
|
-
expect(item).toHaveAttribute('aria-disabled', 'true')
|
|
166
|
-
})
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
test('should set tabIndex to -1 when disabled (horizontal nav)', () => {
|
|
170
|
-
[
|
|
171
|
-
"default",
|
|
172
|
-
"subtle",
|
|
173
|
-
"bold"
|
|
174
|
-
].forEach((variant) => {
|
|
175
|
-
render(
|
|
176
|
-
<Nav
|
|
177
|
-
aria={{ label: navDisabledTestId }}
|
|
178
|
-
className={navClassName}
|
|
179
|
-
data={{ testid: navDisabledTestId }}
|
|
180
|
-
orientation="horizontal"
|
|
181
|
-
variant={variant}
|
|
182
|
-
>
|
|
183
|
-
<NavItem
|
|
184
|
-
aria={{ label: `${itemDisabledTestId}-${variant}` }}
|
|
185
|
-
className={itemClassName}
|
|
186
|
-
data={{ testid: `${itemDisabledTestId}-${variant}` }}
|
|
187
|
-
disabled
|
|
188
|
-
link="#"
|
|
189
|
-
text="Files"
|
|
190
|
-
/>
|
|
191
|
-
</Nav>
|
|
192
|
-
)
|
|
193
|
-
const kit = screen.getByTestId(`${itemDisabledTestId}-${variant}`)
|
|
194
|
-
expect(kit).toHaveAttribute('tabIndex', '-1')
|
|
195
|
-
})
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
test('should prevent onClick when disabled', () => {
|
|
199
|
-
const handleClick = jest.fn()
|
|
200
|
-
render(
|
|
201
|
-
<NavItem
|
|
202
|
-
data={{ testid: 'disabled-click-item' }}
|
|
203
|
-
disabled
|
|
204
|
-
link="#"
|
|
205
|
-
onClick={handleClick}
|
|
206
|
-
text="Disabled Item"
|
|
207
|
-
/>
|
|
208
|
-
)
|
|
209
|
-
const kit = screen.getByTestId('disabled-click-item')
|
|
210
|
-
kit.click()
|
|
211
|
-
expect(handleClick).not.toHaveBeenCalled()
|
|
212
|
-
})
|
|
213
|
-
|
|
214
|
-
test('should apply disabled class when disabled (vertical nav)', () => {
|
|
215
|
-
[
|
|
216
|
-
"default",
|
|
217
|
-
"subtle",
|
|
218
|
-
"bold"
|
|
219
|
-
].forEach((variant) => {
|
|
220
|
-
render(
|
|
221
|
-
<Nav
|
|
222
|
-
aria={{ label: navDisabledTestId }}
|
|
223
|
-
className={navClassName}
|
|
224
|
-
data={{ testid: navDisabledTestId }}
|
|
225
|
-
orientation="vertical"
|
|
226
|
-
variant={variant}
|
|
227
|
-
>
|
|
228
|
-
<NavItem
|
|
229
|
-
aria={{ label: `${itemDisabledTestId}-${variant}` }}
|
|
230
|
-
className={itemClassName}
|
|
231
|
-
data={{ testid: `${itemDisabledTestId}-${variant}` }}
|
|
232
|
-
disabled
|
|
233
|
-
link="#"
|
|
234
|
-
text="Files"
|
|
235
|
-
/>
|
|
236
|
-
</Nav>
|
|
237
|
-
)
|
|
238
|
-
const kit = screen.getByTestId(`${itemDisabledTestId}-${variant}`)
|
|
239
|
-
expect(kit).toHaveClass('pb_nav_item_disabled')
|
|
240
|
-
})
|
|
241
|
-
})
|
|
242
|
-
|
|
243
|
-
test('should set aria-disabled when disabled (vertical nav)', () => {
|
|
244
|
-
[
|
|
245
|
-
"default",
|
|
246
|
-
"subtle",
|
|
247
|
-
"bold"
|
|
248
|
-
].forEach((variant) => {
|
|
249
|
-
render(
|
|
250
|
-
<Nav
|
|
251
|
-
aria={{ label: navDisabledTestId }}
|
|
252
|
-
className={navClassName}
|
|
253
|
-
data={{ testid: navDisabledTestId }}
|
|
254
|
-
orientation="vertical"
|
|
255
|
-
variant={variant}
|
|
256
|
-
>
|
|
257
|
-
<NavItem
|
|
258
|
-
aria={{ label: `${itemDisabledTestId}-${variant}` }}
|
|
259
|
-
className={itemClassName}
|
|
260
|
-
data={{ testid: `${itemDisabledTestId}-${variant}` }}
|
|
261
|
-
disabled
|
|
262
|
-
link="#"
|
|
263
|
-
text="Files"
|
|
264
|
-
/>
|
|
265
|
-
</Nav>
|
|
266
|
-
)
|
|
267
|
-
const item = screen.getByTestId(`${itemDisabledTestId}-${variant}`)
|
|
268
|
-
expect(item).toHaveAttribute('aria-disabled', 'true')
|
|
269
|
-
})
|
|
270
|
-
})
|
|
271
|
-
|
|
272
|
-
test('should set tabIndex to -1 when disabled (vertical nav)', () => {
|
|
273
|
-
[
|
|
274
|
-
"default",
|
|
275
|
-
"subtle",
|
|
276
|
-
"bold"
|
|
277
|
-
].forEach((variant) => {
|
|
278
|
-
render(
|
|
279
|
-
<Nav
|
|
280
|
-
aria={{ label: navDisabledTestId }}
|
|
281
|
-
className={navClassName}
|
|
282
|
-
data={{ testid: navDisabledTestId }}
|
|
283
|
-
orientation="vertical"
|
|
284
|
-
variant={variant}
|
|
285
|
-
>
|
|
286
|
-
<NavItem
|
|
287
|
-
aria={{ label: `${itemDisabledTestId}-${variant}` }}
|
|
288
|
-
className={itemClassName}
|
|
289
|
-
data={{ testid: `${itemDisabledTestId}-${variant}` }}
|
|
290
|
-
disabled
|
|
291
|
-
link="#"
|
|
292
|
-
text="Files"
|
|
293
|
-
/>
|
|
294
|
-
</Nav>
|
|
295
|
-
)
|
|
296
|
-
const kit = screen.getByTestId(`${itemDisabledTestId}-${variant}`)
|
|
297
|
-
expect(kit).toHaveAttribute('tabIndex', '-1')
|
|
298
|
-
})
|
|
299
|
-
})
|
|
@@ -44,7 +44,7 @@ $selector: ".pb_nav_list";
|
|
|
44
44
|
transition-duration: 0.15s;
|
|
45
45
|
transition-timing-function: $bezier;
|
|
46
46
|
@media (hover: hover) {
|
|
47
|
-
&:hover
|
|
47
|
+
&:hover {
|
|
48
48
|
background-color: rgba($primary, 0.03);
|
|
49
49
|
[class*="_icon"] {
|
|
50
50
|
color: $primary;
|
|
@@ -18,8 +18,6 @@ examples:
|
|
|
18
18
|
- subtle_horizontal_nav: Subtle Horizontal Nav
|
|
19
19
|
- bold_horizontal_nav: Bold Horizontal Nav
|
|
20
20
|
- horizontal_nav_extendedunderline: Horizontal Nav With Extended Underline
|
|
21
|
-
- horizontal_nav_disabled: Horizontal Nav With Disabled Item
|
|
22
|
-
- vertical_nav_disabled: Vertical Nav With Disabled Item
|
|
23
21
|
- block_nav: Block
|
|
24
22
|
- block_no_title_nav: Without Title
|
|
25
23
|
- new_tab: Open in a New Tab
|
|
@@ -46,8 +44,6 @@ examples:
|
|
|
46
44
|
- subtle_horizontal_nav: Subtle Horizontal Nav
|
|
47
45
|
- bold_horizontal_nav: Bold Horizontal Nav
|
|
48
46
|
- horizontal_nav_extendedunderline: Horizontal Nav With Extended Underline
|
|
49
|
-
- horizontal_nav_disabled: Horizontal Nav With Disabled Item
|
|
50
|
-
- vertical_nav_disabled: Vertical Nav With Disabled Item
|
|
51
47
|
- block_nav: Block
|
|
52
48
|
- block_no_title_nav: Without Title
|
|
53
49
|
- new_tab: Open in a New Tab
|
|
@@ -20,6 +20,4 @@ export { default as NavWithFontControl } from "./_nav_with_font_control.jsx"
|
|
|
20
20
|
export { default as NavWithSpacingControl } from "./_nav_with_spacing_control.jsx"
|
|
21
21
|
export { default as CollapsibleNavItemSpacing } from "./_collapsible_nav_item_spacing.jsx"
|
|
22
22
|
export { default as CollapsibleNavNoIcon } from "./_collapsible_nav_no_icon.jsx"
|
|
23
|
-
export { default as HorizontalNavExtendedunderline } from './_horizontal_nav_extendedunderline.jsx'
|
|
24
|
-
export { default as HorizontalNavDisabled } from './_horizontal_nav_disabled.jsx'
|
|
25
|
-
export { default as VerticalNavDisabled } from './_vertical_nav_disabled.jsx'
|
|
23
|
+
export { default as HorizontalNavExtendedunderline } from './_horizontal_nav_extendedunderline.jsx'
|
|
@@ -24,12 +24,10 @@
|
|
|
24
24
|
<% end %>
|
|
25
25
|
<% else %>
|
|
26
26
|
<%= pb_content_tag( object.tag,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
onkeydown: object.disabled ? nil : (!object.is_link ? "if(event.key==='Enter'||event.key===' '){event.preventDefault(); this.click();}" : nil),
|
|
32
|
-
tabindex: object.disabled ? -1 : (object.is_link ? nil : 0),
|
|
27
|
+
href: object.link && object.link,
|
|
28
|
+
target: object.link && object.target,
|
|
29
|
+
onkeydown: !object.link ? "if(event.key==='Enter'||event.key===' '){event.preventDefault(); this.click();}" : nil,
|
|
30
|
+
tabindex: object.link ? nil : 0,
|
|
33
31
|
) do %>
|
|
34
32
|
<% if object.image_url %>
|
|
35
33
|
<%= pb_rails("image", props: { url: object.image_url, classname: "pb_nav_img_wrapper" }) %>
|
|
@@ -4,7 +4,6 @@ module Playbook
|
|
|
4
4
|
module PbNav
|
|
5
5
|
class Item < Playbook::KitBase
|
|
6
6
|
prop :active, type: Playbook::Props::Boolean, default: false
|
|
7
|
-
prop :disabled, type: Playbook::Props::Boolean, default: false
|
|
8
7
|
prop :font_size, type: Playbook::Props::Enum,
|
|
9
8
|
values: %w[normal small],
|
|
10
9
|
default: "normal"
|
|
@@ -27,7 +26,7 @@ module Playbook
|
|
|
27
26
|
if collapsible
|
|
28
27
|
"#{generate_classname('pb_nav_list_kit_item', active_class, highlighted_border_class)} #{generate_classname('pb_collapsible_nav_item', active_class, collapsible_trail_class)} #{font_size_class} #{font_weight_class} pb_nav_list_item_link_collapsible"
|
|
29
28
|
else
|
|
30
|
-
"#{generate_classname('pb_nav_list_kit_item', active_class, highlighted_border_class)} #{font_size_class} #{font_weight_class} pb_nav_list_item_link
|
|
29
|
+
"#{generate_classname('pb_nav_list_kit_item', active_class, highlighted_border_class)} #{font_size_class} #{font_weight_class} pb_nav_list_item_link"
|
|
31
30
|
end
|
|
32
31
|
end
|
|
33
32
|
|
|
@@ -82,11 +81,7 @@ module Playbook
|
|
|
82
81
|
end
|
|
83
82
|
|
|
84
83
|
def tag
|
|
85
|
-
link
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def is_link
|
|
89
|
-
link && !disabled
|
|
84
|
+
link ? "a" : "div"
|
|
90
85
|
end
|
|
91
86
|
|
|
92
87
|
def collapsible_icons
|
|
@@ -103,10 +98,6 @@ module Playbook
|
|
|
103
98
|
active ? "active" : nil
|
|
104
99
|
end
|
|
105
100
|
|
|
106
|
-
def disabled_class
|
|
107
|
-
disabled ? " pb_nav_item_disabled" : nil
|
|
108
|
-
end
|
|
109
|
-
|
|
110
101
|
def highlighted_border_class
|
|
111
102
|
!highlighted_border && active ? "highlighted_border_none" : nil
|
|
112
103
|
end
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
1
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
4
2
|
|
|
5
3
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
%>
|
|
38
38
|
|
|
39
|
-
<%= pb_rails("title", props: {size: 4, text: "align |
|
|
39
|
+
<%= pb_rails("title", props: {size: 4, text: "align | vertical_align", padding_top: "sm", padding_bottom: "sm"})%>
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
<%= pb_rails("pb_bar_graph", props: {options: chart_options_right}) %>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
1
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
4
2
|
|
|
5
3
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Custom tooltip formatting is configured through the tooltip object in the options passed to the kit:
|
|
3
2
|
`headerFormat` **Type**: String | when set to null will disable the header.
|
|
4
3
|
`pointFormat` **Type**: String | defines the HTML template for each data point and supports custom HTML when `useHTML` is enabled.
|
|
5
4
|
`useHTML` **Type**: boolean (default false) | enables HTML rendering in tooltips.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
1
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
4
2
|
|
|
5
3
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Highcharts allows for any custom colors to be used. Custom data colors allow for color customization to match the needs of business requirements.
|
|
2
2
|
|
|
3
|
-
For React, pass the
|
|
3
|
+
For React, pass the prop `plotOptions.solidgauge.borderColor` with a Playbook token like `colors.` + `data_1 | data_2 | data_3 | data_4 | data_5 | data_6 | data_7 | data_8`. HEX colors are also available `eg: #CA0095`
|
|
4
4
|
|
|
5
|
-
For Rails, the
|
|
5
|
+
For Rails, the prop `plotOptions.solidgauge.borderColor` can only be used with HEX values as shown.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. Once 'highcharts' and 'highcharts-react-official are installed into your repo, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
1
|
+
This kit is a wrapper around the Highcharts library. It applies styling and default settings but does NOT ship Highcharts. In order to use this kit, 'highcharts' and 'highcharts-react-official' must be installed in your repo. Once done, any prop or functionality provided by Highcharts can be used with this kit without requiring specific props from Playbook. The doc examples below showcase a few common usecases but are not a comprehensive list of all the functionalities possible.
|
|
4
2
|
|
|
5
3
|
See the [highcharts API docs](https://api.highcharts.com/highcharts/) for a comprehensive look at what is possible.
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
} %>
|
|
39
39
|
|
|
40
|
-
<%= pb_rails("title", props: {size: 4, text: "align |
|
|
40
|
+
<%= pb_rails("title", props: {size: 4, text: "align | vertical_align", padding_top: "sm", padding_bottom: "sm"})%>
|
|
41
41
|
<%= pb_rails("pb_line_graph", props: {options: chartOptionsFirst}) %>
|
|
42
42
|
|
|
43
43
|
<% chartOptionsSecond = {
|
|
@@ -96,7 +96,7 @@ const EditorToolbar = ({ editor, extensions, simple, sticky }: any): React.React
|
|
|
96
96
|
<SectionSeparator orientation="vertical" />
|
|
97
97
|
<ToolbarNodes editor={editor} />
|
|
98
98
|
{
|
|
99
|
-
extensions &&
|
|
99
|
+
extensions && (
|
|
100
100
|
<>
|
|
101
101
|
<MoreExtensionsDropdown extensions={extensions}/>
|
|
102
102
|
</>
|