playbook_ui 13.27.0 → 13.28.0.pre.alpha.PBNTR297gradientoverlay3029

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +3 -3
  3. data/app/pb_kits/playbook/index.js +3 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +3 -7
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +40 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +3 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +2 -6
  10. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +14 -4
  11. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +11 -7
  12. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -6
  13. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +34 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +31 -0
  16. data/app/pb_kits/playbook/pb_avatar/Utilities/GetPlacementPropsHelper.tsx +16 -0
  17. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +16 -0
  18. data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -1
  19. data/app/pb_kits/playbook/pb_avatar/avatar.rb +4 -0
  20. data/app/pb_kits/playbook/pb_avatar/avatar.test.js +47 -0
  21. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.html.erb +46 -66
  22. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +8 -29
  23. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.md +3 -0
  24. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.html.erb +13 -33
  25. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +48 -67
  26. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.md +3 -0
  27. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +0 -20
  28. data/app/pb_kits/playbook/pb_avatar/docs/example.yml +2 -2
  29. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -6
  30. data/app/pb_kits/playbook/pb_badge/badge.html.erb +1 -6
  31. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +4 -1
  32. data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +31 -0
  33. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +16 -0
  34. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +2 -1
  35. data/app/pb_kits/playbook/pb_bar_graph/docs/{_bar_graph_custom.html.erb → _bar_graph_custom_rails.html.erb} +3 -3
  36. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +2 -0
  37. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -1
  38. data/app/pb_kits/playbook/pb_body/_body.scss +3 -0
  39. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +1 -1
  40. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +4 -3
  41. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +1 -6
  42. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -1
  43. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +7 -1
  44. data/app/pb_kits/playbook/pb_card/card.rb +1 -1
  45. data/app/pb_kits/playbook/pb_card/docs/_card_background.html.erb +20 -0
  46. data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +41 -1
  47. data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
  48. data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -1
  49. data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
  50. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
  51. data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -2
  52. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -3
  53. data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +45 -0
  54. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +22 -1
  55. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -6
  56. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +53 -0
  57. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +33 -16
  58. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +92 -0
  59. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +3 -75
  60. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -6
  61. data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +24 -0
  62. data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +1 -6
  63. data/app/pb_kits/playbook/pb_collapsible/collapsible_icon.html.erb +15 -0
  64. data/app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb +37 -0
  65. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -6
  66. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.jsx +72 -0
  67. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.md +3 -0
  68. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.html.erb +19 -0
  69. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.md +3 -0
  70. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.jsx +73 -0
  71. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.md +3 -0
  72. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.html.erb +20 -0
  73. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.md +3 -0
  74. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +7 -0
  75. data/app/pb_kits/playbook/pb_collapsible/docs/index.js +3 -1
  76. data/app/pb_kits/playbook/pb_collapsible/index.js +16 -6
  77. data/app/pb_kits/playbook/pb_contact/contact.html.erb +1 -6
  78. data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -6
  79. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +7 -1
  80. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +9 -1
  81. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +1 -6
  82. data/app/pb_kits/playbook/pb_date/date.html.erb +1 -6
  83. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +1 -5
  84. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default_swift.md +61 -0
  85. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_props_swift.md +11 -0
  86. data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +4 -1
  87. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +1 -5
  88. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +1 -5
  89. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_bold_swift.md +32 -0
  90. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default_swift.md +17 -0
  91. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year_swift.md +19 -0
  92. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_props_swift.md +10 -0
  93. data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_reversed_swift.md +17 -0
  94. data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +7 -0
  95. data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -6
  96. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_alignment_swift.md +39 -0
  97. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_default_swift.md +39 -0
  98. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_props_swift.md +15 -0
  99. data/app/pb_kits/playbook/pb_date_time/docs/_date_time_size_swift.md +78 -0
  100. data/app/pb_kits/playbook/pb_date_time/docs/example.yml +6 -0
  101. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +1 -6
  102. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +1 -5
  103. data/app/pb_kits/playbook/pb_detail/_detail_mixins.scss +1 -1
  104. data/app/pb_kits/playbook/pb_docs/kit_example.html.erb +3 -3
  105. data/app/pb_kits/playbook/pb_draggable/_draggable.scss +10 -0
  106. data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +53 -0
  107. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +92 -0
  108. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +53 -0
  109. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +159 -0
  110. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +121 -0
  111. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -0
  112. data/app/pb_kits/playbook/pb_draggable/docs/index.js +3 -0
  113. data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +65 -0
  114. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +54 -0
  115. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +57 -0
  116. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +6 -1
  117. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +5 -6
  118. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.html.erb +3 -3
  119. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +1 -1
  120. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md +5 -6
  121. data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_subcomponent_structure.html.erb → _dropdown_subcomponent_structure_rails.html.erb} +3 -3
  122. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.md +6 -0
  123. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -3
  124. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +3 -3
  125. data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_display.html.erb → _dropdown_with_custom_display_rails.html.erb} +11 -6
  126. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.md +5 -0
  127. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +5 -2
  128. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +1 -1
  129. data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_options.html.erb → _dropdown_with_custom_options_rails.html.erb} +16 -11
  130. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.md +1 -0
  131. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
  132. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +1 -1
  133. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +5 -2
  134. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md +1 -1
  135. data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_trigger.html.erb → _dropdown_with_custom_trigger_rails.html.erb} +16 -11
  136. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.md +1 -0
  137. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
  138. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +1 -1
  139. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -6
  140. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +1 -0
  141. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +1 -0
  142. data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -1
  143. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +3 -9
  144. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.rb +2 -6
  145. data/app/pb_kits/playbook/pb_dropdown/index.js +2 -1
  146. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +6 -14
  147. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children_swift.md +23 -0
  148. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close_swift.md +7 -0
  149. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default_swift.md +9 -0
  150. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dismiss_with_timer_swift.md +22 -0
  151. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_swift.md +9 -0
  152. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions_swift.md +62 -0
  153. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_props_swift.md +8 -0
  154. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +9 -0
  155. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +1 -6
  156. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +11 -1
  157. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
  158. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +17 -2
  159. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +4 -1
  160. data/app/pb_kits/playbook/pb_gauge/gauge.rb +6 -1
  161. data/app/pb_kits/playbook/pb_gauge/gauge.test.js +35 -0
  162. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +1 -6
  163. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +1 -6
  164. data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +1 -6
  165. data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +1 -6
  166. data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +1 -6
  167. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +8 -2
  168. data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +52 -0
  169. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +22 -1
  170. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -5
  171. data/app/pb_kits/playbook/pb_message/message_mention.html.erb +6 -6
  172. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +8 -0
  173. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -6
  174. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +1 -6
  175. data/app/pb_kits/playbook/pb_overlay/_overlay.scss +12 -0
  176. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +93 -0
  177. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +40 -0
  178. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -0
  179. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +36 -0
  180. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +5 -0
  181. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +4 -0
  182. data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
  183. data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +66 -0
  184. data/app/pb_kits/playbook/pb_pagination/_pagination.scss +1 -1
  185. data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +1 -6
  186. data/app/pb_kits/playbook/pb_person/person.html.erb +1 -6
  187. data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +1 -6
  188. data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
  189. data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -6
  190. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -6
  191. data/app/pb_kits/playbook/pb_select/_select.scss +8 -0
  192. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -0
  193. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +30 -32
  194. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +0 -2
  195. data/app/pb_kits/playbook/pb_source/source.html.erb +1 -5
  196. data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +1 -5
  197. data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +1 -5
  198. data/app/pb_kits/playbook/pb_table/_table.tsx +5 -0
  199. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +33 -32
  200. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
  201. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +2 -0
  202. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
  203. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
  204. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +34 -0
  205. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +2 -0
  206. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +51 -50
  207. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
  208. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +54 -0
  209. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +2 -0
  210. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +37 -38
  211. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +1 -0
  212. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +53 -0
  213. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +1 -0
  214. data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_row.html.erb → _table_outer_padding.html.erb} +7 -7
  215. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +76 -0
  216. data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +1 -0
  217. data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
  218. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
  219. data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -0
  220. data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +21 -0
  221. data/app/pb_kits/playbook/pb_table/table.rb +14 -1
  222. data/app/pb_kits/playbook/pb_table/table.test.js +5 -1
  223. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +19 -0
  224. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +1 -5
  225. data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +1 -5
  226. data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -5
  227. data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +1 -5
  228. data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +1 -6
  229. data/app/pb_kits/playbook/pb_title/_title.scss +5 -1
  230. data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +1 -6
  231. data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +1 -5
  232. data/app/pb_kits/playbook/pb_tooltip/index.js +1 -0
  233. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +12 -9
  234. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +61 -0
  235. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +6 -1
  236. data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +1 -6
  237. data/app/pb_kits/playbook/playbook-doc.js +4 -0
  238. data/app/pb_kits/playbook/tokens/_titles.scss +5 -1
  239. data/app/pb_kits/playbook/tokens/_vertical_align.scss +18 -0
  240. data/app/pb_kits/playbook/utilities/_vertical_align.scss +16 -0
  241. data/app/pb_kits/playbook/utilities/globalProps.ts +12 -1
  242. data/dist/menu.yml +9 -4
  243. data/dist/playbook-rails.js +6 -6
  244. data/lib/playbook/classnames.rb +1 -0
  245. data/lib/playbook/forms/builder/dropdown_field.rb +14 -0
  246. data/lib/playbook/forms/builder/phone_number_field.rb +12 -0
  247. data/lib/playbook/forms/builder.rb +2 -0
  248. data/lib/playbook/kit_base.rb +3 -1
  249. data/lib/playbook/version.rb +2 -2
  250. data/lib/playbook/vertical_align.rb +37 -0
  251. metadata +94 -14
  252. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +0 -63
  253. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +0 -52
  254. /data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_column.html.erb → _table_alignment_column_rails.html.erb} +0 -0
