playbook_ui 14.18.0.pre.rc.0 → 14.18.0.pre.rc.2
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 +23 -3
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +11 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +60 -128
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +58 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +64 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +8 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +55 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +6 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +6 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +6 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +97 -0
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +19 -45
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +54 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +3 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +45 -0
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +23 -3
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +15 -5
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +39 -6
- data/app/pb_kits/playbook/pb_layout/_layout.scss +70 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +29 -2
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +322 -118
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +74 -43
- data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +79 -0
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +21 -4
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +49 -22
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +15 -4
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +63 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +3 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +1 -7
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +39 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +1 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +40 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +5 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +39 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +3 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +3 -1
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +13 -5
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +94 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +8 -1
- data/dist/chunks/{_typeahead-C2GOKWtm.js → _typeahead-DUI-4yjJ.js} +2 -2
- data/dist/chunks/_weekday_stacked-q9YP0zaF.js +45 -0
- data/dist/chunks/{lib-BGzBzFZX.js → lib-BV_AF_eh.js} +3 -3
- data/dist/chunks/{pb_form_validation-BvNy9Bd6.js → pb_form_validation-nsvkJU2J.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -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 +27 -6
- data/dist/chunks/_weekday_stacked-CFGTPT0O.js +0 -45
@@ -84,8 +84,8 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
84
84
|
'single-line': singleLine,
|
85
85
|
'no-hover': disableHover,
|
86
86
|
'sticky-header': sticky,
|
87
|
-
'sticky-left-column': stickyLeftColumn,
|
88
|
-
'sticky-right-column': stickyRightColumn,
|
87
|
+
'sticky-left-column': stickyLeftColumn.length,
|
88
|
+
'sticky-right-column': stickyRightColumn.length,
|
89
89
|
'striped': striped,
|
90
90
|
'header-borderless': headerStyle === 'borderless',
|
91
91
|
'header-floating': headerStyle === 'floating',
|
@@ -1,3 +1,5 @@
|
|
1
1
|
The `collapsibleContent` can display any content, including nested Table Rows.
|
2
2
|
|
3
|
-
Additionally, the `collapsibleSideHighlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
3
|
+
Additionally, the `collapsibleSideHighlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
4
|
+
|
5
|
+
**NOTE**: We advise against using the `disableHover` Table prop when nesting Table Rows within a Table.
|
@@ -1,3 +1,5 @@
|
|
1
1
|
The `collapsible_content` can display any content, including nested Table Rows.
|
2
2
|
|
3
|
-
Additionally, the `collapsible_side_highlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
3
|
+
Additionally, the `collapsible_side_highlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
4
|
+
|
5
|
+
**NOTE**: We advise against using the `disable_hover` Table prop when nesting Table Rows within a Table.
|
@@ -1 +1,3 @@
|
|
1
|
-
The `collapsible_content` can also be used to display nested Tables within each Row.
|
1
|
+
The `collapsible_content` can also be used to display nested Tables within each Row.
|
2
|
+
|
3
|
+
**NOTE**: We advise against using the `disable_hover` Table prop when nesting Tables within a Table.
|
@@ -25,7 +25,7 @@ type TextInputProps = {
|
|
25
25
|
name: string,
|
26
26
|
label: string,
|
27
27
|
mask?: 'currency' | 'zipCode' | 'postalCode' | 'ssn',
|
28
|
-
onChange: (e: React.FormEvent<HTMLInputElement
|
28
|
+
onChange: (e: React.FormEvent<HTMLInputElement>, sanitizedValue?: string) => void,
|
29
29
|
placeholder: string,
|
30
30
|
required?: boolean,
|
31
31
|
type: string,
|
@@ -102,10 +102,16 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
102
102
|
|
103
103
|
let cursorPosition = e.target.selectionStart;
|
104
104
|
const isAtEnd = cursorPosition === inputValue.length;
|
105
|
-
|
105
|
+
|
106
106
|
const formattedValue = INPUTMASKS[mask].format(inputValue)
|
107
|
+
|
108
|
+
let sanitizedValue = formattedValue;
|
109
|
+
if (INPUTMASKS[mask].sanitize) {
|
110
|
+
sanitizedValue = INPUTMASKS[mask].sanitize(formattedValue)
|
111
|
+
}
|
112
|
+
|
107
113
|
e.target.value = formattedValue
|
108
|
-
|
114
|
+
|
109
115
|
// Keep cursor position
|
110
116
|
if (!isAtEnd) {
|
111
117
|
// Account for extra characters (e.g., commas added/removed in currency)
|
@@ -116,9 +122,11 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
116
122
|
}
|
117
123
|
e.target.selectionStart = e.target.selectionEnd = cursorPosition
|
118
124
|
}
|
125
|
+
|
126
|
+
onChange(e, sanitizedValue);
|
127
|
+
} else {
|
128
|
+
onChange(e)
|
119
129
|
}
|
120
|
-
|
121
|
-
onChange(e)
|
122
130
|
}
|
123
131
|
|
124
132
|
const childInput = children ? children.type === "input" : undefined
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
|
3
|
+
import TextInput from '../../pb_text_input/_text_input'
|
4
|
+
|
5
|
+
const TextInputSanitize = (props) => {
|
6
|
+
const ref = React.createRef()
|
7
|
+
|
8
|
+
const [currency, setCurrency] = useState('')
|
9
|
+
const [sanitizedCurrency, setSanitizedCurrency] = useState('')
|
10
|
+
const handleOnChangeSanitizeCurrency = ({ target }, sanitizedValue) => {
|
11
|
+
setCurrency(target.value)
|
12
|
+
setSanitizedCurrency(sanitizedValue);
|
13
|
+
}
|
14
|
+
|
15
|
+
const [creditCard, setCreditCard] = useState('')
|
16
|
+
const [sanitizedCreditCard, setSanitizedCreditCard] = useState('')
|
17
|
+
const handleOnChangeSanitizeCC = ({ target }, sanitizedValue) => {
|
18
|
+
setCreditCard(target.value)
|
19
|
+
setSanitizedCreditCard(sanitizedValue);
|
20
|
+
}
|
21
|
+
|
22
|
+
const [ssn, setSSN] = useState('')
|
23
|
+
const [sanitizedSSN, setSanitizedSSN] = useState('')
|
24
|
+
const handleOnChangeSanitizeSSN = ({ target }, sanitizedValue) => {
|
25
|
+
setSSN(target.value)
|
26
|
+
setSanitizedSSN(sanitizedValue);
|
27
|
+
}
|
28
|
+
|
29
|
+
return (
|
30
|
+
<div>
|
31
|
+
<TextInput
|
32
|
+
label="Currency"
|
33
|
+
mask="currency"
|
34
|
+
onChange={handleOnChangeSanitizeCurrency}
|
35
|
+
placeholder="Enter Amount"
|
36
|
+
ref={ref}
|
37
|
+
value={currency}
|
38
|
+
{...props}
|
39
|
+
/>
|
40
|
+
|
41
|
+
{currency !== "" && (
|
42
|
+
<React.Fragment>{`The masked value is: ${currency}`}</React.Fragment>
|
43
|
+
)}
|
44
|
+
<br />
|
45
|
+
{sanitizedCurrency !== "" && (
|
46
|
+
<React.Fragment>{`The sanitized value is: ${sanitizedCurrency}`}</React.Fragment>
|
47
|
+
)}
|
48
|
+
|
49
|
+
<br />
|
50
|
+
<br />
|
51
|
+
|
52
|
+
<TextInput
|
53
|
+
label="Credit Card"
|
54
|
+
mask="creditCard"
|
55
|
+
onChange={handleOnChangeSanitizeCC}
|
56
|
+
placeholder="Enter Card"
|
57
|
+
ref={ref}
|
58
|
+
value={creditCard}
|
59
|
+
{...props}
|
60
|
+
/>
|
61
|
+
|
62
|
+
{creditCard !== "" && (
|
63
|
+
<React.Fragment>{`The masked value is: ${creditCard}`}</React.Fragment>
|
64
|
+
)}
|
65
|
+
<br />
|
66
|
+
{sanitizedCreditCard !== "" && (
|
67
|
+
<React.Fragment>{`The sanitized value is: ${sanitizedCreditCard}`}</React.Fragment>
|
68
|
+
)}
|
69
|
+
|
70
|
+
<br />
|
71
|
+
<br />
|
72
|
+
|
73
|
+
<TextInput
|
74
|
+
label="SSN"
|
75
|
+
mask="ssn"
|
76
|
+
onChange={handleOnChangeSanitizeSSN}
|
77
|
+
placeholder="Enter Amount"
|
78
|
+
ref={ref}
|
79
|
+
value={ssn}
|
80
|
+
{...props}
|
81
|
+
/>
|
82
|
+
|
83
|
+
{ssn !== "" && (
|
84
|
+
<React.Fragment>{`The masked value is: ${ssn}`}</React.Fragment>
|
85
|
+
)}
|
86
|
+
<br />
|
87
|
+
{sanitizedSSN !== "" && (
|
88
|
+
<React.Fragment>{`The sanitized value is: ${sanitizedSSN}`}</React.Fragment>
|
89
|
+
)}
|
90
|
+
</div>
|
91
|
+
)
|
92
|
+
}
|
93
|
+
|
94
|
+
export default TextInputSanitize
|
@@ -0,0 +1 @@
|
|
1
|
+
When utilizing the Mask prop, you can retrieve the sanitized value of your input through an event handler that targets `sanitizedValue`.
|
@@ -6,3 +6,4 @@ export { default as TextInputAddOn } from './_text_input_add_on.jsx'
|
|
6
6
|
export { default as TextInputInline } from './_text_input_inline.jsx'
|
7
7
|
export { default as TextInputNoLabel } from './_text_input_no_label.jsx'
|
8
8
|
export { default as TextInputMask } from './_text_input_mask.jsx'
|
9
|
+
export { default as TextInputSanitize } from './_text_input_sanitize.jsx'
|
@@ -3,6 +3,7 @@ type InputMask = {
|
|
3
3
|
formatDefaultValue: (value: string) => string
|
4
4
|
pattern: string
|
5
5
|
placeholder: string
|
6
|
+
sanitize?: (value: string) => string;
|
6
7
|
}
|
7
8
|
|
8
9
|
type InputMaskDictionary = {
|
@@ -73,35 +74,41 @@ export const INPUTMASKS: InputMaskDictionary = {
|
|
73
74
|
// eslint-disable-next-line no-useless-escape
|
74
75
|
pattern: '^\\$\\d{1,3}(?:,\\d{3})*(?:\\.\\d{2})?$',
|
75
76
|
placeholder: '$0.00',
|
77
|
+
sanitize: (value: string) => value.replace(/[$,]/g, ''),
|
76
78
|
},
|
77
79
|
zipCode: {
|
78
80
|
format: formatBasicPostal,
|
79
81
|
formatDefaultValue: formatBasicPostal,
|
80
82
|
pattern: '\\d{5}',
|
81
83
|
placeholder: '12345',
|
84
|
+
sanitize: (value: string) => value,
|
82
85
|
},
|
83
86
|
postalCode: {
|
84
87
|
format: formatExtendedPostal,
|
85
88
|
formatDefaultValue: formatExtendedPostal,
|
86
89
|
pattern: '\\d{5}-\\d{4}',
|
87
90
|
placeholder: '12345-6789',
|
91
|
+
sanitize: (value: string) => value.replace(/-/g, ''),
|
88
92
|
},
|
89
93
|
ssn: {
|
90
94
|
format: formatSSN,
|
91
95
|
formatDefaultValue: formatSSN,
|
92
96
|
pattern: '\\d{3}-\\d{2}-\\d{4}',
|
93
97
|
placeholder: '123-45-6789',
|
98
|
+
sanitize: (value: string) => value.replace(/-/g, ''),
|
94
99
|
},
|
95
100
|
creditCard: {
|
96
101
|
format: formatCreditCard,
|
97
102
|
formatDefaultValue: formatCreditCard,
|
98
103
|
pattern: '\\d{4} \\d{4} \\d{4} \\d{4}',
|
99
104
|
placeholder: '1234 5678 9012 3456',
|
105
|
+
sanitize: (value: string) => value.replace(/\s/g, ''),
|
100
106
|
},
|
101
107
|
cvv: {
|
102
108
|
format: formatCVV,
|
103
109
|
formatDefaultValue: formatCVV,
|
104
110
|
pattern: '\\d{3,4}',
|
105
111
|
placeholder: '123',
|
112
|
+
sanitize: (value: string) => value,
|
106
113
|
},
|
107
|
-
}
|
114
|
+
}
|