playbook_ui 7.16.0 → 8.0.0.pre.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (305) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/playbook/application_controller.rb +0 -1
  3. data/app/helpers/playbook/pb_doc_helper.rb +30 -26
  4. data/app/pb_kits/playbook/_playbook.scss +1 -0
  5. data/app/pb_kits/playbook/pb_avatar/{_avatar.html.erb → avatar.html.erb} +0 -0
  6. data/app/pb_kits/playbook/pb_avatar/avatar.rb +1 -5
  7. data/app/pb_kits/playbook/pb_avatar_action_button/{_avatar_action_button.html.erb → avatar_action_button.html.erb} +6 -10
  8. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +2 -6
  9. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_background/{_background.html.erb → background.html.erb} +2 -2
  11. data/app/pb_kits/playbook/pb_background/background.rb +1 -5
  12. data/app/pb_kits/playbook/pb_badge/{_badge.html.erb → badge.html.erb} +0 -0
  13. data/app/pb_kits/playbook/pb_badge/badge.rb +1 -5
  14. data/app/pb_kits/playbook/pb_bar_graph/{_bar_graph.html.erb → bar_graph.html.erb} +0 -0
  15. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +1 -4
  16. data/app/pb_kits/playbook/{pb_caption/_caption.html.erb → pb_body/body.html.erb} +1 -1
  17. data/app/pb_kits/playbook/pb_body/body.rb +6 -11
  18. data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +0 -1
  19. data/app/pb_kits/playbook/pb_button/{_button.html.erb → button.html.erb} +1 -1
  20. data/app/pb_kits/playbook/pb_button/button.rb +1 -5
  21. data/app/pb_kits/playbook/pb_button_toolbar/{_button_toolbar.html.erb → button_toolbar.html.erb} +1 -1
  22. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.rb +1 -5
  23. data/app/pb_kits/playbook/{pb_body/_body.html.erb → pb_caption/caption.html.erb} +1 -1
  24. data/app/pb_kits/playbook/pb_caption/caption.rb +1 -5
  25. data/app/pb_kits/playbook/pb_card/{_card.html.erb → card.html.erb} +3 -3
  26. data/app/pb_kits/playbook/pb_card/card.rb +2 -7
  27. data/app/pb_kits/playbook/pb_card/{child_kits/_card_header.html.erb → card_body.html.erb} +1 -1
  28. data/app/pb_kits/playbook/pb_card/card_body.rb +1 -5
  29. data/app/pb_kits/playbook/pb_card/{child_kits/_card_body.html.erb → card_header.html.erb} +1 -1
  30. data/app/pb_kits/playbook/pb_card/card_header.rb +1 -6
  31. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +7 -4
  32. data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +5 -1
  33. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +12 -0
  34. data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -7
  35. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default.html.erb +2 -0
  36. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default.jsx +1 -0
  37. data/app/pb_kits/playbook/pb_circle_chart/{_circle_chart.html.erb → circle_chart.html.erb} +3 -3
  38. data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +2 -6
  39. data/app/pb_kits/playbook/pb_circle_icon_button/{_circle_icon_button.html.erb → circle_icon_button.html.erb} +1 -3
  40. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +1 -5
  41. data/app/pb_kits/playbook/pb_contact/{_contact.html.erb → contact.html.erb} +0 -0
  42. data/app/pb_kits/playbook/pb_contact/contact.rb +1 -6
  43. data/app/pb_kits/playbook/pb_currency/{_currency.html.erb → currency.html.erb} +0 -1
  44. data/app/pb_kits/playbook/pb_currency/currency.rb +1 -6
  45. data/app/pb_kits/playbook/pb_dashboard_value/{_dashboard_value.html.erb → dashboard_value.html.erb} +0 -0
  46. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +1 -5
  47. data/app/pb_kits/playbook/pb_date/{_date.html.erb → date.html.erb} +0 -0
  48. data/app/pb_kits/playbook/pb_date/date.rb +1 -7
  49. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +42 -0
  50. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +1 -5
  51. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +0 -3
  52. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +7 -0
  53. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +4 -1
  54. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +16 -0
  55. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +1 -7
  56. data/app/pb_kits/playbook/pb_date_range_stacked/{_date_range_stacked.html.erb → date_range_stacked.html.erb} +0 -0
  57. data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.rb +1 -5
  58. data/app/pb_kits/playbook/pb_date_stacked/{_date_stacked.html.erb → date_stacked.html.erb} +0 -0
  59. data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +1 -7
  60. data/app/pb_kits/playbook/pb_date_time/{_date_time.html.erb → date_time.html.erb} +3 -3
  61. data/app/pb_kits/playbook/pb_date_time/date_time.rb +1 -5
  62. data/app/pb_kits/playbook/pb_date_time_stacked/{_date_time_stacked.html.erb → date_time_stacked.html.erb} +0 -2
  63. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +1 -5
  64. data/app/pb_kits/playbook/pb_date_year_stacked/{_date_year_stacked.html.erb → date_year_stacked.html.erb} +0 -0
  65. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.rb +1 -5
  66. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.scss +3 -3
  67. data/app/pb_kits/playbook/pb_distribution_bar/{_distribution_bar.html.erb → distribution_bar.html.erb} +0 -0
  68. data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +1 -5
  69. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.html.erb +1 -1
  70. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.jsx +1 -1
  71. data/app/pb_kits/playbook/pb_distribution_bar/docs/_distribution_bar_custom_colors.md +1 -1
  72. data/app/pb_kits/playbook/pb_filter/filter.html.erb +86 -0
  73. data/app/pb_kits/playbook/pb_filter/filter.rb +9 -5
  74. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/{_fixed_confirmation_toast.html.erb → fixed_confirmation_toast.html.erb} +0 -0
  75. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -5
  76. data/app/pb_kits/playbook/{pb_layout/_sidebar.html.erb → pb_flex/flex.html.erb} +1 -1
  77. data/app/pb_kits/playbook/pb_flex/flex.rb +1 -5
  78. data/app/pb_kits/playbook/pb_flex/{_flex_item.html.erb → flex_item.html.erb} +1 -1
  79. data/app/pb_kits/playbook/pb_flex/flex_item.rb +1 -5
  80. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
  81. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
  82. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +1 -2
  83. data/app/pb_kits/playbook/pb_form/form.html.erb +7 -0
  84. data/app/pb_kits/playbook/pb_form/form.rb +12 -14
  85. data/app/pb_kits/playbook/pb_form/form_builder.rb +1 -1
  86. data/app/pb_kits/playbook/pb_form/form_builder/action_area.html.erb +3 -0
  87. data/app/pb_kits/playbook/pb_form/form_builder/action_area.rb +5 -21
  88. data/app/pb_kits/playbook/pb_form/form_with.html.erb +18 -0
  89. data/app/pb_kits/playbook/pb_form/form_with.rb +34 -0
  90. data/app/pb_kits/playbook/pb_form/{_form_simple_form.html.erb → simple_form.html.erb} +3 -3
  91. data/app/pb_kits/playbook/pb_form/simple_form.rb +63 -0
  92. data/app/pb_kits/playbook/pb_form_group/{_form_group.html.erb → form_group.html.erb} +1 -1
  93. data/app/pb_kits/playbook/pb_form_group/form_group.rb +1 -5
  94. data/app/pb_kits/playbook/pb_form_pill/{_form_pill.html.erb → form_pill.html.erb} +0 -3
  95. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +1 -5
  96. data/app/pb_kits/playbook/pb_gauge/{_gauge.html.erb → gauge.html.erb} +0 -0
  97. data/app/pb_kits/playbook/pb_gauge/gauge.rb +1 -5
  98. data/app/pb_kits/playbook/pb_hashtag/{_hashtag.html.erb → hashtag.html.erb} +0 -1
  99. data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +1 -5
  100. data/app/pb_kits/playbook/pb_highlight/{_highlight.html.erb → highlight.html.erb} +1 -1
  101. data/app/pb_kits/playbook/pb_highlight/highlight.rb +1 -5
  102. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.html.erb +6 -0
  103. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +9 -9
  104. data/app/pb_kits/playbook/pb_icon/{_icon.html.erb → icon.html.erb} +0 -0
  105. data/app/pb_kits/playbook/pb_icon/icon.rb +1 -5
  106. data/app/pb_kits/playbook/pb_icon_circle/{_icon_circle.html.erb → icon_circle.html.erb} +0 -0
  107. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +1 -5
  108. data/app/pb_kits/playbook/pb_icon_stat_value/{_icon_stat_value.html.erb → icon_stat_value.html.erb} +0 -0
  109. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +1 -6
  110. data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +10 -0
  111. data/app/pb_kits/playbook/pb_icon_value/icon_value.rb +1 -5
  112. data/app/pb_kits/playbook/pb_image/_image.jsx +3 -1
  113. data/app/pb_kits/playbook/pb_image/docs/_default_image.html.erb +6 -6
  114. data/app/pb_kits/playbook/pb_image/docs/_default_image.jsx +6 -0
  115. data/app/pb_kits/playbook/pb_image/docs/_rounded_image.html.erb +5 -5
  116. data/app/pb_kits/playbook/pb_image/docs/_rounded_image.jsx +5 -0
  117. data/app/pb_kits/playbook/pb_image/{_image.html.erb → image.html.erb} +0 -0
  118. data/app/pb_kits/playbook/pb_image/image.rb +3 -7
  119. data/app/pb_kits/playbook/pb_image/image.test.js +35 -0
  120. data/app/pb_kits/playbook/pb_label_pill/{_label_pill.html.erb → label_pill.html.erb} +0 -0
  121. data/app/pb_kits/playbook/pb_label_pill/label_pill.rb +1 -5
  122. data/app/pb_kits/playbook/pb_label_value/{_label_value.html.erb → label_value.html.erb} +2 -2
  123. data/app/pb_kits/playbook/pb_label_value/label_value.rb +1 -6
  124. data/app/pb_kits/playbook/pb_layout/body.html.erb +6 -0
  125. data/app/pb_kits/playbook/pb_layout/body.rb +1 -5
  126. data/app/pb_kits/playbook/pb_layout/footer.html.erb +6 -0
  127. data/app/pb_kits/playbook/pb_layout/footer.rb +1 -5
  128. data/app/pb_kits/playbook/pb_layout/header.html.erb +6 -0
  129. data/app/pb_kits/playbook/pb_layout/header.rb +1 -5
  130. data/app/pb_kits/playbook/{pb_flex/_flex.html.erb → pb_layout/item.html.erb} +1 -1
  131. data/app/pb_kits/playbook/pb_layout/item.rb +1 -5
  132. data/app/pb_kits/playbook/pb_layout/{_item.html.erb → layout.html.erb} +1 -1
  133. data/app/pb_kits/playbook/pb_layout/layout.rb +1 -5
  134. data/app/pb_kits/playbook/pb_layout/{_layout.html.erb → sidebar.html.erb} +1 -1
  135. data/app/pb_kits/playbook/pb_layout/sidebar.rb +1 -5
  136. data/app/pb_kits/playbook/pb_legend/{_legend.html.erb → legend.html.erb} +0 -0
  137. data/app/pb_kits/playbook/pb_legend/legend.rb +1 -5
  138. data/app/pb_kits/playbook/pb_line_graph/{_line_graph.html.erb → line_graph.html.erb} +0 -0
  139. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -5
  140. data/app/pb_kits/playbook/pb_list/{_item.html.erb → item.html.erb} +1 -1
  141. data/app/pb_kits/playbook/pb_list/item.rb +1 -5
  142. data/app/pb_kits/playbook/pb_list/{_list.html.erb → list.html.erb} +1 -1
  143. data/app/pb_kits/playbook/pb_list/list.rb +1 -5
  144. data/app/pb_kits/playbook/pb_loading_inline/{_loading_inline.html.erb → loading_inline.html.erb} +0 -0
  145. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +1 -5
  146. data/app/pb_kits/playbook/pb_message/{_message.html.erb → message.html.erb} +0 -0
  147. data/app/pb_kits/playbook/pb_message/message.rb +1 -5
  148. data/app/pb_kits/playbook/pb_multiple_users/{_multiple_users.html.erb → multiple_users.html.erb} +0 -0
  149. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.rb +1 -5
  150. data/app/pb_kits/playbook/pb_multiple_users_stacked/{_multiple_users_stacked.html.erb → multiple_users_stacked.html.erb} +0 -0
  151. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +1 -5
  152. data/app/pb_kits/playbook/pb_nav/{_item.html.erb → item.html.erb} +1 -1
  153. data/app/pb_kits/playbook/pb_nav/item.rb +1 -5
  154. data/app/pb_kits/playbook/pb_nav/{_nav.html.erb → nav.html.erb} +1 -1
  155. data/app/pb_kits/playbook/pb_nav/nav.rb +1 -6
  156. data/app/pb_kits/playbook/pb_online_status/{_online_status.html.erb → online_status.html.erb} +0 -0
  157. data/app/pb_kits/playbook/pb_online_status/online_status.rb +1 -5
  158. data/app/pb_kits/playbook/pb_person/person.html.erb +12 -0
  159. data/app/pb_kits/playbook/pb_person/person.rb +1 -5
  160. data/app/pb_kits/playbook/pb_person_contact/{_person_contact.html.erb → person_contact.html.erb} +0 -0
  161. data/app/pb_kits/playbook/pb_person_contact/person_contact.rb +1 -5
  162. data/app/pb_kits/playbook/pb_pill/{_pill.html.erb → pill.html.erb} +0 -0
  163. data/app/pb_kits/playbook/pb_pill/pill.rb +1 -5
  164. data/app/pb_kits/playbook/pb_popover/popover.html.erb +11 -0
  165. data/app/pb_kits/playbook/pb_popover/popover.rb +1 -4
  166. data/app/pb_kits/playbook/pb_progress_pills/{_progress_pills.html.erb → progress_pills.html.erb} +1 -1
  167. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +1 -5
  168. data/app/pb_kits/playbook/pb_progress_simple/{_progress_simple.html.erb → progress_simple.html.erb} +0 -0
  169. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.rb +1 -5
  170. data/app/pb_kits/playbook/pb_progress_step/{_progress_step.html.erb → progress_step.html.erb} +1 -1
  171. data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +1 -5
  172. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +13 -0
  173. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +1 -5
  174. data/app/pb_kits/playbook/pb_radio/_radio.scss +20 -9
  175. data/app/pb_kits/playbook/pb_radio/docs/_radio_default.html.erb +4 -2
  176. data/app/pb_kits/playbook/pb_radio/docs/_radio_default.jsx +1 -1
  177. data/app/pb_kits/playbook/pb_radio/{_radio.html.erb → radio.html.erb} +2 -2
  178. data/app/pb_kits/playbook/pb_radio/radio.rb +1 -7
  179. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +13 -0
  180. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb +5 -0
  181. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx +15 -0
  182. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
  183. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +1 -0
  184. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +5 -0
  185. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +4 -10
  186. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +64 -0
  187. data/app/pb_kits/playbook/pb_section_separator/{_section_separator.html.erb → section_separator.html.erb} +1 -1
  188. data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +1 -5
  189. data/app/pb_kits/playbook/pb_select/_select.scss +4 -0
  190. data/app/pb_kits/playbook/pb_select/{_select.html.erb → select.html.erb} +2 -2
  191. data/app/pb_kits/playbook/pb_select/select.rb +1 -7
  192. data/app/pb_kits/playbook/pb_selectable_card/{_selectable_card.html.erb → selectable_card.html.erb} +4 -4
  193. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -5
  194. data/app/pb_kits/playbook/pb_selectable_card_icon/{_selectable_card_icon.html.erb → selectable_card_icon.html.erb} +0 -0
  195. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -5
  196. data/app/pb_kits/playbook/pb_selectable_icon/{_selectable_icon.html.erb → selectable_icon.html.erb} +0 -0
  197. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -5
  198. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +11 -0
  199. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +1 -5
  200. data/app/pb_kits/playbook/pb_selectable_list/{_selectable_list_item.html.erb → selectable_list_item.html.erb} +4 -5
  201. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +1 -5
  202. data/app/pb_kits/playbook/pb_source/{_source.html.erb → source.html.erb} +0 -0
  203. data/app/pb_kits/playbook/pb_source/source.rb +1 -5
  204. data/app/pb_kits/playbook/pb_star_rating/_star_rating.jsx +11 -11
  205. data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +5 -3
  206. data/app/pb_kits/playbook/pb_star_rating/{_star_rating.html.erb → star_rating.html.erb} +9 -10
  207. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +1 -5
  208. data/app/pb_kits/playbook/pb_stat_change/{_stat_change.html.erb → stat_change.html.erb} +0 -0
  209. data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +1 -5
  210. data/app/pb_kits/playbook/pb_stat_value/{_stat_value.html.erb → stat_value.html.erb} +0 -0
  211. data/app/pb_kits/playbook/pb_stat_value/stat_value.rb +1 -6
  212. data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +3 -2
  213. data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +3 -2
  214. data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +3 -2
  215. data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +3 -2
  216. data/app/pb_kits/playbook/pb_table/{_table.html.erb → table.html.erb} +1 -1
  217. data/app/pb_kits/playbook/pb_table/table.rb +1 -5
  218. data/app/pb_kits/playbook/pb_table/{_table_row.html.erb → table_row.html.erb} +1 -1
  219. data/app/pb_kits/playbook/pb_table/table_row.rb +1 -5
  220. data/app/pb_kits/playbook/pb_text_input/{_text_input.html.erb → text_input.html.erb} +6 -10
  221. data/app/pb_kits/playbook/pb_text_input/text_input.rb +1 -5
  222. data/app/pb_kits/playbook/pb_textarea/{_textarea.html.erb → textarea.html.erb} +4 -4
  223. data/app/pb_kits/playbook/pb_textarea/textarea.rb +1 -6
  224. data/app/pb_kits/playbook/pb_time/{_time.html.erb → time.html.erb} +0 -0
  225. data/app/pb_kits/playbook/pb_time/time.rb +1 -5
  226. data/app/pb_kits/playbook/pb_time_range_inline/{_time_range_inline.html.erb → time_range_inline.html.erb} +0 -0
  227. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.rb +1 -5
  228. data/app/pb_kits/playbook/pb_time_stacked/{_time_stacked.html.erb → time_stacked.html.erb} +0 -0
  229. data/app/pb_kits/playbook/pb_time_stacked/time_stacked.rb +1 -8
  230. data/app/pb_kits/playbook/pb_timeline/{_item.html.erb → item.html.erb} +6 -6
  231. data/app/pb_kits/playbook/pb_timeline/item.rb +1 -5
  232. data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +6 -0
  233. data/app/pb_kits/playbook/pb_timeline/timeline.rb +1 -5
  234. data/app/pb_kits/playbook/pb_timestamp/{_timestamp.html.erb → timestamp.html.erb} +0 -0
  235. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +1 -5
  236. data/app/pb_kits/playbook/pb_title/{_title.html.erb → title.html.erb} +0 -0
  237. data/app/pb_kits/playbook/pb_title/title.rb +1 -5
  238. data/app/pb_kits/playbook/pb_title_count/{_title_count.html.erb → title_count.html.erb} +0 -0
  239. data/app/pb_kits/playbook/pb_title_count/title_count.rb +1 -5
  240. data/app/pb_kits/playbook/pb_title_detail/{_title_detail.html.erb → title_detail.html.erb} +0 -0
  241. data/app/pb_kits/playbook/pb_title_detail/title_detail.rb +1 -5
  242. data/app/pb_kits/playbook/pb_toggle/toggle.html.erb +10 -0
  243. data/app/pb_kits/playbook/pb_toggle/toggle.rb +1 -7
  244. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +1 -1
  245. data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +9 -0
  246. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +1 -4
  247. data/app/pb_kits/playbook/pb_typeahead/{_typeahead.html.erb → typeahead.html.erb} +0 -0
  248. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +2 -5
  249. data/app/pb_kits/playbook/pb_user/{_user.html.erb → user.html.erb} +0 -0
  250. data/app/pb_kits/playbook/pb_user/user.rb +1 -5
  251. data/app/pb_kits/playbook/pb_user_badge/badges/{_million-dollar.svg → million-dollar.svg} +0 -0
  252. data/app/pb_kits/playbook/pb_user_badge/badges/{_veteran.svg → veteran.svg} +0 -0
  253. data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +7 -0
  254. data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +9 -6
  255. data/app/pb_kits/playbook/pb_weekday_stacked/{_weekday_stacked.html.erb → weekday_stacked.html.erb} +0 -0
  256. data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb +2 -8
  257. data/app/pb_kits/playbook/tokens/_positioning.scss +2 -0
  258. data/app/pb_kits/playbook/utilities/_positioning.scss +30 -0
  259. data/app/pb_kits/playbook/utilities/accessibility.js +22 -0
  260. data/app/pb_kits/playbook/utilities/globalProps.js +8 -2
  261. data/app/pb_kits/playbook/utilities/test-utils.js +18 -1
  262. data/lib/playbook.rb +5 -1
  263. data/lib/playbook/classnames.rb +34 -0
  264. data/lib/playbook/engine.rb +6 -10
  265. data/lib/playbook/kit_base.rb +24 -0
  266. data/lib/playbook/kit_resolver.rb +23 -0
  267. data/lib/playbook/pb_kit_helper.rb +10 -0
  268. data/lib/playbook/props.rb +7 -103
  269. data/lib/playbook/spacing.rb +76 -0
  270. data/lib/playbook/version.rb +1 -1
  271. data/lib/playbook/z_index.rb +31 -0
  272. metadata +143 -127
  273. data/app/helpers/playbook/pb_kit_helper.rb +0 -27
  274. data/app/pb_kits/playbook/config/_kit_example.html.erb +0 -23
  275. data/app/pb_kits/playbook/config/_kit_samples_list.html.erb +0 -3
  276. data/app/pb_kits/playbook/config/_kit_ui.html.erb +0 -41
  277. data/app/pb_kits/playbook/config/_pb_kit_api.html.erb +0 -16
  278. data/app/pb_kits/playbook/pb_checkbox/_checkbox.html.erb +0 -16
  279. data/app/pb_kits/playbook/pb_date_picker/_date_picker.html.erb +0 -43
  280. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.html.erb +0 -16
  281. data/app/pb_kits/playbook/pb_file_upload/file_upload.rb +0 -11
  282. data/app/pb_kits/playbook/pb_filter/_filter.html.erb +0 -6
  283. data/app/pb_kits/playbook/pb_filter/templates/_core.html.erb +0 -67
  284. data/app/pb_kits/playbook/pb_filter/templates/_default.html.erb +0 -23
  285. data/app/pb_kits/playbook/pb_form/_form_form_with.html.erb +0 -13
  286. data/app/pb_kits/playbook/pb_form/form/form_with_form.rb +0 -39
  287. data/app/pb_kits/playbook/pb_form/form/simple_form_form.rb +0 -46
  288. data/app/pb_kits/playbook/pb_form/form_builder/form_with_form_builder.rb +0 -11
  289. data/app/pb_kits/playbook/pb_form/form_builder/simple_form_builder.rb +0 -25
  290. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.html.erb +0 -10
  291. data/app/pb_kits/playbook/pb_icon_value/_icon_value.html.erb +0 -10
  292. data/app/pb_kits/playbook/pb_kit/base.rb +0 -99
  293. data/app/pb_kits/playbook/pb_layout/_body.html.erb +0 -6
  294. data/app/pb_kits/playbook/pb_layout/_column.html.erb +0 -7
  295. data/app/pb_kits/playbook/pb_layout/_footer.html.erb +0 -6
  296. data/app/pb_kits/playbook/pb_layout/_header.html.erb +0 -6
  297. data/app/pb_kits/playbook/pb_person/_person.html.erb +0 -14
  298. data/app/pb_kits/playbook/pb_popover/_popover.html.erb +0 -11
  299. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.html.erb +0 -13
  300. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.html.erb +0 -1
  301. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.html.erb +0 -11
  302. data/app/pb_kits/playbook/pb_timeline/_timeline.html.erb +0 -6
  303. data/app/pb_kits/playbook/pb_toggle/_toggle.html.erb +0 -15
  304. data/app/pb_kits/playbook/pb_tooltip/_tooltip.html.erb +0 -10
  305. data/app/pb_kits/playbook/pb_user_badge/_user_badge.html.erb +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba7ca0e1a8dbb832e4553d4ca3c0c8c328ead105c57d691a0181ca169197b53a
