playbook_ui 16.9.0 → 16.10.0.pre.alpha.PLAY3053advancedtablebottompinnedrowsreact17469
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +32 -11
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableActionBar.tsx +5 -2
- data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +27 -2
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +19 -14
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/CellRendererUtils.tsx +4 -2
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +17 -0
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/StickyLayoutHelper.ts +100 -0
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +38 -71
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +27 -77
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +7 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +128 -12
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table_action_bar.js +31 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +19 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.html.erb +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +6 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_react.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +36 -44
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.jsx +10 -19
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +3 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.json +2 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_playground.overrides.json +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +20 -29
- data/app/pb_kits/playbook/pb_advanced_table/kit.schema.json +0 -12
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +16 -2
- data/app/pb_kits/playbook/pb_badge/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_button_toolbar/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_card/card.rb +1 -1
- data/app/pb_kits/playbook/pb_card/kit.schema.json +2 -0
- data/app/pb_kits/playbook/pb_checkbox/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +6 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +19 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +58 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +319 -65
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.html.erb +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.jsx +15 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_year_asc.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/kit.schema.json +9 -1
- data/app/pb_kits/playbook/pb_date_time/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +54 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +21 -5
- data/app/pb_kits/playbook/pb_dialog/_dialog_context.tsx +8 -2
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +5 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +125 -0
- data/app/pb_kits/playbook/pb_dialog/index.js +11 -1
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners_rails.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers.html.erb +35 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_independent_containers_rails.md +8 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_rails.md +3 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_react.md +1 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_playground.json +260 -19
- data/app/pb_kits/playbook/pb_draggable/docs/_playground.overrides.json +258 -13
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_draggable/index.js +10 -3
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +122 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +114 -35
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.html.erb +93 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.jsx +127 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled.html.erb +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled.jsx +37 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.html.erb +10 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.jsx +37 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.json +150 -237
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.overrides.json +58 -74
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +5 -4
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +6 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +96 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +1 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +2 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_option.rb +27 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +4 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +2 -0
- data/app/pb_kits/playbook/pb_dropdown/hooks/useHandleOnKeydown.tsx +25 -5
- data/app/pb_kits/playbook/pb_dropdown/index.js +270 -25
- data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +19 -10
- data/app/pb_kits/playbook/pb_dropdown/kit.schema.json +8 -0
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +39 -2
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +15 -4
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +22 -13
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.html.erb +66 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.jsx +53 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.md +5 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/_playground.json +2 -1
- data/app/pb_kits/playbook/pb_file_upload/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_file_upload/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_file_upload/kit.schema.json +3 -3
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +55 -28
- data/app/pb_kits/playbook/pb_filter/Filter/FilterDouble.tsx +4 -1
- data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +4 -1
- data/app/pb_kits/playbook/pb_filter/Filter/InteractiveFilter.tsx +277 -0
- data/app/pb_kits/playbook/pb_filter/_filter.scss +88 -1
- data/app/pb_kits/playbook/pb_filter/_filter.tsx +27 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive.html.erb +116 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive.md +12 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive_react.jsx +153 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_interactive_react.md +10 -0
- data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/_playground.json +308 -5
- data/app/pb_kits/playbook/pb_filter/docs/_playground.overrides.json +312 -0
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_filter/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +80 -3
- data/app/pb_kits/playbook/pb_filter/filter.rb +71 -0
- data/app/pb_kits/playbook/pb_filter/filter.test.js +78 -0
- data/app/pb_kits/playbook/pb_filter/index.ts +349 -0
- data/app/pb_kits/playbook/pb_filter/kit.schema.json +94 -29
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.json +210 -14
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.overrides.json +231 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_flex/docs/_playground.json +297 -38
- data/app/pb_kits/playbook/pb_flex/docs/_playground.overrides.json +300 -40
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +20 -19
- data/app/pb_kits/playbook/pb_form/docs/_playground.json +1 -13
- data/app/pb_kits/playbook/pb_form_group/docs/_playground.json +82 -5
- data/app/pb_kits/playbook/pb_form_group/docs/_playground.overrides.json +91 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_playground.json +155 -14
- data/app/pb_kits/playbook/pb_form_pill/docs/_playground.overrides.json +147 -0
- data/app/pb_kits/playbook/pb_form_pill/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_full_screen/_full_screen.scss +77 -0
- data/app/pb_kits/playbook/pb_full_screen/_full_screen.tsx +183 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_content_padding.jsx +68 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_content_padding.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_custom_trigger.jsx +71 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_custom_trigger.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.html.erb +3 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.jsx +63 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_header_text_styling.jsx +68 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_header_text_styling.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_sticky_header.jsx +68 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_sticky_header.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_table_and_filter.jsx +149 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_table_and_filter.md +1 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_playground.json +155 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/_playground.overrides.json +137 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/example.yml +14 -0
- data/app/pb_kits/playbook/pb_full_screen/docs/index.js +6 -0
- data/app/pb_kits/playbook/pb_full_screen/full_screen.html.erb +12 -0
- data/app/pb_kits/playbook/pb_full_screen/full_screen.rb +11 -0
- data/app/pb_kits/playbook/pb_full_screen/full_screen.test.jsx +237 -0
- data/app/pb_kits/playbook/pb_full_screen/kit.schema.json +89 -0
- data/app/pb_kits/playbook/pb_full_screen/useFullScreen.ts +15 -0
- data/app/pb_kits/playbook/pb_hashtag/docs/_playground.json +72 -11
- data/app/pb_kits/playbook/pb_hashtag/docs/_playground.overrides.json +75 -0
- data/app/pb_kits/playbook/pb_highlight/docs/_playground.json +75 -4
- data/app/pb_kits/playbook/pb_highlight/docs/_playground.overrides.json +75 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.json +138 -12
- data/app/pb_kits/playbook/pb_home_address_street/docs/_playground.overrides.json +162 -0
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +22 -11
- data/app/pb_kits/playbook/pb_icon/docs/_icon_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_icon/docs/_playground.json +66 -41
- data/app/pb_kits/playbook/pb_icon/docs/_playground.overrides.json +85 -27
- data/app/pb_kits/playbook/pb_icon/icon.rb +5 -2
- data/app/pb_kits/playbook/pb_icon/kit.schema.json +3 -5
- data/app/pb_kits/playbook/pb_icon_button/docs/_playground.json +111 -9
- data/app/pb_kits/playbook/pb_icon_button/docs/_playground.overrides.json +131 -0
- data/app/pb_kits/playbook/pb_icon_button/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.json +92 -7
- data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.overrides.json +108 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.json +32 -17
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.overrides.json +81 -8
- data/app/pb_kits/playbook/pb_icon_value/docs/_playground.json +28 -18
- data/app/pb_kits/playbook/pb_icon_value/docs/_playground.overrides.json +58 -9
- data/app/pb_kits/playbook/pb_image/docs/_playground.json +124 -47
- data/app/pb_kits/playbook/pb_image/docs/_playground.overrides.json +122 -47
- data/app/pb_kits/playbook/pb_label_pill/docs/_playground.json +68 -6
- data/app/pb_kits/playbook/pb_label_pill/docs/_playground.overrides.json +85 -0
- data/app/pb_kits/playbook/pb_label_value/docs/_playground.json +59 -36
- data/app/pb_kits/playbook/pb_label_value/docs/_playground.overrides.json +101 -30
- data/app/pb_kits/playbook/pb_layout/docs/_playground.json +216 -10
- data/app/pb_kits/playbook/pb_layout/docs/_playground.overrides.json +188 -0
- data/app/pb_kits/playbook/pb_legend/docs/_playground.json +60 -7
- data/app/pb_kits/playbook/pb_legend/docs/_playground.overrides.json +77 -0
- data/app/pb_kits/playbook/pb_list/docs/_playground.json +165 -17
- data/app/pb_kits/playbook/pb_list/docs/_playground.overrides.json +191 -0
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +3 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_color.html.erb +21 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_color.jsx +55 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_color.md +1 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.json +28 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.overrides.json +27 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_loading_inline/kit.schema.json +18 -2
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +3 -0
- data/app/pb_kits/playbook/pb_map/docs/_playground.json +164 -7
- data/app/pb_kits/playbook/pb_map/docs/_playground.overrides.json +180 -0
- data/app/pb_kits/playbook/pb_message/docs/_playground.json +114 -8
- data/app/pb_kits/playbook/pb_message/docs/_playground.overrides.json +144 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +7 -7
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +127 -12
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.json +310 -61
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_playground.overrides.json +327 -44
- data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.json +35 -6
- data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.overrides.json +35 -6
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.json +32 -21
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.overrides.json +32 -21
- data/app/pb_kits/playbook/pb_nav/docs/_playground.json +546 -18
- data/app/pb_kits/playbook/pb_nav/docs/_playground.overrides.json +561 -14
- data/app/pb_kits/playbook/pb_online_status/docs/_playground.json +18 -23
- data/app/pb_kits/playbook/pb_online_status/docs/_playground.overrides.json +18 -14
- data/app/pb_kits/playbook/pb_overlay/docs/_playground.json +133 -14
- data/app/pb_kits/playbook/pb_overlay/docs/_playground.overrides.json +154 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_playground.json +35 -14
- data/app/pb_kits/playbook/pb_pagination/docs/_playground.overrides.json +35 -14
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +5 -5
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +1 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/_playground.json +129 -14
- data/app/pb_kits/playbook/pb_passphrase/docs/_playground.overrides.json +148 -0
- data/app/pb_kits/playbook/pb_passphrase/index.ts +58 -0
- data/app/pb_kits/playbook/pb_passphrase/kit.schema.json +13 -0
- data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +70 -1
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +70 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.json +378 -4
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_playground.overrides.json +245 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.json +215 -4
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_playground.overrides.json +224 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.json +149 -4
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_playground.overrides.json +162 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.json +392 -4
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_playground.overrides.json +212 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_person/docs/_playground.json +27 -11
- data/app/pb_kits/playbook/pb_person/docs/_playground.overrides.json +34 -9
- data/app/pb_kits/playbook/pb_person_contact/docs/_playground.json +72 -21
- data/app/pb_kits/playbook/pb_person_contact/docs/_playground.overrides.json +71 -21
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.json +179 -21
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.overrides.json +180 -0
- data/app/pb_kits/playbook/pb_phone_number_input/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_pill/docs/_playground.json +16 -49
- data/app/pb_kits/playbook/pb_pill/docs/_playground.overrides.json +33 -30
- data/app/pb_kits/playbook/pb_popover/_popover.scss +27 -0
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +49 -16
- data/app/pb_kits/playbook/pb_popover/docs/_playground.json +155 -46
- data/app/pb_kits/playbook/pb_popover/docs/_playground.overrides.json +162 -30
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +9 -11
- data/app/pb_kits/playbook/pb_popover/index.ts +35 -4
- data/app/pb_kits/playbook/pb_popover/popover.html.erb +5 -2
- data/app/pb_kits/playbook/pb_popover/popover.test.js +212 -5
- data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.json +26 -13
- data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.overrides.json +24 -6
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.json +50 -17
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.overrides.json +41 -7
- data/app/pb_kits/playbook/pb_progress_step/docs/_playground.json +197 -10
- data/app/pb_kits/playbook/pb_progress_step/docs/_playground.overrides.json +189 -0
- data/app/pb_kits/playbook/pb_radio/docs/_playground.json +80 -6
- data/app/pb_kits/playbook/pb_radio/docs/_playground.overrides.json +82 -3
- data/app/pb_kits/playbook/pb_radio/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +12 -24
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +152 -22
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +153 -0
- data/app/pb_kits/playbook/pb_select/_select.tsx +1 -0
- data/app/pb_kits/playbook/pb_select/docs/_playground.json +65 -19
- data/app/pb_kits/playbook/pb_select/docs/_playground.overrides.json +54 -14
- data/app/pb_kits/playbook/pb_select/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.json +75 -82
- data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.overrides.json +76 -76
- data/app/pb_kits/playbook/pb_selectable_card/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.json +105 -15
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.overrides.json +106 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.json +37 -21
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.overrides.json +35 -18
- data/app/pb_kits/playbook/pb_selectable_icon/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.json +174 -12
- data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.overrides.json +162 -10
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.json +68 -6
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.overrides.json +80 -0
- data/app/pb_kits/playbook/pb_source/docs/_playground.json +67 -6
- data/app/pb_kits/playbook/pb_source/docs/_playground.overrides.json +80 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/_playground.json +28 -53
- data/app/pb_kits/playbook/pb_star_rating/docs/_playground.overrides.json +33 -32
- data/app/pb_kits/playbook/pb_star_rating/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_stat_change/docs/_playground.json +15 -9
- data/app/pb_kits/playbook/pb_stat_change/docs/_playground.overrides.json +15 -5
- data/app/pb_kits/playbook/pb_stat_value/docs/_playground.json +19 -9
- data/app/pb_kits/playbook/pb_stat_value/docs/_playground.overrides.json +18 -7
- data/app/pb_kits/playbook/pb_stat_value/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_playground.json +223 -21
- data/app/pb_kits/playbook/pb_table/docs/_playground.overrides.json +176 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_playground.json +44 -5
- data/app/pb_kits/playbook/pb_text_input/docs/_playground.overrides.json +39 -3
- data/app/pb_kits/playbook/pb_text_input/kit.schema.json +3 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_playground.json +35 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_playground.overrides.json +28 -3
- data/app/pb_kits/playbook/pb_textarea/kit.schema.json +1 -1
- data/app/pb_kits/playbook/pb_time/docs/_playground.json +28 -14
- data/app/pb_kits/playbook/pb_time/docs/_playground.overrides.json +26 -13
- data/app/pb_kits/playbook/pb_time_picker/_time_picker.scss +42 -0
- data/app/pb_kits/playbook/pb_time_picker/_time_picker.tsx +309 -167
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.json +36 -30
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.overrides.json +31 -26
- data/app/pb_kits/playbook/pb_time_picker/index.ts +263 -11
- data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.json +63 -9
- data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.overrides.json +69 -0
- data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.json +30 -9
- data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.overrides.json +30 -9
- data/app/pb_kits/playbook/pb_timeline/docs/_playground.json +178 -6
- data/app/pb_kits/playbook/pb_timeline/docs/_playground.overrides.json +165 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_playground.json +36 -21
- data/app/pb_kits/playbook/pb_timestamp/docs/_playground.overrides.json +35 -20
- data/app/pb_kits/playbook/pb_toggle/docs/_playground.json +24 -13
- data/app/pb_kits/playbook/pb_toggle/docs/_playground.overrides.json +20 -12
- data/app/pb_kits/playbook/pb_toggle/kit.schema.json +2 -2
- data/app/pb_kits/playbook/pb_tooltip/docs/_playground.json +42 -23
- data/app/pb_kits/playbook/pb_tooltip/docs/_playground.overrides.json +35 -15
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +109 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_playground.json +124 -44
- data/app/pb_kits/playbook/pb_typeahead/docs/_playground.overrides.json +98 -31
- data/app/pb_kits/playbook/pb_typeahead/kit.schema.json +8 -2
- data/app/pb_kits/playbook/pb_user/docs/_playground.json +33 -15
- data/app/pb_kits/playbook/pb_user/docs/_playground.overrides.json +32 -15
- data/app/pb_kits/playbook/pb_user_badge/docs/_playground.json +26 -12
- data/app/pb_kits/playbook/pb_user_badge/docs/_playground.overrides.json +26 -9
- data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.json +32 -5
- data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.overrides.json +30 -4
- data/app/pb_kits/playbook/tokens/_colors.scss +5 -1
- data/app/pb_kits/playbook/utilities/_border.scss +262 -0
- data/app/pb_kits/playbook/utilities/floatingPortalHosts.ts +565 -0
- data/app/pb_kits/playbook/utilities/global-props.schema.json +98 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +83 -1
- data/app/pb_kits/playbook/utilities/icons/allicons.tsx +38 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/border.test.js +66 -0
- data/dist/chunks/{_pb_line_graph-B870s9g1.js → _pb_line_graph-C2H9vs_8.js} +1 -1
- data/dist/chunks/_typeahead-Du8dRYaM.js +5 -0
- data/dist/chunks/globalProps-DIAZ03-L.js +6 -0
- data/dist/chunks/lib-ZHDedNfP.js +29 -0
- data/dist/chunks/time_picker_helper-CVMV9ync.js +1 -0
- data/dist/chunks/vendor.js +5 -5
- data/dist/menu.yml +7 -0
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/border.rb +87 -0
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/forms/builder/form_field_builder.rb +2 -0
- data/lib/playbook/kit_base.rb +2 -0
- data/lib/playbook/pb_forms_global_props_helper.rb +15 -0
- data/lib/playbook/version.rb +2 -2
- metadata +93 -9
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +0 -92
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +0 -3
- data/dist/chunks/_typeahead-jMN-A0_C.js +0 -5
- data/dist/chunks/globalProps-BInmh-C7.js +0 -6
- data/dist/chunks/lib-CVYIIiwI.js +0 -29
- data/dist/chunks/time_picker_helper-Bx8nzyM8.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-handler-names */
|
|
2
2
|
/* eslint-disable react/no-multi-comp */
|
|
3
3
|
|
|
4
|
-
import React, { useState } from "react";
|
|
4
|
+
import React, { useState, useCallback } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import Modal from "react-modal";
|
|
7
7
|
|
|
@@ -16,7 +16,8 @@ import DialogBody from "./child_kits/_dialog_body";
|
|
|
16
16
|
import Flex from "../pb_flex/_flex";
|
|
17
17
|
import IconCircle from "../pb_icon_circle/_icon_circle";
|
|
18
18
|
import Title from "../pb_title/_title";
|
|
19
|
-
import { DialogContext } from "./_dialog_context";
|
|
19
|
+
import { DialogContext, DialogContextValue } from "./_dialog_context";
|
|
20
|
+
import { PB_FLOATING_OWNER_ATTR } from "../utilities/floatingPortalHosts";
|
|
20
21
|
|
|
21
22
|
type DialogProps = {
|
|
22
23
|
aria?: { [key: string]: string };
|
|
@@ -101,12 +102,20 @@ const Dialog = (props: DialogProps): React.ReactElement => {
|
|
|
101
102
|
const [triggerOpened, setTriggerOpened] = useState(false),
|
|
102
103
|
modalIsOpened = trigger ? triggerOpened : opened;
|
|
103
104
|
|
|
104
|
-
const
|
|
105
|
+
const [selectMenuPortalTarget, setSelectMenuPortalTarget] =
|
|
106
|
+
useState<HTMLElement | null>(null);
|
|
107
|
+
|
|
108
|
+
const floatingRootRefCallback = useCallback((node: HTMLElement | null) => {
|
|
109
|
+
setSelectMenuPortalTarget(node);
|
|
110
|
+
}, []);
|
|
111
|
+
|
|
112
|
+
const api: DialogContextValue = {
|
|
105
113
|
onClose: trigger
|
|
106
114
|
? function () {
|
|
107
115
|
setTriggerOpened(false);
|
|
108
116
|
}
|
|
109
117
|
: onClose,
|
|
118
|
+
selectMenuPortalTarget,
|
|
110
119
|
};
|
|
111
120
|
|
|
112
121
|
if (trigger) {
|
|
@@ -187,7 +196,7 @@ const Dialog = (props: DialogProps): React.ReactElement => {
|
|
|
187
196
|
shouldCloseOnOverlayClick={shouldCloseOnOverlayClick && !loading}
|
|
188
197
|
style={{ content: dynamicInlineProps }}
|
|
189
198
|
>
|
|
190
|
-
|
|
199
|
+
<div className="pb_dialog_scroll_region">
|
|
191
200
|
{title && !status ? <Dialog.Header closeable={closeable}>{title}</Dialog.Header> : null}
|
|
192
201
|
{!status && text ? <Dialog.Body>{text}</Dialog.Body> : null}
|
|
193
202
|
{status && (
|
|
@@ -238,7 +247,14 @@ const Dialog = (props: DialogProps): React.ReactElement => {
|
|
|
238
247
|
</Dialog.Footer>
|
|
239
248
|
) : null}
|
|
240
249
|
{children}
|
|
241
|
-
|
|
250
|
+
</div>
|
|
251
|
+
{/* No aria-hidden: portaled form inputs with dropdowns live here and must remain interactive. */}
|
|
252
|
+
<div
|
|
253
|
+
className="pb_dialog_floating_root"
|
|
254
|
+
data-pb-dialog-floating-root="true"
|
|
255
|
+
{...(id ? { [PB_FLOATING_OWNER_ATTR]: id } : {})}
|
|
256
|
+
ref={floatingRootRefCallback}
|
|
257
|
+
/>
|
|
242
258
|
</Modal>
|
|
243
259
|
</div>
|
|
244
260
|
</DialogContext.Provider>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export type DialogContextValue = {
|
|
4
|
+
onClose?: () => void
|
|
5
|
+
// Mount point for form inputs with dropdowns so they escape dialog scroll/overflow.
|
|
6
|
+
selectMenuPortalTarget?: HTMLElement | null
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const DialogContext = React.createContext<DialogContextValue | null>(null)
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
data-cancel-button-id="<%= object.cancel_button_id %>"
|
|
13
13
|
<% end %>
|
|
14
14
|
>
|
|
15
|
-
<%= pb_content_tag(:dialog, role: "dialog", "aria-modal": "true", "aria-label": "Dialog") do %>
|
|
15
|
+
<%= pb_content_tag(:dialog, role: "dialog", id: object.id, "data-pb-floating-owner": object.id, "aria-modal": "true", "aria-label": "Dialog") do %>
|
|
16
|
+
<div class="pb_dialog_scroll_region">
|
|
16
17
|
<% if object.status === "" && object.title %>
|
|
17
18
|
<%= pb_rails("dialog/dialog_header", props: { title: object.title, id: object.id, closeable: object.closeable }) %>
|
|
18
19
|
<% end %>
|
|
@@ -44,5 +45,8 @@
|
|
|
44
45
|
<% end %>
|
|
45
46
|
|
|
46
47
|
<%= content %>
|
|
48
|
+
</div>
|
|
49
|
+
<%# No aria-hidden: portaled form inputs with dropdowns live here and must remain interactive. %>
|
|
50
|
+
<div class="pb_dialog_floating_root" data-pb-dialog-floating-root="true" data-pb-floating-owner="<%= object.id %>"></div>
|
|
47
51
|
<% end %>
|
|
48
52
|
</div>
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React, {useState} from 'react'
|
|
2
2
|
import { render, cleanup, waitFor, fireEvent, screen } from "../utilities/test-utils";
|
|
3
3
|
import { Dialog, Button } from 'playbook-ui'
|
|
4
|
+
import {
|
|
5
|
+
isNativeSelectMenuInteraction,
|
|
6
|
+
resolveDialogFloatingPortalHost,
|
|
7
|
+
resolvePortaledKitHost,
|
|
8
|
+
} from "../utilities/floatingPortalHosts"
|
|
4
9
|
|
|
5
10
|
const text="Hello Body Text, Nice to meet ya."
|
|
6
11
|
const title="Header Title is the Title Prop"
|
|
@@ -47,6 +52,23 @@ test('renders the component when clicked', async () => {
|
|
|
47
52
|
cleanup()
|
|
48
53
|
})
|
|
49
54
|
|
|
55
|
+
test('renders scroll region and floating root for portaled inputs (Typeahead, etc.)', async () => {
|
|
56
|
+
const { queryByText } = render(<DialogTest />)
|
|
57
|
+
|
|
58
|
+
fireEvent.click(queryByText('Open Dialog'))
|
|
59
|
+
|
|
60
|
+
await waitFor(() =>
|
|
61
|
+
expect(queryByText("Header Title is the Title Prop")).toBeInTheDocument(),
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
expect(document.querySelector('.pb_dialog_scroll_region')).toBeInTheDocument()
|
|
65
|
+
expect(
|
|
66
|
+
document.querySelector('[data-pb-dialog-floating-root="true"]'),
|
|
67
|
+
).toBeInTheDocument()
|
|
68
|
+
|
|
69
|
+
cleanup()
|
|
70
|
+
})
|
|
71
|
+
|
|
50
72
|
test("renders the title and body text", async () => {
|
|
51
73
|
|
|
52
74
|
const { queryByText } = render(<DialogTest />);
|
|
@@ -143,3 +165,106 @@ test('renders dialog without close button when closeable is false', async () =>
|
|
|
143
165
|
|
|
144
166
|
cleanup()
|
|
145
167
|
})
|
|
168
|
+
|
|
169
|
+
describe('Dialog floating portal host (portaled kits)', () => {
|
|
170
|
+
beforeEach(() => {
|
|
171
|
+
document.body.innerHTML = ''
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
test('resolveDialogFloatingPortalHost returns null outside dialog, modal, or popover', () => {
|
|
175
|
+
const div = document.createElement('div')
|
|
176
|
+
document.body.appendChild(div)
|
|
177
|
+
expect(resolveDialogFloatingPortalHost(div)).toBeNull()
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
test('resolveDialogFloatingPortalHost returns floating root inside native dialog', () => {
|
|
181
|
+
const dialog = document.createElement('dialog')
|
|
182
|
+
const scroll = document.createElement('div')
|
|
183
|
+
scroll.className = 'pb_dialog_scroll_region'
|
|
184
|
+
const floating = document.createElement('div')
|
|
185
|
+
floating.setAttribute('data-pb-dialog-floating-root', 'true')
|
|
186
|
+
const inner = document.createElement('div')
|
|
187
|
+
dialog.appendChild(scroll)
|
|
188
|
+
dialog.appendChild(floating)
|
|
189
|
+
dialog.appendChild(inner)
|
|
190
|
+
document.body.appendChild(dialog)
|
|
191
|
+
|
|
192
|
+
expect(resolveDialogFloatingPortalHost(inner)).toBe(floating)
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
test('resolveDialogFloatingPortalHost falls back to dialog when floating root missing', () => {
|
|
196
|
+
const dialog = document.createElement('dialog')
|
|
197
|
+
const inner = document.createElement('div')
|
|
198
|
+
dialog.appendChild(inner)
|
|
199
|
+
document.body.appendChild(dialog)
|
|
200
|
+
|
|
201
|
+
expect(resolveDialogFloatingPortalHost(inner)).toBe(dialog)
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
test('resolveDialogFloatingPortalHost returns floating root inside .pb_dialog', () => {
|
|
205
|
+
const shell = document.createElement('div')
|
|
206
|
+
shell.className = 'pb_dialog'
|
|
207
|
+
const floating = document.createElement('div')
|
|
208
|
+
floating.setAttribute('data-pb-dialog-floating-root', 'true')
|
|
209
|
+
const inner = document.createElement('div')
|
|
210
|
+
shell.appendChild(floating)
|
|
211
|
+
shell.appendChild(inner)
|
|
212
|
+
document.body.appendChild(shell)
|
|
213
|
+
|
|
214
|
+
expect(resolveDialogFloatingPortalHost(inner)).toBe(floating)
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
test('resolvePortaledKitHost uses dialog floating root when inside dialog', () => {
|
|
218
|
+
const dialog = document.createElement('dialog')
|
|
219
|
+
const floating = document.createElement('div')
|
|
220
|
+
floating.setAttribute('data-pb-dialog-floating-root', 'true')
|
|
221
|
+
const kit = document.createElement('div')
|
|
222
|
+
dialog.appendChild(floating)
|
|
223
|
+
dialog.appendChild(kit)
|
|
224
|
+
document.body.appendChild(dialog)
|
|
225
|
+
|
|
226
|
+
expect(resolvePortaledKitHost(kit, null)).toBe(floating)
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
test('resolvePortaledKitHost uses context target when host not in tree', () => {
|
|
230
|
+
const host = document.createElement('div')
|
|
231
|
+
const kit = document.createElement('div')
|
|
232
|
+
document.body.appendChild(kit)
|
|
233
|
+
|
|
234
|
+
expect(resolvePortaledKitHost(kit, host)).toBe(host)
|
|
235
|
+
})
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
describe('isNativeSelectMenuInteraction', () => {
|
|
239
|
+
beforeEach(() => {
|
|
240
|
+
document.body.innerHTML = ''
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
test('returns true when mousedown target is a select inside the dialog', () => {
|
|
244
|
+
const dialog = document.createElement('dialog')
|
|
245
|
+
const select = document.createElement('select')
|
|
246
|
+
dialog.appendChild(select)
|
|
247
|
+
document.body.appendChild(dialog)
|
|
248
|
+
|
|
249
|
+
expect(isNativeSelectMenuInteraction(dialog, select)).toBe(true)
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
test('returns true when a select inside the dialog is focused (Firefox OS menu pick)', () => {
|
|
253
|
+
const dialog = document.createElement('dialog')
|
|
254
|
+
const select = document.createElement('select')
|
|
255
|
+
dialog.appendChild(select)
|
|
256
|
+
document.body.appendChild(dialog)
|
|
257
|
+
select.focus()
|
|
258
|
+
|
|
259
|
+
expect(isNativeSelectMenuInteraction(dialog, dialog)).toBe(true)
|
|
260
|
+
})
|
|
261
|
+
|
|
262
|
+
test('returns false when the select is outside the dialog', () => {
|
|
263
|
+
const dialog = document.createElement('dialog')
|
|
264
|
+
const select = document.createElement('select')
|
|
265
|
+
document.body.appendChild(dialog)
|
|
266
|
+
document.body.appendChild(select)
|
|
267
|
+
|
|
268
|
+
expect(isNativeSelectMenuInteraction(dialog, select)).toBe(false)
|
|
269
|
+
})
|
|
270
|
+
})
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import PbEnhancedElement from "../pb_enhanced_element";
|
|
2
|
+
import {
|
|
3
|
+
isNativeSelectMenuInteraction,
|
|
4
|
+
targetIsInsidePortaledFloatingKit,
|
|
5
|
+
} from "../utilities/floatingPortalHosts";
|
|
2
6
|
|
|
3
7
|
const DIALOG_WRAPPER_SELECTOR = "[data-pb-dialog-wrapper]";
|
|
4
8
|
|
|
@@ -194,7 +198,13 @@ export default class PbDialog extends PbEnhancedElement {
|
|
|
194
198
|
const dialogParentDataset = dialogElement.parentElement.dataset
|
|
195
199
|
if (dialogParentDataset.overlayClick === "overlay_close") return
|
|
196
200
|
|
|
197
|
-
const
|
|
201
|
+
const target = event.target
|
|
202
|
+
if (targetIsInsidePortaledFloatingKit(target, dialogElement.id)) return
|
|
203
|
+
if (isNativeSelectMenuInteraction(dialogElement, target)) return
|
|
204
|
+
|
|
205
|
+
const dialogContent =
|
|
206
|
+
dialogElement.querySelector(".pb_dialog_scroll_region") || dialogElement
|
|
207
|
+
const dialogModal = dialogContent.getBoundingClientRect()
|
|
198
208
|
const clickedOutsideDialogModal = event.clientX < dialogModal.left ||
|
|
199
209
|
event.clientX > dialogModal.right ||
|
|
200
210
|
event.clientY < dialogModal.top ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
You can add drag event listeners for `drag`, `dragend`, `dragenter`, `dragleave`, `dragover`, `dragstart`, and `drop
|
|
1
|
+
You can add drag event listeners for desktop `drag`, `dragend`, `dragenter`, `dragleave`, `dragover`, `dragstart`, and `drop` or mobile `touch`, `touchend`, `touchcancel`,`touchleave`, `touchmove`, `touchstart`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<% lists = [
|
|
2
|
+
{
|
|
3
|
+
title: "Morning Crew",
|
|
4
|
+
items: [
|
|
5
|
+
{ id: "m1", name: "Alice Chen" },
|
|
6
|
+
{ id: "m2", name: "Ben Ortiz" },
|
|
7
|
+
{ id: "m3", name: "Cara Kim" },
|
|
8
|
+
],
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
title: "Afternoon Crew",
|
|
12
|
+
items: [
|
|
13
|
+
{ id: "a1", name: "Diana Patel" },
|
|
14
|
+
{ id: "a2", name: "Evan Brooks" },
|
|
15
|
+
{ id: "a3", name: "Fiona Lee" },
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
] %>
|
|
19
|
+
|
|
20
|
+
<%= pb_rails("flex", props: { gap: "md", justify_content: "center", wrap: true }) do %>
|
|
21
|
+
<% lists.each do |list| %>
|
|
22
|
+
<%= pb_rails("flex/flex_item", props: { fixed_size: "220px" }) do %>
|
|
23
|
+
<%= pb_rails("caption", props: { text: list[:title], text_align: "center", margin_bottom: "xs" }) %>
|
|
24
|
+
<%= pb_rails("draggable", props: { initial_items: list[:items] }) do %>
|
|
25
|
+
<%= pb_rails("draggable/draggable_container", props: { padding: "sm" }) do %>
|
|
26
|
+
<% list[:items].each do |item| %>
|
|
27
|
+
<%= pb_rails("draggable/draggable_item", props: { drag_id: item[:id], margin_bottom: "xs" }) do %>
|
|
28
|
+
<%= pb_rails("body", props: { text: item[:name] }) %>
|
|
29
|
+
<% end %>
|
|
30
|
+
<% end %>
|
|
31
|
+
<% end %>
|
|
32
|
+
<% end %>
|
|
33
|
+
<% end %>
|
|
34
|
+
<% end %>
|
|
35
|
+
<% end %>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Use a **separate** `draggable` kit for each list when items should reorder within their own column only.
|
|
2
|
+
|
|
3
|
+
Each instance creates its own drag boundary. Items stay inside that list on desktop and touch — they cannot be dropped into a neighboring list.
|
|
4
|
+
|
|
5
|
+
This is different from [Dragging Across Multiple Containers](#draggable_multiple_containers), which uses **one** `draggable` wrapping multiple `draggable/draggable_container` kits so items can move between columns.
|
|
6
|
+
|
|
7
|
+
On touch devices, drag from the grip handle. Swiping outside the handle scrolls as usual.
|
|
8
|
+
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
|
|
1
|
+
The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure — **one** `draggable` wrapping multiple `draggable/draggable_container` kits so items can move between columns.
|
|
2
|
+
|
|
3
|
+
For lists that should stay separate, see [Independent Draggable Containers](#draggable_independent_containers).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
|
|
1
|
+
The Draggable kit can also be used to achieve more complex, multiple container functionality as shown here. This complex usage requires the full subcomponent structure.
|
|
@@ -1,54 +1,295 @@
|
|
|
1
1
|
{
|
|
2
2
|
"template": "<Draggable{{props}} />",
|
|
3
|
-
"propTargets": {
|
|
3
|
+
"propTargets": {
|
|
4
|
+
"dropZone": "Provider.props",
|
|
5
|
+
"providerId": "Provider.props",
|
|
6
|
+
"enableCrossContainerPreview": "Provider.props",
|
|
7
|
+
"htmlOptions": "Container.props",
|
|
8
|
+
"tag": "Container.props",
|
|
9
|
+
"onDragStart": "Item.props",
|
|
10
|
+
"onDragEnd": "Item.props",
|
|
11
|
+
"onDrop": "Item.props"
|
|
12
|
+
},
|
|
4
13
|
"defaults": {
|
|
5
|
-
"dropZoneColor": "neutral"
|
|
14
|
+
"dropZoneColor": "neutral",
|
|
15
|
+
"dropZone": {
|
|
16
|
+
"type": "ghost",
|
|
17
|
+
"color": "neutral",
|
|
18
|
+
"direction": "vertical"
|
|
19
|
+
},
|
|
20
|
+
"providerId": "draggable-playground",
|
|
21
|
+
"enableCrossContainerPreview": false
|
|
6
22
|
},
|
|
7
23
|
"groups": [
|
|
8
24
|
{
|
|
9
|
-
"name": "
|
|
25
|
+
"name": "Provider",
|
|
10
26
|
"props": [
|
|
11
27
|
"dropZone",
|
|
12
|
-
"
|
|
28
|
+
"providerId",
|
|
29
|
+
"enableCrossContainerPreview"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "Container",
|
|
34
|
+
"props": [
|
|
35
|
+
"tag"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Item",
|
|
40
|
+
"props": [
|
|
41
|
+
"onDragStart",
|
|
42
|
+
"onDragEnd",
|
|
43
|
+
"onDrop"
|
|
13
44
|
]
|
|
14
45
|
}
|
|
15
46
|
],
|
|
16
47
|
"presets": [
|
|
17
48
|
{
|
|
18
|
-
"name": "
|
|
49
|
+
"name": "Single List",
|
|
50
|
+
"structureMode": "single_container",
|
|
51
|
+
"props": {
|
|
52
|
+
"dropZone": {
|
|
53
|
+
"type": "ghost",
|
|
54
|
+
"color": "neutral",
|
|
55
|
+
"direction": "vertical"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "Outline Drop Zone",
|
|
61
|
+
"structureMode": "single_container",
|
|
62
|
+
"props": {
|
|
63
|
+
"dropZone": {
|
|
64
|
+
"type": "outline",
|
|
65
|
+
"color": "primary",
|
|
66
|
+
"direction": "vertical"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "Shadow Drop Zone",
|
|
72
|
+
"structureMode": "single_container",
|
|
73
|
+
"props": {
|
|
74
|
+
"dropZone": {
|
|
75
|
+
"type": "shadow",
|
|
76
|
+
"color": "purple",
|
|
77
|
+
"direction": "vertical"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "Line Vertical",
|
|
83
|
+
"structureMode": "single_container",
|
|
19
84
|
"props": {
|
|
20
|
-
"dropZone":
|
|
21
|
-
|
|
85
|
+
"dropZone": {
|
|
86
|
+
"type": "line",
|
|
87
|
+
"color": "primary",
|
|
88
|
+
"direction": "vertical"
|
|
89
|
+
}
|
|
22
90
|
}
|
|
23
91
|
},
|
|
24
92
|
{
|
|
25
|
-
"name": "
|
|
93
|
+
"name": "Line Horizontal",
|
|
94
|
+
"structureMode": "single_container_horizontal",
|
|
26
95
|
"props": {
|
|
27
|
-
"dropZone":
|
|
28
|
-
|
|
96
|
+
"dropZone": {
|
|
97
|
+
"type": "line",
|
|
98
|
+
"color": "primary",
|
|
99
|
+
"direction": "horizontal"
|
|
100
|
+
}
|
|
29
101
|
}
|
|
30
102
|
},
|
|
31
103
|
{
|
|
32
|
-
"name": "
|
|
104
|
+
"name": "Multiple Containers",
|
|
105
|
+
"structureMode": "multiple_containers",
|
|
33
106
|
"props": {
|
|
34
|
-
"dropZone":
|
|
35
|
-
|
|
107
|
+
"dropZone": {
|
|
108
|
+
"type": "ghost",
|
|
109
|
+
"color": "neutral",
|
|
110
|
+
"direction": "vertical"
|
|
111
|
+
}
|
|
36
112
|
}
|
|
37
113
|
},
|
|
38
114
|
{
|
|
39
|
-
"name": "
|
|
115
|
+
"name": "Cross Container Preview",
|
|
116
|
+
"structureMode": "multiple_containers",
|
|
40
117
|
"props": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
118
|
+
"enableCrossContainerPreview": true,
|
|
119
|
+
"dropZone": {
|
|
120
|
+
"type": "outline",
|
|
121
|
+
"color": "primary",
|
|
122
|
+
"direction": "vertical"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "Event Listeners",
|
|
128
|
+
"structureMode": "single_container",
|
|
129
|
+
"props": {
|
|
130
|
+
"onDragEnd": "() => console.log('drag end')",
|
|
131
|
+
"onDragStart": "() => console.log('drag start')",
|
|
132
|
+
"onDrop": "() => console.log('drop')",
|
|
133
|
+
"dropZone": {
|
|
134
|
+
"type": "ghost",
|
|
135
|
+
"color": "neutral",
|
|
136
|
+
"direction": "vertical"
|
|
137
|
+
}
|
|
43
138
|
}
|
|
44
139
|
}
|
|
45
140
|
],
|
|
46
141
|
"conditionals": {},
|
|
47
142
|
"hints": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"message": "
|
|
143
|
+
"single_list": {
|
|
144
|
+
"presetName": "Single List",
|
|
145
|
+
"message": "Single List wraps Draggable.Container and Draggable.Item children in DraggableProvider with initialItems and onReorder.",
|
|
146
|
+
"type": "info"
|
|
147
|
+
},
|
|
148
|
+
"outline_drop_zone": {
|
|
149
|
+
"presetName": "Outline Drop Zone",
|
|
150
|
+
"message": "Outline Drop Zone passes a dropZone object to DraggableProvider so the dragged item uses the outline treatment.",
|
|
151
|
+
"type": "info"
|
|
152
|
+
},
|
|
153
|
+
"shadow_drop_zone": {
|
|
154
|
+
"presetName": "Shadow Drop Zone",
|
|
155
|
+
"message": "Shadow Drop Zone uses the provider dropZone color and type to preview the shadow treatment while dragging.",
|
|
51
156
|
"type": "info"
|
|
157
|
+
},
|
|
158
|
+
"line_vertical": {
|
|
159
|
+
"presetName": "Line Vertical",
|
|
160
|
+
"message": "Line Vertical uses dropZone.direction=\"vertical\" for between-row placement.",
|
|
161
|
+
"type": "info"
|
|
162
|
+
},
|
|
163
|
+
"line_horizontal": {
|
|
164
|
+
"presetName": "Line Horizontal",
|
|
165
|
+
"message": "Line Horizontal uses dropZone.direction=\"horizontal\" for between-column placement.",
|
|
166
|
+
"type": "info"
|
|
167
|
+
},
|
|
168
|
+
"multiple_containers": {
|
|
169
|
+
"presetName": "Multiple Containers",
|
|
170
|
+
"message": "Multiple Containers maps items into Draggable.Container columns by their container value.",
|
|
171
|
+
"type": "info"
|
|
172
|
+
},
|
|
173
|
+
"cross_container_preview": {
|
|
174
|
+
"presetName": "Cross Container Preview",
|
|
175
|
+
"message": "Cross Container Preview enables provider-managed movement previews between containers before drop.",
|
|
176
|
+
"type": "info"
|
|
177
|
+
},
|
|
178
|
+
"event_listeners": {
|
|
179
|
+
"presetName": "Event Listeners",
|
|
180
|
+
"message": "Event Listeners routes item callbacks through Draggable.Item props so drag events can be handled by app code.",
|
|
181
|
+
"type": "info"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"structureModes": {
|
|
185
|
+
"default": "single_container",
|
|
186
|
+
"modes": {
|
|
187
|
+
"single_container": {
|
|
188
|
+
"label": "Single Container",
|
|
189
|
+
"template": "<DraggableProvider\n initialItems={initialItems}\n onReorder={setItems}{{Provider.props}}\n>\n <Draggable{{props}}>\n <Draggable.Container\n container=\"tasks\"{{Container.props}}\n >\n <Flex\n gap=\"xs\"\n orientation=\"column\"\n >\n {items.map(({ id, text }) => (\n <Draggable.Item\n container=\"tasks\"\n dragId={id}\n key={id}{{Item.props}}\n >\n <Card padding=\"xs\">\n <Body text={text} />\n </Card>\n </Draggable.Item>\n ))}\n </Flex>\n </Draggable.Container>\n </Draggable>\n</DraggableProvider>",
|
|
190
|
+
"children": "",
|
|
191
|
+
"props": {
|
|
192
|
+
"dropZone": {
|
|
193
|
+
"type": "ghost",
|
|
194
|
+
"color": "neutral",
|
|
195
|
+
"direction": "vertical"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"wrapper": "const initialItems = [\n { id: 'task-1', container: 'tasks', text: 'Confirm scope' },\n { id: 'task-2', container: 'tasks', text: 'Design states' },\n { id: 'task-3', container: 'tasks', text: 'Ship playground' },\n]\n\nconst DraggablePlaygroundExample = () => {\n const [items, setItems] = useState(initialItems)\n\n return {{component}}\n}\n\n<DraggablePlaygroundExample />"
|
|
199
|
+
},
|
|
200
|
+
"single_container_horizontal": {
|
|
201
|
+
"label": "Single Container Horizontal",
|
|
202
|
+
"template": "<Flex>\n <DraggableProvider\n initialItems={initialItems}\n onReorder={setItems}{{Provider.props}}\n >\n <Draggable.Container{{Container.props}}>\n <Flex\n alignItems=\"stretch\"\n flexDirection=\"row\"\n height=\"110px\"\n >\n {items.map(({ id, url }) => (\n <Draggable.Item\n dragId={id}\n key={id}\n marginRight=\"sm\"{{Item.props}}\n >\n <Image\n alt={id}\n size=\"md\"\n url={url}\n />\n </Draggable.Item>\n ))}\n </Flex>\n </Draggable.Container>\n </DraggableProvider>\n</Flex>",
|
|
203
|
+
"children": "",
|
|
204
|
+
"props": {
|
|
205
|
+
"dropZone": {
|
|
206
|
+
"type": "line",
|
|
207
|
+
"color": "primary",
|
|
208
|
+
"direction": "horizontal"
|
|
209
|
+
},
|
|
210
|
+
"htmlOptions": {
|
|
211
|
+
"style": {
|
|
212
|
+
"width": "420px"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"wrapper": "const initialItems = [\n { id: 'image-1', url: 'https://unsplash.it/500/400/?image=633' },\n { id: 'image-2', url: 'https://unsplash.it/500/400/?image=634' },\n { id: 'image-3', url: 'https://unsplash.it/500/400/?image=637' },\n]\n\nconst DraggablePlaygroundExample = () => {\n const [items, setItems] = useState(initialItems)\n\n return {{component}}\n}\n\n<DraggablePlaygroundExample />"
|
|
217
|
+
},
|
|
218
|
+
"multiple_containers": {
|
|
219
|
+
"label": "Multiple Containers",
|
|
220
|
+
"template": "<DraggableProvider\n initialItems={initialItems}\n onReorder={setItems}{{Provider.props}}\n>\n <Draggable{{props}}>\n <Flex\n align=\"start\"\n gap=\"sm\"\n wrap\n >\n {containers.map((container) => (\n <Draggable.Container\n container={container}\n key={container}\n minWidth=\"220px\"{{Container.props}}\n >\n <Card padding=\"sm\">\n <Title\n marginBottom=\"xs\"\n size={4}\n text={container}\n />\n <Flex\n gap=\"xs\"\n orientation=\"column\"\n >\n {items\n .filter((item) => item.container === container)\n .map(({ id, text }) => (\n <Draggable.Item\n container={container}\n dragId={id}\n key={id}{{Item.props}}\n >\n <Card padding=\"xs\">\n <Body text={text} />\n </Card>\n </Draggable.Item>\n ))}\n </Flex>\n </Card>\n </Draggable.Container>\n ))}\n </Flex>\n </Draggable>\n</DraggableProvider>",
|
|
221
|
+
"children": "",
|
|
222
|
+
"props": {
|
|
223
|
+
"dropZone": {
|
|
224
|
+
"type": "ghost",
|
|
225
|
+
"color": "neutral",
|
|
226
|
+
"direction": "vertical"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"wrapper": "const containers = ['To Do', 'In Progress', 'Done']\nconst initialItems = [\n { id: 'task-1', container: 'To Do', text: 'Confirm scope' },\n { id: 'task-2', container: 'To Do', text: 'Design states' },\n { id: 'task-3', container: 'In Progress', text: 'Ship playground' },\n { id: 'task-4', container: 'Done', text: 'Write docs' },\n]\n\nconst DraggablePlaygroundExample = () => {\n const [items, setItems] = useState(initialItems)\n\n return {{component}}\n}\n\n<DraggablePlaygroundExample />"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
"children": {
|
|
234
|
+
"editable": false,
|
|
235
|
+
"default": ""
|
|
236
|
+
},
|
|
237
|
+
"customProps": {
|
|
238
|
+
"dropZone": {
|
|
239
|
+
"type": "object",
|
|
240
|
+
"platforms": [
|
|
241
|
+
"react"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"providerId": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"platforms": [
|
|
247
|
+
"react"
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
"enableCrossContainerPreview": {
|
|
251
|
+
"type": "boolean",
|
|
252
|
+
"platforms": [
|
|
253
|
+
"react"
|
|
254
|
+
],
|
|
255
|
+
"default": false
|
|
256
|
+
},
|
|
257
|
+
"tag": {
|
|
258
|
+
"type": "enum",
|
|
259
|
+
"platforms": [
|
|
260
|
+
"react"
|
|
261
|
+
],
|
|
262
|
+
"values": [
|
|
263
|
+
"div",
|
|
264
|
+
"span",
|
|
265
|
+
"p",
|
|
266
|
+
"tr",
|
|
267
|
+
"td",
|
|
268
|
+
"tbody"
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
"onDragStart": {
|
|
272
|
+
"type": "function",
|
|
273
|
+
"platforms": [
|
|
274
|
+
"react"
|
|
275
|
+
]
|
|
276
|
+
},
|
|
277
|
+
"onDragEnd": {
|
|
278
|
+
"type": "function",
|
|
279
|
+
"platforms": [
|
|
280
|
+
"react"
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
"onDrop": {
|
|
284
|
+
"type": "function",
|
|
285
|
+
"platforms": [
|
|
286
|
+
"react"
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"propSyncOnEnable": {
|
|
291
|
+
"enableCrossContainerPreview": {
|
|
292
|
+
"structureMode": "multiple_containers"
|
|
52
293
|
}
|
|
53
294
|
}
|
|
54
295
|
}
|