playbook_ui 14.13.0.pre.alpha.play1851checkboxreacthook6083 → 14.13.0.pre.alpha.play1884progresspill6064

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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +8 -17
  3. data/app/pb_kits/playbook/pb_checkbox/checkbox.test.js +0 -16
  4. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -2
  5. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
  6. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -3
  7. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +2 -1
  8. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
  9. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
  10. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
  11. data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -3
  12. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -2
  13. data/dist/chunks/{_typeahead-CR2Xkt-o.js → _typeahead-btjo1UN5.js} +2 -2
  14. data/dist/chunks/_weekday_stacked-TIh9nTmZ.js +45 -0
  15. data/dist/chunks/{lib-WQEeEj3t.js → lib-DjpLC8uO.js} +1 -1
  16. data/dist/chunks/{pb_form_validation-Cq64l4zn.js → pb_form_validation-S56UaHZl.js} +1 -1
  17. data/dist/chunks/vendor.js +1 -1
  18. data/dist/playbook-doc.js +1 -1
  19. data/dist/playbook-rails-react-bindings.js +1 -1
  20. data/dist/playbook-rails.js +1 -1
  21. data/dist/playbook.css +1 -1
  22. data/lib/playbook/version.rb +1 -1
  23. metadata +7 -11
  24. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +0 -69
  25. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +0 -1
  26. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -96
  27. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +0 -101
  28. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +0 -1
  29. 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: bb3a9002f9a8764511848a3c3d772fadf25f5f54630059aa06c9a4369335179d
4
- data.tar.gz: a6a46c5bfdb0e7a0a93957852210185c6e9eece5faa63454c1815b5b75e6c63d
3
+ metadata.gz: 21317a1c7d5325bd88ac09a06b74859e30a5fcf6748c6b4b710c500189733796
4
+ data.tar.gz: 0f6e8ac0625c5ba45989ab65b84603c15e777699e9726e2a7769d6e2aa57dd5e
5
5
  SHA512:
6
- metadata.gz: 9224cd88c0f6759480689ee6637464d0a05ff61e69093a1f834f5b1a0477543883204e81b0cce35d67b0ca66b6d00bfc2bcd2f5302e15bd4c008d21c2e3fc352
7
- data.tar.gz: 70771f474c26f416e72a5906f06e4b8b36109daa5d492bc21a5e2a8b8cbb0ac49eb7e4c68ab36a6952dbc8d3be99db7d835390987d8ccc647304b61c8d0cebce
6
+ metadata.gz: a7555df6aeccfb138dd8a45ff0a86b1e1843ba3ae6640a29d27899f2a9972b717f26cda50b79da966a5681b5eea56394f0a97823b165e27194add95c3e892158
7
+ data.tar.gz: 275833538e43720396649195b958886d4d4cca24f5b9e8e977fc1b7ec520d6e1151665de6d02086b11e05c45414f2b9c03d941df3fd43ad2fcd78ce403f4472b
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef, forwardRef } from 'react'
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 = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
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 internalRef = useRef<HTMLInputElement>(null)
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 (internalRef.current) {
68
- internalRef.current.checked = checked
69
- internalRef.current.indeterminate = indeterminate
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={setRefs}
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
- }, initializeOnce ? [] : undefined)
137
+ })
140
138
  const filteredProps = {...props}
141
139
  if (filteredProps.marginBottom === undefined) {
142
140
  filteredProps.marginBottom = "sm"
@@ -3,7 +3,8 @@
3
3
  @import "../tokens/border_radius";
4
4
 
5
5
  @mixin pb_progress_pill {
6
- width: 45px;
6
+ width: 100%;
7
+ max-width: 45px;
7
8
  height: 4px;
8
9
  border-radius: $border_rad_light;
9
10
  margin-right: $space_xs;
@@ -1 +1,2 @@
1
1
  <%= pb_rails("progress_pills", props: { aria: { label: "2 out of 3 steps complete" }, steps: 3, active: 2 }) %>
2
+ <%= pb_rails("progress_pills", props: { aria: { label: "9 out of 18 steps complete" }, steps: 18, active: 9, margin_top: "md" }) %>
@@ -10,6 +10,13 @@ const ProgressPillsDefault = (props) => {
10
10
  steps={3}
11
11
  {...props}
12
12
  />
13
+ <ProgressPills
14
+ active={9}
15
+ aria={{ label: '9 out of 18 steps complete' }}
16
+ marginTop="md"
17
+ steps={18}
18
+ {...props}
19
+ />
13
20
  </>
14
21
  )
15
22
  }
@@ -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 TableWithSelectableRows } from './_table_with_selectable_rows.jsx'
37
- export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'
36
+ export { default as TableWithClickableRows } from './_table_with_clickable_rows.jsx'