@@ -0,0 +1,9 @@
1
+ examples:
2
+
3
+
4
+ react:
5
+ - draggable_default: Default
6
+ - draggable_with_cards: Draggable with Cards
7
+ - draggable_multiple_containers: Dragging Across Multiple Containers
8
+
9
+
@@ -0,0 +1,3 @@
1
+ export { default as DraggableDefault } from './_draggable_default.jsx'
2
+ export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
3
+ export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
@@ -0,0 +1,65 @@
1
+ import React, {useState} from "react"
2
+ import { render, screen } from "../utilities/test-utils"
3
+
4
+ import { Draggable, DraggableProvider, SelectableList } from '../'
5
+
6
+ const testId = 'draggable'
7
+
8
+ const data = [
9
+ {
10
+ id: "1",
11
+ text: "Task 1",
12
+ },
13
+ {
14
+ id: "2",
15
+ text: "Task 2",
16
+ },
17
+ {
18
+ id: "3",
19
+ text: "Task 3",
20
+ },
21
+ {
22
+ id: "4",
23
+ text: "Task 4",
24
+ },
25
+ ];
26
+
27
+
28
+ const DefaultDraggableKit = () => {
29
+ const [initialState, setInitialState] = useState(data);
30
+
31
+ return (
32
+ <DraggableProvider
33
+ initialItems={data}
34
+ onChange={(items) => setInitialState(items)}
35
+ >
36
+ <Draggable
37
+ data={{ testid: testId }}
38
+ draggableItems={data}
39
+ onDragChange={(items) => setInitialItems(items)}
40
+ >
41
+ <Draggable.Container>
42
+ <SelectableList variant="checkbox">
43
+ {initialState.map(({ id, text }) => (
44
+ <Draggable.Item id={id}
45
+ key={id}
46
+ >
47
+ <SelectableList.Item label={text}
48
+ name={id}
49
+ value={id}
50
+ />
51
+ </Draggable.Item>
52
+ ))}
53
+ </SelectableList>
54
+ </Draggable.Container>
55
+ </Draggable>
56
+ </DraggableProvider>
57
+ );
58
+ };
59
+
60
+ test('generated default kit and classname', () => {
61
+ render(<DefaultDraggableKit/>)
62
+ const kit = screen.getByTestId(testId)
63
+ expect(kit).toBeInTheDocument()
64
+ expect(kit).toHaveClass('pb_draggable')
65
+ })
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+ import classnames from "classnames";
3
+ import {
4
+ buildAriaProps,
5
+ buildCss,
6
+ buildDataProps,
7
+ buildHtmlProps
8
+ } from "../../utilities/props";
9
+ import { globalProps } from "../../utilities/globalProps";
10
+ import { DraggableContext } from "../context";
11
+
12
+ type DraggableContainerProps = {
13
+ aria?: { [key: string]: string };
14
+ children?: React.ReactNode;
15
+ className?: string;
16
+ container?: any;
17
+ data?: { [key: string]: string };
18
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
+ id?: string;
20
+ };
21
+
22
+ const DraggableContainer = (props: DraggableContainerProps) => {
23
+ const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
24
+
25
+ const { handleDragOver, handleDrop, activeContainer } = DraggableContext();
26
+
27
+ const ariaProps = buildAriaProps(aria);
28
+ const dataProps = buildDataProps(data);
29
+ const htmlProps = buildHtmlProps(htmlOptions);
30
+
31
+ const classes = classnames(
32
+ buildCss("pb_draggable_container"),
33
+ `${activeContainer === container ? "active" : ""}`,
34
+ globalProps(props),
35
+ className
36
+ );
37
+
38
+ return (
39
+ <div
40
+ {...ariaProps}
41
+ {...dataProps}
42
+ {...htmlProps}
43
+ className={classes}
44
+ id={id}
45
+ key={container}
46
+ onDragOver={(e) => handleDragOver(e, container)}
47
+ onDrop={() => handleDrop(container)}
48
+ >
49
+ {children}
50
+ </div>
51
+ );
52
+ };
53
+
54
+ export default DraggableContainer;
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import classnames from "classnames";
3
+ import {
4
+ buildAriaProps,
5
+ buildCss,
6
+ buildDataProps,
7
+ buildHtmlProps
8
+ } from "../../utilities/props";
9
+ import { globalProps } from "../../utilities/globalProps";
10
+ import { DraggableContext } from "../context";
11
+
12
+ type DraggableItemProps = {
13
+ aria?: { [key: string]: string };
14
+ children?: React.ReactNode;
15
+ className?: string;
16
+ container?: any;
17
+ data?: { [key: string]: string };
18
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
+ id?: string;
20
+ };
21
+
22
+ const DraggableItem = (props: DraggableItemProps) => {
23
+ const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
24
+
25
+ const { isDragging, handleDragStart, handleDragEnter, handleDragEnd } =
26
+ DraggableContext();
27
+
28
+ const ariaProps = buildAriaProps(aria);
29
+ const dataProps = buildDataProps(data);
30
+ const htmlProps = buildHtmlProps(htmlOptions);
31
+
32
+ const classes = classnames(
33
+ buildCss("pb_draggable_item"),
34
+ `${isDragging === id ? "is_dragging" : ""}`,
35
+ globalProps(props),
36
+ className
37
+ );
38
+
39
+ return (
40
+ <div
41
+ {...ariaProps}
42
+ {...dataProps}
43
+ {...htmlProps}
44
+ className={classes}
45
+ draggable
46
+ id={id}
47
+ key={id}
48
+ onDragEnd={() => handleDragEnd()}
49
+ onDragEnter={() => handleDragEnter(id, container)}
50
+ onDragStart={() => handleDragStart(id, container)}
51
+ >
52
+ {children}
53
+ </div>
54
+ );
55
+ };
56
+
57
+ export default DraggableItem;
@@ -63,6 +63,10 @@
63
63
  width: 100%;