4
- data.tar.gz: a8c51729b2dfcfb7dc54d448abc6a305cb89fb367933b4a01893a8a455dd0fcb
3
+ metadata.gz: c921685c5d3955c36d8ae3c9e44ca3da8a85566f09b1586435c2e0eaadef53bc
4
+ data.tar.gz: 84fe2792d4bd4dbc7bb57bc150d5af4bec0cf93b7bbf7ed7e64a7b5c85e6b63d
5
5
  SHA512:
6
- metadata.gz: e2ff1660024fbfc09a674433414caf39bc8b1c50220f51dc642c76d5de7d11f2b8056ae70ab924944c2828ee362f7b9986d1e5226672e9feda680606fc4ba7c2
7
- data.tar.gz: 01b2ae4f1a7abed5972b1394f9a2b13ac31de8814050adef4f78ca81cab284c82fab7b966a88428b94c326f6319b72774443f00894c29e273773279d97388696
6
+ metadata.gz: 68eb2a35ffe4c1b6ecf9fe60853562f7d2cd28ab16c17a8f4cc5904f9b05e56128fa66699fd82527346bdff505f8d797d5eb7251ac78d7095088c8dacabdc721
7
+ data.tar.gz: de3dfb369f495b031ac6744170d62c5dfe0ef1ff84cbbb470a03b35675fc8460abb63b44940764b7c6239e351a888d4a23a9c5733958d0595bd5dc97d2c62be9
@@ -6,7 +6,6 @@ module Playbook
6
6
  helper Playbook::ApplicationHelper
