playbook_ui 14.15.0.pre.alpha.play1917lodashremoval2of36615 → 14.15.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.
Files changed (156) 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_bar_graph/_bar_graph.tsx +1 -1
  7. data/app/pb_kits/playbook/pb_card/_card.tsx +1 -2
  8. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
  9. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -4
  10. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -2
  11. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +6 -5
  12. data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +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_filter/Filter/SortMenu.tsx +1 -2
  25. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -2
  26. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -9
  27. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +0 -4
  28. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
  29. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
  30. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +1 -7
  31. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
  32. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.tsx +1 -1
  33. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +1 -1
  34. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.tsx +1 -1
  35. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
  36. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +0 -7
  37. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +3 -13
  38. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +1 -2
  39. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
  40. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -6
  41. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +0 -13
  42. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +1 -7
  43. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -3
  44. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
  45. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +3 -5
  46. data/app/pb_kits/playbook/pb_overlay/overlay.rb +1 -16
  47. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +0 -12
  48. data/app/pb_kits/playbook/pb_popover/_popover.tsx +2 -2
  49. data/app/pb_kits/playbook/pb_popover/popover.test.js +1 -1
  50. data/app/pb_kits/playbook/pb_radio/_radio.tsx +74 -85
  51. data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -2
  52. data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
  53. data/app/pb_kits/playbook/pb_radio/radio.test.js +0 -16
  54. data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -1
  55. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
  56. data/app/pb_kits/playbook/pb_select/select.html.erb +5 -3
  57. data/app/pb_kits/playbook/pb_select/select.rb +0 -8
  58. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +5 -1
  59. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.html.erb +4 -1
  60. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.html.erb +5 -1
  61. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +3 -2
  62. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -2
  63. data/app/pb_kits/playbook/pb_title/_title.scss +0 -32
  64. data/app/pb_kits/playbook/pb_title/_title.tsx +1 -10
  65. data/app/pb_kits/playbook/pb_title/docs/_title_default.html.erb +2 -1
  66. data/app/pb_kits/playbook/pb_title/docs/_title_default.jsx +1 -1
  67. data/app/pb_kits/playbook/pb_title/docs/example.yml +0 -2
  68. data/app/pb_kits/playbook/pb_title/docs/index.js +0 -1
  69. data/app/pb_kits/playbook/pb_title/title.rb +1 -10
  70. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +3 -0
  71. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +0 -25
  72. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon.erb +10 -0
  73. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +1 -4
  74. data/app/pb_kits/playbook/pb_tooltip/docs/index.js +0 -1
  75. data/app/pb_kits/playbook/pb_tooltip/index.js +1 -1
  76. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -10
  77. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
  78. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +5 -51
  79. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -5
  80. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +1 -1
  81. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +1 -1
  82. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -3
  83. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
  84. data/app/pb_kits/playbook/pb_typeahead/index.ts +8 -61
  85. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +2 -17
  86. data/app/pb_kits/playbook/utilities/object.ts +1 -103
  87. data/app/pb_kits/playbook/utilities/text.ts +1 -1
  88. data/dist/chunks/_typeahead-PqkcDf1H.js +36 -0
  89. data/dist/chunks/_weekday_stacked-BrSrpj7J.js +45 -0
  90. data/dist/chunks/{lib-e7oBFFDo.js → lib-D3us1bGD.js} +2 -2
  91. data/dist/chunks/{pb_form_validation-CMXevI1t.js → pb_form_validation-BpihMSOQ.js} +1 -1
  92. data/dist/chunks/vendor.js +1 -1
  93. data/dist/menu.yml +2 -2
  94. data/dist/playbook-doc.js +1 -1
  95. data/dist/playbook-rails-react-bindings.js +1 -1
  96. data/dist/playbook-rails.js +1 -1
  97. data/dist/playbook.css +1 -1
  98. data/lib/playbook/version.rb +2 -2
  99. metadata +7 -61
  100. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +0 -127
  101. data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +0 -55
  102. data/app/pb_kits/playbook/pb_advanced_table/Components/TablePagination.tsx +0 -33
  103. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +0 -275
  104. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +0 -66
  105. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +0 -195
  106. data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +0 -73
  107. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +0 -52
  108. data/app/pb_kits/playbook/pb_advanced_table/Utilities/TableContainerStyles.ts +0 -80
  109. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +0 -50
  110. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_infinite_scroll.json +0 -152002
  111. data/app/pb_kits/playbook/pb_date_picker/index.ts +0 -38
  112. data/app/pb_kits/playbook/pb_dialog/index.js +0 -75
  113. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  114. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  115. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  116. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  117. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  118. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  119. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  120. data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
  121. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.html.erb +0 -40
  122. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +0 -50
  123. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.md +0 -3
  124. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.html.erb +0 -72
  125. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled.jsx +0 -91
  126. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.html.erb +0 -11
  127. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar.jsx +0 -37
  128. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_rails.md +0 -1
  129. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_hide_scroll_bar_react.md +0 -1
  130. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
  131. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
  132. data/app/pb_kits/playbook/pb_overlay/index.js +0 -61
  133. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +0 -60
  134. data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.md +0 -1
  135. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +0 -58
  136. data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.md +0 -1
  137. data/app/pb_kits/playbook/pb_select/index.js +0 -38
  138. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.html.erb +0 -7
  139. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.jsx +0 -54
  140. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.md +0 -1
  141. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
  142. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
  143. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_icon_rails.html.erb +0 -22
  144. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
  145. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +0 -69
  146. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.md +0 -3
  147. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  148. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.html.erb +0 -45
  149. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options.md +0 -5
  150. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.html.erb +0 -33
  151. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_dynamic_options_pure_rails.md +0 -3
  152. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +0 -66
  153. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.md +0 -1
  154. data/app/pb_kits/playbook/utilities/object.test.js +0 -237
  155. data/dist/chunks/_typeahead-CdVbIURO.js +0 -36
  156. data/dist/chunks/_weekday_stacked-BSTKfYPJ.js +0 -45
