playbook_ui 7.0.1.pre.alpha14 → 7.0.1.pre.alpha15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/playbook/application_controller.rb +0 -2
  3. data/app/pb_kits/playbook/_playbook.scss +1 -1
  4. data/app/pb_kits/playbook/data/menu.yml +5 -4
  5. data/app/pb_kits/playbook/index.js +4 -1
  6. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.html.erb +1 -12
  7. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +1 -1
  8. data/app/pb_kits/playbook/pb_body/body.rb +1 -1
  9. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +1 -0
  10. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +3 -3
  11. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss +82 -90
  12. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_dark.scss +57 -0
  13. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_mixins.scss +27 -0
  14. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.rb +4 -2
  15. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.html.erb +17 -7
  16. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.jsx +32 -9
  17. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.html.erb +18 -7
  18. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.jsx +37 -9
  19. data/app/pb_kits/playbook/pb_button_toolbar/docs/example.yml +3 -7
  20. data/app/pb_kits/playbook/pb_button_toolbar/docs/index.js +0 -2
  21. data/app/pb_kits/playbook/pb_caption/_caption.html.erb +7 -5
  22. data/app/pb_kits/playbook/pb_caption/docs/_caption_block.html.erb +11 -0
  23. data/app/pb_kits/playbook/pb_caption/docs/_caption_block.jsx +28 -0
  24. data/app/pb_kits/playbook/pb_caption/docs/example.yml +2 -0
  25. data/app/pb_kits/playbook/pb_caption/docs/index.js +1 -0
  26. data/app/pb_kits/playbook/pb_date_picker/_date_picker.html.erb +1 -2
  27. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +1 -3
  28. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -2
  29. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +34 -32
  30. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb +1 -2
  31. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx +1 -2
  32. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -0
  33. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.html.erb +4 -0
  34. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.jsx +4 -0
  35. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.html.erb +9 -9
  36. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.jsx +8 -8
  37. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.md +3 -1
  38. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.html.erb +1 -0
  39. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.jsx +1 -0
  40. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -4
  41. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -2
  42. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.html.erb +8 -14
  43. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +122 -39
  44. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +33 -2
  45. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +44 -9
  46. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default.html.erb +14 -1
  47. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default.jsx +45 -1
  48. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.html.erb +1 -8
  49. data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +7 -0
  50. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.html.erb +3 -2
  51. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +29 -15
  52. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +10 -0
  53. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.html.erb +21 -0
  54. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.jsx +38 -0
  55. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default.html.erb +2 -1
  56. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default.jsx +1 -2
  57. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +1 -1
  58. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx +1 -1
  59. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_dark.html.erb +1 -1
  60. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_dark.jsx +1 -1
  61. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  62. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  63. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +7 -1
  64. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +18 -0
  65. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +9 -6
  66. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
  67. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +3 -3
  68. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +3 -3
  69. data/app/pb_kits/playbook/pb_form/form_builder/checkbox_field.rb +7 -2
  70. data/app/pb_kits/playbook/pb_form/form_builder/date_picker_field.rb +1 -0
  71. data/app/pb_kits/playbook/pb_line_graph/_line_graph.html.erb +1 -13
  72. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -1
  73. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +7 -6
  74. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_wrong_numbers.jsx +1 -0
  75. data/app/pb_kits/playbook/pb_popover/_popover.scss +6 -4
  76. data/app/pb_kits/playbook/pb_popover/index.js +3 -1
  77. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +3 -0
  78. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +168 -33
  79. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.html.erb +3 -1
  80. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.jsx +10 -8
  81. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -1
  82. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +14 -16
  83. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +6 -3
  84. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.html.erb +17 -1
  85. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.jsx +17 -1
  86. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.jsx +10 -3
  87. data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +11 -1
  88. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +1 -1
  89. data/app/pb_kits/playbook/pb_table/docs/_table_action_middle.html.erb +34 -0
  90. data/app/pb_kits/playbook/pb_table/docs/_table_action_middle.jsx +68 -0
  91. data/app/pb_kits/playbook/pb_table/docs/_table_action_middle.md +2 -0
  92. data/app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.html.erb +61 -0
  93. data/app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.jsx +89 -0
  94. data/app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.md +1 -0
  95. data/app/pb_kits/playbook/pb_table/docs/_table_one_action.html.erb +34 -0
  96. data/app/pb_kits/playbook/pb_table/docs/_table_one_action.jsx +68 -0
  97. data/app/pb_kits/playbook/pb_table/docs/_table_one_action.md +2 -0
  98. data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.html.erb +43 -0
  99. data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.jsx +80 -0
  100. data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.md +1 -0
  101. data/app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.html.erb +34 -0
  102. data/app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.jsx +63 -0
  103. data/app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.md +1 -0
  104. data/app/pb_kits/playbook/pb_table/docs/example.yml +12 -0
  105. data/app/pb_kits/playbook/pb_table/docs/index.js +6 -0
  106. data/app/pb_kits/playbook/pb_time/_time.html.erb +17 -20
  107. data/app/pb_kits/playbook/pb_time/_time.jsx +40 -27
  108. data/app/pb_kits/playbook/pb_time/_time.scss +4 -24
  109. data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +4 -1
  110. data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +11 -11
  111. data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +13 -1
  112. data/app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx +4 -1
  113. data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +3 -1
  114. data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +7 -2
  115. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +5 -5
  116. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +4 -4
  117. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_options.html.erb +10 -0
  118. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +1 -0
  119. data/app/pb_kits/playbook/pb_toggle/toggle.rb +5 -2
  120. data/app/pb_kits/playbook/pb_typeahead/_typeahead.html.erb +24 -20
  121. data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +19 -1
  122. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +8 -1
  123. data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +21 -13
  124. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +1 -1
  125. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_context_dark.html.erb +1 -1
  126. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.html.erb +25 -0
  127. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +0 -3
  128. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.md +8 -0
  129. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.html.erb +30 -0
  130. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.md +11 -0
  131. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.html.erb +25 -0
  132. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +0 -3
  133. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.md +1 -0
  134. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +3 -0
  135. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +24 -1
  136. data/app/pb_kits/playbook/react_rails_kits.js +6 -0
  137. data/app/pb_kits/playbook/tokens/_colors.scss +22 -23
  138. data/app/pb_kits/playbook/tokens/_typography.scss +4 -4
  139. data/app/pb_kits/playbook/tokens/index.scss +11 -0
  140. data/app/pb_kits/playbook/vendor.js +8 -0
  141. data/lib/generators/kit/kit_generator.rb +1 -1
  142. data/lib/playbook/engine.rb +1 -0
  143. data/lib/playbook/version.rb +1 -1
  144. data/lib/tasks/changelog.rake +14 -0
  145. data/lib/tasks/pb_release.rake +14 -3
  146. metadata +35 -81
  147. data/app/controllers/playbook/guides_controller.rb +0 -11
  148. data/app/controllers/playbook/pages_controller.rb +0 -99
  149. data/app/controllers/playbook/samples_controller.rb +0 -40
  150. data/app/pb_kits/playbook/packs/application.js +0 -55
  151. data/app/pb_kits/playbook/packs/examples.js +0 -182
  152. data/app/pb_kits/playbook/packs/main.scss +0 -12
  153. data/app/pb_kits/playbook/packs/samples.js +0 -21
  154. data/app/pb_kits/playbook/packs/site_styles/_samples.scss +0 -72
  155. data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +0 -43
  156. data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +0 -146
  157. data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +0 -10
  158. data/app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss +0 -7
  159. data/app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss +0 -531
  160. data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +0 -92
  161. data/app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss +0 -15
  162. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +0 -148
  163. data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +0 -15
  164. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +0 -88
  165. data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +0 -72
  166. data/app/pb_kits/playbook/pb_background/_background.html.erb +0 -14
  167. data/app/pb_kits/playbook/pb_background/_background.jsx +0 -64
  168. data/app/pb_kits/playbook/pb_background/_background.scss +0 -15
  169. data/app/pb_kits/playbook/pb_background/background.rb +0 -36
  170. data/app/pb_kits/playbook/pb_background/docs/_background_default.html.erb +0 -41
  171. data/app/pb_kits/playbook/pb_background/docs/_background_default.jsx +0 -75
  172. data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -8
  173. data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
  174. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.html.erb +0 -11
  175. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.jsx +0 -29
  176. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.html.erb +0 -11
  177. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.jsx +0 -34
  178. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.html.erb +0 -4
  179. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx +0 -13
  180. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md +0 -1
  181. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.html.erb +0 -4
  182. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.jsx +0 -13
  183. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx +0 -45
  184. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx +0 -27
  185. data/app/views/layouts/playbook/_mobile_hamburger.html.erb +0 -2
  186. data/app/views/layouts/playbook/_nav.html.erb +0 -37
  187. data/app/views/layouts/playbook/_sidebar.html.erb +0 -51
  188. data/app/views/layouts/playbook/application.html.erb +0 -26
  189. data/app/views/layouts/playbook/fullscreen.html.slim +0 -10
  190. data/app/views/layouts/playbook/grid.html.slim +0 -10
  191. data/app/views/layouts/playbook/samples.html.erb +0 -19
  192. data/app/views/playbook/guides/create_kit.html.slim +0 -16
  193. data/app/views/playbook/guides/create_kit/_file_naming.html.md +0 -2
  194. data/app/views/playbook/guides/create_kit/_generator.html.md +0 -6
  195. data/app/views/playbook/guides/create_kit/_kit_examples.html.md +0 -2
  196. data/app/views/playbook/guides/create_kit/_kit_rails.html.md +0 -2
  197. data/app/views/playbook/guides/create_kit/_kit_react.html.md +0 -2
  198. data/app/views/playbook/guides/create_kit/_layout.html.md +0 -2
  199. data/app/views/playbook/guides/create_kit/_view_objects.html.md +0 -2
  200. data/app/views/playbook/guides/create_kit/_writing_sass.md +0 -10
  201. data/app/views/playbook/guides/use_nitro.html.slim +0 -6
  202. data/app/views/playbook/guides/use_nitro/_local.html.md +0 -2
  203. data/app/views/playbook/guides/use_nitro/_nitro_components.html.md +0 -2
  204. data/app/views/playbook/guides/use_nitro/_versions.html.md +0 -2
  205. data/app/views/playbook/pages/fullscreen.html.slim +0 -10
  206. data/app/views/playbook/pages/grid.html.slim +0 -2
  207. data/app/views/playbook/pages/home.html.slim +0 -4
  208. data/app/views/playbook/pages/kit_category_show.html.erb +0 -14
  209. data/app/views/playbook/pages/kit_show.html.erb +0 -33
  210. data/app/views/playbook/pages/kits.html.erb +0 -12
  211. data/app/views/playbook/pages/principals/_getting_started.html.md +0 -30
  212. data/app/views/playbook/pages/principles.html.slim +0 -3
  213. data/app/views/playbook/pages/tokens.html.slim +0 -15
  214. data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +0 -61
  215. data/app/views/playbook/pages/utilities.html.slim +0 -116
  216. data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +0 -15
  217. data/app/views/playbook/samples/collection_detail/index.html.erb +0 -169
  218. data/app/views/playbook/samples/collection_detail/index.jsx +0 -372
  219. data/app/views/playbook/samples/dashboards/index.html.erb +0 -81
  220. data/app/views/playbook/samples/dashboards/index.jsx +0 -130
  221. data/app/views/playbook/samples/filter_table/index.html.erb +0 -348
  222. data/app/views/playbook/samples/filter_table/index.jsx +0 -433
  223. data/app/views/playbook/samples/registration/index.html.erb +0 -316
  224. data/app/views/playbook/samples/registration/index.jsx +0 -476
  225. data/app/views/playbook/samples/sample_show.html.erb +0 -36
