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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ebcd8e418a573194d60fc898d411fad574f050ac38957d6d73674a503ed522d
|
4
|
+
data.tar.gz: 9948ad7024a45406a248a22e02c40226f0b080ad09f85ca7f4169226b8368297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42c48a5990278c4c6b384d379c8b26b102beba5de1a420eb6f3678672cf0ff3de85eff4429d52ad85b8cfefd291faa325f01f6f07786680c04331b361e935fa2
|
7
|
+
data.tar.gz: 71c1b18be5c1883201ab005f05babbcdd92c1215c0a9839bffd1c633bbcbdccee7c6d46a1d2f712858a5ca53098fdd93d099d79bf2cf76f78bbe19019db6d30a
|
@@ -1,6 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
1
|
@import 'pb_advanced_table/advanced_table';
|
5
2
|
@import 'pb_avatar/avatar';
|
6
3
|
@import 'pb_avatar_action_button/avatar_action_button';
|
@@ -31,6 +28,7 @@
|
|
31
28
|
@import 'pb_detail/detail';
|
32
29
|
@import 'pb_dialog/dialog';
|
33
30
|
@import 'pb_distribution_bar/distribution_bar';
|
31
|
+
@import 'pb_draggable/draggable';
|
34
32
|
@import 'pb_dropdown/dropdown';
|
35
33
|
@import 'pb_file_upload/file_upload';
|
36
34
|
@import 'pb_filter/filter';
|
@@ -64,6 +62,7 @@
|
|
64
62
|
@import 'pb_multiple_users_stacked/multiple_users_stacked';
|
65
63
|
@import 'pb_nav/nav';
|
66
64
|
@import 'pb_online_status/online_status';
|
65
|
+
@import 'pb_overlay/overlay';
|
67
66
|
@import 'pb_pagination/pagination';
|
68
67
|
@import 'pb_passphrase/passphrase';
|
69
68
|
@import 'pb_person/person';
|
@@ -121,3 +120,4 @@
|
|
121
120
|
@import './utilities/text_align';
|
122
121
|
@import './utilities/overflow';
|
123
122
|
@import './utilities/truncate';
|
123
|
+
@import './utilities/vertical_align';
|
@@ -35,6 +35,8 @@ export { default as DateYearStacked } from './pb_date_year_stacked/_date_year_st
|
|
35
35
|
export { default as Detail} from './pb_detail/_detail'
|
36
36
|
export { default as Dialog } from './pb_dialog/_dialog'
|
37
37
|
export { default as DistributionBar } from './pb_distribution_bar/_distribution_bar'
|
38
|
+
export { default as Draggable} from './pb_draggable/_draggable'
|
39
|
+
export { DraggableProvider} from './pb_draggable/context'
|
38
40
|
export { default as Dropdown} from './pb_dropdown/_dropdown'
|
39
41
|
export { default as FileUpload } from './pb_file_upload/_file_upload'
|
40
42
|
export { default as Filter } from './pb_filter/_filter'
|
@@ -70,6 +72,7 @@ export { default as MultipleUsersStacked } from './pb_multiple_users_stacked/_mu
|
|
70
72
|
export { default as Nav } from './pb_nav/_nav'
|
71
73
|
export { default as NavItem } from './pb_nav/_item'
|
72
74
|
export { default as OnlineStatus } from './pb_online_status/_online_status'
|
75
|
+
export { default as Overlay} from './pb_overlay/_overlay'
|
73
76
|
export { default as Passphrase } from './pb_passphrase/_passphrase'
|
74
77
|
export { default as PbReactPopover } from './pb_popover/_popover'
|
75
78
|
export { default as Person } from './pb_person/_person'
|
@@ -1,14 +1,10 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
1
|
+
<%= pb_content_tag do %>
|
6
2
|
<%= pb_rails("table", props: { size: "sm", tag:"div", data_table: true, number_spacing:"tabular", responsive:"none" }) do %>
|
7
3
|
<% if content.present? %>
|
8
4
|
<% content.presence %>
|
9
5
|
<% else %>
|
10
|
-
<%= pb_rails("advanced_table/table_header", props: {column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion }) %>
|
11
|
-
<%= pb_rails("advanced_table/table_body", props: {table_data: object.table_data, column_definitions: object.column_definitions}) %>
|
6
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: object.column_definitions, enable_toggle_expansion: object.enable_toggle_expansion }) %>
|
7
|
+
<%= pb_rails("advanced_table/table_body", props: { id: object.id, table_data: object.table_data, column_definitions: object.column_definitions }) %>
|
12
8
|
<% end %>
|
13
9
|
<% end %>
|
14
10
|
<% end %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
<%
|
2
|
+
column_definitions = [
|
3
|
+
{
|
4
|
+
accessor: "year",
|
5
|
+
label: "Year",
|
6
|
+
cellAccessors: ["quarter", "month", "day"],
|
7
|
+
},
|
8
|
+
{
|
9
|
+
accessor: "newEnrollments",
|
10
|
+
label: "New Enrollments",
|
11
|
+
},
|
12
|
+
{
|
13
|
+
accessor: "scheduledMeetings",
|
14
|
+
label: "Scheduled Meetings",
|
15
|
+
},
|
16
|
+
{
|
17
|
+
accessor: "attendanceRate",
|
18
|
+
label: "Attendance Rate",
|
19
|
+
},
|
20
|
+
{
|
21
|
+
accessor: "completedClasses",
|
22
|
+
label: "Completed Classes",
|
23
|
+
},
|
24
|
+
{
|
25
|
+
accessor: "classCompletionRate",
|
26
|
+
label: "Class Completion Rate",
|
27
|
+
},
|
28
|
+
{
|
29
|
+
accessor: "graduatedStudents",
|
30
|
+
label: "Graduated Students",
|
31
|
+
}
|
32
|
+
]
|
33
|
+
|
34
|
+
subrow_headers = ["Quarter", "Month", "Day"]
|
35
|
+
%>
|
36
|
+
|
37
|
+
<%= pb_rails("advanced_table", props: { table_data: @table_data, column_definitions: column_definitions }) do %>
|
38
|
+
<%= pb_rails("advanced_table/table_header", props: { column_definitions: column_definitions }) %>
|
39
|
+
<%= pb_rails("advanced_table/table_body", props: { id: "subrow_headers", table_data: @table_data, column_definitions: column_definitions, subrow_headers: subrow_headers, enable_toggle_expansion: "all" }) %>
|
40
|
+
<% end %>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
`subrow_headers` is an optional prop that if present will add header rows at each level of the nested data. The prop takes an array of strings, each string being the text for each header row. The array of strings must be in the order in which they need to be rendered in the UI according to depth.
|
2
|
+
|
3
|
+
`enable_toggle_expansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enable_toggle_expansion` is a string that can be "all", "header" or "none". If set to "all", the toggle exapansion button will appear in the table header as well as in the subRow headers. If set to "header" button will only appear in header and NOT in subRow headers. This is set to "header" by default.
|
@@ -1,3 +1,3 @@
|
|
1
1
|
`subRowHeaders` is an optional prop that if present will add header rows at each level of the nested data. The prop takes an array of strings, each string being the text for each header row. The array of strings must be in the order in which they need to be rendered in the UI according to depth.
|
2
2
|
|
3
|
-
`enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be
|
3
|
+
`enableToggleExpansion` is an additional optional prop that can be used in conjunction with the subRowHeaders prop. `enableToggleExpansion` is a string that can be "all", "header" or "none". If set to "all", the toggle exapansion button will appear in the table header as well as in the subRow headers. If set to "header" button will only appear in header and NOT in subRow headers. This is set to "header" by default.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
3
|
- advanced_table_beta: Default (Required Props)
|
4
|
+
- advanced_table_beta_subrow_headers: SubRow Headers
|
4
5
|
react:
|
5
6
|
- advanced_table_default: Default (Required Props)
|
6
7
|
- advanced_table_loading: Loading State
|
@@ -12,4 +13,3 @@ examples:
|
|
12
13
|
- advanced_table_table_options: Table Options
|
13
14
|
- advanced_table_table_props: Table Props
|
14
15
|
- advanced_table_inline_row_loading: inline Row Loading
|
15
|
-
|
@@ -1,9 +1,5 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
1
|
+
<%= pb_content_tag do %>
|
6
2
|
<% object.table_data.each do |row| %>
|
7
|
-
<%= render_row_and_children(row, object.column_definitions) %>
|
3
|
+
<%= render_row_and_children(row, object.column_definitions, 0, false) %>
|
8
4
|
<% end %>
|
9
5
|
<% end %>
|
@@ -3,20 +3,30 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbAdvancedTable
|
5
5
|
class TableBody < Playbook::KitBase
|
6
|
+
prop :id, type: Playbook::Props::String,
|
7
|
+
default: ""
|
6
8
|
prop :table_data, type: Playbook::Props::Array,
|
7
9
|
default: []
|
8
10
|
prop :column_definitions, type: Playbook::Props::Array,
|
9
11
|
default: []
|
12
|
+
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
13
|
+
values: %w[all header none],
|
14
|
+
default: "header"
|
15
|
+
prop :subrow_headers, type: Playbook::Props::Array,
|
16
|
+
default: []
|
10
17
|
|
11
|
-
def render_row_and_children(row, column_definitions, current_depth
|
18
|
+
def render_row_and_children(row, column_definitions, current_depth, first_parent_child)
|
12
19
|
output = ActiveSupport::SafeBuffer.new
|
20
|
+
is_first_child_of_subrow = current_depth.positive? && first_parent_child && subrow_headers[current_depth - 1].present?
|
13
21
|
|
14
|
-
output << pb_rails("advanced_table/
|
22
|
+
output << pb_rails("advanced_table/table_subrow_header", props: { row: row, column_definitions: column_definitions, depth: current_depth, subrow_header: subrow_headers[current_depth - 1] }) if is_first_child_of_subrow && enable_toggle_expansion == "all"
|
23
|
+
|
24
|
+
output << pb_rails("advanced_table/table_row", props: { id: id, row: row, column_definitions: column_definitions, depth: current_depth })
|
15
25
|
|
16
26
|
if row[:children].present?
|
17
|
-
output << content_tag(:div, class: "toggle-content", data: { advanced_table_content: row.object_id }) do
|
27
|
+
output << content_tag(:div, class: "toggle-content", data: { advanced_table_content: row.object_id.to_s + id }) do
|
18
28
|
row[:children].map do |child_row|
|
19
|
-
render_row_and_children(child_row, column_definitions, current_depth + 1)
|
29
|
+
render_row_and_children(child_row, column_definitions, current_depth + 1, row.children.first == child_row)
|
20
30
|
end.join.html_safe
|
21
31
|
end
|
22
32
|
end
|
@@ -1,14 +1,10 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
1
|
+
<%= pb_content_tag do %>
|
6
2
|
<%= pb_rails("table/table_row", props: {tag:"div"}) do %>
|
7
3
|
<% object.column_definitions.each_with_index do |item, index| %>
|
8
4
|
<%= pb_rails("table/table_header", props: { tag:"div", id:item[:accessor], classname:object.th_classname}) do %>
|
9
5
|
<%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end", text_align:"end" }) do %>
|
10
6
|
<% if index.zero? && (object.enable_toggle_expansion == "header" || object.enable_toggle_expansion == "all") %>
|
11
|
-
<button class="gray-icon toggle-all-icon">
|
7
|
+
<button class="gray-icon toggle-all-icon" onclick="expandAllRows(this)">
|
12
8
|
<%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right:"xs" }) %>
|
13
9
|
</button>
|
14
10
|
<% end %>
|
@@ -17,4 +13,12 @@
|
|
17
13
|
<% end %>
|
18
14
|
<% end %>
|
19
15
|
<% end %>
|
20
|
-
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<script type="text/javascript">
|
19
|
+
var expandAllRows = (element) => {
|
20
|
+
element.closest('.pb_table').querySelectorAll('.pb_advanced_table_body > .pb_table_tr [data-advanced-table]').forEach((button) => {
|
21
|
+
button.dispatchEvent(new Event('click'));
|
22
|
+
});
|
23
|
+
};
|
24
|
+
</script>
|
@@ -1,15 +1,11 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id) do %>
|
1
|
+
<%= pb_content_tag do %>
|
6
2
|
<% object.column_definitions.each_with_index do |column, index| %>
|
7
3
|
<%= pb_rails("table/table_cell", props: { tag:"div", classname:object.td_classname}) do %>
|
8
4
|
<%= pb_rails("flex", props:{ align: "center", justify: index.zero? ? "start" : "end" }) do %>
|
9
5
|
<div style="padding-left: <%= depth * 1.25 %>em">
|
10
6
|
<%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
|
11
7
|
<% if index.zero? && object.row[:children].present? %>
|
12
|
-
<button id="<%= object.row.object_id %>" class="gray-icon expand-toggle-icon" data-advanced-table="true" >
|
8
|
+
<button id="<%= object.row.object_id.to_s + object.id %>" class="gray-icon expand-toggle-icon" data-advanced-table="true" >
|
13
9
|
<%= pb_rails("icon", props: { id: "advanced-table_open_icon", icon: "circle-play", cursor: "pointer" }) %>
|
14
10
|
<%= pb_rails("icon", props: { id: "advanced-table_close_icon", display: "none", icon: "circle-play", cursor: "pointer", rotation: 90 }) %>
|
15
11
|
</button>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= content_tag(:div,
|
2
|
+
aria: object.aria,
|
3
|
+
class: object.classname,
|
4
|
+
data: object.data,
|
5
|
+
id: object.id) do %>
|
6
|
+
<% object.column_definitions.each_with_index do |column, index| %>
|
7
|
+
<%= pb_rails("table/table_cell", props: { tag: "div", classname: object.td_classname}) do %>
|
8
|
+
<%= pb_rails("flex", props:{ align: "center", justify: "start" }) do %>
|
9
|
+
<div style="padding-left: <%= depth * 1.25 %>em">
|
10
|
+
<%= pb_rails("flex", props:{align: "center", column_gap: "xs"}) do %>
|
11
|
+
<% if index.zero? && object.row[:children].present? %>
|
12
|
+
<button class="gray-icon toggle-all-icon" onclick="expandAllSubRows(this, <%= depth %>)">
|
13
|
+
<%= pb_rails("icon", props: { icon: "arrows-from-line", cursor: "pointer", fixed_width: true, padding_right:"xs" }) %>
|
14
|
+
</button>
|
15
|
+
<% end %>
|
16
|
+
<%= pb_rails("flex/flex_item") do %>
|
17
|
+
<% if index.zero? %>
|
18
|
+
<%= pb_rails("caption", props: { margin_left: object.row[:children].present? ? "none" : "xs", text: object.subrow_header }) %>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<script type="text/javascript">
|
29
|
+
var expandAllSubRows = (element, rowDepth) => {
|
30
|
+
element.closest(".toggle-content").querySelectorAll('.depth-sub-row-' + rowDepth + ' [data-advanced-table]').forEach((button) => {
|
31
|
+
button.dispatchEvent(new Event('click'));
|
32
|
+
});
|
33
|
+
};
|
34
|
+
</script>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module PbAdvancedTable
|
5
|
+
class TableSubrowHeader < Playbook::KitBase
|
6
|
+
prop :column_definitions, type: Playbook::Props::Array,
|
7
|
+
default: []
|
8
|
+
prop :depth
|
9
|
+
prop :row
|
10
|
+
prop :enable_toggle_expansion, type: Playbook::Props::Enum,
|
11
|
+
values: %w[all header none],
|
12
|
+
default: "header"
|
13
|
+
prop :subrow_header, type: Playbook::Props::String,
|
14
|
+
default: ""
|
15
|
+
|
16
|
+
def classname
|
17
|
+
generate_classname("pb_table_tr", "bg-white", subrow_depth_classname, separator: " ")
|
18
|
+
end
|
19
|
+
|
20
|
+
def td_classname
|
21
|
+
generate_classname("id-cell", "chrome-styles", separator: " ")
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def subrow_depth_classname
|
27
|
+
depth.positive? ? "depth-sub-row-#{depth}" : ""
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -9,6 +9,10 @@ export const getPlacementProps = (placement: string, size?: "md" | "lg" | "sm" |
|
|
9
9
|
'bottom-left': { bottom: 'xs', left: 'xs' },
|
10
10
|
'top-left': { top: 'xs', left: 'xs' },
|
11
11
|
'bottom-right': { bottom: 'xs', right: 'xs' },
|
12
|
+
'bottom-center': { bottom: "xs", className: "overlay_bottom_center" },
|
13
|
+
'top-center': { top: "xs", className: "overlay_top_center" },
|
14
|
+
'left-center': { left: "sm", className: "overlay_left_center" },
|
15
|
+
'right-center': { right: "sm", className: "overlay_right_center" }
|
12
16
|
};
|
13
17
|
break;
|
14
18
|
|
@@ -18,6 +22,10 @@ export const getPlacementProps = (placement: string, size?: "md" | "lg" | "sm" |
|
|
18
22
|
'bottom-left': { bottom: '0', left: 'xs' },
|
19
23
|
'top-left': { top: '0', left: 'xs' },
|
20
24
|
'bottom-right': { bottom: '0', right: 'xs' },
|
25
|
+
'bottom-center': { bottom: "xs", className: "overlay_bottom_center" },
|
26
|
+
'top-center': { top: "xs", className: "overlay_top_center" },
|
27
|
+
'left-center': { left: "sm", className: "overlay_left_center" },
|
28
|
+
'right-center': { right: "sm", className: "overlay_right_center" }
|
21
29
|
};
|
22
30
|
break;
|
23
31
|
|
@@ -28,6 +36,10 @@ export const getPlacementProps = (placement: string, size?: "md" | "lg" | "sm" |
|
|
28
36
|
'bottom-left': { bottom: '0', left: '0' },
|
29
37
|
'top-left': { top: '0', left: '0' },
|
30
38
|
'bottom-right': { bottom: '0', right: '0' },
|
39
|
+
'bottom-center': { bottom: "xs", className: "overlay_bottom_center" },
|
40
|
+
'top-center': { top: "xs", className: "overlay_top_center" },
|
41
|
+
'left-center': { left: "sm", className: "overlay_left_center" },
|
42
|
+
'right-center': { right: "sm", className: "overlay_right_center" }
|
31
43
|
};
|
32
44
|
break;
|
33
45
|
|
@@ -37,6 +49,10 @@ export const getPlacementProps = (placement: string, size?: "md" | "lg" | "sm" |
|
|
37
49
|
'bottom-left': { bottom: { value: "xxs", inset: true }, left: { value: "xxs", inset: true } },
|
38
50
|
'top-left': { top: { value: "xxs", inset: true }, left: { value: "xxs", inset: true } },
|
39
51
|
'bottom-right': { bottom: { value: "xxs", inset: true }, right: { value: "xxs", inset: true } },
|
52
|
+
'bottom-center': { bottom: "xs", className: "overlay_bottom_center" },
|
53
|
+
'top-center': { top: "xs", className: "overlay_top_center" },
|
54
|
+
'left-center': { left: "sm", className: "overlay_left_center" },
|
55
|
+
'right-center': { right: "sm", className: "overlay_right_center" }
|
40
56
|
};
|
41
57
|
break;
|
42
58
|
}
|
@@ -26,6 +26,22 @@ $avatar-sizes: (
|
|
26
26
|
flex-grow: 0;
|
27
27
|
flex-basis: $size;
|
28
28
|
|
29
|
+
& > [class^=pb_flex_kit] {
|
30
|
+
[class^=pb_card_kit].overlay_bottom_center,
|
31
|
+
[class^=pb_card_kit].overlay_top_center {
|
32
|
+
left: 50%;
|
33
|
+
transform: translateX(-50%);
|
34
|
+
padding: 2px !important;
|
35
|
+
}
|
36
|
+
|
37
|
+
[class^=pb_card_kit].overlay_left_center,
|
38
|
+
[class^=pb_card_kit].overlay_right_center {
|
39
|
+
top: 50%;
|
40
|
+
transform: translateY(-50%);
|
41
|
+
padding: 2px !important;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
29
45
|
.avatar_wrapper {
|
30
46
|
width: $size;
|
31
47
|
height: $size;
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<% end %>
|
8
8
|
<%= pb_rails("card", props: { border_none: true, border_radius: "rounded", html_options: { style: "padding: 2px" }, position: "absolute" }.merge(specific_placement_style)) do %>
|
9
9
|
|
10
|
-
<%= pb_rails("icon_circle", props: { size: "xxs", icon: object.component_overlay[:icon] }) %>
|
10
|
+
<%= pb_rails("icon_circle", props: { size: "xxs", icon: object.component_overlay[:icon], variant: object.component_overlay[:variant] }) %>
|
11
11
|
<% end %>
|
12
12
|
<% end %>
|
13
13
|
<% elsif object.component_overlay && object.component_overlay[:component] == "badge" %>
|
@@ -71,6 +71,10 @@ module Playbook
|
|
71
71
|
"bottom-left" => { bottom: top_bottom_offset, left: offset },
|
72
72
|
"top-left" => { top: top_bottom_offset, left: offset },
|
73
73
|
"bottom-right" => { bottom: top_bottom_offset, right: offset },
|
74
|
+
"bottom-center" => { bottom: "xs", classname: "overlay_bottom_center" },
|
75
|
+
"top-center" => { top: "xs", classname: "overlay_top_center" },
|
76
|
+
"left-center" => { left: "sm", classname: "overlay_left_center" },
|
77
|
+
"right-center" => { right: "sm", classname: "overlay_right_center" },
|
74
78
|
}
|
75
79
|
end
|
76
80
|
end
|
@@ -42,3 +42,50 @@ test('uses the name prop as the alt property if no imageAlt prop is passed in',
|
|
42
42
|
|
43
43
|
expect(image).toHaveAttribute('alt', name)
|
44
44
|
})
|
45
|
+
|
46
|
+
test('renders with badge overlay', () => {
|
47
|
+
const componentOverlay = {
|
48
|
+
component: "badge",
|
49
|
+
placement: "top-right",
|
50
|
+
text: "New",
|
51
|
+
variant: "error"
|
52
|
+
};
|
53
|
+
render(
|
54
|
+
<Avatar
|
55
|
+
componentOverlay={componentOverlay}
|
56
|
+
data={{ testid: testId }}
|
57
|
+
imageAlt={imageAlt}
|
58
|
+
imageUrl={imageUrl}
|
59
|
+
name={name}
|
60
|
+
/>
|
61
|
+
);
|
62
|
+
|
63
|
+
const badgeOverlay = screen.getByTestId(testId);
|
64
|
+
|
65
|
+
expect(badgeOverlay).toBeInTheDocument();
|
66
|
+
expect(badgeOverlay).toHaveClass('pb_avatar_kit_size_md');
|
67
|
+
expect(badgeOverlay).toHaveTextContent('New');
|
68
|
+
});
|
69
|
+
|
70
|
+
test('renders with iconCircle overlay', () => {
|
71
|
+
const componentOverlay = {
|
72
|
+
component: "iconCircle",
|
73
|
+
placement: "bottom-left",
|
74
|
+
icon: "plus",
|
75
|
+
variant: "blue"
|
76
|
+
};
|
77
|
+
render(
|
78
|
+
<Avatar
|
79
|
+
componentOverlay={componentOverlay}
|
80
|
+
data={{ testid: testId }}
|
81
|
+
imageAlt={imageAlt}
|
82
|
+
imageUrl={imageUrl}
|
83
|
+
name={name}
|
84
|
+
/>
|
85
|
+
);
|
86
|
+
|
87
|
+
const iconCircleOverlay = screen.getByTestId(testId);
|
88
|
+
|
89
|
+
expect(iconCircleOverlay).toBeInTheDocument();
|
90
|
+
expect(iconCircleOverlay).toHaveClass('pb_avatar_kit_size_md');
|
91
|
+
});
|
@@ -1,71 +1,51 @@
|
|
1
|
-
<%= pb_rails("avatar", props: {
|
2
|
-
component_overlay: {
|
3
|
-
component: "badge",
|
4
|
-
text: "12",
|
5
|
-
placement: "top-left"
|
6
|
-
},
|
7
|
-
name: "Terry Johnson",
|
8
|
-
size: "xxs",
|
9
|
-
image_url: "https://randomuser.me/api/portraits/men/44.jpg",
|
10
|
-
margin_bottom: "sm"
|
11
|
-
}) %>
|
12
1
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
2
|
+
<%= pb_rails("avatar", props: {
|
3
|
+
component_overlay: {
|
4
|
+
component: "badge",
|
5
|
+
text: "12",
|
6
|
+
placement: "bottom-right"
|
7
|
+
},
|
8
|
+
name: "Terry Johnson",
|
9
|
+
size: "sm",
|
10
|
+
image_url: "https://randomuser.me/api/portraits/men/44.jpg",
|
11
|
+
margin_bottom: "sm"
|
12
|
+
}) %>
|
24
13
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
14
|
+
<%= pb_rails("avatar", props: {
|
15
|
+
component_overlay: {
|
16
|
+
component: "badge",
|
17
|
+
text: "12",
|
18
|
+
placement: "top-left"
|
19
|
+
},
|
20
|
+
name: "Terry Johnson",
|
21
|
+
size: "md",
|
22
|
+
image_url: "https://randomuser.me/api/portraits/men/44.jpg",
|
23
|
+
margin_bottom: "sm"
|
24
|
+
}) %>
|
36
25
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
26
|
+
<%= pb_rails("avatar", props: {
|
27
|
+
component_overlay: {
|
28
|
+
component: "badge",
|
29
|
+
text: "On Roadtrip",
|
30
|
+
placement: "top-center",
|
31
|
+
variant: "info"
|
32
|
+
},
|
33
|
+
name: "Terry Johnson",
|
34
|
+
size: "lg",
|
35
|
+
image_url: "https://randomuser.me/api/portraits/men/44.jpg",
|
36
|
+
margin_bottom: "sm"
|
37
|
+
}) %>
|
48
38
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
39
|
+
<%= pb_rails("avatar", props: {
|
40
|
+
component_overlay: {
|
41
|
+
component: "badge",
|
42
|
+
text: "Out of Office",
|
43
|
+
placement: "bottom-center",
|
44
|
+
variant: "error"
|
45
|
+
},
|
46
|
+
name: "Terry Johnson",
|
47
|
+
size: "xl",
|
48
|
+
image_url: "https://randomuser.me/api/portraits/men/44.jpg",
|
49
|
+
margin_bottom: "sm"
|
50
|
+
}) %>
|
60
51
|
|
61
|
-
<%= pb_rails("avatar", props: {
|
62
|
-
component_overlay: {
|
63
|
-
component: "badge",
|
64
|
-
text: "12",
|
65
|
-
placement: "top-right"
|
66
|
-
},
|
67
|
-
name: "Terry Johnson",
|
68
|
-
size: "xl",
|
69
|
-
image_url: "https://randomuser.me/api/portraits/men/44.jpg",
|
70
|
-
margin_bottom: "sm"
|
71
|
-
}) %>
|