playbook_ui 14.17.0.pre.rc.1 → 14.18.0.pre.alpha.PLAY20787400

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 (220) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +23 -3
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +67 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +1 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +29 -19
  6. data/app/pb_kits/playbook/pb_advanced_table/Utilities/types.ts +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +133 -124
  8. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +92 -2
  9. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +20 -7
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.jsx +66 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md +10 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +90 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +3 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +58 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +6 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +64 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +8 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +55 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +3 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +33 -0
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +3 -0
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +1 -2
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
  25. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  26. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +6 -2
  27. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +6 -2
  28. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +9 -3
  29. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +6 -1
  30. data/app/pb_kits/playbook/pb_advanced_table/index.js +7 -0
  31. data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +97 -0
  32. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  33. data/app/pb_kits/playbook/pb_background/_background.scss +26 -0
  34. data/app/pb_kits/playbook/pb_background/_background.tsx +5 -3
  35. data/app/pb_kits/playbook/pb_background/background.test.js +5 -0
  36. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.jsx +35 -0
  37. data/app/pb_kits/playbook/pb_background/docs/_background_overlay.md +1 -0
  38. data/app/pb_kits/playbook/pb_background/docs/example.yml +1 -0
  39. data/app/pb_kits/playbook/pb_background/docs/index.js +1 -0
  40. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
  41. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +2 -2
  42. data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +53 -0
  43. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
  44. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
  45. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
  46. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
  47. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
  48. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
  49. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
  50. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
  51. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
  52. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
  53. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
  54. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +38 -0
  55. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +1 -0
  56. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
  57. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
  58. data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +2 -3
  59. data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +2 -1
  60. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +39 -1
  61. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +4 -0
  62. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +9 -1
  63. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +14 -0
  64. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +28 -0
  65. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +42 -0
  66. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +1 -0
  67. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
  68. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
  69. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +14 -7
  70. data/app/pb_kits/playbook/pb_contact/contact.test.js +7 -7
  71. data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +19 -45
  72. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +54 -0
  73. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +3 -0
  74. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +14 -0
  75. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +3 -0
  76. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +2 -0
  77. data/app/pb_kits/playbook/pb_copy_button/docs/index.js +2 -1
  78. data/app/pb_kits/playbook/pb_copy_button/index.js +46 -20
  79. data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +45 -0
  80. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +12 -0
  81. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +12 -0
  82. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +50 -1
  83. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +4 -0
  84. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
  85. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +5 -1
  86. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +34 -0
  87. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +14 -0
  88. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +20 -0
  89. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +14 -0
  90. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  91. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
  92. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +10 -0
  93. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +2 -2
  94. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.test.js +1 -1
  95. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +10 -1
  96. data/app/pb_kits/playbook/pb_dialog/dialog.rb +2 -0
  97. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +117 -0
  98. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +9 -0
  99. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
  100. data/app/pb_kits/playbook/pb_dialog/index.js +106 -14
  101. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +43 -20
  102. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +58 -17
  103. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +102 -105
  104. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +3 -3
  105. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +50 -48
  106. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -1
  107. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.jsx +110 -0
  108. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_line.md +5 -0
  109. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.html.erb +42 -0
  110. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.md +1 -0
  111. data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table_react.jsx → _draggable_with_table.jsx} +1 -1
  112. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +3 -1
  113. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +10 -6
  114. data/app/pb_kits/playbook/pb_draggable/docs/index.js +4 -1
  115. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +71 -3
  116. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -3
  117. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -1
  118. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
  119. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
  120. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
  121. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
  122. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +3 -3
  123. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
  124. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +45 -3
  125. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +15 -5
  126. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +39 -6
  127. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +30 -0
  128. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +1 -0
  129. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +1 -0
  130. data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
  131. data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +85 -0
  132. data/app/pb_kits/playbook/pb_icon/icon.test.js +9 -9
  133. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.test.js +1 -1
  134. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +1 -1
  135. data/app/pb_kits/playbook/pb_icon_value/icon_value.test.js +1 -1
  136. data/app/pb_kits/playbook/pb_label_value/label_value.test.js +1 -1
  137. data/app/pb_kits/playbook/pb_layout/_layout.scss +127 -0
  138. data/app/pb_kits/playbook/pb_layout/_layout.tsx +47 -7
  139. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +394 -0
  140. data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +5 -0
  141. data/app/pb_kits/playbook/pb_layout/docs/example.yml +1 -0
  142. data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
  143. data/app/pb_kits/playbook/pb_layout/layout.test.js +4 -0
  144. data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +121 -0
  145. data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +79 -0
  146. data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +74 -0
  147. data/app/pb_kits/playbook/pb_link/link.test.jsx +2 -2
  148. data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +5 -3
  149. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +83 -22
  150. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +39 -7
  151. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +63 -0
  152. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +3 -0
  153. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +1 -7
  154. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +49 -0
  155. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +1 -0
  156. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +81 -0
  157. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +1 -0
  158. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +39 -0
  159. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +1 -0
  160. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +40 -0
  161. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +5 -0
  162. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +5 -0
  163. data/app/pb_kits/playbook/pb_overlay/docs/index.js +5 -0
  164. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +39 -1
  165. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +1 -0
  166. data/app/pb_kits/playbook/pb_stat_change/stat_change.test.js +8 -4
  167. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
  168. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +3 -1
  169. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +3 -1
  170. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +3 -1
  171. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +3 -1
  172. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.html.erb +34 -0
  173. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_rails.md +1 -0
  174. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.html.erb +36 -0
  175. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_rails.md +1 -0
  176. data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -1
  177. data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
  178. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
  179. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +19 -7
  180. data/app/pb_kits/playbook/pb_table/styles/_striped.scss +3 -3
  181. data/app/pb_kits/playbook/pb_table/table.rb +13 -1
  182. data/app/pb_kits/playbook/pb_table/table_header.rb +13 -1
  183. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +13 -5
  184. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +94 -0
  185. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +1 -0
  186. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -0
  187. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  188. data/app/pb_kits/playbook/pb_text_input/inputMask.ts +8 -1
  189. data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +2 -5
  190. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
  191. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
  192. data/app/pb_kits/playbook/pb_user/user.html.erb +1 -6
  193. data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -6
  194. data/dist/chunks/_typeahead-BX8IifKY.js +22 -0
  195. data/dist/chunks/_weekday_stacked-DfMD7HJz.js +45 -0
  196. data/dist/chunks/lib-96_ZmvAo.js +29 -0
  197. data/dist/chunks/{pb_form_validation-BvNy9Bd6.js → pb_form_validation-Vv2TqXVC.js} +1 -1
  198. data/dist/chunks/vendor.js +1 -1
  199. data/dist/menu.yml +2 -2
  200. data/dist/playbook-doc.js +19 -1
  201. data/dist/playbook-rails-react-bindings.js +1 -1
  202. data/dist/playbook-rails.js +1 -1
  203. data/dist/playbook.css +1 -1
  204. data/lib/playbook/kit_base.rb +4 -4
  205. data/lib/playbook/version.rb +2 -2
  206. metadata +79 -18
  207. data/dist/chunks/_typeahead-Djo6qCne.js +0 -22
  208. data/dist/chunks/_weekday_stacked-DIIHW0OV.js +0 -45
  209. data/dist/chunks/lib-BGzBzFZX.js +0 -29
  210. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default_rails.html.erb → _draggable_default.html.erb} +0 -0
  211. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_default.md → _draggable_default_react.md} +0 -0
  212. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers_rails.html.erb → _draggable_multiple_containers.html.erb} +0 -0
  213. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_multiple_containers.md → _draggable_multiple_containers_react.md} +0 -0
  214. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards_rails.html.erb → _draggable_with_cards.html.erb} +0 -0
  215. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_cards.md → _draggable_with_cards_react.md} +0 -0
  216. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list_rails.html.erb → _draggable_with_list.html.erb} +0 -0
  217. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_list.md → _draggable_with_list_react.md} +0 -0
  218. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list_rails.html.erb → _draggable_with_selectable_list.html.erb} +0 -0
  219. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_selectable_list.md → _draggable_with_selectable_list_react.md} +0 -0
  220. /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_with_table.md → _draggable_with_table_rails.md} +0 -0
