playbook_ui 2.7.2 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/playbook/application_controller.rb +2 -0
  3. data/app/controllers/playbook/guides_controller.rb +3 -0
  4. data/app/controllers/playbook/pages_controller.rb +21 -21
  5. data/app/helpers/playbook/application_helper.rb +2 -0
  6. data/app/helpers/playbook/layout_helper.rb +7 -5
  7. data/app/helpers/playbook/pb_doc_helper.rb +17 -15
  8. data/app/helpers/playbook/pb_kit_helper.rb +11 -9
  9. data/app/helpers/playbook/redcarpet_helper.rb +41 -44
  10. data/app/pb_kits/playbook/packs/application.js +6 -4
  11. data/app/pb_kits/playbook/packs/examples.js +62 -2
  12. data/app/pb_kits/playbook/packs/index.js +57 -0
  13. data/app/pb_kits/playbook/packs/kits.js +18 -0
  14. data/app/pb_kits/playbook/packs/pb_bar_graph.js +4 -0
  15. data/app/pb_kits/playbook/packs/pb_dashboard_value.js +4 -0
  16. data/app/pb_kits/playbook/packs/pb_date.js +4 -0
  17. data/app/pb_kits/playbook/packs/pb_icon.js +4 -0
  18. data/app/pb_kits/playbook/packs/pb_icon_circle.js +4 -0
  19. data/app/pb_kits/playbook/packs/pb_icon_value.js +4 -0
  20. data/app/pb_kits/playbook/packs/pb_label_value.js +4 -0
  21. data/app/pb_kits/playbook/packs/pb_line_graph.js +4 -0
  22. data/app/pb_kits/playbook/packs/pb_message.js +4 -0
  23. data/app/pb_kits/playbook/packs/pb_online_status.js +4 -0
  24. data/app/pb_kits/playbook/packs/pb_pill.js +4 -0
  25. data/app/pb_kits/playbook/packs/pb_progress_simple.js +4 -0
  26. data/app/pb_kits/playbook/packs/pb_star_rating.js +4 -0
  27. data/app/pb_kits/playbook/packs/pb_time.js +4 -0
  28. data/app/pb_kits/playbook/packs/pb_timestamp.js +4 -0
  29. data/app/pb_kits/playbook/packs/pb_title_count.js +4 -0
  30. data/app/pb_kits/playbook/packs/pb_title_detail.js +4 -0
  31. data/app/pb_kits/playbook/packs/pb_user.js +4 -0
  32. data/app/pb_kits/playbook/packs/pb_user_badge.js +4 -0
  33. data/app/pb_kits/playbook/packs/site_styles/_kit_style_index.scss +19 -1
  34. data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +1 -1
  35. data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +4 -4
  36. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +16 -3
  37. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +7 -7
  38. data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +2 -2
  39. data/app/pb_kits/playbook/pb_avatar/_avatar.html.erb +7 -3
  40. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +1 -1
  41. data/app/pb_kits/playbook/pb_avatar/_avatar.scss +73 -30
  42. data/app/pb_kits/playbook/pb_avatar/avatar.rb +39 -42
  43. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.html.erb +42 -5
  44. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.html.erb +32 -0
  45. data/app/pb_kits/playbook/pb_avatar/docs/example.yml +1 -0
  46. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.html.erb +19 -0
  47. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +21 -0
  48. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +3 -0
  49. data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +24 -0
  50. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +86 -0
  51. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +20 -0
  52. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +12 -0
  53. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +9 -0
  54. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
  55. data/app/pb_kits/playbook/pb_body/_body.html.erb +6 -4
  56. data/app/pb_kits/playbook/pb_body/_body.scss +11 -31
  57. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +53 -0
  58. data/app/pb_kits/playbook/pb_body/body.rb +61 -38
  59. data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +19 -3
  60. data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +21 -3
  61. data/app/pb_kits/playbook/pb_button/_button.html.erb +19 -8
  62. data/app/pb_kits/playbook/pb_button/_button.scss +23 -47
  63. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +116 -0
  64. data/app/pb_kits/playbook/pb_button/button.rb +95 -51
  65. data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -0
  66. data/app/pb_kits/playbook/pb_button/docs/_button_block_content.html.erb +4 -0
  67. data/app/pb_kits/playbook/pb_button/docs/_button_default.html.erb +4 -0
  68. data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.html.erb +4 -0
  69. data/app/pb_kits/playbook/pb_button/docs/_button_full_width.html.erb +1 -0
  70. data/app/pb_kits/playbook/pb_button/docs/_button_link.html.erb +3 -0
  71. data/app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb +3 -0
  72. data/app/pb_kits/playbook/pb_button/docs/example.yml +7 -3
  73. data/app/pb_kits/playbook/pb_caption/_caption.html.erb +5 -2
  74. data/app/pb_kits/playbook/pb_caption/_caption.scss +9 -1
  75. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +10 -13
  76. data/app/pb_kits/playbook/pb_caption/caption.rb +35 -40
  77. data/app/pb_kits/playbook/pb_card/_card.html.erb +3 -2
  78. data/app/pb_kits/playbook/pb_card/_card.scss +20 -1
  79. data/app/pb_kits/playbook/pb_card/card.rb +34 -9
  80. data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +1 -1
  81. data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +84 -0
  82. data/app/pb_kits/playbook/pb_dashboard/pbChartPlugin.js +120 -0
  83. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +162 -0
  84. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.html.erb +8 -0
  85. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +21 -0
  86. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.scss +10 -0
  87. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value_mixins.scss +12 -0
  88. data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_change.html.erb +6 -0
  89. data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_label.html.erb +6 -0
  90. data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_value.html.erb +10 -0
  91. data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_value.scss +7 -0
  92. data/app/pb_kits/playbook/pb_dashboard_value/dashboardValueSettings.js +47 -0
  93. data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +79 -0
  94. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_align.html.erb +23 -0
  95. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_change.html.erb +15 -0
  96. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.html.erb +21 -0
  97. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.jsx +12 -0
  98. data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_label.html.erb +19 -0
  99. data/app/pb_kits/playbook/pb_dashboard_value/docs/example.yml +11 -0
  100. data/app/pb_kits/playbook/pb_dashboard_value/docs/index.js +1 -0
  101. data/app/pb_kits/playbook/pb_dashboard_value/stat_change.rb +93 -0
  102. data/app/pb_kits/playbook/pb_dashboard_value/stat_label.rb +53 -0
  103. data/app/pb_kits/playbook/pb_dashboard_value/stat_value.rb +63 -0
  104. data/app/pb_kits/playbook/pb_date/_date.html.erb +6 -0
  105. data/app/pb_kits/playbook/pb_date/_date.jsx +21 -0
  106. data/app/pb_kits/playbook/pb_date/_date.scss +5 -0
  107. data/app/pb_kits/playbook/pb_date/date.rb +105 -0
  108. data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +10 -0
  109. data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +12 -0
  110. data/app/pb_kits/playbook/pb_date/docs/example.yml +9 -0
  111. data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
  112. data/app/pb_kits/playbook/pb_icon/_icon.html.erb +7 -0
  113. data/app/pb_kits/playbook/pb_icon/_icon.jsx +21 -0
  114. data/app/pb_kits/playbook/pb_icon/_icon.scss +3 -0
  115. data/app/pb_kits/playbook/pb_icon/docs/_icon_animate.html.erb +3 -0
  116. data/app/pb_kits/playbook/pb_icon/docs/_icon_border.html.erb +1 -0
  117. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.html.erb +1 -0
  118. data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +12 -0
  119. data/app/pb_kits/playbook/pb_icon/docs/_icon_default_dark.html.erb +1 -0
  120. data/app/pb_kits/playbook/pb_icon/docs/_icon_flip.html.erb +3 -0
  121. data/app/pb_kits/playbook/pb_icon/docs/_icon_pull.html.erb +2 -0
  122. data/app/pb_kits/playbook/pb_icon/docs/_icon_rotate.html.erb +3 -0
  123. data/app/pb_kits/playbook/pb_icon/docs/_icon_sizes.html.erb +16 -0
  124. data/app/pb_kits/playbook/pb_icon/docs/example.yml +12 -0
  125. data/app/pb_kits/playbook/pb_icon/docs/index.js +1 -0
  126. data/app/pb_kits/playbook/pb_icon/icon.rb +160 -0
  127. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.html.erb +6 -0
  128. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +21 -0
  129. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +57 -0
  130. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.html.erb +35 -0
  131. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_default.html.erb +3 -0
  132. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_default.jsx +12 -0
  133. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_sizes.html.erb +24 -0
  134. data/app/pb_kits/playbook/pb_icon_circle/docs/example.yml +10 -0
  135. data/app/pb_kits/playbook/pb_icon_circle/docs/index.js +1 -0
  136. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +67 -0
  137. data/app/pb_kits/playbook/pb_icon_value/_icon_value.html.erb +6 -0
  138. data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +21 -0
  139. data/app/pb_kits/playbook/pb_icon_value/_icon_value.scss +30 -0
  140. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_align.html.erb +20 -0
  141. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_default.html.erb +18 -0
  142. data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_default.jsx +12 -0
  143. data/app/pb_kits/playbook/pb_icon_value/docs/example.yml +9 -0
  144. data/app/pb_kits/playbook/pb_icon_value/docs/index.js +1 -0
  145. data/app/pb_kits/playbook/pb_icon_value/icon_value.rb +78 -0
  146. data/app/pb_kits/playbook/pb_image/_image.html.erb +2 -1
  147. data/app/pb_kits/playbook/pb_image/image.rb +26 -20
  148. data/app/pb_kits/playbook/pb_input/input.rb +21 -16
  149. data/app/pb_kits/playbook/pb_kit/base.rb +74 -13
  150. data/app/pb_kits/playbook/pb_label_value/_label_value.html.erb +7 -0
  151. data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +21 -0
  152. data/app/pb_kits/playbook/pb_label_value/_label_value.scss +7 -0
  153. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_default.html.erb +21 -0
  154. data/app/pb_kits/playbook/pb_label_value/docs/_label_value_default.jsx +12 -0
  155. data/app/pb_kits/playbook/pb_label_value/docs/example.yml +9 -0
  156. data/app/pb_kits/playbook/pb_label_value/docs/index.js +1 -0
  157. data/app/pb_kits/playbook/pb_label_value/label_value.rb +56 -0
  158. data/app/pb_kits/playbook/pb_layout/_layout.scss +2 -2
  159. data/app/pb_kits/playbook/pb_layout/_layout_mixin.scss +6 -6
  160. data/app/pb_kits/playbook/pb_layout/body.rb +9 -7
  161. data/app/pb_kits/playbook/pb_layout/layout.rb +26 -42
  162. data/app/pb_kits/playbook/pb_layout/sidebar.rb +9 -7
  163. data/app/pb_kits/playbook/pb_line_graph/_line_graph.html.erb +19 -0
  164. data/{lib/generators/kit/templates/jsx.erb → app/pb_kits/playbook/pb_line_graph/_line_graph.jsx} +4 -4
  165. data/{components/SearchCollectionSelect/searchCollectionSelect.scss → app/pb_kits/playbook/pb_line_graph/_line_graph.scss} +0 -0
  166. data/app/pb_kits/playbook/pb_line_graph/docs/_rails.html.erb +21 -0
  167. data/app/pb_kits/playbook/pb_line_graph/docs/_react.html.erb +2 -0
  168. data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +5 -0
  169. data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +15 -0
  170. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +85 -0
  171. data/app/pb_kits/playbook/pb_list/_item.html.erb +1 -1
  172. data/app/pb_kits/playbook/pb_list/_list.scss +15 -78
  173. data/app/pb_kits/playbook/pb_list/_list_mixin.scss +91 -0
  174. data/app/pb_kits/playbook/pb_list/docs/_list_borderless.html.erb +6 -6
  175. data/app/pb_kits/playbook/pb_list/docs/_list_dark.html.erb +6 -6
  176. data/app/pb_kits/playbook/pb_list/docs/_list_dark_borderless.html.erb +6 -6
  177. data/app/pb_kits/playbook/pb_list/docs/_list_dark_lg.html.erb +6 -6
  178. data/app/pb_kits/playbook/pb_list/docs/_list_dark_ordered.html.erb +6 -6
  179. data/app/pb_kits/playbook/pb_list/docs/_list_dark_xpadding.html.erb +6 -6
  180. data/app/pb_kits/playbook/pb_list/docs/_list_default.html.erb +6 -6
  181. data/app/pb_kits/playbook/pb_list/docs/_list_lg.html.erb +6 -6
  182. data/app/pb_kits/playbook/pb_list/docs/_list_ordered.html.erb +6 -6
  183. data/app/pb_kits/playbook/pb_list/docs/_list_xpadding.html.erb +6 -6
  184. data/app/pb_kits/playbook/pb_list/item.rb +14 -16
  185. data/app/pb_kits/playbook/pb_list/list.rb +30 -29
  186. data/app/pb_kits/playbook/pb_message/_message.html.erb +11 -0
  187. data/app/pb_kits/playbook/pb_message/_message.jsx +21 -0
  188. data/app/pb_kits/playbook/pb_message/_message.scss +5 -0
  189. data/app/pb_kits/playbook/pb_message/_message_mixins.scss +24 -0
  190. data/app/pb_kits/playbook/pb_message/docs/_message_default.html.erb +63 -0
  191. data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +12 -0
  192. data/app/pb_kits/playbook/pb_message/docs/example.yml +9 -0
  193. data/app/pb_kits/playbook/pb_message/docs/index.js +1 -0
  194. data/app/pb_kits/playbook/pb_message/message.rb +89 -0
  195. data/app/pb_kits/playbook/pb_online_status/_online_status.html.erb +5 -0
  196. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +21 -0
  197. data/app/pb_kits/playbook/pb_online_status/_online_status.scss +20 -0
  198. data/app/pb_kits/playbook/pb_online_status/_online_status_mixins.scss +35 -0
  199. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.html.erb +9 -0
  200. data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.jsx +12 -0
  201. data/app/pb_kits/playbook/pb_online_status/docs/example.yml +9 -0
  202. data/app/pb_kits/playbook/pb_online_status/docs/index.js +1 -0
  203. data/app/pb_kits/playbook/pb_online_status/online_status.rb +48 -0
  204. data/app/pb_kits/playbook/pb_pill/_pill.html.erb +6 -0
  205. data/app/pb_kits/playbook/pb_pill/_pill.jsx +21 -0
  206. data/app/pb_kits/playbook/pb_pill/_pill.scss +24 -0
  207. data/app/pb_kits/playbook/pb_pill/docs/_pill_default.html.erb +38 -0
  208. data/app/pb_kits/playbook/pb_pill/docs/_pill_default.jsx +12 -0
  209. data/app/pb_kits/playbook/pb_pill/docs/example.yml +9 -0
  210. data/app/pb_kits/playbook/pb_pill/docs/index.js +1 -0
  211. data/app/pb_kits/playbook/pb_pill/pill.rb +62 -0
  212. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.html.erb +11 -0
  213. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +21 -0
  214. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +45 -0
  215. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_align.html.erb +5 -0
  216. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_default.html.erb +1 -0
  217. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_default.jsx +12 -0
  218. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_muted.html.erb +1 -0
  219. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_value.html.erb +5 -0
  220. data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_width.html.erb +1 -0
  221. data/app/pb_kits/playbook/pb_progress_simple/docs/example.yml +12 -0
  222. data/app/pb_kits/playbook/pb_progress_simple/docs/index.js +1 -0
  223. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.rb +100 -0
  224. data/app/pb_kits/playbook/pb_star_rating/_star_rating.html.erb +28 -0
  225. data/app/pb_kits/playbook/pb_star_rating/_star_rating.jsx +21 -0
  226. data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +60 -0
  227. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.html.erb +13 -0
  228. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +12 -0
  229. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.html.erb +1 -0
  230. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +9 -0
  231. data/app/pb_kits/playbook/pb_star_rating/docs/index.js +1 -0
  232. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +70 -0
  233. data/app/pb_kits/playbook/pb_table/_table.html.erb +1 -5
  234. data/app/pb_kits/playbook/pb_table/styles/_as-cards.scss +1 -1
  235. data/app/pb_kits/playbook/pb_table/styles/_content.scss +1 -1
  236. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +3 -3
  237. data/app/pb_kits/playbook/pb_table/styles/_hover.scss +7 -5
  238. data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +103 -100
  239. data/app/pb_kits/playbook/pb_table/styles/_reset.scss +1 -1
  240. data/app/pb_kits/playbook/pb_table/styles/_single-line.scss +1 -1
  241. data/app/pb_kits/playbook/pb_table/styles/_structure.scss +5 -3
  242. data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +5 -5
  243. data/app/pb_kits/playbook/pb_table/styles/_table-dark.scss +64 -58
  244. data/app/pb_kits/playbook/pb_table/styles/_variables.scss +3 -0
  245. data/app/pb_kits/playbook/pb_table/table.rb +50 -50
  246. data/app/pb_kits/playbook/pb_time/_time.html.erb +6 -0
  247. data/app/pb_kits/playbook/pb_time/_time.jsx +21 -0
  248. data/app/pb_kits/playbook/pb_time/_time.scss +25 -0
  249. data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +23 -0
  250. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +12 -0
  251. data/app/pb_kits/playbook/pb_time/docs/example.yml +9 -0
  252. data/app/pb_kits/playbook/pb_time/docs/index.js +1 -0
  253. data/app/pb_kits/playbook/pb_time/time.rb +135 -0
  254. data/app/pb_kits/playbook/pb_timestamp/_timestamp-mixins.scss +10 -0
  255. data/app/pb_kits/playbook/pb_timestamp/_timestamp.html.erb +6 -0
  256. data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +21 -0
  257. data/app/pb_kits/playbook/pb_timestamp/_timestamp.scss +5 -0
  258. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +1 -0
  259. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +12 -0
  260. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +9 -0
  261. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +1 -0
  262. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +50 -0
  263. data/app/pb_kits/playbook/pb_title/_title.html.erb +4 -1
  264. data/app/pb_kits/playbook/pb_title/_title.scss +12 -21
  265. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +18 -40
  266. data/app/pb_kits/playbook/pb_title/docs/_title_dark.html.erb +4 -0
  267. data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +4 -0
  268. data/app/pb_kits/playbook/pb_title/title.rb +39 -37
  269. data/app/pb_kits/playbook/pb_title_count/_title_count.html.erb +7 -0
  270. data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +21 -0
  271. data/app/pb_kits/playbook/pb_title_count/_title_count.scss +17 -0
  272. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align.html.erb +20 -0
  273. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.html.erb +20 -0
  274. data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.jsx +12 -0
  275. data/app/pb_kits/playbook/pb_title_count/docs/example.yml +9 -0
  276. data/app/pb_kits/playbook/pb_title_count/docs/index.js +1 -0
  277. data/app/pb_kits/playbook/pb_title_count/title_count.rb +88 -0
  278. data/app/pb_kits/playbook/pb_title_detail/_title_detail.html.erb +7 -0
  279. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +21 -0
  280. data/app/pb_kits/playbook/pb_title_detail/_title_detail.scss +14 -0
  281. data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.html.erb +16 -0
  282. data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.jsx +12 -0
  283. data/app/pb_kits/playbook/pb_title_detail/docs/example.yml +9 -0
  284. data/app/pb_kits/playbook/pb_title_detail/docs/index.js +1 -0
  285. data/app/pb_kits/playbook/pb_title_detail/title_detail.rb +70 -0
  286. data/app/pb_kits/playbook/pb_user/_user.html.erb +11 -0
  287. data/app/pb_kits/playbook/pb_user/_user.jsx +21 -0
  288. data/app/pb_kits/playbook/pb_user/_user.scss +51 -0
  289. data/app/pb_kits/playbook/pb_user/docs/_user_default.html.erb +41 -0
  290. data/app/pb_kits/playbook/pb_user/docs/_user_default.jsx +12 -0
  291. data/app/pb_kits/playbook/pb_user/docs/_user_size.html.erb +35 -0
  292. data/app/pb_kits/playbook/pb_user/docs/_user_text_only.html.erb +17 -0
  293. data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size.html.erb +33 -0
  294. data/app/pb_kits/playbook/pb_user/docs/example.yml +11 -0
  295. data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
  296. data/app/pb_kits/playbook/pb_user/user.rb +117 -0
  297. data/app/pb_kits/playbook/pb_user_badge/_user_badge.html.erb +8 -0
  298. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +21 -0
  299. data/app/pb_kits/playbook/pb_user_badge/_user_badge.scss +24 -0
  300. data/app/pb_kits/playbook/pb_user_badge/badges/_million-dollar.html.erb +88 -0
  301. data/app/pb_kits/playbook/pb_user_badge/badges/_veteran.html.erb +17 -0
  302. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_default.html.erb +11 -0
  303. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_default.jsx +12 -0
  304. data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_size.html.erb +18 -0
  305. data/app/pb_kits/playbook/pb_user_badge/docs/example.yml +9 -0
  306. data/app/pb_kits/playbook/pb_user_badge/docs/index.js +1 -0
  307. data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +62 -0
  308. data/app/pb_kits/playbook/pb_vertical_nav/_item.html.erb +4 -4
  309. data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.scss +10 -11
  310. data/app/pb_kits/playbook/pb_vertical_nav/docs/_block_nav.html.erb +5 -0
  311. data/app/pb_kits/playbook/pb_vertical_nav/docs/_default_nav.html.erb +3 -3
  312. data/app/pb_kits/playbook/pb_vertical_nav/docs/example.yml +1 -0
  313. data/app/pb_kits/playbook/pb_vertical_nav/item.rb +28 -29
  314. data/app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb +18 -13
  315. data/app/pb_kits/playbook/tokens/_border_radius.scss +33 -0
  316. data/app/pb_kits/playbook/tokens/_colors.scss +35 -248
  317. data/app/pb_kits/playbook/tokens/_line_height.scss +9 -0
  318. data/app/pb_kits/playbook/tokens/_opacity.scss +12 -0
  319. data/app/pb_kits/playbook/tokens/_positioning.scss +11 -0
  320. data/app/pb_kits/playbook/tokens/_shadows.scss +14 -5
  321. data/app/pb_kits/playbook/tokens/_spacing.scss +0 -1
  322. data/app/pb_kits/playbook/tokens/_transition.scss +1 -0
  323. data/app/pb_kits/playbook/tokens/{_typography.sass → _typography.scss} +25 -0
  324. data/app/views/layouts/playbook/_nav.html.slim +4 -1
  325. data/app/views/layouts/playbook/_sidebar.html.slim +1 -1
  326. data/app/views/layouts/playbook/application.html.slim +7 -3
  327. data/app/views/playbook/pages/kit_show.html.slim +1 -1
  328. data/app/views/playbook/pages/principals/_getting_started.html.md +22 -4
  329. data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +2 -1
  330. data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +2 -1
  331. data/lib/generators/kit/USAGE +2 -29
  332. data/lib/generators/kit/kit_generator.rb +78 -71
  333. data/lib/generators/kit/templates/kit_example_rails.erb.tt +1 -0
  334. data/lib/generators/kit/templates/kit_example_react.erb.tt +12 -0
  335. data/lib/generators/kit/templates/kit_example_yml.erb.tt +9 -0
  336. data/lib/generators/kit/templates/kit_html.erb.tt +6 -0
  337. data/lib/generators/kit/templates/kit_js.erb.tt +1 -0
  338. data/lib/generators/kit/templates/kit_jsx.erb.tt +21 -0
  339. data/lib/generators/kit/templates/kit_pack.erb.tt +4 -0
  340. data/lib/generators/kit/templates/kit_ruby.erb.tt +32 -0
  341. data/lib/generators/kit/templates/kit_scss.erb +3 -0
  342. data/lib/playbook.rb +2 -0
  343. data/lib/playbook/engine.rb +15 -14
  344. data/lib/playbook/version.rb +3 -1
  345. data/lib/tasks/db.rake +2 -0
  346. data/lib/tasks/playbook_tasks.rake +9 -7
  347. metadata +332 -227
  348. data/app/pb_kits/playbook/pb_button/_variations.json +0 -15
  349. data/app/pb_kits/playbook/pb_button/docs/_button_dark.html.erb +0 -3
  350. data/app/pb_kits/playbook/pb_button/docs/_button_light.html.erb +0 -3
  351. data/app/pb_kits/playbook/pb_button/docs/_button_sizes.html.erb +0 -3
  352. data/app/pb_kits/playbook/pb_caption/_caption_lg.scss +0 -5
  353. data/app/pb_kits/playbook/tokens/_border_radius.sass +0 -27
  354. data/components/Avatar/Avatar.jsx +0 -96
  355. data/components/Avatar/AvatarStory.jsx +0 -19
  356. data/components/Avatar/styles.scss +0 -54
  357. data/components/Avatar/styles.scss.flow +0 -14
  358. data/components/Badge/Badge.jsx +0 -40
  359. data/components/Badge/BadgeStory.jsx +0 -40
  360. data/components/Badge/badges.scss +0 -167
  361. data/components/Badge/labels.scss +0 -121
  362. data/components/Badge/styles.scss +0 -4
  363. data/components/Badge/styles.scss.flow +0 -38
  364. data/components/Banner/Banner.jsx +0 -54
  365. data/components/Banner/BannerStory.jsx +0 -22
  366. data/components/Banner/styles.scss +0 -75
  367. data/components/Banner/styles.scss.flow +0 -19
  368. data/components/Button/Button.jsx +0 -75
  369. data/components/Button/ButtonStory.jsx +0 -94
  370. data/components/Capping/CappingStory.jsx +0 -21
  371. data/components/Card/Card.jsx +0 -44
  372. data/components/Card/CardStory.jsx +0 -19
  373. data/components/CircleButton/CircleButton.jsx +0 -51
  374. data/components/CircleButton/CircleButtonStory.jsx +0 -25
  375. data/components/CircleButton/styles.scss +0 -33
  376. data/components/CircleButton/styles.scss.flow +0 -6
  377. data/components/CollapsibleCard/CollapsibleCard.jsx +0 -108
  378. data/components/CollapsibleCard/CollapsibleCardStory.jsx +0 -26
  379. data/components/Color/Color.jsx +0 -55
  380. data/components/Color/ColorStory.jsx +0 -16
  381. data/components/Color/styles.scss +0 -6
  382. data/components/Color/styles.scss.flow +0 -5
  383. data/components/ColorPickerInput/ColorPickerInput.jsx +0 -99
  384. data/components/ColorPickerInput/ColorPickerInputStory.jsx +0 -37
  385. data/components/ColorPickerInput/colorPickerInput.scss +0 -10
  386. data/components/ColorPickerInput/colorPickerInput.scss.flow +0 -6
  387. data/components/DOBInput/index.jsx +0 -35
  388. data/components/DOBInput/story.jsx +0 -20
  389. data/components/DOBInput/styles.scss +0 -11
  390. data/components/DOBInput/styles.scss.flow +0 -7
  391. data/components/DatePicker/DatePicker.jsx +0 -156
  392. data/components/DatePicker/DatePickerStory.jsx +0 -22
  393. data/components/DatePicker/styles.scss +0 -6
  394. data/components/DatePicker/styles.scss.flow +0 -5
  395. data/components/DateTimePicker/DateTimePicker.jsx +0 -109
  396. data/components/DateTimePicker/DateTimePickerStory.jsx +0 -31
  397. data/components/DateTimePicker/story-styles.scss +0 -3
  398. data/components/DateTimePicker/story-styles.scss.flow +0 -5
  399. data/components/DateTimePicker/styles.scss +0 -1
  400. data/components/DateTimePicker/styles.scss.flow +0 -5
  401. data/components/Errors/Errors.jsx +0 -38
  402. data/components/FileCard/FileCard.jsx +0 -183
  403. data/components/FileCard/FileCardStory.jsx +0 -62
  404. data/components/FileCard/styles.scss +0 -81
  405. data/components/FileCard/styles.scss.flow +0 -12
  406. data/components/Flip/Flip.jsx +0 -50
  407. data/components/Flip/FlipStory.jsx +0 -85
  408. data/components/Flip/styles.scss +0 -41
  409. data/components/Flip/styles.scss.flow +0 -11
  410. data/components/FlyoutPanel/FlyoutPanel.jsx +0 -34
  411. data/components/FlyoutPanel/FlyoutPanelStory.jsx +0 -36
  412. data/components/FlyoutPanel/flyout_panel.scss +0 -33
  413. data/components/FlyoutPanel/flyout_panel.scss.flow +0 -11
  414. data/components/Grade/Grade.jsx +0 -55
  415. data/components/Grade/GradeStory.jsx +0 -18
  416. data/components/Grade/grade.scss +0 -39
  417. data/components/Grade/grade.scss.flow +0 -6
  418. data/components/Highlight/Highlight.jsx +0 -39
  419. data/components/Highlight/HighlightStory.jsx +0 -22
  420. data/components/Highlight/styles.scss +0 -24
  421. data/components/Highlight/styles.scss.flow +0 -17
  422. data/components/Icon/Icon.jsx +0 -54
  423. data/components/Icon/IconButtonStory.jsx +0 -20
  424. data/components/Icon/IconStory.jsx +0 -25
  425. data/components/IconToggle/IconToggle.jsx +0 -56
  426. data/components/IconToggle/IconToggleStory.jsx +0 -24
  427. data/components/Milestones/MilestoneItem.jsx +0 -47
  428. data/components/Milestones/MilestoneItemStory.jsx +0 -25
  429. data/components/Milestones/Milestones.jsx +0 -51
  430. data/components/Milestones/MilestonesStory.jsx +0 -30
  431. data/components/Milestones/milestones.scss +0 -19
  432. data/components/Milestones/milestones.scss.flow +0 -7
  433. data/components/Milestones/milestones_item.scss +0 -157
  434. data/components/Milestones/milestones_item.scss.flow +0 -13
  435. data/components/Milestones/milestones_variables.scss +0 -11
  436. data/components/Modal/ModalStory.jsx +0 -29
  437. data/components/MonogramAvatar/MonogramAvatar.jsx +0 -91
  438. data/components/MonogramAvatar/MonogramAvatarStory.jsx +0 -21
  439. data/components/MonogramAvatar/monogram_avatar.scss +0 -54
  440. data/components/MonogramAvatar/monogram_avatar.scss.flow +0 -10
  441. data/components/Panel/Panel.jsx +0 -159
  442. data/components/Panel/PanelStory.jsx +0 -23
  443. data/components/Panel/panel.scss +0 -32
  444. data/components/Panel/panel.scss.flow +0 -12
  445. data/components/PanelGroup/PanelGroup.jsx +0 -121
  446. data/components/PanelGroup/PanelGroup.scss +0 -96
  447. data/components/PanelGroup/PanelGroup.scss.flow +0 -6
  448. data/components/PanelGroup/PanelGroupStory.jsx +0 -112
  449. data/components/SearchCollectionSelect/SearchCollectionSelect.jsx +0 -29
  450. data/components/SearchCollectionSelect/SearchCollectionSelectStory.jsx +0 -48
  451. data/components/SideModal/SideModalStory.jsx +0 -31
  452. data/components/Spinner/Spinner.jsx +0 -80
  453. data/components/Spinner/SpinnerStory.jsx +0 -21
  454. data/components/Spinner/spinner.scss +0 -6
  455. data/components/Spinner/spinner.scss.flow +0 -5
  456. data/components/StepMeter/StepMeter.jsx +0 -75
  457. data/components/StepMeter/StepMeterStory.jsx +0 -25
  458. data/components/StepMeter/step_meter.scss +0 -120
  459. data/components/StepMeter/step_meter.scss.flow +0 -9
  460. data/components/Survey/Survey.jsx +0 -190
  461. data/components/Survey/SurveyStory.jsx +0 -125
  462. data/components/Survey/survey.scss +0 -75
  463. data/components/Survey/survey.scss.flow +0 -11
  464. data/components/Tab/Tab.jsx +0 -70
  465. data/components/Tab/tab.scss +0 -25
  466. data/components/Tab/tab.scss.flow +0 -6
  467. data/components/TabList/TabList.jsx +0 -35
  468. data/components/TabList/TabListStory.jsx +0 -31
  469. data/components/TabList/tabList.scss +0 -5
  470. data/components/TabList/tabList.scss.flow +0 -5
  471. data/components/Text/Text.jsx +0 -53
  472. data/components/Text/TextStory.jsx +0 -23
  473. data/components/Text/styles.scss +0 -3
  474. data/components/Text/styles.scss.flow +0 -123
  475. data/components/Text/text.scss +0 -35
  476. data/components/TextInput/TextInput.jsx +0 -95
  477. data/components/TextInput/TextInputStory.jsx +0 -23
  478. data/components/TextInput/form-control.scss +0 -96
  479. data/components/TextInput/styles.scss +0 -3
  480. data/components/TextInput/styles.scss.flow +0 -7
  481. data/components/TimePicker/TimePicker.jsx +0 -218
  482. data/components/TimePicker/TimePickerStory.jsx +0 -22
  483. data/components/TimePicker/styles.scss +0 -1
  484. data/components/TimePicker/styles.scss.flow +0 -5
  485. data/components/ToggleButton/ToggleButton.jsx +0 -68
  486. data/components/ToggleButton/ToggleButtonStory.jsx +0 -46
  487. data/components/ToggleButton/toggleButton.scss +0 -70
  488. data/components/ToggleButton/toggleButton.scss.flow +0 -14
  489. data/components/UserStamp/UserStamp.jsx +0 -40
  490. data/components/UserStamp/UserStampStory.jsx +0 -22
  491. data/components/UserStamp/styles.scss +0 -6
  492. data/components/UserStamp/styles.scss.flow +0 -7
  493. data/components/Wip/Wip.jsx +0 -34
  494. data/components/index.js +0 -33
  495. data/components/types.js +0 -21
  496. data/lib/generators/kit/templates/html.erb +0 -3
  497. data/lib/generators/kit/templates/javascript.erb +0 -4
  498. data/lib/generators/kit/templates/logo.txt +0 -28
  499. data/lib/generators/kit/templates/ruby.erb +0 -48
  500. data/lib/generators/kit/templates/scss.erb +0 -0
  501. data/lib/generators/kit/templates/storyrails.erb +0 -2
  502. data/lib/generators/kit/templates/storyreact.erb +0 -2
  503. data/lib/generators/kit/templates/variations.erb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60709f84ef1ea598256ad339a79cd89bb8aee2132851164d0dcf3e2f8820363b