@@ -0,0 +1,11 @@
1
+ @import "animation-curves";
2
+ @import "border_radius";
3
+ @import "colors";
4
+ @import "line_height";
5
+ @import "opacity";
6
+ @import "positioning";
7
+ @import "screen_sizes";
8
+ @import "shadows";
9
+ @import "spacing";
10
+ @import "transition";
11
+ @import "typography";
@@ -18,6 +18,9 @@ PbPopover.start()
18
18
  import PbTooltip from './pb_tooltip'
19
19
  PbTooltip.start()
20
20
 
21
+ import PbFixedConfirmationToast from './pb_fixed_confirmation_toast'
22
+ PbFixedConfirmationToast.start()
23
+
21
24
  import PbTypeahead from './pb_typeahead'
22
25
  PbTypeahead.start()
23
26
 
@@ -25,3 +28,8 @@ import PbTable from './pb_table'
25
28
  PbTable.start()
26
29
 
27
30
  import 'flatpickr'
31
+
32
+ // React-Rendered Rails Kits =====
33
+ import WebpackerReact from 'webpacker-react'
34
+ import * as ReactRailsPBKits from './react_rails_kits.js'
35
+ WebpackerReact.setup({ ...ReactRailsPBKits })
@@ -74,7 +74,7 @@ class KitGenerator < Rails::Generators::NamedBase
74
74
  template "kit_js.erb", "#{full_kit_directory}/docs/index.js"
