playbook_ui 14.14.0.pre.alpha.PBNTR907reactfilterpopoverpropswidthbug6557 → 14.14.0.pre.alpha.pbntr500currencykithandlingofnullvalues6275

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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +3 -143
  3. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +99 -45
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +7 -123
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +299 -153
  6. data/app/pb_kits/playbook/pb_card/_card.tsx +1 -2
  7. data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -1
  8. data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -1
  9. data/app/pb_kits/playbook/pb_currency/currency.rb +2 -14
  10. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb +1 -3
  11. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -4
  12. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -2
  13. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +3 -43
  14. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -3
  15. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +37 -20
  16. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -20
  17. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +6 -6
  18. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +0 -1
  19. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -6
  20. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -20
  21. data/app/pb_kits/playbook/pb_drawer/drawer.rb +1 -49
  22. data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +4 -5
  23. data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +2 -2
  24. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -2
  25. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -9
  26. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +0 -4
  27. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
  28. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
  29. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +1 -7
  30. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -4
  31. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +0 -7
  32. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +3 -13
  33. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +1 -2
  34. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
  35. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -6
  36. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -13
  37. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +1 -7
  38. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
  39. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
  40. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +3 -5
  41. data/app/pb_kits/playbook/pb_overlay/overlay.rb +1 -16
  42. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -12
  43. data/app/pb_kits/playbook/pb_popover/_popover.tsx +2 -2
  44. data/app/pb_kits/playbook/pb_popover/popover.test.js +1 -1
  45. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +2 -2
  46. data/app/pb_kits/playbook/pb_radio/_radio.tsx +74 -85
  47. data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -2
  48. data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
  49. data/app/pb_kits/playbook/pb_radio/radio.test.js +0 -16
  50. data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -1
  51. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
  52. data/app/pb_kits/playbook/pb_select/select.html.erb +5 -3
  53. data/app/pb_kits/playbook/pb_select/select.rb +0 -8
  54. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +5 -1
  55. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +4 -1
  56. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +5 -1
  57. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -2
  58. data/app/pb_kits/playbook/pb_title/_title.scss +0 -32
  59. data/app/pb_kits/playbook/pb_title/_title.tsx +1 -10
  60. data/app/pb_kits/playbook/pb_title/docs/_title_default.html.erb +2 -1
  61. data/app/pb_kits/playbook/pb_title/docs/_title_default.jsx +1 -1
  62. data/app/pb_kits/playbook/pb_title/docs/example.yml +0 -2
  63. data/app/pb_kits/playbook/pb_title/docs/index.js +0 -1
  64. data/app/pb_kits/playbook/pb_title/title.rb +1 -10
  65. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +3 -0
  66. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +0 -25
  67. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -3
  68. data/app/pb_kits/playbook/pb_tooltip/docs/index.js +0 -1
  69. data/app/pb_kits/playbook/pb_tooltip/index.js +2 -2
  70. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -10
  71. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -36
  72. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -5
  73. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  74. data/app/pb_kits/playbook/pb_typeahead/index.ts +8 -61
  75. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +2 -17
  76. data/app/pb_kits/playbook/utilities/object.ts +1 -29
  77. data/dist/chunks/_typeahead-PqkcDf1H.js +36 -0
  78. data/dist/chunks/_weekday_stacked-BhC8Xp9l.js +45 -0
  79. data/dist/chunks/{lib-5OzNgeeu.js → lib-D3us1bGD.js} +2 -2
  80. data/dist/chunks/{pb_form_validation-DGhKbZtO.js → pb_form_validation-BpihMSOQ.js} +1 -1
  81. data/dist/chunks/vendor.js +1 -1
  82. data/dist/menu.yml +3 -3
  83. data/dist/playbook-doc.js +1 -1
  84. data/dist/playbook-rails-react-bindings.js +1 -1
  85. data/dist/playbook-rails.js +1 -1
  86. data/dist/playbook.css +1 -1
  87. data/lib/playbook/version.rb +1 -1
  88. metadata +6 -64
  89. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +0 -127
  90. data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +0 -55
  91. data/app/pb_kits/playbook/pb_advanced_table/Components/TablePagination.tsx +0 -33
  92. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +0 -275
  93. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +0 -66
  94. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +0 -195
  95. data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +0 -73
  96. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +0 -52
  97. data/app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts +0 -80
  98. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +0 -50
  99. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json +0 -152002
  100. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md +0 -1
  101. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md +0 -1
  102. data/app/pb_kits/playbook/pb_date_picker/index.ts +0 -38
  103. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  104. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  105. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  106. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  107. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  108. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  109. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  110. data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
  111. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.html.erb +0 -40
  112. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +0 -50
  113. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.md +0 -3
  114. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -71
  115. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +0 -17
  116. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +0 -61
  117. data/app/pb_kits/playbook/pb_icon_button/docs/index.js +0 -2
  118. data/app/pb_kits/playbook/pb_icon_button/icon_button.test.jsx +0 -39
  119. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.html.erb +0 -72
  120. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.jsx +0 -91
  121. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +0 -11
  122. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +0 -37
  123. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +0 -1
  124. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +0 -1
  125. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
  126. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
  127. data/app/pb_kits/playbook/pb_overlay/index.js +0 -61
  128. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +0 -60
  129. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.md +0 -1
  130. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +0 -58
  131. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.md +0 -1
  132. data/app/pb_kits/playbook/pb_select/index.js +0 -38
  133. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.html.erb +0 -7
  134. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.jsx +0 -54
  135. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.md +0 -1
  136. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
  137. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
  138. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
  139. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +0 -69
  140. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.md +0 -3
  141. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  142. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +0 -45
  143. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +0 -5
  144. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +0 -33
  145. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +0 -3
  146. data/app/pb_kits/playbook/utilities/object.test.js +0 -99
  147. data/dist/chunks/_typeahead-F4bG5YsC.js +0 -36
  148. data/dist/chunks/_weekday_stacked-CaWVQMMq.js +0 -45