7
7
  helper Playbook::PbDocHelper
8
8
  helper Playbook::PbSampleHelper
9
- append_view_path Playbook::Engine.root + "app/pb_kits"
10
9
 
11
10
  def delete_dark_mode_cookie
12
11
  cookies.delete :dark_mode
@@ -6,6 +6,27 @@ module Playbook
6
6
  title.remove("pb_").titleize.tr("_", " ")
7
7
  end
8
8
 
9
+ def pb_doc_source(type, kit, example_key)
10
+ highlight = type == "react" ? "react" : "erb"
11
+ extension = type == "react" ? "jsx" : "html.erb"
12
+ source = read_source_file kit_path(kit).join("docs/_#{example_key}.#{extension}")
13
+ raw rouge(source, highlight)
14
+ end
15
+
16
+ def pb_doc_example(type, kit, example_key)
17
+ if type == "rails"
18
+ render file: kit_path(kit).join("docs/_#{example_key}.html.erb")
19
+ elsif type == "react"
20
+ pb_react(example_key.camelize)
21
+ end
22
+ end
23
+
24
+ def pb_doc_kit_api(kit)
25
+ kit_class = Playbook::KitResolver.resolve(kit.to_s)
26
+ return unless kit_class
27
+ render partial: "playbook/config/pb_kit_api", locals: { kit_api: kit_class.props.keys }
28
+ end
29
+
9
30
  def has_kit_type?(kit, type)