75
75
 
76
76
  # Import kit examples ===========================
77
- append_to_file("app/pb_kits/playbook/packs/examples.js") do
77
+ append_to_file("app/pb_kits/playbook/packs/react-examples.js") do
78
78
  "import * as #{@kit_name_pascal} from 'pb_#{@kit_name_underscore}/docs'\nWebpackerReact.setup(#{@kit_name_pascal})\n"
79
79
  end
80
80
  append_to_file("app/pb_kits/playbook/index.js") do
@@ -21,6 +21,7 @@ module Playbook
21
21
  initializer "playbook_ui.add_view_paths", after: :add_view_paths do |_app|
22
22
  ActiveSupport.on_load(:action_controller) do
23
23
  append_view_path "#{Gem.loaded_specs['playbook_ui'].full_gem_path}/app/pb_kits/playbook"
24
+ append_view_path "#{Gem.loaded_specs['playbook_ui'].full_gem_path}/app/pb_kits/playbook/config"
24
25
  end
25
26
  end
26
27
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Playbook
3
- VERSION = "7.0.1-alpha14"
3
+ VERSION = "7.0.1.pre.alpha15"
4
4
  end
@@ -0,0 +1,14 @@
1
+ require 'github_changelog_generator/task'
2
+
3
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
4
+ config.user = 'powerhome'
5
+ config.project = 'playbook'
6
+ config.since_tag = Playbook::VERSION
7
+ config.header = ''
8
+ config.issues = false
9
+ config.base = 'CHANGELOG.md'
10
+ config.enhancement_prefix = '**Kit Enhancements:**'
11
+ config.bug_prefix = '**Fixed Bugs:**'
12
+ config.max_issues = 75
13
+ config.configure_sections = {"New Kits":{"prefix":"**New Kits:**","labels":["new kit"]},"Improvements": {"prefix":"**Improvements:**","labels":["improvement"]},"Breaking": {"prefix":"**Breaking Changes:**","labels":["breaking"]}}
14
+ end
@@ -39,6 +39,9 @@ namespace :pb_release do
39
39
  puts "Updated Gemfile.lock"
