playbook_ui 4.15.0 → 4.18.0

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/README.md +0 -1
  3. data/app/pb_kits/playbook/_playbook.scss +7 -1
  4. data/app/pb_kits/playbook/data/menu.yml +5 -1
  5. data/app/pb_kits/playbook/index.js +5 -0
  6. data/app/pb_kits/playbook/packs/examples.js +8 -0
  7. data/app/pb_kits/playbook/packs/samples.js +2 -0
  8. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +1 -1
  9. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +24 -15
  10. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.jsx +45 -0
  11. data/app/pb_kits/playbook/pb_avatar/docs/example.yml +6 -5
  12. data/app/pb_kits/playbook/pb_avatar/docs/index.js +1 -0
  13. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.html.erb +33 -0
  14. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +81 -0
  15. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +63 -0
  16. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +44 -0
  17. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +15 -0
  18. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +19 -0
  19. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +8 -0
  20. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +13 -0
  21. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +15 -0
  22. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +14 -0
  23. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +27 -0
  24. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +29 -0
  25. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +11 -0
  26. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +16 -0
  27. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +4 -0
  28. data/app/pb_kits/playbook/pb_badge/_badge.jsx +20 -14
  29. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +9 -2
  30. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +5 -1
  31. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +2 -2
  32. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +2 -2
  33. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +26 -0
  34. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +36 -0
  35. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +14 -0
  36. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +23 -0
  37. data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +3 -1
  38. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +4 -0
  39. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +2 -0
  40. data/app/pb_kits/playbook/pb_body/_body.jsx +2 -1
  41. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +4 -0
  42. data/app/pb_kits/playbook/pb_button/_button.jsx +2 -1
  43. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +6 -0
  44. data/app/pb_kits/playbook/pb_caption/_caption.jsx +19 -17
  45. data/app/pb_kits/playbook/pb_card/_card.html.erb +1 -1
  46. data/app/pb_kits/playbook/pb_card/_card.jsx +35 -38
  47. data/app/pb_kits/playbook/pb_card/_card.scss +0 -10
  48. data/app/pb_kits/playbook/pb_card/card.rb +9 -3
  49. data/app/pb_kits/playbook/pb_card/card_body.rb +1 -5
  50. data/app/pb_kits/playbook/pb_card/card_header.rb +0 -3
  51. data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +2 -1
  52. data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +17 -18
  53. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.html.erb +1 -1
  54. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +10 -1
  55. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +3 -1
  56. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.html.erb +11 -0
  57. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.jsx +25 -0
  58. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +3 -1
  59. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
  60. data/app/pb_kits/playbook/pb_contact/_contact.html.erb +16 -3
  61. data/app/pb_kits/playbook/pb_contact/_contact.jsx +58 -34
  62. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -1
  63. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +1 -0
  64. data/app/pb_kits/playbook/pb_currency/_currency.html.erb +7 -9
  65. data/app/pb_kits/playbook/pb_currency/_currency.jsx +37 -21
  66. data/app/pb_kits/playbook/pb_currency/currency.rb +22 -29
  67. data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.html.erb +3 -3
  68. data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.jsx +2 -3
  69. data/app/pb_kits/playbook/pb_currency/docs/_currency_large.jsx +2 -3
  70. data/app/pb_kits/playbook/pb_currency/docs/_currency_medium.jsx +2 -2
  71. data/app/pb_kits/playbook/pb_currency/docs/_currency_small.html.erb +1 -1
  72. data/app/pb_kits/playbook/pb_currency/docs/_currency_small.jsx +5 -2
  73. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -2
  74. data/app/pb_kits/playbook/pb_date/_date.jsx +39 -15
  75. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +3 -1
  76. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +43 -37
  77. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default.jsx +2 -2
  78. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +6 -16
  79. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +21 -18
  80. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +30 -33
  81. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +10 -15
  82. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +8 -8
  83. data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +13 -23
  84. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +16 -14
  85. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +13 -12
  86. data/app/pb_kits/playbook/pb_flex/_flex.jsx +35 -20
  87. data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +6 -9
  88. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +14 -19
  89. data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +26 -22
  90. data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +13 -12
  91. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +85 -80
  92. data/app/pb_kits/playbook/pb_icon/_icon.jsx +54 -33
  93. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +13 -9
  94. data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +16 -20
  95. data/app/pb_kits/playbook/pb_image/_image.jsx +12 -10
  96. data/app/pb_kits/playbook/pb_label_pill/_label_pill.html.erb +1 -0
  97. data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +49 -14
  98. data/app/pb_kits/playbook/pb_label_pill/docs/_label_pill_default.jsx +50 -0
  99. data/app/pb_kits/playbook/pb_label_pill/docs/example.yml +4 -3
  100. data/app/pb_kits/playbook/pb_label_pill/docs/index.js +1 -0
  101. data/app/pb_kits/playbook/pb_label_pill/label_pill.rb +1 -1
  102. data/app/pb_kits/playbook/pb_label_value/_label_value.html.erb +1 -0
  103. data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +30 -18
  104. data/app/pb_kits/playbook/pb_layout/_layout.jsx +51 -45
  105. data/app/pb_kits/playbook/pb_layout/_layout.scss +76 -57
  106. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.html.erb +54 -0
  107. data/app/pb_kits/playbook/pb_layout/docs/_layout_collection.jsx +27 -0
  108. data/app/pb_kits/playbook/pb_layout/docs/example.yml +2 -0
  109. data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
  110. data/app/pb_kits/playbook/pb_layout/layout.rb +10 -2
  111. data/app/pb_kits/playbook/pb_legend/_legend.jsx +17 -15
  112. data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +9 -2
  113. data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +3 -1
  114. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +8 -8
  115. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +1 -1
  116. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +26 -0
  117. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +35 -0
  118. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +15 -0
  119. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +23 -0
  120. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +5 -1
  121. data/app/pb_kits/playbook/pb_line_graph/docs/index.js +2 -0
  122. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +6 -0
  123. data/app/pb_kits/playbook/pb_list/_list.jsx +24 -21
  124. data/app/pb_kits/playbook/pb_list/docs/_description.md +7 -1
  125. data/app/pb_kits/playbook/pb_list/docs/_list_layout_left.html.erb +8 -0
  126. data/app/pb_kits/playbook/pb_list/docs/_list_layout_right.html.erb +8 -0
  127. data/app/pb_kits/playbook/pb_list/docs/example.yml +2 -0
  128. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.jsx +21 -19
  129. data/app/pb_kits/playbook/pb_logistic/_logistic.html.erb +1 -0
  130. data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +26 -11
  131. data/app/pb_kits/playbook/pb_message/_message.html.erb +1 -0
  132. data/app/pb_kits/playbook/pb_message/_message.jsx +33 -11
  133. data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +1 -2
  134. data/app/pb_kits/playbook/pb_message/message.rb +1 -1
  135. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +10 -10
  136. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +7 -19
  137. data/app/pb_kits/playbook/pb_nav/_nav.jsx +17 -14
  138. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +5 -13
  139. data/app/pb_kits/playbook/pb_person/_person.html.erb +9 -2
  140. data/app/pb_kits/playbook/pb_person/_person.jsx +36 -18
  141. data/app/pb_kits/playbook/pb_person/docs/_person_default.html.erb +5 -1
  142. data/app/pb_kits/playbook/pb_person_contact/_person_contact.html.erb +1 -0
  143. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +73 -21
  144. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_wrong_numbers.jsx +32 -0
  145. data/app/pb_kits/playbook/pb_person_contact/docs/example.yml +2 -0
  146. data/app/pb_kits/playbook/pb_person_contact/docs/index.js +1 -0
  147. data/app/pb_kits/playbook/pb_pill/_pill.jsx +5 -10
  148. data/app/pb_kits/playbook/pb_popover/_popover.jsx +52 -41
  149. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.html.erb +1 -0
  150. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +41 -13
  151. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +15 -12
  152. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +17 -10
  153. data/app/pb_kits/playbook/pb_radio/_radio.jsx +3 -1
  154. data/app/pb_kits/playbook/pb_section_separator/_section_separator.html.erb +1 -0
  155. data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +30 -15
  156. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.jsx +3 -1
  157. data/app/pb_kits/playbook/pb_select/_select.jsx +4 -2
  158. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.jsx +12 -7
  159. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.html.erb +30 -0
  160. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.jsx +97 -0
  161. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss +74 -0
  162. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_checkmark.html.erb +29 -0
  163. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_checkmark.jsx +41 -0
  164. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_dark.html.erb +30 -0
  165. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_dark.jsx +40 -0
  166. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_default.html.erb +26 -0
  167. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_default.jsx +37 -0
  168. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_single_select.html.erb +27 -0
  169. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_single_select.jsx +40 -0
  170. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/example.yml +16 -0
  171. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/index.js +4 -0
  172. data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +50 -0
  173. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.html.erb +24 -0
  174. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.jsx +107 -0
  175. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.scss +85 -0
  176. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_dark.html.erb +26 -0
  177. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_dark.jsx +43 -0
  178. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.html.erb +23 -0
  179. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +40 -0
  180. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.html.erb +27 -0
  181. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +46 -0
  182. data/app/pb_kits/playbook/pb_selectable_icon/docs/example.yml +12 -0
  183. data/app/pb_kits/playbook/pb_selectable_icon/docs/index.js +3 -0
  184. data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +55 -0
  185. data/app/pb_kits/playbook/pb_source/_source.jsx +113 -13
  186. data/app/pb_kits/playbook/pb_source/docs/_source_default.html.erb +3 -1
  187. data/app/pb_kits/playbook/pb_source/docs/_source_default.jsx +37 -0
  188. data/app/pb_kits/playbook/pb_source/docs/_source_noicon.jsx +40 -0
  189. data/app/pb_kits/playbook/pb_source/docs/_source_types.jsx +85 -0
  190. data/app/pb_kits/playbook/pb_source/docs/example.yml +3 -0
  191. data/app/pb_kits/playbook/pb_source/docs/index.js +5 -0
  192. data/app/pb_kits/playbook/pb_star_rating/_star_rating.html.erb +6 -2
  193. data/app/pb_kits/playbook/pb_star_rating/_star_rating.jsx +98 -13
  194. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +28 -0
  195. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.jsx +13 -0
  196. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +2 -1
  197. data/app/pb_kits/playbook/pb_star_rating/docs/index.js +3 -0
  198. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +2 -1
  199. data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +14 -13
  200. data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +2 -1
  201. data/app/pb_kits/playbook/pb_table/_table.jsx +29 -28
  202. data/app/pb_kits/playbook/pb_table/_table.scss +1 -1
  203. data/app/pb_kits/playbook/pb_table/_table_row.jsx +6 -7
  204. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.html.erb +52 -8
  205. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.jsx +52 -8
  206. data/app/pb_kits/playbook/pb_table/docs/_table_side_highlight.md +3 -1
  207. data/app/pb_kits/playbook/pb_text_input/_text_input.html.erb +5 -3
  208. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +21 -5
  209. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +31 -5
  210. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +3 -0
  211. data/app/pb_kits/playbook/pb_text_input/text_input.rb +1 -1
  212. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +2 -1
  213. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +38 -18
  214. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +12 -11
  215. data/app/pb_kits/playbook/pb_timeline/_item.html.erb +28 -0
  216. data/app/pb_kits/playbook/pb_timeline/_item.jsx +54 -0
  217. data/app/pb_kits/playbook/pb_timeline/_timeline.html.erb +6 -0
  218. data/app/pb_kits/playbook/pb_timeline/_timeline.jsx +43 -0
  219. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +271 -0
  220. data/app/pb_kits/playbook/pb_timeline/docs/_description.md +3 -0
  221. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_default.html.erb +43 -0
  222. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_default.jsx +73 -0
  223. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.html.erb +43 -0
  224. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.jsx +73 -0
  225. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.html.erb +44 -0
  226. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.jsx +85 -0
  227. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +13 -0
  228. data/app/pb_kits/playbook/pb_timeline/docs/index.js +3 -0
  229. data/app/pb_kits/playbook/pb_timeline/item.rb +25 -0
  230. data/app/pb_kits/playbook/pb_timeline/timeline.rb +27 -0
  231. data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +7 -14
  232. data/app/pb_kits/playbook/pb_title/_title.jsx +12 -13
  233. data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +1 -1
  234. data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +49 -28
  235. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align.jsx +31 -0
  236. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.jsx +13 -2
  237. data/app/pb_kits/playbook/pb_title_count/docs/example.yml +4 -5
  238. data/app/pb_kits/playbook/pb_title_count/docs/index.js +1 -0
  239. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +7 -18
  240. data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +9 -11
  241. data/app/pb_kits/playbook/pb_user/_user.jsx +37 -37
  242. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +7 -7
  243. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +32 -30
  244. data/app/pb_kits/playbook/plugins/pb_chart.js +4 -0
  245. data/app/pb_kits/playbook/props.rb +48 -0
  246. data/app/pb_kits/playbook/tokens/_colors.scss +3 -3
  247. data/app/pb_kits/playbook/tokens/_spacing.scss +1 -0
  248. data/app/pb_kits/playbook/utilities/_spacing.scss +42 -0
  249. data/app/pb_kits/playbook/utilities/spacing.js +33 -0
  250. data/app/views/playbook/samples/dashboards/index.html.erb +3 -1
  251. data/app/views/playbook/samples/registration/index.html.erb +316 -0
  252. data/app/views/playbook/samples/registration/index.jsx +476 -0
  253. data/lib/playbook/version.rb +1 -1
  254. metadata +88 -4
