playbook_ui_docs 16.10.0.pre.rc.1 → 16.10.0.pre.rc.2

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 (107) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +2 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +36 -44
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +10 -19
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +0 -4
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -5
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +0 -7
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +0 -7
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
  10. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_rails.md +1 -1
  11. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers.html.erb +35 -0
  12. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers_rails.md +8 -0
  13. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +3 -1
  14. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_react.md +1 -1
  15. data/app/pb_kits/playbook/pb_draggable/docs/_playground.json +260 -19
  16. data/app/pb_kits/playbook/pb_draggable/docs/_playground.overrides.json +258 -13
  17. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_dropdown/docs/_playground.json +1 -0
  19. data/app/pb_kits/playbook/pb_file_upload/docs/_playground.json +2 -1
  20. data/app/pb_kits/playbook/pb_filter/docs/_playground.json +301 -5
  21. data/app/pb_kits/playbook/pb_filter/docs/_playground.overrides.json +312 -0
  22. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.json +210 -14
  23. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.overrides.json +231 -0
  24. data/app/pb_kits/playbook/pb_flex/docs/_playground.json +297 -38
  25. data/app/pb_kits/playbook/pb_flex/docs/_playground.overrides.json +300 -40
  26. data/app/pb_kits/playbook/pb_form/docs/_playground.json +1 -13
  27. data/app/pb_kits/playbook/pb_form_group/docs/_playground.json +1 -23
  28. data/app/pb_kits/playbook/pb_form_pill/docs/_playground.json +155 -14
  29. data/app/pb_kits/playbook/pb_form_pill/docs/_playground.overrides.json +147 -0
  30. data/app/pb_kits/playbook/pb_hashtag/docs/_playground.json +72 -11
  31. data/app/pb_kits/playbook/pb_hashtag/docs/_playground.overrides.json +75 -0
  32. data/app/pb_kits/playbook/pb_highlight/docs/_playground.json +75 -4
  33. data/app/pb_kits/playbook/pb_highlight/docs/_playground.overrides.json +75 -0
  34. data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.json +138 -12
  35. data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.overrides.json +162 -0
  36. data/app/pb_kits/playbook/pb_icon/docs/_playground.json +79 -40
  37. data/app/pb_kits/playbook/pb_icon/docs/_playground.overrides.json +96 -27
  38. data/app/pb_kits/playbook/pb_icon_button/docs/_playground.json +111 -9
  39. data/app/pb_kits/playbook/pb_icon_button/docs/_playground.overrides.json +131 -0
  40. data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.json +92 -7
  41. data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.overrides.json +108 -0
  42. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.json +32 -17
  43. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.overrides.json +81 -8
  44. data/app/pb_kits/playbook/pb_icon_value/docs/_playground.json +28 -18
  45. data/app/pb_kits/playbook/pb_icon_value/docs/_playground.overrides.json +58 -9
  46. data/app/pb_kits/playbook/pb_image/docs/_playground.json +124 -47
  47. data/app/pb_kits/playbook/pb_image/docs/_playground.overrides.json +122 -47
  48. data/app/pb_kits/playbook/pb_label_pill/docs/_playground.json +68 -6
  49. data/app/pb_kits/playbook/pb_label_pill/docs/_playground.overrides.json +85 -0
  50. data/app/pb_kits/playbook/pb_label_value/docs/_playground.json +59 -36
  51. data/app/pb_kits/playbook/pb_label_value/docs/_playground.overrides.json +101 -30
  52. data/app/pb_kits/playbook/pb_layout/docs/_playground.json +1 -40
  53. data/app/pb_kits/playbook/pb_legend/docs/_playground.json +60 -7
  54. data/app/pb_kits/playbook/pb_legend/docs/_playground.overrides.json +77 -0
  55. data/app/pb_kits/playbook/pb_list/docs/_playground.json +165 -17
  56. data/app/pb_kits/playbook/pb_list/docs/_playground.overrides.json +191 -0
  57. data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.json +28 -1
  58. data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.overrides.json +27 -1
  59. data/app/pb_kits/playbook/pb_map/docs/_playground.json +164 -7
  60. data/app/pb_kits/playbook/pb_map/docs/_playground.overrides.json +180 -0
  61. data/app/pb_kits/playbook/pb_message/docs/_playground.json +114 -8
  62. data/app/pb_kits/playbook/pb_message/docs/_playground.overrides.json +144 -0
  63. data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.json +310 -61
  64. data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.overrides.json +327 -44
  65. data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.json +35 -6
  66. data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.overrides.json +35 -6
  67. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.json +32 -21
  68. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.overrides.json +32 -21
  69. data/app/pb_kits/playbook/pb_nav/docs/_playground.json +546 -18
  70. data/app/pb_kits/playbook/pb_nav/docs/_playground.overrides.json +561 -14
  71. data/app/pb_kits/playbook/pb_online_status/docs/_playground.json +18 -23
  72. data/app/pb_kits/playbook/pb_online_status/docs/_playground.overrides.json +18 -14
  73. data/app/pb_kits/playbook/pb_overlay/docs/_playground.json +133 -14
  74. data/app/pb_kits/playbook/pb_overlay/docs/_playground.overrides.json +154 -0
  75. data/app/pb_kits/playbook/pb_pagination/docs/_playground.json +35 -14
  76. data/app/pb_kits/playbook/pb_pagination/docs/_playground.overrides.json +35 -14
  77. data/app/pb_kits/playbook/pb_passphrase/docs/_playground.json +129 -14
  78. data/app/pb_kits/playbook/pb_passphrase/docs/_playground.overrides.json +148 -0
  79. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.json +378 -4
  80. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.overrides.json +245 -0
  81. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.json +215 -4
  82. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.overrides.json +224 -0
  83. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.json +149 -4
  84. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.overrides.json +162 -0
  85. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.json +392 -4
  86. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.overrides.json +212 -0
  87. data/app/pb_kits/playbook/pb_person/docs/_playground.json +27 -11
  88. data/app/pb_kits/playbook/pb_person/docs/_playground.overrides.json +34 -9
  89. data/app/pb_kits/playbook/pb_person_contact/docs/_playground.json +72 -21
  90. data/app/pb_kits/playbook/pb_person_contact/docs/_playground.overrides.json +71 -21
  91. data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.json +179 -21
  92. data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.overrides.json +180 -0
  93. data/app/pb_kits/playbook/pb_pill/docs/_playground.json +16 -49
  94. data/app/pb_kits/playbook/pb_pill/docs/_playground.overrides.json +33 -30
  95. data/app/pb_kits/playbook/pb_popover/docs/_playground.json +155 -46
  96. data/app/pb_kits/playbook/pb_popover/docs/_playground.overrides.json +162 -30
  97. data/app/pb_kits/playbook/pb_progress_step/docs/_playground.json +1 -31
  98. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +1 -44
  99. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.json +1 -38
  100. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.json +1 -30
  101. data/app/pb_kits/playbook/pb_source/docs/_playground.json +1 -27
  102. data/app/pb_kits/playbook/pb_table/docs/_playground.json +1 -57
  103. data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.json +1 -32
  104. data/app/pb_kits/playbook/pb_timeline/docs/_playground.json +1 -27
  105. metadata +24 -4
  106. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +0 -92
  107. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4267f7b437b78af8734c0b08b776a4d8c14c8676bb558bc73ed30890c305d3cc
