playbook_ui_docs 14.12.0.pre.rc.11 → 14.13.0.pre.alpha.PBNTR457formtimezoneselect6219

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 (160) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_custom_cell.jsx +75 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading.html.erb +33 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_loading_rails.md +1 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_loading.md → _advanced_table_loading_react.md} +2 -2
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +50 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +1 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -0
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb +38 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +60 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +5 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +78 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +1 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +53 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +1 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +52 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +1 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +3 -1
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +3 -1
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +33 -0
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +55 -0
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +3 -0
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -0
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +42 -0
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +299 -0
  29. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +10 -0
  30. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +8 -1
  31. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +9 -3
  32. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +6 -2
  33. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +64 -0
  34. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +1 -0
  35. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
  36. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
  37. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +69 -0
  38. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +1 -0
  39. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +2 -1
  40. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +1 -0
  41. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -0
  42. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +21 -0
  43. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +5 -0
  44. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +45 -0
  45. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.md +1 -0
  46. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +8 -0
  47. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -0
  48. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +2 -1
  49. data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +13 -5
  50. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
  51. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
  52. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
  53. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.html.erb +99 -0
  54. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +1 -0
  55. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +1 -3
  56. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +7 -0
  57. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +61 -0
  58. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +4 -0
  59. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +90 -0
  60. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +5 -0
  61. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +4 -5
  62. data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
  63. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +38 -0
  64. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -45
  65. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -1
  66. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +9 -16
  67. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +44 -19
  68. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +21 -3
  69. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +16 -21
  70. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +2 -19
  71. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +2 -1
  72. data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
  73. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  74. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.html.erb +58 -0
  75. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close_rails.md +3 -0
  76. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +1 -0
  77. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  78. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -0
  79. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
  80. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
  81. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
  82. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
  83. data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
  84. data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
  85. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +2 -0
  86. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb +27 -0
  87. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +5 -0
  88. data/app/pb_kits/playbook/pb_link/docs/_link_target.html.erb +15 -0
  89. data/app/pb_kits/playbook/pb_link/docs/_link_target.jsx +29 -0
  90. data/app/pb_kits/playbook/pb_link/docs/example.yml +5 -3
  91. data/app/pb_kits/playbook/pb_link/docs/index.js +2 -1
  92. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +37 -0
  93. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md +1 -0
  94. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +1 -0
  95. data/app/pb_kits/playbook/pb_overlay/docs/index.js +1 -0
  96. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +1 -0
  97. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +7 -0
  98. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +1 -0
  99. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +1 -0
  100. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +18 -0
  101. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +1 -0
  102. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +1 -0
  103. data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +2 -0
  104. data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +1 -0
  105. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tooltip.html.erb +6 -6
  106. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
  107. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +4 -1
  108. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +4 -1
  109. data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.html.erb +6 -9
  110. data/app/pb_kits/playbook/pb_table/docs/_table_with_background_kit.jsx +6 -9
  111. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.html.erb +47 -0
  112. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.jsx +88 -0
  113. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.md +1 -0
  114. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +47 -0
  115. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
  116. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +2 -0
  117. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +51 -0
  118. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +2 -0
  119. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +12 -8
  120. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.html.erb +52 -0
  121. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.md +0 -0
  122. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.html.erb +52 -0
  123. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -0
  124. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.html.erb +80 -0
  125. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -0
  126. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +96 -0
  127. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +101 -0
  128. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +1 -0
  129. data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -0
  130. data/app/pb_kits/playbook/pb_table/docs/index.js +3 -1
  131. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +60 -0
  132. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +3 -0
  133. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -1
  134. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
  135. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +19 -0
  136. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +27 -0
  137. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -0
  138. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  139. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  140. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.html.erb +42 -0
  141. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.jsx +59 -0
  142. data/app/pb_kits/playbook/pb_user/docs/_user_light_weight.md +2 -0
  143. data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
  144. data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
  145. data/dist/playbook-doc.js +1 -1
  146. metadata +87 -17
  147. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -19
  148. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -26
  149. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -10
  150. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -17
  151. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -19
  152. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -16
  153. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -35
  154. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -42
  155. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -13
  156. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +0 -15
  157. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
  158. /data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/{_fixed_confirmation_toast_auto_close.md → _fixed_confirmation_toast_auto_close_react.md} +0 -0
  159. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible.md → _table_with_collapsible_react.md} +0 -0
  160. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click.md → _table_with_collapsible_with_custom_click_react.md} +0 -0