@@ -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.
@@ -1,22 +0,0 @@
1
- <%= pb_rails "flex", props: { flex_direction: "row", gap: "md", wrap: true } do %>
2
- <%= pb_rails "button", props: { id: "tool-tip-with-icon-1", text: "Tooltip With Icon" } %>
3
- <%= pb_rails "tooltip", props: { trigger_element_selector: "#tool-tip-with-icon-1", tooltip_id: "tool-tip-with-icon-1", position: "top" } do %>
4
- <%= pb_rails("icon", props: { icon: "paper-plane", fixed_width: true, color: "white", size: "1x", padding_right: "xxs" }) %>
5
- Send Email
6
- <% end %>
7
- <%= pb_rails "button", props: { id: "tool-tip-with-icon-2", text: "Tooltip With Icon" } %>
8
- <%= pb_rails "tooltip", props: { trigger_element_selector: "#tool-tip-with-icon-2", tooltip_id: "tool-tip-with-icon-2", position: "bottom" } do %>
9
- <%= pb_rails("icon", props: { icon: "paper-plane", fixed_width: true, color: "white", size: "1x", padding_right: "xxs" }) %>
10
- Send Email
11
- <% end %>
12
- <%= pb_rails "button", props: { id: "tool-tip-with-icon-3", text: "Tooltip With Icon" } %>
13
- <%= pb_rails "tooltip", props: { trigger_element_selector: "#tool-tip-with-icon-3", tooltip_id: "tool-tip-with-icon-3", position: "left" } do %>
14
- <%= pb_rails("icon", props: { icon: "paper-plane", fixed_width: true, color: "white", size: "1x", padding_right: "xxs" }) %>
15
- Send Email
16
- <% end %>
17
- <%= pb_rails "button", props: { id: "tool-tip-with-icon-4", text: "Tooltip With Icon" } %>
18
- <%= pb_rails "tooltip", props: { trigger_element_selector: "#tool-tip-with-icon-4", tooltip_id: "tool-tip-with-icon-4", position: "right" } do %>
19
- <%= pb_rails("icon", props: { icon: "paper-plane", fixed_width: true, color: "white", size: "1x", padding_right: "xxs" }) %>
20
- Send Email
21
- <% end %>
22
- <% end %>
@@ -1,26 +0,0 @@
1
- <%= pb_rails("flex", props: { gap: "md", wrap: true }) do %>
2
- <%= pb_rails("flex/flex_item") do %>
3
- <%= pb_rails("button", props: { text: "With Interaction", id: "tooltip-interaction"}) %>
4
-
5
- <%= pb_rails("tooltip", props: {
6
- trigger_element_selector: "#tooltip-interaction",
7
- tooltip_id: "tooltip-with-interaction",
8
- position: 'top',
9
- interaction: true
10
- }) do %>
11
- You can copy me
12
- <% end %>
13
- <% end %>
14
-
15
- <%= pb_rails("flex/flex_item") do %>
16
- <%= pb_rails("button", props: { text: "No Interaction", id: "tooltip-no-interaction"}) %>
17
-
18
- <%= pb_rails("tooltip", props: {
19
- trigger_element_selector: "#tooltip-no-interaction",
20
- tooltip_id: "tooltip-without-interaction",
21
- position: 'top',
22
- }) do %>
23
- I'm just a regular tooltip
24
- <% end %>
25
- <% end %>
26
- <% end %>
@@ -1,69 +0,0 @@
1
- import React from 'react'
2
- import { Button, Tooltip, Flex, FlexItem } from 'playbook-ui';
3
-
4
- const TooltipSizing = (props) => {
5
-
6
- return (
7
- <Flex
8
- flexDirection='row'
9
- gap='md'
10
- wrap
11
- >
12
- <FlexItem>
13
- <Tooltip
14
- height='150px'
15
- placement='top'
16
- text="I'm 150px high and 100px wide!"
17
- width='100px'
18
- {...props}
19
- >
20
- <Button text="Height and Width"/>
21
- </Tooltip>
22
- </FlexItem>
23
- <FlexItem>
24
- <Tooltip
25
- maxHeight='100px'
26
- placement='top'
27
- text="I have a maxHeight of 100px! Lorem ipsum dolor sit amet consectetur adipisicing elit."
28
- width='250px'
29
- {...props}
30
- >
31
- <Button text="maxHeight"/>
32
- </Tooltip>
33
- </FlexItem>
34
- <FlexItem>
35
- <Tooltip
36
- maxWidth='150px'
37
- placement='top'
38
- text="I have a maxWidth of 150px! Lorem ipsum dolor sit amet consectetur adipisicing elit."
39
- {...props}
40
- >
41
- <Button text="maxWidth"/>
42
- </Tooltip>
43
- </FlexItem>
44
- <FlexItem>
45
- <Tooltip
46
- minWidth='300px'
47
- placement='top'
48
- text="I have a minWidth of 300px!"
49
- {...props}
50
- >
51
- <Button text="minWidth"/>
52
- </Tooltip>
53
- </FlexItem>
54
- <FlexItem>
55
- <Tooltip
56
- maxWidth='150px'
57
- minHeight='300px'
58
- placement='top'
59
- text="I have a minHeight of 300px!"
60
- {...props}
61
- >
62
- <Button text="minHeight"/>
63
- </Tooltip>
64
- </FlexItem>
65
- </Flex>
66
- )
67
- }
68
-
69
- export default TooltipSizing
@@ -1,3 +0,0 @@
1
- You can customize the `height` and `width` of the tooltip's popover.
2
-
3
- When using `maxHeight`, be sure to set a `width` as well. The text needs to truncate within the `width` prop.