4
- data.tar.gz: 8bc1fca35b58428b9e5d63c7e28e3e23f70a802a4a61b95d0a89c9f8ae62015f
3
+ metadata.gz: 6d2653be2df48cac4415d63ee188fc15096bc4a448c10edafb7dc87a69157d14
4
+ data.tar.gz: 5f0558748209d96a3c2992a5795dcae02063d55e0b469630bb5741ce0809ab15
5
5
  SHA512:
6
- metadata.gz: b4287d30d524a651ace270617e492c6bffaf26e437142eff85c9ac04ea3de6e2cb0d7943fce2a70bcd6e310d0f83b5165917519a116958c6a3f6a0fc9c813168
7
- data.tar.gz: 3e80ffcdba468f594af4868c36829bef356f05b4d2ca898627b2d5070013e721ba023f1ec9d35626dd9d48fbb8257b17bb4588adfea612c1b6adc9c1abc4aa4f
6
+ metadata.gz: '06193bc8cb1d36f416961ab4e12576ccbe0b83803f78f1222a381bebf17e4c4f7c6855016f8dcb49c0a98efa570415ab69ff1993747f33adf73aef80c7675082'
7
+ data.tar.gz: 7edd74d3169482a18f78b80ab112fdde75cbf84f90c5ad25eb5833a27794d6d6450fa51adf6558b465715dd76adc1c2fadf4c60102e17ae13e2a7b8c6e34aafd
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Playbook
2
4
  class ApplicationController < ActionController::Base