10
31
  type ||= "rails"
11
32
  if type == "rails"
@@ -17,20 +38,16 @@ module Playbook
17
38
  end
18
39
  end
19
40
 
20
- def kit_path(kit)
21
- "#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{kit}"
22
- end
23
-
24
41
  def get_kit_description(kit)
25
- read_source_file "app/pb_kits/playbook/pb_#{kit}/docs/_description.md"
42
+ read_source_file kit_path(kit).join("docs/_description.md")
26
43
  end
27
44
 
28
45
  def get_per_sample_descriptions(kit, key)
29
- read_source_file "app/pb_kits/playbook/pb_#{kit}/docs/_#{key}.md"
46
+ read_source_file kit_path(kit).join("docs/_#{key}.md")
30
47
  end
31
48
 
32
49
  def get_kit_footer(kit)
33
- read_source_file "app/pb_kits/playbook/pb_#{kit}/docs/_footer.md"
50
+ read_source_file kit_path(kit).join("docs/_footer.md")
34
51
  end
35
52
 
36
53
  def pb_kit(kit: "", type: "rails", show_code: true, limit_examples: false)
@@ -38,7 +55,7 @@ module Playbook
38
55
  @kit_examples = get_kit_examples(kit, type)
39
56
  @limit_examples = limit_examples