40
40
  puts "\n\n"
41
41
 
42
+ puts "\nCreating dist files"
43
+ `yarn release`
44
+
42
45
  puts "Commit your changes and create a PR to merge to master"
43
46
  end
44
47
  end
@@ -56,11 +59,19 @@ namespace :pb_release do
56
59
  puts "\nPushing to RubyGems..."
57
60
  `gem push playbook_ui-#{version}.gem`
58
61
  puts "\nPushed to RubyGems. Now lets clean up..."
59
- `rm -rf playbook_ui-#{version}.gem`
62
+ `rm -rf playbook_ui-*.gem`
60
63
 
61
64
  # NPM
62
- puts "\nPushing to NPM..."
63
- `npm publish`
65
+ puts "\nGenerating distribution files"
66
+ `docker-compose run web yarn release`
67
+ puts "\nOrganizing distribution files"
68
+ `rm dist/playbook-rails.css && mv dist/playbook-react.css dist/playbook.css`
69
+ puts "\nCreating NPM package..."
70
+ `npm pack`
71
+ puts "\nPublishing to NPM..."
72
+ `npm publish playbook-ui-#{version}.tgz`
73
+ puts "\nPublished to NPM. Now lets clean up..."
74
+ `rm -rf playbook-ui-*.tgz`
64
75
 
65
76
  # Tags
66
77
  puts "\nPushed to NPM. Now lets create a tag..."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1.pre.alpha14
4
+ version: 7.0.1.pre.alpha15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-10-07 00:00:00.000000000 Z
12
+ date: 2020-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -401,9 +401,6 @@ files:
401
401
  - app/assets/images/pb-check.svg
402
402
  - app/assets/images/pb.logo.svg
403
403
  - app/controllers/playbook/application_controller.rb
404
- - app/controllers/playbook/guides_controller.rb
405
- - app/controllers/playbook/pages_controller.rb
406
- - app/controllers/playbook/samples_controller.rb
407
404
  - app/helpers/playbook/application_helper.rb
408
405
  - app/helpers/playbook/layout_helper.rb
409
406
  - app/helpers/playbook/pb_doc_helper.rb
@@ -417,22 +414,6 @@ files:
417
414
  - app/pb_kits/playbook/config/_pb_kit_api.html.erb