@@ -0,0 +1,110 @@
1
+ import React, { useState } from "react";
2
+ import Flex from '../../pb_flex/_flex'
3
+ import Caption from '../../pb_caption/_caption'
4
+ import Draggable from '../_draggable'
5
+ import { DraggableProvider } from '../context'
6
+ import Image from '../../pb_image/_image'
7
+
8
+
9
+
10
+ const dataLineVertical = [
11
+ {
12
+ id: "211",
13
+ url: "https://unsplash.it/500/400/?image=633",
14
+ },
15
+ {
16
+ id: "212",
17
+ url: "https://unsplash.it/500/400/?image=634",
18
+ },
19
+ {
20
+ id: "213",
21
+ url: "https://unsplash.it/500/400/?image=637",
22
+ },
23
+ ];
24
+
25
+ const dataLineHorizontal = [
26
+ {
27
+ id: "2111",
28
+ url: "https://unsplash.it/500/400/?image=633",
29
+ },
30
+ {
31
+ id: "2122",
32
+ url: "https://unsplash.it/500/400/?image=634",
33
+ },
34
+ {
35
+ id: "2133",
36
+ url: "https://unsplash.it/500/400/?image=637",
37
+ },
38
+ ];
39
+
40
+ const DraggableDropZones = (props) => {
41
+ const [initialLineVerticalState, setInitialLineVerticalState] = useState(dataLineVertical);
42
+ const [initialLineHorizontalState, setInitialLineHorizontalState] = useState(dataLineHorizontal);
43
+
44
+ return (
45
+ <>
46
+ <Caption marginBottom="xs"
47
+ marginTop="xl"
48
+ text="Vertical"
49
+ />
50
+ <DraggableProvider
51
+ dropZone={{ type: "line", color: "purple" }}
52
+ initialItems={dataLineVertical}
53
+ onReorder={(items) => setInitialLineVerticalState(items)}
54
+ >
55
+ <Draggable.Container {...props}>
56
+ <Flex flexDirection="column"
57
+ height="367px"
58
+ >
59
+ {initialLineVerticalState.map(({ id, url }) => (
60
+ <Draggable.Item dragId={id}
61
+ key={id}
62
+ marginBottom="sm"
63
+ >
64
+ <Image alt={id}
65
+ size="md"
66
+ url={url}
67
+ />
68
+ </Draggable.Item>
69
+ ))}
70
+ </Flex>
71
+ </Draggable.Container>
72
+ </DraggableProvider>
73
+ <Caption marginBottom="xs"
74
+ marginTop="xl"
75
+ text="Horizontal"
76
+ />
77
+ <Flex>
78
+ <DraggableProvider
79
+ dropZone={{ type: "line", direction: "horizontal" }}
80
+ initialItems={dataLineHorizontal}
81
+ onReorder={(items) => setInitialLineHorizontalState(items)}
82
+ >
83
+ <Draggable.Container
84
+ htmlOptions={{style:{ width: "285px"}}}
85
+ {...props}
86
+ >
87
+ <Flex alignItems="stretch"
88
+ flexDirection="row"
89
+ height="110px"
90
+ >
91
+ {initialLineHorizontalState.map(({ id, url }) => (
92
+ <Draggable.Item dragId={id}
93
+ key={id}
94
+ marginRight="sm"
95
+ >
96
+ <Image alt={id}
97
+ size="md"
98
+ url={url}
99
+ />
100
+ </Draggable.Item>
101
+ ))}
102
+ </Flex>
103
+ </Draggable.Container>
104
+ </DraggableProvider>
105
+ </Flex>
106
+ </>
107
+ );
108
+ };
109
+
110
+ export default DraggableDropZones;
@@ -0,0 +1,5 @@
1
+ When using the "line" style, make sure to set the appropriate `direction` attribute within the `dropZone` prop based on the orientation of your draggable view. By default, this is set to "vertical," but it can also be adjusted to "horizontal." Note that the direction attribute only applies to the "line" style and does not affect other drop zone styles. The default `color` for "line" is "primary" and "purple" is the only alternative color option.
2
+
3
+ The length of the line is calculated based off of the width (for "vertical") or height (for "horizontal") of the parent container holding the draggable items.
4
+
5
+ Additionally, if the parent container of the `DraggableProvider`/`DraggableContainer` (or a subcontainer within) does not have a set height (for "vertical") or width (for "horizontal"), like the [Draggable Drop Zones doc example](https://playbook.powerapp.cloud/kits/draggable/react#draggable-drop-zones) does, elements on the page may jump up (for "vertical") or to the left (for "horizontal") when an item is actively being dragged. To prevent this, give a parent element a fixed height (for "vertical") or width (for "horizontal") as demonstrated in this doc example.
@@ -0,0 +1,42 @@
1
+ <% initial_items = [
2
+ {
3
+ id: "100",
4
+ url: "https://unsplash.it/500/400/?image=638",
5
+ },
6
+ {
7
+ id: "200",
8
+ url: "https://unsplash.it/500/400/?image=639",
9
+ },
10
+ {
11
+ id: "300",
12
+ url: "https://unsplash.it/500/400/?image=640",
13
+ },
14
+ ] %>
15
+
16
+ <%= pb_rails("draggable", props: {initial_items: initial_items}) do %>
17
+ <%= pb_rails("draggable/draggable_container") do %>
18
+ <%= pb_rails("flex") do %>
19
+ <% initial_items.each do |item| %>
20
+ <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id]}) do %>
21
+ <%= pb_rails("image", props: { alt: item[:id], size: "md", url: item[:url], margin: "xs" }) %>
22
+ <% end %>
23
+ <% end %>
24
+ <% end %>
25
+ <% end %>
26
+ <% end %>
27
+
28
+ <script>
29
+ const itemIds = ["item_100", "item_200", "item_300"];
30
+
31
+ itemIds.forEach((id) => {
32
+ const element = document.getElementById(id);
33
+ if (element) {
34
+ element.addEventListener("dragstart", (event) => {
35
+ console.log(`${id} drag start!`);
36
+ });
37
+ element.addEventListener("dragend", (event) => {
38
+ console.log(`${id} drag end!`);
39
+ });
40
+ }
41
+ });
42
+ </script>
@@ -0,0 +1 @@
1
+ You can add drag event listeners for `drag`, `dragend`, `dragenter`, `dragleave`, `dragover`, `dragstart`, and `drop`.
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
 