64
64
 
65
65
  [class*="pb_dropdown_option"] {
66
+ padding-left: $space_sm;
67
+ padding-right: $space_sm;
68
+ padding-top: $space_xs;
69
+ padding-bottom: $space_xs;
66
70
  cursor: pointer;
67
71
  &:hover {
68
72
  background-color: $border_light;
@@ -77,8 +81,9 @@
77
81
  }
78
82
  &[class*="selected"] {
79
83
  background-color: $primary;
84
+ color: $white;
80
85
  [class^="pb_body"],
81
- [class^="pb_title_kit"] {
86
+ [class^="pb_title_kit"], a {
82
87
  color: $white !important;
83
88
  }
84
89
  &:hover {
@@ -4,7 +4,6 @@ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../uti
4
4
  import { globalProps } from "../utilities/globalProps";
5
5
  import { GenericObject } from "../types";
6
6
 
7
- import Body from "../pb_body/_body";
8
7
  import Caption from "../pb_caption/_caption";
9
8
 
10
9
  import DropdownContainer from "./subcomponents/DropdownContainer";
@@ -114,8 +113,10 @@ const Dropdown = (props: DropdownProps) => {
114
113
  setIsDropDownClosed(isClosed)
115
114
  },[isClosed])
116
115
 
117
- const filteredOptions = options?.filter((option: GenericObject) =>
118
- option.label.toLowerCase().includes(filterItem.toLowerCase())
116
+ const filteredOptions = options?.filter((option: GenericObject) => {
117
+ const label = typeof option.label === 'string' ? option.label.toLowerCase() : option.label;
118
+ return String(label).toLowerCase().includes(filterItem.toLowerCase());
119
+ }
119
120
  );
120
121
 
121
122
  // For keyboard accessibility: Set focus within dropdown to selected item if it exists
@@ -233,9 +234,7 @@ const Dropdown = (props: DropdownProps) => {
233
234
  options?.map((option: GenericObject) => (
234
235
  <Dropdown.Option key={option.id}
235
236
  option={option}
236
- >
237
- <Body text={option.label} />
238
- </Dropdown.Option>
237
+ />
239
238
  ))}
240
239
  </DropdownContainer>
241
240
  </>
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -1 +1 @@
1
- The Dropdown kit accepts an `options` array and renders each object from that array as a selectable option within a dropdown container. `options` is a required prop and must be an array of objects. Each object can contain as many key/value pairs as needed but MUST contain 'label' and 'value' as the only required items within each object.
1
+ This kit's `options` prop requires an array of objects, each of which will be used as the selectable options within the dropdown. Each option object can support any number of key-value pairs, but each must contain `label` and `value`.
@@ -1,7 +1,6 @@
1
- The dropdown comes with the following subcomponents that can be used to achieve various levels of customization:
1
+ The dropdown is built using all of the following subcomponents:
2
2
 
3
- `Dropdown. Trigger` / `dropdown/dropdown_trigger`
4
- `Dropdown.Container`/ `dropdown/dropdown_container`
5
- `Dropdown.Option` / `dropdown/dropdown_option`
6
-
7
- See the code snippet below for a visual on how to use the kit with subcomponents. Each subcomponent allows for GlobalProps in addition to any subcomponent specfic props.
3
+ `Dropdown.Trigger` is the UI component that users interact with to toggle the dropdown.
4
+ `Dropdown.Container` is the floating container that wraps the list of dropdown options.
5
+ `Dropdown.Option` renders options that are passed to the container.
6
+ Each of these subcomponents can be altered using global props and/or their respective props. See doc examples below for more information on each.
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -0,0 +1,6 @@
1
+ The dropdown is built using all of the following required subcomponents:
2
+
3
+ `dropdown/dropdown_trigger` is the UI component that users interact with to toggle the dropdown.
4
+ `dropdown/dropdown_container` is the floating container that wraps the list of dropdown options.
5
+ `dropdown/dropdown_option` renders options that are passed to the container.
6
+ Each of these subcomponents can be altered using global props and/or their respective props. See doc examples below for more information on each.
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from 'react'
2
- import { Dropdown, User, FlexItem, Badge, Avatar } from '../../'
2
+ import { Dropdown, User, Flex, FlexItem, Badge, Avatar } from '../../'
3
3
 
4
4
  const DropdownWithCustomDisplay = (props) => {
5
5
  const [selectedOption, setSelectedOption] = useState();
@@ -69,7 +69,10 @@ const DropdownWithCustomDisplay = (props) => {
69
69
  <Dropdown.Option key={option.id}
70
70
  option={option}
71
71
  >
72
- <>
72
+ <Flex
73
+ align="center"
74
+ justify="between"
75
+ >
73
76
  <FlexItem>
74
77
  <User
75
78
  align="left"
@@ -93,7 +96,7 @@ const DropdownWithCustomDisplay = (props) => {
93
96
  }`}
94
97
  />
95
98
  </FlexItem>
96
- </>
99
+ </Flex>
97
100
  </Dropdown.Option>
98
101
  ))}
99
102
  </Dropdown>
@@ -1,5 +1,5 @@
1
- The `customDisplay` prop can be used to customize the display of the selected item by allowing devs to pass in a component that will be rendered to the left of the default text-based display. In this example the Avatar kit is being used.
1
+ Optionally utilize `customDisplay` on the `Dropdown.Trigger` subcomponent to customize its content after an option is selected. The component passed to customDisplay will be rendered to the left of the default text-based display. In this example the Avatar kit is being used.
2
2
 
3
- The `placeholder` prop can also be used to customize the placeholder text for the default Trigger.
3
+ The `placeholder` prop can also be used to customize the placeholder text for the default `Dropdown.Trigger`.
4
4
 
5
- The `onSelect` prop is a function that gives the dev one argument: the selected option. In this example we are using the `onSelect` to set a state with the selected option and using it to customize the `customDisplay`.
5
+ The `onSelect` prop returns the selected option as an object to be utilized by the dev. In this example we are using the `onSelect` to set a state with the selected option and using it to customize the `customDisplay`.
@@ -48,12 +48,17 @@
48
48
  <%= pb_rails("dropdown/dropdown_container") do %>
49
49
  <% options.each do |option| %>
50
50
  <%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
51
- <%= pb_rails("flex/flex_item") do %>
52
- <%= pb_rails("user", props: {name: option[:label], align:"left", avatar: true, orientation:"horizontal", territory:option[:territory], title: option[:title]}) %>
53
- <% end %>
54
- <%= pb_rails("flex/flex_item") do %>
55
- <%= pb_rails("badge", props: {rounded: true, dark: true, text: option[:status], variant: option[:status] == "Offline" ? "neutral" : option[:status] == "Online" ? "success" : "warning" }) %>
56
- <% end %>
51
+ <%= pb_rails("flex", props: {
52
+ align: "center",
53
+ justify: "between",
54
+ }) do %>
55
+ <%= pb_rails("flex/flex_item") do %>
56
+ <%= pb_rails("user", props: {name: option[:label], align:"left", avatar: true, orientation:"horizontal", territory:option[:territory], title: option[:title]}) %>
57
+ <% end %>
58
+ <%= pb_rails("flex/flex_item") do %>
59
+ <%= pb_rails("badge", props: {rounded: true, dark: true, text: option[:status], variant: option[:status] == "Offline" ? "neutral" : option[:status] == "Online" ? "success" : "warning" }) %>
60
+ <% end %>
61
+ <% end %>
57
62
  <% end %>
58
63
  <% end %>
59
64
  <% end %>
@@ -0,0 +1,5 @@
1
+ Optionally utilize `custom_display` on the `dropdown/dropdown_trigger` subcomponent to customize its content after an option is selected. The component passed to custom_display will be rendered to the left of the default text-based display. In this example the Avatar kit is being used.
2
+
3
+ The `placeholder` prop can also be used to customize the placeholder text for the default `dropdown/dropdown_trigger`.
4
+
5
+ The dropdown follows the typical rails pattern of utilizing hidden inputs for form submission. The hidden input value is the selected options' id.
@@ -38,7 +38,10 @@ const DropdownWithCustomOptions = (props) => {
38
38
  <Dropdown.Option key={option.id}
39
39
  option={option}
40
40
  >
41
- <>
41
+ <Flex
42
+ align="center"
43
+ justify="between"
44
+ >
42
45
  <FlexItem>
43
46
  <Flex>
44
47
  <Icon icon={option.icon}
@@ -52,7 +55,7 @@ const DropdownWithCustomOptions = (props) => {
52
55
  text={option.areaCode}
53
56
  />
54
57
  </FlexItem>
55
- </>
58
+ </Flex>
56
59
  </Dropdown.Option>
57
60
  ))}
58
61
  </Dropdown>
@@ -1 +1 @@
1
- The Dropdown also allows for custom options that can be passed in as children to the `Dropdown.Option` subcomponent. If no children are passed to `Dropdown.Option`, the kit will render each option as text within a Body kit by default.
1
+ `Dropdown.Option` subcomponent accepts any child components to customize the options' contents and display. By default, options are Body kit text that is set by the `label` value from the `option` object.
@@ -5,21 +5,21 @@
5
5
  value: "United States",
6
6
  areaCode: "+1",
7
7
  icon: "🇺🇸",
8
- id: "United-states"
8
+ id: "us"
9
9
  },
10
10
  {
11
11
  label: "Canada",
12
12
  value: "Canada",
13
13
  areaCode: "+1",
14
14
  icon: "🇨🇦",
15
- id: "canada"
15
+ id: "ca"
16
16
  },
17
17
  {
18
18
  label: "Pakistan",
19
19
  value: "Pakistan",
20
20
  areaCode: "+92",
21
21
  icon: "🇵🇰",
22
- id: "pakistan"
22
+ id: "pk"
23
23
  }
24
24
  ]
25
25
 
@@ -30,14 +30,19 @@
30
30
  <%= pb_rails("dropdown/dropdown_container") do %>
31
31
  <% options.each do |option| %>
32
32
  <%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
33
- <%= pb_rails("flex/flex_item") do %>
34
- <%= pb_rails("flex") do %>
35
- <%= pb_rails("icon", props: {icon: option[:icon]}) %>
36
- <%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
37
- <% end %>
38
- <% end %>
39
- <%= pb_rails("flex/flex_item") do %>
40
- <%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
33
+ <%= pb_rails("flex", props: {
34
+ align: "center",
35
+ justify: "between",
36
+ }) do %>
37
+ <%= pb_rails("flex/flex_item") do %>
38
+ <%= pb_rails("flex") do %>
39
+ <%= pb_rails("icon", props: {icon: option[:icon]}) %>
40
+ <%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
41
+ <% end %>
42
+ <% end %>
43
+ <%= pb_rails("flex/flex_item") do %>
44
+ <%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
45
+ <% end %>
41
46
  <% end %>
42
47
  <% end %>
43
48
  <% end %>
@@ -0,0 +1 @@
1
+ `dropdown/dropdown_option` subcomponent accepts any child components to customize the options' contents and display. By default, options are Body kit text that is set by the `label` value from the `option` object.
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -1 +1 @@
1
- By default, the padding on each option in the dropdown is set to `xs`. The `padding` Global Props however can be used to override this default. In this example, we are setting padding to `sm`.
1
+ By default, dropdown option paddingX is set to `sm` and paddingY is set to `xs`, but this padding can be overridden using our global padding props. In this example we are setting the option padding to `sm` all around.
@@ -51,7 +51,10 @@ const [selectedOption, setSelectedOption] = useState();
51
51
  <Dropdown.Option key={option.id}
52
52
  option={option}
53
53
  >
54
- <>
54
+ <Flex
55
+ align="center"
56
+ justify="between"
57
+ >
55
58
  <FlexItem>
56
59
  <Flex>
57
60
  <Icon icon={option.icon}
@@ -65,7 +68,7 @@ const [selectedOption, setSelectedOption] = useState();
65
68
  text={option.areaCode}
66
69
  />
67
70
  </FlexItem>
68
- </>
71
+ </Flex>
69
72
  </Dropdown.Option>
70
73
  ))}
71
74
  </Dropdown.Container>
@@ -1 +1 @@
1
- The Dropdown can also be given a custom Trigger by passing children to the `Dropdown.Trigger` subcomponent as shown in this example. Here we are using the IconCircle kit.
1
+ Optionally replace the default trigger's select element by passing child components directly to the `Dropdown.Trigger`.
@@ -5,21 +5,21 @@
5
5
  value: "United States",
6
6
  areaCode: "+1",
7
7
  icon: "🇺🇸",
8
- id: "United-states"
8
+ id: "us"
9
9
  },
10
10
  {
11
11
  label: "Canada",
12
12
  value: "Canada",
13
13
  areaCode: "+1",
14
14
  icon: "🇨🇦",
15
- id: "canada"
15
+ id: "ca"
16
16
  },
17
17
  {
18
18
  label: "Pakistan",
19
19
  value: "Pakistan",
20
20
  areaCode: "+92",
21
21
  icon: "🇵🇰",
22
- id: "pakistan"
22
+ id: "pk"
23
23
  }
24
24
  ]
25
25
 
@@ -32,15 +32,20 @@
32
32
  <%= pb_rails("dropdown/dropdown_container", props:{max_width:"xs"}) do %>
33
33
  <% options.each do |option| %>
34
34
  <%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
35
+ <%= pb_rails("flex", props: {
36
+ align: "center",
37
+ justify: "between",
38
+ }) do %>
35
39
  <%= pb_rails("flex/flex_item") do %>
36
- <%= pb_rails("flex") do %>
37
- <%= pb_rails("icon", props: {icon: option[:icon]}) %>
38
- <%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
39
- <% end %>
40
- <% end %>
41
- <%= pb_rails("flex/flex_item") do %>
42
- <%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
43
- <% end %>
40
+ <%= pb_rails("flex") do %>
41
+ <%= pb_rails("icon", props: {icon: option[:icon]}) %>
42
+ <%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
43
+ <% end %>
44
+ <% end %>
45
+ <%= pb_rails("flex/flex_item") do %>
46
+ <%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
47
+ <% end %>
48
+ <% end %>
44
49
  <% end %>
45
50
  <% end %>
46
51
  <% end %>
@@ -0,0 +1 @@
1
+ Optionally replace the default trigger's select element by passing child components directly to the `dropdown/dropdown_trigger`.
@@ -1,8 +1,8 @@
1
1
  <%
2
2
  options = [
3
- { label: 'United States', value: 'United States' },
4
- { label: 'Canada', value: 'Canada' },
5
- { label: 'Pakistan', value: 'Pakistan' },
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' },
6
6
  ]
7
7
 
8
8
  %>
@@ -1 +1 @@
1
- The optional `label` prop takes a string value that if present will render that string as the label for the Dropdown.
1
+ The top-level Dropdown component optionally accepts any string through a `label` prop to produce a label above your trigger element.
@@ -1,12 +1,12 @@
1
1
  examples:
2
2
  rails:
3
3
  - dropdown_default: Default
4
- - dropdown_subcomponent_structure: Subcomponent Structure
4
+ - dropdown_subcomponent_structure_rails: Subcomponent Structure
5
5
  - dropdown_with_label: With Label
6
- - dropdown_with_custom_options: Custom Options
7
- - dropdown_with_custom_display: Custom Display
8
- - dropdown_with_custom_trigger: Custom Trigger
9
- - dropdown_with_custom_padding: Custom Padding for Dropdown Options
6
+ - dropdown_with_custom_options_rails: Custom Options
7
+ - dropdown_with_custom_display_rails: Custom Display
8
+ - dropdown_with_custom_trigger_rails: Custom Trigger
9
+ - dropdown_with_custom_padding: Custom Option Padding
10
10
 
11
11
  react:
12
12
  - dropdown_default: Default
@@ -15,7 +15,7 @@ examples:
15
15
  - dropdown_with_custom_options: Custom Options
16
16
  - dropdown_with_custom_display: Custom Display
17
17
  - dropdown_with_custom_trigger: Custom Trigger
18
- - dropdown_with_custom_padding: Custom Padding for Dropdown Options
18
+ - dropdown_with_custom_padding: Custom Option Padding
19
19
  # - dropdown_with_autocomplete: Autocomplete
20
20
  # - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
21
21
  # - dropdown_with_external_control: useDropdown Hook
@@ -8,6 +8,7 @@
8
8
  <%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %>
9
9
  <% end %>
10
10
  <div class="dropdown_wrapper" style="position: relative">
11
+ <input type="hidden" name="<%= object.name %>" id="dropdown-selected-option" value=""/>
11
12
  <% if content.present? %>
12
13
  <%= content.presence %>
13
14
  <% else %>
@@ -6,6 +6,7 @@ module Playbook
6
6
  prop :options, type: Playbook::Props::Array,
7
7
  default: []
8
8
  prop :label, type: Playbook::Props::String
9
+ prop :name, type: Playbook::Props::String
9
10
 
10
11
  def data
11
12
  Hash(prop(:data)).merge(pb_dropdown: true)
@@ -203,5 +203,5 @@ test('selected option on click', () => {
203
203
  const kit = screen.getByTestId(testId)
204
204
  const option = kit.querySelector('.pb_dropdown_option_list')
205
205
  option.click()
206
- expect(option).toHaveClass('pb_dropdown_option_selected p_xs')
206
+ expect(option).toHaveClass('pb_dropdown_option_selected')
207
207
  })