418
415
  - app/pb_kits/playbook/data/menu.yml
419
416
  - app/pb_kits/playbook/index.js
420
- - app/pb_kits/playbook/packs/application.js
421
- - app/pb_kits/playbook/packs/examples.js
422
- - app/pb_kits/playbook/packs/main.scss
423
- - app/pb_kits/playbook/packs/samples.js
424
- - app/pb_kits/playbook/packs/site_styles/_samples.scss
425
- - app/pb_kits/playbook/packs/site_styles/_scaffold.scss
426
- - app/pb_kits/playbook/packs/site_styles/_site-style.scss
427
- - app/pb_kits/playbook/packs/site_styles/docs/_all.scss
428
- - app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss
429
- - app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss
430
- - app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss
431
- - app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss
432
- - app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss
433
- - app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss
434
- - app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss
435
- - app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss
436
417
  - app/pb_kits/playbook/pb_avatar/_avatar.html.erb
437
418
  - app/pb_kits/playbook/pb_avatar/_avatar.jsx
438
419
  - app/pb_kits/playbook/pb_avatar/_avatar.scss
@@ -464,14 +445,6 @@ files:
464
445
  - app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb
465
446
  - app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml
466
447
  - app/pb_kits/playbook/pb_avatar_action_button/docs/index.js
467
- - app/pb_kits/playbook/pb_background/_background.html.erb
468
- - app/pb_kits/playbook/pb_background/_background.jsx
469
- - app/pb_kits/playbook/pb_background/_background.scss
470
- - app/pb_kits/playbook/pb_background/background.rb
471
- - app/pb_kits/playbook/pb_background/docs/_background_default.html.erb
472
- - app/pb_kits/playbook/pb_background/docs/_background_default.jsx
473
- - app/pb_kits/playbook/pb_background/docs/example.yml
474
- - app/pb_kits/playbook/pb_background/docs/index.js
475
448
  - app/pb_kits/playbook/pb_badge/_badge.html.erb
476
449
  - app/pb_kits/playbook/pb_badge/_badge.jsx
477
450
  - app/pb_kits/playbook/pb_badge/_badge.scss
@@ -542,15 +515,13 @@ files:
542
515
  - app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.html.erb
543
516
  - app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx
544
517
  - app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss
518
+ - app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_dark.scss
519
+ - app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_mixins.scss
545
520
  - app/pb_kits/playbook/pb_button_toolbar/button_toolbar.rb
546
521
  - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.html.erb
547
522
  - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.jsx
548
523
  - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.html.erb
549
524
  - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.jsx
550
- - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.html.erb
551
- - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.jsx
552
- - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.html.erb
553
- - app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.jsx
554
525
  - app/pb_kits/playbook/pb_button_toolbar/docs/_description.md
555
526
  - app/pb_kits/playbook/pb_button_toolbar/docs/example.yml
556
527
  - app/pb_kits/playbook/pb_button_toolbar/docs/index.js
@@ -559,6 +530,8 @@ files:
559
530
  - app/pb_kits/playbook/pb_caption/_caption.scss
560
531
  - app/pb_kits/playbook/pb_caption/_caption_mixin.scss
561
532
  - app/pb_kits/playbook/pb_caption/caption.rb
533
+ - app/pb_kits/playbook/pb_caption/docs/_caption_block.html.erb
534
+ - app/pb_kits/playbook/pb_caption/docs/_caption_block.jsx
562
535
  - app/pb_kits/playbook/pb_caption/docs/_caption_light.html.erb
563
536
  - app/pb_kits/playbook/pb_caption/docs/_caption_light.jsx
564
537
  - app/pb_kits/playbook/pb_caption/docs/_caption_variants.html.erb
@@ -707,15 +680,11 @@ files:
707
680
  - app/pb_kits/playbook/pb_date_picker/_date_picker.scss
708
681
  - app/pb_kits/playbook/pb_date_picker/date_picker.rb
709
682
  - app/pb_kits/playbook/pb_date_picker/date_picker_helper.js
710
- - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.html.erb
711
- - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx
712
- - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md
713
- - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.html.erb
714
- - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.jsx
715
683
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb
716
684
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.jsx
717
685
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb
718
686
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx
687
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md
719
688
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.html.erb
720
689
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.jsx
721
690
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb
@@ -863,6 +832,8 @@ files:
863
832
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx
864
833
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss
865
834
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_description.md
835
+ - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.html.erb
836
+ - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.jsx
866
837
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dark.html.erb
867
838
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dark.jsx
868
839
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default.html.erb
@@ -875,6 +846,7 @@ files:
875
846
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml
876
847
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js
877
848
  - app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb
