playbook_ui 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +316 -0
- data/Rakefile +32 -0
- data/app/assets/config/playbook_manifest.js +2 -0
- data/app/assets/images/clark.jpg +0 -0
- data/app/assets/images/giant.jpg +0 -0
- data/app/assets/images/pb-caret.svg +1 -0
- data/app/assets/images/pb-check.svg +11 -0
- data/app/controllers/playbook/application_controller.rb +10 -0
- data/app/controllers/playbook/guides_controller.rb +8 -0
- data/app/controllers/playbook/pages_controller.rb +50 -0
- data/app/helpers/playbook/application_helper.rb +19 -0
- data/app/helpers/playbook/layout_helper.rb +7 -0
- data/app/helpers/playbook/pb_doc_helper.rb +68 -0
- data/app/helpers/playbook/pb_kit_helper.rb +45 -0
- data/app/helpers/playbook/redcarpet_helper.rb +154 -0
- data/app/pb_kits/playbook/config/_kit_example.html.slim +5 -0
- data/app/pb_kits/playbook/config/_kit_ui.html.slim +24 -0
- data/app/pb_kits/playbook/config/_pb_kit_api.html.erb +18 -0
- data/app/pb_kits/playbook/packs/application.js +12 -0
- data/app/pb_kits/playbook/packs/examples.js +37 -0
- data/app/pb_kits/playbook/packs/kits.js +11 -0
- data/app/pb_kits/playbook/packs/main.scss +9 -0
- data/app/pb_kits/playbook/packs/pb_avatar.js +4 -0
- data/app/pb_kits/playbook/packs/pb_body.js +4 -0
- data/app/pb_kits/playbook/packs/pb_button.js +4 -0
- data/app/pb_kits/playbook/packs/pb_caption.js +4 -0
- data/app/pb_kits/playbook/packs/pb_card.js +4 -0
- data/app/pb_kits/playbook/packs/pb_image.js +6 -0
- data/app/pb_kits/playbook/packs/pb_input.js +4 -0
- data/app/pb_kits/playbook/packs/pb_layout.js +4 -0
- data/app/pb_kits/playbook/packs/pb_list.js +4 -0
- data/app/pb_kits/playbook/packs/pb_table.js +16 -0
- data/app/pb_kits/playbook/packs/pb_title.js +4 -0
- data/app/pb_kits/playbook/packs/pb_vertical_nav.js +4 -0
- data/app/pb_kits/playbook/packs/site_styles/_kit_style_index.scss +13 -0
- data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +43 -0
- data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +72 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +8 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss +531 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +90 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +173 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +22 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +82 -0
- data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +72 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.html.erb +8 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +62 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +49 -0
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +82 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.html.erb +5 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +16 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_monogram.html.erb +5 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_monogram.jsx +16 -0
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_avatar/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_body/_body.html.erb +4 -0
- data/app/pb_kits/playbook/pb_body/_body.jsx +36 -0
- data/app/pb_kits/playbook/pb_body/_body.scss +37 -0
- data/app/pb_kits/playbook/pb_body/body.rb +76 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_dark.html.erb +3 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_dark.jsx +14 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +3 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +14 -0
- data/app/pb_kits/playbook/pb_body/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_body/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_button/_button.html.erb +9 -0
- data/app/pb_kits/playbook/pb_button/_button.jsx +40 -0
- data/app/pb_kits/playbook/pb_button/_button.scss +53 -0
- data/app/pb_kits/playbook/pb_button/_variations.json +15 -0
- data/app/pb_kits/playbook/pb_button/button.rb +87 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_dark.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_dark.jsx +14 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_light.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_light.jsx +14 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_sizes.html.erb +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_sizes.jsx +14 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_caption/_caption.html.erb +2 -0
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +39 -0
- data/app/pb_kits/playbook/pb_caption/_caption.scss +5 -0
- data/app/pb_kits/playbook/pb_caption/_caption_lg.scss +5 -0
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +23 -0
- data/app/pb_kits/playbook/pb_caption/caption.rb +78 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_dark.html.erb +2 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_dark.jsx +13 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_light.html.erb +2 -0
- data/app/pb_kits/playbook/pb_caption/docs/_caption_light.jsx +13 -0
- data/app/pb_kits/playbook/pb_caption/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_caption/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_card/_card.html.erb +6 -0
- data/app/pb_kits/playbook/pb_card/_card.jsx +25 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +14 -0
- data/app/pb_kits/playbook/pb_card/card.rb +37 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +3 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_light.jsx +12 -0
- data/app/pb_kits/playbook/pb_card/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_card/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_image/_image.html.erb +5 -0
- data/app/pb_kits/playbook/pb_image/_image.jsx +32 -0
- data/app/pb_kits/playbook/pb_image/_image.scss +15 -0
- data/app/pb_kits/playbook/pb_image/docs/_default_image.html.erb +1 -0
- data/app/pb_kits/playbook/pb_image/docs/_default_image.jsx +12 -0
- data/app/pb_kits/playbook/pb_image/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_image/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_image/image.rb +53 -0
- data/app/pb_kits/playbook/pb_input/_input.html.erb +17 -0
- data/app/pb_kits/playbook/pb_input/_input.jsx +57 -0
- data/app/pb_kits/playbook/pb_input/_input.scss +58 -0
- data/app/pb_kits/playbook/pb_input/docs/_input_default.html.erb +5 -0
- data/app/pb_kits/playbook/pb_input/docs/_input_default.jsx +16 -0
- data/app/pb_kits/playbook/pb_input/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_input/input.rb +85 -0
- data/app/pb_kits/playbook/pb_kit/base.rb +38 -0
- data/app/pb_kits/playbook/pb_layout/_body.html.erb +6 -0
- data/app/pb_kits/playbook/pb_layout/_body.jsx +26 -0
- data/app/pb_kits/playbook/pb_layout/_layout.html.erb +6 -0
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +54 -0
- data/app/pb_kits/playbook/pb_layout/_layout.scss +87 -0
- data/app/pb_kits/playbook/pb_layout/_layout_mixin.scss +60 -0
- data/app/pb_kits/playbook/pb_layout/_sidebar.html.erb +6 -0
- data/app/pb_kits/playbook/pb_layout/_sidebar.jsx +26 -0
- data/app/pb_kits/playbook/pb_layout/body.rb +37 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_lg.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_lg_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_md.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_md_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_sm.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_sm_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_xl.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_xl_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_xs.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_xs.jsx +15 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_xs_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +14 -0
- data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_layout/layout.rb +109 -0
- data/app/pb_kits/playbook/pb_layout/sidebar.rb +37 -0
- data/app/pb_kits/playbook/pb_list/_item.html.erb +6 -0
- data/app/pb_kits/playbook/pb_list/_list.html.erb +9 -0
- data/app/pb_kits/playbook/pb_list/_list.jsx +56 -0
- data/app/pb_kits/playbook/pb_list/_list.scss +94 -0
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +26 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_borderless.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_dark.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_borderless.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_lg.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_ordered.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_dark_xpadding.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_default.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_default.jsx +16 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_lg.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_ordered.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/_list_xpadding.html.erb +7 -0
- data/app/pb_kits/playbook/pb_list/docs/example.yml +14 -0
- data/app/pb_kits/playbook/pb_list/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_list/item.rb +41 -0
- data/app/pb_kits/playbook/pb_list/list.rb +114 -0
- data/app/pb_kits/playbook/pb_table/_table.html.erb +12 -0
- data/app/pb_kits/playbook/pb_table/_table.jsx +60 -0
- data/app/pb_kits/playbook/pb_table/_table.scss +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_container.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_container.jsx +45 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_container_dark.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_container_dark.jsx +46 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_dark.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_dark.jsx +45 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_disable_hover.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_disable_hover.jsx +45 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_lg.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_lg.jsx +43 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_md.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_md.jsx +43 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_multiline.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_multiline.jsx +43 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_single_line.html.erb +48 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_single_line.jsx +45 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sm.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_sm.jsx +43 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +21 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +9 -0
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +14 -0
- data/app/pb_kits/playbook/pb_table/styles/_as-cards.scss +49 -0
- data/app/pb_kits/playbook/pb_table/styles/_content.scss +13 -0
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +17 -0
- data/app/pb_kits/playbook/pb_table/styles/_hover.scss +66 -0
- data/app/pb_kits/playbook/pb_table/styles/_mixins.scss +0 -0
- data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +138 -0
- data/app/pb_kits/playbook/pb_table/styles/_reset.scss +17 -0
- data/app/pb_kits/playbook/pb_table/styles/_single-line.scss +35 -0
- data/app/pb_kits/playbook/pb_table/styles/_structure.scss +39 -0
- data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +88 -0
- data/app/pb_kits/playbook/pb_table/styles/_table-dark.scss +92 -0
- data/app/pb_kits/playbook/pb_table/styles/_variables.scss +23 -0
- data/app/pb_kits/playbook/pb_table/table.rb +95 -0
- data/app/pb_kits/playbook/pb_title/_title.html.erb +1 -0
- data/app/pb_kits/playbook/pb_title/_title.jsx +33 -0
- data/app/pb_kits/playbook/pb_title/_title.scss +32 -0
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +57 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_dark.html.erb +4 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_dark.jsx +15 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +4 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_light.jsx +15 -0
- data/app/pb_kits/playbook/pb_title/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_title/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_title/title.rb +76 -0
- data/app/pb_kits/playbook/pb_vertical_nav/_item.html.erb +8 -0
- data/app/pb_kits/playbook/pb_vertical_nav/_item.jsx +34 -0
- data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.html.erb +13 -0
- data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.jsx +31 -0
- data/app/pb_kits/playbook/pb_vertical_nav/_vertical_nav.scss +73 -0
- data/app/pb_kits/playbook/pb_vertical_nav/docs/_default_nav.html.erb +5 -0
- data/app/pb_kits/playbook/pb_vertical_nav/docs/_default_nav.jsx +15 -0
- data/app/pb_kits/playbook/pb_vertical_nav/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_vertical_nav/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_vertical_nav/item.rb +65 -0
- data/app/pb_kits/playbook/pb_vertical_nav/vertical_nav.rb +59 -0
- data/app/pb_kits/playbook/tokens/_animation-curves.scss +37 -0
- data/app/pb_kits/playbook/tokens/_border_radius.sass +27 -0
- data/app/pb_kits/playbook/tokens/_colors.scss +417 -0
- data/app/pb_kits/playbook/tokens/_fonts.scss +97 -0
- data/app/pb_kits/playbook/tokens/_line_height.scss +7 -0
- data/app/pb_kits/playbook/tokens/_opacity.scss +9 -0
- data/app/pb_kits/playbook/tokens/_positioning.scss +24 -0
- data/app/pb_kits/playbook/tokens/_screen_sizes.scss +30 -0
- data/app/pb_kits/playbook/tokens/_shadows.scss +8 -0
- data/app/pb_kits/playbook/tokens/_spacing.scss +27 -0
- data/app/pb_kits/playbook/tokens/_typography.sass +64 -0
- data/app/pb_kits/playbook/utilities/_background_colors.scss +21 -0
- data/app/pb_kits/playbook/utilities/_colors.scss +26 -0
- data/app/views/layouts/playbook/_nav.html.slim +3 -0
- data/app/views/layouts/playbook/_sidebar.html.slim +29 -0
- data/app/views/layouts/playbook/application.html.slim +18 -0
- data/app/views/layouts/playbook/fullscreen.html.slim +10 -0
- data/app/views/layouts/playbook/grid.html.slim +10 -0
- data/app/views/playbook/guides/create_kit.html.slim +16 -0
- data/app/views/playbook/guides/create_kit/_file_naming.html.md +2 -0
- data/app/views/playbook/guides/create_kit/_generator.html.md +6 -0
- data/app/views/playbook/guides/create_kit/_kit_examples.html.md +2 -0
- data/app/views/playbook/guides/create_kit/_kit_rails.html.md +2 -0
- data/app/views/playbook/guides/create_kit/_kit_react.html.md +2 -0
- data/app/views/playbook/guides/create_kit/_layout.html.md +2 -0
- data/app/views/playbook/guides/create_kit/_view_objects.html.md +2 -0
- data/app/views/playbook/guides/create_kit/_writing_sass.md +10 -0
- data/app/views/playbook/guides/use_nitro.html.slim +6 -0
- data/app/views/playbook/guides/use_nitro/_local.html.md +2 -0
- data/app/views/playbook/guides/use_nitro/_nitro_components.html.md +2 -0
- data/app/views/playbook/guides/use_nitro/_versions.html.md +2 -0
- data/app/views/playbook/pages/fullscreen.html.slim +10 -0
- data/app/views/playbook/pages/grid.html.slim +2 -0
- data/app/views/playbook/pages/home.html.slim +4 -0
- data/app/views/playbook/pages/kit_show.html.slim +14 -0
- data/app/views/playbook/pages/kits.html.slim +10 -0
- data/app/views/playbook/pages/principals/_getting_started.html.md +12 -0
- data/app/views/playbook/pages/principles.html.slim +5 -0
- data/app/views/playbook/pages/tokens.html.slim +15 -0
- data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +16 -0
- data/app/views/playbook/pages/utilities.html.slim +89 -0
- data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +14 -0
- data/components/Avatar/Avatar.jsx +96 -0
- data/components/Avatar/AvatarStory.jsx +19 -0
- data/components/Avatar/styles.scss +54 -0
- data/components/Avatar/styles.scss.flow +14 -0
- data/components/Badge/Badge.jsx +40 -0
- data/components/Badge/BadgeStory.jsx +40 -0
- data/components/Badge/badges.scss +167 -0
- data/components/Badge/labels.scss +121 -0
- data/components/Badge/styles.scss +4 -0
- data/components/Badge/styles.scss.flow +38 -0
- data/components/Banner/Banner.jsx +54 -0
- data/components/Banner/BannerStory.jsx +22 -0
- data/components/Banner/styles.scss +75 -0
- data/components/Banner/styles.scss.flow +19 -0
- data/components/Button/Button.jsx +75 -0
- data/components/Button/ButtonStory.jsx +94 -0
- data/components/Capping/CappingStory.jsx +21 -0
- data/components/Card/Card.jsx +44 -0
- data/components/Card/CardStory.jsx +19 -0
- data/components/CircleButton/CircleButton.jsx +51 -0
- data/components/CircleButton/CircleButtonStory.jsx +25 -0
- data/components/CircleButton/styles.scss +33 -0
- data/components/CircleButton/styles.scss.flow +6 -0
- data/components/CollapsibleCard/CollapsibleCard.jsx +108 -0
- data/components/CollapsibleCard/CollapsibleCardStory.jsx +26 -0
- data/components/Color/Color.jsx +55 -0
- data/components/Color/ColorStory.jsx +16 -0
- data/components/Color/styles.scss +6 -0
- data/components/Color/styles.scss.flow +5 -0
- data/components/ColorPickerInput/ColorPickerInput.jsx +99 -0
- data/components/ColorPickerInput/ColorPickerInputStory.jsx +37 -0
- data/components/ColorPickerInput/colorPickerInput.scss +10 -0
- data/components/ColorPickerInput/colorPickerInput.scss.flow +6 -0
- data/components/DOBInput/index.jsx +35 -0
- data/components/DOBInput/story.jsx +20 -0
- data/components/DOBInput/styles.scss +11 -0
- data/components/DOBInput/styles.scss.flow +7 -0
- data/components/DatePicker/DatePicker.jsx +156 -0
- data/components/DatePicker/DatePickerStory.jsx +22 -0
- data/components/DatePicker/styles.scss +6 -0
- data/components/DatePicker/styles.scss.flow +5 -0
- data/components/DateTimePicker/DateTimePicker.jsx +109 -0
- data/components/DateTimePicker/DateTimePickerStory.jsx +31 -0
- data/components/DateTimePicker/story-styles.scss +3 -0
- data/components/DateTimePicker/story-styles.scss.flow +5 -0
- data/components/DateTimePicker/styles.scss +1 -0
- data/components/DateTimePicker/styles.scss.flow +5 -0
- data/components/Errors/Errors.jsx +38 -0
- data/components/FileCard/FileCard.jsx +183 -0
- data/components/FileCard/FileCardStory.jsx +62 -0
- data/components/FileCard/styles.scss +81 -0
- data/components/FileCard/styles.scss.flow +12 -0
- data/components/Flip/Flip.jsx +50 -0
- data/components/Flip/FlipStory.jsx +85 -0
- data/components/Flip/styles.scss +41 -0
- data/components/Flip/styles.scss.flow +11 -0
- data/components/FlyoutPanel/FlyoutPanel.jsx +34 -0
- data/components/FlyoutPanel/FlyoutPanelStory.jsx +36 -0
- data/components/FlyoutPanel/flyout_panel.scss +33 -0
- data/components/FlyoutPanel/flyout_panel.scss.flow +11 -0
- data/components/Grade/Grade.jsx +55 -0
- data/components/Grade/GradeStory.jsx +18 -0
- data/components/Grade/grade.scss +39 -0
- data/components/Grade/grade.scss.flow +6 -0
- data/components/Highlight/Highlight.jsx +39 -0
- data/components/Highlight/HighlightStory.jsx +22 -0
- data/components/Highlight/styles.scss +24 -0
- data/components/Highlight/styles.scss.flow +17 -0
- data/components/Icon/Icon.jsx +54 -0
- data/components/Icon/IconButtonStory.jsx +20 -0
- data/components/Icon/IconStory.jsx +25 -0
- data/components/IconToggle/IconToggle.jsx +56 -0
- data/components/IconToggle/IconToggleStory.jsx +24 -0
- data/components/Milestones/MilestoneItem.jsx +47 -0
- data/components/Milestones/MilestoneItemStory.jsx +25 -0
- data/components/Milestones/Milestones.jsx +51 -0
- data/components/Milestones/MilestonesStory.jsx +30 -0
- data/components/Milestones/milestones.scss +19 -0
- data/components/Milestones/milestones.scss.flow +7 -0
- data/components/Milestones/milestones_item.scss +157 -0
- data/components/Milestones/milestones_item.scss.flow +13 -0
- data/components/Milestones/milestones_variables.scss +11 -0
- data/components/Modal/ModalStory.jsx +29 -0
- data/components/MonogramAvatar/MonogramAvatar.jsx +91 -0
- data/components/MonogramAvatar/MonogramAvatarStory.jsx +21 -0
- data/components/MonogramAvatar/monogram_avatar.scss +54 -0
- data/components/MonogramAvatar/monogram_avatar.scss.flow +10 -0
- data/components/Panel/Panel.jsx +159 -0
- data/components/Panel/PanelStory.jsx +23 -0
- data/components/Panel/panel.scss +32 -0
- data/components/Panel/panel.scss.flow +12 -0
- data/components/PanelGroup/PanelGroup.jsx +121 -0
- data/components/PanelGroup/PanelGroup.scss +96 -0
- data/components/PanelGroup/PanelGroup.scss.flow +6 -0
- data/components/PanelGroup/PanelGroupStory.jsx +112 -0
- data/components/SearchCollectionSelect/SearchCollectionSelect.jsx +29 -0
- data/components/SearchCollectionSelect/SearchCollectionSelectStory.jsx +48 -0
- data/components/SearchCollectionSelect/searchCollectionSelect.scss +0 -0
- data/components/SideModal/SideModalStory.jsx +31 -0
- data/components/Spinner/Spinner.jsx +80 -0
- data/components/Spinner/SpinnerStory.jsx +21 -0
- data/components/Spinner/spinner.scss +6 -0
- data/components/Spinner/spinner.scss.flow +5 -0
- data/components/StepMeter/StepMeter.jsx +75 -0
- data/components/StepMeter/StepMeterStory.jsx +25 -0
- data/components/StepMeter/step_meter.scss +120 -0
- data/components/StepMeter/step_meter.scss.flow +9 -0
- data/components/Survey/Survey.jsx +190 -0
- data/components/Survey/SurveyStory.jsx +125 -0
- data/components/Survey/survey.scss +75 -0
- data/components/Survey/survey.scss.flow +11 -0
- data/components/Tab/Tab.jsx +70 -0
- data/components/Tab/tab.scss +25 -0
- data/components/Tab/tab.scss.flow +6 -0
- data/components/TabList/TabList.jsx +35 -0
- data/components/TabList/TabListStory.jsx +31 -0
- data/components/TabList/tabList.scss +5 -0
- data/components/TabList/tabList.scss.flow +5 -0
- data/components/Text/Text.jsx +53 -0
- data/components/Text/TextStory.jsx +23 -0
- data/components/Text/styles.scss +3 -0
- data/components/Text/styles.scss.flow +123 -0
- data/components/Text/text.scss +35 -0
- data/components/TextInput/TextInput.jsx +95 -0
- data/components/TextInput/TextInputStory.jsx +23 -0
- data/components/TextInput/form-control.scss +96 -0
- data/components/TextInput/styles.scss +3 -0
- data/components/TextInput/styles.scss.flow +7 -0
- data/components/TimePicker/TimePicker.jsx +218 -0
- data/components/TimePicker/TimePickerStory.jsx +22 -0
- data/components/TimePicker/styles.scss +1 -0
- data/components/TimePicker/styles.scss.flow +5 -0
- data/components/ToggleButton/ToggleButton.jsx +68 -0
- data/components/ToggleButton/ToggleButtonStory.jsx +46 -0
- data/components/ToggleButton/toggleButton.scss +70 -0
- data/components/ToggleButton/toggleButton.scss.flow +14 -0
- data/components/UserStamp/UserStamp.jsx +40 -0
- data/components/UserStamp/UserStampStory.jsx +22 -0
- data/components/UserStamp/styles.scss +6 -0
- data/components/UserStamp/styles.scss.flow +7 -0
- data/components/Wip/Wip.jsx +34 -0
- data/components/index.js +33 -0
- data/components/types.js +21 -0
- data/db/migrate/20171025045845_devise_create_users.rb +42 -0
- data/db/migrate/20171025050917_create_sections.rb +9 -0
- data/db/migrate/20171025050923_create_categories.rb +10 -0
- data/db/migrate/20171025050930_create_pages.rb +12 -0
- data/db/migrate/20171025050935_create_tags.rb +9 -0
- data/db/migrate/20171025050941_create_types.rb +10 -0
- data/db/migrate/20171025051118_create_page_tags.rb +8 -0
- data/db/migrate/20171025051848_add_user_ref_to_pages.rb +5 -0
- data/db/migrate/20171025051853_add_type_ref_to_pages.rb +5 -0
- data/db/migrate/20171025051859_add_page_ref_to_page_tags.rb +5 -0
- data/db/migrate/20171025051904_add_tag_ref_to_page_tags.rb +5 -0
- data/db/migrate/20171025052205_add_section_ref_to_categories.rb +5 -0
- data/db/migrate/20171025052211_add_category_ref_to_pages.rb +5 -0
- data/db/migrate/20180327194658_add_nitro_id_to_user.rb +14 -0
- data/db/migrate/20180327195455_create_friendly_id_slugs.rb +15 -0
- data/db/migrate/20180328142634_drop_types.rb +5 -0
- data/db/migrate/20180328145054_remove_type_id_from_pages.rb +5 -0
- data/db/migrate/20180328145144_drop_friendly_id_slugs.rb +6 -0
- data/db/migrate/20180518133907_add_page_ref_to_pages.rb +5 -0
- data/db/seeds.rb +7 -0
- data/fonts/fontawesome.js +1978 -0
- data/fonts/regular.js +1217 -0
- data/lib/generators/kit/USAGE +32 -0
- data/lib/generators/kit/kit_generator.rb +86 -0
- data/lib/generators/kit/templates/html.erb +3 -0
- data/lib/generators/kit/templates/javascript.erb +4 -0
- data/lib/generators/kit/templates/jsx.erb +31 -0
- data/lib/generators/kit/templates/logo.txt +28 -0
- data/lib/generators/kit/templates/ruby.erb +48 -0
- data/lib/generators/kit/templates/scss.erb +0 -0
- data/lib/generators/kit/templates/storyrails.erb +2 -0
- data/lib/generators/kit/templates/storyreact.erb +2 -0
- data/lib/generators/kit/templates/variations.erb +10 -0
- data/lib/playbook.rb +32 -0
- data/lib/playbook/engine.rb +34 -0
- data/lib/playbook/version.rb +3 -0
- data/lib/playbook_ui.rb +3 -0
- data/lib/tasks/db.rake +8 -0
- data/lib/tasks/playbook_tasks.rake +24 -0
- data/stories/basic.js +18 -0
- data/stories/complex.js +15 -0
- data/stories/form.js +2 -0
- data/stories/index.js +29 -0
- metadata +832 -0
@@ -0,0 +1,11 @@
|
|
1
|
+
// @flow
|
2
|
+
/* This file is automatically generated by css-modules-flow-types */
|
3
|
+
declare module.exports: {|
|
4
|
+
+'flyout-panel': string;
|
5
|
+
+'hidden-xxs': string;
|
6
|
+
+'left': string;
|
7
|
+
+'open': string;
|
8
|
+
+'right': string;
|
9
|
+
+'scroll-inner-box': string;
|
10
|
+
+'visible-xxs': string;
|
11
|
+
|};
|
@@ -0,0 +1,55 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import Icon from '../Icon/Icon'
|
5
|
+
import classnames from 'classnames'
|
6
|
+
|
7
|
+
import styles from './grade.scss'
|
8
|
+
|
9
|
+
type Props = {
|
10
|
+
className: string,
|
11
|
+
label: string,
|
12
|
+
grade: number,
|
13
|
+
starFullAt: number,
|
14
|
+
starEmptyAt: number,
|
15
|
+
}
|
16
|
+
|
17
|
+
const gradeToStarIconName = (grade: number, starFullAt: number, starEmptyAt: number): string => {
|
18
|
+
if (grade >= starFullAt) { return 'trophy-alt' }
|
19
|
+
if (grade <= starEmptyAt) { return 'star' }
|
20
|
+
|
21
|
+
return 'star-half'
|
22
|
+
}
|
23
|
+
|
24
|
+
class Grade extends React.Component<Props> {
|
25
|
+
static defaultProps = {
|
26
|
+
starFullAt: 10,
|
27
|
+
starEmptyAt: 0,
|
28
|
+
label: 'Grade'
|
29
|
+
}
|
30
|
+
props: Props
|
31
|
+
|
32
|
+
render() {
|
33
|
+
const { grade, label, starFullAt, starEmptyAt, className } = this.props
|
34
|
+
const classes = [
|
35
|
+
className,
|
36
|
+
styles.grade
|
37
|
+
]
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div className={classnames(classes)}>
|
41
|
+
<Icon
|
42
|
+
className={styles.star}
|
43
|
+
label=""
|
44
|
+
name={gradeToStarIconName(grade, starFullAt, starEmptyAt)}
|
45
|
+
/>
|
46
|
+
<div>
|
47
|
+
<p>{grade}</p>
|
48
|
+
<label>{label}</label>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
)
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
export default Grade
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import Grade from "./Grade"
|
3
|
+
|
4
|
+
import { number, text } from "@storybook/addon-knobs"
|
5
|
+
|
6
|
+
export default function GradeStory(stories) {
|
7
|
+
stories.add("Grade",
|
8
|
+
() => {
|
9
|
+
let props = {
|
10
|
+
grade: number("grade", 8.5, { range: true, min: 0, max: 10, step: 0.5 }),
|
11
|
+
starFullAt: number("starFullAt", 10, { range: true, min: 0, max: 10, step: 0.5 }),
|
12
|
+
starEmptyAt: number("starEmptyAt", 0, { range: true, min: 0, max: 10, step: 0.5 }),
|
13
|
+
label: text("label", "Grade")
|
14
|
+
}
|
15
|
+
return <Grade {...props}/>
|
16
|
+
}
|
17
|
+
)
|
18
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
@import "base-variables/_colors.scss";
|
2
|
+
@import "base-variables/_spacing.sass";
|
3
|
+
@import "base-variables/_typography.sass";
|
4
|
+
|
5
|
+
.grade {
|
6
|
+
display: flex;
|
7
|
+
flex-direction: row;
|
8
|
+
|
9
|
+
.star {
|
10
|
+
font-size: $font-largest;
|
11
|
+
line-height: 36px;
|
12
|
+
margin-right: $space-base;
|
13
|
+
color: $ink-lighter;
|
14
|
+
}
|
15
|
+
|
16
|
+
div {
|
17
|
+
display: flex;
|
18
|
+
flex-direction: column;
|
19
|
+
|
20
|
+
p {
|
21
|
+
font-size: $font-large;
|
22
|
+
color: $ink-light;
|
23
|
+
font-weight: $bold;
|
24
|
+
margin: 0;
|
25
|
+
padding: 0;
|
26
|
+
line-height: $font-large + 2;
|
27
|
+
text-align: center;
|
28
|
+
}
|
29
|
+
label {
|
30
|
+
margin: 0;
|
31
|
+
padding: 0;
|
32
|
+
color: $ink-lightest;
|
33
|
+
text-transform: uppercase;
|
34
|
+
font-weight: $regular;
|
35
|
+
font-size: $font-smaller;
|
36
|
+
line-height: $font-smaller + 2;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/* @flow */
|
2
|
+
import styles from './styles.scss'
|
3
|
+
import React from 'react'
|
4
|
+
import classnames from 'classnames'
|
5
|
+
|
6
|
+
type Props = {
|
7
|
+
|
8
|
+
side: "top" | "bottom" | "left" | "right"| null,
|
9
|
+
color: "power-navy" | "power-navy-darker" | "power-red" | "power-gold" | "power-blue" | "power-green" | "power-royal",
|
10
|
+
|
11
|
+
}
|
12
|
+
|
13
|
+
export default class Highlight extends React.Component<Props> {
|
14
|
+
static defaultProps = {
|
15
|
+
side: "",
|
16
|
+
color: "",
|
17
|
+
}
|
18
|
+
props: Props
|
19
|
+
render() {
|
20
|
+
const {
|
21
|
+
side,
|
22
|
+
color,
|
23
|
+
} = this.props
|
24
|
+
|
25
|
+
const css = [
|
26
|
+
styles[`highlight-${side}`],
|
27
|
+
styles[`highlight-${color}`],
|
28
|
+
]
|
29
|
+
|
30
|
+
return (
|
31
|
+
<div>
|
32
|
+
<span className={classnames(css,'well')} >{`I'm a ${side} highlight ${color}`}</span>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
)
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import Highlight from "./Highlight"
|
3
|
+
import { select, } from "@storybook/addon-knobs"
|
4
|
+
import classnames from 'classnames'
|
5
|
+
|
6
|
+
export default function HighlightStory(stories) {
|
7
|
+
stories.add("Highlight",
|
8
|
+
() => {
|
9
|
+
let props = {
|
10
|
+
side: select("side",['left','right','top','bottom'], 'left'),
|
11
|
+
color: select('color',['power-navy','power-red','power-blue','power-gold','power-green','power-navy-darker','power-royal'],'power-blue'),
|
12
|
+
}
|
13
|
+
|
14
|
+
const highlightSide = `highlight-${props.side}`
|
15
|
+
const highlightColor = `highlight-${props.color}`
|
16
|
+
|
17
|
+
|
18
|
+
return <Highlight {...props} className={classnames(highlightSide,highlightColor)}/>
|
19
|
+
|
20
|
+
}
|
21
|
+
)
|
22
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@import '../../sass-mixins/base-variables/colors';
|
2
|
+
@import '../../sass-mixins/base-mixins/all';
|
3
|
+
//highlight
|
4
|
+
$borderStyle: "solid";
|
5
|
+
$sides: "top" "right" "bottom" "left" ;
|
6
|
+
$borderWidth: 4px;
|
7
|
+
|
8
|
+
@mixin config-highlight-colors($prefix) {
|
9
|
+
@each $color in $power-colors {
|
10
|
+
.#{$prefix}-#{nth($color, 1)} {
|
11
|
+
border-color: #{nth($color,2)} !important;
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
@include config-highlight-colors("highlight");
|
17
|
+
@each $side in $sides {
|
18
|
+
|
19
|
+
.highlight-#{$side} {
|
20
|
+
border:0;
|
21
|
+
border-#{$side}-style: #{$borderStyle};
|
22
|
+
border-#{$side}-width: $borderWidth;
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// @flow
|
2
|
+
/* This file is automatically generated by css-modules-flow-types */
|
3
|
+
declare module.exports: {|
|
4
|
+
+'hidden-xxs': string;
|
5
|
+
+'highlight-bottom': string;
|
6
|
+
+'highlight-left': string;
|
7
|
+
+'highlight-power-blue': string;
|
8
|
+
+'highlight-power-gold': string;
|
9
|
+
+'highlight-power-green': string;
|
10
|
+
+'highlight-power-navy': string;
|
11
|
+
+'highlight-power-navy-darker': string;
|
12
|
+
+'highlight-power-red': string;
|
13
|
+
+'highlight-power-royal': string;
|
14
|
+
+'highlight-right': string;
|
15
|
+
+'highlight-top': string;
|
16
|
+
+'visible-xxs': string;
|
17
|
+
|};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import FontAwesome from "react-fontawesome"
|
3
|
+
import Text from '../Text/Text'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Icon renders a FontAwesome icon followed by a label.
|
7
|
+
*
|
8
|
+
* @param {string} name FontAwesome icon's name. For the icon 'fa-paperclip' for
|
9
|
+
* example, its name would be 'paperclip'.
|
10
|
+
* @param {string} label the text to use as a label.
|
11
|
+
* @param {string} size an optional FontAwesome icon size ('lg', '2x', '3x', etc).
|
12
|
+
* @param {func} onClick the function to be called when the React onClick event is triggered.
|
13
|
+
* @param {string} className class name is an option on the FontAwesome package that adds a class to the FontAwesome span.
|
14
|
+
* @param {string} title an optional title as a tooltip on mouse hover.
|
15
|
+
* @returns {ReactElement} JSX.
|
16
|
+
*/
|
17
|
+
|
18
|
+
export default class Icon extends React.Component<Props> {
|
19
|
+
static defaultProps = {
|
20
|
+
label: "",
|
21
|
+
spin: false,
|
22
|
+
}
|
23
|
+
props: IconType
|
24
|
+
render() {
|
25
|
+
const {
|
26
|
+
name,
|
27
|
+
label,
|
28
|
+
size,
|
29
|
+
spin,
|
30
|
+
onClick,
|
31
|
+
className,
|
32
|
+
title
|
33
|
+
} = this.props
|
34
|
+
return (
|
35
|
+
<span
|
36
|
+
className="icon"
|
37
|
+
onClick={onClick}
|
38
|
+
title={title}
|
39
|
+
>
|
40
|
+
<FontAwesome
|
41
|
+
className={`far ${className}`}
|
42
|
+
name={name}
|
43
|
+
size={size}
|
44
|
+
spin={spin}
|
45
|
+
/>
|
46
|
+
<If condition={label}>
|
47
|
+
<span className="ml-2" >
|
48
|
+
{label}
|
49
|
+
</span>
|
50
|
+
</If>
|
51
|
+
</span>
|
52
|
+
)
|
53
|
+
}
|
54
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import Icon from "./Icon"
|
3
|
+
import { Button } from "react-bootstrap"
|
4
|
+
|
5
|
+
import { text, boolean } from "@storybook/addon-knobs"
|
6
|
+
|
7
|
+
export default function IconStory(stories) {
|
8
|
+
stories.add("Button With Icon",
|
9
|
+
() => {
|
10
|
+
let props = {
|
11
|
+
className: text("className", ""),
|
12
|
+
name: text("name", "plus-circle"),
|
13
|
+
label: text("label", "Add User"),
|
14
|
+
}
|
15
|
+
return (
|
16
|
+
<Button><Icon {...props}/></Button>
|
17
|
+
)
|
18
|
+
}
|
19
|
+
)
|
20
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import Icon from "./Icon"
|
3
|
+
|
4
|
+
import { text, boolean } from "@storybook/addon-knobs"
|
5
|
+
|
6
|
+
export default function IconStory(stories) {
|
7
|
+
stories.add("Icon",
|
8
|
+
() => {
|
9
|
+
let props = {
|
10
|
+
className: text("className", ""),
|
11
|
+
name: text("name", "battery-half"),
|
12
|
+
label: text("label", "50%"),
|
13
|
+
size: text("size", "lg"),
|
14
|
+
spin: boolean("spin", false),
|
15
|
+
onClick: () => {
|
16
|
+
alert("Whaa? Why u click me?!")
|
17
|
+
},
|
18
|
+
title: text("title", "Battery Percentage")
|
19
|
+
}
|
20
|
+
return (
|
21
|
+
<Icon {...props}/>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
)
|
25
|
+
}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import Icon from '../Icon/Icon'
|
5
|
+
|
6
|
+
|
7
|
+
type Props = {
|
8
|
+
children?: Array<React.Node>,
|
9
|
+
className?: string,
|
10
|
+
iconOption1?:string,
|
11
|
+
iconOption2?:string,
|
12
|
+
size:string,
|
13
|
+
color:string,
|
14
|
+
}
|
15
|
+
|
16
|
+
export default class IconToggle extends React.Component<Props> {
|
17
|
+
|
18
|
+
static defaultProps = {
|
19
|
+
color: "text-sky",
|
20
|
+
className: "icon-toggle",
|
21
|
+
iconOption1:"minus-circle",
|
22
|
+
iconOption2:"plus-circle",
|
23
|
+
size:"text-larger",
|
24
|
+
}
|
25
|
+
|
26
|
+
props: Props
|
27
|
+
|
28
|
+
render() {
|
29
|
+
const{
|
30
|
+
className,
|
31
|
+
iconOption1,
|
32
|
+
iconOption2,
|
33
|
+
color,
|
34
|
+
size,
|
35
|
+
} = this.props
|
36
|
+
|
37
|
+
|
38
|
+
return (
|
39
|
+
<div>
|
40
|
+
<label className={`icon-toggle ${size} m-0`}>
|
41
|
+
<input className=""
|
42
|
+
type="checkbox"
|
43
|
+
/>
|
44
|
+
<Icon className={`${className,color}`}
|
45
|
+
name={iconOption1}
|
46
|
+
title={`icon-1`}
|
47
|
+
/>
|
48
|
+
<Icon className={`ml-4 ${className,color}`}
|
49
|
+
name={iconOption2}
|
50
|
+
title={`icon-2`}
|
51
|
+
/>
|
52
|
+
</label>
|
53
|
+
</div>
|
54
|
+
)
|
55
|
+
}
|
56
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import IconToggle from "./IconToggle"
|
3
|
+
|
4
|
+
import { text, select, } from "@storybook/addon-knobs"
|
5
|
+
|
6
|
+
|
7
|
+
export default function IconToggleStory(stories) {
|
8
|
+
stories.add("IconToggle",
|
9
|
+
() => {
|
10
|
+
let props = {
|
11
|
+
className: text("className", ""),
|
12
|
+
size: select("size", ["text-smallest", "text-smaller", "text-small","text-base","text-large","text-larger","text-largest","text-jumbo"],"text-larger"),
|
13
|
+
iconOption1:text("iconOption1","minus-circle"),
|
14
|
+
iconOption2:text("iconOption2","plus-circle"),
|
15
|
+
color:text("defaultColor","text-sky")
|
16
|
+
}
|
17
|
+
return (
|
18
|
+
|
19
|
+
<IconToggle {...props}/>
|
20
|
+
|
21
|
+
)
|
22
|
+
}
|
23
|
+
)
|
24
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
/* @flow */
|
2
|
+
|
3
|
+
import React from 'react'
|
4
|
+
import classnames from 'classnames'
|
5
|
+
import Icon from '../Icon/Icon'
|
6
|
+
|
7
|
+
import styles from './milestones_item.scss'
|
8
|
+
|
9
|
+
type Props = {
|
10
|
+
className: string,
|
11
|
+
name: string,
|
12
|
+
status: string,
|
13
|
+
background: string,
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
const statusToIconName = (status: string): string => {
|
18
|
+
if (status == 'done') { return 'check' }
|
19
|
+
if (status == 'started') { return 'dot-circle' }
|
20
|
+
return 'dot-circle'
|
21
|
+
}
|
22
|
+
|
23
|
+
export default class MilestoneItem extends React.Component<Props> {
|
24
|
+
static defaultProps = {
|
25
|
+
className: "",
|
26
|
+
background: "light"
|
27
|
+
}
|
28
|
+
props: Props
|
29
|
+
render() {
|
30
|
+
const {
|
31
|
+
className,
|
32
|
+
name,
|
33
|
+
status,
|
34
|
+
background,
|
35
|
+
} = this.props
|
36
|
+
const css = [
|
37
|
+
className,
|
38
|
+
styles[`milestone-item`],
|
39
|
+
styles[`background-${background}`],
|
40
|
+
styles[`status-${status}`],
|
41
|
+
]
|
42
|
+
return <li className={classnames(css)}>
|
43
|
+
<Icon name={statusToIconName(status)} className={styles[`icon`]}/>
|
44
|
+
<span className={styles[`milestone-item-label`]}>{name}</span>
|
45
|
+
</li>
|
46
|
+
}
|
47
|
+
}
|