4
- data.tar.gz: c565734d3238c9f404ebcff2fa4b159b03aef1b97089c613aa607df543421b28
3
+ metadata.gz: 198af968a895742be35f3531714337260e08b7bf52fe6a13d7d4ce508afe262f
4
+ data.tar.gz: 43210e9fce280af93fd7e4e0e7e5ddf21c64ebfbafedb955b4475c648227fb6d
5
5
  SHA512:
6
- metadata.gz: b0ef9f525463816195a2f3e5ed4ff7d9b684341829979557a99664ee1879fcb65d1da6166003da9758ca64232004a9173c5beb86510e7e09eda31168498d4387
7
- data.tar.gz: 72079f297c3b342c8a5b34137f6b65a0cb8ff2a82452ccc433664415ca5d83ee93f4d75c59436ff037c85be3da8907c572c0f459345cce8602759c213f597f71
6
+ metadata.gz: baeb1a4f222328cf7ae972f95ca44041db163bc472880948cfed57585222a011c1e9bf961af9c524b97bfad149b40fdf343379448a00325e2f82b71f06860d32
7
+ data.tar.gz: 2cc98997bc248035efc41e101f4354d069a38dbb26b46d32ad260dcc8af6ad5f4ab4bfb106524cfab56a8558e9a85b20d44c56d1b2962ae51fa153ce3e94a002
@@ -1,6 +1,6 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../_advanced_table'
3
- import MOCK_DATA from "./advanced_table_mock_data_with_id.json"
3
+ import MOCK_DATA_WITH_ID from "./advanced_table_mock_data_with_id.json"
4
4
  import colors from '../../tokens/exports/_colors.module.scss'