849
+ - app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js
878
850
  - app/pb_kits/playbook/pb_flex/_flex.html.erb
879
851
  - app/pb_kits/playbook/pb_flex/_flex.jsx
880
852
  - app/pb_kits/playbook/pb_flex/_flex.scss
@@ -1533,12 +1505,18 @@ files:
1533
1505
  - app/pb_kits/playbook/pb_table/_table_row.html.erb
1534
1506
  - app/pb_kits/playbook/pb_table/_table_row.jsx
1535
1507
  - app/pb_kits/playbook/pb_table/docs/_description.md
1508
+ - app/pb_kits/playbook/pb_table/docs/_table_action_middle.html.erb
1509
+ - app/pb_kits/playbook/pb_table/docs/_table_action_middle.jsx
1510
+ - app/pb_kits/playbook/pb_table/docs/_table_action_middle.md
1536
1511
  - app/pb_kits/playbook/pb_table/docs/_table_container.html.erb
1537
1512
  - app/pb_kits/playbook/pb_table/docs/_table_container.jsx
1538
1513
  - app/pb_kits/playbook/pb_table/docs/_table_data_table.html.erb
1539
1514
  - app/pb_kits/playbook/pb_table/docs/_table_data_table.jsx
1540
1515
  - app/pb_kits/playbook/pb_table/docs/_table_disable_hover.html.erb
1541
1516
  - app/pb_kits/playbook/pb_table/docs/_table_disable_hover.jsx
1517
+ - app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.html.erb
1518
+ - app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.jsx
1519
+ - app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.md
1542
1520
  - app/pb_kits/playbook/pb_table/docs/_table_lg.html.erb
1543
1521
  - app/pb_kits/playbook/pb_table/docs/_table_lg.jsx
1544
1522
  - app/pb_kits/playbook/pb_table/docs/_table_lg.md
@@ -1547,6 +1525,9 @@ files:
1547
1525
  - app/pb_kits/playbook/pb_table/docs/_table_md.md
1548
1526
  - app/pb_kits/playbook/pb_table/docs/_table_multiline.html.erb
1549
1527
  - app/pb_kits/playbook/pb_table/docs/_table_multiline.jsx
1528
+ - app/pb_kits/playbook/pb_table/docs/_table_one_action.html.erb
1529
+ - app/pb_kits/playbook/pb_table/docs/_table_one_action.jsx
1530
+ - app/pb_kits/playbook/pb_table/docs/_table_one_action.md
1550
1531
  - app/pb_kits/playbook/pb_table/docs/_table_responsive_table.html.erb
1551
1532
  - app/pb_kits/playbook/pb_table/docs/_table_responsive_table.jsx
1552
1533
  - app/pb_kits/playbook/pb_table/docs/_table_side_highlight.html.erb
@@ -1557,6 +1538,12 @@ files:
1557
1538
  - app/pb_kits/playbook/pb_table/docs/_table_sm.html.erb
1558
1539
  - app/pb_kits/playbook/pb_table/docs/_table_sm.jsx
1559
1540
  - app/pb_kits/playbook/pb_table/docs/_table_sm.md
1541
+ - app/pb_kits/playbook/pb_table/docs/_table_two_actions.html.erb
1542
+ - app/pb_kits/playbook/pb_table/docs/_table_two_actions.jsx
1543
+ - app/pb_kits/playbook/pb_table/docs/_table_two_actions.md
1544
+ - app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.html.erb
1545
+ - app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.jsx
1546
+ - app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.md
1560
1547
  - app/pb_kits/playbook/pb_table/docs/example.yml
1561
1548
  - app/pb_kits/playbook/pb_table/docs/index.js
1562
1549
  - app/pb_kits/playbook/pb_table/index.js
@@ -1726,6 +1713,7 @@ files:
1726
1713
  - app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
1727
1714
  - app/pb_kits/playbook/pb_toggle/docs/_toggle_name.html.erb
1728
1715
  - app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
1716
+ - app/pb_kits/playbook/pb_toggle/docs/_toggle_options.html.erb
1729
1717
  - app/pb_kits/playbook/pb_toggle/docs/example.yml
1730
1718
  - app/pb_kits/playbook/pb_toggle/docs/index.js
1731
1719
  - app/pb_kits/playbook/pb_toggle/toggle.rb
