playbook_ui 6.5.0 → 6.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (317) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -4
  3. data/app/controllers/playbook/application_controller.rb +3 -1
  4. data/app/controllers/playbook/pages_controller.rb +21 -1
  5. data/app/helpers/playbook/application_helper.rb +19 -0
  6. data/app/helpers/playbook/pb_kit_helper.rb +18 -2
  7. data/app/pb_kits/playbook/config/_kit_example.html.erb +3 -3
  8. data/app/pb_kits/playbook/config/_kit_ui.html.erb +2 -1
  9. data/app/pb_kits/playbook/config/_pb_kit_api.html.erb +10 -12
  10. data/app/pb_kits/playbook/index.js +1 -0
  11. data/app/pb_kits/playbook/packs/examples.js +2 -0
  12. data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +15 -4
  13. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +31 -72
  14. data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +0 -3
  15. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +8 -2
  16. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +8 -3
  17. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +6 -1
  18. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_monogram.jsx +6 -1
  19. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.jsx +5 -1
  20. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +3 -1
  21. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +2 -1
  22. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +2 -1
  23. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +5 -1
  24. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +1 -9
  25. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +0 -4
  26. data/app/pb_kits/playbook/pb_badge/docs/_badge_colors.jsx +19 -1
  27. data/app/pb_kits/playbook/pb_badge/docs/_badge_default.jsx +4 -1
  28. data/app/pb_kits/playbook/pb_badge/docs/_badge_rounded.jsx +4 -1
  29. data/app/pb_kits/playbook/pb_badge/docs/example.yml +1 -2
  30. data/app/pb_kits/playbook/pb_badge/docs/index.js +0 -1
  31. data/app/pb_kits/playbook/pb_body/docs/_body_block.jsx +2 -2
  32. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +6 -1
  33. data/app/pb_kits/playbook/pb_body/docs/example.yml +2 -4
  34. data/app/pb_kits/playbook/pb_body/docs/index.js +0 -1
  35. data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.jsx +2 -1
  36. data/app/pb_kits/playbook/pb_button/docs/_button_block_content.jsx +2 -1
  37. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +6 -2
  38. data/app/pb_kits/playbook/pb_button/docs/_button_full_width.jsx +2 -1
  39. data/app/pb_kits/playbook/pb_button/docs/_button_link.jsx +4 -1
  40. data/app/pb_kits/playbook/pb_button/docs/_button_loading.jsx +4 -1
  41. data/app/pb_kits/playbook/pb_button/docs/_button_options.jsx +2 -1
  42. data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
  43. data/app/pb_kits/playbook/pb_button/docs/index.js +0 -1
  44. data/app/pb_kits/playbook/pb_caption/docs/_caption_light.jsx +7 -2
  45. data/app/pb_kits/playbook/pb_caption/docs/example.yml +2 -6
  46. data/app/pb_kits/playbook/pb_caption/docs/index.js +0 -1
  47. data/app/pb_kits/playbook/pb_card/_card.scss +0 -3
  48. data/app/pb_kits/playbook/pb_card/docs/_card_border_none.jsx +7 -4
  49. data/app/pb_kits/playbook/pb_card/docs/_card_content.jsx +3 -3
  50. data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +39 -13
  51. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +13 -4
  52. data/app/pb_kits/playbook/pb_card/docs/_card_light.jsx +2 -2
  53. data/app/pb_kits/playbook/pb_card/docs/_card_padding.jsx +37 -7
  54. data/app/pb_kits/playbook/pb_card/docs/_card_selected.jsx +8 -3
  55. data/app/pb_kits/playbook/pb_card/docs/_card_separator.jsx +13 -4
  56. data/app/pb_kits/playbook/pb_card/docs/_card_shadow.jsx +25 -5
  57. data/app/pb_kits/playbook/pb_card/docs/example.yml +0 -2
  58. data/app/pb_kits/playbook/pb_card/docs/index.js +0 -1
  59. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_checked.jsx +2 -1
  60. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_custom.jsx +5 -2
  61. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default.jsx +2 -1
  62. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_error.jsx +2 -1
  63. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +0 -4
  64. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -2
  65. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_click.jsx +2 -1
  66. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_default.jsx +5 -1
  67. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.jsx +3 -1
  68. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +0 -2
  69. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +0 -1
  70. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +6 -1
  71. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +5 -1
  72. data/app/pb_kits/playbook/pb_currency/docs/_currency_large.jsx +4 -1
  73. data/app/pb_kits/playbook/pb_currency/docs/_currency_medium.jsx +4 -1
  74. data/app/pb_kits/playbook/pb_currency/docs/_currency_small.jsx +4 -1
  75. data/app/pb_kits/playbook/pb_currency/docs/example.yml +1 -2
  76. data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
  77. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_align.jsx +4 -1
  78. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.jsx +4 -1
  79. data/app/pb_kits/playbook/pb_date/date.rb +2 -1
  80. data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +8 -1
  81. data/app/pb_kits/playbook/pb_date/docs/_date_timezone.html.erb +51 -0
  82. data/app/pb_kits/playbook/pb_date/docs/_date_timezone.md +6 -0
  83. data/app/pb_kits/playbook/pb_date/docs/_description.md +2 -0
  84. data/app/pb_kits/playbook/pb_date/docs/example.yml +1 -0
  85. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +6 -3
  86. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -4
  87. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -3
  88. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +4 -10
  89. data/app/pb_kits/playbook/pb_date_picker/docs/{_date_picker_read_only.html.erb → _date_picker_allow_input.html.erb} +1 -1
  90. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx +13 -0
  91. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md +1 -0
  92. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -2
  93. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -1
  94. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +1 -0
  95. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_default.jsx +5 -1
  96. data/app/pb_kits/playbook/pb_hashtag/docs/example.yml +0 -2
  97. data/app/pb_kits/playbook/pb_hashtag/docs/index.js +0 -1
  98. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +3 -1
  99. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified.jsx +2 -1
  100. data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +1 -3
  101. data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +0 -1
  102. data/app/pb_kits/playbook/pb_label_value/docs/example.yml +1 -7
  103. data/app/pb_kits/playbook/pb_label_value/docs/index.js +0 -4
  104. data/app/pb_kits/playbook/pb_legend/docs/example.yml +1 -5
  105. data/app/pb_kits/playbook/pb_legend/docs/index.js +0 -2
  106. data/app/pb_kits/playbook/pb_list/docs/example.yml +1 -11
  107. data/app/pb_kits/playbook/pb_list/docs/index.js +0 -6
  108. data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +1 -3
  109. data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +0 -1
  110. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +1 -2
  111. data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +0 -1
  112. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +1 -2
  113. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +0 -1
  114. data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +24 -0
  115. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +28 -0
  116. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.jsx +13 -4
  117. data/app/pb_kits/playbook/pb_online_status/docs/example.yml +1 -2
  118. data/app/pb_kits/playbook/pb_online_status/docs/index.js +0 -1
  119. data/app/pb_kits/playbook/pb_pill/docs/example.yml +1 -3
  120. data/app/pb_kits/playbook/pb_pill/docs/index.js +0 -1
  121. data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +1 -4
  122. data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +0 -2
  123. data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +0 -2
  124. data/app/pb_kits/playbook/pb_progress_step/docs/index.js +0 -1
  125. data/app/pb_kits/playbook/pb_radio/docs/example.yml +0 -4
  126. data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -3
  127. data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +1 -2
  128. data/app/pb_kits/playbook/pb_section_separator/docs/index.js +0 -1
  129. data/app/pb_kits/playbook/pb_select/docs/example.yml +1 -4
  130. data/app/pb_kits/playbook/pb_select/docs/index.js +0 -2
  131. data/app/pb_kits/playbook/pb_selectable_card/docs/example.yml +1 -2
  132. data/app/pb_kits/playbook/pb_selectable_card/docs/index.js +0 -1
  133. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/example.yml +1 -4
  134. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/index.js +0 -1
  135. data/app/pb_kits/playbook/pb_selectable_icon/docs/example.yml +1 -3
  136. data/app/pb_kits/playbook/pb_selectable_icon/docs/index.js +0 -1
  137. data/app/pb_kits/playbook/pb_table/docs/example.yml +1 -4
  138. data/app/pb_kits/playbook/pb_table/docs/index.js +0 -2
  139. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -8
  140. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -5
  141. data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -2
  142. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +1 -4
  143. data/app/pb_kits/playbook/pb_textarea/docs/index.js +0 -2
  144. data/app/pb_kits/playbook/pb_time/_time.html.erb +23 -17
  145. data/app/pb_kits/playbook/pb_time/_time.jsx +20 -11
  146. data/app/pb_kits/playbook/pb_time/_time.scss +16 -8
  147. data/app/pb_kits/playbook/pb_time/docs/_time_align.html.erb +18 -0
  148. data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +3 -3
  149. data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +47 -3
  150. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +33 -4
  151. data/app/pb_kits/playbook/pb_time/docs/_time_sizes.html.erb +11 -0
  152. data/app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx +19 -0
  153. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb +3 -1
  154. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +0 -7
  155. data/app/pb_kits/playbook/pb_time/docs/_time_timezone.html.erb +37 -0
  156. data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +12 -14
  157. data/app/pb_kits/playbook/pb_time/docs/example.yml +6 -3
  158. data/app/pb_kits/playbook/pb_time/docs/index.js +1 -1
  159. data/app/pb_kits/playbook/pb_time/time.rb +14 -2
  160. data/app/pb_kits/playbook/pb_time_range_inline/docs/example.yml +0 -3
  161. data/app/pb_kits/playbook/pb_time_range_inline/docs/index.js +0 -1
  162. data/app/pb_kits/playbook/pb_time_stacked/docs/example.yml +1 -3
  163. data/app/pb_kits/playbook/pb_time_stacked/docs/index.js +0 -1
  164. data/app/pb_kits/playbook/pb_title/docs/example.yml +1 -2
  165. data/app/pb_kits/playbook/pb_title/docs/index.js +0 -1
  166. data/app/pb_kits/playbook/pb_title_count/docs/example.yml +0 -4
  167. data/app/pb_kits/playbook/pb_title_count/docs/index.js +0 -2
  168. data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +60 -0
  169. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +20 -3
  170. data/app/pb_kits/playbook/pb_typeahead/components/Control.jsx +30 -0
  171. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.jsx +13 -0
  172. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.jsx +12 -0
  173. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +51 -0
  174. data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +34 -0
  175. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +13 -0
  176. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.jsx +13 -0
  177. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +22 -0
  178. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +29 -0
  179. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +84 -0
  180. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx +45 -0
  181. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +101 -0
  182. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx +27 -0
  183. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +8 -2
  184. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +4 -0
  185. data/app/pb_kits/playbook/pb_user/docs/example.yml +1 -4
  186. data/app/pb_kits/playbook/pb_user/docs/index.js +0 -3
  187. data/app/pb_kits/playbook/pb_user_badge/docs/example.yml +0 -5
  188. data/app/pb_kits/playbook/pb_user_badge/docs/index.js +0 -1
  189. data/app/pb_kits/playbook/pb_weekday_stacked/docs/example.yml +0 -3
  190. data/app/pb_kits/playbook/pb_weekday_stacked/docs/index.js +0 -1
  191. data/app/pb_kits/playbook/tokens/_colors.scss +1 -1
  192. data/app/pb_kits/playbook/tokens/_typography.scss +3 -3
  193. data/app/views/layouts/playbook/_nav.html.erb +31 -7
  194. data/app/views/layouts/playbook/_sidebar.html.erb +6 -7
  195. data/app/views/layouts/playbook/application.html.erb +26 -0
  196. data/app/views/playbook/pages/kit_show.html.erb +4 -4
  197. data/lib/playbook/version.rb +1 -2
  198. metadata +28 -123
  199. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions_dark.html.erb +0 -17
  200. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions_dark.jsx +0 -21
  201. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_dark.html.erb +0 -9
  202. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_dark.jsx +0 -14
  203. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click_dark.html.erb +0 -15
  204. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click_dark.jsx +0 -16
  205. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement_dark.html.erb +0 -31
  206. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement_dark.jsx +0 -33
  207. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip_dark.html.erb +0 -12
  208. data/app/pb_kits/playbook/pb_badge/docs/_badge_dark.html.erb +0 -124
  209. data/app/pb_kits/playbook/pb_badge/docs/_badge_dark.jsx +0 -160
  210. data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +0 -28
  211. data/app/pb_kits/playbook/pb_body/docs/_body_dark.jsx +0 -35
  212. data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.html.erb +0 -22
  213. data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.jsx +0 -31
  214. data/app/pb_kits/playbook/pb_caption/docs/_caption_dark.html.erb +0 -3
  215. data/app/pb_kits/playbook/pb_caption/docs/_caption_dark.jsx +0 -25
  216. data/app/pb_kits/playbook/pb_card/docs/_card_dark.html.erb +0 -3
  217. data/app/pb_kits/playbook/pb_card/docs/_card_dark.jsx +0 -12
  218. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_dark.html.erb +0 -4
  219. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_dark.jsx +0 -17
  220. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_dark_error.html.erb +0 -7
  221. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_dark_error.jsx +0 -18
  222. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_dark.html.erb +0 -29
  223. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_dark.jsx +0 -38
  224. data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.html.erb +0 -23
  225. data/app/pb_kits/playbook/pb_currency/docs/_currency_dark.jsx +0 -32
  226. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.jsx +0 -13
  227. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.md +0 -1
  228. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_dark.html.erb +0 -13
  229. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_dark.jsx +0 -41
  230. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_dark.html.erb +0 -12
  231. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_dark.jsx +0 -20
  232. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_dark.html.erb +0 -24
  233. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_dark.jsx +0 -35
  234. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_details_dark.html.erb +0 -43
  235. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_details_dark.jsx +0 -54
  236. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_details_examples_dark.html.erb +0 -80
  237. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_details_examples_dark.jsx +0 -101
  238. data/app/pb_kits/playbook/pb_legend/docs/_legend_dark.html.erb +0 -5
  239. data/app/pb_kits/playbook/pb_legend/docs/_legend_dark.jsx +0 -21
  240. data/app/pb_kits/playbook/pb_legend/docs/_legend_dark_prefix.html.erb +0 -1
  241. data/app/pb_kits/playbook/pb_legend/docs/_legend_dark_prefix.jsx +0 -15
  242. data/app/pb_kits/playbook/pb_list/docs/_list_dark.html.erb +0 -7
  243. data/app/pb_kits/playbook/pb_list/docs/_list_dark.jsx +0 -19
  244. data/app/pb_kits/playbook/pb_list/docs/_list_dark_borderless.html.erb +0 -7
  245. data/app/pb_kits/playbook/pb_list/docs/_list_dark_borderless.jsx +0 -22
  246. data/app/pb_kits/playbook/pb_list/docs/_list_dark_lg.html.erb +0 -7
  247. data/app/pb_kits/playbook/pb_list/docs/_list_dark_lg.jsx +0 -22
  248. data/app/pb_kits/playbook/pb_list/docs/_list_dark_ordered.html.erb +0 -7
  249. data/app/pb_kits/playbook/pb_list/docs/_list_dark_ordered.jsx +0 -22
  250. data/app/pb_kits/playbook/pb_list/docs/_list_dark_xpadding.html.erb +0 -7
  251. data/app/pb_kits/playbook/pb_list/docs/_list_dark_xpadding.jsx +0 -22
  252. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_dark.html.erb +0 -13
  253. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_dark.jsx +0 -20
  254. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_dark.html.erb +0 -41
  255. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_dark.jsx +0 -52
  256. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_dark.html.erb +0 -53
  257. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_dark.jsx +0 -62
  258. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_dark.html.erb +0 -9
  259. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_dark.jsx +0 -28
  260. data/app/pb_kits/playbook/pb_pill/docs/_pill_dark.html.erb +0 -52
  261. data/app/pb_kits/playbook/pb_pill/docs/_pill_dark.jsx +0 -69
  262. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_dark.html.erb +0 -1
  263. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_dark.jsx +0 -20
  264. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_status_dark.html.erb +0 -1
  265. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_status_dark.jsx +0 -19
  266. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_dark.html.erb +0 -34
  267. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_dark.jsx +0 -18
  268. data/app/pb_kits/playbook/pb_radio/docs/_radio_dark.html.erb +0 -25
  269. data/app/pb_kits/playbook/pb_radio/docs/_radio_dark.jsx +0 -33
  270. data/app/pb_kits/playbook/pb_radio/docs/_radio_dark_error.html.erb +0 -7
  271. data/app/pb_kits/playbook/pb_radio/docs/_radio_dark_error.jsx +0 -17
  272. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dark.html.erb +0 -1
  273. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dark.jsx +0 -14
  274. data/app/pb_kits/playbook/pb_select/docs/_select_dark.html.erb +0 -24
  275. data/app/pb_kits/playbook/pb_select/docs/_select_dark.jsx +0 -33
  276. data/app/pb_kits/playbook/pb_select/docs/_select_dark_error.html.erb +0 -25
  277. data/app/pb_kits/playbook/pb_select/docs/_select_dark_error.jsx +0 -39
  278. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_dark.html.erb +0 -45
  279. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_dark.jsx +0 -72
  280. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_dark.html.erb +0 -30
  281. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_dark.jsx +0 -40
  282. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_dark.html.erb +0 -26
  283. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_dark.jsx +0 -43
  284. data/app/pb_kits/playbook/pb_table/docs/_table_container_dark.html.erb +0 -34
  285. data/app/pb_kits/playbook/pb_table/docs/_table_container_dark.jsx +0 -47
  286. data/app/pb_kits/playbook/pb_table/docs/_table_dark.html.erb +0 -34
  287. data/app/pb_kits/playbook/pb_table/docs/_table_dark.jsx +0 -46
  288. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_dark.html.erb +0 -5
  289. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_dark.jsx +0 -78
  290. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_dark_error.html.erb +0 -14
  291. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_dark_error.jsx +0 -18
  292. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_dark.html.erb +0 -9
  293. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_dark.jsx +0 -34
  294. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_dark_error.html.erb +0 -6
  295. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_dark_error.jsx +0 -19
  296. data/app/pb_kits/playbook/pb_time/docs/_time_dark.jsx +0 -26
  297. data/app/pb_kits/playbook/pb_time_range_inline/docs/_time_range_inline_dark.html.erb +0 -72
  298. data/app/pb_kits/playbook/pb_time_range_inline/docs/_time_range_inline_dark.jsx +0 -81
  299. data/app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_dark.html.erb +0 -1
  300. data/app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_dark.jsx +0 -15
  301. data/app/pb_kits/playbook/pb_title/docs/_title_dark.html.erb +0 -8
  302. data/app/pb_kits/playbook/pb_title/docs/_title_dark.jsx +0 -35
  303. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align_dark.html.erb +0 -23
  304. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align_dark.jsx +0 -34
  305. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_dark.html.erb +0 -23
  306. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_dark.jsx +0 -34
  307. data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_dark.html.erb +0 -19
  308. data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_dark.jsx +0 -29
  309. data/app/pb_kits/playbook/pb_user/docs/_user_dark.html.erb +0 -42
  310. data/app/pb_kits/playbook/pb_user/docs/_user_dark.jsx +0 -55
  311. data/app/pb_kits/playbook/pb_user/docs/_user_text_only_dark.html.erb +0 -19
  312. data/app/pb_kits/playbook/pb_user/docs/_user_text_only_dark.jsx +0 -26
  313. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_dark.html.erb +0 -13
  314. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_dark.jsx +0 -27
  315. data/app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_dark.html.erb +0 -1
  316. data/app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_dark.jsx +0 -14
  317. data/app/views/layouts/playbook/application.html.slim +0 -22
