playbook_ui 7.0.1.pre.alpha10 → 7.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -6
- data/app/controllers/playbook/application_controller.rb +1 -4
- data/app/helpers/playbook/pb_kit_helper.rb +2 -2
- data/app/pb_kits/playbook/_playbook.scss +1 -0
- data/app/pb_kits/playbook/index.js +6 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +5 -1
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +4 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.html.erb +1 -12
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +1 -1
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +2 -1
- data/app/pb_kits/playbook/pb_button/_button.jsx +5 -1
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +5 -1
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -2
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +5 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +3 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_options.html.erb +10 -0
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx +130 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +39 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +29 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +28 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +117 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +53 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +30 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +30 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +11 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +9 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +5 -1
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +5 -1
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +5 -1
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +5 -1
- data/app/pb_kits/playbook/pb_date/date.rb +2 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +8 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_timezone.html.erb +51 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_timezone.md +6 -0
- data/app/pb_kits/playbook/pb_date/docs/_description.md +2 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +7 -4
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -4
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -3
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +8 -10
- data/app/pb_kits/playbook/pb_date_picker/docs/{_date_picker_read_only.html.erb → _date_picker_allow_input.html.erb} +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.jsx +34 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md +3 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +1 -0
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +5 -1
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +5 -1
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.html.erb +1 -8
- data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +7 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +9 -1
- data/app/pb_kits/playbook/pb_form/form_builder/checkbox_field.rb +7 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +3 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +5 -1
- data/app/pb_kits/playbook/pb_image/_image.jsx +5 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +5 -1
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +4 -4
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.html.erb +1 -13
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +2 -1
- data/app/pb_kits/playbook/pb_list/_list.jsx +3 -2
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +3 -2
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +5 -1
- data/app/pb_kits/playbook/pb_message/_message.jsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +5 -2
- data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
- data/app/pb_kits/playbook/pb_person/_person.jsx +5 -1
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +12 -7
- data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_wrong_numbers.jsx +1 -0
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +5 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +4 -4
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.html.erb +1 -1
- data/app/pb_kits/playbook/pb_radio/docs/_radio_options.html.erb +9 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_radio/radio.rb +2 -4
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +1 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +3 -3
- data/app/pb_kits/playbook/pb_stat_value/docs/_stat_value_default.jsx +6 -1
- data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -8
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.html.erb +23 -17
- data/app/pb_kits/playbook/pb_time/_time.jsx +22 -13
- data/app/pb_kits/playbook/pb_time/_time.scss +16 -8
- data/app/pb_kits/playbook/pb_time/docs/_time_align.html.erb +18 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +3 -3
- data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +47 -3
- data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +33 -4
- data/app/pb_kits/playbook/pb_time/docs/_time_sizes.html.erb +11 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx +19 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb +3 -1
- data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +0 -7
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.html.erb +38 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx +12 -14
- data/app/pb_kits/playbook/pb_time/docs/example.yml +6 -2
- data/app/pb_kits/playbook/pb_time/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_time/time.rb +14 -2
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +1 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +3 -3
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.jsx +5 -1
- data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +5 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +5 -5
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +3 -3
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +41 -43
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_toggle/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_toggle/toggle.rb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +60 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +20 -3
- data/app/pb_kits/playbook/pb_typeahead/components/Control.jsx +30 -0
- data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MenuList.jsx +12 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +51 -0
- data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +34 -0
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.jsx +13 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +22 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +29 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +84 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx +45 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +101 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx +27 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +8 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +5 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +1 -1
- data/app/pb_kits/playbook/react_rails_kits.js +5 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +22 -23
- data/app/pb_kits/playbook/tokens/_typography.scss +7 -7
- data/app/pb_kits/playbook/tokens/index.scss +11 -0
- data/app/pb_kits/playbook/vendor.js +5 -0
- data/lib/generators/kit/kit_generator.rb +1 -1
- data/lib/generators/kit/templates/kit_jsx.erb.tt +1 -1
- data/lib/playbook/engine.rb +1 -0
- data/lib/playbook/version.rb +1 -1
- data/lib/tasks/pb_release.rake +14 -3
- metadata +46 -70
- data/app/controllers/playbook/guides_controller.rb +0 -11
- data/app/controllers/playbook/pages_controller.rb +0 -94
- data/app/controllers/playbook/samples_controller.rb +0 -40
- data/app/pb_kits/playbook/packs/application.js +0 -55
- data/app/pb_kits/playbook/packs/examples.js +0 -176
- data/app/pb_kits/playbook/packs/main.scss +0 -12
- data/app/pb_kits/playbook/packs/samples.js +0 -21
- data/app/pb_kits/playbook/packs/site_styles/_samples.scss +0 -72
- data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +0 -43
- data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +0 -146
- data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +0 -10
- data/app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss +0 -7
- data/app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss +0 -531
- data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +0 -92
- data/app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss +0 -15
- data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +0 -132
- data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +0 -15
- data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +0 -88
- data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +0 -72
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.jsx +0 -13
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.md +0 -1
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.html.erb +0 -11
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx +0 -44
- data/app/views/layouts/playbook/_mobile_hamburger.html.erb +0 -2
- data/app/views/layouts/playbook/_nav.html.erb +0 -34
- data/app/views/layouts/playbook/_sidebar.html.erb +0 -51
- data/app/views/layouts/playbook/application.html.erb +0 -26
- data/app/views/layouts/playbook/fullscreen.html.slim +0 -10
- data/app/views/layouts/playbook/grid.html.slim +0 -10
- data/app/views/layouts/playbook/samples.html.erb +0 -19
- data/app/views/playbook/guides/create_kit.html.slim +0 -16
- data/app/views/playbook/guides/create_kit/_file_naming.html.md +0 -2
- data/app/views/playbook/guides/create_kit/_generator.html.md +0 -6
- data/app/views/playbook/guides/create_kit/_kit_examples.html.md +0 -2
- data/app/views/playbook/guides/create_kit/_kit_rails.html.md +0 -2
- data/app/views/playbook/guides/create_kit/_kit_react.html.md +0 -2
- data/app/views/playbook/guides/create_kit/_layout.html.md +0 -2
- data/app/views/playbook/guides/create_kit/_view_objects.html.md +0 -2
- data/app/views/playbook/guides/create_kit/_writing_sass.md +0 -10
- data/app/views/playbook/guides/use_nitro.html.slim +0 -6
- data/app/views/playbook/guides/use_nitro/_local.html.md +0 -2
- data/app/views/playbook/guides/use_nitro/_nitro_components.html.md +0 -2
- data/app/views/playbook/guides/use_nitro/_versions.html.md +0 -2
- data/app/views/playbook/pages/fullscreen.html.slim +0 -10
- data/app/views/playbook/pages/grid.html.slim +0 -2
- data/app/views/playbook/pages/home.html.slim +0 -4
- data/app/views/playbook/pages/kit_category_show.html.erb +0 -14
- data/app/views/playbook/pages/kit_show.html.erb +0 -33
- data/app/views/playbook/pages/kits.html.erb +0 -12
- data/app/views/playbook/pages/principals/_getting_started.html.md +0 -30
- data/app/views/playbook/pages/principles.html.slim +0 -3
- data/app/views/playbook/pages/tokens.html.slim +0 -15
- data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +0 -61
- data/app/views/playbook/pages/utilities.html.slim +0 -116
- data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +0 -15
- data/app/views/playbook/samples/collection_detail/index.html.erb +0 -169
- data/app/views/playbook/samples/collection_detail/index.jsx +0 -372
- data/app/views/playbook/samples/dashboards/index.html.erb +0 -81
- data/app/views/playbook/samples/dashboards/index.jsx +0 -130
- data/app/views/playbook/samples/filter_table/index.html.erb +0 -348
- data/app/views/playbook/samples/filter_table/index.jsx +0 -433
- data/app/views/playbook/samples/registration/index.html.erb +0 -316
- data/app/views/playbook/samples/registration/index.jsx +0 -476
- data/app/views/playbook/samples/sample_show.html.erb +0 -36
@@ -2,7 +2,7 @@
|
|
2
2
|
$font_family_base: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans_serif;
|
3
3
|
|
4
4
|
|
5
|
-
|
5
|
+
/* CLEAN UP AND REMOVE */
|
6
6
|
$font_jumbo: 36px;
|
7
7
|
$font_largest: 32px;
|
8
8
|
$font_larger: 28px;
|
@@ -29,7 +29,7 @@ $text_smaller: $font_smaller;
|
|
29
29
|
$text_smallest: $font_smallest;
|
30
30
|
|
31
31
|
|
32
|
-
|
32
|
+
/* Headings */
|
33
33
|
$heading_1: 48px;
|
34
34
|
$heading_2: 34px;
|
35
35
|
$heading_3: $font_larger;
|
@@ -39,9 +39,9 @@ $heading_4: $font_base;
|
|
39
39
|
|
40
40
|
|
41
41
|
// Letter Spacing
|
42
|
-
$lspace_tightest:
|
43
|
-
$lspace_tighter:
|
44
|
-
$lspace_tight:
|
42
|
+
$lspace_tightest: -.1em;
|
43
|
+
$lspace_tighter: -.07em;
|
44
|
+
$lspace_tight: -.03em;
|
45
45
|
$lspace_normal: 0;
|
46
46
|
$lspace_loose: .03em;
|
47
47
|
$lspace_looser: .07em;
|
@@ -52,11 +52,11 @@ $lspace_super_loosest: .2em;
|
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
-
|
55
|
+
/* Standard Font Weights */
|
56
56
|
$bold: 600;
|
57
57
|
$regular: 400;
|
58
58
|
|
59
|
-
|
59
|
+
/* Non_Standard Font Weights */
|
60
60
|
$extrabold: 900;
|
61
61
|
$boldest: 800;
|
62
62
|
$bolder: 700;
|
@@ -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";
|
@@ -25,3 +25,8 @@ import PbTable from './pb_table'
|
|
25
25
|
PbTable.start()
|
26
26
|
|
27
27
|
import 'flatpickr'
|
28
|
+
|
29
|
+
// React-Rendered Rails Kits =====
|
30
|
+
import WebpackerReact from 'webpacker-react'
|
31
|
+
import * as ReactRailsPBKits from './react_rails_kits.js'
|
32
|
+
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
|
@@ -51,7 +51,7 @@ const <%= @kit_name_pascal %> = (props: <%= type_name %>) => {
|
|
51
51
|
|
52
52
|
const ariaProps = buildAriaProps(aria)
|
53
53
|
const dataProps = buildDataProps(data)
|
54
|
-
const classes = classnames(buildCss('pb_<%= @kit_name_underscore %>'),
|
54
|
+
const classes = classnames(buildCss('pb_<%= @kit_name_underscore %>'), globalProps(props), className)
|
55
55
|
|
56
56
|
return (
|
57
57
|
<div
|
data/lib/playbook/engine.rb
CHANGED
@@ -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
|
|
data/lib/playbook/version.rb
CHANGED
data/lib/tasks/pb_release.rake
CHANGED
@@ -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
|
62
|
+
`rm -rf playbook_ui-*.gem`
|
60
63
|
|
61
64
|
# NPM
|
62
|
-
puts "\
|
63
|
-
`
|
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
|
4
|
+
version: 7.0.1
|
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-
|
12
|
+
date: 2020-10-12 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
|
@@ -604,21 +585,33 @@ files:
|
|
604
585
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default.jsx
|
605
586
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_error.html.erb
|
606
587
|
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_error.jsx
|
588
|
+
- app/pb_kits/playbook/pb_checkbox/docs/_checkbox_options.html.erb
|
607
589
|
- app/pb_kits/playbook/pb_checkbox/docs/_description.md
|
608
590
|
- app/pb_kits/playbook/pb_checkbox/docs/example.yml
|
609
591
|
- app/pb_kits/playbook/pb_checkbox/docs/index.js
|
610
592
|
- app/pb_kits/playbook/pb_circle_chart/_circle_chart.html.erb
|
593
|
+
- app/pb_kits/playbook/pb_circle_chart/_circle_chart.jsx
|
611
594
|
- app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss
|
612
595
|
- app/pb_kits/playbook/pb_circle_chart/circle_chart.rb
|
613
596
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb
|
597
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx
|
614
598
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb
|
599
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx
|
615
600
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb
|
601
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx
|
616
602
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb
|
603
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx
|
604
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx
|
617
605
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb
|
606
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx
|
618
607
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.html.erb
|
608
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx
|
619
609
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.html.erb
|
610
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx
|
620
611
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.html.erb
|
612
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx
|
621
613
|
- app/pb_kits/playbook/pb_circle_chart/docs/example.yml
|
614
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/index.js
|
622
615
|
- app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.html.erb
|
623
616
|
- app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx
|
624
617
|
- app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss
|
@@ -677,6 +670,8 @@ files:
|
|
677
670
|
- app/pb_kits/playbook/pb_date/date.rb
|
678
671
|
- app/pb_kits/playbook/pb_date/docs/_date_default.html.erb
|
679
672
|
- app/pb_kits/playbook/pb_date/docs/_date_default.jsx
|
673
|
+
- app/pb_kits/playbook/pb_date/docs/_date_timezone.html.erb
|
674
|
+
- app/pb_kits/playbook/pb_date/docs/_date_timezone.md
|
680
675
|
- app/pb_kits/playbook/pb_date/docs/_description.md
|
681
676
|
- app/pb_kits/playbook/pb_date/docs/example.yml
|
682
677
|
- app/pb_kits/playbook/pb_date/docs/index.js
|
@@ -685,6 +680,9 @@ files:
|
|
685
680
|
- app/pb_kits/playbook/pb_date_picker/_date_picker.scss
|
686
681
|
- app/pb_kits/playbook/pb_date_picker/date_picker.rb
|
687
682
|
- app/pb_kits/playbook/pb_date_picker/date_picker_helper.js
|
683
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.html.erb
|
684
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx
|
685
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md
|
688
686
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.html.erb
|
689
687
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.jsx
|
690
688
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb
|
@@ -711,11 +709,10 @@ files:
|
|
711
709
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_label.md
|
712
710
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.html.erb
|
713
711
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_min_max.jsx
|
712
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.jsx
|
713
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_on_change.md
|
714
714
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.html.erb
|
715
715
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.jsx
|
716
|
-
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.html.erb
|
717
|
-
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.jsx
|
718
|
-
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_read_only.md
|
719
716
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_range.html.erb
|
720
717
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_range.jsx
|
721
718
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_range.md
|
@@ -1373,6 +1370,7 @@ files:
|
|
1373
1370
|
- app/pb_kits/playbook/pb_radio/docs/_radio_error.html.erb
|
1374
1371
|
- app/pb_kits/playbook/pb_radio/docs/_radio_error.jsx
|
1375
1372
|
- app/pb_kits/playbook/pb_radio/docs/_radio_error.md
|
1373
|
+
- app/pb_kits/playbook/pb_radio/docs/_radio_options.html.erb
|
1376
1374
|
- app/pb_kits/playbook/pb_radio/docs/example.yml
|
1377
1375
|
- app/pb_kits/playbook/pb_radio/docs/index.js
|
1378
1376
|
- app/pb_kits/playbook/pb_radio/radio.rb
|
@@ -1590,12 +1588,16 @@ files:
|
|
1590
1588
|
- app/pb_kits/playbook/pb_time/_time.scss
|
1591
1589
|
- app/pb_kits/playbook/pb_time/docs/_description.md
|
1592
1590
|
- app/pb_kits/playbook/pb_time/docs/_footer.md
|
1591
|
+
- app/pb_kits/playbook/pb_time/docs/_time_align.html.erb
|
1593
1592
|
- app/pb_kits/playbook/pb_time/docs/_time_align.jsx
|
1594
1593
|
- app/pb_kits/playbook/pb_time/docs/_time_default.html.erb
|
1595
1594
|
- app/pb_kits/playbook/pb_time/docs/_time_default.jsx
|
1596
1595
|
- app/pb_kits/playbook/pb_time/docs/_time_default.md
|
1596
|
+
- app/pb_kits/playbook/pb_time/docs/_time_sizes.html.erb
|
1597
|
+
- app/pb_kits/playbook/pb_time/docs/_time_sizes.jsx
|
1597
1598
|
- app/pb_kits/playbook/pb_time/docs/_time_timestamp.html.erb
|
1598
1599
|
- app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx
|
1600
|
+
- app/pb_kits/playbook/pb_time/docs/_time_timezone.html.erb
|
1599
1601
|
- app/pb_kits/playbook/pb_time/docs/_time_timezone.jsx
|
1600
1602
|
- app/pb_kits/playbook/pb_time/docs/_time_timezone.md
|
1601
1603
|
- app/pb_kits/playbook/pb_time/docs/example.yml
|
@@ -1697,8 +1699,6 @@ files:
|
|
1697
1699
|
- app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx
|
1698
1700
|
- app/pb_kits/playbook/pb_toggle/docs/_toggle_name.html.erb
|
1699
1701
|
- app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx
|
1700
|
-
- app/pb_kits/playbook/pb_toggle/docs/_toggle_size.html.erb
|
1701
|
-
- app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx
|
1702
1702
|
- app/pb_kits/playbook/pb_toggle/docs/example.yml
|
1703
1703
|
- app/pb_kits/playbook/pb_toggle/docs/index.js
|
1704
1704
|
- app/pb_kits/playbook/pb_toggle/toggle.rb
|
@@ -1710,12 +1710,27 @@ files:
|
|
1710
1710
|
- app/pb_kits/playbook/pb_tooltip/index.js
|
1711
1711
|
- app/pb_kits/playbook/pb_tooltip/tooltip.rb
|
1712
1712
|
- app/pb_kits/playbook/pb_typeahead/_typeahead.html.erb
|
1713
|
+
- app/pb_kits/playbook/pb_typeahead/_typeahead.jsx
|
1713
1714
|
- app/pb_kits/playbook/pb_typeahead/_typeahead.scss
|
1715
|
+
- app/pb_kits/playbook/pb_typeahead/components/Control.jsx
|
1716
|
+
- app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.jsx
|
1717
|
+
- app/pb_kits/playbook/pb_typeahead/components/MenuList.jsx
|
1718
|
+
- app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
|
1719
|
+
- app/pb_kits/playbook/pb_typeahead/components/Option.jsx
|
1720
|
+
- app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx
|
1721
|
+
- app/pb_kits/playbook/pb_typeahead/components/ValueContainer.jsx
|
1714
1722
|
- app/pb_kits/playbook/pb_typeahead/docs/_description.md
|
1715
1723
|
- app/pb_kits/playbook/pb_typeahead/docs/_footer.md
|
1716
1724
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb
|
1725
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx
|
1717
1726
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_context_dark.html.erb
|
1727
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx
|
1728
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx
|
1729
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx
|
1730
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx
|
1731
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx
|
1718
1732
|
- app/pb_kits/playbook/pb_typeahead/docs/example.yml
|
1733
|
+
- app/pb_kits/playbook/pb_typeahead/docs/index.js
|
1719
1734
|
- app/pb_kits/playbook/pb_typeahead/index.js
|
1720
1735
|
- app/pb_kits/playbook/pb_typeahead/typeahead.rb
|
1721
1736
|
- app/pb_kits/playbook/pb_user/_user.html.erb
|
@@ -1780,6 +1795,7 @@ files:
|
|
1780
1795
|
- app/pb_kits/playbook/props/percentage.rb
|
1781
1796
|
- app/pb_kits/playbook/props/proc.rb
|
1782
1797
|
- app/pb_kits/playbook/props/string.rb
|
1798
|
+
- app/pb_kits/playbook/react_rails_kits.js
|
1783
1799
|
- app/pb_kits/playbook/tokens/_animation-curves.scss
|
1784
1800
|
- app/pb_kits/playbook/tokens/_border_radius.scss
|
1785
1801
|
- app/pb_kits/playbook/tokens/_colors.scss
|
@@ -1792,6 +1808,7 @@ files:
|
|
1792
1808
|
- app/pb_kits/playbook/tokens/_spacing.scss
|
1793
1809
|
- app/pb_kits/playbook/tokens/_transition.scss
|
1794
1810
|
- app/pb_kits/playbook/tokens/_typography.scss
|
1811
|
+
- app/pb_kits/playbook/tokens/index.scss
|
1795
1812
|
- app/pb_kits/playbook/types.js
|
1796
1813
|
- app/pb_kits/playbook/utilities/_background_colors.scss
|
1797
1814
|
- app/pb_kits/playbook/utilities/_colors.scss
|
@@ -1800,47 +1817,6 @@ files:
|
|
1800
1817
|
- app/pb_kits/playbook/utilities/props.js
|
1801
1818
|
- app/pb_kits/playbook/utilities/text.js
|
1802
1819
|
- app/pb_kits/playbook/vendor.js
|
1803
|
-
- app/views/layouts/playbook/_mobile_hamburger.html.erb
|
1804
|
-
- app/views/layouts/playbook/_nav.html.erb
|
1805
|
-
- app/views/layouts/playbook/_sidebar.html.erb
|
1806
|
-
- app/views/layouts/playbook/application.html.erb
|
1807
|
-
- app/views/layouts/playbook/fullscreen.html.slim
|
1808
|
-
- app/views/layouts/playbook/grid.html.slim
|
1809
|
-
- app/views/layouts/playbook/samples.html.erb
|
1810
|
-
- app/views/playbook/guides/create_kit.html.slim
|
1811
|
-
- app/views/playbook/guides/create_kit/_file_naming.html.md
|
1812
|
-
- app/views/playbook/guides/create_kit/_generator.html.md
|
1813
|
-
- app/views/playbook/guides/create_kit/_kit_examples.html.md
|
1814
|
-
- app/views/playbook/guides/create_kit/_kit_rails.html.md
|
1815
|
-
- app/views/playbook/guides/create_kit/_kit_react.html.md
|
1816
|
-
- app/views/playbook/guides/create_kit/_layout.html.md
|
1817
|
-
- app/views/playbook/guides/create_kit/_view_objects.html.md
|
1818
|
-
- app/views/playbook/guides/create_kit/_writing_sass.md
|
1819
|
-
- app/views/playbook/guides/use_nitro.html.slim
|
1820
|
-
- app/views/playbook/guides/use_nitro/_local.html.md
|
1821
|
-
- app/views/playbook/guides/use_nitro/_nitro_components.html.md
|
1822
|
-
- app/views/playbook/guides/use_nitro/_versions.html.md
|
1823
|
-
- app/views/playbook/pages/fullscreen.html.slim
|
1824
|
-
- app/views/playbook/pages/grid.html.slim
|
1825
|
-
- app/views/playbook/pages/home.html.slim
|
1826
|
-
- app/views/playbook/pages/kit_category_show.html.erb
|
1827
|
-
- app/views/playbook/pages/kit_show.html.erb
|
1828
|
-
- app/views/playbook/pages/kits.html.erb
|
1829
|
-
- app/views/playbook/pages/principals/_getting_started.html.md
|
1830
|
-
- app/views/playbook/pages/principles.html.slim
|
1831
|
-
- app/views/playbook/pages/tokens.html.slim
|
1832
|
-
- app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim
|
1833
|
-
- app/views/playbook/pages/utilities.html.slim
|
1834
|
-
- app/views/playbook/pages/utilities/_pb_doc_color.html.slim
|
1835
|
-
- app/views/playbook/samples/collection_detail/index.html.erb
|
1836
|
-
- app/views/playbook/samples/collection_detail/index.jsx
|
1837
|
-
- app/views/playbook/samples/dashboards/index.html.erb
|
1838
|
-
- app/views/playbook/samples/dashboards/index.jsx
|
1839
|
-
- app/views/playbook/samples/filter_table/index.html.erb
|
1840
|
-
- app/views/playbook/samples/filter_table/index.jsx
|
1841
|
-
- app/views/playbook/samples/registration/index.html.erb
|
1842
|
-
- app/views/playbook/samples/registration/index.jsx
|
1843
|
-
- app/views/playbook/samples/sample_show.html.erb
|
1844
1820
|
- fonts/fontawesome-min.js
|
1845
1821
|
- fonts/regular-min.js
|
1846
1822
|
- lib/generators/kit/USAGE
|
@@ -1875,11 +1851,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1875
1851
|
version: '0'
|
1876
1852
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1877
1853
|
requirements:
|
1878
|
-
- - "
|
1854
|
+
- - ">="
|
1879
1855
|
- !ruby/object:Gem::Version
|
1880
|
-
version:
|
1856
|
+
version: '0'
|
1881
1857
|
requirements: []
|
1882
|
-
rubygems_version: 3.1.
|
1858
|
+
rubygems_version: 3.1.4
|
1883
1859
|
signing_key:
|
1884
1860
|
specification_version: 4
|
1885
1861
|
summary: Playbook Design System
|
@@ -1,94 +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
|
-
|
12
|
-
def enable_dark_mode
|
13
|
-
cookies[:dark_mode] = {
|
14
|
-
value: "true"
|
15
|
-
}
|
16
|
-
redirect_back(fallback_location: root_path)
|
17
|
-
end
|
18
|
-
|
19
|
-
def disable_dark_mode
|
20
|
-
cookies[:dark_mode] = {
|
21
|
-
value: "false"
|
22
|
-
}
|
23
|
-
redirect_back(fallback_location: root_path)
|
24
|
-
end
|
25
|
-
|
26
|
-
|
27
|
-
def home; end
|
28
|
-
|
29
|
-
def utilities; end
|
30
|
-
|
31
|
-
def tokens; end
|
32
|
-
|
33
|
-
def kits
|
34
|
-
params[:type] ||= "react"
|
35
|
-
@type = params[:type]
|
36
|
-
end
|
37
|
-
|
38
|
-
def principles; end
|
39
|
-
|
40
|
-
def grid
|
41
|
-
render layout: "layouts/playbook/grid"
|
42
|
-
end
|
43
|
-
|
44
|
-
def kit_show_rails
|
45
|
-
render "playbook/pages/kit_show"
|
46
|
-
end
|
47
|
-
|
48
|
-
def kit_show_react
|
49
|
-
render template: "playbook/pages/kit_show"
|
50
|
-
end
|
51
|
-
|
52
|
-
def kit_category_show_rails
|
53
|
-
params[:type] ||= "rails"
|
54
|
-
@type = params[:type]
|
55
|
-
render template: "playbook/pages/kit_category_show"
|
56
|
-
end
|
57
|
-
|
58
|
-
def kit_category_show_react
|
59
|
-
render template: "playbook/pages/kit_category_show"
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
|
-
def set_category
|
65
|
-
categories = MENU["kits"].map { |link| link.first.first if link.is_a?(Hash) }.compact
|
66
|
-
@category = params[:name]
|
67
|
-
if categories.flatten.include?(@category)
|
68
|
-
@category_kits = MENU["kits"].map { |link| link.first.last if link.is_a?(Hash) && link.first.first == @category }.compact.flatten
|
69
|
-
@kits = params[:name]
|
70
|
-
else
|
71
|
-
redirect_to root_path, flash: { error: "That kit does not exist" }
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
def set_kit
|
76
|
-
menu = MENU["kits"].map { |link| link.is_a?(Hash) ? link.first.last : link }
|
77
|
-
if menu.flatten.include?(params[:name])
|
78
|
-
@kit = params[:name]
|
79
|
-
else
|
80
|
-
redirect_to root_path, flash: { error: "That kit does not exist" }
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def ensure_kit_type_exists
|
85
|
-
# TODO: unsure why we cannot simply use the helpers that are included in ApplicationController - fix this
|
86
|
-
is_rails_kit = action_name == "kit_show_rails"
|
87
|
-
files = is_rails_kit ? File.join("**", "*.erb") : File.join("**", "*.jsx")
|
88
|
-
kit_files = Dir.glob(files, base: "#{Playbook::Engine.root}/app/pb_kits/playbook/pb_#{@kit}/docs").present?
|
89
|
-
if !kit_files.present?
|
90
|
-
redirect_to action: is_rails_kit ? "kit_show_react" : "kit_show_rails"
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|