@@ -1751,11 +1739,15 @@ files:
1751
1739
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb
1752
1740
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx
1753
1741
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_context_dark.html.erb
1742
+ - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.html.erb
1754
1743
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx
1744
+ - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.md
1745
+ - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.html.erb
1755
1746
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx
1756
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx
1747
+ - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.md
1748
+ - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.html.erb
1757
1749
  - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx
1758
- - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx
1750
+ - app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.md
1759
1751
  - app/pb_kits/playbook/pb_typeahead/docs/example.yml
1760
1752
  - app/pb_kits/playbook/pb_typeahead/docs/index.js
1761
1753
  - app/pb_kits/playbook/pb_typeahead/index.js
@@ -1822,6 +1814,7 @@ files:
1822
1814
  - app/pb_kits/playbook/props/percentage.rb
1823
1815
  - app/pb_kits/playbook/props/proc.rb
1824
1816
  - app/pb_kits/playbook/props/string.rb
1817
+ - app/pb_kits/playbook/react_rails_kits.js
1825
1818
  - app/pb_kits/playbook/tokens/_animation-curves.scss
1826
1819
  - app/pb_kits/playbook/tokens/_border_radius.scss
1827
1820
  - app/pb_kits/playbook/tokens/_colors.scss
@@ -1834,6 +1827,7 @@ files:
1834
1827
  - app/pb_kits/playbook/tokens/_spacing.scss
1835
1828
  - app/pb_kits/playbook/tokens/_transition.scss
1836
1829
  - app/pb_kits/playbook/tokens/_typography.scss
1830
+ - app/pb_kits/playbook/tokens/index.scss
1837
1831
  - app/pb_kits/playbook/types.js
1838
1832
  - app/pb_kits/playbook/utilities/_background_colors.scss
1839
1833
  - app/pb_kits/playbook/utilities/_colors.scss
@@ -1842,47 +1836,6 @@ files:
1842
1836
  - app/pb_kits/playbook/utilities/props.js
1843
1837
  - app/pb_kits/playbook/utilities/text.js
1844
1838
  - app/pb_kits/playbook/vendor.js
1845
- - app/views/layouts/playbook/_mobile_hamburger.html.erb
1846
- - app/views/layouts/playbook/_nav.html.erb
1847
- - app/views/layouts/playbook/_sidebar.html.erb
1848
- - app/views/layouts/playbook/application.html.erb
1849
- - app/views/layouts/playbook/fullscreen.html.slim
1850
- - app/views/layouts/playbook/grid.html.slim
1851
- - app/views/layouts/playbook/samples.html.erb
1852
- - app/views/playbook/guides/create_kit.html.slim
1853
- - app/views/playbook/guides/create_kit/_file_naming.html.md
1854
- - app/views/playbook/guides/create_kit/_generator.html.md
1855
- - app/views/playbook/guides/create_kit/_kit_examples.html.md
1856
- - app/views/playbook/guides/create_kit/_kit_rails.html.md
1857
- - app/views/playbook/guides/create_kit/_kit_react.html.md
1858
- - app/views/playbook/guides/create_kit/_layout.html.md
1859
- - app/views/playbook/guides/create_kit/_view_objects.html.md
1860
- - app/views/playbook/guides/create_kit/_writing_sass.md
1861
- - app/views/playbook/guides/use_nitro.html.slim
1862
- - app/views/playbook/guides/use_nitro/_local.html.md
1863
- - app/views/playbook/guides/use_nitro/_nitro_components.html.md
1864
- - app/views/playbook/guides/use_nitro/_versions.html.md
1865
- - app/views/playbook/pages/fullscreen.html.slim
1866
- - app/views/playbook/pages/grid.html.slim
1867
- - app/views/playbook/pages/home.html.slim
1868
- - app/views/playbook/pages/kit_category_show.html.erb
1869
- - app/views/playbook/pages/kit_show.html.erb
1870
- - app/views/playbook/pages/kits.html.erb
1871
- - app/views/playbook/pages/principals/_getting_started.html.md
1872
- - app/views/playbook/pages/principles.html.slim
1873
- - app/views/playbook/pages/tokens.html.slim
1874
- - app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim
1875
- - app/views/playbook/pages/utilities.html.slim
1876
- - app/views/playbook/pages/utilities/_pb_doc_color.html.slim
1877
- - app/views/playbook/samples/collection_detail/index.html.erb
1878
- - app/views/playbook/samples/collection_detail/index.jsx
1879
- - app/views/playbook/samples/dashboards/index.html.erb
1880
- - app/views/playbook/samples/dashboards/index.jsx
1881
- - app/views/playbook/samples/filter_table/index.html.erb
1882
- - app/views/playbook/samples/filter_table/index.jsx
1883
- - app/views/playbook/samples/registration/index.html.erb
1884
- - app/views/playbook/samples/registration/index.jsx
1885
- - app/views/playbook/samples/sample_show.html.erb
1886
1839
  - fonts/fontawesome-min.js