40
57
  @show_code = show_code
41
- render partial: "config/kit_example"
58
+ render partial: "playbook/config/kit_example"
42
59
  end
43
60
 
44
61
  def pb_kits(type: "rails", limit_examples: false)
@@ -76,16 +93,6 @@ module Playbook
76
93
  title + ui
77
94
  end
78
95
 
79
- def pb_kit_api(kit)
80
- kit_class_obj = get_class_name(kit.to_s)
81
- @kit_api = if kit_class_obj < Playbook::PbKit::Base
82
- kit_class_obj.instance_method(:initialize).parameters.map(&:last)
83
- else
84
- kit_class_obj.props.keys
85
- end
86
- render partial: "playbook/config/pb_kit_api"
87
- end
88
-
89
96
  def nav_hash_category(link)
90
97
  link.keys.first
91
98
  end
@@ -171,9 +178,12 @@ module Playbook
171
178
 
172
179
  private
173
180
 
181
+ def kit_path(kit)
182
+ Playbook::Engine.root.join("app/pb_kits/playbook/pb_#{kit}")
183
+ end
184
+
174
185
  def get_kit_examples(kit, type)
175
- example_file = File.join(Playbook::Engine.root,
176
- "app", "pb_kits", "playbook", "pb_#{kit}", "docs", "example.yml")
186
+ example_file = kit_path(kit).join("docs/example.yml")
177
187
  if File.exist? example_file