@@ -3,17 +3,10 @@
3
3
 
4
4
  import React from 'react'
5
5
  import classnames from 'classnames'
6
+ import { spacing } from '../utilities/spacing.js'
7
+ import { Avatar, Badge } from '../'
6
8
 
7
- import {
8
- Avatar,
9
- Badge,
10
- } from '../'
11
-
12
- import {
13
- buildAriaProps,
14
- buildCss,
15
- buildDataProps,
16
- } from '../utilities/props'
9
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
17
10
 
18
11
  type MultipleUsersStackedProps = {
19
12
  className?: String,
@@ -23,13 +16,8 @@ type MultipleUsersStackedProps = {
23
16
  users: Array<Object>,
24
17
  }
25
18
 
26
- const MultipleUsersStacked = ({
27
- className,
28
- id,
29
- aria = {},
30
- data = {},
31
- users,
32
- }: MultipleUsersStackedProps) => {
19
+ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
20
+ const { className, id, aria = {}, data = {}, users } = props
33
21
  const moreThanTwo = users.length > 2
34
22
  const onlyOne = users.length == 1
35
23
  const displayCount = () => {
@@ -39,7 +27,7 @@ const MultipleUsersStacked = ({
39
27
  const dataProps = buildDataProps(data)
40
28
  const css = buildCss({
41
29
  'pb_multiple_users_stacked_kit': true,
42
- 'single': onlyOne,
30
+ single: onlyOne,
43
31
  })
44
32
 
45
33
  const firstUser = () => {
@@ -87,7 +75,7 @@ const MultipleUsersStacked = ({
87
75
  <div
88
76
  {...ariaProps}
89
77
  {...dataProps}
90
- className={classnames(css, className)}
78
+ className={classnames(css, className, spacing(props))}
91
79
  id={id}
92
80
  >
93
81
  {firstUser()}
@@ -1,34 +1,37 @@
1
1
  /* @flow */
2
2
 
3
3
  import React from 'react'
4
+ import classnames from 'classnames'
4
5
  import { Caption } from '../'
5
6
  import { buildCss } from '../utilities/props'
7
+ import { spacing } from '../utilities/spacing.js'
6
8
 
7
9
  type NavProps = {
8
10
  title: String,
9
- orientation?: 'vertical' | 'horizontal',
11
+ orientation?: "vertical" | "horizontal",
10
12
  link: String,
11
13
  children?: React.Node,
12
14
  className?: String | Array<String>,
13
15
  highlight?: Boolean,
14
- variant?: 'normal' | 'subtle',
16
+ variant?: "normal" | "subtle",
15
17
  onClick?: EventHandler,
16
18
  }
17
- const Nav = ({
18
- title = '',
19
- orientation = 'vertical',
20
- link = '',
21
- children,
22
- className,
23
- highlight = true,
24
- variant = 'normal',
25
- onClick = () => {},
26
- }: NavProps) => {
19
+ const Nav = (props: NavProps) => {
20
+ const {
21
+ title = '',
22
+ orientation = 'vertical',
23
+ link = '',
24
+ children,
25
+ className,
26
+ highlight = true,
27
+ variant = 'normal',
28
+ onClick = () => {},
29
+ } = props
27
30
  const cardCss = buildCss('pb_nav_list', variant, orientation, className, {
28
- 'highlight': highlight,
31
+ highlight: highlight,
29
32
  })
30
33
  return (
31
- <div className={cardCss}>
34
+ <div className={classnames(cardCss, spacing(props))}>
32
35
  <If condition={title}>
33
36
  <div className="pb_nav_list_title">
34
37
  <a
@@ -2,10 +2,9 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
+ import { spacing } from '../utilities/spacing.js'
5
6
 
6
- import {
7
- buildDataProps,
8
- } from '../utilities/props'
7
+ import { buildDataProps } from '../utilities/props'
9
8
 
10
9
  type OnlineStatusProps = {
11
10
  className?: String,
@@ -14,17 +13,10 @@ type OnlineStatusProps = {
14
13
  status?: "online" | "offline" | "away",
15
14
  }
16
15
 
17
- const OnlineStatus = ({
18
- id,
19
- data = {},
20
- className,
21
- status = 'offline',
22
- }: OnlineStatusProps) => {
16
+ const OnlineStatus = (props: OnlineStatusProps) => {
17
+ const { id, data = {}, className, status = 'offline' } = props
23
18
  const dataProps = buildDataProps(data)
24
- const css = classnames([
25
- `pb_online_status_kit_${status}`,
26
- className,
27
- ])
19
+ const css = classnames([`pb_online_status_kit_${status}`, className], spacing(props))
28
20
 
29
21
  return (
30
22
  <div
@@ -1,7 +1,14 @@
1
1
  <%= content_tag(:div,
2
+ aria: object.aria,
2
3
  id: object.id,
3
4
  data: object.data,
4
5
  class: object.classname) do %>
5
- <%= pb_rails("body", props: { tag: "span", classname: "pb_person_first", children: -> { object.first_name } }) %>
6
- <%= pb_rails("title", props: { text: object.last_name, size: 4 }) if object.last_name %>
6
+ <%= pb_rails("body", props: {
7
+ tag: "span",
8
+ classname: "pb_person_first",
9
+ children: -> { object.first_name
10
+ } }) %>
11
+ <%= pb_rails("title", props: {
12
+ text: object.last_name,
13
+ size: 4 }) if object.last_name %>
7
14
  <% end %>
@@ -2,40 +2,58 @@
2
2
 
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
+ import { spacing } from '../utilities/spacing.js'
5
6
 
6
7
  import {
7
- Body,
8
- Title,
9
- } from '../'
8
+ buildAriaProps,
9
+ buildCss,
10
+ buildDataProps,
11
+ } from '../utilities/props'
12
+
13
+ import { Body, Title } from '../'
10
14
 
11
15
  type PersonProps = {
16
+ aria?: object,
12
17
  className?: String | Array<String>,
13
- dark?: Boolean,
18
+ data?: object,
14
19
  firstName: String,
20
+ id?: String,
15
21
  lastName: String,
16
22
  }
17
23
 
18
- const Person = ({
19
- className,
20
- dark = false,
21
- firstName,
22
- lastName,
23
- }: PersonProps) => {
24
+ const Person = (props: PersonProps) => {
25
+ const {
26
+ aria = {},
27
+ className,
28
+ data = {},
29
+ firstName,
30
+ id,
31
+ lastName } = props
32
+
33
+ const ariaProps = buildAriaProps(aria)
34
+ const dataProps = buildDataProps(data)
35
+ const classes = classnames(buildCss('pb_person_kit'), className, spacing(props))
36
+
24
37
  return (
25
- <div className={classnames('pb_person_kit', className)}>
38
+ <div
39
+ {...ariaProps}
40
+ {...dataProps}
41
+ className={classes}
42
+ id={id}
43
+ >
26
44
  <Body
27
45
  className="pb_person_first"
28
- dark={dark}
29
46
  tag="span"
30
47
  >
31
48
  {firstName}
32
49
  </Body>
33
- <Title
34
- className="pb_person_first"
35
- dark={dark}
36
- size={4}
37
- text={` ${lastName}`}
38
- />
50
+ <If condition={lastName}>
51
+ <Title
52
+ className="pb_person_first"
53
+ size={4}
54
+ text={` ${lastName}`}
55
+ />
56
+ </If>
39
57
  </div>
40
58
  )
41
59
  }
@@ -1 +1,5 @@
1
- <%= pb_rails("person", props: { first_name: "Kyle", last_name: "Fadigan" }) %>
1
+ <%= pb_rails("person",
2
+ props: {
3
+ first_name: "Kyle",
4
+ last_name: "Fadigan"
5
+ }) %>
@@ -1,4 +1,5 @@
1
1
  <%= content_tag(:div,
2
+ aria: object.aria,
2
3
  id: object.id,
3
4
  data: object.data,
4
5
  class: object.classname) do %>
@@ -3,7 +3,15 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
 
6
- import { Contact, Person } from '../'
6
+ import {
7
+ buildAriaProps,
8
+ buildCss,
9
+ buildDataProps,
10
+ } from '../utilities/props'
11
+
12
+ import { spacing } from '../utilities/spacing.js'
13
+
14
+ import { Caption, Contact, Person } from '../'
7
15
 
8
16
  type ContactItem = {
9
17
  contactType: String,
@@ -12,33 +20,77 @@ type ContactItem = {
12
20
  }
13
21
 
14
22
  type PersonContactProps = {
23
+ aria?: object,
15
24
  className?: String | Array<String>,
16
25
  dark?: Boolean,
26
+ data?: object,
17
27
  firstName: String,
28
+ id?: String,
18
29
  lastName: String,
19
30
  contacts?: Array<ContactItem>,
20
31
  }
21
32
 
22
- const PersonContact = ({
23
- className,
24
- firstName,
25
- lastName,
26
- contacts,
27
- }: PersonContactProps) => (
28
- <div className={classnames('pb_person_contact_kit', className)}>
29
- <Person
30
- firstName={firstName}
31
- lastName={lastName}
32
- />
33
- {contacts.map((contactObject, index) => (
34
- <Contact
35
- contactDetail={contactObject.contactDetail}
36
- contactType={contactObject.contactType}
37
- contactValue={contactObject.contactValue}
38
- key={index}
33
+ const PersonContact = (props: PersonContactProps) => {
34
+ const {
35
+ aria = {},
36
+ className,
37
+ contacts = [],
38
+ data = {},
39
+ firstName,
40
+ id,
41
+ lastName,
42
+ } = props
43
+
44
+ const ariaProps = buildAriaProps(aria)
45
+ const dataProps = buildDataProps(data)
46
+ const classes = classnames(buildCss('pb_person_contact_kit'), className, spacing(props))
47
+
48
+ const wrongContacts = () => (
49
+ contacts.filter((contactObject) => (
50
+ contactObject.contactType === 'wrong-phone'
51
+ ))
52
+ )
53
+
54
+ const validContacts = () => (
55
+ contacts.filter((contactObject) => (
56
+ contactObject.contactType !== 'wrong-phone'
57
+ ))
58
+ )
59
+
60
+ return (
61
+ <div
62
+ {...ariaProps}
63
+ {...dataProps}
64
+ className={classes}
65
+ id={id}
66
+ >
67
+ <Person
68
+ firstName={firstName}
69
+ lastName={lastName}
39
70
  />
40
- ))}
41
- </div>
42
- )
71
+ {validContacts().map((contactObject, index) => (
72
+ <Contact
73
+ contactDetail={contactObject.contactDetail}
74
+ contactType={contactObject.contactType}
75
+ contactValue={contactObject.contactValue}
76
+ key={index}
77
+ />
78
+ ))}
79
+ {wrongContacts().map((contactObject, index) => (
80
+ <>
81
+ <Caption
82
+ className="wrong_numbers"
83
+ text="wrong number"
84
+ />
85
+ <Contact
86
+ contactType={contactObject.contactType}
87
+ contactValue={contactObject.contactValue}
88
+ key={index}
89
+ />
90
+ </>
91
+ ))}
92
+ </div>
93
+ )
94
+ }
43
95
 
44
96
  export default PersonContact
@@ -0,0 +1,32 @@
1
+ import React from 'react'
2
+ import { PersonContact } from '../../'
3
+
4
+ const PersonContactWithWrongNumbers = () => {
5
+ return (
6
+ <>
7
+ <PersonContact
8
+ contacts={[
9
+ {
10
+ contactType: 'email',
11
+ contactValue: 'email@example.com',
12
+ },
13
+ {
14
+ contactValue: '5555555555',
15
+ },
16
+ {
17
+ contactType: 'wrong-phone',
18
+ contactValue: '3245627482',
19
+ },
20
+ {
21
+ contactType: 'phone',
22
+ contactValue: '3048615385',
23
+ },
24
+ ]}
25
+ firstName="Pauline"
26
+ lastName="Smith"
27
+ />
28
+ </>
29
+ )
30
+ }
31
+
32
+ export default PersonContactWithWrongNumbers
@@ -10,3 +10,5 @@ examples:
10
10
  - person_contact_default: Default
11
11
  - person_contact_multiple: Multiple People
12
12
  - person_contact_with_detail: With Detail
13
+ - person_contact_with_wrong_numbers: With Wrong Numbers
14
+
@@ -1,3 +1,4 @@
1
1
  export { default as PersonContactDefault } from './_person_contact_default.jsx'
2
2
  export { default as PersonContactMultiple } from './_person_contact_multiple.jsx'
3
3
  export { default as PersonContactWithDetail } from './_person_contact_with_detail.jsx'
4
+ export { default as PersonContactWithWrongNumbers } from './_person_contact_with_wrong_numbers.jsx'
@@ -4,23 +4,18 @@ import React from 'react'
4
4
 
5
5
  import classnames from 'classnames'
6
6
  import Title from '../pb_title/_title.jsx'
7
+ import { spacing } from '../utilities/spacing.js'
7
8
 
8
9
  type PillProps = {
9
10
  className?: String,
10
11
  id?: String,
11
12
  text: String,
12
- variant?: 'success' | 'warning' | 'error' | 'info' | 'neutral',
13
+ variant?: "success" | "warning" | "error" | "info" | "neutral",
13
14
  }
14
15
 
15
- const Pill = ({
16
- className,
17
- text,
18
- variant = 'neutral',
19
- }: PillProps) => {
20
- const css = classnames([
21
- `pb_pill_kit_${variant}`,
22
- className,
23
- ])
16
+ const Pill = (props: PillProps) => {
17
+ const { className, text, variant = 'neutral' } = props
18
+ const css = classnames([`pb_pill_kit_${variant}`, className], spacing(props))
24
19
 
25
20
  return (
26
21
  <div className={css}>
@@ -10,16 +10,16 @@ import {
10
10
  Reference as PopperReference,
11
11
  } from 'react-popper'
12
12
 
13
- import {
14
- buildCss,
15
- noop,
16
- } from '../utilities/props'
13
+ import { buildCss, noop } from '../utilities/props'
14
+
15
+ import classnames from 'classnames'
16
+ import { spacing } from '../utilities/spacing.js'
17
17
 
18
18
  import { Card } from '../'
19
19
 
20
20
  type PbPopoverProps = {
21
21
  className?: String,
22
- closeOnClick?: 'outside' | 'inside',
22
+ closeOnClick?: "outside" | "inside",
23
23
  offset?: Boolean,
24
24
  reference: PopperReference,
25
25
  show?: Boolean,
@@ -30,7 +30,8 @@ type PbPopoverProps = {
30
30
  // https://popper.js.org/docs/v2/modifiers
31
31
 
32
32
  const POPOVER_MODIFIERS = {
33
- offset: { //https://popper.js.org/docs/v2/modifiers/offset/
33
+ offset: {
34
+ //https://popper.js.org/docs/v2/modifiers/offset/
34
35
  enabled: true,
35
36
  name: 'offset',
36
37
  options: {
@@ -44,38 +45,47 @@ const popoverModifiers = ({ modifiers, offset }) => {
44
45
  return offset ? modifiers.concat([POPOVER_MODIFIERS.offset]) : modifiers
45
46
  }
46
47
 
47
- const Popover = ({
48
- children,
49
- className,
50
- modifiers,
51
- offset,
52
- placement,
53
- referenceElement,
54
- }: PbPopoverProps) => (
55
- <Popper
56
- modifiers={popoverModifiers({ modifiers, offset })}
57
- placement={placement}
58
- referenceElement={referenceElement}
59
- >
60
- {({ placement, ref, style }) => {
61
- return (
62
- <div
63
- className={`${buildCss('pb_popover_kit')} ${className}`}
64
- data-placement={placement}
65
- ref={ref}
66
- style={style}
67
- >
68
- <div className={`${buildCss('popover_tooltip')} show`}>
69
- <Card shadow="deeper">
70
- { children }
71
- </Card>
48
+ const Popover = (props: PbPopoverProps) => {
49
+ const {
50
+ children,
51
+ className,
52
+ modifiers,
53
+ offset,
54
+ placement,
55
+ referenceElement,
56
+ } = props
57
+ return (
58
+ <Popper
59
+ modifiers={popoverModifiers({ modifiers, offset })}
60
+ placement={placement}
61
+ referenceElement={referenceElement}
62
+ >
63
+ {({ placement, ref, style }) => {
64
+ return (
65
+ <div
66
+ className={`${buildCss('pb_popover_kit')} ${className}`}
67
+ data-placement={placement}
68
+ ref={ref}
69
+ style={style}
70
+ >
71
+ <div
72
+ className={classnames(
73
+ `${buildCss('popover_tooltip')} show`
74
+ )}
75
+ >
76
+ <Card
77
+ className={spacing(props)}
78
+ shadow="deeper"
79
+ >
80
+ {children}
81
+ </Card>
82
+ </div>
72
83
  </div>
73
- </div>
74
84
  )
75
- }
76
- }
77
- </Popper>
78
- )
85
+ }}
86
+ </Popper>
87
+ )
88
+ }
79
89
 
80
90
  export default class PbReactPopover extends React.Component<PbPopoverProps> {
81
91
  static defaultProps = {
@@ -94,8 +104,10 @@ export default class PbReactPopover extends React.Component {
94
104
  if (!closeOnClick) return
95
105
 
96
106
  document.body.addEventListener('click', ({ target }) => {
97
- const targetIsPopover = target.closest('[class^=popover_tooltip]') !== null
98
- const targetIsReference = target.closest('.pb_popover_reference_wrapper') !== null
107
+ const targetIsPopover =
108
+ target.closest('[class^=popover_tooltip]') !== null
109
+ const targetIsReference =
110
+ target.closest('.pb_popover_reference_wrapper') !== null
99
111
 
100
112
  if (targetIsReference) return
101
113
 
@@ -135,6 +147,7 @@ export default class PbReactPopover extends React.Component {
135
147
 
136
148
  const popoverComponent = (
137
149
  <Popover
150
+ {...this.props}
138
151
  className={className}
139
152
  modifiers={modifiers}
140
153
  offset={offset}
@@ -154,9 +167,7 @@ export default class PbReactPopover extends React.Component {
154
167
  className="pb_popover_reference_wrapper"
155
168
  ref={ref}
156
169
  >
157
- <reference.type
158
- {...reference.props}
159
- />
170
+ <reference.type {...reference.props} />
160
171
  </span>
161
172
  )}
162
173
  </PopperReference>