playbook_ui 14.11.1.pre.alpha.PBNTR440enableglobalpropspbformwith5624 → 14.11.1.pre.alpha.PBNTR573datepickerinvestigation5355

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +2 -18
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +5 -27
  5. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +2 -17
  6. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +1 -23
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -29
  8. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +4 -61
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -1
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -5
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -6
  14. data/app/pb_kits/playbook/pb_button/button.html.erb +3 -2
  15. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +6 -1
  16. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -3
  17. data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +0 -3
  18. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +26 -23
  19. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -2
  20. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb +12 -1
  21. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
  22. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -1
  23. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +9 -3
  24. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -1
  25. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +183 -145
  26. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +268 -158
  27. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +45 -3
  28. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +1 -0
  29. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +16 -9
  30. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +19 -44
  31. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +3 -21
  32. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +21 -16
  33. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +19 -2
  34. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -2
  35. data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -1
  36. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +5 -5
  37. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  38. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +12 -7
  39. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +14 -9
  40. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +11 -6
  41. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +14 -8
  42. data/app/pb_kits/playbook/pb_list/item.html.erb +8 -30
  43. data/app/pb_kits/playbook/pb_list/item.rb +0 -7
  44. data/app/pb_kits/playbook/pb_list/list.html.erb +11 -31
  45. data/app/pb_kits/playbook/pb_list/list.rb +0 -4
  46. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -6
  47. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +0 -4
  48. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +0 -1
  49. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -1
  50. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +12 -30
  51. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +1 -3
  52. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
  53. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
  54. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +1 -20
  55. data/app/pb_kits/playbook/pb_radio/_radio.scss +8 -12
  56. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +3 -8
  57. data/app/pb_kits/playbook/pb_select/_select.scss +5 -3
  58. data/app/pb_kits/playbook/pb_select/_select.tsx +1 -5
  59. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  60. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -9
  61. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +1 -4
  62. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +1 -4
  63. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +3 -17
  64. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +0 -3
  65. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +4 -11
  66. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +0 -3
  67. data/app/pb_kits/playbook/pb_table/_table.tsx +3 -2
  68. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
  69. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -3
  70. data/app/pb_kits/playbook/pb_table/index.ts +88 -187
  71. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -12
  72. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +5 -6
  73. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  74. data/app/pb_kits/playbook/pb_table/table.rb +2 -17
  75. data/app/pb_kits/playbook/pb_table/table_row.html.erb +1 -20
  76. data/app/pb_kits/playbook/pb_table/table_row.rb +0 -5
  77. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -2
  78. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +0 -4
  79. data/app/pb_kits/playbook/pb_text_input/text_input.rb +3 -33
  80. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +30 -30
  81. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  82. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
  83. data/dist/chunks/_typeahead-BNULwihE.js +36 -0
  84. data/dist/chunks/_weekday_stacked-BKWemDAe.js +45 -0
  85. data/dist/chunks/{lib-kMuhBuU7.js → lib-B7sgJtGS.js} +2 -2
  86. data/dist/chunks/{pb_form_validation-DBJ0wZuS.js → pb_form_validation-C5Cc0-1v.js} +1 -1
  87. data/dist/chunks/vendor.js +1 -1
  88. data/dist/menu.yml +0 -6
  89. data/dist/playbook-doc.js +1 -1
  90. data/dist/playbook-rails-react-bindings.js +1 -1
  91. data/dist/playbook-rails.js +1 -1
  92. data/dist/playbook.css +1 -1
  93. data/lib/playbook/pb_forms_helper.rb +4 -13
  94. data/lib/playbook/version.rb +1 -1
  95. metadata +7 -63
  96. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +0 -50
  97. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +0 -60
  98. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +0 -5
  99. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +0 -78
  100. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +0 -1
  101. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +0 -53
  102. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +0 -1
  103. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +0 -52
  104. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +0 -1
  105. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +0 -42
  106. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +0 -299
  107. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +0 -13
  108. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +0 -3
  109. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +0 -5
  110. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +0 -38
  111. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +0 -3
  112. data/app/pb_kits/playbook/pb_drawer/context.ts +0 -11
  113. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +0 -38
  114. data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +0 -60
  115. data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +0 -21
  116. data/app/pb_kits/playbook/pb_icon_button/_icon_button.scss +0 -78
  117. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +0 -3
  118. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -7
  119. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +0 -16
  120. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +0 -22
  121. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +0 -15
  122. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +0 -24
  123. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +0 -1
  124. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +0 -74
  125. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +0 -3
  126. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +0 -74
  127. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +0 -3
  128. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +0 -47
  129. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +0 -2
  130. data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +0 -22
  131. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +0 -46
  132. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +0 -3
  133. data/app/pb_kits/playbook/pb_text_input/index.js +0 -103
  134. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +0 -19
  135. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +0 -27
  136. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +0 -1
  137. data/dist/chunks/_typeahead-BWwaAo_0.js +0 -36
  138. data/dist/chunks/_weekday_stacked-zyBCd1s8.js +0 -45
  139. data/lib/playbook/pb_forms_global_props_helper.rb +0 -136
  140. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_react.md → _table_with_collapsible.md} +0 -0