3
3
  import Flex from '../../pb_flex/_flex'
4
- import { DraggableProvider } from '../../pb_draggable/context'
4
+ import { DraggableProvider } from '../context'
5
5
  import Avatar from '../../pb_avatar/_avatar'
6
6
  import Body from '../../pb_body/_body'
7
7
  import Table from '../../pb_table/_table'
@@ -2,4 +2,6 @@ The draggable kit can also be used in conjunction with the table kit to create d
2
2
 
3
3
  - Wrap the Table with the `DraggableProvider` and manage state as shown.
4
4
  - use the `draggableContainer` prop on the Table.Body to designate it as the Draggable Container
5
- - use the `draggableItem` prop on the Table.Row to designate it as the Draggable Item. Make sure to also pass id to the `dragId` prop here.
5
+ - use the `draggableItem` prop on the Table.Row to designate it as the Draggable Item. Make sure to also pass id to the `dragId` prop here.
6
+
7
+ We recommending using the default `dropZone type` with the Table kit.
@@ -4,14 +4,18 @@ examples:
4
4
  - draggable_with_list: Draggable with List Kit
5
5
  - draggable_with_selectable_list: Draggable with SelectableList Kit
6
6
  - draggable_with_cards: Draggable with Cards
7
- - draggable_with_table_react: Draggable with Table
7
+ - draggable_with_table: Draggable with Table
8
8
  - draggable_multiple_containers: Dragging Across Multiple Containers