178
188
  examples_list = YAML.load_file(example_file)
179
189
  .inject({}) { |item, (k, v)| item[k.to_sym] = v; item }
@@ -183,12 +193,6 @@ module Playbook
183
193
  end
184
194
  end
185
195
 
186
- def get_class_name(kit)
187
- folder = is_subkit?(kit) ? kit.split("/")[0] : kit
188
- item = is_subkit?(kit) ? kit.split("/")[-1] : kit
189
- "Playbook::Pb#{folder.camelize}::#{item.camelize}".safe_constantize
190
- end
191
-
192
196
  def render_clickable_title(kit, type)
193
197
  url = "#"
194
198
  begin
@@ -90,3 +90,4 @@
90
90
  @import 'pb_weekday_stacked/weekday_stacked';
91
91
  @import './utilities/spacing';
92
92
  @import './utilities/max_width';
93
+ @import './utilities/positioning';
@@ -2,11 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbAvatar
5
- class Avatar
6
- include Playbook::Props
7
-
8
- partial "pb_avatar/avatar"
9
-
5
+ class Avatar < Playbook::KitBase
10
6
  prop :image_url
11
7
  prop :name, default: ""
12
8
  prop :size, type: Playbook::Props::Enum,
@@ -3,8 +3,6 @@
3
3
  id: object.id,