@@ -1,5 +1,7 @@
1
1
  @import "../tokens/colors";
2
2
  @import "../tokens/border_radius";
3
+ @import "../tokens/spacing";
4
+ @import "../tokens/shadows";
3
5
 
4
6
  [class^=pb_typeahead_kit] {
5
7
  .pb_typeahead_wrapper {
@@ -17,8 +19,10 @@
17
19
  }
18
20
 
19
21
  [class^=pb_text_input_kit] {
20
- .text_input_wrapper > input:first-child {
21
- padding-right: $space_xl;
22
+ .text_input_wrapper {
23
+ & > input:first-child {
24
+ padding-right: $space_xl;
25
+ }
22
26
  }
23
27
  }
24
28
 
@@ -31,7 +35,7 @@
31
35
  }
32
36
  }
33
37
  }
34
-
38
+
35
39
  [class^=pb_list_kit] {
36
40
  max-height: 18em;
37
41
  overflow-y: auto;
@@ -86,4 +90,17 @@
86
90
  color: $text_dk_light;
87
91
  }
88
92
  }
93
+
94
+ &.react-select {
95
+ .text_input {
96
+ display: inherit;
97
+ padding: 3px 4px;
98
+ &_indicators {
99
+ max-width: 70px;
100
+ }
101
+ &_value_container {
102
+ flex-grow: 1;
103
+ }
104
+ }
105
+ }
89
106
  }