@@ -1,299 +0,0 @@
1
- [
2
- {
3
- "year": "2021",
4
- "id": "1",
5
- "quarter": null,
6
- "month": null,
7
- "day": null,
8
- "newEnrollments": "20",
9
- "scheduledMeetings": "10",
10
- "attendanceRate": "51%",
11
- "completedClasses": "3",
12
- "classCompletionRate": "33%",
13
- "graduatedStudents": "19",
14
- "children": [
15
- {
16
- "year": "2021",
17
- "id": "2",
18
- "quarter": "Q1",
19
- "month": null,
20
- "day": null,
21
- "newEnrollments": "2",
22
- "scheduledMeetings": "35",
23
- "attendanceRate": "32%",
24
- "completedClasses": "15",
25
- "classCompletionRate": "52%",
26
- "graduatedStudents": "36",
27
- "children": [
28
- {
29
- "year": "2021",
30
- "id": "3",
31
- "quarter": "Q1",
32
- "month": "January",
33
- "day": null,
34
- "newEnrollments": "16",
35
- "scheduledMeetings": "20",
36
- "attendanceRate": "11%",
37
- "completedClasses": "13",
38
- "classCompletionRate": "47%",
39
- "graduatedStudents": "28",
40
- "children": [
41
- {
42
- "year": "2021",
43
- "id": "4",
44
- "quarter": "Q1",
45
- "month": "January",
46
- "day": "10",
47
- "newEnrollments": "34",
48
- "scheduledMeetings": "28",
49
- "attendanceRate": "97%",
50
- "completedClasses": "20",
51
- "classCompletionRate": "15%",
52
- "graduatedStudents": "17"
53
- },
54
- {
55
- "year": "2021",
56
- "id": "5",
57
- "quarter": "Q1",
58
- "month": "January",
59
- "day": "20",
60
- "newEnrollments": "43",
61
- "scheduledMeetings": "23",
62
- "attendanceRate": "66%",
63
- "completedClasses": "26",
64
- "classCompletionRate": "47%",
65
- "graduatedStudents": "9"
66
- }
67
- ]
68
- },
69
- {
70
- "year": "2021",
71
- "id": "6",
72
- "quarter": "Q1",
73
- "month": "February",
74
- "day": null,
75
- "newEnrollments": "20",
76
- "scheduledMeetings": "41",
77
- "attendanceRate": "95%",
78
- "completedClasses": "26",
79
- "classCompletionRate": "83%",
80
- "graduatedStudents": "43",
81
- "children": [
82
- {
83
- "year": "2021",
84
- "id": "7",
85
- "quarter": "Q1",
86
- "month": "February",
87
- "day": "15",
88
- "newEnrollments": "19",
89
- "scheduledMeetings": "35",
90
- "attendanceRate": "69%",
91
- "completedClasses": "8",
92
- "classCompletionRate": "75%",
93
- "graduatedStudents": "23"
94
- }
95
- ]
96
- }
97
- ]
98
- }
99
- ]
100
- },
101
- {
102
- "year": "2022",
103
- "id": "8",
104
- "quarter": null,
105
- "month": null,
106
- "day": null,
107
- "newEnrollments": "25",
108
- "scheduledMeetings": "17",
109
- "attendanceRate": "75%",
110
- "completedClasses": "5",
111
- "classCompletionRate": "45%",
112
- "graduatedStudents": "32",
113
- "children": [
114
- {
115
- "year": "2022",
116
- "id": "9",
117
- "quarter": "Q1",
118
- "month": null,
119
- "day": null,
120
- "newEnrollments": "2",
121
- "scheduledMeetings": "35",
122
- "attendanceRate": "32%",
123
- "completedClasses": "15",
124
- "classCompletionRate": "52%",
125
- "graduatedStudents": "36",
126
- "children": [
127
- {
128
- "year": "2022",
129
- "id": "10",
130
- "quarter": "Q1",
131
- "month": "January",
132
- "day": null,
133
- "newEnrollments": "16",
134
- "scheduledMeetings": "20",
135
- "attendanceRate": "11%",
136
- "completedClasses": "13",
137
- "classCompletionRate": "47%",
138
- "graduatedStudents": "28",
139
- "children": [
140
- {
141
- "year": "2022",
142
- "id": "11",
143
- "quarter": "Q1",
144
- "month": "January",
145
- "day": "15",
146
- "newEnrollments": "34",
147
- "scheduledMeetings": "28",
148
- "attendanceRate": "97%",
149
- "completedClasses": "20",
150
- "classCompletionRate": "15%",
151
- "graduatedStudents": "17"
152
- },
153
- {
154
- "year": "2022",
155
- "id": "12",
156
- "quarter": "Q1",
157
- "month": "January",
158
- "day": "25",
159
- "newEnrollments": "43",
160
- "scheduledMeetings": "23",
161
- "attendanceRate": "66%",
162
- "completedClasses": "26",
163
- "classCompletionRate": "47%",
164
- "graduatedStudents": "9"
165
- }
166
- ]
167
- },
168
- {
169
- "year": "2022",
170
- "id": "13",
171
- "quarter": "Q1",
172
- "month": "May",
173
- "day": null,
174
- "newEnrollments": "20",
175
- "scheduledMeetings": "41",
176
- "attendanceRate": "95%",
177
- "completedClasses": "26",
178
- "classCompletionRate": "83%",
179
- "graduatedStudents": "43",
180
- "children": [
181
- {
182
- "year": "2022",
183
- "id": "14",
184
- "quarter": "Q1",
185
- "month": "May",
186
- "day": "2",
187
- "newEnrollments": "19",
188
- "scheduledMeetings": "35",
189
- "attendanceRate": "69%",
190
- "completedClasses": "8",
191
- "classCompletionRate": "75%",
192
- "graduatedStudents": "23"
193
- }
194
- ]
195
- }
196
- ]
197
- }
198
- ]
199
- },
200
- {
201
- "year": "2023",
202
- "id": "15",
203
- "quarter": null,
204
- "month": null,
205
- "day": null,
206
- "newEnrollments": "10",
207
- "scheduledMeetings": "15",
208
- "attendanceRate": "65%",
209
- "completedClasses": "4",
210
- "classCompletionRate": "49%",
211
- "graduatedStudents": "29",
212
- "children": [
213
- {
214
- "year": "2023",
215
- "id": "16",
216
- "quarter": "Q1",
217
- "month": null,
218
- "day": null,
219
- "newEnrollments": "2",
220
- "scheduledMeetings": "35",
221
- "attendanceRate": "32%",
222
- "completedClasses": "15",
223
- "classCompletionRate": "52%",
224
- "graduatedStudents": "36",
225
- "children": [
226
- {
227
- "year": "2023",
228
- "id": "17",
229
- "quarter": "Q1",
230
- "month": "March",
231
- "day": null,
232
- "newEnrollments": "16",
233
- "scheduledMeetings": "20",
234
- "attendanceRate": "11%",
235
- "completedClasses": "13",
236
- "classCompletionRate": "47%",
237
- "graduatedStudents": "28",
238
- "children": [
239
- {
240
- "year": "2023",
241
- "id": "18",
242
- "quarter": "Q1",
243
- "month": "March",
244
- "day": "10",
245
- "newEnrollments": "34",
246
- "scheduledMeetings": "28",
247
- "attendanceRate": "97%",
248
- "completedClasses": "20",
249
- "classCompletionRate": "15%",
250
- "graduatedStudents": "17"
251
- },
252
- {
253
- "year": "2023",
254
- "id": "19",
255
- "quarter": "Q1",
256
- "month": "March",
257
- "day": "11",
258
- "newEnrollments": "43",
259
- "scheduledMeetings": "23",
260
- "attendanceRate": "66%",
261
- "completedClasses": "26",
262
- "classCompletionRate": "47%",
263
- "graduatedStudents": "9"
264
- }
265
- ]
266
- },
267
- {
268
- "year": "2023",
269
- "id": "20",
270
- "quarter": "Q1",
271
- "month": "April",
272
- "day": null,
273
- "newEnrollments": "20",
274
- "scheduledMeetings": "41",
275
- "attendanceRate": "95%",
276
- "completedClasses": "26",
277
- "classCompletionRate": "83%",
278
- "graduatedStudents": "43",
279
- "children": [
280
- {
281
- "year": "2023",
282
- "id": "21",
283
- "quarter": "Q1",
284
- "month": "April",
285
- "day": "15",
286
- "newEnrollments": "19",
287
- "scheduledMeetings": "35",
288
- "attendanceRate": "69%",
289
- "completedClasses": "8",
290
- "classCompletionRate": "75%",
291
- "graduatedStudents": "23"
292
- }
293
- ]
294
- }
295
- ]
296
- }
297
- ]
298
- }
299
- ]
@@ -1,13 +0,0 @@
1
- <%= pb_rails("date_picker", props: { picker_id: "date-picker-turbo-frames", custom_event_type: "datePickerLoader" }) %>
2
- <%= pb_rails("button", props: { id: "date-picker-loader", text: "Click Event Simulation" }) %>
3
-
4
- <script>
5
- document.getElementById("date-picker-loader").addEventListener("click", () => {
6
- window.document.dispatchEvent(
7
- new CustomEvent("datePickerLoader", {
8
- bubbles: true,
9
- })
10
- )
11
- console.log("Event 'datePickerLoader' dispatched - in a real implementation, this event would trigger the date picker's reinitialization through the custom_event_type prop connection")
12
- })
13
- </script>
@@ -1,3 +0,0 @@
1
- The `custom_event_type` prop allows you to specify a custom event that will trigger the date picker's initialization, in addition to the default initialization on `DOMContentLoaded`. This is particularly useful in dynamic contexts like Turbo Frame updates where you need to reinitialize the date picker after new content loads. For Turbo integration, use `custom_event_type: "turbo:before-render"` to ensure the date picker properly reinitializes after Turbo navigation events.
2
-
3
- In this example, we demonstrate the setup pattern by connecting a button to dispatch a "datePickerLoader" event - while the date picker's event listener is properly configured through the `custom_event_type` prop, this demo only logs the event dispatch to the console to illustrate the connection structure.
@@ -1,5 +0,0 @@
1
- For a simplified version of the Draggable API for the List kit, you can do the following:
2
-
3
- The List kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on List kit with an array of the included items AND `drag_id` prop on ListItems. You will also need to include the `items` prop containing your array of listed items for the Draggable API.
4
-
5
- An additional optional boolean prop (set to true by default) of `drag_handle` is also available on ListItem kit to show the drag handle icon.
@@ -1,38 +0,0 @@
1
- <%= pb_rails("selectable_list",
2
- props: {
3
- enable_drag: true,
4
- variant: "radio",
5
- items: [
6
- { drag_id: "41",
7
- text: "Task 1",
8
- input_options: {
9
- value: "1",
10
- name: "radio-name",
11
- }
12
- },
13
- { drag_id: "42",
14
- text: "Task 2",
15
- checked: true,
16
- input_options: {
17
- value: "2",
18
- name: "radio-name",
19
- }
20
- },
21
- { drag_id: "43",
22
- text: "Task 3",
23
- input_options: {
24
- value: "3",
25
- name: "radio-name",
26
- }
27
- },
28
- { drag_id: "44",
29
- text: "Task 4",
30
- input_options: {
31
- value: "4",
32
- name: "radio-name",
33
- }
34
- }
35
- ]
36
- }
37
- )
38
- %>
@@ -1,3 +0,0 @@
1
- For a simplified version of the Draggable API for the SelectableList kit, you can do the following:
2
-
3
- The SelectableList kit is optimized to work with the draggable kit. To enable drag, use the `enable_drag` prop on SelectableList kit AND `drag_id` prop within the SelectableList kit prop. An additional optional boolean prop (set to true by default) of `drag_handle` is also available on SelectableList kit to show the drag handle icon.
@@ -1,11 +0,0 @@
1
- import React from 'react'
2
-
3
- const noop = (): void => void 0
4
-
5
- type DrawerContextType = {
6
- onClose: () => void
7
- }
8
-
9
- export const DrawerContext = React.createContext<DrawerContextType>({
10
- onClose: noop,
11
- })
@@ -1,38 +0,0 @@
1
- import React, { useState } from "react"
2
- import { Button, Drawer, Flex } from "playbook-ui"
3
-
4
- const useDrawer = (visible = false) => {
5
- const [opened, setOpened] = useState(visible)
6
- const toggle = () => setOpened(!opened)
7
-
8
- return [opened, toggle]
9
- }
10
-
11
- const DrawerBehavior = () => {
12
- const [drawerOpen, toggleDrawerOpen] = useDrawer()
13
-
14
- return (
15
- <>
16
- <Flex wrap>
17
- <Button id='sm'
18
- marginRight='md'
19
- onClick={toggleDrawerOpen}
20
- >
21
- {"Push Behavior"}
22
- </Button>
23
- </Flex>
24
- <Flex>
25
- <Drawer
26
- behavior={"push"}
27
- onClose={toggleDrawerOpen}
28
- opened={drawerOpen}
29
- size={"lg"}
30
- >
31
- Test me (Push Behavior)
32
- </Drawer>
33
- </Flex>
34
- </>
35
- )
36
- }
37
-
38
- export default DrawerBehavior
@@ -1,60 +0,0 @@
1
- import { useState, useEffect } from 'react'
2
-
3
- export const breakpointValues = {
4
- none: 0,
5
- xs: 575,
6
- sm: 768,
7
- md: 992,
8
- lg: 1200,
9
- xl: 1400,
10
- } as const
11
-
12
- type BreakpointSize = keyof typeof breakpointValues
13
-
14
- interface UseBreakpointProps {
15
- breakpoint?: BreakpointSize
16
- triggerId?: string
17
- }
18
-
19
- export const useBreakpoint = ({
20
- breakpoint = 'none',
21
- triggerId
22
- }: UseBreakpointProps) => {
23
- const [isOpenBreakpointOpen, setIsOpenBreakpointOpen] = useState(false)
24
- const [isUserClosed, setIsUserClosed] = useState(false)
25
-
26
- useEffect(() => {
27
- if (breakpoint === 'none') return
28
-
29
- const handleResize = () => {
30
- const width = window.innerWidth
31
-
32
- const openBreakpointWidth = breakpointValues[breakpoint]
33
- if (width >= openBreakpointWidth) {
34
- setIsOpenBreakpointOpen(true)
35
- } else {
36
- setIsOpenBreakpointOpen(false)
37
- setIsUserClosed(false)
38
- }
39
-
40
- // Handle menu button visibility
41
- if (triggerId) {
42
- const menuButton = document.getElementById(triggerId)
43
- if (menuButton) {
44
- menuButton.style.display = isOpenBreakpointOpen ? 'none' : ''
45
- }
46
- }
47
- }
48
-
49
- window.addEventListener('resize', handleResize)
50
- handleResize()
51
-
52
- return () => window.removeEventListener('resize', handleResize)
53
- }, [breakpoint, triggerId, isOpenBreakpointOpen])
54
-
55
- return {
56
- isOpenBreakpointOpen,
57
- isUserClosed,
58
- setIsUserClosed
59
- }
60
- }
@@ -1,21 +0,0 @@
1
- import { useState, useEffect } from 'react'
2
-
3
- export const useDrawerAnimation = (isOpen: boolean) => {
4
- const [animationState, setAnimationState] = useState('')
5
-
6
- useEffect(() => {
7
- if (isOpen) {
8
- setAnimationState('afterOpen')
9
- } else if (!isOpen && animationState === 'afterOpen') {
10
- setAnimationState('beforeClose')
11
- setTimeout(() => {
12
- setAnimationState('')
13
- }, 200)
14
- }
15
- }, [isOpen])
16
-
17
- return {
18
- animationState,
19
- isVisible: isOpen || animationState === 'beforeClose'
20
- }
21
- }
@@ -1,78 +0,0 @@
1
- $icon_colors: (
2
- default: $text_lt_default,
3
- link: $primary_action
4
- );
5
-
6
- @mixin icon_button_variant($variant) {
7
- .icon_button_icon {
8
- color: map-get($icon_colors, $variant);
9
- }
10
- }
11
-
12
- .pb_icon_button_kit_default,
13
- .pb_icon_button_kit_link {
14
- width: fit-content;
15
- height: fit-content;
16
-
17
- &:hover {
18
- [class*="pb_button_kit"] {
19
- background-color: $bg_light;
20
- }
21
- .icon_button_icon {
22
- color: $primary_action;
23
- }
24
- }
25
-
26
- &:active {
27
- [class*="pb_button_kit"] {
28
- background-color: $bg_light;
29
- }
30
- .icon_button_icon {
31
- color: $primary_action;
32
- }
33
- }
34
-
35
- &:hover:active {
36
- [class*="pb_button_kit"] {
37
- background-color: $bg_light;
38
- }
39
- .icon_button_icon {
40
- color: $text_lt_default;
41
- }
42
- }
43
-
44
- &:focus {
45
- outline: 2px solid $primary_action;
46
- border-radius: 8px;
47
- }
48
-
49
- [class*="pb_button_kit"] {
50
- min-height: 0;
51
- background: none;
52
- position: relative;
53
- display: flex;
54
- justify-content: center;
55
- align-items: center;
56
- flex-shrink: 0;
57
- flex-grow: 0;
58
- width: fit-content;
59
- height: fit-content;
60
- line-height: normal;
61
- flex-basis: auto;
62
- min-width: 0;
63
- padding: 0;
64
-
65
- .icon_button_icon {
66
- display: block;
67
- vertical-align: middle;
68
- }
69
- }
70
- }
71
-
72
- .pb_icon_button_kit_default {
73
- @include icon_button_variant(default);
74
- }
75
-
76
- .pb_icon_button_kit_link {
77
- @include icon_button_variant(link);
78
- }
@@ -1,3 +0,0 @@
1
- <%= pb_rails("icon_button") %>
2
- </br>
3
- <%= pb_rails("icon_button", props: {variant: "link"}) %>
@@ -1,7 +0,0 @@
1
- examples:
2
-
3
- rails:
4
- - icon_button_default: Default
5
-
6
-
7
-
@@ -1,16 +0,0 @@
1
- <%= pb_content_tag do %>
2
- <%= pb_rails("button", props: { type: object.type,
3
- link: object.link,
4
- new_window:object.new_window,
5
- target: object.target,
6
- dark: object.dark,
7
- border_radius: "lg" }) do %>
8
- <%= pb_rails("icon", props: { icon: object.icon,
9
- fixed_width: true,
10
- dark: object.dark,
11
- size: "2x",
12
- color: "text_lt_default",
13
- classname: "icon_button_icon",
14
- padding_x: "xxs", padding_y: "xs" }) %>
15
- <% end %>
16
- <% end %>
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Playbook
4
- module PbIconButton
5
- class IconButton < ::Playbook::KitBase
6
- prop :type, type: Playbook::Props::Enum,
7
- values: %w[button submit reset],
8
- default: "button"
9
- prop :icon, required: false, default: "bars"
10
- prop :link
11
- prop :new_window, type: Playbook::Props::Boolean,
12
- default: false
13
- prop :target
14
- prop :variant, type: Playbook::Props::Enum,
15
- values: %w[default link],
16
- default: "default"
17
- def classname
18
- generate_classname("pb_icon_button_kit", variant)
19
- end
20
- end
21
- end
22
- end
@@ -1,15 +0,0 @@
1
- <%= pb_rails("phone_number_input", props: {
2
- id: "phone_number_input",
3
- format_as_you_type: true
4
- }) %>
5
-
6
- <%= pb_rails("button", props: {id: "clickable", text: "Save Phone Number"}) %>
7
-
8
- <%= javascript_tag do %>
9
- document.querySelector('#clickable').addEventListener('click', () => {
10
- const formattedPhoneNumber = document.querySelector('#phone_number_input').value
11
- const unformattedPhoneNumber = formattedPhoneNumber.replace(/\D/g, "")
12
-
13
- alert(`Formatted: ${formattedPhoneNumber}. Unformatted: ${unformattedPhoneNumber}`)
14
- })
15
- <% end %>
@@ -1,24 +0,0 @@
1
- import React, { useState } from "react";
2
- import { PhoneNumberInput, Body } from "playbook-ui";
3
-
4
- const PhoneNumberInputFormat = (props) => {
5
- const [phoneNumber, setPhoneNumber] = useState("");
6
-
7
- const handleOnChange = ({ number }) => {
8
- setPhoneNumber(number);
9
- };
10
-
11
- return (
12
- <>
13
- <PhoneNumberInput
14
- formatAsYouType
15
- id="format"
16
- onChange={handleOnChange}
17
- {...props}
18
- />
19
- {phoneNumber && <Body>Unformatted number: {phoneNumber}</Body>}
20
- </>
21
- );
22
- };
23
-
24
- export default PhoneNumberInputFormat;
@@ -1 +0,0 @@
1
- NOTE: the `number` in the React `onChange` event will not include formatting (no spaces, dashes, and parentheses). For Rails, the `value` will include formatting and its value must be sanitized manually.