4
4
  data: object.data,
5
5
  class: object.classname) do %>
6
-
7
-
8
6
  <% if object.tooltip_text.present? %>
9
7
  <%= pb_rails("tooltip", props: {
10
8
  trigger_element_id: object.tooltip_id,
@@ -17,7 +15,6 @@
17
15
  <% end %>
18
16
 
19
17
  <%= link_to object.link_url, id: object.tooltip_id do %>
20
-
21
18
  <%= pb_rails("avatar", props: {
22
19
  dark: object.dark,
23
20
  name: object.name,
@@ -25,12 +22,11 @@
25
22
  image_url: object.image_url,
26
23
  class: "avatar_action"
27
24
  }) %>
28
- <div class="icon <%= object.dark ? 'dark' : '' %> ">
29
- <%= pb_rails("icon", props: {
30
- dark: object.dark,
31
- icon: object.action_icons
32
- }) %>
33
- </div>
34
-
25
+ <div class="icon <%= object.dark ? 'dark' : '' %> ">
26
+ <%= pb_rails("icon", props: {
27
+ dark: object.dark,
28
+ icon: object.action_icons
29
+ }) %>
30
+ </div>
35
31
  <% end %>
36
32
  <% end %>
@@ -2,13 +2,11 @@
2
2
 
3
3
  module Playbook
4
4
  module PbAvatarActionButton
5
- class AvatarActionButton
6
- include Playbook::Props
7
-
5
+ class AvatarActionButton < Playbook::KitBase
8
6
  prop :action, type: Playbook::Props::String,
9
7
  default: "add"
10
8
  prop :image_url, type: Playbook::Props::String
11
- prop :link_url, type: Playbook::Props::String
9
+ prop :link_url, type: Playbook::Props::String, default: "#"
12
10
  prop :tooltip_text, type: Playbook::Props::String
13
11
  prop :tooltip_id, type: Playbook::Props::String
14
12
  prop :name, type: Playbook::Props::String,
@@ -20,8 +18,6 @@ module Playbook
20
18
  values: %w[bottom_left bottom_right top_left top_right],
21
19
  default: "bottom_left"
22
20
 
23
- partial "pb_avatar_action_button/avatar_action_button"
24
-
25
21
  def classname
26
22
  generate_classname("pb_avatar_action_button_kit", action, size, placement)
27
23
  end
@@ -1,5 +1,5 @@
1
1
  <div class="pb--doc-demo-row">
2
-
2
+
3
3
  <%= pb_rails("avatar_action_button", props: {
4
4
  name: "Sophia Carden",
5
5
  image_url: "https://randomuser.me/api/portraits/women/8.jpg"
@@ -6,7 +6,7 @@
6
6
  class: object.classname,
7
7
  style: "background-image: url('#{object.image_url}');"
8
8
  ) do %>
9
- <%= capture(&object.children) %>
9
+ <%= content.presence %>
10
10
  <% end %>
11
11
  <% else %>
12
12
  <%= content_tag(object.tag,
@@ -15,6 +15,6 @@
15
15
  id: object.id,
16
16
  class: object.classname
17
17
  ) do %>
18
- <%= capture(&object.children) %>
18
+ <%= content.presence %>
19
19
  <% end %>
20
20
  <% end %>
@@ -2,11 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbBackground
5
- class Background
6
- include Playbook::Props
7
-
8
- partial "pb_background/background"
9
-
5
+ class Background < Playbook::KitBase
10
6
  prop :background_color, type: Playbook::Props::Enum,
11
7
  values: %w[gradient dark light white],
12
8
  default: "light"
@@ -2,11 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbBadge
5
- class Badge
6
- include Playbook::Props
7
-
8
- partial "pb_badge/badge"
9
-
5
+ class Badge < Playbook::KitBase
10
6
  prop :rounded, type: Playbook::Props::Boolean, default: false
11
7
  prop :text
12
8
  prop :variant, type: Playbook::Props::Enum,
@@ -2,10 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbBarGraph
5
- class BarGraph
6
- include Playbook::Props
7
- partial "pb_bar_graph/bar_graph"
8
-
5
+ class BarGraph < Playbook::KitBase
9
6
  prop :axis_title
10
7
  prop :chart_data, type: Playbook::Props::Array,
11
8
  default: []
@@ -3,5 +3,5 @@
3
3
  id: object.id,
4
4
  data: object.data,
5
5
  class: object.classname) do %>
6
- <%= object.children.present? ? capture(&object.children) : object.text %>
6
+ <%= object.content %>
7
7
  <% end %>
@@ -2,12 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbBody
5
- class Body
6
- include Playbook::Props
7
- include ActionView::Helpers
8
-
9
- partial "pb_body/body"
10
-
5
+ class Body < Playbook::KitBase
11
6
  prop :color, type: Playbook::Props::Enum,
12
7
  values: %w[default light lighter],
13
8
  default: "default"
@@ -19,7 +14,7 @@ module Playbook
19
14
  default: "div"
20
15
  prop :text
21
16
  prop :highlighting, type: Playbook::Props::Boolean,
22
- default: false
17
+ default: false
23
18
  prop :highlighted_text, type: Playbook::Props::Array,
24
19
  default: []
25
20
 
@@ -28,14 +23,14 @@ module Playbook
28
23
  end
29
24
 
30
25
  def content
31
- highlighting ? apply_highlight : text
26
+ body_text = super.presence || text
27
+ highlighting ? apply_highlight(body_text) : body_text
32
28
  end
33
29
 
34
30
  private
35
31
 
36
- def apply_highlight
37
- pb_highlight = Playbook::PbHighlight::Highlight.new() {"|"}
38
- pb_highlight_output = ApplicationController.renderer.render(partial: pb_highlight, as: :object)
32
+ def apply_highlight(text)
33
+ pb_highlight_output = pb_rails("highlight") { "|" }
39
34
  highlight_tags = pb_highlight_output.split("|")
40
35
  highlight(text, highlighted_text, highlighter: "#{highlight_tags.first.html_safe} \\1 #{highlight_tags.last.html_safe}")
41
36
  end
@@ -2,7 +2,6 @@
2
2
  text: "I am a body kit"
3
3
  }) %>