5
5
 
6
6
 
@@ -55,7 +55,7 @@ const rowStyling = [
55
55
  <AdvancedTable
56
56
  columnDefinitions={columnDefinitions}
57
57
  rowStyling={rowStyling}
58
- tableData={MOCK_DATA}
58
+ tableData={MOCK_DATA_WITH_ID}
59
59
  {...props}
60
60
  />
61
61
  </div>
@@ -1,47 +1,39 @@
1
1
  <% column_definitions = [
2
- {
3
- accessor: "year",
4
- label: "Year",
5
- },
6
- {
7
- accessor: "newEnrollments",
8
- label: "New Enrollments",
9
- },
10
- {
11
- accessor: "scheduledMeetings",
12
- label: "Scheduled Meetings",
13
- },
14
- {
15
- accessor: "attendanceRate",
16
- label: "Attendance Rate",
17
- },
18
- {
19
- accessor: "completedClasses",
20
- label: "Completed Classes",
21
- },
22
- {
23
- accessor: "classCompletionRate",
24
- label: "Class Completion Rate",
25
- },
26
- {
27
- accessor: "graduatedStudents",
28
- label: "Graduated Students",
29
- }
30
- ] %>
31
-
32
- <% table_data = 15.times.map do |index|
33
2
  {
34
- year: (2020 + index).to_s,
35
- id: (2020 + index).to_s,
36
- newEnrollments: (20 + index).to_s,
37
- scheduledMeetings: (10 + index).to_s,
38
- attendanceRate: "#{50 + index}%",
39
- completedClasses: (3 + index).to_s,
40
- classCompletionRate: "#{30 + index}%",
41
- graduatedStudents: (19 + index).to_s,
42
- }
43
- end %>
3
+ accessor: "year",
4
+ label: "Year",
5
+ cellAccessors: ["quarter", "month", "day"],
6
+ },
7
+ {
8
+ accessor: "newEnrollments",
9
+ label: "New Enrollments",
10
+ },
11
+ {
12
+ accessor: "scheduledMeetings",
13
+ label: "Scheduled Meetings",
14
+ },
15
+ {
16
+ accessor: "attendanceRate",
17
+ label: "Attendance Rate",
18
+ },
19
+ {
20
+ accessor: "completedClasses",
21
+ label: "Completed Classes",
22
+ },
23
+ {
24
+ accessor: "classCompletionRate",
25
+ label: "Class Completion Rate",
26
+ },
27
+ {
28
+ accessor: "graduatedStudents",
29
+ label: "Graduated Students",
30
+ },
31
+ ] %>
44
32
 
45
- <div style="max-height: 320px; overflow-y: auto;">
46
- <%= pb_rails("advanced_table", props: { id: "table_props_sticky_table", table_data: table_data, column_definitions: column_definitions, table_props: { sticky: true }}) %>
47
- </div>
33
+ <%= pb_rails("advanced_table", props: {
34
+ id: "table_props_sticky_table",
35
+ table_data: @table_data,
36
+ column_definitions: column_definitions,
37
+ max_height: "xs",
38
+ table_props: { sticky: true },
39
+ }) %>
@@ -1,21 +1,13 @@
1
1
  import React from "react"
2
2
  import AdvancedTable from '../../pb_advanced_table/_advanced_table'
3
-
4
- const tableData = Array.from({ length: 15 }, (_, index) => ({
5
- year: String(2020 + index),
6
- newEnrollments: String(20 + index),
7
- scheduledMeetings: String(10 + index),
8
- attendanceRate: `${50 + index}%`,
9
- completedClasses: String(3 + index),
10
- classCompletionRate: `${30 + index}%`,
11
- graduatedStudents: String(19 + index),
12
- }))
3
+ import MOCK_DATA from "./advanced_table_mock_data.json"
13
4
 
