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
@@ -2,7 +2,7 @@
|
|
2
2
|
aria: object.aria,
|
3
3
|
class: object.classname,
|
4
4
|
data: object.data,
|
5
|
-
id: object.id,
|
5
|
+
id: object.option[:id],
|
6
6
|
**combined_html_options) do %>
|
7
7
|
<%= pb_rails("list/item", props: {
|
8
8
|
display: "flex",
|
@@ -10,18 +10,12 @@
|
|
10
10
|
padding:"none",
|
11
11
|
cursor: "pointer"
|
12
12
|
}) do %>
|
13
|
-
|
14
|
-
align: "center",
|
15
|
-
classname:"dropdown_option_wrapper",
|
16
|
-
justify: "between",
|
17
|
-
padding_x:"sm",
|
18
|
-
padding_y:"xxs",
|
19
|
-
}) do %>
|
13
|
+
<div class="dropdown_option_wrapper">
|
20
14
|
<% if content.present? %>
|
21
15
|
<%= content.presence %>
|
22
16
|
<% else %>
|
23
17
|
<%= pb_rails("body", props: {text: object.option[:label]}) %>
|
24
18
|
<% end %>
|
25
|
-
|
19
|
+
</div>
|
26
20
|
<% end %>
|
27
21
|
<% end %>
|
@@ -3,19 +3,15 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbDropdown
|
5
5
|
class DropdownOption < Playbook::KitBase
|
6
|
-
prop :option, type: Playbook::Props::
|
6
|
+
prop :option, type: Playbook::Props::HashProp
|
7
7
|
prop :id, type: Playbook::Props::String
|
8
8
|
|
9
9
|
def data
|
10
10
|
Hash(prop(:data)).merge("dropdown_option_label": option)
|
11
11
|
end
|
12
12
|
|
13
|
-
def padding_helper
|
14
|
-
" p_xs"
|
15
|
-
end
|
16
|
-
|
17
13
|
def classname
|
18
|
-
generate_classname("pb_dropdown_option", "list")
|
14
|
+
generate_classname("pb_dropdown_option", "list")
|
19
15
|
end
|
20
16
|
end
|
21
17
|
end
|
@@ -37,8 +37,10 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
37
37
|
|
38
38
|
handleOptionClick(event) {
|
39
39
|
const option = event.target.closest(OPTION_SELECTOR);
|
40
|
+
const hiddenInput = this.element.querySelector("#dropdown-selected-option");
|
40
41
|
if (option) {
|
41
42
|
const value = option.dataset.dropdownOptionLabel;
|
43
|
+
hiddenInput.value = JSON.parse(value).id;
|
42
44
|
this.onOptionSelected(value, option);
|
43
45
|
}
|
44
46
|
}
|
@@ -99,7 +101,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
99
101
|
option.classList.remove("pb_dropdown_option_selected");
|
100
102
|
});
|
101
103
|
selectedOption.classList.add("pb_dropdown_option_selected");
|
102
|
-
console.log(`Selected value: ${value}`);
|
103
104
|
}
|
104
105
|
|
105
106
|
get target() {
|
@@ -10,7 +10,6 @@ import { globalProps, GlobalProps } from "../../utilities/globalProps";
|
|
10
10
|
|
11
11
|
import DropdownContext from "../context";
|
12
12
|
|
13
|
-
import Flex from "../../pb_flex/_flex";
|
14
13
|
import Body from "../../pb_body/_body";
|
15
14
|
import ListItem from "../../pb_list/_list_item";
|
16
15
|
import { GenericObject } from "../../types";
|
@@ -39,7 +38,6 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
39
38
|
id,
|
40
39
|
key,
|
41
40
|
option,
|
42
|
-
padding = "xs",
|
43
41
|
} = props;
|
44
42
|
|
45
43
|
const {
|
@@ -50,8 +48,10 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
50
48
|
selected,
|
51
49
|
} = useContext(DropdownContext);
|
52
50
|
|
53
|
-
const isItemMatchingFilter = (option: GenericObject) =>
|
54
|
-
option
|
51
|
+
const isItemMatchingFilter = (option: GenericObject) => {
|
52
|
+
const label = typeof option.label === 'string' ? option.label.toLowerCase() : option.label;
|
53
|
+
return String(label).toLowerCase().includes(filterItem.toLowerCase());
|
54
|
+
}
|
55
55
|
|
56
56
|
if (!isItemMatchingFilter(option)) {
|
57
57
|
return null;
|
@@ -75,7 +75,7 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
75
75
|
selectedClass,
|
76
76
|
focusedClass,
|
77
77
|
),
|
78
|
-
globalProps(props
|
78
|
+
globalProps(props),
|
79
79
|
className
|
80
80
|
);
|
81
81
|
|
@@ -96,20 +96,12 @@ const DropdownOption = (props: DropdownOptionProps) => {
|
|
96
96
|
key={option.label}
|
97
97
|
padding="none"
|
98
98
|
>
|
99
|
-
<Flex
|
100
|
-
align="center"
|
101
|
-
className="dropdown_option_wrapper"
|
102
|
-
justify="between"
|
103
|
-
paddingX="sm"
|
104
|
-
paddingY="xxs"
|
105
|
-
>
|
106
99
|
{children ?
|
107
|
-
|
100
|
+
<div className="dropdown_option_wrapper">{children}</div> :
|
108
101
|
<Body dark={dark}
|
109
102
|
text={option.label}
|
110
103
|
/>
|
111
104
|
}
|
112
|
-
</Flex>
|
113
105
|
</ListItem>
|
114
106
|
</div>
|
115
107
|
);
|
@@ -0,0 +1,23 @@
|
|
1
|
+
![Children-Toast](https://github.com/powerhome/playbook-swift/assets/54749071/55aebd12-43c4-4061-92d3-6aebb07ff349)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBToast(
|
6
|
+
text: message,
|
7
|
+
variant: .success,
|
8
|
+
actionView: .custom(AnyView(Text("Undo").pbFont(.title4, color: .white))),
|
9
|
+
dismissAction: closeToast
|
10
|
+
)
|
11
|
+
PBToast(
|
12
|
+
variant: .custom(nil, .pbPrimary),
|
13
|
+
actionView: .custom(
|
14
|
+
AnyView(
|
15
|
+
HStack {
|
16
|
+
Text("Undo action").pbFont(.caption, color: .white)
|
17
|
+
PBButton(variant: .primary, title: "Undo").disabled(true)
|
18
|
+
}
|
19
|
+
)),
|
20
|
+
dismissAction: closeToast
|
21
|
+
)
|
22
|
+
}
|
23
|
+
```
|
data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close_swift.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
```swift
|
2
|
+
VStack(alignment: .leading) {
|
3
|
+
PBToast(text: "Error Message", variant: .error, actionView: .default, dismissAction: closeToast)
|
4
|
+
PBToast(text: "Items Successfully Moved", variant: .success, actionView: .default, dismissAction: closeToast)
|
5
|
+
PBToast(text: "Scan to Assign Selected Items", variant: .neutral, actionView: .default, dismissAction: closeToast)
|
6
|
+
}
|
7
|
+
```
|
@@ -0,0 +1,9 @@
|
|
1
|
+
![Default-Toast](https://github.com/powerhome/playbook-swift/assets/54749071/cc465b1b-85ba-4492-a832-b06b842a1555)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBToast(text: "Error Message", variant: .error, dismissAction: closeToast)
|
6
|
+
PBToast(text: "Items Successfully Moved", variant: .success, dismissAction: closeToast)
|
7
|
+
PBToast(text: "Scan to Assign Selected Items", variant: .neutral, dismissAction: closeToast)
|
8
|
+
}
|
9
|
+
```
|
@@ -0,0 +1,22 @@
|
|
1
|
+
```swift
|
2
|
+
HStack {
|
3
|
+
PBButton(variant: .secondary, title: "Top Center") {
|
4
|
+
position = .top
|
5
|
+
toastView = PBToast(
|
6
|
+
text: "Top Center",
|
7
|
+
variant: .neutral,
|
8
|
+
actionView: .withTimer(3),
|
9
|
+
dismissAction: closeToast
|
10
|
+
)
|
11
|
+
}
|
12
|
+
PBButton(variant: .secondary, title: "Bottom Center") {
|
13
|
+
position = .bottom
|
14
|
+
toastView = PBToast(
|
15
|
+
text: "Bottom Center",
|
16
|
+
variant: .neutral,
|
17
|
+
actionView: .withTimer(2),
|
18
|
+
dismissAction: closeToast
|
19
|
+
)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
```
|
@@ -0,0 +1,62 @@
|
|
1
|
+
```swift
|
2
|
+
GridRow {
|
3
|
+
PBButton(variant: .secondary, title: "Top Left") {
|
4
|
+
position = .topLeft
|
5
|
+
toastView = PBToast(
|
6
|
+
text: "Top Left",
|
7
|
+
variant: .neutral,
|
8
|
+
actionView: .default,
|
9
|
+
dismissAction: closeToast
|
10
|
+
)
|
11
|
+
}
|
12
|
+
PBButton(variant: .secondary, title: "Top Right") {
|
13
|
+
position = .topRight
|
14
|
+
toastView = PBToast(
|
15
|
+
text: "Top Right",
|
16
|
+
variant: .neutral,
|
17
|
+
actionView: .default,
|
18
|
+
dismissAction: closeToast
|
19
|
+
)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
GridRow {
|
23
|
+
PBButton(variant: .secondary, title: "Top Center") {
|
24
|
+
position = .top
|
25
|
+
toastView = PBToast(
|
26
|
+
text: "Top Center",
|
27
|
+
variant: .neutral,
|
28
|
+
actionView: .default,
|
29
|
+
dismissAction: closeToast
|
30
|
+
)
|
31
|
+
}
|
32
|
+
PBButton(variant: .secondary, title: "Bottom Center") {
|
33
|
+
position = .bottom
|
34
|
+
toastView = PBToast(
|
35
|
+
text: "Bottom Center",
|
36
|
+
variant: .custom(.user, .status(.neutral)),
|
37
|
+
actionView: .default,
|
38
|
+
dismissAction: closeToast
|
39
|
+
)
|
40
|
+
}
|
41
|
+
}
|
42
|
+
GridRow {
|
43
|
+
PBButton(variant: .secondary, title: "Bottom Left") {
|
44
|
+
position = .bottomLeft
|
45
|
+
toastView = PBToast(
|
46
|
+
text: "Bottom Left",
|
47
|
+
variant: .custom(.user, .status(.neutral)),
|
48
|
+
actionView: .default,
|
49
|
+
dismissAction: closeToast
|
50
|
+
)
|
51
|
+
}
|
52
|
+
PBButton(variant: .secondary, title: "Bottom Right") {
|
53
|
+
position = .bottomRight
|
54
|
+
toastView = PBToast(
|
55
|
+
text: "Bottom Right",
|
56
|
+
variant: .custom(.user, .status(.neutral)),
|
57
|
+
actionView: .default,
|
58
|
+
dismissAction: closeToast
|
59
|
+
)
|
60
|
+
}
|
61
|
+
}
|
62
|
+
```
|
data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_props_swift.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
### Props
|
2
|
+
| Name | Type | Description | Default | Values |
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
4
|
+
| **text** | `String` |`Value for the toast message` | `nil` | |
|
5
|
+
| **variant** | `Variant` | `Determines the type pf toast message being displayed` | `.custom()` | `error`, `success`,
|
6
|
+
`neutral`, `custom()` |
|
7
|
+
| **actionView** | `dismissAction` | Dismisses the toast message | `.default` | `default` `custom()` `withTimer()` |
|
8
|
+
| **dismissAction** | `(() -> Void)` | `Triggers the dismiss action` | | |
|
@@ -14,3 +14,12 @@ examples:
|
|
14
14
|
- fixed_confirmation_toast_positions: Click to Show Positions
|
15
15
|
- fixed_confirmation_toast_auto_close: Click to Show Auto Close
|
16
16
|
- fixed_confirmation_toast_children: Children
|
17
|
+
|
18
|
+
swift:
|
19
|
+
- fixed_confirmation_toast_default_swift: Default
|
20
|
+
- fixed_confirmation_toast_multi_line_swift: Multi Line
|
21
|
+
#- fixed_confirmation_toast_close_swift: Click to Close
|
22
|
+
#- fixed_confirmation_toast_positions_swift: Click to Show Positions
|
23
|
+
- fixed_confirmation_toast_children_swift: Children
|
24
|
+
#- fixed_confirmation_toast_dismiss_with_timer_swift: Timer
|
25
|
+
- fixed_confirmation_toast_props_swift: ""
|
@@ -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("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
|
8
3
|
|
9
4
|
<% if content %>
|
@@ -13,16 +13,26 @@
|
|
13
13
|
]
|
14
14
|
%>
|
15
15
|
|
16
|
+
<%
|
17
|
+
example_dropdown_options = [
|
18
|
+
{ label: 'United States', value: 'United States', id: 'us' },
|
19
|
+
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
20
|
+
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
21
|
+
]
|
22
|
+
|
23
|
+
%>
|
24
|
+
|
16
25
|
<%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
|
17
26
|
<%= form.typeahead :example_user, props: { data: { typeahead_example1: true, user: {} }, placeholder: "Search for a user" } %>
|
18
27
|
<%= form.text_field :example_text_field, props: { label: true } %>
|
19
|
-
<%= form.
|
28
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
20
29
|
<%= form.email_field :example_email_field, props: { label: true } %>
|
21
30
|
<%= form.number_field :example_number_field, props: { label: true } %>
|
22
31
|
<%= form.search_field :example_search_field, props: { label: true } %>
|
23
32
|
<%= form.password_field :example_password_field, props: { label: true } %>
|
24
33
|
<%= form.url_field :example_url_field, props: { label: true } %>
|
25
34
|
<%= form.text_area :example_text_area, props: { label: true } %>
|
35
|
+
<%= form.dropdown_field :example_dropdown, props: { label: true, options: example_dropdown_options } %>
|
26
36
|
<%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
|
27
37
|
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
28
38
|
<%= form.check_box :example_checkbox,
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
17
17
|
<%= form.text_field :example_text_field, props: { label: true, required: true } %>
|
18
|
-
<%= form.
|
18
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
19
19
|
<%= form.email_field :example_email_field, props: { label: true, required: true } %>
|
20
20
|
<%= form.number_field :example_number_field, props: { label: true, required: true } %>
|
21
21
|
<%= form.search_field :example_project_number, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
|
@@ -33,6 +33,17 @@
|
|
33
33
|
outline-offset: -1px;
|
34
34
|
}
|
35
35
|
}
|
36
|
+
.text_input_wrapper_add_on .add-on-right [class^=pb_card_kit] {
|
37
|
+
border-bottom-right-radius: 0;
|
38
|
+
border-top-right-radius: 0;
|
39
|
+
border-right-width: 0;
|
40
|
+
}
|
41
|
+
.text_input_wrapper_add_on .add-on-right.border_left_on .card-right-aligned {
|
42
|
+
border-left: 1px $border_light solid;
|
43
|
+
&.dark {
|
44
|
+
border-left: 1px rgba($white, 0.15) solid;
|
45
|
+
}
|
46
|
+
}
|
36
47
|
}
|
37
48
|
|
38
49
|
& > [class^=pb_text_input_kit]:not(:first-child) {
|
@@ -40,6 +51,10 @@
|
|
40
51
|
border-bottom-left-radius: 0;
|
41
52
|
border-top-left-radius: 0;
|
42
53
|
}
|
54
|
+
.text_input_wrapper_add_on .add-on-left [class^=pb_card_kit] {
|
55
|
+
border-bottom-left-radius: 0;
|
56
|
+
border-top-left-radius: 0;
|
57
|
+
}
|
43
58
|
}
|
44
59
|
|
45
60
|
& > [class^=pb_button_kit]:not(:last-child) {
|
@@ -92,7 +107,7 @@
|
|
92
107
|
}
|
93
108
|
|
94
109
|
& > [class^=pb_date_picker_kit]:not(:last-child) {
|
95
|
-
.
|
110
|
+
.input_wrapper input, [class^=pb_text_input_kit] .date_picker_input_wrapper .flatpickr-wrapper {
|
96
111
|
border-bottom-right-radius: 0;
|
97
112
|
border-top-right-radius: 0;
|
98
113
|
border-right-width: 0;
|
@@ -100,7 +115,7 @@
|
|
100
115
|
}
|
101
116
|
|
102
117
|
& > [class^=pb_date_picker_kit]:not(:first-child) {
|
103
|
-
.
|
118
|
+
.input_wrapper input, [class^=pb_text_input_kit] .date_picker_input_wrapper .flatpickr-wrapper {
|
104
119
|
border-bottom-left-radius: 0;
|
105
120
|
border-top-left-radius: 0;
|
106
121
|
}
|
@@ -13,11 +13,13 @@ import typography from "../tokens/exports/_typography.scss";
|
|
13
13
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
|
14
14
|
import { globalProps } from "../utilities/globalProps";
|
15
15
|
import { GenericObject } from "../types";
|
16
|
+
import { merge } from 'lodash'
|
16
17
|
|
17
18
|
type GaugeProps = {
|
18
19
|
aria: { [key: string]: string };
|
19
20
|
className?: string;
|
20
21
|
chartData?: { name: string; value: number[] | number }[];
|
22
|
+
customOptions?: Partial<Highcharts.Options>;
|
21
23
|
dark?: boolean;
|
22
24
|
data?: { [key: string]: string };
|
23
25
|
disableAnimation?: boolean;
|
@@ -41,6 +43,7 @@ type GaugeProps = {
|
|
41
43
|
const Gauge = ({
|
42
44
|
aria = {},
|
43
45
|
chartData,
|
46
|
+
customOptions = {},
|
44
47
|
dark = false,
|
45
48
|
data = {},
|
46
49
|
disableAnimation = false,
|
@@ -175,7 +178,7 @@ const Gauge = ({
|
|
175
178
|
},
|
176
179
|
};
|
177
180
|
|
178
|
-
setOptions(
|
181
|
+
setOptions(merge(staticOptions, customOptions));
|
179
182
|
|
180
183
|
if (document.querySelector(".prefix")) {
|
181
184
|
document.querySelectorAll(".prefix").forEach((prefix) => {
|
@@ -5,6 +5,7 @@ module Playbook
|
|
5
5
|
class Gauge < Playbook::KitBase
|
6
6
|
prop :chart_data, type: Playbook::Props::Array,
|
7
7
|
default: [{ name: "Name", value: 0 }]
|
8
|
+
prop :custom_options, default: {}
|
8
9
|
prop :style, type: Playbook::Props::Enum,
|
9
10
|
values: %w[solidgauge],
|
10
11
|
default: "solidgauge"
|
@@ -22,7 +23,7 @@ module Playbook
|
|
22
23
|
prop :max, type: Playbook::Props::Numeric, default: 100
|
23
24
|
prop :colors, type: Playbook::Props::Array, default: []
|
24
25
|
|
25
|
-
def
|
26
|
+
def standard_options
|
26
27
|
{
|
27
28
|
id: id,
|
28
29
|
chartData: chart_data,
|
@@ -43,6 +44,10 @@ module Playbook
|
|
43
44
|
}
|
44
45
|
end
|
45
46
|
|
47
|
+
def chart_options
|
48
|
+
standard_options.deep_merge(custom_options)
|
49
|
+
end
|
50
|
+
|
46
51
|
def classname
|
47
52
|
generate_classname("pb_gauge_kit")
|
48
53
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render, screen } from '../utilities/test-utils';
|
3
|
+
import Gauge from './_gauge';
|
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 = 'gauge1';
|
19
|
+
|
20
|
+
test('uses exact classname', () => {
|
21
|
+
const data = [
|
22
|
+
{ name: 'Name', value: 45 },
|
23
|
+
]
|
24
|
+
render(
|
25
|
+
<Gauge
|
26
|
+
chartData={data}
|
27
|
+
data={{ testid: testId }}
|
28
|
+
id='gaugeid'
|
29
|
+
/>
|
30
|
+
);
|
31
|
+
|
32
|
+
const kit = screen.getByTestId(testId);
|
33
|
+
expect(kit).toHaveClass('pb_gauge_kit');
|
34
|
+
});
|
35
|
+
|
@@ -1,8 +1,3 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<%= pb_rails("icon", props: { dark: object.dark, icon: object.icon, fixed_width: true }) %>
|
8
3
|
<% end %>
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<%= pb_rails("body", props: { color: "light", dark: object.dark }) do %>
|
8
3
|
<%= pb_rails("icon", props: { icon: object.icon, fixed_width: true }) %>
|
9
4
|
<%= object.text %>
|
@@ -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("caption", props: { text: object.label, classname: "pb_label_pill_label"}) %>
|
8
3
|
<%= pb_rails("pill", props: { text: object.pill_value, variant: object.variant, classname: "pb_label_pill_pill" }) %>
|
9
4
|
<% 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("caption", props: { text: object.label, dark: object.dark }) %>
|
8
3
|
<% if object.variant == "details" %>
|
9
4
|
<%= pb_rails("flex", props: {inline: true, vertical: "center"}) do %>
|
@@ -8,6 +8,7 @@ import Highcharts from "highcharts";
|
|
8
8
|
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
9
9
|
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
10
10
|
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
11
|
+
import { merge } from 'lodash'
|
11
12
|
|
12
13
|
type LineGraphProps = {
|
13
14
|
align?: "left" | "right" | "center";
|
@@ -21,6 +22,7 @@ type LineGraphProps = {
|
|
21
22
|
name: string;
|
22
23
|
data: number[];
|
23
24
|
}[];
|
25
|
+
customOptions?: Partial<Highcharts.Options>;
|
24
26
|
gradient?: boolean;
|
25
27
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
26
28
|
id: string;
|
@@ -45,6 +47,7 @@ const LineGraph = ({
|
|
45
47
|
data = {},
|
46
48
|
align = "center",
|
47
49
|
className = "pb_bar_graph",
|
50
|
+
customOptions = {},
|
48
51
|
dark = false,
|
49
52
|
gradient = false,
|
50
53
|
type = "line",
|
@@ -130,16 +133,19 @@ const LineGraph = ({
|
|
130
133
|
staticOptions.plotOptions.series.events = { legendItemClick: () => false };
|
131
134
|
}
|
132
135
|
|
136
|
+
const filteredProps: any = {...props};
|
137
|
+
delete filteredProps.verticalAlign;
|
138
|
+
|
133
139
|
const [options, setOptions] = useState({});
|
134
140
|
|
135
141
|
useEffect(() => {
|
136
|
-
setOptions(
|
142
|
+
setOptions(merge(staticOptions, customOptions));
|
137
143
|
}, [chartData]);
|
138
144
|
|
139
145
|
return (
|
140
146
|
<HighchartsReact
|
141
147
|
containerProps={{
|
142
|
-
className: classnames(globalProps(
|
148
|
+
className: classnames(globalProps(filteredProps), className),
|
143
149
|
id: id,
|
144
150
|
...ariaProps,
|
145
151
|
...dataProps,
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { render, screen } from '../utilities/test-utils';
|
3
|
+
import LineGraph from './_line_graph';
|
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 = 'linechart1';
|
19
|
+
|
20
|
+
test('uses exact classname', () => {
|
21
|
+
const data = [{
|
22
|
+
name: 'Installation',
|
23
|
+
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
24
|
+
}, {
|
25
|
+
name: 'Manufacturing',
|
26
|
+
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434],
|
27
|
+
}, {
|
28
|
+
name: 'Sales & Distribution',
|
29
|
+
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387],
|
30
|
+
}, {
|
31
|
+
name: 'Project Development',
|
32
|
+
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227],
|
33
|
+
}, {
|
34
|
+
name: 'Other',
|
35
|
+
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111],
|
36
|
+
}]
|
37
|
+
render(
|
38
|
+
<LineGraph
|
39
|
+
axisTitle="Number of Employees"
|
40
|
+
chartData={data}
|
41
|
+
data={{ testid: testId }}
|
42
|
+
id="line-default"
|
43
|
+
subTitle="Source: thesolarfoundation.com"
|
44
|
+
title="Solar Employment Growth by Sector, 2010-2016"
|
45
|
+
xAxisCategories={['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']}
|
46
|
+
yAxisMin={0}
|
47
|
+
/>
|
48
|
+
);
|
49
|
+
|
50
|
+
const kit = screen.getByTestId(testId);
|
51
|
+
expect(kit).toHaveClass('pb_bar_graph');
|
52
|
+
});
|