3
5
  protect_from_forgery with: :exception
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_dependency "playbook/application_controller"
2
4
 
3
5
  module Playbook
4
6
  class GuidesController < ApplicationController
5
7
  def create_kit; end
8
+
6
9
  def use_nitro; end
7
10
  end
8
11
  end
@@ -1,26 +1,24 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_dependency "playbook/application_controller"
2
- require 'yaml'
4
+ require "yaml"
3
5
 
4
6
  module Playbook
5
7
  class PagesController < ApplicationController
6
- before_action :set_kit, only: [:kit_show_rails, :kit_show_react]
8
+ before_action :set_kit, only: %i[kit_show_rails kit_show_react]
7
9
 
10
+ def home; end
8
11
 
9
- def home
10
- end
12
+ def utilities; end
11
13
 
12
- def utilities
13
- end
14
-
15
- def tokens
16
- end
14
+ def tokens; end
17
15
 
18
16
  def kits
19
17
  params[:type] ||= "rails"
20
18
  @type = params[:type]
21
19
  end
22
- def principles
23
- end
20
+
21
+ def principles; end
24
22
 
25
23
  def fullscreen
26
24
  render layout: "layouts/playbook/fullscreen"
@@ -31,20 +29,22 @@ module Playbook
31
29
  end
32
30
 
