playbook_ui 13.27.0 → 13.28.0.pre.alpha.PBNTR297gradientoverlay3029
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +3 -3
- data/app/pb_kits/playbook/index.js +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +3 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +40 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +14 -4
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +11 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +34 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +31 -0
- data/app/pb_kits/playbook/pb_avatar/Utilities/GetPlacementPropsHelper.tsx +16 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +16 -0
- data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -1
- data/app/pb_kits/playbook/pb_avatar/avatar.rb +4 -0
- data/app/pb_kits/playbook/pb_avatar/avatar.test.js +47 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.html.erb +46 -66
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +8 -29
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.md +3 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.html.erb +13 -33
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +48 -67
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.md +3 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +0 -20
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -6
- data/app/pb_kits/playbook/pb_badge/badge.html.erb +1 -6
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +4 -1
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +31 -0
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +16 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +2 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/{_bar_graph_custom.html.erb → _bar_graph_custom_rails.html.erb} +3 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_body/_body.scss +3 -0
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +1 -1
- data/app/pb_kits/playbook/pb_button/_button_mixins.scss +4 -3
- data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.html.erb +1 -6
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +7 -1
- data/app/pb_kits/playbook/pb_card/card.rb +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_background.html.erb +20 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +41 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -3
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +45 -0
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +22 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -6
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +53 -0
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +33 -16
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +92 -0
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +3 -75
- data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -6
- data/app/pb_kits/playbook/pb_collapsible/collapsible.test.js +24 -0
- data/app/pb_kits/playbook/pb_collapsible/collapsible_content.html.erb +1 -6
- data/app/pb_kits/playbook/pb_collapsible/collapsible_icon.html.erb +15 -0
- data/app/pb_kits/playbook/pb_collapsible/collapsible_icon.rb +37 -0
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +1 -6
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.jsx +72 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.html.erb +19 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.jsx +73 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.html.erb +20 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_collapsible/index.js +16 -6
- data/app/pb_kits/playbook/pb_contact/contact.html.erb +1 -6
- data/app/pb_kits/playbook/pb_currency/currency.html.erb +1 -6
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +7 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +9 -1
- data/app/pb_kits/playbook/pb_dashboard_value/dashboard_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date/date.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.html.erb +1 -5
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default_swift.md +61 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +4 -1
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_bold_swift.md +32 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default_swift.md +17 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year_swift.md +19 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_props_swift.md +10 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_reversed_swift.md +17 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_alignment_swift.md +39 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_default_swift.md +39 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_props_swift.md +15 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_size_swift.md +78 -0
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +1 -6
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_detail/_detail_mixins.scss +1 -1
- data/app/pb_kits/playbook/pb_docs/kit_example.html.erb +3 -3
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +10 -0
- data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +53 -0
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +92 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default.jsx +53 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +159 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +121 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +65 -0
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +54 -0
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +57 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +6 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +5 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md +5 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_subcomponent_structure.html.erb → _dropdown_subcomponent_structure_rails.html.erb} +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.md +6 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.md +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_display.html.erb → _dropdown_with_custom_display_rails.html.erb} +11 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.md +5 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +5 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_options.html.erb → _dropdown_with_custom_options_rails.html.erb} +16 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +5 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_trigger.html.erb → _dropdown_with_custom_trigger_rails.html.erb} +16 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -6
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +1 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +1 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +3 -9
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.rb +2 -6
- data/app/pb_kits/playbook/pb_dropdown/index.js +2 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +6 -14
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children_swift.md +23 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close_swift.md +7 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default_swift.md +9 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dismiss_with_timer_swift.md +22 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_swift.md +9 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions_swift.md +62 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_props_swift.md +8 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +1 -6
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +11 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +17 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +4 -1
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +6 -1
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +35 -0
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +1 -6
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_icon_value/icon_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_label_pill/label_pill.html.erb +1 -6
- data/app/pb_kits/playbook/pb_label_value/label_value.html.erb +1 -6
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +8 -2
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +52 -0
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +22 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -5
- data/app/pb_kits/playbook/pb_message/message_mention.html.erb +6 -6
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +8 -0
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -6
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +1 -6
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +12 -0
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +93 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +40 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +36 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +5 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +66 -0
- data/app/pb_kits/playbook/pb_pagination/_pagination.scss +1 -1
- data/app/pb_kits/playbook/pb_pagination/pagination.html.erb +1 -6
- data/app/pb_kits/playbook/pb_person/person.html.erb +1 -6
- data/app/pb_kits/playbook/pb_person_contact/person_contact.html.erb +1 -6
- data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -6
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -6
- data/app/pb_kits/playbook/pb_select/_select.scss +8 -0
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -0
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +30 -32
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +0 -2
- data/app/pb_kits/playbook/pb_source/source.html.erb +1 -5
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +1 -5
- data/app/pb_kits/playbook/pb_stat_value/stat_value.html.erb +1 -5
- data/app/pb_kits/playbook/pb_table/_table.tsx +5 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +33 -32
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +51 -50
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +54 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +37 -38
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +53 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_row.html.erb → _table_outer_padding.html.erb} +7 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +76 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -0
- data/app/pb_kits/playbook/pb_table/styles/_outer_padding.scss +21 -0
- data/app/pb_kits/playbook/pb_table/table.rb +14 -1
- data/app/pb_kits/playbook/pb_table/table.test.js +5 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +19 -0
- data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb +1 -5
- data/app/pb_kits/playbook/pb_time_stacked/time_stacked.html.erb +1 -5
- data/app/pb_kits/playbook/pb_timeline/item.html.erb +1 -5
- data/app/pb_kits/playbook/pb_timeline/timeline.html.erb +1 -5
- data/app/pb_kits/playbook/pb_timestamp/timestamp.html.erb +1 -6
- data/app/pb_kits/playbook/pb_title/_title.scss +5 -1
- data/app/pb_kits/playbook/pb_title_count/title_count.html.erb +1 -6
- data/app/pb_kits/playbook/pb_title_detail/title_detail.html.erb +1 -5
- data/app/pb_kits/playbook/pb_tooltip/index.js +1 -0
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +12 -9
- data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +61 -0
- data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +6 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb +1 -6
- data/app/pb_kits/playbook/playbook-doc.js +4 -0
- data/app/pb_kits/playbook/tokens/_titles.scss +5 -1
- data/app/pb_kits/playbook/tokens/_vertical_align.scss +18 -0
- data/app/pb_kits/playbook/utilities/_vertical_align.scss +16 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +12 -1
- data/dist/menu.yml +9 -4
- data/dist/playbook-rails.js +6 -6
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/forms/builder/dropdown_field.rb +14 -0
- data/lib/playbook/forms/builder/phone_number_field.rb +12 -0
- data/lib/playbook/forms/builder.rb +2 -0
- data/lib/playbook/kit_base.rb +3 -1
- data/lib/playbook/version.rb +2 -2
- data/lib/playbook/vertical_align.rb +37 -0
- metadata +94 -14
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +0 -63
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +0 -52
- /data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_column.html.erb → _table_alignment_column_rails.html.erb} +0 -0
@@ -20,7 +20,6 @@ $transition: $transition_cubic;
|
|
20
20
|
border: solid $border_light 2px;
|
21
21
|
border-radius: $border_rad_light;
|
22
22
|
height: 22px;
|
23
|
-
position: relative;
|
24
23
|
transition: background $transition_default ease, box-shadow $transition_default ease;
|
25
24
|
width: 22px;
|
26
25
|
.check_icon,
|
@@ -28,8 +27,8 @@ $transition: $transition_cubic;
|
|
28
27
|
color: $white;
|
29
28
|
height: 16px;
|
30
29
|
left: 1px;
|
31
|
-
position: relative;
|
32
30
|
display: flex;
|
31
|
+
margin: auto;
|
33
32
|
opacity: 0;
|
34
33
|
width: 16px;
|
35
34
|
&.hidden {
|
@@ -10,6 +10,7 @@ import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
|
10
10
|
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
11
11
|
import { globalProps } from "../utilities/globalProps";
|
12
12
|
import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props";
|
13
|
+
import { merge } from 'lodash'
|
13
14
|
|
14
15
|
type CircleChartProps = {
|
15
16
|
align?: "left" | "right" | "center";
|
@@ -18,6 +19,7 @@ type CircleChartProps = {
|
|
18
19
|
children?: Node;
|
19
20
|
className?: string;
|
20
21
|
colors?: string[];
|
22
|
+
customOptions?: Partial<Highcharts.Options>;
|
21
23
|
dark?: boolean;
|
22
24
|
data?: {[key: string]: string},
|
23
25
|
dataLabelHtml?: string;
|
@@ -67,6 +69,7 @@ const CircleChart = ({
|
|
67
69
|
children,
|
68
70
|
className,
|
69
71
|
colors = [],
|
72
|
+
customOptions = {},
|
70
73
|
dark = false,
|
71
74
|
data = {},
|
72
75
|
dataLabelHtml = "<div>{point.name}</div>",
|
@@ -115,6 +118,9 @@ const CircleChart = ({
|
|
115
118
|
innerSizes[size];
|
116
119
|
|
117
120
|
|
121
|
+
const filteredProps: any = {...props};
|
122
|
+
delete filteredProps.verticalAlign;
|
123
|
+
|
118
124
|
const [options, setOptions] = useState({});
|
119
125
|
|
120
126
|
useEffect(() => {
|
@@ -171,7 +177,7 @@ const CircleChart = ({
|
|
171
177
|
],
|
172
178
|
credits: false,
|
173
179
|
};
|
174
|
-
setOptions(
|
180
|
+
setOptions(merge(staticOptions, customOptions));
|
175
181
|
}, [chartData]);
|
176
182
|
|
177
183
|
|
@@ -181,7 +187,7 @@ const CircleChart = ({
|
|
181
187
|
<div id={`wrapper-circle-chart-${id}`}>
|
182
188
|
<HighchartsReact
|
183
189
|
containerProps={{
|
184
|
-
className: classnames("pb_circle_chart", globalProps(
|
190
|
+
className: classnames("pb_circle_chart", globalProps(filteredProps)),
|
185
191
|
id: id,
|
186
192
|
...ariaProps,
|
187
193
|
...dataProps,
|
@@ -195,7 +201,7 @@ const CircleChart = ({
|
|
195
201
|
) : (
|
196
202
|
<HighchartsReact
|
197
203
|
containerProps={{
|
198
|
-
className: classnames("pb_circle_chart", globalProps(
|
204
|
+
className: classnames("pb_circle_chart", globalProps(filteredProps)),
|
199
205
|
id: id,
|
200
206
|
...ariaProps,
|
201
207
|
...dataProps,
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render, screen } from '../utilities/test-utils';
|
3
|
+
import CircleChart from './_circle_chart';
|
4
|
+
|
5
|
+
beforeEach(() => {
|
6
|
+
// Silences error logs within the test suite.
|
7
|
+
jest.spyOn(console, 'error');
|
8
|
+
jest.spyOn(console, 'warn');
|
9
|
+
console.error.mockImplementation(() => {});
|
10
|
+
console.warn.mockImplementation(() => {});
|
11
|
+
});
|
12
|
+
|
13
|
+
afterEach(() => {
|
14
|
+
console.error.mockRestore();
|
15
|
+
console.warn.mockRestore();
|
16
|
+
});
|
17
|
+
|
18
|
+
const testId = 'circlechart1';
|
19
|
+
|
20
|
+
test('uses exact classname', () => {
|
21
|
+
const data = [
|
22
|
+
{
|
23
|
+
name: 'Waiting for Calls',
|
24
|
+
value: 41,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: 'On Call',
|
28
|
+
value: 49,
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: 'After call',
|
32
|
+
value: 10,
|
33
|
+
},
|
34
|
+
]
|
35
|
+
render(
|
36
|
+
<CircleChart
|
37
|
+
chartData={data}
|
38
|
+
data={{ testid: testId }}
|
39
|
+
id='circlechartid'
|
40
|
+
/>
|
41
|
+
);
|
42
|
+
|
43
|
+
const kit = screen.getByTestId(testId);
|
44
|
+
expect(kit).toHaveClass('pb_circle_chart');
|
45
|
+
});
|
@@ -8,6 +8,7 @@ module Playbook
|
|
8
8
|
default: "center"
|
9
9
|
prop :chart_data, type: Playbook::Props::Array,
|
10
10
|
default: []
|
11
|
+
prop :custom_options, default: {}
|
11
12
|
prop :style, type: Playbook::Props::Enum,
|
12
13
|
values: %w[pie],
|
13
14
|
default: "pie"
|
@@ -40,7 +41,7 @@ module Playbook
|
|
40
41
|
prop :x, type: Playbook::Props::Numeric
|
41
42
|
prop :y, type: Playbook::Props::Numeric
|
42
43
|
|
43
|
-
def
|
44
|
+
def standard_options
|
44
45
|
{
|
45
46
|
align: align,
|
46
47
|
id: id,
|
@@ -68,6 +69,26 @@ module Playbook
|
|
68
69
|
}
|
69
70
|
end
|
70
71
|
|
72
|
+
def chart_options
|
73
|
+
standard_options.deep_merge(custom_options)
|
74
|
+
end
|
75
|
+
|
76
|
+
def vertical_align_props
|
77
|
+
if vertical_align
|
78
|
+
if object.vertical_align
|
79
|
+
original_result = super
|
80
|
+
class_to_remove = "vertical_align_#{object.vertical_align}"
|
81
|
+
|
82
|
+
modified_result = original_result.gsub(class_to_remove, "").strip
|
83
|
+
modified_result.empty? ? nil : modified_result
|
84
|
+
else
|
85
|
+
super
|
86
|
+
end
|
87
|
+
else
|
88
|
+
super
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
71
92
|
def classname
|
72
93
|
generate_classname("pb_circle_chart")
|
73
94
|
end
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
id: object.id,
|
4
|
-
data: object.data,
|
5
|
-
class: object.classname,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<%= pb_rails("button", props: {type: object.type, link: object.link, new_window:object.new_window, variant: object.variant, disabled: object.disabled, dark: object.dark}) do %>
|
8
3
|
<%= pb_rails("icon", props: {icon: object.icon, fixed_width: true, dark: object.dark}) %>
|
9
4
|
<% end %>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`html structure is correct 1`] = `
|
4
|
+
<div>
|
5
|
+
<div
|
6
|
+
class="pb_collapsible_kit additional_class"
|
7
|
+
data-testid="collapsible1"
|
8
|
+
>
|
9
|
+
<div
|
10
|
+
class="pb_collapsible_main_kit cursor_pointer"
|
11
|
+
>
|
12
|
+
<div>
|
13
|
+
<div
|
14
|
+
class="pb_flex_kit_orientation_row_justify_content_left_align_items_center_spacing_between"
|
15
|
+
>
|
16
|
+
<div
|
17
|
+
class="pb_flex_item_kit"
|
18
|
+
>
|
19
|
+
<div>
|
20
|
+
Main Section
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
<div
|
24
|
+
class="pb_flex_item_kit"
|
25
|
+
>
|
26
|
+
<div
|
27
|
+
class="icon_wrapper"
|
28
|
+
style="vertical-align: middle; color: rgb(193, 205, 214);"
|
29
|
+
>
|
30
|
+
<i
|
31
|
+
class="pb_icon_kit far fa-fw fa-lg fa-chevron-down"
|
32
|
+
/>
|
33
|
+
<span
|
34
|
+
aria-label="chevron-down icon"
|
35
|
+
hidden=""
|
36
|
+
/>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<div
|
43
|
+
class="pb_collapsible_content_kit toggle-content"
|
44
|
+
data-collapsible-content="true"
|
45
|
+
style="height: 0px;"
|
46
|
+
>
|
47
|
+
<div>
|
48
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
`;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useEffect } from 'react'
|
1
|
+
import React, { useEffect, ReactElement } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
import useCollapsible from './useCollapsible'
|
4
4
|
|
@@ -9,10 +9,18 @@ import CollapsibleContent from './child_kits/CollapsibleContent'
|
|
9
9
|
import CollapsibleMain from './child_kits/CollapsibleMain'
|
10
10
|
import CollapsibleContext from './context'
|
11
11
|
import { IconSizes } from "../pb_icon/_icon"
|
12
|
+
import CollapsibleIcon from './child_kits/CollapsibleIcon'
|
12
13
|
|
14
|
+
type CollapsibleMainProps = {
|
15
|
+
children: React.ReactNode
|
16
|
+
}
|
17
|
+
|
18
|
+
type CollapsibleContentProps = {
|
19
|
+
children: React.ReactNode
|
20
|
+
}
|
13
21
|
|
14
22
|
type CollapsibleProps = {
|
15
|
-
children?:
|
23
|
+
children?: [ReactElement<CollapsibleMainProps>, ReactElement<CollapsibleContentProps>],
|
16
24
|
aria?: {[key: string]: string},
|
17
25
|
className?: string,
|
18
26
|
collapsed?: boolean,
|
@@ -29,7 +37,7 @@ type CollapsibleProps = {
|
|
29
37
|
const Collapsible = ({
|
30
38
|
aria = {},
|
31
39
|
className,
|
32
|
-
children
|
40
|
+
children,
|
33
41
|
collapsed = true,
|
34
42
|
data = {},
|
35
43
|
htmlOptions = {},
|
@@ -47,17 +55,19 @@ const Collapsible = ({
|
|
47
55
|
setIsCollapsed(collapsed)
|
48
56
|
},[collapsed])
|
49
57
|
|
50
|
-
|
51
|
-
|
52
|
-
if (CollapsibleParent.length !== 2) {
|
58
|
+
if (children.length !== 2) {
|
53
59
|
throw new Error('Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.')
|
54
60
|
}
|
55
61
|
|
56
|
-
const
|
57
|
-
const
|
62
|
+
const FirstChild = children[0]
|
63
|
+
const SecondChild = children[1]
|
64
|
+
|
65
|
+
const Main = FirstChild.type === CollapsibleMain ? FirstChild : null
|
66
|
+
const Content = SecondChild.type === CollapsibleContent ? SecondChild : null
|
67
|
+
|
58
68
|
|
59
|
-
const { children: mainChildren, ...mainProps } = Main.props
|
60
|
-
const { children: contentChildren, ...contentProps } = Content.props
|
69
|
+
const { children: mainChildren = null, ...mainProps } = Main ? Main.props : {}
|
70
|
+
const { children: contentChildren = null, ...contentProps } = Content ? Content.props : {}
|
61
71
|
const ariaProps = buildAriaProps(aria)
|
62
72
|
const dataProps = buildDataProps(data)
|
63
73
|
const htmlProps = buildHtmlProps(htmlOptions)
|
@@ -75,13 +85,19 @@ const Collapsible = ({
|
|
75
85
|
className={classes}
|
76
86
|
id={id}
|
77
87
|
>
|
78
|
-
|
79
|
-
{
|
80
|
-
|
88
|
+
{Main ? (
|
89
|
+
<CollapsibleMain {...mainProps}>
|
90
|
+
{mainChildren}
|
91
|
+
</CollapsibleMain>
|
92
|
+
) : (
|
93
|
+
FirstChild
|
94
|
+
)}
|
81
95
|
|
82
|
-
|
83
|
-
{
|
84
|
-
|
96
|
+
{Content && (
|
97
|
+
<CollapsibleContent {...contentProps}>
|
98
|
+
{contentChildren}
|
99
|
+
</CollapsibleContent>
|
100
|
+
)}
|
85
101
|
</div>
|
86
102
|
</CollapsibleContext.Provider>
|
87
103
|
)
|
@@ -89,5 +105,6 @@ const Collapsible = ({
|
|
89
105
|
|
90
106
|
Collapsible.Main = CollapsibleMain
|
91
107
|
Collapsible.Content = CollapsibleContent
|
108
|
+
Collapsible.Icon = CollapsibleIcon
|
92
109
|
|
93
110
|
export default Collapsible
|
@@ -0,0 +1,92 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import Icon, { IconSizes } from "../../pb_icon/_icon";
|
3
|
+
|
4
|
+
type IconColors =
|
5
|
+
| "default"
|
6
|
+
| "light"
|
7
|
+
| "lighter"
|
8
|
+
| "link"
|
9
|
+
| "error"
|
10
|
+
| "success";
|
11
|
+
|
12
|
+
type IconProps = {
|
13
|
+
collapsed: boolean | (() => void);
|
14
|
+
icon?: string[] | string;
|
15
|
+
iconColor?: IconColors;
|
16
|
+
iconSize?: IconSizes;
|
17
|
+
onIconClick?: () => void;
|
18
|
+
};
|
19
|
+
|
20
|
+
type colorMap = {
|
21
|
+
default: string;
|
22
|
+
light: string;
|
23
|
+
lighter: string;
|
24
|
+
link: string;
|
25
|
+
error: string;
|
26
|
+
success: string;
|
27
|
+
};
|
28
|
+
|
29
|
+
const colorMap = {
|
30
|
+
default: "#242B42",
|
31
|
+
light: "#687887",
|
32
|
+
lighter: "#C1CDD6",
|
33
|
+
link: "#0056CF",
|
34
|
+
error: "#FF2229",
|
35
|
+
success: "#00CA74",
|
36
|
+
};
|
37
|
+
|
38
|
+
const CollapsibleIcon = ({
|
39
|
+
collapsed,
|
40
|
+
icon,
|
41
|
+
iconSize,
|
42
|
+
iconColor,
|
43
|
+
onIconClick,
|
44
|
+
}: IconProps) => {
|
45
|
+
const color = colorMap[iconColor];
|
46
|
+
|
47
|
+
const showIcon = (icon: string | string[]) => {
|
48
|
+
if (typeof icon === "string") {
|
49
|
+
return [icon, icon];
|
50
|
+
}
|
51
|
+
return icon;
|
52
|
+
};
|
53
|
+
|
54
|
+
const handleIconClick = (e: React.MouseEvent<HTMLElement>) => {
|
55
|
+
if (onIconClick) {
|
56
|
+
e.stopPropagation();
|
57
|
+
onIconClick();
|
58
|
+
}
|
59
|
+
};
|
60
|
+
|
61
|
+
return (
|
62
|
+
<>
|
63
|
+
{collapsed ? (
|
64
|
+
<div
|
65
|
+
className="icon_wrapper"
|
66
|
+
key={icon ? showIcon(icon)[0] : "chevron-down"}
|
67
|
+
onClick={(e) => handleIconClick(e)}
|
68
|
+
style={{ verticalAlign: "middle", color: color }}
|
69
|
+
>
|
70
|
+
<Icon
|
71
|
+
icon={icon ? showIcon(icon)[0] : "chevron-down"}
|
72
|
+
size={iconSize}
|
73
|
+
/>
|
74
|
+
</div>
|
75
|
+
) : (
|
76
|
+
<div
|
77
|
+
className="icon_wrapper"
|
78
|
+
key={icon ? showIcon(icon)[1] : "chevron-up"}
|
79
|
+
onClick={(e) => handleIconClick(e)}
|
80
|
+
style={{ verticalAlign: "middle", color: color }}
|
81
|
+
>
|
82
|
+
<Icon
|
83
|
+
icon={icon ? showIcon(icon)[1] : "chevron-up"}
|
84
|
+
size={iconSize}
|
85
|
+
/>
|
86
|
+
</div>
|
87
|
+
)}
|
88
|
+
</>
|
89
|
+
);
|
90
|
+
};
|
91
|
+
|
92
|
+
export default CollapsibleIcon;
|
@@ -7,27 +7,9 @@ import { globalProps } from '../../utilities/globalProps'
|
|
7
7
|
|
8
8
|
import Flex from '../../pb_flex/_flex'
|
9
9
|
import FlexItem from '../../pb_flex/_flex_item'
|
10
|
-
import
|
10
|
+
import { IconSizes } from "../../pb_icon/_icon"
|
11
11
|
import CollapsibleContext from '../context'
|
12
|
-
|
13
|
-
|
14
|
-
type colorMap = {
|
15
|
-
default: string,
|
16
|
-
light: string,
|
17
|
-
lighter: string,
|
18
|
-
link: string,
|
19
|
-
error: string,
|
20
|
-
success: string
|
21
|
-
}
|
22
|
-
|
23
|
-
const colorMap = {
|
24
|
-
default: "#242B42",
|
25
|
-
light: "#687887",
|
26
|
-
lighter: "#C1CDD6",
|
27
|
-
link: "#0056CF",
|
28
|
-
error: "#FF2229",
|
29
|
-
success: "#00CA74",
|
30
|
-
}
|
12
|
+
import CollapsibleIcon from './CollapsibleIcon'
|
31
13
|
|
32
14
|
type CollapsibleMainProps = {
|
33
15
|
children: React.ReactNode[] | React.ReactNode,
|
@@ -38,60 +20,6 @@ type CollapsibleMainProps = {
|
|
38
20
|
}
|
39
21
|
type IconColors = "default" | "light" | "lighter" | "link" | "error" | "success"
|
40
22
|
|
41
|
-
type IconProps = {
|
42
|
-
collapsed: boolean | (()=> void)
|
43
|
-
icon?: string[] | string
|
44
|
-
iconColor?: IconColors
|
45
|
-
iconSize?: IconSizes
|
46
|
-
onIconClick?: ()=> void
|
47
|
-
}
|
48
|
-
|
49
|
-
const ToggleIcon = ({ collapsed, icon, iconSize, iconColor, onIconClick }: IconProps) => {
|
50
|
-
const color = colorMap[iconColor]
|
51
|
-
|
52
|
-
const showIcon = (icon: string |string[]) => {
|
53
|
-
if (typeof icon === "string") {
|
54
|
-
return [icon, icon]
|
55
|
-
}
|
56
|
-
return icon
|
57
|
-
}
|
58
|
-
|
59
|
-
const handleIconClick = (e: React.MouseEvent<HTMLElement>) => {
|
60
|
-
if (onIconClick) {
|
61
|
-
e.stopPropagation();
|
62
|
-
onIconClick()
|
63
|
-
}
|
64
|
-
}
|
65
|
-
|
66
|
-
return (
|
67
|
-
<>
|
68
|
-
{collapsed ? (
|
69
|
-
<div
|
70
|
-
className="icon_wrapper"
|
71
|
-
key={icon ? showIcon(icon)[0] : "chevron-down"}
|
72
|
-
onClick={(e)=> handleIconClick(e)}
|
73
|
-
style={{ verticalAlign: "middle", color: color }}
|
74
|
-
>
|
75
|
-
<Icon icon={icon ? showIcon(icon)[0] : "chevron-down"}
|
76
|
-
size={iconSize}
|
77
|
-
/>
|
78
|
-
</div>
|
79
|
-
) : (
|
80
|
-
<div
|
81
|
-
className="icon_wrapper"
|
82
|
-
key={icon ? showIcon(icon)[1] : "chevron-up"}
|
83
|
-
onClick={(e)=> handleIconClick(e)}
|
84
|
-
style={{ verticalAlign: "middle", color: color }}
|
85
|
-
>
|
86
|
-
<Icon icon={icon ? showIcon(icon)[1] : "chevron-up"}
|
87
|
-
size={iconSize}
|
88
|
-
/>
|
89
|
-
</div>
|
90
|
-
)}
|
91
|
-
</>
|
92
|
-
);
|
93
|
-
}
|
94
|
-
|
95
23
|
const CollapsibleMain = ({
|
96
24
|
children,
|
97
25
|
className,
|
@@ -120,7 +48,7 @@ const CollapsibleMain = ({
|
|
120
48
|
>
|
121
49
|
<FlexItem>{children}</FlexItem>
|
122
50
|
<FlexItem>
|
123
|
-
<
|
51
|
+
<CollapsibleIcon
|
124
52
|
collapsed={collapsed as () => void}
|
125
53
|
icon={icon as string[] | string}
|
126
54
|
iconColor={iconColor as IconColors}
|
@@ -48,3 +48,27 @@ test('returns namespaced additional_class class name', () => {
|
|
48
48
|
const kit = screen.getByTestId(testId)
|
49
49
|
expect(kit).toHaveClass(`${kitClass} additional_class`)
|
50
50
|
})
|
51
|
+
|
52
|
+
test('html structure is correct', () => {
|
53
|
+
const { container } = render(
|
54
|
+
<Collapsible
|
55
|
+
className="additional_class"
|
56
|
+
data={{ testid: testId }}
|
57
|
+
iconColor='lighter'
|
58
|
+
iconSize="lg"
|
59
|
+
>
|
60
|
+
<Collapsible.Main>
|
61
|
+
<div>{'Main Section'}</div>
|
62
|
+
</Collapsible.Main>
|
63
|
+
<Collapsible.Content>
|
64
|
+
<div>
|
65
|
+
{
|
66
|
+
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'
|
67
|
+
}
|
68
|
+
</div>
|
69
|
+
</Collapsible.Content>
|
70
|
+
</Collapsible>
|
71
|
+
)
|
72
|
+
|
73
|
+
expect(container).toMatchSnapshot()
|
74
|
+
})
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%= content_tag(:div,
|
2
|
+
id: object.id,
|
3
|
+
data: object.data,
|
4
|
+
class: object.classname,
|
5
|
+
aria: object.aria,
|
6
|
+
style: "color: #{object.icon_color};",
|
7
|
+
**combined_html_options) do %>
|
8
|
+
<% if object.icon.present? %>
|
9
|
+
<%= pb_rails("icon", props: { icon: object.show_icon(object.icon)[0], id:"collapsible_open_icon", size: object.size }) %>
|
10
|
+
<%= pb_rails("icon", props: { icon: object.show_icon(object.icon)[1], id:"collapsible_close_icon", size: object.size }) %>
|
11
|
+
<% else %>
|
12
|
+
<%= pb_rails("icon", props: { icon: "chevron-down", id:"collapsible_open_icon", size: object.size }) %>
|
13
|
+
<%= pb_rails("icon", props: { icon: "chevron-up", id:"collapsible_close_icon", size: object.size }) %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module PbCollapsible
|
5
|
+
class CollapsibleIcon < Playbook::KitBase
|
6
|
+
prop :collapsed, type: Playbook::Props::Boolean,
|
7
|
+
default: true
|
8
|
+
prop :color, type: Playbook::Props::Enum,
|
9
|
+
values: %w[default light lighter link success error],
|
10
|
+
default: "default"
|
11
|
+
prop :icon
|
12
|
+
prop :size, type: Playbook::Props::Enum,
|
13
|
+
values: ["lg", "xs", "sm", "1x", "2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x", nil],
|
14
|
+
default: nil
|
15
|
+
|
16
|
+
def classname
|
17
|
+
generate_classname("pb_collapsible_icon_kit", separator: " ")
|
18
|
+
end
|
19
|
+
|
20
|
+
def show_icon(icon)
|
21
|
+
case icon
|
22
|
+
when ::String
|
23
|
+
[icon, icon]
|
24
|
+
when ::Array
|
25
|
+
icon
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def icon_color
|
30
|
+
return "" if color.nil?
|
31
|
+
|
32
|
+
color_object = { light: "#687887", lighter: "#C1CDD6", link: "#0056CF", success: "#00CA74", error: "#FF2229", default: "#242B42" }
|
33
|
+
color_object[color.to_sym]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<%=
|
2
|
-
id: object.id,
|
3
|
-
data: object.data,
|
4
|
-
class: object.classname,
|
5
|
-
aria: object.aria,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
|
8
3
|
<%= pb_rails("flex", props: {vertical: "center", spacing: "between", cursor: "pointer"}) do %>
|
9
4
|
<%= pb_rails("flex/flex_item") do %>
|