@@ -0,0 +1,30 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { components } from 'react-select'
5
+
6
+ import {
7
+ Flex,
8
+ TextInput,
9
+ } from '../..'
10
+
11
+ type Props = {
12
+ selectProps: any,
13
+ }
14
+
15
+ const TypeaheadControl = (props: Props) => (
16
+ <div className="pb_typeahead_wrapper">
17
+ <TextInput
18
+ label={props.selectProps.label}
19
+ >
20
+ <Flex>
21
+ <components.Control
22
+ className="text_input"
23
+ {...props}
24
+ />
25
+ </Flex>
26
+ </TextInput>
27
+ </div>
28
+ )
29
+
30
+ export default TypeaheadControl
@@ -0,0 +1,13 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { components } from 'react-select'
5
+
6
+ const IndicatorsContainer = (props: any) => (
7
+ <components.IndicatorsContainer
8
+ className="text_input_indicators"
9
+ {...props}
10
+ />
11
+ )
12
+
13
+ export default IndicatorsContainer
@@ -0,0 +1,12 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { components } from 'react-select'
5
+
6
+ const MenuList = (props: any) => (
7
+ <components.MenuList {...props}>
8
+ {props.children}
9
+ </components.MenuList>
10
+ )
11
+
12
+ export default MenuList
@@ -0,0 +1,51 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { components } from 'react-select'
5
+
6
+ import { FormPill } from '../../'
7
+
8
+ type Props = {
9
+ data: object,
10
+ multiValueTemplate: any,
11
+ removeProps: any,
12
+ selectProps: any,
13
+ }
14
+
15
+ const MultiValue = (props: Props) => {
16
+ const {
17
+ data,
18
+ removeProps,
19
+ selectProps,
20
+ } = props
21
+
22
+ const handleOnClick = () => {
23
+ if (selectProps.onMultiValueClick) selectProps.onMultiValueClick(data)
24
+ removeProps.onClick()
25
+ }
26
+ const { imageUrl, label } = data
27
+
28
+ return (
29
+ <components.MultiValueContainer
30
+ className="text_input_multivalue_container"
31
+ {...props}
32
+ >
33
+ <If condition={imageUrl}>
34
+ <FormPill
35
+ avatarUrl={imageUrl}
36
+ marginRight="xs"
37
+ name={label}
38
+ onClick={handleOnClick}
39
+ />
40
+ <Else />
41
+ <FormPill
42
+ marginRight="xs"
43
+ onClick={handleOnClick}
44
+ text={label}
45
+ />
46
+ </If>
47
+ </components.MultiValueContainer>
48
+ )
49
+ }
50
+
51
+ export default MultiValue
@@ -0,0 +1,34 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { components } from 'react-select'
5
+
6
+ import {
7
+ User,
8
+ } from '../../'
9
+
10
+ const Option = (props: any) => {
11
+ const {
12
+ imageUrl,
13
+ label,
14
+ } = props.data
15
+ return (
16
+ <components.Option {...props}>
17
+ <Choose>
18
+ <When condition={imageUrl}>
19
+ <User
20
+ align="left"
21
+ avatarUrl={imageUrl}
22
+ name={label}
23
+ orientation="horizontal"
24
+ />
25
+ </When>
26
+ <When condition={!imageUrl}>
27
+ {label}
28
+ </When>
29
+ </Choose>
30
+ </components.Option>
31
+ )
32
+ }
33
+
34
+ export default Option
@@ -0,0 +1,13 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { components } from 'react-select'
5
+
6
+ const Placeholder = (props: any) => (
7
+ <components.IndicatorsContainer
8
+ className="placeholder"
9
+ {...props}
10
+ />
11
+ )
12
+
13
+ export default Placeholder
@@ -0,0 +1,13 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { components } from 'react-select'
5
+
6
+ const ValueContainer = (props: Props) => (
7
+ <components.ValueContainer
8
+ className="text_input_value_container"
9
+ {...props}
10
+ />
11
+ )
12
+
13
+ export default ValueContainer
@@ -0,0 +1,22 @@
1
+ // @flow
2
+
3
+ import React from 'react'
4
+ import { Typeahead } from '../../'
5
+
6
+ const options = [
7
+ { label: 'Orange', value: '#FFA500' },
8
+ { label: 'Red', value: '#FF0000' },
9
+ { label: 'Green', value: '#00FF00' },
10
+ { label: 'Blue', value: '#0000FF' },
11
+ ]
12
+
13
+ const TypeaheadDefault = () => {
14
+ return (
15
+ <Typeahead
16
+ label="Colors"
17
+ options={options}
18
+ />
19
+ )
20
+ }
21
+
22
+ export default TypeaheadDefault
@@ -0,0 +1,29 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { Typeahead } from '../..'
5
+
6
+ const options = [
7
+ { label: 'Windows', value: '#FFA500' },
8
+ { label: 'Siding', value: '#FF0000' },
9
+ { label: 'Doors', value: '#00FF00' },
10
+ { label: 'Roofs', value: '#0000FF' },
11
+ ]
12
+
13
+ import TypeaheadWithPillsSummary from './_typeahead_with_pills_summary'
14
+
15
+ const TypeaheadWithPills = () => {
16
+ return (
17
+ <>
18
+ <TypeaheadWithPillsSummary />
19
+ <Typeahead
20
+ isMulti
21
+ label="Colors"
22
+ options={options}
23
+ placeholder=""
24
+ />
25
+ </>
26
+ )
27
+ }
28
+
29
+ export default TypeaheadWithPills
@@ -0,0 +1,84 @@
1
+ /* @flow */
2
+
3
+ import React, { useState } from 'react'
4
+
5
+ import {
6
+ Caption,
7
+ Typeahead,
8
+ User,
9
+ } from '../..'
10
+
11
+ /**
12
+ *
13
+ * @const filterResults
14
+ * @ignore
15
+ * @returns {[Object]} - a custom mapping of objects, minimally containing
16
+ * `value` and `label` among other possible fields
17
+ * @summary - for doc example purposes only
18
+ */
19
+
20
+ const filterResults = (results) =>
21
+ results.items.map((result) => {
22
+ return {
23
+ label: result.login,
24
+ value: result.id,
25
+ }
26
+ })
27
+
28
+ /**
29
+ *
30
+ * @const promiseOptions
31
+ * @ignore
32
+ * @returns {Promise} - fetch API data results from Typeahead input text
33
+ * @see - https://react-select.com/home#async
34
+ * @summary - for doc example purposes only
35
+ */
36
+
37
+ const promiseOptions = (inputValue) =>
38
+ new Promise((resolve) => {
39
+ if (inputValue) {
40
+ fetch(`https://api.github.com/search/users?q=${inputValue}`)
41
+ .then((response) => response.json())
42
+ .then((results) => resolve(filterResults(results)))
43
+ } else {
44
+ resolve([])
45
+ }
46
+ })
47
+
48
+ const TypeaheadWithPillsAsync = () => {
49
+ const [users, setUsers] = useState([])
50
+ const handleOnChange = (value) => setUsers(value)
51
+
52
+ return (
53
+ <>
54
+ <If condition={users && users.length > 0}>
55
+ <Caption
56
+ marginBottom="xs"
57
+ text="State (Users)"
58
+ />
59
+ <For
60
+ each="user"
61
+ of={users}
62
+ >
63
+ <User
64
+ align="left"
65
+ key={user.value}
66
+ marginBottom="md"
67
+ name={user.label}
68
+ orientation="horizontal"
69
+ />
70
+ </For>
71
+ </If>
72
+ <Typeahead
73
+ async
74
+ isMulti
75
+ label="Github Users"
76
+ loadOptions={promiseOptions}
77
+ onChange={handleOnChange}
78
+ placeholder="type the name of a Github user"
79
+ />
80
+ </>
81
+ )
82
+ }
83
+
84
+ export default TypeaheadWithPillsAsync
@@ -0,0 +1,45 @@
1
+ /* @flow */
2
+
3
+ import React from 'react'
4
+ import { Body, Flex, FlexItem, Icon } from '../..'
5
+
6
+ const TypeaheadWithPillsAsyncSummary = () => {
7
+ return (
8
+ <>
9
+ <Flex
10
+ marginBottom="lg"
11
+ vertical="center"
12
+ >
13
+ <FlexItem>
14
+ <Body
15
+ color="light"
16
+ >
17
+ <Icon
18
+ icon="info-circle"
19
+ marginRight="xs"
20
+ />
21
+ </Body>
22
+ </FlexItem>
23
+ <FlexItem>
24
+ <Body
25
+ color="light"
26
+ >
27
+ {'If the data field '}
28
+ <code>{'imageUrl'}</code>
29
+ {' is present, '}
30
+ <code>{'FormPill'}</code>
31
+ {' will receive that field as a prop and display the image. '}
32
+ <br />
33
+ {'Additionally, you can also leverage the callback prop: '}
34
+ <code>{'onMultiValueClick'}</code>
35
+ {' to perform custom work when a '}
36
+ <code>{'MultiValue'}</code>
37
+ {' item is clicked.'}
38
+ </Body>
39
+ </FlexItem>
40
+ </Flex>
41
+ </>
42
+ )
43
+ }
44
+
45
+ export default TypeaheadWithPillsAsyncSummary
@@ -0,0 +1,101 @@
1
+ /* @flow */
2
+
3
+ import React, { useState } from 'react'
4
+
5
+ import {
6
+ Caption,
7
+ Typeahead,
8
+ User,
9
+ } from '../..'
10
+
11
+ import TypeaheadWithPillsAsyncSummary from './_typeahead_with_pills_async_summary'
12
+
13
+ /**
14
+ *
15
+ * @const filterResults
16
+ * @ignore
17
+ * @returns {[Object]} - a custom mapping of objects, minimally containing
18
+ * `value` and `label` among other possible fields
19
+ * @summary - for doc example purposes only
20
+ */
21
+
22
+ const filterResults = (results) =>
23
+ results.items.map((result) => {
24
+ return {
25
+ imageUrl: result.avatar_url, //add the custom field
26
+ label: result.login,
27
+ value: result.id,
28
+ }
29
+ })
30
+
31
+ /**
32
+ *
33
+ * @const promiseOptions
34
+ * @ignore
35
+ * @returns {Promise} - fetch API data results from Typeahead input text
36
+ * @see - https://react-select.com/home#async
37
+ * @summary - for doc example purposes only
38
+ */
39
+
40
+ const promiseOptions = (inputValue) =>
41
+ new Promise((resolve) => {
42
+ if (inputValue) {
43
+ fetch(`https://api.github.com/search/users?q=${inputValue}`)
44
+ .then((response) => response.json())
45
+ .then((results) => resolve(filterResults(results)))
46
+ } else {
47
+ resolve([])
48
+ }
49
+ })
50
+
51
+ const TypeaheadWithPillsAsyncUsers = () => {
52
+ const [users, setUsers] = useState([])
53
+ const handleOnChange = (value) => setUsers(value)
54
+
55
+ /**
56
+ *
57
+ * @const handleOnMultiValueClick {function} - a custom callback for the MultiValue click
58
+ * @ignore
59
+ * @returns {null}
60
+ * @summary - for doc example purposes only
61
+ */
62
+ const handleOnMultiValueClick = (value) => {
63
+ alert(`You removed the user: "${value.label}"`)
64
+ }
65
+
66
+ return (
67
+ <>
68
+ <TypeaheadWithPillsAsyncSummary />
69
+ <If condition={users && users.length > 0}>
70
+ <Caption
71
+ marginBottom="xs"
72
+ text="State (Users)"
73
+ />
74
+ <For
75
+ each="user"
76
+ of={users}
77
+ >
78
+ <User
79
+ align="left"
80
+ avatarUrl={user.imageUrl}
81
+ key={user.value}
82
+ marginBottom="md"
83
+ name={user.label}
84
+ orientation="horizontal"
85
+ />
86
+ </For>
87
+ </If>
88
+ <Typeahead
89
+ async
90
+ isMulti
91
+ label="Github Users"
92
+ loadOptions={promiseOptions}
93
+ onChange={handleOnChange}
94
+ onMultiValueClick={handleOnMultiValueClick}
95
+ placeholder="type the name of a Github user"
96
+ />
97
+ </>
98
+ )
99
+ }
100
+
101
+ export default TypeaheadWithPillsAsyncUsers