playbook_ui 14.23.0.pre.alpha.play23129273 → 14.23.0.pre.rc.0
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +6 -7
- data/app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx +25 -24
- data/app/pb_kits/playbook/pb_advanced_table/Components/SubRowHeaderRow.tsx +11 -32
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +10 -10
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +12 -11
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +5 -8
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +1 -67
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +7 -19
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +2 -14
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -34
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +0 -16
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +6 -14
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +1 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -5
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -36
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +4 -13
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -2
- data/app/pb_kits/playbook/pb_badge/_badge.scss +6 -5
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +15 -33
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +72 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +6 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +15 -33
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +22 -52
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +16 -12
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +15 -31
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +16 -39
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +38 -86
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +1 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +15 -32
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +22 -72
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +1 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +15 -31
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +16 -37
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_truncate.jsx +3 -3
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -12
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_indeterminate_rails.md +1 -2
- data/app/pb_kits/playbook/pb_checkbox/index.js +1 -3
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +1 -36
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +26 -71
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +16 -29
- data/app/pb_kits/playbook/pb_circle_chart/docs/{_circle_chart_colors_rails.md → _circle_chart_colors.md} +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +16 -28
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +2 -4
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +15 -23
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +51 -81
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +75 -103
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +7 -4
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +13 -19
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +17 -30
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +20 -34
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +20 -29
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +20 -28
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +4 -12
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +2 -5
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -17
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +0 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options.jsx +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_radio_options_react.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +0 -24
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -11
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +15 -32
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +9 -35
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +14 -26
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +15 -32
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +17 -45
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +22 -59
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +9 -40
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +18 -50
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +30 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +18 -31
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +17 -34
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +23 -64
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +1 -7
- data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +17 -36
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +16 -31
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +31 -63
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +16 -35
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +16 -41
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +62 -107
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +7 -4
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +52 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +1 -16
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +0 -4
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_rails.md +1 -3
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_react.md +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +17 -30
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_select/select.rb +2 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -1
- data/app/pb_kits/playbook/pb_title/docs/_title_truncate.jsx +3 -3
- data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_tooltip/index.js +36 -59
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -9
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.scss +0 -0
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +202 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_continuous.jsx +69 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_default.jsx +71 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_multi_beacon.jsx +110 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_beacon.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_no_overlay.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_styled.jsx +76 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/example.yml +10 -0
- data/app/pb_kits/playbook/pb_walkthrough/docs/index.js +6 -0
- data/app/pb_kits/playbook/pb_walkthrough/walkthrough.test.jsx +34 -0
- data/dist/chunks/_typeahead-B7FRYVtS.js +22 -0
- data/dist/chunks/_weekday_stacked-BNSy7Mo2.js +45 -0
- data/dist/chunks/lib-Carqm8Ip.js +29 -0
- data/dist/chunks/{pb_form_validation-D3b0JKHH.js → pb_form_validation-DqRmTS8m.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +15 -68
- data/dist/playbook-doc.js +2 -2
- 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 +2 -2
- metadata +35 -49
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.jsx +0 -65
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_sort.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.html.erb +0 -46
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column.md +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_per_column_for_multi_column.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.jsx +0 -69
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.jsx +0 -107
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_multi_header.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.html.erb +0 -51
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_with_custom_header_rails.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_body/docs/_body_truncate_react.md +0 -4
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown_mixin.scss +0 -36
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options.jsx +0 -90
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_active_style_options_react.md +0 -4
- data/app/pb_kits/playbook/pb_gauge/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.jsx +0 -26
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_strict_mode.md +0 -3
- data/app/pb_kits/playbook/pb_title/docs/_title_truncate_react.md +0 -4
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open.html.erb +0 -14
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_click_open_rails.md +0 -1
- data/dist/chunks/_line_graph-BNbgv7cZ.js +0 -1
- data/dist/chunks/_typeahead-BjxzQL_-.js +0 -6
- data/dist/chunks/_weekday_stacked-DA1-B51Z.js +0 -37
- data/dist/chunks/lib-CY5ZPzic.js +0 -29
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_row_styling_react.md → _advanced_table_row_styling.md} +0 -0
- /data/app/pb_kits/playbook/pb_body/docs/{_body_truncate_rails.md → _body_truncate.md} +0 -0
- /data/app/pb_kits/playbook/pb_gauge/docs/{_gauge_colors_rails.md → _gauge_colors.md} +0 -0
- /data/app/pb_kits/playbook/pb_gauge/docs/{_gauge_complex_rails.md → _gauge_complex.md} +0 -0
- /data/app/pb_kits/playbook/pb_line_graph/docs/{_line_graph_colors_rails.md → _line_graph_colors.md} +0 -0
- /data/app/pb_kits/playbook/pb_title/docs/{_title_truncate_rails.md → _title_truncate.md} +0 -0
- /data/app/pb_kits/playbook/pb_tooltip/docs/{_tooltip_click_open_react.md → _tooltip_click_open.md} +0 -0
@@ -1,3 +1 @@
|
|
1
|
-
The `range` prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the `range` prop.
|
2
|
-
|
3
|
-
Note: If the `total` pages prop is 0 or 1, the Pagination component will not be displayed, as there aren't multiple pages to navigate.
|
1
|
+
The `range` prop determines how many pages to display in the Pagination component. Regardless of this value, the first two and last two pages are always visible to facilitate navigation to the beginning and end of the pagination. If these always-visible pages fall within the specified range, they are included in the display. If they fall outside the range, the pagination will show additional pages up to the number defined by the `range` prop.
|
@@ -38,7 +38,6 @@ type PhoneNumberInputProps = {
|
|
38
38
|
required?: boolean,
|
39
39
|
value?: string,
|
40
40
|
formatAsYouType?: boolean,
|
41
|
-
strictMode?: boolean,
|
42
41
|
countrySearch?: boolean,
|
43
42
|
}
|
44
43
|
|
@@ -69,7 +68,7 @@ const containOnlyNumbers = (value: string) => {
|
|
69
68
|
return /^[()+\-\ .\d]*$/g.test(value)
|
70
69
|
}
|
71
70
|
|
72
|
-
const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.
|
71
|
+
const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefObject<unknown>) => {
|
73
72
|
const {
|
74
73
|
aria = {},
|
75
74
|
className,
|
@@ -95,7 +94,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
95
94
|
preferredCountries = [],
|
96
95
|
value = "",
|
97
96
|
formatAsYouType = false,
|
98
|
-
strictMode = false,
|
99
97
|
countrySearch = false,
|
100
98
|
} = props
|
101
99
|
|
@@ -108,16 +106,15 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
108
106
|
className
|
109
107
|
)
|
110
108
|
|
111
|
-
const inputRef = useRef<HTMLInputElement
|
109
|
+
const inputRef = useRef<HTMLInputElement>()
|
112
110
|
const itiRef = useRef<any>(null);
|
113
111
|
const [inputValue, setInputValue] = useState(value)
|
114
112
|
const [error, setError] = useState(props.error)
|
115
113
|
const [dropDownIsOpen, setDropDownIsOpen] = useState(false)
|
116
114
|
const [selectedData, setSelectedData] = useState()
|
117
|
-
const [hasTyped, setHasTyped] = useState(false)
|
118
115
|
|
119
116
|
useEffect(() => {
|
120
|
-
if (
|
117
|
+
if (error?.length > 0) {
|
121
118
|
onValidate(false)
|
122
119
|
} else {
|
123
120
|
onValidate(true)
|
@@ -134,7 +131,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
134
131
|
clearField() {
|
135
132
|
setInputValue("")
|
136
133
|
setError("")
|
137
|
-
setHasTyped(false)
|
138
134
|
},
|
139
135
|
inputNode() {
|
140
136
|
return inputRef.current
|
@@ -205,8 +201,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
205
201
|
}
|
206
202
|
|
207
203
|
const validateErrors = () => {
|
208
|
-
if (!hasTyped && !error) return
|
209
|
-
|
210
204
|
if (itiRef.current) isValid(itiRef.current.isValidNumber())
|
211
205
|
if (validateOnlyNumbers(itiRef.current)) return
|
212
206
|
if (validateTooLongNumber(itiRef.current)) return
|
@@ -220,7 +214,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
220
214
|
}
|
221
215
|
|
222
216
|
const handleOnChange = (evt: React.ChangeEvent<HTMLInputElement>) => {
|
223
|
-
if (!hasTyped) setHasTyped(true)
|
224
217
|
setInputValue(evt.target.value)
|
225
218
|
let phoneNumberData
|
226
219
|
if (formatAsYouType) {
|
@@ -258,7 +251,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
258
251
|
countrySearch: countrySearch,
|
259
252
|
fixDropdownWidth: false,
|
260
253
|
formatAsYouType: formatAsYouType,
|
261
|
-
strictMode: strictMode,
|
262
254
|
hiddenInput: hiddenInputs ? () => ({
|
263
255
|
phone: `${name}_full`,
|
264
256
|
country: `${name}_country_code`,
|
@@ -267,17 +259,16 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
267
259
|
|
268
260
|
itiRef.current = telInputInit;
|
269
261
|
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
262
|
+
inputRef.current.addEventListener("countrychange", (evt: Event) => {
|
263
|
+
const phoneNumberData = getCurrentSelectedData(telInputInit, (evt.target as HTMLInputElement).value)
|
264
|
+
setSelectedData(phoneNumberData)
|
265
|
+
onChange(phoneNumberData)
|
266
|
+
validateErrors()
|
267
|
+
})
|
268
|
+
|
269
|
+
inputRef.current.addEventListener("open:countrydropdown", () => setDropDownIsOpen(true))
|
270
|
+
inputRef.current.addEventListener("close:countrydropdown", () => setDropDownIsOpen(false))
|
277
271
|
|
278
|
-
inputRef.current.addEventListener("open:countrydropdown", () => setDropDownIsOpen(true))
|
279
|
-
inputRef.current.addEventListener("close:countrydropdown", () => setDropDownIsOpen(false))
|
280
|
-
}
|
281
272
|
if (formatAsYouType) {
|
282
273
|
inputRef.current?.addEventListener("input", (evt) => {
|
283
274
|
handleOnChange(evt as unknown as React.ChangeEvent<HTMLInputElement>);
|
@@ -312,16 +303,12 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.Ref<unknown>
|
|
312
303
|
{...htmlProps}
|
313
304
|
>
|
314
305
|
<TextInput
|
315
|
-
ref={
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
} else {
|
320
|
-
(ref as React.MutableRefObject<HTMLInputElement | null>).current = inputNode
|
321
|
-
}
|
306
|
+
ref={
|
307
|
+
inputNode => {
|
308
|
+
ref ? ref.current = inputNode : null
|
309
|
+
inputRef.current = inputNode
|
322
310
|
}
|
323
|
-
|
324
|
-
}}
|
311
|
+
}
|
325
312
|
{...textInputProps}
|
326
313
|
/>
|
327
314
|
</div>
|
@@ -10,7 +10,6 @@ examples:
|
|
10
10
|
- phone_number_input_clear_field: Clearing the Input Field
|
11
11
|
- phone_number_input_access_input_element: Accessing the Input Element
|
12
12
|
- phone_number_input_format: Format as You Type
|
13
|
-
- phone_number_input_strict_mode: Strict Mode
|
14
13
|
- phone_number_input_country_search: Country Search
|
15
14
|
|
16
15
|
rails:
|
@@ -21,6 +20,5 @@ examples:
|
|
21
20
|
- phone_number_input_exclude_countries: Exclude Countries
|
22
21
|
- phone_number_input_validation: Form Validation
|
23
22
|
- phone_number_input_format: Format as You Type
|
24
|
-
- phone_number_input_strict_mode: Strict Mode
|
25
23
|
- phone_number_input_hidden_inputs: Hidden Inputs
|
26
24
|
- phone_number_input_country_search: Country Search
|
@@ -7,5 +7,4 @@ export { default as PhoneNumberInputValidation } from './_phone_number_input_val
|
|
7
7
|
export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
|
8
8
|
export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
|
9
9
|
export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
|
10
|
-
export { default as PhoneNumberInputStrictMode } from './_phone_number_input_strict_mode'
|
11
10
|
export { default as PhoneNumberInputCountrySearch } from './_phone_number_input_country_search'
|
@@ -25,8 +25,6 @@ module Playbook
|
|
25
25
|
default: ""
|
26
26
|
prop :format_as_you_type, type: Playbook::Props::Boolean,
|
27
27
|
default: false
|
28
|
-
prop :strict_mode, type: Playbook::Props::Boolean,
|
29
|
-
default: false
|
30
28
|
prop :hidden_inputs, type: Playbook::Props::Boolean,
|
31
29
|
default: false
|
32
30
|
prop :country_search, type: Playbook::Props::Boolean,
|
@@ -43,7 +41,6 @@ module Playbook
|
|
43
41
|
disabled: disabled,
|
44
42
|
error: error,
|
45
43
|
formatAsYouType: format_as_you_type,
|
46
|
-
strictMode: strict_mode,
|
47
44
|
hiddenInputs: hidden_inputs,
|
48
45
|
initialCountry: initial_country,
|
49
46
|
label: label,
|
@@ -24,9 +24,7 @@ module Playbook
|
|
24
24
|
prop :validation_message, type: Playbook::Props::String, default: ""
|
25
25
|
|
26
26
|
def classnames
|
27
|
-
|
28
|
-
.reject(&:empty?)
|
29
|
-
.join(" ")
|
27
|
+
classname + inline_class + compact_class + show_arrow_class
|
30
28
|
end
|
31
29
|
|
32
30
|
def all_attributes
|
@@ -46,7 +44,7 @@ module Playbook
|
|
46
44
|
end
|
47
45
|
|
48
46
|
def inline_class
|
49
|
-
inline ? "inline" : ""
|
47
|
+
inline ? " inline " : " "
|
50
48
|
end
|
51
49
|
|
52
50
|
def compact_class
|
@@ -20,7 +20,7 @@ const TitleTruncate = (props) => {
|
|
20
20
|
marginBottom="md"
|
21
21
|
size={4}
|
22
22
|
text={lorem}
|
23
|
-
truncate=
|
23
|
+
truncate="1"
|
24
24
|
{...props}
|
25
25
|
/>
|
26
26
|
|
@@ -32,7 +32,7 @@ const TitleTruncate = (props) => {
|
|
32
32
|
marginBottom="md"
|
33
33
|
size={4}
|
34
34
|
text={lorem}
|
35
|
-
truncate=
|
35
|
+
truncate="2"
|
36
36
|
{...props}
|
37
37
|
/>
|
38
38
|
|
@@ -43,7 +43,7 @@ const TitleTruncate = (props) => {
|
|
43
43
|
<Title
|
44
44
|
size={4}
|
45
45
|
text={lorem}
|
46
|
-
truncate=
|
46
|
+
truncate="3"
|
47
47
|
{...props}
|
48
48
|
/>
|
49
49
|
</Flex>
|
@@ -19,75 +19,60 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
19
19
|
}
|
20
20
|
|
21
21
|
this.triggerElements.forEach((trigger) => {
|
22
|
-
const method = this.
|
22
|
+
const method = this.triggerMethod
|
23
23
|
const interactionEnabled = this.tooltipInteraction
|
24
24
|
|
25
25
|
if (method === 'click') {
|
26
|
-
trigger.addEventListener('click', (
|
27
|
-
|
28
|
-
e.preventDefault()
|
29
|
-
if (this.isTooltipVisible()) {
|
30
|
-
this.hideTooltip()
|
31
|
-
} else {
|
32
|
-
this.showTooltip(trigger)
|
33
|
-
}
|
34
|
-
} else {
|
35
|
-
this.showTooltip(trigger)
|
36
|
-
}
|
26
|
+
trigger.addEventListener('click', () => {
|
27
|
+
this.showTooltip(trigger)
|
37
28
|
})
|
38
29
|
} else {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
this.
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
})
|
30
|
+
trigger.addEventListener('mouseenter', () => {
|
31
|
+
clearSafeZoneListener(this)
|
32
|
+
clearTimeout(this.mouseleaveTimeout)
|
33
|
+
this.currentTrigger = trigger
|
34
|
+
const delayOpen = this.delayOpen ? parseInt(this.delayOpen) : TOOLTIP_TIMEOUT
|
35
|
+
this.mouseenterTimeout = setTimeout(() => {
|
36
|
+
this.showTooltip(trigger)
|
37
|
+
if (interactionEnabled) {
|
38
|
+
this.checkCloseTooltip(trigger)
|
39
|
+
}
|
40
|
+
}, delayOpen)
|
41
|
+
})
|
52
42
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
if (interactionEnabled) {
|
59
|
-
this.attachSafeZoneListener()
|
60
|
-
} else {
|
61
|
-
this.hideTooltip()
|
62
|
-
}
|
63
|
-
}, delayClose)
|
64
|
-
} else {
|
43
|
+
trigger.addEventListener('mouseleave', () => {
|
44
|
+
clearTimeout(this.mouseenterTimeout)
|
45
|
+
if (this.delayClose) {
|
46
|
+
const delayClose = parseInt(this.delayClose)
|
47
|
+
this.mouseleaveTimeout = setTimeout(() => {
|
65
48
|
if (interactionEnabled) {
|
66
49
|
this.attachSafeZoneListener()
|
67
50
|
} else {
|
68
51
|
this.hideTooltip()
|
69
52
|
}
|
53
|
+
}, delayClose)
|
54
|
+
} else {
|
55
|
+
if (interactionEnabled) {
|
56
|
+
this.attachSafeZoneListener()
|
57
|
+
} else {
|
58
|
+
this.hideTooltip()
|
70
59
|
}
|
71
|
-
}
|
60
|
+
}
|
61
|
+
})
|
72
62
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
63
|
+
if (interactionEnabled) {
|
64
|
+
this.tooltip.addEventListener('mouseenter', () => {
|
65
|
+
clearSafeZoneListener(this)
|
66
|
+
})
|
77
67
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
}
|
68
|
+
this.tooltip.addEventListener('mouseleave', () => {
|
69
|
+
this.attachSafeZoneListener()
|
70
|
+
})
|
82
71
|
}
|
83
72
|
}
|
84
73
|
})
|
85
74
|
}
|
86
75
|
|
87
|
-
isTooltipVisible() {
|
88
|
-
return this.tooltip && this.tooltip.classList.contains('show')
|
89
|
-
}
|
90
|
-
|
91
76
|
attachSafeZoneListener() {
|
92
77
|
clearSafeZoneListener(this)
|
93
78
|
this.safeZoneHandler = (e) => {
|
@@ -160,7 +145,7 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
160
145
|
|
161
146
|
this.tooltip.classList.add('show')
|
162
147
|
|
163
|
-
if (this.
|
148
|
+
if (this.triggerMethod === 'click') {
|
164
149
|
clearTimeout(this.autoHideTimeout)
|
165
150
|
this.autoHideTimeout = setTimeout(() => {
|
166
151
|
this.hideTooltip()
|
@@ -239,14 +224,6 @@ export default class PbTooltip extends PbEnhancedElement {
|
|
239
224
|
return this.element.dataset.pbTooltipTriggerMethod || 'hover'
|
240
225
|
}
|
241
226
|
|
242
|
-
get useClickToOpen() {
|
243
|
-
return this.element.dataset.pbTooltipUseClickToOpen === 'true'
|
244
|
-
}
|
245
|
-
|
246
|
-
get effectiveTriggerMethod() {
|
247
|
-
return this.useClickToOpen ? 'click' : this.triggerMethod
|
248
|
-
}
|
249
|
-
|
250
227
|
get tooltipInteraction() {
|
251
228
|
return this.element.dataset.pbTooltipInteraction === 'true'
|
252
229
|
}
|
@@ -21,8 +21,6 @@ module Playbook
|
|
21
21
|
prop :trigger_method, type: Playbook::Props::Enum,
|
22
22
|
values: %w[hover click],
|
23
23
|
default: "hover"
|
24
|
-
prop :use_click_to_open, type: Playbook::Props::Boolean,
|
25
|
-
default: false
|
26
24
|
prop :width
|
27
25
|
|
28
26
|
def classname
|
@@ -48,10 +46,6 @@ module Playbook
|
|
48
46
|
out
|
49
47
|
end
|
50
48
|
|
51
|
-
def effective_trigger_method
|
52
|
-
use_click_to_open ? "click" : (trigger_method || "hover")
|
53
|
-
end
|
54
|
-
|
55
49
|
def data
|
56
50
|
data = Hash(values[:data]).merge(
|
57
51
|
pb_tooltip_kit: true,
|
@@ -60,9 +54,8 @@ module Playbook
|
|
60
54
|
pb_tooltip_trigger_element_id: trigger_element_id,
|
61
55
|
pb_tooltip_tooltip_id: tooltip_id,
|
62
56
|
pb_tooltip_show_tooltip: true,
|
63
|
-
pb_tooltip_trigger_method:
|
64
|
-
pb_tooltip_interaction: interaction
|
65
|
-
pb_tooltip_use_click_to_open: use_click_to_open
|
57
|
+
pb_tooltip_trigger_method: trigger_method,
|
58
|
+
pb_tooltip_interaction: interaction
|
66
59
|
)
|
67
60
|
data = data.merge(pb_tooltip_delay_open: delay_open) if delay_open
|
68
61
|
data = data.merge(pb_tooltip_delay_close: delay_close) if delay_close
|
File without changes
|
@@ -0,0 +1,202 @@
|
|
1
|
+
/* eslint-disable react/no-multi-comp */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import classnames from 'classnames'
|
5
|
+
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
6
|
+
import { globalProps } from '../utilities/globalProps'
|
7
|
+
import Joyride, { TooltipRenderProps } from 'react-joyride'
|
8
|
+
import Button from '../pb_button/_button'
|
9
|
+
import Flex from '../pb_flex/_flex'
|
10
|
+
import SectionSeparator from '../pb_section_separator/_section_separator'
|
11
|
+
import Title from '../pb_title/_title'
|
12
|
+
|
13
|
+
type WalkthroughProps = {
|
14
|
+
aria?: { [key: string]: string },
|
15
|
+
callback?: () => void,
|
16
|
+
className?: string,
|
17
|
+
continuous?: boolean,
|
18
|
+
data?: { [key: string]: string },
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
|
+
id?: string,
|
21
|
+
run?: boolean,
|
22
|
+
steps?: [],
|
23
|
+
stepIndex?: number,
|
24
|
+
debug?: boolean,
|
25
|
+
disableCloseOnEsc?: boolean,
|
26
|
+
disableOverlay?: boolean,
|
27
|
+
disableOverlayClose?: boolean,
|
28
|
+
disableScrolling?: boolean,
|
29
|
+
floaterProps?: Record<string, unknown>,
|
30
|
+
hideBackButton?: boolean,
|
31
|
+
hideCloseButton?: boolean,
|
32
|
+
showProgress?: boolean,
|
33
|
+
showSkipButton?: boolean,
|
34
|
+
spotlightClicks?: boolean,
|
35
|
+
spotlightPadding?: number,
|
36
|
+
styles?: {
|
37
|
+
options: {
|
38
|
+
beaconSize?: number,
|
39
|
+
arrowColor?: string,
|
40
|
+
backgroundColor?: string,
|
41
|
+
primaryColor?: string,
|
42
|
+
overlayColor?: string,
|
43
|
+
spotlightShadow?: string,
|
44
|
+
width?: number,
|
45
|
+
zIndex?: number,
|
46
|
+
},
|
47
|
+
},
|
48
|
+
}
|
49
|
+
|
50
|
+
type TooltipProps = {
|
51
|
+
continuous?: boolean,
|
52
|
+
className?: string,
|
53
|
+
index?: number,
|
54
|
+
isLastStep?: boolean,
|
55
|
+
size?: number,
|
56
|
+
step: {
|
57
|
+
title?: string,
|
58
|
+
content?: React.ReactNode[] | React.ReactNode | string,
|
59
|
+
target: string,
|
60
|
+
disableBeacon?: boolean,
|
61
|
+
},
|
62
|
+
skip?: boolean,
|
63
|
+
backProps?: Record<string, unknown>,
|
64
|
+
closeProps?: Record<string, unknown>,
|
65
|
+
primaryProps?: Record<string, unknown>,
|
66
|
+
skipProps?: Record<string, unknown>,
|
67
|
+
tooltipProps?: Record<string, unknown>,
|
68
|
+
}
|
69
|
+
|
70
|
+
// eslint-disable-next-line react/display-name
|
71
|
+
const Tooltip = React.forwardRef((props: TooltipProps) => (
|
72
|
+
<div
|
73
|
+
className="pb_card_kit_border_none p_none"
|
74
|
+
{...props.tooltipProps}
|
75
|
+
>
|
76
|
+
{props.step.title && <div>
|
77
|
+
<Flex
|
78
|
+
align="center"
|
79
|
+
justify="between"
|
80
|
+
padding="xs"
|
81
|
+
>
|
82
|
+
<Title
|
83
|
+
paddingLeft="xs"
|
84
|
+
size={4}
|
85
|
+
>
|
86
|
+
{props.step.title}
|
87
|
+
</Title>
|
88
|
+
{props.skip && (
|
89
|
+
<Button
|
90
|
+
{...props.skipProps}
|
91
|
+
id="skip"
|
92
|
+
text="Skip Tour"
|
93
|
+
variant="link"
|
94
|
+
/>
|
95
|
+
)}
|
96
|
+
<Button
|
97
|
+
{...props.skipProps}
|
98
|
+
id="skip"
|
99
|
+
text="Skip Tour"
|
100
|
+
variant="link"
|
101
|
+
/>
|
102
|
+
</Flex>
|
103
|
+
<SectionSeparator />
|
104
|
+
</div>}
|
105
|
+
|
106
|
+
<Flex padding="sm">{props.step.content}</Flex>
|
107
|
+
<SectionSeparator />
|
108
|
+
<Flex
|
109
|
+
justify={props.index == 0 ? 'end' : 'between'}
|
110
|
+
padding="xs"
|
111
|
+
>
|
112
|
+
|
113
|
+
{props.index > 0 && (
|
114
|
+
<Button
|
115
|
+
{...props.backProps}
|
116
|
+
id="back"
|
117
|
+
text="Back"
|
118
|
+
/>
|
119
|
+
)}
|
120
|
+
|
121
|
+
{props.continuous && !props.isLastStep &&
|
122
|
+
<Button
|
123
|
+
{...props.primaryProps}
|
124
|
+
id="next"
|
125
|
+
text="Next"
|
126
|
+
/>
|
127
|
+
}
|
128
|
+
|
129
|
+
{!props.continuous &&
|
130
|
+
<Button
|
131
|
+
{...props.closeProps}
|
132
|
+
id="close"
|
133
|
+
text="Close"
|
134
|
+
/>
|
135
|
+
}
|
136
|
+
|
137
|
+
{!((props.continuous && !props.isLastStep) || (!props.continuous)) &&
|
138
|
+
<Button
|
139
|
+
{...props.closeProps}
|
140
|
+
id="close"
|
141
|
+
text="Close"
|
142
|
+
/>
|
143
|
+
}
|
144
|
+
</Flex>
|
145
|
+
</div>
|
146
|
+
)) as unknown as React.ForwardRefRenderFunction<HTMLDivElement, TooltipRenderProps>
|
147
|
+
|
148
|
+
const Walkthrough = (props: WalkthroughProps): React.ReactElement => {
|
149
|
+
const {
|
150
|
+
aria = {},
|
151
|
+
callback,
|
152
|
+
className,
|
153
|
+
continuous = false,
|
154
|
+
data = {},
|
155
|
+
disableOverlay,
|
156
|
+
floaterProps = {
|
157
|
+
offset: 50,
|
158
|
+
},
|
159
|
+
htmlOptions = {},
|
160
|
+
id,
|
161
|
+
run = false,
|
162
|
+
steps,
|
163
|
+
styles = {
|
164
|
+
options: {
|
165
|
+
zIndex: 20000,
|
166
|
+
},
|
167
|
+
},
|
168
|
+
showSkipButton,
|
169
|
+
} = props
|
170
|
+
|
171
|
+
const ariaProps = buildAriaProps(aria)
|
172
|
+
const dataProps = buildDataProps(data)
|
173
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
174
|
+
const classes = classnames(buildCss('pb_walkthrough'), globalProps(props), className)
|
175
|
+
|
176
|
+
return (
|
177
|
+
<div
|
178
|
+
{...ariaProps}
|
179
|
+
{...dataProps}
|
180
|
+
{...htmlProps}
|
181
|
+
className={classes}
|
182
|
+
id={id}
|
183
|
+
>
|
184
|
+
<Joyride
|
185
|
+
callback={callback}
|
186
|
+
continuous={continuous}
|
187
|
+
disableOverlay={disableOverlay}
|
188
|
+
disableScrolling
|
189
|
+
floaterProps={floaterProps}
|
190
|
+
run={run}
|
191
|
+
showSkipButton={showSkipButton}
|
192
|
+
steps={steps}
|
193
|
+
styles={styles}
|
194
|
+
tooltipComponent={Tooltip}
|
195
|
+
{...props}
|
196
|
+
/>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
)
|
200
|
+
}
|
201
|
+
|
202
|
+
export default Walkthrough
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import Button from '../../pb_button/_button'
|
3
|
+
import Walkthrough from '../../pb_walkthrough/_walkthrough'
|
4
|
+
|
5
|
+
const WalkthroughContinuous = (props) => {
|
6
|
+
const [state, setState] = useState({
|
7
|
+
run: false,
|
8
|
+
steps: [
|
9
|
+
{
|
10
|
+
title: 'Example Title',
|
11
|
+
content: 'Setting the prop - continuous allows the next button to appear and lets the user move to the next step by pressing the next button instead of the beacon',
|
12
|
+
target: '.examplePaused',
|
13
|
+
},
|
14
|
+
{
|
15
|
+
title: 'Toggle',
|
16
|
+
content: 'Setting the prop - continuous allows the next button to appear and lets the user move to the next step by pressing the next button instead of the beacon',
|
17
|
+
target: '.pb_toggle_control',
|
18
|
+
},
|
19
|
+
{
|
20
|
+
title: 'Top Nav',
|
21
|
+
content: 'Setting the prop - continuous allows the next button to appear and lets the user move to the next step by pressing the next button instead of the beacon',
|
22
|
+
target: '.pb--page--topNav',
|
23
|
+
},
|
24
|
+
],
|
25
|
+
})
|
26
|
+
|
27
|
+
return (
|
28
|
+
<div>
|
29
|
+
<div
|
30
|
+
className="examplePaused"
|
31
|
+
style={{ 'display': 'inline' }}
|
32
|
+
>
|
33
|
+
{'Start the Tour. Then click the Beacon to demo the default behavior of the Walkthrough Kit'}
|
34
|
+
</div>
|
35
|
+
<br />
|
36
|
+
<br />
|
37
|
+
<Button
|
38
|
+
onClick={() => {
|
39
|
+
setState({ ...state,
|
40
|
+
run: true,
|
41
|
+
})
|
42
|
+
}}
|
43
|
+
>
|
44
|
+
{'Start Tour'}
|
45
|
+
</Button>
|
46
|
+
<br />
|
47
|
+
<br />
|
48
|
+
<Button
|
49
|
+
onClick={() => {
|
50
|
+
setState({
|
51
|
+
...state,
|
52
|
+
run: false,
|
53
|
+
})
|
54
|
+
}}
|
55
|
+
>
|
56
|
+
{'Reset/Stop Tour'}
|
57
|
+
</Button>
|
58
|
+
|
59
|
+
<Walkthrough
|
60
|
+
run={state.run}
|
61
|
+
steps={state.steps}
|
62
|
+
{...props}
|
63
|
+
continuous
|
64
|
+
/>
|
65
|
+
</div>
|
66
|
+
)
|
67
|
+
}
|
68
|
+
|
69
|
+
export default WalkthroughContinuous
|