@@ -1,61 +0,0 @@
1
- import React from 'react'
2
- import { IconButton, Flex } from 'playbook-ui'
3
-
4
- const IconButtonSizes = (props) => (
5
- <div>
6
- <Flex align="center">
7
- <IconButton
8
- {...props}
9
- size="lg"
10
- />
11
- <span>Large</span>
12
- </Flex>
13
- <Flex align="center">
14
- <IconButton
15
- {...props}
16
- size="sm"
17
- />
18
- <span>Small</span>
19
- </Flex>
20
- <Flex align="center">
21
- <IconButton
22
- {...props}
23
- size="xs"
24
- />
25
- <span>XSmall</span>
26
- </Flex>
27
- <Flex
28
- align="center"
29
- marginTop="md"
30
- >
31
- <IconButton
32
- {...props}
33
- size="1x"
34
- />
35
- <span>1x</span>
36
- </Flex>
37
- <Flex align="center">
38
- <IconButton
39
- {...props}
40
- size="2x"
41
- />
42
- <span>2x</span>
43
- </Flex>
44
- <Flex align="center">
45
- <IconButton
46
- {...props}
47
- size="3x"
48
- />
49
- <span>3x</span>
50
- </Flex>
51
- <Flex align="center">
52
- <IconButton
53
- {...props}
54
- size="4x"
55
- />
56
- <span>4x</span>
57
- </Flex>
58
- </div>
59
- )
60
-
61
- export default IconButtonSizes
@@ -1,2 +0,0 @@
1
- export { default as IconButtonDefault } from './_icon_button_default.jsx'
2
- export { default as IconButtonSizes } from './_icon_button_sizes.jsx'
@@ -1,39 +0,0 @@
1
- import { ensureAccessible, renderKit } from '../utilities/test-utils'
2
-
3
- import { IconButton } from 'playbook-ui'
4
-
5
- const props = {
6
- data: { testid: 'default', icon: 'plus' }
7
- }
8
-
9
- test('default test', () => {
10
- const kit = renderKit(IconButton, props)
11
-
12
- expect(kit).toBeInTheDocument()
13
- expect(kit).toHaveClass('pb_icon_button_kit_default')
14
-
15
- const iconElement = kit.querySelector('.icon_button_icon')
16
- expect(iconElement).toBeInTheDocument()
17
- })
18
-
19
- it("should be accessible", async () => {
20
- ensureAccessible(IconButton, props)
21
- })
22
-
23
- test('passes link variant prop', () => {
24
- const kit = renderKit(IconButton, { ...props, variant: "link" })
25
- expect(kit).toBeInTheDocument()
26
- expect(kit).toHaveClass('pb_icon_button_kit_link')
27
- })
28
-
29
- test('should set button type to "submit" when htmlType prop is passed', () => {
30
- const kit = renderKit(IconButton, { ...props, htmlType: 'submit' })
31
- const buttonElement = kit.querySelector('button')
32
- expect(buttonElement).toHaveAttribute('type', 'submit')
33
- })
34
-
35
- test('passes custom classname', () => {
36
- const kit = renderKit(IconButton, { ...props, className: "extra_class" })
37
- expect(kit).toBeInTheDocument()
38
- expect(kit).toHaveClass('pb_icon_button_kit_default extra_class')
39
- })
@@ -1,72 +0,0 @@
1
- <% treeData = [{
2
- label: "Power Home Remodeling",
3
- value: "Power Home Remodeling",
4
- id: "100",
5
- expanded: true,
6
- children: [
7
- {
8
- label: "People",
9
- value: "People",
10
- id: "101",
11
- expanded: true,
12
- children: [
13
- {
14
- label: "Talent Acquisition",
15
- value: "Talent Acquisition",
16
- id: "102",
17
- },
18
- {
19
- label: "Business Affairs",
20
- value: "Business Affairs",
21
- id: "103",
22
- children: [
23
- {
24
- label: "Initiatives",
25
- value: "Initiatives",
26
- id: "104",
27
- },
28
- {
29
- label: "Learning & Development",
30
- value: "Learning & Development",
31
- id: "105",
32
- },
33
- ],
34
- },
35
- {
36
- label: "People Experience",
37
- value: "People Experience",
38
- id: "106",
39
- },
40
- ],
41
- },
42
- {
43
- label: "Contact Center",
44
- value: "Contact Center",
45
- id: "107",
46
- children: [
47
- {
48
- label: "Appointment Management",
49
- value: "Appointment Management",
50
- id: "108",
51
- },
52
- {
53
- label: "Customer Service",
54
- value: "Customer Service",
55
- id: "109",
56
- },
57
- {
58
- label: "Energy",
59
- value: "Energy",
60
- id: "110",
61
- },
62
- ],
63
- },
64
- ],
65
- }] %>
66
-
67
- <%= pb_rails("multi_level_select", props: {
68
- disabled: true,
69
- id: "multi-level-select-default-rails",
70
- name: "my_array",
71
- tree_data: treeData
72
- }) %>
@@ -1,91 +0,0 @@
1
- import React from "react";
2
- import MultiLevelSelect from "../_multi_level_select";
3
-
4
- const treeData = [
5
- {
6
- label: "Power Home Remodeling",
7
- value: "Power Home Remodeling",
8
- id: "powerhome1",
9
- expanded: true,
10
- children: [
11
- {
12
- label: "People",
13
- value: "People",
14
- id: "people1",
15
- expanded: true,
16
- children: [
17
- {
18
- label: "Talent Acquisition",
19
- value: "Talent Acquisition",
20
- id: "talent1",
21
- },
22
- {
23
- label: "Business Affairs",
24
- value: "Business Affairs",
25
- id: "business1",
26
- children: [
27
- {
28
- label: "Initiatives",
29
- value: "Initiatives",
30
- id: "initiative1",
31
- },
32
- {
33
- label: "Learning & Development",
34
- value: "Learning & Development",
35
- id: "development1",
36
- },
37
- ],
38
- },
39
- {
40
- label: "People Experience",
41
- value: "People Experience",
42
- id: "experience1",
43
- },
44
- ],
45
- },
46
- {
47
- label: "Contact Center",
48
- value: "Contact Center",
49
- id: "contact1",
50
- children: [
51
- {
52
- label: "Appointment Management",
53
- value: "Appointment Management",
54
- id: "appointment1",
55
- },
56
- {
57
- label: "Customer Service",
58
- value: "Customer Service",
59
- id: "customer1",
60
- },
61
- {
62
- label: "Energy",
63
- value: "Energy",
64
- id: "energy1",
65
- },
66
- ],
67
- },
68
- ],
69
- },
70
- ];
71
-
72
- const MultiLevelSelectDisabled = (props) => {
73
- return (
74
- <>
75
- <MultiLevelSelect
76
- disabled
77
- id='multiselect-default'
78
- onSelect={(selectedNodes) =>
79
- console.log(
80
- "Selected Items",
81
- selectedNodes
82
- )
83
- }
84
- treeData={treeData}
85
- {...props}
86
- />
87
- </>
88
- )
89
- };
90
-
91
- export default MultiLevelSelectDisabled
@@ -1,11 +0,0 @@
1
- <%= pb_rails("overlay", props: { layout: { "x": "xl" }, color: "card_light", scroll_bar_none: true }) do %>
2
- <%= pb_rails("flex", props: { column_gap: "lg", orientation: "row", overflow_x: "auto" }) do %>
3
- <% 15.times do %>
4
- <%= pb_rails("flex/flex_item") do %>
5
- <%= pb_rails("card") do %>
6
- Card content
7
- <% end %>
8
- <% end %>
9
- <% end %>
10
- <% end %>
11
- <% end %>
@@ -1,37 +0,0 @@
1
- import React from 'react'
2
- import {
3
- Overlay,
4
- Card,
5
- Flex,
6
- FlexItem,
7
- } from 'playbook-ui'
8
-
9
- const InlineCardsExample = () => {
10
- return (
11
- <Flex
12
- columnGap="lg"
13
- orientation="row"
14
- overflowX="auto"
15
- >
16
- {Array.from({ length: 15 }, (_, index) => (
17
- <FlexItem key={index}>
18
- <Card>{"Card Content"}</Card>
19
- </FlexItem>
20
- ))}
21
- </Flex>
22
- )
23
- }
24
-
25
- const OverlayHideScrollBar = () => (
26
- <>
27
- <Overlay
28
- color="card_light"
29
- layout={{"x": "xl"}}
30
- scrollBarNone
31
- >
32
- <InlineCardsExample />
33
- </Overlay>
34
- </>
35
- )
36
-
37
- export default OverlayHideScrollBar
@@ -1 +0,0 @@
1
- Pass the `scroll_bar_none` prop to hide the scrollbar from view. This is particularly helpful for small containers where the scrollbar may occupy too much space.
@@ -1 +0,0 @@
1
- Pass the `scrollBarNone` prop to hide the scrollbar from view. This is particularly helpful for small containers where the scrollbar may occupy too much space.
@@ -1,11 +0,0 @@
1
- <%= pb_rails("overlay", props: { layout: { "x": "xl" }, color: "card_light", dynamic: true }) do %>
2
- <%= pb_rails("flex", props: { column_gap: "lg", orientation: "row", overflow_x: "auto" }) do %>
3
- <% 15.times do %>
4
- <%= pb_rails("flex/flex_item") do %>
5
- <%= pb_rails("card") do %>
6
- Card content
7
- <% end %>
8
- <% end %>
9
- <% end %>
10
- <% end %>
11
- <% end %>
@@ -1 +0,0 @@
1
- Pass the `dynamic` prop to make the overlay render while the scrollbar isn't at either end on the scrollbar.
@@ -1,61 +0,0 @@
1
- import PbEnhancedElement from '../pb_enhanced_element'
2
-
3
- const OVERLAY_SELECTOR = '[data-pb-overlay]'
4
- const OVERLAY_SCROLL_ELEMENT = '[data-overlay-scroll-element]'
5
- const PREVIOUS_OVERLAY_CLASSNAME = '[data-previous-overlay-classname]'
6
- const SUBSEQUENT_OVERLAY_CLASSNAME = '[data-subsequent-overlay-classname]'
7
-
8
- export default class PbOverlay extends PbEnhancedElement {
9
- static get selector() {
10
- return OVERLAY_SELECTOR
11
- }
12
-
13
- get target() {
14
- return this.element.querySelector(OVERLAY_SCROLL_ELEMENT).children[0]
15
- }
16
-
17
- connect() {
18
- this.handleOverlayDynamic()
19
- }
20
-
21
- handleOverlayDynamic() {
22
- const isOverlayDynamic = this.element.dataset?.overlayDynamic
23
-
24
- if (isOverlayDynamic) {
25
- const previousOverlayElement = this.element.querySelector(PREVIOUS_OVERLAY_CLASSNAME)
26
- const previousOverlayClassname = previousOverlayElement?.dataset?.previousOverlayClassname
27
- const subsequentOverlayElement = this.element.querySelector(SUBSEQUENT_OVERLAY_CLASSNAME)
28
- const subsequentOverlayClassname = subsequentOverlayElement?.dataset?.subsequentOverlayClassname
29
-
30
- const handleScrollChange = (target) => {
31
- const { scrollLeft, scrollWidth, clientWidth } = target
32
- const isScrollAtStart = scrollLeft === 0
33
- const isScrollAtEnd = scrollLeft + clientWidth >= scrollWidth - 1
34
-
35
- if (isScrollAtStart) {
36
- previousOverlayElement.classList.remove(previousOverlayClassname)
37
- } else {
38
- previousOverlayElement.classList.add(previousOverlayClassname)
39
- }
40
-
41
- if (isScrollAtEnd) {
42
- subsequentOverlayElement.classList.remove(subsequentOverlayClassname)
43
- } else {
44
- subsequentOverlayElement.classList.add(subsequentOverlayClassname)
45
- }
46
- }
47
-
48
- this.target.addEventListener('scroll', (event) => {
49
- handleScrollChange(event.target)
50
- })
51
-
52
- handleScrollChange(this.target)
53
- }
54
- }
55
-
56
- disconnect() {
57
- if (this.element.dataset?.overlayDynamic) {
58
- this.target.removeEventListener('scroll')
59
- }
60
- }
61
- }
@@ -1,60 +0,0 @@
1
- import React from "react"
2
- import { useForm } from "react-hook-form"
3
- import { Radio, Flex, Body } from "playbook-ui"
4
-
5
- const RadioReactHook = () => {
6
- const { register, watch } = useForm({
7
- defaultValues: {
8
- size: "Small",
9
- },
10
- })
11
-
12
- const selectedSize = watch("size", "Small")
13
-
14
- return (
15
- <Flex orientation="row">
16
- <Flex
17
- align="start"
18
- orientation="column"
19
- paddingRight="lg"
20
- >
21
- <Radio
22
- alignment="left"
23
- label="Small"
24
- marginBottom='sm'
25
- name="size"
26
- value="Small"
27
- {...register("size")}
28
- />
29
- <br />
30
- <Radio
31
- alignment="left"
32
- label="Medium"
33
- marginBottom='sm'
34
- name="size"
35
- value="Medium"
36
- {...register("size")}
37
- />
38
- <br />
39
- <Radio
40
- alignment="left"
41
- label="Large"
42
- marginBottom='sm'
43
- name="size"
44
- value="Large"
45
- {...register("size")}
46
- />
47
- </Flex>
48
- <Flex
49
- align="start"
50
- orientation="column"
51
- >
52
- <Body
53
- text={`Selected Size: ${selectedSize}`}
54
- />
55
- </Flex>
56
- </Flex>
57
- )
58
- }
59
-
60
- export default RadioReactHook
@@ -1 +0,0 @@
1
- You can pass react hook props to the radio kit.
@@ -1,58 +0,0 @@
1
- import React, { useState } from "react"
2
- import { useForm } from "react-hook-form"
3
- import { Button, Body, Select } from "playbook-ui"
4
-
5
- const SelectReactHook = (props) => {
6
- const { register, handleSubmit, formState: { errors } } = useForm({
7
- defaultValues: {
8
- food: '',
9
- },
10
- })
11
-
12
- const [submittedData, setSubmittedData] = useState({
13
- food: '',
14
- })
15
-
16
- const onSubmit = (data) => {
17
- setSubmittedData(data)
18
- }
19
-
20
- const options = [
21
- {
22
- value: 1,
23
- text: 'Burgers',
24
- },
25
- {
26
- value: 2,
27
- text: 'Pizza',
28
- },
29
- {
30
- value: 3,
31
- text: 'Tacos',
32
- },
33
- ]
34
-
35
- return (
36
- <>
37
- <form onSubmit={handleSubmit(onSubmit)}>
38
- <Select
39
- {...props}
40
- {...register("food", { required: true })}
41
- error={errors.food ? "Please select a food." : null}
42
- label="Favorite Food"
43
- options={options}
44
- />
45
- <br />
46
- <Button htmlType="submit"
47
- marginTop="sm"
48
- text="Submit"
49
- />
50
- </form>
51
- <Body padding="xs"
52
- text={`Food: ${submittedData.food}`}
53
- />
54
- </>
55
- )
56
- }
57
-
58
- export default SelectReactHook
@@ -1 +0,0 @@
1
- You can pass react-hook-form props to a select kit. You can use `register` which will make the value available for both the form validation and submission.
@@ -1,38 +0,0 @@
1
- import PbEnhancedElement from "../pb_enhanced_element";
2
-
3
- const SELECT_WRAPPER_SELECTOR = "[data-pb-select]";
4
- const SELECT_VALIDATION_MESSAGE_CLASS = ".pb_body_kit_negative";
5
-
6
- export default class PbSelect extends PbEnhancedElement {
7
- static get selector() {
8
- return SELECT_WRAPPER_SELECTOR;
9
- }
10
-
11
- connect() {
12
- this.setValidationMessage();
13
- }
14
-
15
- setValidationMessage() {
16
- const validationMessage = this.element.dataset?.validationMessage;
17
-
18
- if (validationMessage) {
19
- const selectElement = this.element.querySelector("select");
20
- const setErrorTextContent = (text, timeout) => {
21
- setTimeout(() => {
22
- const errorMessageElement = this.element.querySelector(SELECT_VALIDATION_MESSAGE_CLASS);
23
- if (errorMessageElement) {
24
- errorMessageElement.textContent = text;
25
- } else {
26
- setErrorTextContent(text, 100);
27
- }
28
- }, timeout);
29
- };
30
-
31
- selectElement.addEventListener("change", (e) => {
32
- if (!e.target.checkValidity()) {
33
- setErrorTextContent(validationMessage, 300);
34
- }
35
- });
36
- }
37
- }
38
- }
@@ -1,7 +0,0 @@
1
- <%= pb_rails("title", props: { text: "Display Size xs", tag: "h1", display_size: "xs" }) %>
2
- <%= pb_rails("title", props: { text: "Display Size sm", tag: "h1", display_size: "sm" }) %>
3
- <%= pb_rails("title", props: { text: "Display Size md", tag: "h1", display_size: "md" }) %>
4
- <%= pb_rails("title", props: { text: "Display Size lg", tag: "h1", display_size: "lg" }) %>
5
- <%= pb_rails("title", props: { text: "Display Size xl", tag: "h1", display_size: "xl" }) %>
6
- <%= pb_rails("title", props: { text: "Display Size xxl", tag: "h1", display_size: "xxl" }) %>
7
- <%= pb_rails("title", props: { text: "This is a size of display", tag: "h1", size: "display"}) %>
@@ -1,54 +0,0 @@
1
- import React from 'react'
2
-
3
- import Title from '../_title'
4
-
5
- const TitleDisplaySize = (props) => {
6
- return (
7
- <div>
8
- <Title
9
- displaySize="xs"
10
- tag="h1"
11
- text="Display Size xs"
12
- {...props}
13
- />
14
- <Title
15
- displaySize="sm"
16
- tag="h1"
17
- text="Display Size sm"
18
- {...props}
19
- />
20
- <Title
21
- displaySize="md"
22
- tag="h1"
23
- text="Display Size md"
24
- {...props}
25
- />
26
- <Title
27
- displaySize="lg"
28
- tag="h1"
29
- text="Display Size lg"
30
- {...props}
31
- />
32
- <Title
33
- displaySize="xl"
34
- tag="h1"
35
- text="Display Size xl"
36
- {...props}
37
- />
38
- <Title
39
- displaySize="xxl"
40
- tag="h1"
41
- text="Display Size xxl"
42
- {...props}
43
- />
44
- <Title
45
- size="display"
46
- tag="h1"
47
- text="This is a size of display"
48
- {...props}
49
- />
50
- </div>
51
- )
52
- }
53
-
54
- export default TitleDisplaySize
@@ -1 +0,0 @@
1
- Responsive sizes for large screens and tablets, perfect for digital signage.
@@ -1,39 +0,0 @@
1
- <%= pb_rails("flex", props: { orientation: "row", gap: "md" }) do %>
2
- <%= pb_rails("flex/flex_item", props: {margin_top: "md"}) do %>
3
- <%= pb_rails("button", props: {classname: "tooltip-delay", text: "1s delay"}) %>
4
- <% end %>
5
-
6
- <%= pb_rails("flex/flex_item", props: {margin_top: "md"}) do %>
7
- <%= pb_rails("button", props: {classname: "tooltip-open-delay", text: "Open only"}) %>
8
- <% end %>
9
-
10
- <%= pb_rails("flex/flex_item", props: {margin_top: "md"}) do %>
11
- <%= pb_rails("button", props: {classname: "tooltip-close-delay", text: "Close only"}) %>
12
- <% end %>
13
-
14
- <%= pb_rails("tooltip", props: {
15
- trigger_element_selector: ".tooltip-delay",
16
- tooltip_id: "delay-tooltip",
17
- position: 'top',
18
- delay_open: 1000,
19
- delay_close: 1000
20
- }) do %>
21
- 1s open/close delay
22
- <% end %>
23
- <%= pb_rails("tooltip", props: {
24
- trigger_element_selector: ".tooltip-open-delay",
25
- tooltip_id: "open-tooltip",
26
- position: 'top',
27
- delay_open: 1000
28
- }) do %>
29
- 1s open delay
30
- <% end %>
31
- <%= pb_rails("tooltip", props: {
32
- trigger_element_selector: ".tooltip-close-delay",
33
- tooltip_id: "close-tooltip",
34
- position: 'top',
35
- delay_close: 1000
36
- }) do %>
37
- 1s close delay
38
- <% end %>
39
- <% end %>
@@ -1,3 +0,0 @@
1
- Waits for the specified time when the event listener runs before triggering the tooltip.
2
-
3
- The `delay_open` and `delay_close` accept numbers in milliseconds. 1 second is 1000 milliseconds.