4
4
 
5
-
6
5
  <%= pb_rails("body", props: {
7
6
  text: "I am a body kit (Light)",
8
7
  color: "light"
@@ -1,5 +1,5 @@
1
1
  <%= content_tag(object.tag,
2
2
  object.tag == "button" ? object.options : object.link_options) do %>
3
3
  <%= pb_rails("icon", props: { icon: "spinner", pulse: true, fixed_width: true, classname: "loading-icon" }) %>
4
- <span class="pb_button_content"><%= !object.children.nil? ? capture(&object.children) : object.text %></span>
4
+ <span class="pb_button_content"><%= content.presence || object.text %></span>
5
5
  <% end %>
@@ -2,11 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbButton
5
- class Button
6
- include Playbook::Props
7
-
8
- partial "pb_button/button"
9
-
5
+ class Button < Playbook::KitBase
10
6
  prop :disabled, type: Playbook::Props::Boolean,
11
7
  default: false
12
8
  prop :full_width, type: Playbook::Props::Boolean,
@@ -3,5 +3,5 @@
3
3
  class: object.classname,
4
4
  data: object.data,
5
5
  id: object.id) do %>
6
- <%= !object.children.nil? ? capture(&object.children) : object.text %>
6
+ <%= content.presence || object.text %>
7
7
  <% end %>
@@ -2,11 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbButtonToolbar
5
- class ButtonToolbar
6
- include Playbook::Props
7
-
8
- partial "pb_button_toolbar/button_toolbar"
9
-
5
+ class ButtonToolbar < Playbook::KitBase
10
6
  prop :connected, type: Playbook::Props::Boolean, default: false
11
7
 
12
8
  prop :orientation, type: Playbook::Props::Enum,
@@ -3,5 +3,5 @@
3
3
  id: object.id,
4
4
  data: object.data,
5
5
  class: object.classname) do %>
6
- <%= object.children.present? ? capture(&object.children) : object.content %>
6
+ <%= content.presence || object.text %>
7
7
  <% end %>
@@ -2,11 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbCaption
5
- class Caption
6
- include Playbook::Props
7
-
8
- partial "pb_caption/caption"
9
-
5
+ class Caption < Playbook::KitBase
10
6
  prop :size, type: Playbook::Props::Enum,
11
7
  values: %w[xs sm md base lg xl],
12
8
  default: "md"
@@ -4,7 +4,7 @@
4
4
  class: object.classname,
5
5
  aria: object.aria,
6
6
  dark: object.dark) do %>
7
- <% if object.children %>
8
- <%= pb_rails("card/card_body", props: { padding: object.body_padding, children: object.children }) %>
9
- <% end %>
7
+ <%= pb_rails("card/card_body", props: { padding: object.body_padding }) do %>
8
+ <%= content %>
9
+ <% end if content.present? %>
10
10
  <% end %>
@@ -2,11 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbCard
5
- class Card
6
- include Playbook::Props
7
-
8
- partial "pb_card/card"
9
-
5
+ class Card < Playbook::KitBase
10
6
  prop :selected, type: Playbook::Props::Boolean, default: false
11
7
  prop :shadow, type: Playbook::Props::Enum,
12
8
  values: %w[none deep deeper deepest],
@@ -31,7 +27,7 @@ module Playbook
31
27
 
32
28
  def body_padding
33
29
  if padding.present?
34
- ""
30
+ ""
35
31
  else
36
32
  "p_md"
37
33
  end
@@ -39,7 +35,6 @@ module Playbook
39
35
 
40
36
  private
41
37
 
42
-
43
38
  def selected_class
44
39
  selected ? "selected" : "deselected"
45
40
  end