playbook_ui 14.13.0.pre.alpha.play1851checkboxreacthook6083 → 14.13.0.pre.alpha.play1884progresspill6064
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +8 -17
- data/app/pb_kits/playbook/pb_checkbox/checkbox.test.js +0 -16
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -3
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +2 -1
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
- data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -2
- data/dist/chunks/{_typeahead-CR2Xkt-o.js → _typeahead-btjo1UN5.js} +2 -2
- data/dist/chunks/_weekday_stacked-TIh9nTmZ.js +45 -0
- data/dist/chunks/{lib-WQEeEj3t.js → lib-DjpLC8uO.js} +1 -1
- data/dist/chunks/{pb_form_validation-Cq64l4zn.js → pb_form_validation-S56UaHZl.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 +7 -11
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +0 -69
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -96
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +0 -101
- data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +0 -1
- data/dist/chunks/_weekday_stacked-9LU-xxnS.js +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21317a1c7d5325bd88ac09a06b74859e30a5fcf6748c6b4b710c500189733796
|
4
|
+
data.tar.gz: 0f6e8ac0625c5ba45989ab65b84603c15e777699e9726e2a7769d6e2aa57dd5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7555df6aeccfb138dd8a45ff0a86b1e1843ba3ae6640a29d27899f2a9972b717f26cda50b79da966a5681b5eea56394f0a97823b165e27194add95c3e892158
|
7
|
+
data.tar.gz: 275833538e43720396649195b958886d4d4cca24f5b9e8e977fc1b7ec520d6e1151665de6d02086b11e05c45414f2b9c03d941df3fd43ad2fcd78ce403f4472b
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useEffect, useRef
|
1
|
+
import React, { useEffect, useRef } from 'react'
|
2
2
|
import Body from '../pb_body/_body'
|
3
3
|
import Icon from '../pb_icon/_icon'
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
@@ -24,7 +24,7 @@ type CheckboxProps = {
|
|
24
24
|
value?: string,
|
25
25
|
} & GlobalProps
|
26
26
|
|
27
|
-
const Checkbox =
|
27
|
+
const Checkbox = (props: CheckboxProps): React.ReactElement => {
|
28
28
|
const {
|
29
29
|
aria = {},
|
30
30
|
checked = false,
|
@@ -44,15 +44,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
44
44
|
value = '',
|
45
45
|
} = props
|
46
46
|
|
47
|
-
const
|
48
|
-
const setRefs = (el: HTMLInputElement) => {
|
49
|
-
internalRef.current = el
|
50
|
-
if (typeof ref === 'function') {
|
51
|
-
ref(el)
|
52
|
-
} else if (ref) {
|
53
|
-
(ref as React.MutableRefObject<HTMLInputElement | null>).current = el
|
54
|
-
}
|
55
|
-
}
|
47
|
+
const checkRef = useRef(null)
|
56
48
|
const ariaProps = buildAriaProps(aria)
|
57
49
|
const dataProps = buildDataProps(data)
|
58
50
|
const htmlProps = buildHtmlProps(htmlOptions)
|
@@ -64,9 +56,9 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
64
56
|
)
|
65
57
|
|
66
58
|
useEffect(() => {
|
67
|
-
if (
|
68
|
-
|
69
|
-
|
59
|
+
if (checkRef.current) {
|
60
|
+
checkRef.current.checked = checked
|
61
|
+
checkRef.current.indeterminate = indeterminate
|
70
62
|
}
|
71
63
|
}, [indeterminate, checked])
|
72
64
|
|
@@ -80,7 +72,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
80
72
|
disabled={disabled}
|
81
73
|
name={name}
|
82
74
|
onChange={onChange}
|
83
|
-
ref={
|
75
|
+
ref={checkRef}
|
84
76
|
tabIndex={tabIndex}
|
85
77
|
type="checkbox"
|
86
78
|
value={value}
|
@@ -127,7 +119,6 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
127
119
|
</Body>
|
128
120
|
</label>
|
129
121
|
)
|
130
|
-
}
|
122
|
+
}
|
131
123
|
|
132
|
-
Checkbox.displayName = "Checkbox"
|
133
124
|
export default Checkbox
|
@@ -106,19 +106,3 @@ test('has disabled attribute', () => {
|
|
106
106
|
const input = kit.querySelector('input')
|
107
107
|
expect(input).toHaveAttribute('disabled')
|
108
108
|
})
|
109
|
-
|
110
|
-
test('has ref in the input element', () => {
|
111
|
-
const ref = React.createRef()
|
112
|
-
render(
|
113
|
-
<Checkbox
|
114
|
-
data={{ testid: testId }}
|
115
|
-
name="checkbox-name"
|
116
|
-
ref={ref}
|
117
|
-
text="Checkbox"
|
118
|
-
value="check-box value"
|
119
|
-
/>
|
120
|
-
)
|
121
|
-
|
122
|
-
expect(ref.current).not.toBeNull()
|
123
|
-
expect(ref.current?.tagName).toBe('INPUT')
|
124
|
-
})
|
@@ -11,7 +11,6 @@ examples:
|
|
11
11
|
react:
|
12
12
|
- checkbox_default: Default
|
13
13
|
- checkbox_checked: Load as checked
|
14
|
-
- checkbox_react_hook: React Hook Form
|
15
14
|
- checkbox_custom: Custom Checkbox
|
16
15
|
- checkbox_error: Default w/ Error
|
17
16
|
- checkbox_indeterminate: Indeterminate Checkbox
|
@@ -22,4 +21,4 @@ examples:
|
|
22
21
|
- checkbox_error_swift: Default w/ Error
|
23
22
|
- checkbox_indeterminate_swift: Indeterminate Checkbox
|
24
23
|
- checkbox_props_swift: ""
|
25
|
-
|
24
|
+
|
@@ -1,6 +1,5 @@
|
|
1
1
|
export { default as CheckboxDefault } from './_checkbox_default.jsx'
|
2
2
|
export { default as CheckboxCustom } from './_checkbox_custom.jsx'
|
3
|
-
export { default as CheckboxReactHook } from './_checkbox_react_hook.jsx'
|
4
3
|
export { default as CheckboxError } from './_checkbox_error.jsx'
|
5
4
|
export { default as CheckboxChecked } from './_checkbox_checked.jsx'
|
6
5
|
export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
|
@@ -29,7 +29,6 @@ type DatePickerProps = {
|
|
29
29
|
hideLabel?: boolean,
|
30
30
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
31
31
|
id?: string,
|
32
|
-
initializeOnce?: boolean,
|
33
32
|
inLine?: boolean,
|
34
33
|
inputAria?: { [key: string]: string },
|
35
34
|
inputData?: { [key: string]: string },
|
@@ -74,7 +73,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
74
73
|
hideLabel = false,
|
75
74
|
htmlOptions = {},
|
76
75
|
id,
|
77
|
-
initializeOnce = false,
|
78
76
|
inLine = false,
|
79
77
|
inputAria = {},
|
80
78
|
inputData = {},
|
@@ -136,7 +134,7 @@ useEffect(() => {
|
|
136
134
|
yearRange,
|
137
135
|
required: false,
|
138
136
|
}, scrollContainer)
|
139
|
-
}
|
137
|
+
})
|
140
138
|
const filteredProps = {...props}
|
141
139
|
if (filteredProps.marginBottom === undefined) {
|
142
140
|
filteredProps.marginBottom = "sm"
|
@@ -0,0 +1 @@
|
|
1
|
+
Progress pills start at `45px` wide if the container allows, but will shrink down to `1px` as the container gets smaller. Resize this window to see each pill shrink.
|
@@ -35,7 +35,6 @@ examples:
|
|
35
35
|
- table_with_collapsible_with_nested_rows_rails: Table with Collapsible with Nested Rows
|
36
36
|
- table_with_collapsible_with_nested_table_rails: Table with Collapsible with Nested Table
|
37
37
|
- table_with_clickable_rows: Table with Clickable Rows
|
38
|
-
- table_with_selectable_rows: Table with Selectable Rows
|
39
38
|
|
40
39
|
react:
|
41
40
|
- table_sm: Small
|
@@ -72,5 +71,4 @@ examples:
|
|
72
71
|
- table_with_collapsible_with_custom_content: Table with Collapsible with Custom Content
|
73
72
|
- table_with_collapsible_with_nested_rows: Table with Collapsible with Nested Rows
|
74
73
|
- table_with_collapsible_with_nested_table: Table with Collapsible with Nested Table
|
75
|
-
- table_with_clickable_rows: Table with Clickable Rows
|
76
|
-
- table_with_selectable_rows: Table with Selectable Rows
|
74
|
+
- table_with_clickable_rows: Table with Clickable Rows
|
@@ -33,5 +33,4 @@ export { default as TableWithCollapsibleWithCustomContent } from './_table_with_
|
|
33
33
|
export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
|
34
34
|
export { default as TableWithCollapsibleWithNestedRows } from './_table_with_collapsible_with_nested_rows.jsx'
|
35
35
|
export { default as TableWithCollapsibleWithCustomClick } from './_table_with_collapsible_with_custom_click.jsx'
|
36
|
-
export { default as
|
37
|
-
export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
|
36
|
+
export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
|