33
31
  def kit_show_rails
34
- render template: 'playbook/pages/kit_show'
32
+ render template: "playbook/pages/kit_show"
35
33
  end
34
+
36
35
  def kit_show_react
37
- render template: 'playbook/pages/kit_show'
36
+ render template: "playbook/pages/kit_show"
38
37
  end
39
38
 
40
- private
41
- def set_kit
42
- menu = MENU["kits"]
43
- unless menu.include?(params[:name])
44
- redirect_to root_path
45
- else
46
- @kit = params[:name]
47
- end
39
+ private
40
+
41
+ def set_kit
42
+ menu = MENU["kits"]
43
+ if menu.include?(params[:name])
44
+ @kit = params[:name]
45
+ else
46
+ redirect_to root_path
48
47
  end
48
+ end
49
49
  end
50
50
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "webpacker"
2
4
  require "webpacker/react/railtie" if defined?(Rails)
3
5
  require "webpacker/react/helpers"
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Playbook
2
- module LayoutHelper
3
- def layout(name, &block)
4
- Dir["../*"]
5
- end
4
+ module LayoutHelper
5
+ def layout(_name)
6
+ Dir["../*"]
6
7
  end
7
- end
8
+ end
9
+ end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Playbook
2
4
  module PbDocHelper
3
- def pb_title(title)
4
- return title.remove('pb_').titleize.tr("_", " ")
5
+ def pb_kit_title(title)
6
+ title.remove("pb_").titleize.tr("_", " ")
5
7
  end