@@ -9,8 +9,8 @@ const useDrawer = (visible = false) => {
9
9
  };
10
10
 
11
11
  const DrawerDefault = () => {
12
- const [headerSeparatorDrawerOpened, toggleHeaderSeparatorDrawer] = useDrawer();
13
- const [bothSeparatorsDrawerOpened, toggleBothSeparatorsDrawer] = useDrawer();
12
+ const [drawerLeftOpen, toggleDrawerLeftOpen] = useDrawer();
13
+ const [drawerRightOpen, toggleDrawerRightOpen ] = useDrawer();
14
14
 
15
15
  return (
16
16
  <>
@@ -18,13 +18,13 @@ const DrawerDefault = () => {
18
18
  <Button
19
19
  id="sm"
20
20
  marginRight="md"
21
- onClick={toggleHeaderSeparatorDrawer}
21
+ onClick={toggleDrawerLeftOpen}
22
22
  >
23
23
  {"Left Drawer"}
24
24
  </Button>
25
25
  <Button
26
26
  marginRight="xl"
27
- onClick={toggleBothSeparatorsDrawer}
27
+ onClick={toggleDrawerRightOpen}
28
28
  >
29
29
  {"Right Drawer"}
30
30
  </Button>
@@ -32,12 +32,8 @@ const DrawerDefault = () => {
32
32
  <Flex>
33
33
  {/* Left Drawer */}
34
34
  <Drawer
35
- behavior={"push"}
36
- fullHeight
37
- onClose={toggleHeaderSeparatorDrawer}
38
- opened={headerSeparatorDrawerOpened}
39
- overlay
40
- placement={"left"}
35
+ onClose={toggleDrawerLeftOpen}
36
+ opened={drawerLeftOpen}
41
37
  size={"lg"}
42
38
  >
43
39
  Test me (Left Drawer)
@@ -45,11 +41,8 @@ const DrawerDefault = () => {
45
41
 
46
42
  {/* Right Drawer */}
47
43
  <Drawer
48
- behavior={"push"}
49
- fullHeight
50
- onClose={toggleBothSeparatorsDrawer}
51
- opened={bothSeparatorsDrawerOpened}
52
- overlay
44
+ onClose={toggleDrawerRightOpen}
45
+ opened={drawerRightOpen}
53
46
  placement={"right"}
54
47
  size={"lg"}
55
48
  >
@@ -60,4 +53,4 @@ const DrawerDefault = () => {
60
53
  );
61
54
  };
62
55
 
63
- export default DrawerDefault;
56
+ export default DrawerDefault;
@@ -1,31 +1,56 @@
1
- import React from "react";
2
- import { Button, Drawer, Icon, Title } from "playbook-ui";
1
+ import React, { useState, useEffect } from "react"
2
+ import { Button, Drawer, Icon, Nav, NavItem } from "playbook-ui"
3
3
 
4
4
  const DrawerMenu = () => {
5
+ const [isSmallScreen, setIsSmallScreen] = useState(false)
6
+
7
+ useEffect(() => {
8
+ const mediaQuery = window.matchMedia("(max-width: 600px)")
9
+ setIsSmallScreen(mediaQuery.matches)
10
+ const handler = (e) => setIsSmallScreen(e.matches)
11
+ mediaQuery.addEventListener('change', handler)
12
+ return () => mediaQuery.removeEventListener('change', handler)
13
+ }, [])
5
14
 
6
15
  return (
7
- <>
8
- <Button id="menuButton"
9
- padding="sm"
16
+ <div>
17
+ <Button id='menuButton'
18
+ padding='xs'
10
19
  >
11
- <Icon icon="bars"
12
- size="3x"
20
+ <Icon icon='bars'
21
+ size='2x'
13
22
  />
14
23
  </Button>
15
24
  <Drawer
16
- behavior="push"
17
- closeBreakpoint="md"
18
- menuButtonID="menuButton"
19
- overlay={false}
20
- placement="left"
21
- size="lg"
25
+ breakpoint="md"
26
+ placement='bottom'
27
+ size='full'
28
+ triggerId='menuButton'
22
29
  withinElement
23
30
  >
24
- <Title paddingBottom="md">A really neat menu</Title>
25
- <Button text="This Button does nothing" />
31
+ <Nav
32
+ highlight={false}
33
+ link='#'
34
+ orientation={isSmallScreen ? 'vertical' : 'horizontal'}
35
+ padding={isSmallScreen ? 'none' : 'sm'}
36
+ >
37
+ <NavItem link='#'
38
+ text='About'
39
+ />
40
+ <NavItem active
41
+ link='#'
42
+ text='Case Studies'
43
+ />
44
+ <NavItem link='#'
45
+ text='Service'
46
+ />
47
+ <NavItem link='#'
48
+ text='Contacts'
49
+ />
50
+ </Nav>
26
51
  </Drawer>
27
- </>
28
- );
29
- };
52
+ </div>
53
+ )
54
+ }
30
55
 
31
- export default DrawerMenu;
56
+ export default DrawerMenu
@@ -1,6 +1,24 @@
1
- Our drawer kit can fulfill your responsive menu needs! Using the `closeBreakpoint` prop you can have the menu close on smaller screens like phones/tablets.
1
+ The Drawer component can be used to create responsive navigation menus and sidebars. It provides flexible options for controlling when and how the drawer appears based on screen size.
2
+
3
+ ### Within Element
4
+ The `withinElement` prop allows you to render the drawer within its parent container:
5
+ - The drawer will be positioned relative to its parent element
6
+ - Useful for creating nested navigation structures
7
+ - This must be used in conjunction with the `triggerId` prop
8
+
9
+ This provides a clean way to create responsive navigation patterns that adapt to different screen sizes while maintaining a consistent user experience.
10
+
11
+ ### Trigger Id
12
+ The `triggerId` prop allows you to connect an element to control the drawer:
13
+ - The specified element will toggle the drawer open/closed
14
+ - The element is automatically hidden when the drawer is opened via breakpoint
15
+ - The element reappears when the drawer is closed via breakpoint
16
+
17
+ ### Breakpoint
18
+ Use the `breakpoint` prop to control when the drawer automatically opens or closes based on screen size. For example, setting `breakpoint="md"` will:
19
+ - Close the drawer on screens smaller than the medium breakpoint (992px)
20
+ - Automatically open the drawer on screens larger than or equal to the medium breakpoint
21
+
2
22
 
3
- Set a menu button with the `menuButtonID` props. When the Drawer is open, the menu button will be hidden. But when your Brakpoint closes the drawer, you can toggle the Drawer open/close with your menu butotn.
4
23
 
5
- Also use the `withinElement` props to have the Drawer open within a specific element, instead of the default behavior of it taking up the entire screen size.
6
24
 
@@ -1,24 +1,25 @@
1
- import React, { useState } from "react";
2
- import { Button, Drawer, Flex } from "playbook-ui";
1
+ import React, { useState } from "react"
2
+ import { Button, Drawer, Flex } from "playbook-ui"
3
3
 
4
4
  const DrawerSizes = () => {
5
5
  // Individual state variables for each drawer size
6
- const [openedNoOverlayDrawer, setOpenedNoOverlayDrawer] = useState(false);
7
- const [openedOverlayDrawer, setOpenedOverlayDrawer] = useState(false);
6
+ const [openedNoOverlayDrawer, setOpenedNoOverlayDrawer] = useState(false)
7
+ const [openedOverlayDrawer, setOpenedOverlayDrawer] = useState(false)
8
8
 
9
9
  // Toggle functions for each drawer
10
- const toggleNoOverlayDrawer = () => setOpenedNoOverlayDrawer(!openedNoOverlayDrawer);
11
- const toggleOverlayDrawer = () => setOpenedOverlayDrawer(!openedOverlayDrawer);
10
+ const toggleNoOverlayDrawer = () =>
11
+ setOpenedNoOverlayDrawer(!openedNoOverlayDrawer)
12
+ const toggleOverlayDrawer = () => setOpenedOverlayDrawer(!openedOverlayDrawer)
12
13
 
13
14
  return (
14
15
  <>
15
16
  <Flex wrap>
16
- <Button marginRight="md"
17
+ <Button marginRight='md'
17
18
  onClick={toggleNoOverlayDrawer}
18
19
  >
19
20
  No Overlay Drawer
20
21
  </Button>
21
- <Button marginRight="md"
22
+ <Button marginRight='md'
22
23
  onClick={toggleOverlayDrawer}
23
24
  >
24
25
  Overlay Drawer
@@ -27,29 +28,23 @@ const DrawerSizes = () => {
27
28
 
28
29
  {/* Drawers for each size */}
29
30
  <Drawer
30
- behavior="push"
31
- fullHeight
32
31
  onClose={toggleNoOverlayDrawer}
33
32
  opened={openedNoOverlayDrawer}
34
33
  overlay={false}
35
- placement="right"
36
- size="lg"
34
+ size='lg'
37
35
  >
38
36
  This is a Drawer with no overlay
39
37
  </Drawer>
40
38
  <Drawer
41
- behavior="push"
42
- fullHeight
43
39
  onClose={toggleOverlayDrawer}
44
40
  opened={openedOverlayDrawer}
45
- overlay
46
- placement="right"
47
- size="lg"
41
+ placement='right'
42
+ size='lg'
48
43
  >
49
- This is a Drawer with an overlay
44
+ This is a Drawer with an overlay
50
45
  </Drawer>
51
46
  </>
52
- );
53
- };
47
+ )
48
+ }
54
49
 
55
- export default DrawerSizes;
50
+ export default DrawerSizes
@@ -19,7 +19,8 @@ const DrawerSizes = () => {
19
19
  return (
20
20
  <>
21
21
  <Flex wrap>
22
- <Button marginRight="md"
22
+ <Button
23
+ marginRight="md"
23
24
  onClick={toggleXsDrawer}
24
25
  >
25
26
  XS Drawer
@@ -48,11 +49,8 @@ const DrawerSizes = () => {
48
49
 
49
50
  {/* Drawers for each size */}
50
51
  <Drawer
51
- behavior="push"
52
- fullHeight
53
52
  onClose={toggleXsDrawer}
54
53
  opened={openedXsDrawer}
55
- overlay
56
54
  placement="right"
57
55
  size="xs"
58
56
  >
@@ -60,47 +58,32 @@ const DrawerSizes = () => {
60
58
  </Drawer>
61
59
 
62
60
  <Drawer
63
- behavior="push"
64
- fullHeight
65
61
  onClose={toggleSmDrawer}
66
62
  opened={openedSmDrawer}
67
- overlay
68
- placement="right"
69
63
  size="sm"
70
64
  >
71
65
  This is an SM Drawer
72
66
  </Drawer>
73
67
 
74
68
  <Drawer
75
- behavior="push"
76
- fullHeight
77
69
  onClose={toggleMdDrawer}
78
70
  opened={openedMdDrawer}
79
- overlay
80
71
  placement="right"
81
- size="md"
82
72
  >
83
73
  This is an MD Drawer
84
74
  </Drawer>
85
75
 
86
76
  <Drawer
87
- behavior="push"
88
- fullHeight
89
77
  onClose={toggleLgDrawer}
90
78
  opened={openedLgDrawer}
91
- overlay
92
- placement="right"
93
79
  size="lg"
94
80
  >
95
81
  This is an LG Drawer
96
82
  </Drawer>
97
83
 
98
84
  <Drawer
99
- behavior="push"
100
- fullHeight
101
85
  onClose={toggleXlDrawer}
102
86
  opened={openedXlDrawer}
103
- overlay
104
87
  placement="right"
105
88
  size="xl"
106
89
  >
@@ -6,7 +6,8 @@ examples:
6
6
 
7
7
  react:
8
8
  - drawer_default: Default
9
- - drawer_menu: Menu Behavior
9
+ - drawer_behavior: Push Behavior
10
+ - drawer_menu: Within Element
10
11
  - drawer_sizes: Sizes
11
12
  - drawer_overlay: Overlay
12
13
  - drawer_borders: Borders
@@ -4,3 +4,4 @@ export { default as DrawerOverlay } from './_drawer_overlay.jsx'
4
4
  export { default as DrawerBorders } from './_drawer_borders.jsx'
5
5
  export { default as DrawerBreakpoints } from './_drawer_breakpoints.jsx'
6
6
  export { default as DrawerMenu } from './_drawer_menu.jsx'
7
+ export { default as DrawerBehavior } from './_drawer_behavior.jsx'
@@ -1 +1 @@
1
- For the `subtle` variant, it is recommended that you set the `Separators` prop to `false` to remove the separator lines between the options for a more cleaner look.
1
+ For the `subtle` variant, it is recommended that you set the `Separators` prop to `false` to remove the separator lines between the options for a cleaner look.
@@ -0,0 +1,58 @@
1
+ <%= pb_rails("button", props: { text: "Show Auto Close Toast", variant: "secondary", data: { toast: "#toast-auto-close" } }) %>
2
+ <%= pb_rails("button", props: { text: "Show Closeable Auto Close Toast", variant: "secondary", data: { toast: "#toast-auto-close-closeable" } }) %>
3
+
4
+ <%= pb_rails("fixed_confirmation_toast", props: {
5
+ auto_close: 3000,
6
+ classname: "toast-to-hide",
7
+ id: "toast-auto-close",
8
+ text: "I will disappear in 3 seconds.",
9
+ status: "tip",
10
+ vertical: "top",
11
+ horizontal: "center"
12
+ }) %>
13
+
14
+ <%= pb_rails("fixed_confirmation_toast", props: {
15
+ auto_close: 10000,
16
+ closeable: true,
17
+ id: "toast-auto-close-closeable",
18
+ text: "I will disappear in 10 seconds.",
19
+ status: "tip",
20
+ vertical: "top",
21
+ horizontal: "center"
22
+ }) %>
23
+
24
+ <script>
25
+ document.addEventListener('DOMContentLoaded', () => {
26
+ // Initialize toast elements and buttons
27
+ const toasts = {
28
+ '#toast-auto-close': document.querySelector("#toast-auto-close"),
29
+ '#toast-auto-close-closeable': document.querySelector("#toast-auto-close-closeable")
30
+ }
31
+
32
+ const buttons = {
33
+ '#toast-auto-close': document.querySelector("button[data-toast='#toast-auto-close']"),
34
+ '#toast-auto-close-closeable': document.querySelector("button[data-toast='#toast-auto-close-closeable']")
35
+ }
36
+
37
+ // Store original toasts and remove them from DOM
38
+ const originalToasts = {}
39
+ Object.entries(toasts).forEach(([id, toast]) => {
40
+ if (toast) {
41
+ originalToasts[id] = toast.cloneNode(true)
42
+ toast.remove()
43
+ }
44
+ })
45
+
46
+ // Set up button click handlers
47
+ Object.keys(buttons).forEach((toastId) => {
48
+ const button = buttons[toastId]
49
+ if (button) {
50
+ button.onclick = () => {
51
+ const newToast = originalToasts[toastId].cloneNode(true)
52
+ newToast.style.display = "flex"
53
+ document.body.appendChild(newToast)
54
+ }
55
+ }
56
+ })
57
+ })
58
+ </script>
@@ -0,0 +1,3 @@
1
+ Auto close is used when you want the confirmation toast to close automatically after a certain time. `auto_close` property will be a delay number in ms.
2
+
3
+ The script tag in this code snippet is for demonstration purposes only. It clones the toasts in order to have it appear with a button click prompt and not upon initial page load. In a typical production environment the event triggering a fixed confirmation toast to appear would be handled by a controller or a separate javascript file.
@@ -5,6 +5,7 @@ examples:
5
5
  - fixed_confirmation_toast_multi_line: Multi Line
6
6
  - fixed_confirmation_toast_close: Click to Close
7
7
  - fixed_confirmation_toast_positions: Click to Show Positions
8
+ - fixed_confirmation_toast_auto_close: Click to Show Auto Close
8
9
  - fixed_confirmation_toast_children: Children
9
10
  - fixed_confirmation_toast_custom_icon: Custom Icon
10
11
 
@@ -46,6 +46,7 @@
46
46
  %>
47
47
  <%= form.date_picker :example_date_picker_1, props: { label: true } %>
48
48
  <%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true } %>
49
+ <%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true } %>
49
50
 
50
51
  <%= form.actions do |action| %>
51
52
  <%= action.submit %>
@@ -37,6 +37,7 @@
37
37
  <%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
38
38
  <%= form.date_picker :example_date_picker_2, props: { label: true, required: true } %>
39
39
  <%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
40
+ <%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true, blank_selection: "Select a Time Zone...", required: true } %>
40
41
 
41
42
  <%= form.actions do |action| %>
42
43
  <%= action.submit %>
@@ -0,0 +1,11 @@
1
+ <%= pb_rails("home_address_street", props: {
2
+ address: "70 pRoSpEcT ave",
3
+ address_cont: "Apt M18",
4
+ city: "West Chester",
5
+ home_id: 8250263,
6
+ home_url: "https://powerhrg.com/",
7
+ preserve_case: true,
8
+ state: "pa",
9
+ zipcode: "19382",
10
+ territory: "PHL",
11
+ }) %>
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+
3
+ import HomeAddressStreet from '../_home_address_street'
4
+
5
+ const HomeAddressStreetFormatting = (props) => {
6
+ return (
7
+ <HomeAddressStreet
8
+ address="70 pRoSpEcT ave"
9
+ addressCont="Apt M18"
10
+ city="West Chester"
11
+ homeId="8250263"
12
+ homeUrl="https://powerhrg.com/"
13
+ preserveCase
14
+ state="pa"
15
+ territory="PHL"
16
+ zipcode="19382"
17
+ {...props}
18
+ />
19
+ )
20
+ }
21
+
22
+ export default HomeAddressStreetFormatting
@@ -0,0 +1 @@
1
+ The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserve_case: true`, the street address will be rendered exactly as entered, without automatic title capitalization.
@@ -0,0 +1 @@
1
+ The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserveCase`, the street address will be rendered exactly as entered, without automatic title capitalization.
@@ -5,12 +5,14 @@ examples:
5
5
  - home_address_street_emphasis: Emphasis
6
6
  - home_address_street_modified: Modified
7
7
  - home_address_street_link: Link
8
+ - home_address_street_formatting: Formatting
8
9
 
9
10
  react:
10
11
  - home_address_street_default: Default
11
12
  - home_address_street_emphasis: Emphasis
12
13
  - home_address_street_modified: Modified
13
14
  - home_address_street_link: Link
15
+ - home_address_street_formatting: Formatting
14
16
 
15
17
  swift:
16
18
  - home_address_street_default_swift: Default
@@ -2,3 +2,4 @@ export { default as HomeAddressStreetDefault } from './_home_address_street_defa
2
2
  export { default as HomeAddressStreetEmphasis } from './_home_address_street_emphasis.jsx'
3
3
  export { default as HomeAddressStreetModified } from './_home_address_street_modified.jsx'
4
4
  export { default as HomeAddressStreetLink } from './_home_address_street_link.jsx'
5
+ export { default as HomeAddressStreetFormatting } from './_home_address_street_formatting.jsx'
@@ -0,0 +1,2 @@
1
+ <%= pb_rails("icon_button") %>
2
+ <%= pb_rails("icon_button", props: {variant: "link", margin_top: "md" }) %>
@@ -0,0 +1,27 @@
1
+ <%= pb_rails("flex", props: { align: "center"}) do %>
2
+ <%= pb_rails("icon_button", props: {size: "lg"}) %> <span>Large</span>
3
+ <% end %>
4
+
5
+ <%= pb_rails("flex", props: { align: "center" }) do %>
6
+ <%= pb_rails("icon_button", props: {size: "sm"}) %> <span>Small</span>
7
+ <% end %>
8
+
9
+ <%= pb_rails("flex", props: { align: "center" }) do %>
10
+ <%= pb_rails("icon_button", props: {size: "xs"}) %> <span>XSmall</span>
11
+ <% end %>
12
+
13
+ <%= pb_rails("flex", props: { align: "center", margin_top: "md" }) do %>
14
+ <%= pb_rails("icon_button", props: {size: "1x"}) %> <span>1x</span>
15
+ <% end %>
16
+
17
+ <%= pb_rails("flex", props: { align: "center" }) do %>
18
+ <%= pb_rails("icon_button", props: {size: "2x"}) %> <span>2x</span>
19
+ <% end %>
20
+
21
+ <%= pb_rails("flex", props: { align: "center" }) do %>
22
+ <%= pb_rails("icon_button", props: {size: "3x"}) %> <span>3x</span>
23
+ <% end %>
24
+
25
+ <%= pb_rails("flex", props: { align: "center" }) do %>
26
+ <%= pb_rails("icon_button", props: {size: "4x"}) %> <span>4x</span>
27
+ <% end %>
@@ -0,0 +1,5 @@
1
+ examples:
2
+
3
+ rails:
4
+ - icon_button_default: Default
5
+ - icon_button_sizes: Sizes
@@ -0,0 +1,15 @@
1
+ <div>
2
+ <%= pb_rails("link", props: {
3
+ href: "http://google.com",
4
+ target: "blank",
5
+ text: "Open In New Window"
6
+ }) %>
7
+ </div>
8
+
9
+ <div>
10
+ <%= pb_rails("link", props: {
11
+ href: "https://playbook.powerapp.cloud/",
12
+ target: "child",
13
+ text: "Open In Child Tab",
14
+ }) %>
15
+ </div>
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { Link } from 'playbook-ui'
3
+
4
+ const LinkTarget = (props) => (
5
+ <div>
6
+ <div>
7
+ <Link
8
+ aria={{ label: 'Link to Google in new window' }}
9
+ href="https://google.com"
10
+ tabIndex={0}
11
+ target='blank'
12
+ text="Open In New Window"
13
+ {...props}
14
+ />
15
+ </div>
16
+ <div>
17
+ <Link
18
+ aria={{ label: 'Link to Playbook in a child tab' }}
19
+ href="https://playbook.powerapp.cloud/"
20
+ tabIndex={0}
21
+ target='child'
22
+ text="Open In Child Tab"
23
+ {...props}
24
+ />
25
+ </div>
26
+ </div>
27
+ )
28
+
29
+ export default LinkTarget
@@ -1,16 +1,18 @@
1
1
  examples:
2
-
2
+
3
3
  rails:
4
4
  - link_color: Color
5
5
  - link_underline: Underline
6
6
  - link_icon: Icon
7
7
  - link_disabled: Disabled
8
8
  - link_tag: Tag
9
-
10
-
9
+ - link_target: Target
10
+
11
+
11
12
  react:
12
13
  - link_color: Color
13
14
  - link_underline: Underline
14
15
  - link_icon: Icon
15
16
  - link_disabled: Disabled
16
17
  - link_tag: Tag
18
+ - link_target: Target
@@ -2,4 +2,5 @@ export { default as LinkColor } from './_link_color.jsx'
2
2
  export { default as LinkUnderline } from './_link_underline.jsx'
3
3
  export { default as LinkIcon } from './_link_icon.jsx'
4
4
  export { default as LinkDisabled } from './_link_disabled.jsx'
5
- export { default as LinkTag } from './_link_tag.jsx'
5
+ export { default as LinkTag } from './_link_tag.jsx'
6
+ export { default as LinkTarget } from './_link_target.jsx'
@@ -0,0 +1,37 @@
1
+ import React, { forwardRef } from 'react'
2
+ import {
3
+ Overlay,
4
+ Card,
5
+ Flex,
6
+ FlexItem,
7
+ } from 'playbook-ui'
8
+
9
+ const InlineCardsExample = forwardRef(function InlineCardsExample(ref) {
10
+ return (
11
+ <Flex
12
+ columnGap="lg"
13
+ orientation="row"
14
+ ref={ref}
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 OverlayVerticalDynamicMultiDirectional = () => (
26
+ <>
27
+ <Overlay
28
+ color="card_light"
29
+ dynamic
30
+ layout={{"x": "xl"}}
31
+ >
32
+ <InlineCardsExample />
33
+ </Overlay>
34
+ </>
35
+ )
36
+
37
+ export default OverlayVerticalDynamicMultiDirectional
@@ -0,0 +1 @@
1
+ Pass the `dynamic` prop to make the overlay render while the scrollbar isn't at either end on the scrollbar. You must also add a `ref` to the child that's being passed through the Overlay.
@@ -2,6 +2,7 @@ examples:
2
2
  react:
3
3
  - overlay_default: Default
4
4
  - overlay_multi_directional: Multi-directional
5
+ - overlay_vertical_dynamic_multi_directional: Vertical Dynamic Multi-directional
5
6
  - overlay_toggle: Toggle
6
7
 
7
8
  rails:
@@ -1,3 +1,4 @@
1
1
  export { default as OverlayDefault } from './_overlay_default.jsx'
2
2
  export { default as OverlayMultiDirectional } from './_overlay_multi_directional.jsx'
3
3
  export { default as OverlayToggle } from './_overlay_toggle.jsx'
4
+ export { default as OverlayVerticalDynamicMultiDirectional } from './_overlay_vertical_dynamic_multi_directional.jsx'