playbook_ui 16.1.0.pre.alpha.play274314216 → 16.1.0.pre.alpha.play276813969
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_advanced_table/Components/RegularTableView.tsx +2 -12
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +0 -17
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -10
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +0 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +5 -14
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx +2 -6
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +3 -6
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -8
- data/app/pb_kits/playbook/pb_dropdown/index.js +10 -11
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +3 -6
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +2 -9
- data/app/pb_kits/playbook/pb_nav/_item.tsx +3 -5
- data/app/pb_kits/playbook/pb_nav/_nav.scss +3 -82
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +6 -2
- data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_nav/item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/item.rb +1 -1
- data/app/pb_kits/playbook/pb_nav/navTypes.ts +0 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +2 -20
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +33 -78
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb +5 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +3 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.jsx +0 -6
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb +6 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +35 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.jsx +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb +10 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +0 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.jsx +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.jsx +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.html.erb +115 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.jsx +0 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.html.erb +4 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.jsx +14 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +20 -23
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +5 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +63 -0
- data/app/pb_kits/playbook/pb_table/index.ts +27 -29
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +10 -10
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +0 -10
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.jsx +0 -3
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +9 -25
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +1 -7
- data/app/pb_kits/playbook/pb_time_picker/_time_picker.tsx +11 -97
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.jsx +2 -5
- data/app/pb_kits/playbook/pb_time_picker/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_time_picker/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_time_picker/time_picker.rb +0 -3
- data/app/pb_kits/playbook/pb_time_picker/time_picker.test.jsx +1 -47
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +1 -29
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +323 -411
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +21 -22
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -3
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -3
- data/app/pb_kits/playbook/tokens/_colors.scss +0 -3
- data/app/pb_kits/playbook/tokens/exports/_colors.module.scss +0 -10
- data/dist/chunks/{_pb_line_graph-DJcGlEF0.js → _pb_line_graph-BgKF_zz1.js} +1 -1
- data/dist/chunks/_typeahead-C4YsbA48.js +1 -0
- data/dist/chunks/{globalProps-ClQG2Tbk.js → globalProps-BhVYCqRf.js} +1 -1
- data/dist/chunks/lib-DD34ZrWL.js +29 -0
- data/dist/chunks/vendor.js +4 -4
- data/dist/menu.yml +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +2 -2
- data/dist/reset.css +1 -1
- data/lib/playbook/forms/builder/form_field_builder.rb +1 -1
- data/lib/playbook/forms/builder/typeahead_field.rb +1 -15
- data/lib/playbook/forms/builder.rb +2 -2
- data/lib/playbook/version.rb +1 -1
- metadata +19 -27
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.jsx +0 -71
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.md +0 -4
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.html.erb +0 -6
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.jsx +0 -17
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.md +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.html.erb +0 -24
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.jsx +0 -87
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx +0 -44
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +0 -34
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +0 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.html.erb +0 -6
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.jsx +0 -16
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.html.erb +0 -16
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.jsx +0 -23
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.md +0 -3
- data/app/pb_kits/playbook/tokens/_colors_accessible.scss +0 -250
- data/dist/chunks/_typeahead-Bme5UrUS.js +0 -1
- data/dist/chunks/lib-C3P9fL1l.js +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 387f03d299bddebe2e4ac7e9800fddf28bb00cdeceb0ffcd9a5c4ea1ed211d20
|
|
4
|
+
data.tar.gz: 03b9b1cbcb66afd3afd4d28eb8c0226dc4d7a2ddc883dadb0844bc427f857831
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4f7c1a63a205b06dadc63869cbfb9f761d88775d9d625efe37bd896d1cbd5269107b71fc0c24714bb781c2b314e949aa5a37bcab80eed8689fe0d90b72796f9
|
|
7
|
+
data.tar.gz: 7933fda91c7fe525372cb559bcc56147fe86bc877cac737603ee0694b62f34fdef93cd2e40b88860de6a51f0c389e21ac2ae6d858cd1cb14531a31083e78bd7c
|
|
@@ -66,18 +66,8 @@ const TableCellRenderer = ({
|
|
|
66
66
|
// Find the "owning" colDefinition by accessor. Needed for multi column logic
|
|
67
67
|
const colDef = findColumnDefByAccessor(columnDefinitions ?? [], column.id)
|
|
68
68
|
const cellAlignment = colDef?.columnStyling?.cellAlignment ?? "right"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const cellFontColorValue = colDef?.columnStyling?.fontColor
|
|
72
|
-
const cellFontColor = typeof cellFontColorValue === 'function'
|
|
73
|
-
? cellFontColorValue(row)
|
|
74
|
-
: cellFontColorValue
|
|
75
|
-
|
|
76
|
-
const cellBackgroundColorValue = colDef?.columnStyling?.cellBackgroundColor
|
|
77
|
-
const cellBackgroundColor = typeof cellBackgroundColorValue === 'function'
|
|
78
|
-
? cellBackgroundColorValue(row)
|
|
79
|
-
: cellBackgroundColorValue
|
|
80
|
-
|
|
69
|
+
const cellFontColor = colDef?.columnStyling?.fontColor
|
|
70
|
+
const cellBackgroundColor = colDef?.columnStyling?.cellBackgroundColor
|
|
81
71
|
const paddingValue = colDef?.columnStyling?.cellPadding ?? customRowStyle?.cellPadding
|
|
82
72
|
const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
|
|
83
73
|
|
|
@@ -920,39 +920,6 @@ test("columnStyling.backgroundColor works as excpected", () => {
|
|
|
920
920
|
expect(firstEnrollmentCell).toHaveStyle({ backgroundColor: colors.error_subtle });
|
|
921
921
|
});
|
|
922
922
|
|
|
923
|
-
test("columnStyling.cellBackgroundColor works as expected with function", () => {
|
|
924
|
-
const styledColumnDefs = [
|
|
925
|
-
{
|
|
926
|
-
accessor: "year",
|
|
927
|
-
label: "Year",
|
|
928
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
929
|
-
},
|
|
930
|
-
{
|
|
931
|
-
accessor: "newEnrollments",
|
|
932
|
-
label: "New Enrollments",
|
|
933
|
-
columnStyling:{
|
|
934
|
-
cellBackgroundColor: (row) => row.original.newEnrollments > 15 ? colors.success_subtle : colors.error_subtle,
|
|
935
|
-
fontColor: (row) => row.original.newEnrollments > 15 ? colors.success : colors.error,
|
|
936
|
-
},
|
|
937
|
-
},
|
|
938
|
-
{
|
|
939
|
-
accessor: "scheduledMeetings",
|
|
940
|
-
label: "Scheduled Meetings",
|
|
941
|
-
},
|
|
942
|
-
];
|
|
943
|
-
|
|
944
|
-
render(
|
|
945
|
-
<AdvancedTable
|
|
946
|
-
columnDefinitions={styledColumnDefs}
|
|
947
|
-
data={{ testid: testId }}
|
|
948
|
-
tableData={MOCK_DATA}
|
|
949
|
-
/>
|
|
950
|
-
);
|
|
951
|
-
|
|
952
|
-
const firstEnrollmentCell = screen.getAllByText("20")[0].closest("td");
|
|
953
|
-
expect(firstEnrollmentCell).toHaveStyle({ backgroundColor: colors.success_subtle, color: colors.success });
|
|
954
|
-
});
|
|
955
|
-
|
|
956
923
|
test("columnStyling.headerBackgroundColor works as excpected", () => {
|
|
957
924
|
const styledColumnDefs = [
|
|
958
925
|
{
|
|
@@ -2,4 +2,4 @@ the `enableSorting` prop is a boolean prop set to false by default. If true, the
|
|
|
2
2
|
|
|
3
3
|
### sortIcon
|
|
4
4
|
|
|
5
|
-
An optional prop, `sortIcon` allows you to customize your icon sets by passing it an array of any comma-separated pair of icon values. The first icon value will replace the kit's default icon when sort direction is desc, and the second value will replace the default icon when sort direction is asc. `sortIcon` also allows you to pass it a single icon as a string, in which case the icon will not toggle with the sort state. Default for this prop is `["arrow-up-wide
|
|
5
|
+
An optional prop, `sortIcon` allows you to customize your icon sets by passing it an array of any comma-separated pair of icon values. The first icon value will replace the kit's default icon when sort direction is desc, and the second value will replace the default icon when sort direction is asc. `sortIcon` also allows you to pass it a single icon as a string, in which case the icon will not toggle with the sort state. Default for this prop is `["arrow-up-short-wide", "arrow-down-short-wide"]`. All strings must be valid FA icons.
|
|
@@ -78,7 +78,6 @@ examples:
|
|
|
78
78
|
- advanced_table_column_styling: Column Styling
|
|
79
79
|
- advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
|
|
80
80
|
- advanced_table_column_styling_background: Column Styling Background Color
|
|
81
|
-
- advanced_table_column_styling_background_custom: Column Styling Background Color (Custom)
|
|
82
81
|
- advanced_table_column_styling_background_multi: Column Styling Background Color with Multiple Headers
|
|
83
82
|
- advanced_table_padding_control: Padding Control using Column Styling
|
|
84
83
|
- advanced_table_column_border_color: Column Group Border Color
|
|
@@ -47,5 +47,4 @@ export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced
|
|
|
47
47
|
export { default as AdvancedTablePaddingControl } from './_advanced_table_padding_control.jsx'
|
|
48
48
|
export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
|
|
49
49
|
export { default as AdvancedTableColumnStylingBackground } from './_advanced_table_column_styling_background.jsx'
|
|
50
|
-
export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
|
|
51
|
-
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
50
|
+
export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
|
|
@@ -4,8 +4,6 @@ import Icon from '../pb_icon/_icon'
|
|
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
|
5
5
|
import classnames from 'classnames'
|
|
6
6
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
|
7
|
-
import colors from '../tokens/exports/_colors.module.scss'
|
|
8
|
-
import spacing from '../tokens/exports/_spacing.module.scss'
|
|
9
7
|
|
|
10
8
|
type CheckboxProps = {
|
|
11
9
|
aria?: {[key: string]: string},
|
|
@@ -21,7 +19,6 @@ type CheckboxProps = {
|
|
|
21
19
|
indeterminate?: boolean,
|
|
22
20
|
name?: string,
|
|
23
21
|
onChange?: (event: React.FormEvent<HTMLInputElement>) => void,
|
|
24
|
-
requiredIndicator?: boolean,
|
|
25
22
|
tabIndex?: number,
|
|
26
23
|
text?: string,
|
|
27
24
|
value?: string,
|
|
@@ -42,7 +39,6 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
|
42
39
|
indeterminate = false,
|
|
43
40
|
name = '',
|
|
44
41
|
onChange = () => { void 0 },
|
|
45
|
-
requiredIndicator = false,
|
|
46
42
|
tabIndex,
|
|
47
43
|
text = '',
|
|
48
44
|
value = '',
|
|
@@ -128,20 +124,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
|
128
124
|
variant={null}
|
|
129
125
|
>
|
|
130
126
|
{text}
|
|
131
|
-
{requiredIndicator && (
|
|
132
|
-
<span
|
|
133
|
-
aria-hidden="true"
|
|
134
|
-
className="pb_required_indicator"
|
|
135
|
-
style={{
|
|
136
|
-
color: colors.error,
|
|
137
|
-
marginLeft: spacing.space_xs,
|
|
138
|
-
}}
|
|
139
|
-
>
|
|
140
|
-
{'*'}
|
|
141
|
-
</span>
|
|
142
|
-
)}
|
|
143
127
|
</Body>
|
|
144
|
-
|
|
145
128
|
</label>
|
|
146
129
|
)
|
|
147
130
|
})
|
|
@@ -5,15 +5,6 @@
|
|
|
5
5
|
<%= pb_rails("icon", props: { icon: "minus", classname: "indeterminate_icon hidden", fixed_width: true}) %>
|
|
6
6
|
</span>
|
|
7
7
|
<span class="pb_checkbox_label">
|
|
8
|
-
<%= pb_rails("body", props: { status: object.checkbox_label_status, dark: object.dark, margin_right: object.form_spacing ? "xs" : "" })
|
|
9
|
-
<%= object.text%>
|
|
10
|
-
<% if object.required_indicator %>
|
|
11
|
-
<span
|
|
12
|
-
class="pb_checkbox_required_indicator"
|
|
13
|
-
aria-hidden="true"
|
|
14
|
-
style="color: #DA0014;"
|
|
15
|
-
>*</span>
|
|
16
|
-
<% end %>
|
|
17
|
-
<% end %>
|
|
8
|
+
<%= pb_rails("body", props: { status: object.checkbox_label_status, text: object.text, dark: object.dark, margin_right: object.form_spacing ? "xs" : "" }) %>
|
|
18
9
|
</span>
|
|
19
10
|
<% end %>
|
|
@@ -23,8 +23,6 @@ module Playbook
|
|
|
23
23
|
prop :hidden_input, type: Playbook::Props::Boolean,
|
|
24
24
|
default: false
|
|
25
25
|
prop :hidden_value
|
|
26
|
-
prop :required_indicator, type: Playbook::Props::Boolean,
|
|
27
|
-
default: false
|
|
28
26
|
|
|
29
27
|
def classname
|
|
30
28
|
generate_classname("pb_checkbox_kit", checked_class) + error_class
|
|
@@ -8,7 +8,6 @@ examples:
|
|
|
8
8
|
- checkbox_indeterminate: Indeterminate Checkbox
|
|
9
9
|
- checkbox_disabled: Disabled Checkbox
|
|
10
10
|
- checkbox_form: Form and Hidden Input
|
|
11
|
-
# - checkbox_required_indicator: Required Indicator
|
|
12
11
|
|
|
13
12
|
react:
|
|
14
13
|
- checkbox_default: Default
|
|
@@ -18,7 +17,6 @@ examples:
|
|
|
18
17
|
- checkbox_error: Default w/ Error
|
|
19
18
|
- checkbox_indeterminate: Indeterminate Checkbox
|
|
20
19
|
- checkbox_disabled: Disabled Checkbox
|
|
21
|
-
# - checkbox_required_indicator: Required Indicator
|
|
22
20
|
|
|
23
21
|
swift:
|
|
24
22
|
- checkbox_default_swift: Default
|
|
@@ -5,4 +5,3 @@ export { default as CheckboxError } from './_checkbox_error.jsx'
|
|
|
5
5
|
export { default as CheckboxChecked } from './_checkbox_checked.jsx'
|
|
6
6
|
export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
|
|
7
7
|
export { default as CheckboxDisabled } from './_checkbox_disabled.jsx'
|
|
8
|
-
export { default as CheckboxRequiredIndicator } from './_checkbox_required_indicator.jsx'
|
|
@@ -40,7 +40,7 @@ type DatePickerProps = {
|
|
|
40
40
|
maxDate: string,
|
|
41
41
|
minDate: string,
|
|
42
42
|
name: string,
|
|
43
|
-
pickerId
|
|
43
|
+
pickerId?: string,
|
|
44
44
|
placeholder?: string,
|
|
45
45
|
positionElement?: HTMLElement | null,
|
|
46
46
|
scrollContainer?: string,
|
|
@@ -196,8 +196,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
196
196
|
|
|
197
197
|
const angleDown = getAllIcons()["angleDown"].icon as unknown as { [key: string]: SVGElement }
|
|
198
198
|
|
|
199
|
-
const errorId = error ? `${pickerId}-error` : undefined
|
|
200
|
-
|
|
201
199
|
return (
|
|
202
200
|
<div
|
|
203
201
|
{...ariaProps}
|
|
@@ -213,18 +211,14 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
213
211
|
>
|
|
214
212
|
|
|
215
213
|
{!hideLabel && (
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
/>
|
|
221
|
-
</label>
|
|
214
|
+
<Caption
|
|
215
|
+
className="pb_date_picker_kit_label"
|
|
216
|
+
text={label}
|
|
217
|
+
/>
|
|
222
218
|
)}
|
|
223
219
|
<>
|
|
224
220
|
<div className="date_picker_input_wrapper">
|
|
225
221
|
<input
|
|
226
|
-
aria-describedby={errorId}
|
|
227
|
-
aria-invalid={!!error}
|
|
228
222
|
autoComplete="off"
|
|
229
223
|
className="date_picker_input"
|
|
230
224
|
disabled={disableInput}
|
|
@@ -238,9 +232,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
238
232
|
|
|
239
233
|
{error &&
|
|
240
234
|
<Body
|
|
241
|
-
aria={{ atomic: "true", live: "polite" }}
|
|
242
|
-
htmlOptions={{ role: "alert" }}
|
|
243
|
-
id={errorId}
|
|
244
235
|
status="negative"
|
|
245
236
|
text={error}
|
|
246
237
|
variant={null}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<% end %>
|
|
29
29
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
30
30
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
31
|
-
<%= pb_rails("
|
|
31
|
+
<%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
|
|
32
32
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
33
33
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
34
34
|
<%= pb_rails("dropdown", props: {options: options, autocomplete: true}) %>
|
|
@@ -4,7 +4,7 @@ import Body from '../../pb_body/_body'
|
|
|
4
4
|
import Button from '../../pb_button/_button'
|
|
5
5
|
import Caption from '../../pb_caption/_caption'
|
|
6
6
|
import Dialog from '../../pb_dialog/_dialog'
|
|
7
|
-
import
|
|
7
|
+
import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
|
|
8
8
|
import Typeahead from '../../pb_typeahead/_typeahead'
|
|
9
9
|
|
|
10
10
|
const DialogCompound = () => {
|
|
@@ -25,12 +25,8 @@ const DialogCompound = () => {
|
|
|
25
25
|
<Body>{'What do you need us to take care of?'}</Body>
|
|
26
26
|
</Dialog.Header>
|
|
27
27
|
<Dialog.Body>
|
|
28
|
-
<Textarea
|
|
29
|
-
id="default-example-1"
|
|
30
|
-
label="Description"
|
|
31
|
-
rows={4}
|
|
32
|
-
/>
|
|
33
28
|
<Caption marginBottom="xs">{'Description'}</Caption>
|
|
29
|
+
<RichTextEditor />
|
|
34
30
|
<br />
|
|
35
31
|
<Caption>
|
|
36
32
|
{
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<% end %>
|
|
13
13
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
14
14
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
15
|
-
<%= pb_rails("
|
|
15
|
+
<%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
|
|
16
16
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
17
17
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
18
18
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<% end %>
|
|
32
32
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
33
33
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
34
|
-
<%= pb_rails("
|
|
34
|
+
<%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
|
|
35
35
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
36
36
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
37
37
|
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<% end %>
|
|
50
50
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
51
51
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
52
|
-
<%= pb_rails("
|
|
52
|
+
<%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
|
|
53
53
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
54
54
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
55
55
|
|
|
@@ -5,7 +5,7 @@ import Button from '../../pb_button/_button'
|
|
|
5
5
|
import Dialog from '../../pb_dialog/_dialog'
|
|
6
6
|
import Flex from '../../pb_flex/_flex'
|
|
7
7
|
import Caption from '../../pb_caption/_caption'
|
|
8
|
-
import
|
|
8
|
+
import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
|
|
9
9
|
import Typeahead from '../../pb_typeahead/_typeahead'
|
|
10
10
|
|
|
11
11
|
const useDialog = (visible = false) => {
|
|
@@ -77,11 +77,8 @@ const DialogFullHeight = () => {
|
|
|
77
77
|
<Body>{title}</Body>
|
|
78
78
|
</Dialog.Header>
|
|
79
79
|
<Dialog.Body>
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
label="Description"
|
|
83
|
-
rows={4}
|
|
84
|
-
/>
|
|
80
|
+
<Caption marginBottom="xs">{"Description"}</Caption>
|
|
81
|
+
<RichTextEditor />
|
|
85
82
|
<br />
|
|
86
83
|
<Caption>
|
|
87
84
|
{
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<% end %>
|
|
14
14
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
15
15
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
16
|
-
<%= pb_rails("
|
|
16
|
+
<%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
|
|
17
17
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
18
18
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
19
19
|
<% end %>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<% end %>
|
|
33
33
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
34
34
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
35
|
-
<%= pb_rails("
|
|
35
|
+
<%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
|
|
36
36
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
37
37
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
38
38
|
<% end %>
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
<% end %>
|
|
51
51
|
<%= pb_rails("dialog/dialog_body") do %>
|
|
52
52
|
<%= pb_rails("caption", props: { text: "Description", margin_bottom: "xs" }) %>
|
|
53
|
-
<%= pb_rails("
|
|
53
|
+
<%= pb_rails("rich_text_editor", props: {id: "default", value: "Add your text here"}) %>
|
|
54
54
|
<%= pb_rails("caption", props: { text: "Type in a word or term too help find tickets later. ex. training, phone setup, hr", margin_bottom: "xs", margin_top: "sm" }) %>
|
|
55
55
|
<%= pb_rails("typeahead", props: { placeholder: "Tags.."}) %>
|
|
56
56
|
<% end %>
|
|
@@ -5,7 +5,7 @@ import Button from '../../pb_button/_button'
|
|
|
5
5
|
import Dialog from '../../pb_dialog/_dialog'
|
|
6
6
|
import Flex from '../../pb_flex/_flex'
|
|
7
7
|
import Caption from '../../pb_caption/_caption'
|
|
8
|
-
import
|
|
8
|
+
import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
|
|
9
9
|
import Typeahead from '../../pb_typeahead/_typeahead'
|
|
10
10
|
|
|
11
11
|
const useDialog = (visible = false) => {
|
|
@@ -76,11 +76,8 @@ const DialogFullHeightPlacement = () => {
|
|
|
76
76
|
<Body>{title}</Body>
|
|
77
77
|
</Dialog.Header>
|
|
78
78
|
<Dialog.Body>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
label="Description"
|
|
82
|
-
rows={4}
|
|
83
|
-
/>
|
|
79
|
+
<Caption marginBottom="xs">{"Description"}</Caption>
|
|
80
|
+
<RichTextEditor />
|
|
84
81
|
<br />
|
|
85
82
|
<Caption>
|
|
86
83
|
{
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
const option = e.detail;
|
|
77
77
|
const dropdown = e.target;
|
|
78
78
|
|
|
79
|
-
const display = dropdown.querySelector("
|
|
79
|
+
const display = dropdown.querySelector("#dropdown_trigger_custom_display");
|
|
80
80
|
if (!display) return;
|
|
81
81
|
|
|
82
82
|
const nameEl = display.querySelector("#dropdown-avatar-name");
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<div class="dropdown_wrapper<%= error_class %>" style="position: relative">
|
|
8
8
|
<input
|
|
9
9
|
data-default-value="<%= input_default_value %>"
|
|
10
|
-
|
|
10
|
+
id="dropdown-selected-option"
|
|
11
11
|
name="<%= object.name %><%= '[]' if object.multi_select %>"
|
|
12
12
|
style="display: none"
|
|
13
13
|
<%= object.required ? "required" : ""%>
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
<%= pb_rails("flex", props: {align: "center"}) do %>
|
|
24
24
|
<% if object.custom_display.present? %>
|
|
25
25
|
<%= pb_rails("flex", props: {align: "center"}) do %>
|
|
26
|
-
<div
|
|
26
|
+
<div id="dropdown_trigger_custom_display" style="display: none;">
|
|
27
27
|
<%= object.custom_display %>
|
|
28
28
|
</div>
|
|
29
|
-
<%= pb_rails("body", props: {text: object.default_display_placeholder,
|
|
29
|
+
<%= pb_rails("body", props: {text: object.default_display_placeholder, id: "dropdown_trigger_display"}) %>
|
|
30
30
|
<% end %>
|
|
31
31
|
<% else %>
|
|
32
32
|
<% if object.multi_select %>
|
|
33
33
|
<%= pb_rails("flex", props: { align: "center", wrap: true }) do %>
|
|
34
|
-
<%= pb_rails("flex", props: {
|
|
34
|
+
<%= pb_rails("flex", props: { id:"dropdown_pills_wrapper", wrap: true }) do %>
|
|
35
35
|
<% end %>
|
|
36
36
|
<% if object.autocomplete %>
|
|
37
37
|
<input
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
autocomplete="off"
|
|
43
43
|
/>
|
|
44
44
|
<% else %>
|
|
45
|
-
<%= pb_rails("body", props: {text: object.default_display_placeholder,
|
|
45
|
+
<%= pb_rails("body", props: {text: object.default_display_placeholder, id: "dropdown_trigger_display_multi_select"}) %>
|
|
46
46
|
<% end %>
|
|
47
47
|
<% end %>
|
|
48
48
|
<% else %>
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
autocomplete="off"
|
|
56
56
|
/>
|
|
57
57
|
<% else %>
|
|
58
|
-
<%= pb_rails("body", props: {text: object.default_display_placeholder,
|
|
58
|
+
<%= pb_rails("body", props: {text: object.default_display_placeholder, id: "dropdown_trigger_display"}) %>
|
|
59
59
|
<% end %>
|
|
60
60
|
<% end %>
|
|
61
61
|
<% end %>
|
|
@@ -63,9 +63,9 @@
|
|
|
63
63
|
<% end %>
|
|
64
64
|
<%= pb_rails("flex/flex_item") do %>
|
|
65
65
|
<%= pb_rails("body", props: {display: "flex", align_items:"center" }) do %>
|
|
66
|
-
<%= pb_rails("icon", props: {icon: "times", cursor: "pointer", size:"sm",
|
|
67
|
-
<%= pb_rails("icon", props: {icon: "chevron-down", cursor: "pointer", size:"sm",
|
|
68
|
-
<%= pb_rails("icon", props: {icon: "chevron-up", cursor: "pointer", size:"sm",
|
|
66
|
+
<%= pb_rails("icon", props: {icon: "times", cursor: "pointer", size:"sm", id: "dropdown_clear_icon", padding_right:"xs" }) %>
|
|
67
|
+
<%= pb_rails("icon", props: {icon: "chevron-down", cursor: "pointer", size:"sm", id: "dropdown_open_icon"}) %>
|
|
68
|
+
<%= pb_rails("icon", props: {icon: "chevron-up", cursor: "pointer", size:"sm", id: "dropdown_close_icon"}) %>
|
|
69
69
|
<% end %>
|
|
70
70
|
<% end %>
|
|
71
71
|
<% end %>
|
|
@@ -4,19 +4,18 @@ import { PbDropdownKeyboard } from "./keyboard_accessibility";
|
|
|
4
4
|
const DROPDOWN_SELECTOR = "[data-pb-dropdown]";
|
|
5
5
|
const TRIGGER_SELECTOR = "[data-dropdown-trigger]";
|
|
6
6
|
const CONTAINER_SELECTOR = "[data-dropdown-container]";
|
|
7
|
-
const DOWN_ARROW_SELECTOR = "
|
|
8
|
-
const UP_ARROW_SELECTOR = "
|
|
7
|
+
const DOWN_ARROW_SELECTOR = "#dropdown_open_icon";
|
|
8
|
+
const UP_ARROW_SELECTOR = "#dropdown_close_icon";
|
|
9
9
|
const OPTION_SELECTOR = "[data-dropdown-option-label]";
|
|
10
10
|
const CUSTOM_DISPLAY_SELECTOR = "[data-dropdown-custom-trigger]";
|
|
11
|
-
const DROPDOWN_TRIGGER_DISPLAY = "
|
|
11
|
+
const DROPDOWN_TRIGGER_DISPLAY = "#dropdown_trigger_display";
|
|
12
12
|
const DROPDOWN_PLACEHOLDER = "[data-dropdown-placeholder]";
|
|
13
|
-
const DROPDOWN_INPUT = "
|
|
13
|
+
const DROPDOWN_INPUT = "#dropdown-selected-option";
|
|
14
14
|
const SEARCH_INPUT_SELECTOR = "[data-dropdown-autocomplete]";
|
|
15
15
|
const SEARCH_BAR_SELECTOR = "[data-dropdown-search]";
|
|
16
|
-
const CLEAR_ICON_SELECTOR = "
|
|
16
|
+
const CLEAR_ICON_SELECTOR = "#dropdown_clear_icon";
|
|
17
17
|
const LABEL_SELECTOR = '[data-dropdown="pb-dropdown-label"]';
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
export default class PbDropdown extends PbEnhancedElement {
|
|
21
20
|
static get selector() {
|
|
22
21
|
return DROPDOWN_SELECTOR;
|
|
@@ -306,7 +305,7 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
306
305
|
onOptionSelected(value, selectedOption) {
|
|
307
306
|
const triggerElement = this.element.querySelector(DROPDOWN_TRIGGER_DISPLAY);
|
|
308
307
|
const customDisplayElement = this.element.querySelector(
|
|
309
|
-
|
|
308
|
+
"#dropdown_trigger_custom_display",
|
|
310
309
|
);
|
|
311
310
|
|
|
312
311
|
if (triggerElement) {
|
|
@@ -694,9 +693,9 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
694
693
|
updatePills() {
|
|
695
694
|
if (!this.isMultiSelect) return;
|
|
696
695
|
|
|
697
|
-
const wrapper = this.element.querySelector(
|
|
696
|
+
const wrapper = this.element.querySelector("#dropdown_pills_wrapper");
|
|
698
697
|
const placeholder = this.element.querySelector(
|
|
699
|
-
|
|
698
|
+
"#dropdown_trigger_display_multi_select",
|
|
700
699
|
);
|
|
701
700
|
if (!wrapper) return;
|
|
702
701
|
|
|
@@ -774,7 +773,7 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
774
773
|
}
|
|
775
774
|
}
|
|
776
775
|
const customDisplay = this.element.querySelector(
|
|
777
|
-
|
|
776
|
+
"#dropdown_trigger_custom_display",
|
|
778
777
|
);
|
|
779
778
|
if (customDisplay) {
|
|
780
779
|
customDisplay.style.display = "none";
|
|
@@ -830,7 +829,7 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
830
829
|
}
|
|
831
830
|
|
|
832
831
|
const customDisplay = this.element.querySelector(
|
|
833
|
-
|
|
832
|
+
"#dropdown_trigger_custom_display",
|
|
834
833
|
);
|
|
835
834
|
if (customDisplay) {
|
|
836
835
|
customDisplay.style.display = "none";
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
<%= pb_form_with(scope: :example, url: "", method: :get, validate: true) do |form| %>
|
|
2
|
-
<%= form.typeahead :example_typeahead_field, props: { label: true, required: true, required_indicator: true } %>
|
|
3
2
|
<%= form.text_field :example_text_field, props: { label: true, required: true, required_indicator: true } %>
|
|
4
3
|
<%= form.text_field :example_text_field_2, props: { label: "Text Field Custom Label", required: true, required_indicator: true } %>
|
|
5
|
-
<%= form.
|
|
4
|
+
<%= form.text_area :example_text_area, props: { label: true, required: true, required_indicator: true } %>
|
|
5
|
+
<%= form.text_area :example_text_area_2, props: { label: "Textarea Custom Label", required: true, required_indicator: true } %>
|
|
6
6
|
<%= form.email_field :example_email_field, props: { label: true, required: true, required_indicator: true } %>
|
|
7
7
|
<%= form.number_field :example_number_field, props: { label: true, required: true, required_indicator: true } %>
|
|
8
8
|
<%= form.search_field :example_search_field, props: { label: true, required: true, required_indicator: true } %>
|
|
9
9
|
<%= form.password_field :example_password_field, props: { label: true, required: true, required_indicator: true } %>
|
|
10
10
|
<%= form.url_field :example_url_field, props: { label: true, required: true, required_indicator: true } %>
|
|
11
|
-
<%= form.
|
|
12
|
-
<%= form.text_area :example_text_area_2, props: { label: "Textarea Custom Label", required: true, required_indicator: true } %>
|
|
13
|
-
<%# <%= form.check_box :example_checkbox, props: { label: true, text: "Checkbox Label", required: true, required_indicator: true } %>
|
|
14
|
-
<%= form.time_picker :example_time_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
11
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: true, required: true, required_indicator: true } %>
|
|
15
12
|
|
|
16
13
|
<%= form.actions do |action| %>
|
|
17
14
|
<%= action.submit %>
|
|
@@ -26,10 +26,6 @@ class PbFormValidation extends PbEnhancedElement {
|
|
|
26
26
|
const isPhoneNumberInput = field.closest('.pb_phone_number_input')
|
|
27
27
|
if (isPhoneNumberInput) return
|
|
28
28
|
|
|
29
|
-
// Skip TimePicker inputs - they handle their own validation
|
|
30
|
-
const isTimePickerInput = field.closest('.pb_time_picker')
|
|
31
|
-
if (isTimePickerInput) return
|
|
32
|
-
|
|
33
29
|
FIELD_EVENTS.forEach((e) => {
|
|
34
30
|
field.addEventListener(e, debounce((event) => {
|
|
35
31
|
this.validateFormField(event)
|
|
@@ -71,16 +67,13 @@ class PbFormValidation extends PbEnhancedElement {
|
|
|
71
67
|
|
|
72
68
|
// Check if this is a phone number input
|
|
73
69
|
const isPhoneNumberInput = kitElement.classList.contains('pb_phone_number_input')
|
|
74
|
-
|
|
75
|
-
// Check if this is a TimePicker input
|
|
76
|
-
const isTimePickerInput = kitElement.classList.contains('pb_time_picker')
|
|
77
70
|
|
|
78
71
|
// ensure clean error message state
|
|
79
72
|
this.clearError(target)
|
|
80
73
|
kitElement.classList.add('error')
|
|
81
74
|
|
|
82
|
-
// Only add error message if it's NOT a phone number input
|
|
83
|
-
if (!isPhoneNumberInput
|
|
75
|
+
// Only add error message if it's NOT a phone number input
|
|
76
|
+
if (!isPhoneNumberInput) {
|
|
84
77
|
// set the error message element
|
|
85
78
|
const errorMessageContainer = this.errorMessageContainer
|
|
86
79
|
|
|
@@ -91,7 +91,6 @@ const NavItem = (props: NavItemProps) => {
|
|
|
91
91
|
marginX,
|
|
92
92
|
marginY,
|
|
93
93
|
disabled = false,
|
|
94
|
-
|
|
95
94
|
} = props;
|
|
96
95
|
|
|
97
96
|
const spacingMarginProps = {
|
|
@@ -198,14 +197,13 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
|
198
197
|
if (React.isValidElement(child)) {
|
|
199
198
|
const childProps: NavChildProps = {
|
|
200
199
|
itemSpacing: itemSpacing,
|
|
201
|
-
...(disabled && { disabled: disabled })
|
|
202
200
|
};
|
|
203
201
|
return React.cloneElement(child, childProps);
|
|
204
202
|
}
|
|
205
203
|
return child;
|
|
206
204
|
});
|
|
207
205
|
|
|
208
|
-
const collapsibleClasses = buildCss("collapsible_nav_wrapper", activeClass, highlightedBorderClass, collapsibleTrailClass
|
|
206
|
+
const collapsibleClasses = buildCss("collapsible_nav_wrapper", activeClass, highlightedBorderClass, collapsibleTrailClass)
|
|
209
207
|
|
|
210
208
|
const handleKeyDown = (e: React.KeyboardEvent) => {
|
|
211
209
|
if (!disabled && !isLink && (e.key === "Enter" || e.key === " ")) {
|
|
@@ -233,8 +231,8 @@ const { filteredPadding, filteredMargin } = filterItemSpacing(itemSpacing);
|
|
|
233
231
|
icon={iconRight && iconRight}
|
|
234
232
|
iconSize="xs"
|
|
235
233
|
id={id}
|
|
236
|
-
onClick={
|
|
237
|
-
onIconClick={
|
|
234
|
+
onClick={onClick}
|
|
235
|
+
onIconClick={onIconRightClick}
|
|
238
236
|
>
|
|
239
237
|
<Collapsible.Main
|
|
240
238
|
className={globalProps({ ...finalItemSpacing })}
|