6
8
 
7
9
  def has_kit_type?(kit, type)
@@ -16,7 +18,7 @@ module Playbook
16
18
  def pb_kit(kit: "", type: "rails")
17
19
  @type = type
18
20
  @kit_examples = get_kit_examples(kit, type)
19
- return render partial: "playbook/config/kit_example"
21
+ render partial: "playbook/config/kit_example"
20
22
  end
21
23
 
22
24
  def pb_kits(type: "rails")
@@ -25,25 +27,25 @@ module Playbook
25
27
  title = render_clickable_title(kit)
26
28
  ui = raw("<div class='pb--docItem-ui'>
27
29
  #{pb_kit(kit: kit, type: type)}</div>")
28
- display_kits << title+ui
30
+ display_kits << title + ui
29
31
  end
30
- return raw("<div class='pb--docItem'>"+display_kits.map {
31
- |k| k }.join("</div><div class='pb--docItem'>")+"</div>")
32
+ raw("<div class='pb--docItem'>" + display_kits.join("</div><div class='pb--docItem'>") + "</div>")
32
33
  end
33
34
 
34
35
  def pb_kit_api(kit)
35
36
  kit_class_obj = get_class_name(kit)
36
37
  @kit_api = kit_class_obj.instance_method(:initialize).parameters.map(&:last)
37
- return render partial: "playbook/config/pb_kit_api"
38
+ render partial: "playbook/config/pb_kit_api"
38
39
  end
39
40
 
40
41
  private
42
+
41
43
  def get_kit_examples(kit, type)
42
44
  example_file = File.join(Playbook::Engine.root,
43
- "app", "pb_kits", "playbook", "pb_#{kit}", "docs", "example.yml")
45
+ "app", "pb_kits", "playbook", "pb_#{kit}", "docs", "example.yml")
44
46
  if File.exist? example_file