9
+ - draggable_drop_zones: Draggable Drop Zones
10
+ - draggable_drop_zones_colors: Draggable Drop Zones Colors
11
+ - draggable_drop_zones_line: Draggable Drop Zones Line
9
12
 
10
13
  rails:
11
- - draggable_default_rails: Default
12
- - draggable_with_list_rails: Draggable with List Kit
13
- - draggable_with_selectable_list_rails: Draggable with SelectableList Kit
14
- - draggable_with_cards_rails: Draggable with Cards
14
+ - draggable_default: Default
15
+ - draggable_with_list: Draggable with List Kit
16
+ - draggable_with_selectable_list: Draggable with SelectableList Kit
17
+ - draggable_with_cards: Draggable with Cards
15
18
  - draggable_with_table: Draggable with Table
16
- - draggable_multiple_containers_rails: Dragging Across Multiple Containers
19
+ - draggable_multiple_containers: Dragging Across Multiple Containers
20
+ - draggable_event_listeners: Draggable Event Listeners
17
21
 
@@ -3,4 +3,7 @@ export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
3
3
  export { default as DraggableWithList } from './_draggable_with_list.jsx'
4
4
  export { default as DraggableWithSelectableList } from './_draggable_with_selectable_list.jsx'
5
5
  export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
6
- export { default as DraggableWithTableReact } from './_draggable_with_table_react.jsx'
6
+ export { default as DraggableWithTable } from './_draggable_with_table.jsx'
7
+ export { default as DraggableDropZones } from './_draggable_drop_zones.jsx'
8
+ export { default as DraggableDropZonesColors } from './_draggable_drop_zones_colors.jsx'
9
+ export { default as DraggableDropZonesLine } from './_draggable_drop_zones_line.jsx'
@@ -128,6 +128,58 @@ const DraggableKitWithCard = () => {
128
128
  );
