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.
- checksums.yaml +4 -4
- data/app/controllers/playbook/application_controller.rb +2 -0
- data/app/controllers/playbook/guides_controller.rb +3 -0
- data/app/controllers/playbook/pages_controller.rb +21 -21
- data/app/helpers/playbook/application_helper.rb +2 -0
- data/app/helpers/playbook/layout_helper.rb +7 -5
- data/app/helpers/playbook/pb_doc_helper.rb +17 -15
- data/app/helpers/playbook/pb_kit_helper.rb +11 -9
- data/app/helpers/playbook/redcarpet_helper.rb +41 -44
- data/app/pb_kits/playbook/packs/application.js +6 -4
- data/app/pb_kits/playbook/packs/examples.js +62 -2
- data/app/pb_kits/playbook/packs/index.js +57 -0
- data/app/pb_kits/playbook/packs/kits.js +18 -0
- data/app/pb_kits/playbook/packs/pb_bar_graph.js +4 -0
- data/app/pb_kits/playbook/packs/pb_dashboard_value.js +4 -0
- data/app/pb_kits/playbook/packs/pb_date.js +4 -0
- data/app/pb_kits/playbook/packs/pb_icon.js +4 -0
- data/app/pb_kits/playbook/packs/pb_icon_circle.js +4 -0
- data/app/pb_kits/playbook/packs/pb_icon_value.js +4 -0
- data/app/pb_kits/playbook/packs/pb_label_value.js +4 -0
- data/app/pb_kits/playbook/packs/pb_line_graph.js +4 -0
- data/app/pb_kits/playbook/packs/pb_message.js +4 -0
- data/app/pb_kits/playbook/packs/pb_online_status.js +4 -0
- data/app/pb_kits/playbook/packs/pb_pill.js +4 -0
- data/app/pb_kits/playbook/packs/pb_progress_simple.js +4 -0
- data/app/pb_kits/playbook/packs/pb_star_rating.js +4 -0
- data/app/pb_kits/playbook/packs/pb_time.js +4 -0
- data/app/pb_kits/playbook/packs/pb_timestamp.js +4 -0
- data/app/pb_kits/playbook/packs/pb_title_count.js +4 -0
- data/app/pb_kits/playbook/packs/pb_title_detail.js +4 -0
- data/app/pb_kits/playbook/packs/pb_user.js +4 -0
- data/app/pb_kits/playbook/packs/pb_user_badge.js +4 -0
- data/app/pb_kits/playbook/packs/site_styles/_kit_style_index.scss +19 -1
- data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +1 -1
- data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +4 -4
- data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +16 -3
- data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +7 -7
- data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +2 -2
- data/app/pb_kits/playbook/pb_avatar/_avatar.html.erb +7 -3
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +1 -1
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +73 -30
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +39 -42
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.html.erb +42 -5
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.html.erb +32 -0
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.html.erb +19 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +21 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +3 -0
- data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +24 -0
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +86 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +20 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_body/_body.html.erb +6 -4
- data/app/pb_kits/playbook/pb_body/_body.scss +11 -31
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +53 -0
- data/app/pb_kits/playbook/pb_body/body.rb +61 -38
- data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +19 -3
- data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +21 -3
- data/app/pb_kits/playbook/pb_button/_button.html.erb +19 -8
- data/app/pb_kits/playbook/pb_button/_button.scss +23 -47
- data/app/pb_kits/playbook/pb_button/_button_mixins.scss +116 -0
- data/app/pb_kits/playbook/pb_button/button.rb +95 -51
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_block_content.html.erb +4 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_default.html.erb +4 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_default_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_full_width.html.erb +1 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_link.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +7 -3
- data/app/pb_kits/playbook/pb_caption/_caption.html.erb +5 -2
- data/app/pb_kits/playbook/pb_caption/_caption.scss +9 -1
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +10 -13
- data/app/pb_kits/playbook/pb_caption/caption.rb +35 -40
- data/app/pb_kits/playbook/pb_card/_card.html.erb +3 -2
- data/app/pb_kits/playbook/pb_card/_card.scss +20 -1
- data/app/pb_kits/playbook/pb_card/card.rb +34 -9
- data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +84 -0
- data/app/pb_kits/playbook/pb_dashboard/pbChartPlugin.js +120 -0
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +162 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.html.erb +8 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +21 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.scss +10 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value_mixins.scss +12 -0
- data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_change.html.erb +6 -0
- data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_label.html.erb +6 -0
- data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_value.html.erb +10 -0
- data/app/pb_kits/playbook/pb_dashboard_value/child_kits/_stat_value.scss +7 -0
- data/app/pb_kits/playbook/pb_dashboard_value/dashboardValueSettings.js +47 -0
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.rb +79 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_align.html.erb +23 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_change.html.erb +15 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.html.erb +21 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_dashboard_value_label.html.erb +19 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/example.yml +11 -0
- data/app/pb_kits/playbook/pb_dashboard_value/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dashboard_value/stat_change.rb +93 -0
- data/app/pb_kits/playbook/pb_dashboard_value/stat_label.rb +53 -0
- data/app/pb_kits/playbook/pb_dashboard_value/stat_value.rb +63 -0
- data/app/pb_kits/playbook/pb_date/_date.html.erb +6 -0
- data/app/pb_kits/playbook/pb_date/_date.jsx +21 -0
- data/app/pb_kits/playbook/pb_date/_date.scss +5 -0
- data/app/pb_kits/playbook/pb_date/date.rb +105 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +10 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_date/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon/_icon.html.erb +7 -0
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +21 -0
- data/app/pb_kits/playbook/pb_icon/_icon.scss +3 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_animate.html.erb +3 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_border.html.erb +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_default_dark.html.erb +1 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_flip.html.erb +3 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_pull.html.erb +2 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_rotate.html.erb +3 -0
- data/app/pb_kits/playbook/pb_icon/docs/_icon_sizes.html.erb +16 -0
- data/app/pb_kits/playbook/pb_icon/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_icon/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon/icon.rb +160 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.html.erb +6 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +21 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +57 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.html.erb +35 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_default.html.erb +3 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_sizes.html.erb +24 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/example.yml +10 -0
- data/app/pb_kits/playbook/pb_icon_circle/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +67 -0
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.html.erb +6 -0
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +21 -0
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.scss +30 -0
- data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_align.html.erb +20 -0
- data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_default.html.erb +18 -0
- data/app/pb_kits/playbook/pb_icon_value/docs/_icon_value_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_icon_value/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_icon_value/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon_value/icon_value.rb +78 -0
- data/app/pb_kits/playbook/pb_image/_image.html.erb +2 -1
- data/app/pb_kits/playbook/pb_image/image.rb +26 -20
- data/app/pb_kits/playbook/pb_input/input.rb +21 -16
- data/app/pb_kits/playbook/pb_kit/base.rb +74 -13
- data/app/pb_kits/playbook/pb_label_value/_label_value.html.erb +7 -0
- data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +21 -0
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +7 -0
- data/app/pb_kits/playbook/pb_label_value/docs/_label_value_default.html.erb +21 -0
- data/app/pb_kits/playbook/pb_label_value/docs/_label_value_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_label_value/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_label_value/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_label_value/label_value.rb +56 -0
- data/app/pb_kits/playbook/pb_layout/_layout.scss +2 -2
- data/app/pb_kits/playbook/pb_layout/_layout_mixin.scss +6 -6
- data/app/pb_kits/playbook/pb_layout/body.rb +9 -7
- data/app/pb_kits/playbook/pb_layout/layout.rb +26 -42
- data/app/pb_kits/playbook/pb_layout/sidebar.rb +9 -7
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.html.erb +19 -0
- data/{lib/generators/kit/templates/jsx.erb → app/pb_kits/playbook/pb_line_graph/_line_graph.jsx} +4 -4
- data/{components/SearchCollectionSelect/searchCollectionSelect.scss → app/pb_kits/playbook/pb_line_graph/_line_graph.scss} +0 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_rails.html.erb +21 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/_react.html.erb +2 -0
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +15 -0
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +85 -0
- data/app/pb_kits/playbook/pb_list/_item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_list/_list.scss +15 -78
- data/app/pb_kits/playbook/pb_list/_list_mixin.scss +91 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_borderless.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_dark.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_borderless.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_lg.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_ordered.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_xpadding.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_default.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_lg.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_ordered.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/docs/_list_xpadding.html.erb +6 -6
- data/app/pb_kits/playbook/pb_list/item.rb +14 -16
- data/app/pb_kits/playbook/pb_list/list.rb +30 -29
- data/app/pb_kits/playbook/pb_message/_message.html.erb +11 -0
- data/app/pb_kits/playbook/pb_message/_message.jsx +21 -0
- data/app/pb_kits/playbook/pb_message/_message.scss +5 -0
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +24 -0
- data/app/pb_kits/playbook/pb_message/docs/_message_default.html.erb +63 -0
- data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_message/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_message/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_message/message.rb +89 -0
- data/app/pb_kits/playbook/pb_online_status/_online_status.html.erb +5 -0
- data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +21 -0
- data/app/pb_kits/playbook/pb_online_status/_online_status.scss +20 -0
- data/app/pb_kits/playbook/pb_online_status/_online_status_mixins.scss +35 -0
- data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.html.erb +9 -0
- data/app/pb_kits/playbook/pb_online_status/docs/_online_status_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_online_status/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_online_status/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_online_status/online_status.rb +48 -0
- data/app/pb_kits/playbook/pb_pill/_pill.html.erb +6 -0
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +21 -0
- data/app/pb_kits/playbook/pb_pill/_pill.scss +24 -0
- data/app/pb_kits/playbook/pb_pill/docs/_pill_default.html.erb +38 -0
- data/app/pb_kits/playbook/pb_pill/docs/_pill_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_pill/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_pill/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_pill/pill.rb +62 -0
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.html.erb +11 -0
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +21 -0
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +45 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_align.html.erb +5 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_muted.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_value.html.erb +5 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/_progress_simple_width.html.erb +1 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_progress_simple/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_progress_simple/progress_simple.rb +100 -0
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.html.erb +28 -0
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.jsx +21 -0
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +60 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.html.erb +13 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.html.erb +1 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +70 -0
- data/app/pb_kits/playbook/pb_table/_table.html.erb +1 -5
- data/app/pb_kits/playbook/pb_table/styles/_as-cards.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_content.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +3 -3
- data/app/pb_kits/playbook/pb_table/styles/_hover.scss +7 -5
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +103 -100
- data/app/pb_kits/playbook/pb_table/styles/_reset.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_single-line.scss +1 -1
- data/app/pb_kits/playbook/pb_table/styles/_structure.scss +5 -3
- data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +5 -5
- data/app/pb_kits/playbook/pb_table/styles/_table-dark.scss +64 -58
- data/app/pb_kits/playbook/pb_table/styles/_variables.scss +3 -0
- data/app/pb_kits/playbook/pb_table/table.rb +50 -50
- data/app/pb_kits/playbook/pb_time/_time.html.erb +6 -0
- data/app/pb_kits/playbook/pb_time/_time.jsx +21 -0
- data/app/pb_kits/playbook/pb_time/_time.scss +25 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_default.html.erb +23 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_time/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_time/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_time/time.rb +135 -0
- data/app/pb_kits/playbook/pb_timestamp/_timestamp-mixins.scss +10 -0
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.html.erb +6 -0
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +21 -0
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.scss +5 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +50 -0
- data/app/pb_kits/playbook/pb_title/_title.html.erb +4 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +12 -21
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +18 -40
- data/app/pb_kits/playbook/pb_title/docs/_title_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +4 -0
- data/app/pb_kits/playbook/pb_title/title.rb +39 -37
- data/app/pb_kits/playbook/pb_title_count/_title_count.html.erb +7 -0
- data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +21 -0
- data/app/pb_kits/playbook/pb_title_count/_title_count.scss +17 -0
- data/app/pb_kits/playbook/pb_title_count/docs/_title_count_align.html.erb +20 -0
- data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.html.erb +20 -0
- data/app/pb_kits/playbook/pb_title_count/docs/_title_count_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_title_count/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_title_count/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title_count/title_count.rb +88 -0
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.html.erb +7 -0
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +21 -0
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.scss +14 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.html.erb +16 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_title_detail/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title_detail/title_detail.rb +70 -0
- data/app/pb_kits/playbook/pb_user/_user.html.erb +11 -0
- data/app/pb_kits/playbook/pb_user/_user.jsx +21 -0
- data/app/pb_kits/playbook/pb_user/_user.scss +51 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_default.html.erb +41 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_size.html.erb +35 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_text_only.html.erb +17 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size.html.erb +33 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +11 -0
- data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_user/user.rb +117 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.html.erb +8 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +21 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.scss +24 -0
- data/app/pb_kits/playbook/pb_user_badge/badges/_million-dollar.html.erb +88 -0
- data/app/pb_kits/playbook/pb_user_badge/badges/_veteran.html.erb +17 -0
- data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_default.html.erb +11 -0
- data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_default.jsx +12 -0
- data/app/pb_kits/playbook/pb_user_badge/docs/_user_badge_size.html.erb +18 -0
- data/app/pb_kits/playbook/pb_user_badge/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_user_badge/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +62 -0
- data/app/pb_kits/playbook/pb_vertical_nav/_item.html.erb +4 -4
- data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.scss +10 -11
- data/app/pb_kits/playbook/pb_vertical_nav/docs/_block_nav.html.erb +5 -0
- data/app/pb_kits/playbook/pb_vertical_nav/docs/_default_nav.html.erb +3 -3
- data/app/pb_kits/playbook/pb_vertical_nav/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_vertical_nav/item.rb +28 -29
- data/app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb +18 -13
- data/app/pb_kits/playbook/tokens/_border_radius.scss +33 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +35 -248
- data/app/pb_kits/playbook/tokens/_line_height.scss +9 -0
- data/app/pb_kits/playbook/tokens/_opacity.scss +12 -0
- data/app/pb_kits/playbook/tokens/_positioning.scss +11 -0
- data/app/pb_kits/playbook/tokens/_shadows.scss +14 -5
- data/app/pb_kits/playbook/tokens/_spacing.scss +0 -1
- data/app/pb_kits/playbook/tokens/_transition.scss +1 -0
- data/app/pb_kits/playbook/tokens/{_typography.sass → _typography.scss} +25 -0
- data/app/views/layouts/playbook/_nav.html.slim +4 -1
- data/app/views/layouts/playbook/_sidebar.html.slim +1 -1
- data/app/views/layouts/playbook/application.html.slim +7 -3
- data/app/views/playbook/pages/kit_show.html.slim +1 -1
- data/app/views/playbook/pages/principals/_getting_started.html.md +22 -4
- data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +2 -1
- data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +2 -1
- data/lib/generators/kit/USAGE +2 -29
- data/lib/generators/kit/kit_generator.rb +78 -71
- data/lib/generators/kit/templates/kit_example_rails.erb.tt +1 -0
- data/lib/generators/kit/templates/kit_example_react.erb.tt +12 -0
- data/lib/generators/kit/templates/kit_example_yml.erb.tt +9 -0
- data/lib/generators/kit/templates/kit_html.erb.tt +6 -0
- data/lib/generators/kit/templates/kit_js.erb.tt +1 -0
- data/lib/generators/kit/templates/kit_jsx.erb.tt +21 -0
- data/lib/generators/kit/templates/kit_pack.erb.tt +4 -0
- data/lib/generators/kit/templates/kit_ruby.erb.tt +32 -0
- data/lib/generators/kit/templates/kit_scss.erb +3 -0
- data/lib/playbook.rb +2 -0
- data/lib/playbook/engine.rb +15 -14
- data/lib/playbook/version.rb +3 -1
- data/lib/tasks/db.rake +2 -0
- data/lib/tasks/playbook_tasks.rake +9 -7
- metadata +332 -227
- data/app/pb_kits/playbook/pb_button/_variations.json +0 -15
- data/app/pb_kits/playbook/pb_button/docs/_button_dark.html.erb +0 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_light.html.erb +0 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_sizes.html.erb +0 -3
- data/app/pb_kits/playbook/pb_caption/_caption_lg.scss +0 -5
- data/app/pb_kits/playbook/tokens/_border_radius.sass +0 -27
- data/components/Avatar/Avatar.jsx +0 -96
- data/components/Avatar/AvatarStory.jsx +0 -19
- data/components/Avatar/styles.scss +0 -54
- data/components/Avatar/styles.scss.flow +0 -14
- data/components/Badge/Badge.jsx +0 -40
- data/components/Badge/BadgeStory.jsx +0 -40
- data/components/Badge/badges.scss +0 -167
- data/components/Badge/labels.scss +0 -121
- data/components/Badge/styles.scss +0 -4
- data/components/Badge/styles.scss.flow +0 -38
- data/components/Banner/Banner.jsx +0 -54
- data/components/Banner/BannerStory.jsx +0 -22
- data/components/Banner/styles.scss +0 -75
- data/components/Banner/styles.scss.flow +0 -19
- data/components/Button/Button.jsx +0 -75
- data/components/Button/ButtonStory.jsx +0 -94
- data/components/Capping/CappingStory.jsx +0 -21
- data/components/Card/Card.jsx +0 -44
- data/components/Card/CardStory.jsx +0 -19
- data/components/CircleButton/CircleButton.jsx +0 -51
- data/components/CircleButton/CircleButtonStory.jsx +0 -25
- data/components/CircleButton/styles.scss +0 -33
- data/components/CircleButton/styles.scss.flow +0 -6
- data/components/CollapsibleCard/CollapsibleCard.jsx +0 -108
- data/components/CollapsibleCard/CollapsibleCardStory.jsx +0 -26
- data/components/Color/Color.jsx +0 -55
- data/components/Color/ColorStory.jsx +0 -16
- data/components/Color/styles.scss +0 -6
- data/components/Color/styles.scss.flow +0 -5
- data/components/ColorPickerInput/ColorPickerInput.jsx +0 -99
- data/components/ColorPickerInput/ColorPickerInputStory.jsx +0 -37
- data/components/ColorPickerInput/colorPickerInput.scss +0 -10
- data/components/ColorPickerInput/colorPickerInput.scss.flow +0 -6
- data/components/DOBInput/index.jsx +0 -35
- data/components/DOBInput/story.jsx +0 -20
- data/components/DOBInput/styles.scss +0 -11
- data/components/DOBInput/styles.scss.flow +0 -7
- data/components/DatePicker/DatePicker.jsx +0 -156
- data/components/DatePicker/DatePickerStory.jsx +0 -22
- data/components/DatePicker/styles.scss +0 -6
- data/components/DatePicker/styles.scss.flow +0 -5
- data/components/DateTimePicker/DateTimePicker.jsx +0 -109
- data/components/DateTimePicker/DateTimePickerStory.jsx +0 -31
- data/components/DateTimePicker/story-styles.scss +0 -3
- data/components/DateTimePicker/story-styles.scss.flow +0 -5
- data/components/DateTimePicker/styles.scss +0 -1
- data/components/DateTimePicker/styles.scss.flow +0 -5
- data/components/Errors/Errors.jsx +0 -38
- data/components/FileCard/FileCard.jsx +0 -183
- data/components/FileCard/FileCardStory.jsx +0 -62
- data/components/FileCard/styles.scss +0 -81
- data/components/FileCard/styles.scss.flow +0 -12
- data/components/Flip/Flip.jsx +0 -50
- data/components/Flip/FlipStory.jsx +0 -85
- data/components/Flip/styles.scss +0 -41
- data/components/Flip/styles.scss.flow +0 -11
- data/components/FlyoutPanel/FlyoutPanel.jsx +0 -34
- data/components/FlyoutPanel/FlyoutPanelStory.jsx +0 -36
- data/components/FlyoutPanel/flyout_panel.scss +0 -33
- data/components/FlyoutPanel/flyout_panel.scss.flow +0 -11
- data/components/Grade/Grade.jsx +0 -55
- data/components/Grade/GradeStory.jsx +0 -18
- data/components/Grade/grade.scss +0 -39
- data/components/Grade/grade.scss.flow +0 -6
- data/components/Highlight/Highlight.jsx +0 -39
- data/components/Highlight/HighlightStory.jsx +0 -22
- data/components/Highlight/styles.scss +0 -24
- data/components/Highlight/styles.scss.flow +0 -17
- data/components/Icon/Icon.jsx +0 -54
- data/components/Icon/IconButtonStory.jsx +0 -20
- data/components/Icon/IconStory.jsx +0 -25
- data/components/IconToggle/IconToggle.jsx +0 -56
- data/components/IconToggle/IconToggleStory.jsx +0 -24
- data/components/Milestones/MilestoneItem.jsx +0 -47
- data/components/Milestones/MilestoneItemStory.jsx +0 -25
- data/components/Milestones/Milestones.jsx +0 -51
- data/components/Milestones/MilestonesStory.jsx +0 -30
- data/components/Milestones/milestones.scss +0 -19
- data/components/Milestones/milestones.scss.flow +0 -7
- data/components/Milestones/milestones_item.scss +0 -157
- data/components/Milestones/milestones_item.scss.flow +0 -13
- data/components/Milestones/milestones_variables.scss +0 -11
- data/components/Modal/ModalStory.jsx +0 -29
- data/components/MonogramAvatar/MonogramAvatar.jsx +0 -91
- data/components/MonogramAvatar/MonogramAvatarStory.jsx +0 -21
- data/components/MonogramAvatar/monogram_avatar.scss +0 -54
- data/components/MonogramAvatar/monogram_avatar.scss.flow +0 -10
- data/components/Panel/Panel.jsx +0 -159
- data/components/Panel/PanelStory.jsx +0 -23
- data/components/Panel/panel.scss +0 -32
- data/components/Panel/panel.scss.flow +0 -12
- data/components/PanelGroup/PanelGroup.jsx +0 -121
- data/components/PanelGroup/PanelGroup.scss +0 -96
- data/components/PanelGroup/PanelGroup.scss.flow +0 -6
- data/components/PanelGroup/PanelGroupStory.jsx +0 -112
- data/components/SearchCollectionSelect/SearchCollectionSelect.jsx +0 -29
- data/components/SearchCollectionSelect/SearchCollectionSelectStory.jsx +0 -48
- data/components/SideModal/SideModalStory.jsx +0 -31
- data/components/Spinner/Spinner.jsx +0 -80
- data/components/Spinner/SpinnerStory.jsx +0 -21
- data/components/Spinner/spinner.scss +0 -6
- data/components/Spinner/spinner.scss.flow +0 -5
- data/components/StepMeter/StepMeter.jsx +0 -75
- data/components/StepMeter/StepMeterStory.jsx +0 -25
- data/components/StepMeter/step_meter.scss +0 -120
- data/components/StepMeter/step_meter.scss.flow +0 -9
- data/components/Survey/Survey.jsx +0 -190
- data/components/Survey/SurveyStory.jsx +0 -125
- data/components/Survey/survey.scss +0 -75
- data/components/Survey/survey.scss.flow +0 -11
- data/components/Tab/Tab.jsx +0 -70
- data/components/Tab/tab.scss +0 -25
- data/components/Tab/tab.scss.flow +0 -6
- data/components/TabList/TabList.jsx +0 -35
- data/components/TabList/TabListStory.jsx +0 -31
- data/components/TabList/tabList.scss +0 -5
- data/components/TabList/tabList.scss.flow +0 -5
- data/components/Text/Text.jsx +0 -53
- data/components/Text/TextStory.jsx +0 -23
- data/components/Text/styles.scss +0 -3
- data/components/Text/styles.scss.flow +0 -123
- data/components/Text/text.scss +0 -35
- data/components/TextInput/TextInput.jsx +0 -95
- data/components/TextInput/TextInputStory.jsx +0 -23
- data/components/TextInput/form-control.scss +0 -96
- data/components/TextInput/styles.scss +0 -3
- data/components/TextInput/styles.scss.flow +0 -7
- data/components/TimePicker/TimePicker.jsx +0 -218
- data/components/TimePicker/TimePickerStory.jsx +0 -22
- data/components/TimePicker/styles.scss +0 -1
- data/components/TimePicker/styles.scss.flow +0 -5
- data/components/ToggleButton/ToggleButton.jsx +0 -68
- data/components/ToggleButton/ToggleButtonStory.jsx +0 -46
- data/components/ToggleButton/toggleButton.scss +0 -70
- data/components/ToggleButton/toggleButton.scss.flow +0 -14
- data/components/UserStamp/UserStamp.jsx +0 -40
- data/components/UserStamp/UserStampStory.jsx +0 -22
- data/components/UserStamp/styles.scss +0 -6
- data/components/UserStamp/styles.scss.flow +0 -7
- data/components/Wip/Wip.jsx +0 -34
- data/components/index.js +0 -33
- data/components/types.js +0 -21
- data/lib/generators/kit/templates/html.erb +0 -3
- data/lib/generators/kit/templates/javascript.erb +0 -4
- data/lib/generators/kit/templates/logo.txt +0 -28
- data/lib/generators/kit/templates/ruby.erb +0 -48
- data/lib/generators/kit/templates/scss.erb +0 -0
- data/lib/generators/kit/templates/storyrails.erb +0 -2
- data/lib/generators/kit/templates/storyreact.erb +0 -2
- data/lib/generators/kit/templates/variations.erb +0 -10
@@ -1,80 +0,0 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import classnames from "classnames"
|
3
|
-
|
4
|
-
import spinnerStyles from "./spinner.scss"
|
5
|
-
|
6
|
-
type Props = {
|
7
|
-
position?: 'centered',
|
8
|
-
top?: number,
|
9
|
-
right?: number,
|
10
|
-
bottom?: number,
|
11
|
-
left?: number,
|
12
|
-
active?: boolean,
|
13
|
-
}
|
14
|
-
|
15
|
-
export default class Spinner extends React.Component<Props> {
|
16
|
-
static defaultProps = {
|
17
|
-
top: 90,
|
18
|
-
right: 15,
|
19
|
-
bottom: null,
|
20
|
-
left: null,
|
21
|
-
active: true,
|
22
|
-
}
|
23
|
-
props: Props
|
24
|
-
render() {
|
25
|
-
const {
|
26
|
-
active,
|
27
|
-
position,
|
28
|
-
top,
|
29
|
-
right,
|
30
|
-
bottom,
|
31
|
-
left
|
32
|
-
} = this.props
|
33
|
-
|
34
|
-
let styles
|
35
|
-
if(!position) styles = { top: top, right: right, bottom: bottom, left: left }
|
36
|
-
|
37
|
-
const css = classnames([
|
38
|
-
"Spinner",
|
39
|
-
active ? "visible" : "hidden",
|
40
|
-
position ? spinnerStyles[position] : null,
|
41
|
-
])
|
42
|
-
|
43
|
-
return (
|
44
|
-
<div
|
45
|
-
className={css}
|
46
|
-
style={styles}
|
47
|
-
>
|
48
|
-
<span className="badge">
|
49
|
-
<svg
|
50
|
-
height="30px"
|
51
|
-
id="loader-1"
|
52
|
-
style={{ enableBackground: "new 0 0 50 50" }}
|
53
|
-
version="1.1"
|
54
|
-
viewBox="0 0 50 50"
|
55
|
-
width="30px"
|
56
|
-
x="0px"
|
57
|
-
xmlSpace="preserve"
|
58
|
-
y="0px"
|
59
|
-
>
|
60
|
-
<path
|
61
|
-
d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"
|
62
|
-
fill="#004976"
|
63
|
-
transform="rotate(70 25 25)"
|
64
|
-
>
|
65
|
-
<animateTransform
|
66
|
-
attributeName="transform"
|
67
|
-
attributeType="xml"
|
68
|
-
dur="0.6s"
|
69
|
-
from="0 25 25"
|
70
|
-
repeatCount="indefinite"
|
71
|
-
to="360 25 25"
|
72
|
-
type="rotate"
|
73
|
-
/>
|
74
|
-
</path>
|
75
|
-
</svg>
|
76
|
-
</span>
|
77
|
-
</div>
|
78
|
-
)
|
79
|
-
}
|
80
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import React from "react"
|
2
|
-
|
3
|
-
import Spinner from './Spinner'
|
4
|
-
|
5
|
-
import { boolean, number, select } from "@storybook/addon-knobs"
|
6
|
-
|
7
|
-
export default function SpinnerStory(stories) {
|
8
|
-
stories.add("Spinner",
|
9
|
-
() => {
|
10
|
-
const props = {
|
11
|
-
active: boolean("active", true),
|
12
|
-
position: select("position", [null, "centered"], null),
|
13
|
-
top: number("top", null),
|
14
|
-
right: number("right", null),
|
15
|
-
bottom: number("bottom", null),
|
16
|
-
left: number("left", null),
|
17
|
-
}
|
18
|
-
return <Spinner {...props} />
|
19
|
-
}
|
20
|
-
)
|
21
|
-
}
|
@@ -1,75 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import React from 'react'
|
4
|
-
import { map } from 'lodash'
|
5
|
-
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
|
6
|
-
import classnames from 'classnames'
|
7
|
-
|
8
|
-
import Icon from '../Icon/Icon'
|
9
|
-
import styles from './step_meter.scss'
|
10
|
-
|
11
|
-
type States = 'done' | 'started' | 'none'
|
12
|
-
|
13
|
-
type Step = {|
|
14
|
-
id: number,
|
15
|
-
name: string,
|
16
|
-
state: States,
|
17
|
-
|}
|
18
|
-
|
19
|
-
type Props = {
|
20
|
-
className: string,
|
21
|
-
steps: Array<Step>,
|
22
|
-
type: string,
|
23
|
-
}
|
24
|
-
|
25
|
-
const StepMeter = ({
|
26
|
-
steps,
|
27
|
-
type,
|
28
|
-
className
|
29
|
-
}: Props) => {
|
30
|
-
const classes = [
|
31
|
-
className,
|
32
|
-
styles['step-meter'],
|
33
|
-
styles[`type-${type}`],
|
34
|
-
]
|
35
|
-
return (
|
36
|
-
<ul className={classnames(classes)}>
|
37
|
-
{
|
38
|
-
map(steps, (step, idx) => (
|
39
|
-
<Choose>
|
40
|
-
<When condition={type == 'simple'}>
|
41
|
-
<OverlayTrigger
|
42
|
-
key={idx}
|
43
|
-
overlay={<Tooltip id={`tooltip-step.name`}>{step.name}</Tooltip>}
|
44
|
-
placement="bottom"
|
45
|
-
trigger={['hover', 'focus']}
|
46
|
-
>
|
47
|
-
<li
|
48
|
-
className={`text-uppercase ${styles[step.state]}`}
|
49
|
-
/>
|
50
|
-
</OverlayTrigger>
|
51
|
-
</When>
|
52
|
-
<Otherwise>
|
53
|
-
<li
|
54
|
-
className={`text-uppercase ${styles[step.state]}`}
|
55
|
-
key={idx}
|
56
|
-
>
|
57
|
-
<If condition={step.state == 'done'}>
|
58
|
-
<Icon
|
59
|
-
label=""
|
60
|
-
name="check"
|
61
|
-
/>
|
62
|
-
</If>
|
63
|
-
<span>
|
64
|
-
{step.name}
|
65
|
-
</span>
|
66
|
-
</li>
|
67
|
-
</Otherwise>
|
68
|
-
</Choose>
|
69
|
-
))
|
70
|
-
}
|
71
|
-
</ul>
|
72
|
-
)
|
73
|
-
}
|
74
|
-
|
75
|
-
export default StepMeter
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import React from "react"
|
2
|
-
import StepMeter from "./StepMeter"
|
3
|
-
|
4
|
-
import { object, select } from "@storybook/addon-knobs"
|
5
|
-
|
6
|
-
export default function StepMeterStory(stories) {
|
7
|
-
stories.add("StepMeter",
|
8
|
-
() => {
|
9
|
-
let props = {
|
10
|
-
type: select("Type", ["complex", "simple"], "complex"),
|
11
|
-
steps: object(
|
12
|
-
"steps",
|
13
|
-
[
|
14
|
-
{ id: 1, name: 'Apply', state: 'done'},
|
15
|
-
{ id: 2, name: 'Screen', state: 'done'},
|
16
|
-
{ id: 3, name: 'Interview', state: 'started'},
|
17
|
-
{ id: 4, name: 'Offer', state: 'none'},
|
18
|
-
{ id: 5, name: 'Hired', state: 'none'},
|
19
|
-
]
|
20
|
-
)
|
21
|
-
}
|
22
|
-
return <StepMeter {...props}/>
|
23
|
-
}
|
24
|
-
)
|
25
|
-
}
|
@@ -1,120 +0,0 @@
|
|
1
|
-
@import "base-variables/_colors.scss";
|
2
|
-
@import "base-variables/_spacing.sass";
|
3
|
-
@import "base-variables/_border-radius.sass";
|
4
|
-
@import "base-variables/_typography.sass";
|
5
|
-
|
6
|
-
$step-size-sm: 10px;
|
7
|
-
|
8
|
-
.step-meter {
|
9
|
-
list-style-type: none;
|
10
|
-
padding: 0 $space-base;
|
11
|
-
margin: 0;
|
12
|
-
|
13
|
-
li {
|
14
|
-
background: $sky;
|
15
|
-
border-radius: $border-rad-heavy*2;
|
16
|
-
color: $ink-light;
|
17
|
-
font-size: $font-smallest - 1;
|
18
|
-
font-weight: 400;
|
19
|
-
display: inline-block;
|
20
|
-
height: 18px;
|
21
|
-
line-height: 20px;
|
22
|
-
margin: 0 $space-small;
|
23
|
-
min-width: 75px;
|
24
|
-
padding: 0 $space-smallest;
|
25
|
-
position: relative;
|
26
|
-
text-align: center;
|
27
|
-
text-transform: uppercase;
|
28
|
-
|
29
|
-
&::before {
|
30
|
-
content: '';
|
31
|
-
background: $sky;
|
32
|
-
position: absolute;
|
33
|
-
height: 4px;
|
34
|
-
left: -14px;
|
35
|
-
right: 0;
|
36
|
-
top: calc(50% - 2px);
|
37
|
-
width: 14px;
|
38
|
-
}
|
39
|
-
|
40
|
-
&:first-child {
|
41
|
-
&::before {
|
42
|
-
display: none;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
&.done,
|
47
|
-
&.done::before {
|
48
|
-
background: $power-blue;
|
49
|
-
}
|
50
|
-
&.started,
|
51
|
-
&.started::before {
|
52
|
-
background: $power-blue;
|
53
|
-
}
|
54
|
-
&.error,
|
55
|
-
&.error::before {
|
56
|
-
background: $power-red;
|
57
|
-
}
|
58
|
-
|
59
|
-
&.done,
|
60
|
-
&.started,
|
61
|
-
&.error {
|
62
|
-
color: white;
|
63
|
-
}
|
64
|
-
|
65
|
-
span {
|
66
|
-
&:first-child {
|
67
|
-
margin-right: $space-smallest/2;
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
&.type-simple {
|
73
|
-
width: 100%;
|
74
|
-
display: flex;
|
75
|
-
|
76
|
-
li {
|
77
|
-
min-width: auto;
|
78
|
-
height: 10px;
|
79
|
-
line-height: 10px;
|
80
|
-
flex-grow: 1;
|
81
|
-
margin: 0;
|
82
|
-
background: transparent !important;
|
83
|
-
|
84
|
-
span {
|
85
|
-
display: none;
|
86
|
-
}
|
87
|
-
|
88
|
-
&::before {
|
89
|
-
height: 2px;
|
90
|
-
top: calc(50% - 1px);
|
91
|
-
left: calc(-50% + 5px);
|
92
|
-
width: calc(100% - 10px);
|
93
|
-
}
|
94
|
-
&::after {
|
95
|
-
content: '';
|
96
|
-
position: absolute;
|
97
|
-
top: 0;
|
98
|
-
left: calc(50% - 5px);
|
99
|
-
width: $step-size-sm;
|
100
|
-
height: $step-size-sm;
|
101
|
-
border-radius: $step-size-sm/2;
|
102
|
-
background-color: $sky;
|
103
|
-
border: 2px solid $sky;
|
104
|
-
}
|
105
|
-
|
106
|
-
&.done::after, &.done::before {
|
107
|
-
background: $online-green;
|
108
|
-
border-color: $online-green;
|
109
|
-
}
|
110
|
-
&.error::after, &.error::before {
|
111
|
-
background: $power-red;
|
112
|
-
border-color: $power-red;
|
113
|
-
}
|
114
|
-
&.started::after {
|
115
|
-
background: transparent;
|
116
|
-
border-color: $power-blue;
|
117
|
-
}
|
118
|
-
}
|
119
|
-
}
|
120
|
-
}
|
@@ -1,190 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import React from 'react'
|
4
|
-
|
5
|
-
import classnames from 'classnames'
|
6
|
-
import styles from './survey.scss'
|
7
|
-
|
8
|
-
import {
|
9
|
-
Errors,
|
10
|
-
Spinner,
|
11
|
-
} from '..'
|
12
|
-
|
13
|
-
import { SurveyQuestions } from '../types'
|
14
|
-
|
15
|
-
import {
|
16
|
-
Button,
|
17
|
-
Icon,
|
18
|
-
Panel,
|
19
|
-
} from '../index'
|
20
|
-
|
21
|
-
type Props = {
|
22
|
-
canSubmit?: boolean,
|
23
|
-
dismissable?: boolean,
|
24
|
-
errors: Array<string>,
|
25
|
-
loading?: boolean,
|
26
|
-
onChange: () => mixed,
|
27
|
-
onDismiss: () => mixed,
|
28
|
-
onSubmit: () => mixed,
|
29
|
-
questions: SurveyQuestions,
|
30
|
-
submitting: boolean,
|
31
|
-
}
|
32
|
-
|
33
|
-
export default class Survey extends React.Component<Props> {
|
34
|
-
static defaultProps = {
|
35
|
-
canSubmit: true,
|
36
|
-
dismissable: true,
|
37
|
-
errors: [],
|
38
|
-
loading: false,
|
39
|
-
modal: false,
|
40
|
-
onChange: function(){},
|
41
|
-
onDismiss: function(){},
|
42
|
-
onSubmit: function(){},
|
43
|
-
questions: [],
|
44
|
-
submitting: false,
|
45
|
-
}
|
46
|
-
props: Props
|
47
|
-
|
48
|
-
handleOnSubmit = (e) => {
|
49
|
-
e.preventDefault();
|
50
|
-
this.props.onSubmit();
|
51
|
-
}
|
52
|
-
|
53
|
-
handleOnChange(qaIdx) {
|
54
|
-
this.props.onChange(...qaIdx)
|
55
|
-
}
|
56
|
-
|
57
|
-
renderHeader() {
|
58
|
-
const {
|
59
|
-
errors,
|
60
|
-
} = this.props
|
61
|
-
return (
|
62
|
-
<div>
|
63
|
-
<If condition={errors && errors.length}>
|
64
|
-
<Errors messages={errors} />
|
65
|
-
</If>
|
66
|
-
</div>
|
67
|
-
)
|
68
|
-
}
|
69
|
-
renderBody() {
|
70
|
-
const {
|
71
|
-
questions,
|
72
|
-
submitting,
|
73
|
-
} = this.props
|
74
|
-
const css = classnames([
|
75
|
-
'panel-default',
|
76
|
-
styles.surveyQuestion,
|
77
|
-
])
|
78
|
-
|
79
|
-
if(!questions.length) return null
|
80
|
-
|
81
|
-
return (
|
82
|
-
<ol className={styles['survey-question-list']}>
|
83
|
-
{questions.map((q, i) =>
|
84
|
-
(
|
85
|
-
<li
|
86
|
-
className={styles['survey-question']}
|
87
|
-
key={`question-li-${i}`}
|
88
|
-
>
|
89
|
-
<Panel
|
90
|
-
className={css}
|
91
|
-
flush
|
92
|
-
key={`question-${i}`}
|
93
|
-
title={q.question}
|
94
|
-
>
|
95
|
-
<ul className={styles['survey-question-answer-list']}>
|
96
|
-
{q.answers.map((answer, x) => {
|
97
|
-
let otherProps = {
|
98
|
-
onChange: this.handleOnChange.bind(this, [i, x]),
|
99
|
-
}
|
100
|
-
if(submitting) otherProps.disabled = true
|
101
|
-
if(answer.selected) otherProps.checked = true
|
102
|
-
|
103
|
-
return (
|
104
|
-
<li
|
105
|
-
className={styles['survey-question-answer']}
|
106
|
-
key={`question-${i}-answer-${x}-li`}
|
107
|
-
>
|
108
|
-
<label>
|
109
|
-
<input
|
110
|
-
name={`question-${i}-answer`}
|
111
|
-
type="radio"
|
112
|
-
defaultValue={answer.value}
|
113
|
-
{...otherProps}
|
114
|
-
/>
|
115
|
-
<span>
|
116
|
-
{answer.label}
|
117
|
-
</span>
|
118
|
-
</label>
|
119
|
-
</li>
|
120
|
-
)
|
121
|
-
})}
|
122
|
-
</ul>
|
123
|
-
</Panel>
|
124
|
-
</li>
|
125
|
-
)
|
126
|
-
)}
|
127
|
-
</ol>
|
128
|
-
)
|
129
|
-
}
|
130
|
-
renderFooter() {
|
131
|
-
const {
|
132
|
-
canSubmit,
|
133
|
-
submitting,
|
134
|
-
} = this.props
|
135
|
-
|
136
|
-
let props = {
|
137
|
-
text: submitting ? "Submitting Answers" : "Submit Answers",
|
138
|
-
type: submitting ? "" : "submit",
|
139
|
-
}
|
140
|
-
if(!canSubmit || submitting) props.disabled = true
|
141
|
-
props.className = classnames([
|
142
|
-
"btn-primary",
|
143
|
-
styles.submit,
|
144
|
-
])
|
145
|
-
if(submitting) {
|
146
|
-
props.icon = (
|
147
|
-
<Icon
|
148
|
-
className="mr-3 fa-spin"
|
149
|
-
name="spinner"
|
150
|
-
spin
|
151
|
-
/>
|
152
|
-
)
|
153
|
-
}
|
154
|
-
|
155
|
-
return (
|
156
|
-
<Button {...props} />
|
157
|
-
)
|
158
|
-
}
|
159
|
-
renderLoading() {
|
160
|
-
return (
|
161
|
-
<div className={styles.overlay}>
|
162
|
-
<Spinner
|
163
|
-
position="centered"
|
164
|
-
/>
|
165
|
-
</div>
|
166
|
-
)
|
167
|
-
}
|
168
|
-
render() {
|
169
|
-
const {
|
170
|
-
loading,
|
171
|
-
questions,
|
172
|
-
} = this.props
|
173
|
-
|
174
|
-
return (
|
175
|
-
<form
|
176
|
-
className={styles.survey}
|
177
|
-
onSubmit={this.handleOnSubmit}
|
178
|
-
>
|
179
|
-
<div>
|
180
|
-
<If condition={loading}>{this.renderLoading()}</If>
|
181
|
-
{this.renderHeader()}
|
182
|
-
<If condition={questions.length > 0}>
|
183
|
-
{this.renderBody()}
|
184
|
-
{this.renderFooter()}
|
185
|
-
</If>
|
186
|
-
</div>
|
187
|
-
</form>
|
188
|
-
)
|
189
|
-
}
|
190
|
-
}
|