45
47
  examples_list = YAML.load_file(example_file)
46
- examples_list = examples_list.inject({}){|item,(k,v)| item[k.to_sym] = v; item}
48
+ examples_list = examples_list.inject({}) { |item, (k, v)| item[k.to_sym] = v; item }
47
49
  all_kit_examples = {}
48
50
  all_kit_examples[:kit] = kit
49
51
  all_kit_examples[:examples] = examples_list[:examples][type]
@@ -54,15 +56,15 @@ module Playbook
54
56
  end
55
57
 
56
58
  def get_class_name(kit)
57
- folder = is_subkit?(kit) ? pb_camelize(kit.split('/')[0]) : pb_camelize(kit)
58
- item = is_subkit?(kit) ? pb_camelize(kit.split('/')[-1]) : pb_camelize(kit)
59
- return "Playbook::Pb#{folder}::#{item}".safe_constantize
59
+ folder = is_subkit?(kit) ? pb_camelize(kit.split("/")[0]) : pb_camelize(kit)
60
+ item = is_subkit?(kit) ? pb_camelize(kit.split("/")[-1]) : pb_camelize(kit)
61
+ "Playbook::Pb#{folder}::#{item}".safe_constantize
60
62
  end
61
63
 
62
64
  def render_clickable_title(kit)