129
129
  };
130
130
 
131
+ const DraggableWithLineVertical = () => {
132
+ const [initialState, setInitialState] = useState(data);
133
+ return (
134
+ <div data-testid={testId}>
135
+ <DraggableProvider
136
+ dropZone={{ type: "line" }}
137
+ initialItems={data}
138
+ onReorder={(items) => setInitialState(items)}
139
+ >
140
+ <Draggable>
141
+ <Draggable.Container>
142
+ {initialState.map(({ id, text }) => (
143
+ <Draggable.Item
144
+ dragId={id}
145
+ key={id}
146
+ >
147
+ {text}
148
+ </Draggable.Item>
149
+ ))}
150
+ </Draggable.Container>
151
+ </Draggable>
152
+ </DraggableProvider>
153
+ </div>
154
+ );
155
+ };
156
+
157
+ const DraggableWithLineHorizontal = () => {
158
+ const [initialState, setInitialState] = useState(data);
159
+ return (
160
+ <div data-testid={testId}>
161
+ <DraggableProvider
162
+ dropZone={{ type: "line", direction: "horizontal" }}
163
+ initialItems={data}
164
+ onReorder={(items) => setInitialState(items)}
165
+ >
166
+ <Draggable>
167
+ <Draggable.Container>
168
+ {initialState.map(({ id, text }) => (
169
+ <Draggable.Item
170
+ dragId={id}
171
+ key={id}
172
+ >
173
+ {text}
174
+ </Draggable.Item>
175
+ ))}
176
+ </Draggable.Container>
177
+ </Draggable>
178
+ </DraggableProvider>
179
+ </div>
180
+ );
181
+ };
182
+
131
183
  test("generated default kit and classname", () => {
132
184
  render(<DefaultDraggableKit />);
133
185
  const kit = screen.getByTestId(testId);
@@ -165,7 +217,7 @@ test("generated dragHandle with List", () => {
165
217
 
166
218
  const list = kit.querySelector(".pb_list_kit");
167
219
  expect(list).toBeInTheDocument();
168
- const dragHandle = list.querySelector(".fa-grip-dots-vertical");
220
+ const dragHandle = list.querySelector(".pb_custom_icon");
169
221
  expect(dragHandle).toBeInTheDocument();
170
222
  });
171
223
 
@@ -175,7 +227,7 @@ test("generated dragHandle with SelectableList", () => {
175
227
 
176
228
  const selectabellist = kit.querySelector(".pb_selectable_list_kit");
177
229
  expect(selectabellist).toBeInTheDocument();
178
- const dragHandle = selectabellist.querySelector(".fa-grip-dots-vertical");
230
+ const dragHandle = selectabellist.querySelector(".pb_custom_icon");
179
231
  expect(dragHandle).toBeInTheDocument();
180
232
  });
181
233
 
@@ -185,6 +237,22 @@ test("generated dragHandle with Card", () => {
185
237
 
186
238
  const card = kit.querySelector(".pb_card_kit_deselected_border_radius_md");
187
239
  expect(card).toBeInTheDocument();
188
- const dragHandle = card.querySelector(".fa-grip-dots-vertical");
240
+ const dragHandle = card.querySelector(".pb_custom_icon");
189
241
  expect(dragHandle).toBeInTheDocument();
190
242
  });
243
+
244
+ test("line dropZone with default direction applies 'line_vertical' class to container", () => {
245
+ render(<DraggableWithLineVertical />);
246
+ const kit = screen.getByTestId(testId);
247
+ const container = kit.querySelector(".pb_draggable_container");
248
+
249
+ expect(container).toHaveClass("line_vertical");
250
+ });
251
+
252
+ test("line dropZone with horizontal direction applies 'line_horizontal' class to container", () => {
253
+ render(<DraggableWithLineHorizontal />);
254
+ const kit = screen.getByTestId(testId);
255
+ const container = kit.querySelector(".pb_draggable_container");
256
+
257
+ expect(container).toHaveClass("line_horizontal");
258
+ });
@@ -31,7 +31,7 @@ const DraggableContainer = (props: DraggableContainerProps) => {
31
31
  } = contextValues;
32
32
 
33
33
  // Only get direction if dropZone is 'line'
34
- const direction = dropZone === 'line' ? (contextValues.direction || 'vertical') : 'vertical';
34
+ const direction = dropZone === 'line' ? (contextValues.direction || 'vertical') : null;
35
35
 
36
36
  const ariaProps = buildAriaProps(aria);
37
37
  const dataProps = buildDataProps(data);
@@ -41,8 +41,9 @@ const DraggableContainer = (props: DraggableContainerProps) => {
41
41
  const classes = classnames(
42
42
  buildCss("pb_draggable_container"),
43
43
  `${activeContainer === container ? "active" : ""}`,
44
- // Only add vertical class if dropZone is 'line' and direction is 'vertical'
45
- (dropZone === 'line' && direction === 'vertical') ? 'vertical' : '',
44
+ // Line variant gets line_{direction} classname on container no matter what
45
+ dropZone === 'line' && direction === 'vertical' ? 'line_vertical' : '',
46
+ dropZone === 'line' && direction === 'horizontal' ? 'line_horizontal' : '',
46
47
  globalProps(props),
47
48
  className
48
49
  );
@@ -35,7 +35,7 @@ type DropdownProps = {
35
35
  label?: string;
36
36
  onSelect?: (arg: GenericObject) => null;
37
37
  options: GenericObject;
38
- separators: boolean;
38
+ separators?: boolean;
39
39
  triggerRef?: any;
40
40
  variant?: "default" | "subtle";
41
41
  };
@@ -12,7 +12,7 @@ const DropdownWithAutocomplete = (props) => {
12
12
  label: "Jasper Furniss",
13
13
  value: "Jasper Furniss",
14
14
  territory: "PHL",
15
- title: "Senior UX Engineer",
15
+ title: "Lead UX Engineer",
16
16
  id: "jasper-furniss",
17
17
  status: "Offline"
18
18
  },
@@ -25,18 +25,18 @@ const DropdownWithAutocomplete = (props) => {
25
25
  status: "Away"
26
26
  },
27
27
  {
28
- label: "Jason Cypret",
29
- value: "Jason Cypret",
28
+ label: "Carlos Lima",
29
+ value: "Carlos Lima",
30
30
  territory: "PHL",
31
- title: "VP of User Experience",
32
- id: "jason-cypret",
31
+ title: "Nitro Developer",
32
+ id: "carlos-lima",
33
33
  status: "Online"
34
34
  },
35
35
  {
36
36
  label: "Courtney Long",
37
37
  value: "Courtney Long",
38
38
  territory: "PHL",
39
- title: "UX Design Mentor",
39
+ title: "Lead UX Designer",
40
40
  id: "courtney-long",
41
41
  status: "Online"
42
42
  }
@@ -15,7 +15,7 @@ const DropdownWithAutocompleteAndCustomDisplay = (props) => {
15
15
  label: "Jasper Furniss",
16
16
  value: "Jasper Furniss",
17
17
  territory: "PHL",
18
- title: "Senior UX Engineer",
18
+ title: "Lead UX Engineer",
19
19
  id: "jasper-furniss",
20
20
  status: "Offline"
21
21
  },
@@ -28,18 +28,18 @@ const DropdownWithAutocompleteAndCustomDisplay = (props) => {
28
28
  status: "Away"
29
29
  },
30
30
  {
31
- label: "Jason Cypret",
32
- value: "Jason Cypret",
31
+ label: "Carlos Lima",
32
+ value: "Carlos Lima",
33
33
  territory: "PHL",
34
- title: "VP of User Experience",
35
- id: "jason-cypret",
34
+ title: "Nitro Developer",
35
+ id: "carlos-lima",
36
36
  status: "Online"
37
37
  },
38
38
  {
39
39
  label: "Courtney Long",
40
40
  value: "Courtney Long",
41
41
  territory: "PHL",
42
- title: "UX Design Mentor",
42
+ title: "Lead UX Designer",
43
43
  id: "courtney-long",
44
44
  status: "Online"
45
45
  }
@@ -15,7 +15,7 @@ const DropdownWithCustomDisplay = (props) => {
15
15
  label: "Jasper Furniss",
16
16
  value: "Jasper Furniss",
17
17
  territory: "PHL",
18
- title: "Senior UX Engineer",
18
+ title: "Lead UX Engineer",
19
19
  id: "jasper-furniss",
20
20
  status: "Offline"
21
21
  },
@@ -28,18 +28,18 @@ const DropdownWithCustomDisplay = (props) => {
28
28
  status: "Away"
29
29
  },
30
30
  {
31
- label: "Jason Cypret",
32
- value: "Jason Cypret",
31
+ label: "Carlos Lima",
32
+ value: "Carlos Lima",
33
33
  territory: "PHL",
34
- title: "VP of User Experience",
35
- id: "jason-cypret",
34
+ title: "Nitro Developer",
35
+ id: "carlos-lima",
36
36
  status: "Online"
37
37
  },
38
38
  {
39
39
  label: "Courtney Long",
40
40
  value: "Courtney Long",
41
41
  territory: "PHL",
42
- title: "UX Design Mentor",
42
+ title: "Lead UX Designer",
43
43
  id: "courtney-long",
44
44
  status: "Online"
45
45
  }
@@ -1,10 +1,10 @@
1
1
  <%
2
- options = [
2
+ options = [
3
3
  {
4
4
  label: "Jasper Furniss",
5
5
  value: "Jasper Furniss",
6
6
  territory: "PHL",
7
- title: "Senior UX Engineer",
7
+ title: "Lead UX Engineer",
8
8
  id: "jasper-furniss",
9
9
  status: "Offline"
10
10
  },
@@ -17,22 +17,22 @@
17
17
  status: "Away"
18
18
  },
19
19
  {
20
- label: "Jason Cypret",
21
- value: "Jason Cypret",
20
+ label: "Carlos Lima",
21
+ value: "Carlos Lima",
22
22
  territory: "PHL",
23
- title: "VP of User Experience",
24
- id: "jason-cypret",
23
+ title: "Nitro Developer",
24
+ id: "carlos-lima",
25
25
  status: "Online"
26
26
  },
27
27
  {
28
28
  label: "Courtney Long",
29
29
  value: "Courtney Long",
30
30
  territory: "PHL",
31
- title: "UX Design Mentor",
31
+ title: "Lead UX Designer",
32
32
  id: "courtney-long",
33
33
  status: "Online"
34
34
  }
35
- ]
35
+ ];
36
36
 
37
37
  %>
38
38
 
@@ -95,7 +95,7 @@ test('generated customDisplay for trigger', () => {
95
95
 
96
96
  const kit = screen.getByTestId(testId)
97
97
  const trigger = kit.querySelector('.pb_dropdown_trigger')
98
- const customDisplay = trigger.querySelector('.fa-flag.pb_icon_kit.fa-fw')
98
+ const customDisplay = trigger.querySelector('.pb_custom_icon')
99
99
  expect(customDisplay).toBeInTheDocument()
100
100
  })
101
101
 
@@ -170,7 +170,7 @@ test('generated custom Trigger', () => {
170
170
  options={options}
171
171
  >
172
172
  <Dropdown.Trigger>
173
- <Icon icon="elephant" />
173
+ <Icon icon="flag" />
174
174
  </Dropdown.Trigger>
175
175
  {options.map((option) => (
176
176
  <Dropdown.Option key={option.id}
@@ -182,7 +182,7 @@ test('generated custom Trigger', () => {
182
182
 
183
183
  const kit = screen.getByTestId(testId)
184
184
  const trigger = kit.querySelector('.pb_dropdown_trigger')
185
- const customTrigger = trigger.querySelector('.fa-elephant.pb_icon_kit.fa-fw')
185
+ const customTrigger = trigger.querySelector('.pb_custom_icon')
186
186
  expect(customTrigger).toBeInTheDocument()
187
187
  })
188
188
 
@@ -22,7 +22,7 @@ type DropdownOptionProps = {
22
22
  data?: { [key: string]: string };
23
23
  htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
24
24
  id?: string;
25
- key?: string;
25
+ key?: string | number;
26
26
  option?: GenericObject;
27
27
  padding?: string;
28
28
  } & GlobalProps;
@@ -85,11 +85,19 @@
85
85
  .text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .text_input {
86
86
  border-bottom-right-radius: 0;
87
87
  border-top-right-radius: 0;
88
- border-right-width: 0;
88
+ border-right-color: transparent;
89
89
  }
90
+ [class^=pb_text_input_kit] .text_input_wrapper input:focus,
91
+ [class^=pb_text_input_kit] .text_input_wrapper .text_input:focus {
92
+ border-right-color: $primary;
93
+ }
94
+ [class^=pb_text_input_kit].error .text_input_wrapper input,
95
+ [class^=pb_text_input_kit].error .text_input_wrapper .text_input {
96
+ border-right-color: $error;
97
+ }
90
98
  }
91
99
 
92
- & > [class^=pb_phone_number_input]:not(:first-child) {
100
+ & > [class^=pb_phone_number_input]:not(:first-child), [class^=pb_passphrase]:not(:first-child) {
93
101
  .text_input_wrapper input, [class^=pb_text_input_kit] .text_input_wrapper .text_input {
94
102
  border-bottom-left-radius: 0;
95
103
  border-top-left-radius: 0;
@@ -107,8 +115,16 @@
107
115
  .text_input {
108
116
  border-bottom-right-radius: 0;
109
117
  border-top-right-radius: 0;
110
- border-right: none;
118
+ border-right-color: transparent;
111
119
  }
120
+ [class^=pb_text_input_kit] .text_input_wrapper input:focus,
121
+ [class^=pb_text_input_kit] .text_input_wrapper .text_input:focus {
122
+ border-right-color: $primary;
123
+ }
124
+ [class^=pb_text_input_kit].error .text_input_wrapper input,
125
+ [class^=pb_text_input_kit].error .text_input_wrapper .text_input {
126
+ border-right-color: $error;
127
+ }
112
128
  }
113
129
 
114
130
  &[class*=rails] > [class^=pb_date_picker_kit] {
@@ -205,4 +221,30 @@
205
221
  border-top-left-radius: 0;
206
222
  }
207
223
  }
224
+
225
+ .pb_text_input_kit.error {
226
+ .text_input_wrapper {
227
+ input:focus {
228
+ outline: none;
229
+ }
230
+ }
231
+
232
+ & + * input,
233
+ & + * select {
234
+ border-left-color: $red;
235
+ }
236
+ }
237
+
238
+ .pb_text_input_kit:not(.error):focus-within + .error,
239
+ .pb_text_input_kit:not(.error):focus-within + .pb_select .error {
240
+ input,
241
+ select {
242
+ border-left: none;
243
+ padding-left: calc(var(--iti-flag-width) + 1px);
244
+ }
245
+ }
246
+
247
+ &:has(> [class^="pb_select"]):has(> .pb_passphrase) [class^="pb_select"] {
248
+ align-self: baseline;
249
+ }
208
250
  }
@@ -1,5 +1,4 @@
1
- <div>
2
-
1
+ <%= pb_rails("flex", props: {orientation: "column", row_gap:"md"}) do %>
3
2
  <%= pb_rails("form_group") do %>
4
3
  <%= pb_rails("text_input", props: { placeholder: "Enter Artist Name" }) %>
5
4
  <%= pb_rails("select", props: {
@@ -17,8 +16,6 @@
17
16
  ]
18
17
  }) %>
19
18
  <% end %>
20
- <br>
21
- <br>
22
19
  <%= pb_rails("form_group") do %>
23
20
  <%= pb_rails("select", props: {
24
21
  blank_selection: "Phone",
@@ -32,4 +29,17 @@
32
29
  id: "phone"
33
30
  }) %>
34
31
  <% end %>
35
- </div>
32
+ <%= pb_rails("form_group") do %>
33
+ <%= pb_rails("phone_number_input", props: {
34
+ id: "phone2"
35
+ }) %>
36
+ <%= pb_rails("select", props: {
37
+ blank_selection: "Phone",
38
+ options: [
39
+ { value: "Cell" },
40
+ { value: "Work" },
41
+ { value: "Home" },
42
+ ]
43
+ }) %>
44
+ <% end %>
45
+ <% end %>