14
5
  const AdvancedTableTablePropsStickyHeader = (props) => {
15
6
  const columnDefinitions = [
16
7
  {
17
8
  accessor: "year",
18
9
  label: "Year",
10
+ cellAccessors: ["quarter", "month", "day"],
19
11
  },
20
12
  {
21
13
  accessor: "newEnrollments",
@@ -44,18 +36,17 @@ const AdvancedTableTablePropsStickyHeader = (props) => {
44
36
  ]
45
37
 
46
38
  const tableProps = {
47
- sticky: true
39
+ sticky: true,
48
40
  }
49
41
 
50
42
  return (
51
- <div style={{ maxHeight: "320px", overflowY: "auto" }}>
52
- <AdvancedTable
53
- columnDefinitions={columnDefinitions}
54
- tableData={tableData}
55
- tableProps={tableProps}
56
- {...props}
57
- />
58
- </div>
43
+ <AdvancedTable
44
+ columnDefinitions={columnDefinitions}
45
+ maxHeight="xs"
46
+ tableData={MOCK_DATA}
47
+ tableProps={tableProps}
48
+ {...props}
49
+ />
59
50
  )
60
51
  }
61
52
 
@@ -2,10 +2,6 @@ Create a sticky header that works for responsive Advanced Tables by setting `sti
2
2
 
3
3
  **NOTE**: This behavior requires a `max_height` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
4
 
5
- Scroll inside the table preview to see the header stick.
6
-
7
- This example builds flat table data inline for the docs preview. For typical `table_data` setup, see [Default (Required Props)](/kits/advanced_table/default/rails#advanced_table_beta).
8
-
9
5
  Expand the table above to see this in action.
10
6
 
11
7
  A sticky header on a nonresponsive table is demonstrated in the ["Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table#sticky-header) doc example above.
@@ -1,9 +1,7 @@
1
- Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and wrapping the table in a scroll container (or using `maxHeight`).
1
+ Create a sticky header that works for responsive Advanced Tables by setting `sticky: true` via `tableProps` and giving the AdvancedTable a `maxHeight` using our [Max Height](https://playbook.powerapp.cloud/global_props/max_height) global prop.
2
2
 
3
- **NOTE**: The header is sticky within the table scroll area. The live example uses flat rows so you can scroll inside the preview without expanding subrows.
3
+ **NOTE**: This behavior requires a `maxHeight` to work. The header is sticky within the table container, allowing for it to work along with the first column stickiness of a responsive table on smaller screen sizes.
4
4
 
5
- This example builds flat table data inline for the docs preview. For typical `tableData` setup, see [Default (Required Props)](/kits/advanced_table/default/react#advanced_table_default).
6
-
7
- Expand the table above to see responsive behavior in action.
5
+ Expand the table above to see this in action.
8
6
 
9
7
  A sticky header on a nonresponsive table is demonstrated in the ["Sticky Header"](https://playbook.powerapp.cloud/kits/advanced_table/react#sticky-header) doc example above.
@@ -233,11 +233,6 @@
233
233
  "customSort": true
234
234
  }
235
235
  },
236
- "fullScreenControl": {
237
- "requires": {
238
- "allowFullScreen": true
239
- }
240
- },
241
236
  "enableSortingRemoval": {
242
237
  "requires": {
243
238
  "enableSorting": true
@@ -2954,9 +2949,7 @@
2954
2949
  },
2955
2950
  "hiddenProps": [
2956
2951
  "sortControl",
2957
- "fullScreenControl",
2958
2952
  "expandedControl",
2959
- "allowFullScreen",
2960
2953
  "pagination",
2961
2954
  "paginationProps"
2962
2955
  ],
@@ -73,9 +73,7 @@
73
73
  },
74
74
  "hiddenProps": [
75
75
  "sortControl",
76
- "fullScreenControl",
77
76
  "expandedControl",
78
- "allowFullScreen",
79
77
  "pagination",
80
78
  "paginationProps"
81
79
  ],
@@ -291,11 +289,6 @@
291
289
  "customSort": true
292
290
  }
293
291
  },
294
- "fullScreenControl": {
295
- "requires": {
296
- "allowFullScreen": true
297
- }
298
- },
299
292
  "enableSortingRemoval": {
300
293
  "requires": {
301
294
  "enableSorting": true
@@ -23,7 +23,6 @@ export { default as AdvancedTableTablePropsStickyHeader } from './_advanced_tabl
23
23
  export { default as AdvancedTableColumnHeadersCustomCell } from './_advanced_table_column_headers_custom_cell.jsx'
24
24
  export { default as AdvancedTableColumnHeadersVerticalBorder } from './_advanced_table_column_headers_vertical_border.jsx'
25
25
  export { default as AdvancedTableInlineEditing } from './_advanced_table_inline_editing.jsx'
26
- export { default as AdvancedTableFullscreen } from './_advanced_table_fullscreen.jsx'
27
26
  export { default as AdvancedTableStickyColumns } from './_advanced_table_sticky_columns.jsx'
28
27
  export { default as AdvancedTableStickyHeader } from './_advanced_table_sticky_header.jsx'
29
28
  export { default as AdvancedTableStickyColumnsAndHeader } from './_advanced_table_sticky_columns_and_header.jsx'
@@ -1 +1 @@
1
- You can add drag event listeners for `drag`, `dragend`, `dragenter`, `dragleave`, `dragover`, `dragstart`, and `drop`.
1
+ You can add drag event listeners for desktop `drag`, `dragend`, `dragenter`, `dragleave`, `dragover`, `dragstart`, and `drop` or mobile `touch`, `touchend`, `touchcancel`,`touchleave`, `touchmove`, `touchstart`
@@ -0,0 +1,35 @@
1
+ <% lists = [
2
+ {
3
+ title: "Morning Crew",
4
+ items: [
5
+ { id: "m1", name: "Alice Chen" },
6
+ { id: "m2", name: "Ben Ortiz" },
7
+ { id: "m3", name: "Cara Kim" },
8
+ ],
9
+ },
10
+ {
11
+ title: "Afternoon Crew",
12
+ items: [
13
+ { id: "a1", name: "Diana Patel" },
14
+ { id: "a2", name: "Evan Brooks" },
15
+ { id: "a3", name: "Fiona Lee" },
16
+ ],
17
+ },
18
+ ] %>
19
+
20
+ <%= pb_rails("flex", props: { gap: "md", justify_content: "center", wrap: true }) do %>
21
+ <% lists.each do |list| %>
22
+ <%= pb_rails("flex/flex_item", props: { fixed_size: "220px" }) do %>
23
+ <%= pb_rails("caption", props: { text: list[:title], text_align: "center", margin_bottom: "xs" }) %>
24
+ <%= pb_rails("draggable", props: { initial_items: list[:items] }) do %>
25
+ <%= pb_rails("draggable/draggable_container", props: { padding: "sm" }) do %>
26
+ <% list[:items].each do |item| %>
27
+ <%= pb_rails("draggable/draggable_item", props: { drag_id: item[:id], margin_bottom: "xs" }) do %>
28
+ <%= pb_rails("body", props: { text: item[:name] }) %>
29
+ <% end %>
30
+ <% end %>
31
+ <% end %>
32
+ <% end %>
33
+ <% end %>
34
+ <% end %>
35
+ <% end %>
@@ -0,0 +1,8 @@
1
+ Use a **separate** `draggable` kit for each list when items should reorder within their own column only.
2
+
3
+ Each instance creates its own drag boundary. Items stay inside that list on desktop and touch — they cannot be dropped into a neighboring list.
4
+
5
+ This is different from [Dragging Across Multiple Containers](#draggable_multiple_containers), which uses **one** `draggable` wrapping multiple `draggable/draggable_container` kits so items can move between columns.
6
+
7
+ On touch devices, drag from the grip handle. Swiping outside the handle scrolls as usual.
8
+
@@ -1 +1,3 @@
1
- The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
1
+ The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure — **one** `draggable` wrapping multiple `draggable/draggable_container` kits so items can move between columns.
2
+
3
+ For lists that should stay separate, see [Independent Draggable Containers](#draggable_independent_containers).
@@ -1 +1 @@
1
- The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
1
+ The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
@@ -1,54 +1,295 @@
1
1
  {
2
2
  "template": "<Draggable{{props}} />",
3
- "propTargets": {},
3
+ "propTargets": {
4
+ "dropZone": "Provider.props",
5
+ "providerId": "Provider.props",
6
+ "enableCrossContainerPreview": "Provider.props",
7
+ "htmlOptions": "Container.props",
8
+ "tag": "Container.props",
9
+ "onDragStart": "Item.props",
10
+ "onDragEnd": "Item.props",
11
+ "onDrop": "Item.props"
12
+ },
4
13
  "defaults": {
5
- "dropZoneColor": "neutral"
14
+ "dropZoneColor": "neutral",
15
+ "dropZone": {
16
+ "type": "ghost",
17
+ "color": "neutral",
18
+ "direction": "vertical"
19
+ },
20
+ "providerId": "draggable-playground",
21
+ "enableCrossContainerPreview": false
6
22
  },
7
23
  "groups": [
8
24
  {
9
- "name": "Appearance",
25
+ "name": "Provider",
10
26
  "props": [
11
27
  "dropZone",
12
- "dropZoneColor"
28
+ "providerId",
29
+ "enableCrossContainerPreview"
30
+ ]
31
+ },
32
+ {
33
+ "name": "Container",
34
+ "props": [
35
+ "tag"
36
+ ]
37
+ },
38
+ {
39
+ "name": "Item",
40
+ "props": [
41
+ "onDragStart",
42
+ "onDragEnd",
43
+ "onDrop"
13
44
  ]
14
45
  }
15
46
  ],
16
47
  "presets": [
17
48
  {
18
- "name": "Ghost (neutral)",
49
+ "name": "Single List",
50
+ "structureMode": "single_container",
51
+ "props": {
52
+ "dropZone": {
53
+ "type": "ghost",
54
+ "color": "neutral",
55
+ "direction": "vertical"
56
+ }
57
+ }
58
+ },
59
+ {
60
+ "name": "Outline Drop Zone",
61
+ "structureMode": "single_container",
62
+ "props": {
63
+ "dropZone": {
64
+ "type": "outline",
65
+ "color": "primary",
66
+ "direction": "vertical"
67
+ }
68
+ }
69
+ },
70
+ {
71
+ "name": "Shadow Drop Zone",
72
+ "structureMode": "single_container",
73
+ "props": {
74
+ "dropZone": {
75
+ "type": "shadow",
76
+ "color": "purple",
77
+ "direction": "vertical"
78
+ }
79
+ }
80
+ },
81
+ {
82
+ "name": "Line Vertical",
83
+ "structureMode": "single_container",
19
84
  "props": {
20
- "dropZone": "ghost",
21
- "dropZoneColor": "neutral"
85
+ "dropZone": {
86
+ "type": "line",
87
+ "color": "primary",
88
+ "direction": "vertical"
89
+ }
22
90
  }
23
91
  },
24
92
  {
25
- "name": "Outline (primary)",
93
+ "name": "Line Horizontal",
94
+ "structureMode": "single_container_horizontal",
26
95
  "props": {
27
- "dropZone": "outline",
28
- "dropZoneColor": "primary"
96
+ "dropZone": {
97
+ "type": "line",
98
+ "color": "primary",
99
+ "direction": "horizontal"
100
+ }
29
101
  }
30
102
  },
31
103
  {
32
- "name": "Shadow (purple)",
104
+ "name": "Multiple Containers",
105
+ "structureMode": "multiple_containers",
33
106
  "props": {
34
- "dropZone": "shadow",
35
- "dropZoneColor": "purple"
107
+ "dropZone": {
108
+ "type": "ghost",
109
+ "color": "neutral",
110
+ "direction": "vertical"
111
+ }
36
112
  }
37
113
  },
38
114
  {
39
- "name": "Line (neutral)",
115
+ "name": "Cross Container Preview",
116
+ "structureMode": "multiple_containers",
40
117
  "props": {
41
- "dropZone": "line",
42
- "dropZoneColor": "neutral"
118
+ "enableCrossContainerPreview": true,
119
+ "dropZone": {
120
+ "type": "outline",
121
+ "color": "primary",
122
+ "direction": "vertical"
123
+ }
124
+ }
125
+ },
126
+ {
127
+ "name": "Event Listeners",
128
+ "structureMode": "single_container",
129
+ "props": {
130
+ "onDragEnd": "() => console.log('drag end')",
131
+ "onDragStart": "() => console.log('drag start')",
132
+ "onDrop": "() => console.log('drop')",
133
+ "dropZone": {
134
+ "type": "ghost",
135
+ "color": "neutral",
136
+ "direction": "vertical"
137
+ }
43
138
  }
44
139
  }
45
140
  ],
46
141
  "conditionals": {},
47
142
  "hints": {
48
- "children_note": {
49
- "when": {},
50
- "message": "Compose Draggable.Container and Draggable.Item as children to build a sortable list.",
143
+ "single_list": {
144
+ "presetName": "Single List",
145
+ "message": "Single List wraps Draggable.Container and Draggable.Item children in DraggableProvider with initialItems and onReorder.",
146
+ "type": "info"
147
+ },
148
+ "outline_drop_zone": {
149
+ "presetName": "Outline Drop Zone",
150
+ "message": "Outline Drop Zone passes a dropZone object to DraggableProvider so the dragged item uses the outline treatment.",
151
+ "type": "info"
152
+ },
153
+ "shadow_drop_zone": {
154
+ "presetName": "Shadow Drop Zone",
155
+ "message": "Shadow Drop Zone uses the provider dropZone color and type to preview the shadow treatment while dragging.",
51
156
  "type": "info"
157
+ },
158
+ "line_vertical": {
159
+ "presetName": "Line Vertical",
160
+ "message": "Line Vertical uses dropZone.direction=\"vertical\" for between-row placement.",
161
+ "type": "info"
162
+ },
163
+ "line_horizontal": {
164
+ "presetName": "Line Horizontal",
165
+ "message": "Line Horizontal uses dropZone.direction=\"horizontal\" for between-column placement.",
166
+ "type": "info"
167
+ },
168
+ "multiple_containers": {
169
+ "presetName": "Multiple Containers",
170
+ "message": "Multiple Containers maps items into Draggable.Container columns by their container value.",
171
+ "type": "info"
172
+ },
173
+ "cross_container_preview": {
174
+ "presetName": "Cross Container Preview",
175
+ "message": "Cross Container Preview enables provider-managed movement previews between containers before drop.",
176
+ "type": "info"
177
+ },
178
+ "event_listeners": {
179
+ "presetName": "Event Listeners",
180
+ "message": "Event Listeners routes item callbacks through Draggable.Item props so drag events can be handled by app code.",
181
+ "type": "info"
182
+ }
183
+ },
184
+ "structureModes": {
185
+ "default": "single_container",
186
+ "modes": {
187
+ "single_container": {
188
+ "label": "Single Container",
189
+ "template": "<DraggableProvider\n initialItems={initialItems}\n onReorder={setItems}{{Provider.props}}\n>\n <Draggable{{props}}>\n <Draggable.Container\n container=\"tasks\"{{Container.props}}\n >\n <Flex\n gap=\"xs\"\n orientation=\"column\"\n >\n {items.map(({ id, text }) => (\n <Draggable.Item\n container=\"tasks\"\n dragId={id}\n key={id}{{Item.props}}\n >\n <Card padding=\"xs\">\n <Body text={text} />\n </Card>\n </Draggable.Item>\n ))}\n </Flex>\n </Draggable.Container>\n </Draggable>\n</DraggableProvider>",
190
+ "children": "",
191
+ "props": {
192
+ "dropZone": {
193
+ "type": "ghost",
194
+ "color": "neutral",
195
+ "direction": "vertical"
196
+ }
197
+ },
198
+ "wrapper": "const initialItems = [\n { id: 'task-1', container: 'tasks', text: 'Confirm scope' },\n { id: 'task-2', container: 'tasks', text: 'Design states' },\n { id: 'task-3', container: 'tasks', text: 'Ship playground' },\n]\n\nconst DraggablePlaygroundExample = () => {\n const [items, setItems] = useState(initialItems)\n\n return {{component}}\n}\n\n<DraggablePlaygroundExample />"
199
+ },
200
+ "single_container_horizontal": {
201
+ "label": "Single Container Horizontal",
202
+ "template": "<Flex>\n <DraggableProvider\n initialItems={initialItems}\n onReorder={setItems}{{Provider.props}}\n >\n <Draggable.Container{{Container.props}}>\n <Flex\n alignItems=\"stretch\"\n flexDirection=\"row\"\n height=\"110px\"\n >\n {items.map(({ id, url }) => (\n <Draggable.Item\n dragId={id}\n key={id}\n marginRight=\"sm\"{{Item.props}}\n >\n <Image\n alt={id}\n size=\"md\"\n url={url}\n />\n </Draggable.Item>\n ))}\n </Flex>\n </Draggable.Container>\n </DraggableProvider>\n</Flex>",
203
+ "children": "",
204
+ "props": {
205
+ "dropZone": {
206
+ "type": "line",
207
+ "color": "primary",
208
+ "direction": "horizontal"
209
+ },
210
+ "htmlOptions": {
211
+ "style": {
212
+ "width": "420px"
213
+ }
214
+ }
215
+ },
216
+ "wrapper": "const initialItems = [\n { id: 'image-1', url: 'https://unsplash.it/500/400/?image=633' },\n { id: 'image-2', url: 'https://unsplash.it/500/400/?image=634' },\n { id: 'image-3', url: 'https://unsplash.it/500/400/?image=637' },\n]\n\nconst DraggablePlaygroundExample = () => {\n const [items, setItems] = useState(initialItems)\n\n return {{component}}\n}\n\n<DraggablePlaygroundExample />"
217
+ },
218
+ "multiple_containers": {
219
+ "label": "Multiple Containers",
220
+ "template": "<DraggableProvider\n initialItems={initialItems}\n onReorder={setItems}{{Provider.props}}\n>\n <Draggable{{props}}>\n <Flex\n align=\"start\"\n gap=\"sm\"\n wrap\n >\n {containers.map((container) => (\n <Draggable.Container\n container={container}\n key={container}\n minWidth=\"220px\"{{Container.props}}\n >\n <Card padding=\"sm\">\n <Title\n marginBottom=\"xs\"\n size={4}\n text={container}\n />\n <Flex\n gap=\"xs\"\n orientation=\"column\"\n >\n {items\n .filter((item) => item.container === container)\n .map(({ id, text }) => (\n <Draggable.Item\n container={container}\n dragId={id}\n key={id}{{Item.props}}\n >\n <Card padding=\"xs\">\n <Body text={text} />\n </Card>\n </Draggable.Item>\n ))}\n </Flex>\n </Card>\n </Draggable.Container>\n ))}\n </Flex>\n </Draggable>\n</DraggableProvider>",
221
+ "children": "",
222
+ "props": {
223
+ "dropZone": {
224
+ "type": "ghost",
225
+ "color": "neutral",
226
+ "direction": "vertical"
227
+ }
228
+ },
229
+ "wrapper": "const containers = ['To Do', 'In Progress', 'Done']\nconst initialItems = [\n { id: 'task-1', container: 'To Do', text: 'Confirm scope' },\n { id: 'task-2', container: 'To Do', text: 'Design states' },\n { id: 'task-3', container: 'In Progress', text: 'Ship playground' },\n { id: 'task-4', container: 'Done', text: 'Write docs' },\n]\n\nconst DraggablePlaygroundExample = () => {\n const [items, setItems] = useState(initialItems)\n\n return {{component}}\n}\n\n<DraggablePlaygroundExample />"
230
+ }
231
+ }
232
+ },
233
+ "children": {
234
+ "editable": false,
235
+ "default": ""
236
+ },
237
+ "customProps": {
238
+ "dropZone": {
239
+ "type": "object",
240
+ "platforms": [
241
+ "react"
242
+ ]
243
+ },
244
+ "providerId": {
245
+ "type": "string",
246
+ "platforms": [
247
+ "react"
248
+ ]
249
+ },
250
+ "enableCrossContainerPreview": {
251
+ "type": "boolean",
252
+ "platforms": [
253
+ "react"
254
+ ],
255
+ "default": false
256
+ },
257
+ "tag": {
258
+ "type": "enum",
259
+ "platforms": [
260
+ "react"
261
+ ],
262
+ "values": [
263
+ "div",
264
+ "span",
265
+ "p",
266
+ "tr",
267
+ "td",
268
+ "tbody"
269
+ ]
270
+ },
271
+ "onDragStart": {
272
+ "type": "function",
273
+ "platforms": [
274
+ "react"
275
+ ]
276
+ },
277
+ "onDragEnd": {
278
+ "type": "function",
279
+ "platforms": [
280
+ "react"
281
+ ]
282
+ },
283
+ "onDrop": {
284
+ "type": "function",
285
+ "platforms": [
286
+ "react"
287
+ ]
288
+ }
289
+ },
290
+ "propSyncOnEnable": {
291
+ "enableCrossContainerPreview": {
292
+ "structureMode": "multiple_containers"
52
293
  }
53
294
  }
54
295
  }