63
- return render :inline => "<a href='#{kit_show_path(kit)}'>
64
- #{pb_rails(:title, props: { text: pb_title(kit),
65
- tag: 'h3', size: '2' })}</a>"
65
+ render inline: "<a href='#{kit_show_path(kit)}'>
66
+ #{pb_rails(:title, props: { text: pb_kit_title(kit),
67
+ tag: 'h3', size: '2' })}</a>"
66
68
  end
67
69
  end
68
70
  end
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "webpacker/react/railtie" if defined?(Rails)
2
4
  require "webpacker/react/helpers"
3
5
  require "webpacker/react/component"
4
6
 
5
7
  module Playbook
6
8
  module PbKitHelper
7
- def pb_rails(kit, props:{}, &block)
9
+ def pb_rails(kit, props: {}, &block)
8
10
  render_rails(kit, props, &block)
9
11
  end
10
12
 
11
- def pb_react(kit, props:{}, options:{})
13
+ def pb_react(kit, props: {}, options: {})
12
14
  render_react(kit, props, options)
13
15
  end
14
16
 
@@ -18,7 +20,7 @@ module Playbook
18
20
  props = defined?(props) && !props.nil? ? props : {}
19
21
  kit_class_obj = get_class_name(kit)
20
22
  original_value = ActionView::Base.prefix_partial_path_with_controller_namespace
21
-
23
+ ActionView::Base.prefix_partial_path_with_controller_namespace = true
22
24
  render(partial: kit_class_obj.new(**props, &block), as: :object)
23
25
  rescue ActionView::MissingTemplate
24
26
  ActionView::Base.prefix_partial_path_with_controller_namespace = false
@@ -31,21 +33,21 @@ module Playbook
31
33
  if defined?(props[:props]) && !props[:props].nil?
32
34
  props = props[:props] if props.keys[0] === :props
33
35
  end
34
- return ::Webpacker::React::Component.new(kit.camelize).render(props, options)
36
+ ::Webpacker::React::Component.new(kit.camelize).render(props, options)
35
37
  end
36
38
 
37
39
  def is_subkit?(kit)
38
- return kit.match(/[\/\\]/)
40
+ kit.match(%r{[/\\]})
39
41
  end
40
42
 
41
43
  def pb_camelize(string)
42
- return string.to_s.tr(" ", "_").camelize
44
+ string.to_s.tr(" ", "_").camelize
43
45
  end
44
46
 
45
47
  def get_class_name(kit)
46
- folder = is_subkit?(kit) ? pb_camelize(kit.split('/')[0]) : pb_camelize(kit)
47
- item = is_subkit?(kit) ? pb_camelize(kit.split('/')[-1]) : pb_camelize(kit)
48
- return "Playbook::Pb#{folder}::#{item}".safe_constantize
48
+ folder = is_subkit?(kit) ? pb_camelize(kit.split("/")[0]) : pb_camelize(kit)
49
+ item = is_subkit?(kit) ? pb_camelize(kit.split("/")[-1]) : pb_camelize(kit)
50
+ "Playbook::Pb#{folder}::#{item}".safe_constantize
49
51
  end
50
52
  end
51
53
  end
@@ -1,25 +1,26 @@
1
- require 'redcarpet'
2
- require 'rouge'
3
- require 'rouge/plugins/redcarpet'
4
- require 'action_view'
1
+ # frozen_string_literal: true
2
+
3
+ require "redcarpet"
4
+ require "rouge"
5
+ require "rouge/plugins/redcarpet"
6
+ require "action_view"
5
7
 
6
8
  module Playbook
7
9
  module RedcarpetHelper
8
-
9
10
  def markdown(text)
10
11
  options = {
11
- filter_html: false,
12
- hard_wrap: true,
13
- link_attributes: { rel: 'nofollow', target: "_blank" },
12
+ filter_html: false,
13
+ hard_wrap: true,
14
+ link_attributes: { rel: "nofollow", target: "_blank" },
14
15
  space_after_headers: true,
15
16
  fenced_code_blocks: true,
16
17
  no_styles: false,
17
- safe_links_only: true
18
+ safe_links_only: true,
18
19
  }
19
20
 