1887
1840
  - fonts/regular-min.js
1888
1841
  - lib/generators/kit/USAGE
@@ -1900,6 +1853,7 @@ files:
1900
1853
  - lib/playbook/engine.rb
1901
1854
  - lib/playbook/version.rb
1902
1855
  - lib/playbook_ui.rb
1856
+ - lib/tasks/changelog.rake
1903
1857
  - lib/tasks/pb_release.rake
1904
1858
  - lib/tasks/playbook_tasks.rake
1905
1859
  homepage: http://playbook.powerapp.cloud
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_dependency "playbook/application_controller"
4
-
5
- module Playbook
6
- class GuidesController < ApplicationController
7
- def create_kit; end
8
-
9
- def use_nitro; end
10
- end
11
- end
@@ -1,99 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_dependency "playbook/application_controller"
4
- require "yaml"
5
-
6
- module Playbook
7
- class PagesController < ApplicationController
8
- before_action :set_kit, only: %i[kit_show_rails kit_show_react]
9
- before_action :ensure_kit_type_exists, only: %i[kit_show_rails kit_show_react]
10
- before_action :set_category, only: %i[kit_category_show_rails kit_category_show_react]
11
- before_action :set_playbook
12
-
13
- def set_playbook
14
- @playbook = true
15
- end
16
-
17
- def enable_dark_mode
18
- cookies[:dark_mode] = {
19
- value: "true"
20
- }
21
- redirect_back(fallback_location: root_path)
22
- end
23
-
24
- def disable_dark_mode
25
- cookies[:dark_mode] = {
26
- value: "false"
27
- }
28
- redirect_back(fallback_location: root_path)
29
- end
30
-
31
-
32
- def home; end
33
-
34
- def utilities; end
35
-
36
- def tokens; end
37
-
38
- def kits
39
- params[:type] ||= "react"
40
- @type = params[:type]
41
- end
42
-
43
- def principles; end
44
-
45
- def grid
46
- render layout: "layouts/playbook/grid"
47
- end
48
-
49
- def kit_show_rails
50
- render "playbook/pages/kit_show"
51
- end
52
-
53
- def kit_show_react
54
- render template: "playbook/pages/kit_show"
55
- end
56
-
57
- def kit_category_show_rails
58
- params[:type] ||= "rails"
59
- @type = params[:type]
60
- render template: "playbook/pages/kit_category_show"
61
- end
62
-
63
- def kit_category_show_react
64
- render template: "playbook/pages/kit_category_show"
65
- end
66
-
67
- private
68
-
69
- def set_category
70
- categories = MENU["kits"].map { |link| link.first.first if link.is_a?(Hash) }.compact
71
- @category = params[:name]
72
- if categories.flatten.include?(@category)
73
- @category_kits = MENU["kits"].map { |link| link.first.last if link.is_a?(Hash) && link.first.first == @category }.compact.flatten
74
- @kits = params[:name]
75
- else
76
- redirect_to root_path, flash: { error: "That kit does not exist" }
77
- end
78
- end
79
-
80
- def set_kit
81
- menu = MENU["kits"].map { |link| link.is_a?(Hash) ? link.first.last : link }
82
- if menu.flatten.include?(params[:name])
83
- @kit = params[:name]
84
- else
85
- redirect_to root_path, flash: { error: "That kit does not exist" }
86
- end
87
- end
88
-
89
- def ensure_kit_type_exists
90
- # TODO: unsure why we cannot simply use the helpers that are included in ApplicationController - fix this
91
- is_rails_kit = action_name == "kit_show_rails"
92
- files = is_rails_kit ? File.join("**", "*.erb") : File.join("**", "*.jsx")
93
- kit_files = Dir.glob(files, base: "#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{@kit}/docs").present?
94
- if !kit_files.present?
95
- redirect_to action: is_rails_kit ? "kit_show_react" : "kit_show_rails"
96
- end
97
- end
98
- end
99
- end