20
21
  extensions = {
21
- autolink: true,
22
- superscript: true,
22
+ autolink: true,
23
+ superscript: true,
23
24
  fenced_code_blocks: true,
24
25
  tables: true,
25
26
  disable_indented_code_blocks: false,
@@ -37,26 +38,26 @@ module Playbook
37
38
  end
38
39
 
39
40
  def rouge(text, language)
40
- formatter = Rouge::Formatters::HTML.new(css_class: 'highlight')
41
+ formatter = Rouge::Formatters::HTML.new(css_class: "highlight")
41
42
  lexer = Rouge::Lexer.find(language)
42
43
  formatter.format(lexer.lex(text))
43
44
  end
44
45
 
45
46
  def rouge_markdown(text)
46
47
  render_options = {
47
- filter_html: true,
48
- hard_wrap: true,
49
- link_attributes: { rel: 'nofollow' }
48
+ filter_html: true,
49
+ hard_wrap: true,
50
+ link_attributes: { rel: "nofollow" },
50
51
  }
51
52
  renderer = HTML.new(render_options)
52
53
 
53
54
  extensions = {
54
- autolink: true,
55
- fenced_code_blocks: true,
56
- lax_spacing: true,
57
- no_intra_emphasis: true,
58
- strikethrough: true,
59
- superscript: true
55
+ autolink: true,
56
+ fenced_code_blocks: true,
57
+ lax_spacing: true,
58
+ no_intra_emphasis: true,
59
+ strikethrough: true,
60
+ superscript: true,
60
61
  }
61
62
  markdown = Redcarpet::Markdown.new(renderer, extensions)
62
63
  markdown.render(text)
@@ -67,7 +68,6 @@ module Playbook
67
68
  include Rouge::Plugins::Redcarpet
68
69
  end
69
70
 
70
-
71
71
  class HTMLBlockCode < Redcarpet::Render::HTML
72
72
  include ActionView::Helpers::AssetTagHelper
73
73
  def header(title, level)
@@ -77,8 +77,9 @@ module Playbook
77
77
  if @headers.include?(permalink)
78
78
  permalink += "_1"
79
79
  loop do
80
- break if !@headers.include?(permalink)
81
- permalink.gsub!(/\_(\d+)$/, "_#{$1.to_i + 1}")
80
+ break unless @headers.include?(permalink)
81
+
82
+ permalink.gsub!(/\_(\d+)$/, "_#{Regexp.last_match(1).to_i + 1}")
82
83
  end
83
84
  end
84
85
  @headers << permalink
@@ -94,56 +95,52 @@ module Playbook
94
95
 
95
96
  def preprocess(full_document)
96
97
  full_document.gsub(/\[component (.*)\]/) do
97
- @string = $1
98
- @default_height = '160'
99
- @attr = ['', @default_height]
98
+ @string = Regexp.last_match(1)
99
+ @default_height = "160"
100
+ @attr = ["", @default_height]
100
101
 
101
102
  # Set src from attributes
102
103
  @string.gsub(/src="(.*?)"/) do
103
- @attr[0] = $1
104
+ @attr[0] = Regexp.last_match(1)
104
105
  end
105
106
 
106
107
  # Set height from attributes
107
108
  @string.gsub(/height="(.*?)"/) do
108
- if $1
109
- @attr[1] = $1
110
- else
111
- @attr[1] = @default_height
112
- end
109
+ @attr[1] = (Regexp.last_match(1) || @default_height)
113
110
  end
114
111
 
115
112
  %(\n<div class="uix-component-frame"><iframe scrolling="no" id="component-preview" src="#{@attr[0]}" width="100%" height="#{@attr[1]}"></iframe><a href="#{@attr[0]}" target="_blank" class="uix-component-link">View component</a></div>\n)
116
113
  end
117
114
  end
118
115
 
119
- def list(contents, list_type)
116
+ def list(contents, _list_type)
120
117
  @contents = contents
121
118
  @list_items = contents.split("\n")
122
119
 
123
- if @list_items[0].include? "[do]" or @list_items[0].include? "[dont]"
120
+ if @list_items[0].include?("[do]") || @list_items[0].include?("[dont]")
124
121
  @element_items = []
125
- @list_items.each do |item, index|
126
- item.gsub(/\<li>(.*)\<\/li>/) do
127
- @element_items.push($1);
122
+ @list_items.each do |item, _index|
123
+ item.gsub(%r{\<li>(.*)\</li>}) do
124
+ @element_items.push(Regexp.last_match(1))
128
125
  end
129
126
  end
130
127
 
131
128
  # Doing both because we could have either/both
132
129
  # clean up
133
- @dont_items, @trash_items_dont = @element_items.partition { |x, i| x.include? "[dont]" }
134
- @do_items, @trash_items_do = @element_items.partition { |x, i| x.include? "[do]" }
130
+ @dont_items, @trash_items_dont = @element_items.partition { |x, _i| x.include? "[dont]" }
131
+ @do_items, @trash_items_do = @element_items.partition { |x, _i| x.include? "[do]" }
135
132
 
136
133
  @do_list = []
137
- @do_items.each do |item, index|
134
+ @do_items.each do |item, _index|
138
135
  @do_list.push("<li>#{item.sub('[do] ', '')}</li>")
139
136
  end
140
- @do_list = "<ul class='uix-ruleset do-list'>#{@do_list.join("")}</ul>"
137
+ @do_list = "<ul class='uix-ruleset do-list'>#{@do_list.join('')}</ul>"
141
138
 
142
139
  @dont_list = []
143
- @dont_items.each do |item, index|
140
+ @dont_items.each do |item, _index|
144
141
  @dont_list.push("<li>#{item.sub('[dont] ', '')}</li>")
145
142
  end
146
- @dont_list = "<ul class='uix-ruleset dont-list'>#{@dont_list.join("")}</ul>"
143
+ @dont_list = "<ul class='uix-ruleset dont-list'>#{@dont_list.join('')}</ul>"
147
144
 
148
145
  "<div class='row uix-ruleset-block'><div class='col-sm-6'>#{@do_list}</div><div class='col-sm-6'>#{@dont_list}</div></div>"
149
146
  else
@@ -1,12 +1,14 @@
1
- import "../../../../fonts/fontawesome.js"
2
- import "../../../../fonts/regular.js"
1
+ import "../../../../fonts/fontawesome.js";
2
+ import "../../../../fonts/regular.js";
3
+ import "../pb_dashboard/pbChartPlugin.js";
3
4
  import "./main.scss";
4
5
  import "./kits.js";
5
6
 
6
- $(document).on('click', '[data-toggle]', function(e){
7
+ // Move to separate file
8
+ $(document).on("click", "[data-toggle]", function(e) {
7
9
  e.preventDefault();
8
10
  var kit_container = $(this).closest('.pb--doc');
9
11
  var toggle_target = $(this).data('toggle');
10
12
  $(kit_container).find('[data-action="toggle"]').hide();
11
13
  $(kit_container).find('[data-togglable="'+toggle_target+'"]').show();
12
- });
14
+ });
@@ -1,3 +1,9 @@
1
+ // ===========================================
2
+ // Generated file from kit generator.
3
+ //
4
+ // KIT EXAMPLES
5
+ // ===========================================
6
+
1
7
  import WebpackerReact from "webpacker-react";
2
8
 
3
9
  import * as body from "pb_body/docs";
@@ -31,7 +37,61 @@ import * as vertical_nav from "pb_vertical_nav/docs";
31
37
  WebpackerReact.setup (vertical_nav);
32
38
 
33
39
  import * as avatar from "pb_avatar/docs";
34
- WebpackerReact.setup (avatar);
40
+ WebpackerReact.setup (avatar);
35
41
 
36
42
  import * as input from "pb_input/docs";
37
- WebpackerReact.setup (input);
43
+ WebpackerReact.setup (input);
44
+
45
+ import * as BarGraph from "pb_bar_graph/docs";
46
+ WebpackerReact.setup (BarGraph);
47
+
48
+ import * as Icon from "pb_icon/docs";
49
+ WebpackerReact.setup (Icon);
50
+
51
+ import * as DashboardValue from "pb_dashboard_value/docs";
52
+ WebpackerReact.setup (DashboardValue);
53
+
54
+ import * as Time from "pb_time/docs";
55
+ WebpackerReact.setup (Time);
56
+
57
+ import * as Pill from "pb_pill/docs";
58
+ WebpackerReact.setup (Pill);
59
+
60
+ import * as UserBadge from "pb_user_badge/docs";
61
+ WebpackerReact.setup (UserBadge);
62
+
63
+ import * as Date from "pb_date/docs";
64
+ WebpackerReact.setup (Date);
65
+
66
+ import * as TitleDetail from "pb_title_detail/docs";
67
+ WebpackerReact.setup (TitleDetail);
68
+
69
+ import * as IconCircle from "pb_icon_circle/docs";
70
+ WebpackerReact.setup (IconCircle);
71
+
72
+ import * as IconValue from "pb_icon_value/docs";
73
+ WebpackerReact.setup (IconValue);
74
+
75
+ import * as StarRating from "pb_star_rating/docs";
76
+ WebpackerReact.setup (StarRating);
77
+
78
+ import * as ProgressSimple from "pb_progress_simple/docs";
79
+ WebpackerReact.setup (ProgressSimple);
80
+
81
+ import * as TitleCount from "pb_title_count/docs";
82
+ WebpackerReact.setup (TitleCount);
83
+
84
+ import * as User from "pb_user/docs";
85
+ WebpackerReact.setup (User);
86
+
87
+ import * as LabelValue from "pb_label_value/docs";
88
+ WebpackerReact.setup (LabelValue);
89
+
90
+ import * as Message from "pb_message/docs";
91
+ WebpackerReact.setup (Message);
92
+
93
+ import * as Timestamp from "pb_timestamp/docs";
94
+ WebpackerReact.setup (Timestamp);
95
+
96
+ import * as OnlineStatus from "pb_online_status/docs";
97
+ WebpackerReact.setup (OnlineStatus);