@elastic/eui 110.0.0 → 111.1.0
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.
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +36 -55
- package/es/components/basic_table/in_memory_table.js +6 -6
- package/es/components/beacon/beacon.styles.js +1 -1
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_group/button_group.js +1 -1
- package/es/components/button/button_group/button_group_button.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/button/index.js +2 -1
- package/es/components/button/split_button/index.js +10 -0
- package/es/components/button/split_button/split_button.js +120 -0
- package/es/components/button/split_button/split_button.styles.js +51 -0
- package/es/components/button/split_button/split_button_actions.js +115 -0
- package/{optimize/es/components/flyout/flyout_context.js → es/components/button/split_button/split_button_context.js} +5 -7
- package/es/components/call_out/call_out.js +1 -1
- package/es/components/card/card.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav.js +20 -101
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/es/components/comment_list/comment.js +2 -2
- package/es/components/comment_list/comment_event.js +1 -1
- package/es/components/comment_list/comment_list.js +2 -2
- package/es/components/comment_list/comment_timeline.js +1 -1
- package/es/components/context_menu/context_menu_item.js +1 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/es/components/datagrid/body/data_grid_body.js +7 -7
- package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/es/components/datagrid/controls/column_sorting.js +7 -7
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/es/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
- package/es/components/datagrid/utils/in_memory.js +6 -6
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +2 -2
- package/es/components/flex/flex_group.js +1 -1
- package/es/components/flyout/_flyout_overlay.js +52 -0
- package/es/components/flyout/_flyout_resize_button.js +32 -0
- package/es/components/flyout/{flyout_resizable.styles.js → _flyout_resize_button.styles.js} +11 -11
- package/es/components/flyout/const.js +42 -0
- package/es/components/flyout/flyout.component.js +481 -0
- package/es/components/flyout/flyout.js +77 -379
- package/es/components/flyout/flyout.styles.js +106 -7
- package/es/components/flyout/flyout_menu.js +241 -0
- package/es/components/flyout/flyout_menu.styles.js +19 -0
- package/es/components/flyout/{flyout_context.js → flyout_menu_context.js} +1 -7
- package/es/components/flyout/flyout_parent_context.js +36 -0
- package/es/components/flyout/flyout_resizable.js +33 -144
- package/es/components/flyout/hooks.js +25 -0
- package/es/components/flyout/index.js +5 -2
- package/es/components/flyout/manager/actions.js +153 -0
- package/es/components/flyout/manager/activity_stage.js +95 -0
- package/es/components/flyout/manager/const.js +56 -0
- package/es/components/flyout/manager/context.js +33 -0
- package/es/components/flyout/manager/flyout_child.js +75 -0
- package/es/components/flyout/manager/flyout_main.js +65 -0
- package/es/components/flyout/manager/flyout_main.styles.js +25 -0
- package/es/components/flyout/manager/flyout_managed.js +227 -0
- package/es/components/flyout/manager/flyout_managed.styles.js +69 -0
- package/es/components/flyout/manager/hooks.js +55 -0
- package/es/components/flyout/manager/index.js +31 -0
- package/es/components/flyout/manager/layout_mode.js +167 -0
- package/es/components/flyout/manager/provider.js +57 -0
- package/es/components/flyout/manager/reducer.js +320 -0
- package/es/components/flyout/manager/selectors.js +116 -0
- package/es/components/flyout/manager/store.js +113 -0
- package/es/components/flyout/manager/validation.js +85 -0
- package/es/components/flyout/use_flyout_resizable.js +149 -0
- package/es/components/flyout/use_flyout_z_index.js +46 -0
- package/es/components/form/field_number/field_number.js +2 -2
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/form_control_button/form_control_button.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/es/components/form/text_area/text_area.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_logo/header_logo.js +1 -1
- package/es/components/header/header_section/header_section_item_button.js +1 -1
- package/es/components/horizontal_rule/horizontal_rule.js +1 -1
- package/es/components/icon/assets/agentBuilderRobot.js +37 -0
- package/es/components/icon/assets/cross_project_search.js +35 -0
- package/es/components/icon/assets/dashed_circle.js +35 -0
- package/es/components/icon/assets/product_robot.js +37 -0
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_map.js +3 -0
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/link/external_link_icon.js +6 -3
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/list_group_item_extra_action.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/overlay_mask/overlay_mask.js +13 -3
- package/es/components/overlay_mask/overlay_mask.styles.js +11 -2
- package/es/components/page/page_header/page_header_content.js +2 -2
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/provider/provider.js +2 -1
- package/es/components/search_bar/search_bar.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/es/components/spacer/spacer.js +1 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +1 -1
- package/es/components/toast/toast.js +1 -1
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/components/tour/tour_step_indicator.js +8 -3
- package/es/global_styling/mixins/_button.js +28 -9
- package/es/global_styling/mixins/_container_query.js +106 -0
- package/es/global_styling/mixins/index.js +1 -0
- package/es/services/container_query/container_query_hook.js +64 -0
- package/es/{components/flyout/sessions → services/container_query}/index.js +1 -2
- package/es/services/container_query/match_container.js +242 -0
- package/eui.d.ts +7558 -6642
- package/i18ntokens.json +1438 -1384
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +36 -55
- package/lib/components/basic_table/in_memory_table.js +6 -6
- package/lib/components/beacon/beacon.styles.js +1 -1
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_group/button_group.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/button/index.js +8 -1
- package/lib/components/button/split_button/index.js +25 -0
- package/lib/components/button/split_button/split_button.js +129 -0
- package/lib/components/button/split_button/split_button.styles.js +55 -0
- package/lib/components/button/split_button/split_button_actions.js +123 -0
- package/{optimize/lib/components/flyout/flyout_context.js → lib/components/button/split_button/split_button_context.js} +6 -7
- package/lib/components/call_out/call_out.js +1 -1
- package/lib/components/card/card.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav.js +20 -101
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/lib/components/comment_list/comment.js +2 -2
- package/lib/components/comment_list/comment_event.js +1 -1
- package/lib/components/comment_list/comment_list.js +2 -2
- package/lib/components/comment_list/comment_timeline.js +1 -1
- package/lib/components/context_menu/context_menu_item.js +1 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/lib/components/datagrid/body/data_grid_body.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/lib/components/datagrid/controls/column_sorting.js +7 -7
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/lib/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
- package/lib/components/datagrid/utils/in_memory.js +6 -6
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +2 -2
- package/lib/components/flex/flex_group.js +1 -1
- package/lib/components/flyout/_flyout_overlay.js +59 -0
- package/lib/components/flyout/_flyout_resize_button.js +38 -0
- package/{test-env/components/flyout/flyout_resizable.styles.js → lib/components/flyout/_flyout_resize_button.styles.js} +12 -12
- package/lib/components/flyout/const.js +49 -0
- package/lib/components/flyout/flyout.component.js +488 -0
- package/lib/components/flyout/flyout.js +102 -379
- package/lib/components/flyout/flyout.styles.js +106 -7
- package/lib/components/flyout/flyout_menu.js +243 -0
- package/lib/components/flyout/flyout_menu.styles.js +25 -0
- package/lib/components/flyout/{flyout_context.js → flyout_menu_context.js} +2 -7
- package/lib/components/flyout/flyout_parent_context.js +43 -0
- package/lib/components/flyout/flyout_resizable.js +36 -147
- package/lib/components/flyout/hooks.js +30 -0
- package/lib/components/flyout/index.js +21 -14
- package/lib/components/flyout/manager/actions.js +159 -0
- package/lib/components/flyout/manager/activity_stage.js +101 -0
- package/lib/components/flyout/manager/const.js +62 -0
- package/lib/components/flyout/manager/context.js +41 -0
- package/lib/components/flyout/manager/flyout_child.js +80 -0
- package/lib/components/flyout/manager/flyout_main.js +70 -0
- package/lib/components/flyout/manager/flyout_main.styles.js +31 -0
- package/lib/components/flyout/manager/flyout_managed.js +233 -0
- package/lib/components/flyout/manager/flyout_managed.styles.js +73 -0
- package/lib/components/flyout/manager/hooks.js +131 -0
- package/lib/components/flyout/manager/index.js +168 -0
- package/lib/components/flyout/manager/layout_mode.js +171 -0
- package/lib/components/flyout/manager/provider.js +63 -0
- package/lib/components/flyout/manager/reducer.js +325 -0
- package/lib/components/flyout/manager/selectors.js +122 -0
- package/lib/components/flyout/manager/store.js +120 -0
- package/lib/components/flyout/manager/validation.js +94 -0
- package/lib/components/flyout/use_flyout_resizable.js +153 -0
- package/lib/components/flyout/use_flyout_z_index.js +51 -0
- package/lib/components/form/field_number/field_number.js +2 -2
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/form_control_button/form_control_button.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/lib/components/form/text_area/text_area.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_logo/header_logo.js +1 -1
- package/lib/components/header/header_section/header_section_item_button.js +1 -1
- package/lib/components/horizontal_rule/horizontal_rule.js +1 -1
- package/lib/components/icon/assets/agentBuilderRobot.js +44 -0
- package/lib/components/icon/assets/cross_project_search.js +42 -0
- package/lib/components/icon/assets/dashed_circle.js +42 -0
- package/lib/components/icon/assets/product_robot.js +44 -0
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_map.js +3 -0
- package/lib/components/icon/svgs/cross_project_search.svg +3 -0
- package/lib/components/icon/svgs/dashed_circle.svg +5 -0
- package/lib/components/icon/svgs/product_robot.svg +4 -0
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/link/external_link_icon.js +6 -3
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/list_group_item_extra_action.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/overlay_mask/overlay_mask.js +12 -2
- package/lib/components/overlay_mask/overlay_mask.styles.js +11 -4
- package/lib/components/page/page_header/page_header_content.js +2 -2
- package/lib/components/pagination/pagination_button.js +1 -1
- package/lib/components/provider/provider.js +2 -1
- package/lib/components/search_bar/search_bar.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/lib/components/spacer/spacer.js +1 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +1 -1
- package/lib/components/toast/toast.js +1 -1
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/components/tour/tour_step_indicator.js +8 -3
- package/lib/global_styling/mixins/_button.js +29 -10
- package/lib/global_styling/mixins/_container_query.js +112 -0
- package/lib/global_styling/mixins/index.js +11 -0
- package/lib/services/container_query/container_query_hook.js +67 -0
- package/lib/services/container_query/index.js +16 -0
- package/lib/services/container_query/match_container.js +243 -0
- package/optimize/es/components/basic_table/basic_table.js +30 -49
- package/optimize/es/components/beacon/beacon.styles.js +1 -1
- package/optimize/es/components/button/index.js +2 -1
- package/optimize/es/components/button/split_button/index.js +10 -0
- package/optimize/es/components/button/split_button/split_button.js +98 -0
- package/optimize/es/components/button/split_button/split_button.styles.js +51 -0
- package/optimize/es/components/button/split_button/split_button_actions.js +89 -0
- package/optimize/es/components/button/split_button/split_button_context.js +14 -0
- package/optimize/es/components/collapsible_nav/collapsible_nav.js +1 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
- package/optimize/es/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
- package/optimize/es/components/empty_prompt/empty_prompt.js +1 -1
- package/optimize/es/components/flex/flex_group.js +1 -1
- package/optimize/es/components/flyout/_flyout_overlay.js +52 -0
- package/optimize/es/components/flyout/_flyout_resize_button.js +31 -0
- package/optimize/es/components/flyout/{flyout_resizable.styles.js → _flyout_resize_button.styles.js} +11 -11
- package/optimize/es/components/flyout/const.js +42 -0
- package/optimize/es/components/flyout/flyout.component.js +469 -0
- package/optimize/es/components/flyout/flyout.js +53 -349
- package/optimize/es/components/flyout/flyout.styles.js +103 -7
- package/optimize/es/components/flyout/flyout_menu.js +162 -0
- package/optimize/es/components/flyout/flyout_menu.styles.js +19 -0
- package/optimize/es/components/flyout/flyout_menu_context.js +10 -0
- package/optimize/es/components/flyout/flyout_parent_context.js +36 -0
- package/optimize/es/components/flyout/flyout_resizable.js +7 -138
- package/optimize/es/components/flyout/hooks.js +25 -0
- package/optimize/es/components/flyout/index.js +5 -2
- package/optimize/es/components/flyout/manager/actions.js +153 -0
- package/optimize/es/components/flyout/manager/activity_stage.js +95 -0
- package/optimize/es/components/flyout/manager/const.js +56 -0
- package/optimize/es/components/flyout/manager/context.js +33 -0
- package/optimize/es/components/flyout/manager/flyout_child.js +71 -0
- package/optimize/es/components/flyout/manager/flyout_main.js +61 -0
- package/optimize/es/components/flyout/manager/flyout_main.styles.js +25 -0
- package/optimize/es/components/flyout/manager/flyout_managed.js +223 -0
- package/optimize/es/components/flyout/manager/flyout_managed.styles.js +69 -0
- package/optimize/es/components/flyout/manager/hooks.js +55 -0
- package/optimize/es/components/flyout/manager/index.js +31 -0
- package/optimize/es/components/flyout/manager/layout_mode.js +162 -0
- package/optimize/es/components/flyout/manager/provider.js +53 -0
- package/optimize/es/components/flyout/manager/reducer.js +312 -0
- package/optimize/es/components/flyout/manager/selectors.js +116 -0
- package/optimize/es/components/flyout/manager/store.js +113 -0
- package/optimize/es/components/flyout/manager/types.js +1 -0
- package/optimize/es/components/flyout/manager/validation.js +85 -0
- package/optimize/es/components/flyout/types.js +1 -0
- package/optimize/es/components/flyout/use_flyout_resizable.js +144 -0
- package/optimize/es/components/flyout/use_flyout_z_index.js +46 -0
- package/optimize/es/components/horizontal_rule/horizontal_rule.js +1 -1
- package/optimize/es/components/icon/assets/agentBuilderRobot.js +36 -0
- package/optimize/es/components/icon/assets/cross_project_search.js +34 -0
- package/optimize/es/components/icon/assets/dashed_circle.js +34 -0
- package/optimize/es/components/icon/assets/product_robot.js +36 -0
- package/optimize/es/components/icon/icon_map.js +3 -0
- package/optimize/es/components/link/external_link_icon.js +6 -3
- package/optimize/es/components/overlay_mask/overlay_mask.js +13 -3
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +11 -2
- package/optimize/es/components/page/page_header/page_header_content.js +1 -1
- package/optimize/es/components/provider/provider.js +2 -1
- package/optimize/es/components/search_bar/search_bar.js +1 -1
- package/optimize/es/components/spacer/spacer.js +1 -1
- package/optimize/es/components/tour/tour_step_indicator.js +8 -3
- package/optimize/es/global_styling/mixins/_button.js +28 -9
- package/optimize/es/global_styling/mixins/_container_query.js +106 -0
- package/optimize/es/global_styling/mixins/index.js +1 -0
- package/optimize/es/services/container_query/container_query_hook.js +59 -0
- package/optimize/es/{components/flyout/sessions → services/container_query}/index.js +1 -2
- package/optimize/es/services/container_query/match_container.js +229 -0
- package/optimize/lib/components/basic_table/basic_table.js +30 -49
- package/optimize/lib/components/beacon/beacon.styles.js +1 -1
- package/optimize/lib/components/button/index.js +8 -1
- package/optimize/lib/components/button/split_button/index.js +25 -0
- package/optimize/lib/components/button/split_button/split_button.js +107 -0
- package/optimize/lib/components/button/split_button/split_button.styles.js +55 -0
- package/optimize/lib/components/button/split_button/split_button_actions.js +98 -0
- package/{test-env/components/flyout/flyout_context.js → optimize/lib/components/button/split_button/split_button_context.js} +6 -7
- package/optimize/lib/components/collapsible_nav/collapsible_nav.js +1 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
- package/optimize/lib/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
- package/optimize/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/optimize/lib/components/flex/flex_group.js +1 -1
- package/optimize/lib/components/flyout/_flyout_overlay.js +62 -0
- package/optimize/lib/components/flyout/_flyout_resize_button.js +37 -0
- package/{lib/components/flyout/flyout_resizable.styles.js → optimize/lib/components/flyout/_flyout_resize_button.styles.js} +12 -12
- package/optimize/lib/components/flyout/const.js +49 -0
- package/optimize/lib/components/flyout/flyout.component.js +477 -0
- package/optimize/lib/components/flyout/flyout.js +77 -349
- package/optimize/lib/components/flyout/flyout.styles.js +103 -7
- package/optimize/lib/components/flyout/flyout_menu.js +168 -0
- package/optimize/lib/components/flyout/flyout_menu.styles.js +25 -0
- package/optimize/lib/components/flyout/flyout_menu_context.js +16 -0
- package/optimize/lib/components/flyout/flyout_parent_context.js +43 -0
- package/optimize/lib/components/flyout/flyout_resizable.js +9 -139
- package/optimize/lib/components/flyout/hooks.js +30 -0
- package/optimize/lib/components/flyout/index.js +21 -14
- package/optimize/lib/components/flyout/manager/actions.js +159 -0
- package/optimize/lib/components/flyout/manager/activity_stage.js +101 -0
- package/optimize/lib/components/flyout/manager/const.js +62 -0
- package/optimize/lib/components/flyout/manager/context.js +41 -0
- package/optimize/lib/components/flyout/manager/flyout_child.js +76 -0
- package/optimize/lib/components/flyout/manager/flyout_main.js +66 -0
- package/optimize/lib/components/flyout/manager/flyout_main.styles.js +31 -0
- package/optimize/lib/components/flyout/manager/flyout_managed.js +231 -0
- package/optimize/lib/components/flyout/manager/flyout_managed.styles.js +74 -0
- package/optimize/lib/components/flyout/manager/hooks.js +131 -0
- package/optimize/lib/components/flyout/manager/index.js +168 -0
- package/optimize/lib/components/flyout/manager/layout_mode.js +169 -0
- package/optimize/lib/components/flyout/manager/provider.js +61 -0
- package/optimize/lib/components/flyout/manager/reducer.js +318 -0
- package/optimize/lib/components/flyout/manager/selectors.js +122 -0
- package/optimize/lib/components/flyout/manager/store.js +120 -0
- package/optimize/lib/components/flyout/manager/validation.js +94 -0
- package/optimize/lib/components/flyout/types.js +5 -0
- package/optimize/lib/components/flyout/use_flyout_resizable.js +151 -0
- package/optimize/lib/components/flyout/use_flyout_z_index.js +51 -0
- package/optimize/lib/components/horizontal_rule/horizontal_rule.js +1 -1
- package/optimize/lib/components/icon/assets/agentBuilderRobot.js +44 -0
- package/optimize/lib/components/icon/assets/cross_project_search.js +42 -0
- package/optimize/lib/components/icon/assets/dashed_circle.js +42 -0
- package/optimize/lib/components/icon/assets/product_robot.js +44 -0
- package/optimize/lib/components/icon/icon_map.js +3 -0
- package/optimize/lib/components/icon/svgs/cross_project_search.svg +3 -0
- package/optimize/lib/components/icon/svgs/dashed_circle.svg +5 -0
- package/optimize/lib/components/icon/svgs/product_robot.svg +4 -0
- package/optimize/lib/components/link/external_link_icon.js +6 -3
- package/optimize/lib/components/overlay_mask/overlay_mask.js +12 -2
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +11 -4
- package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
- package/optimize/lib/components/provider/provider.js +2 -1
- package/optimize/lib/components/search_bar/search_bar.js +1 -1
- package/optimize/lib/components/spacer/spacer.js +1 -1
- package/optimize/lib/components/tour/tour_step_indicator.js +8 -3
- package/optimize/lib/global_styling/mixins/_button.js +29 -10
- package/optimize/lib/global_styling/mixins/_container_query.js +112 -0
- package/optimize/lib/global_styling/mixins/index.js +11 -0
- package/optimize/lib/services/container_query/container_query_hook.js +65 -0
- package/optimize/lib/services/container_query/index.js +16 -0
- package/optimize/lib/services/container_query/match_container.js +231 -0
- package/package.json +5 -4
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +36 -55
- package/test-env/components/basic_table/in_memory_table.js +6 -6
- package/test-env/components/beacon/beacon.styles.js +1 -1
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_group/button_group.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/button/index.js +8 -1
- package/test-env/components/button/split_button/index.js +25 -0
- package/test-env/components/button/split_button/split_button.js +123 -0
- package/test-env/components/button/split_button/split_button.styles.js +55 -0
- package/test-env/components/button/split_button/split_button_actions.js +120 -0
- package/test-env/components/button/split_button/split_button_context.js +20 -0
- package/test-env/components/call_out/call_out.js +1 -1
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav.js +20 -101
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/test-env/components/comment_list/comment.js +2 -2
- package/test-env/components/comment_list/comment_event.js +1 -1
- package/test-env/components/comment_list/comment_list.js +2 -2
- package/test-env/components/comment_list/comment_timeline.js +1 -1
- package/test-env/components/context_menu/context_menu_item.js +1 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +12 -12
- package/test-env/components/datagrid/body/data_grid_body.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/test-env/components/datagrid/controls/column_sorting.js +7 -7
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/test-env/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
- package/test-env/components/datagrid/utils/in_memory.js +6 -6
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +2 -2
- package/test-env/components/flex/flex_group.js +1 -1
- package/test-env/components/flyout/_flyout_overlay.js +62 -0
- package/test-env/components/flyout/_flyout_resize_button.js +37 -0
- package/{optimize/lib/components/flyout/flyout_resizable.styles.js → test-env/components/flyout/_flyout_resize_button.styles.js} +12 -12
- package/test-env/components/flyout/const.js +49 -0
- package/test-env/components/flyout/flyout.component.js +477 -0
- package/test-env/components/flyout/flyout.styles.js +103 -7
- package/test-env/components/flyout/flyout_menu.js +241 -0
- package/test-env/components/flyout/flyout_menu.styles.js +25 -0
- package/test-env/components/flyout/flyout_menu_context.js +16 -0
- package/test-env/components/flyout/flyout_parent_context.js +43 -0
- package/test-env/components/flyout/flyout_resizable.js +35 -139
- package/test-env/components/flyout/hooks.js +30 -0
- package/test-env/components/flyout/index.js +21 -14
- package/test-env/components/flyout/manager/actions.js +159 -0
- package/test-env/components/flyout/manager/activity_stage.js +101 -0
- package/test-env/components/flyout/manager/const.js +62 -0
- package/test-env/components/flyout/manager/context.js +41 -0
- package/test-env/components/flyout/manager/flyout_child.js +76 -0
- package/test-env/components/flyout/manager/flyout_main.js +66 -0
- package/test-env/components/flyout/manager/flyout_main.styles.js +31 -0
- package/test-env/components/flyout/manager/flyout_managed.js +231 -0
- package/test-env/components/flyout/manager/flyout_managed.styles.js +74 -0
- package/test-env/components/flyout/manager/hooks.js +131 -0
- package/test-env/components/flyout/manager/index.js +168 -0
- package/test-env/components/flyout/manager/layout_mode.js +169 -0
- package/test-env/components/flyout/manager/provider.js +61 -0
- package/test-env/components/flyout/manager/reducer.js +318 -0
- package/test-env/components/flyout/manager/selectors.js +122 -0
- package/test-env/components/flyout/manager/store.js +120 -0
- package/test-env/components/flyout/manager/types.js +5 -0
- package/test-env/components/flyout/manager/validation.js +94 -0
- package/test-env/components/flyout/types.js +5 -0
- package/test-env/components/flyout/use_flyout_resizable.js +151 -0
- package/test-env/components/flyout/use_flyout_z_index.js +51 -0
- package/test-env/components/form/field_number/field_number.js +2 -2
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/form_control_button/form_control_button.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
- package/test-env/components/form/text_area/text_area.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_logo/header_logo.js +1 -1
- package/test-env/components/header/header_section/header_section_item_button.js +1 -1
- package/test-env/components/horizontal_rule/horizontal_rule.js +1 -1
- package/test-env/components/icon/assets/agentBuilderRobot.js +44 -0
- package/test-env/components/icon/assets/cross_project_search.js +42 -0
- package/test-env/components/icon/assets/dashed_circle.js +42 -0
- package/test-env/components/icon/assets/product_robot.js +44 -0
- package/test-env/components/icon/icon_map.js +3 -0
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/link/external_link_icon.js +6 -3
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/overlay_mask/overlay_mask.js +12 -2
- package/test-env/components/overlay_mask/overlay_mask.styles.js +11 -4
- package/test-env/components/page/page_header/page_header_content.js +2 -2
- package/test-env/components/pagination/pagination_button.js +1 -1
- package/test-env/components/provider/provider.js +2 -1
- package/test-env/components/search_bar/search_bar.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/test-env/components/spacer/spacer.js +1 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +1 -1
- package/test-env/components/toast/toast.js +1 -1
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/components/tour/tour_step_indicator.js +8 -3
- package/test-env/global_styling/mixins/_button.js +29 -10
- package/test-env/global_styling/mixins/_container_query.js +112 -0
- package/test-env/global_styling/mixins/index.js +11 -0
- package/test-env/services/container_query/container_query_hook.js +65 -0
- package/test-env/services/container_query/index.js +16 -0
- package/test-env/services/container_query/match_container.js +231 -0
- package/es/components/flyout/flyout_child.js +0 -223
- package/es/components/flyout/flyout_child.styles.js +0 -32
- package/es/components/flyout/flyout_child_manager.js +0 -114
- package/es/components/flyout/sessions/flyout_provider.js +0 -95
- package/es/components/flyout/sessions/flyout_reducer.js +0 -195
- package/es/components/flyout/sessions/use_eui_flyout.js +0 -82
- package/lib/components/flyout/flyout_child.js +0 -231
- package/lib/components/flyout/flyout_child.styles.js +0 -38
- package/lib/components/flyout/flyout_child_manager.js +0 -122
- package/lib/components/flyout/sessions/flyout_provider.js +0 -102
- package/lib/components/flyout/sessions/flyout_reducer.js +0 -202
- package/lib/components/flyout/sessions/index.js +0 -25
- package/lib/components/flyout/sessions/use_eui_flyout.js +0 -88
- package/optimize/es/components/flyout/flyout_child.js +0 -178
- package/optimize/es/components/flyout/flyout_child.styles.js +0 -32
- package/optimize/es/components/flyout/flyout_child_manager.js +0 -100
- package/optimize/es/components/flyout/sessions/flyout_provider.js +0 -90
- package/optimize/es/components/flyout/sessions/flyout_reducer.js +0 -187
- package/optimize/es/components/flyout/sessions/use_eui_flyout.js +0 -82
- package/optimize/lib/components/flyout/flyout_child.js +0 -186
- package/optimize/lib/components/flyout/flyout_child.styles.js +0 -38
- package/optimize/lib/components/flyout/flyout_child_manager.js +0 -110
- package/optimize/lib/components/flyout/sessions/flyout_provider.js +0 -100
- package/optimize/lib/components/flyout/sessions/flyout_reducer.js +0 -195
- package/optimize/lib/components/flyout/sessions/index.js +0 -25
- package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +0 -88
- package/test-env/components/flyout/flyout_child.js +0 -230
- package/test-env/components/flyout/flyout_child.styles.js +0 -38
- package/test-env/components/flyout/flyout_child_manager.js +0 -119
- package/test-env/components/flyout/sessions/flyout_provider.js +0 -100
- package/test-env/components/flyout/sessions/flyout_reducer.js +0 -195
- package/test-env/components/flyout/sessions/index.js +0 -25
- package/test-env/components/flyout/sessions/use_eui_flyout.js +0 -88
- /package/es/components/flyout/{sessions → manager}/types.js +0 -0
- /package/{optimize/es/components/flyout/sessions → es/components/flyout}/types.js +0 -0
- /package/lib/components/flyout/{sessions → manager}/types.js +0 -0
- /package/{optimize/lib/components/flyout/sessions → lib/components/flyout}/types.js +0 -0
- /package/{test-env/components/flyout/sessions → optimize/lib/components/flyout/manager}/types.js +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
1
2
|
/*
|
|
2
3
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
4
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -12,8 +13,16 @@ export var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
|
|
|
12
13
|
var euiTheme = _ref.euiTheme,
|
|
13
14
|
highContrastMode = _ref.highContrastMode;
|
|
14
15
|
return {
|
|
15
|
-
euiOverlayMask: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;animation:", euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", highContrastMode ? euiTheme.components.overlayMaskBackgroundHighContrast : euiTheme.components.overlayMaskBackground, ";;label:euiOverlayMask;"),
|
|
16
|
+
euiOverlayMask: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;animation:", euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in forwards;animation-iteration-count:1;background:", highContrastMode ? euiTheme.components.overlayMaskBackgroundHighContrast : euiTheme.components.overlayMaskBackground, ";;label:euiOverlayMask;"),
|
|
16
17
|
aboveHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
|
|
17
|
-
belowHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', 'var(--euiFixedHeadersOffset, 0)'), ";;label:belowHeader;")
|
|
18
|
+
belowHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', 'var(--euiFixedHeadersOffset, 0)'), ";;label:belowHeader;"),
|
|
19
|
+
noAnimation: /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
|
|
20
|
+
name: "lqr4xc-noAnimation",
|
|
21
|
+
styles: "animation:none;label:noAnimation;"
|
|
22
|
+
} : {
|
|
23
|
+
name: "lqr4xc-noAnimation",
|
|
24
|
+
styles: "animation:none;label:noAnimation;",
|
|
25
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
26
|
+
})
|
|
18
27
|
};
|
|
19
28
|
};
|
|
@@ -140,7 +140,7 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
|
|
|
140
140
|
})) === null || _tabs$find === void 0 ? void 0 : _tabs$find.label));
|
|
141
141
|
tabsNode = ___EmotionJSX(React.Fragment, null, pageTitleNode && ___EmotionJSX(EuiSpacer, null), screenReaderPageTitle, ___EmotionJSX(EuiTabs, _extends({}, tabsProps, {
|
|
142
142
|
bottomBorder: false,
|
|
143
|
-
size: "
|
|
143
|
+
size: "m"
|
|
144
144
|
}), renderTabs()));
|
|
145
145
|
}
|
|
146
146
|
var childrenNode = children && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiSpacer, null), children);
|
|
@@ -17,6 +17,7 @@ import { EuiCacheProvider } from './cache';
|
|
|
17
17
|
import { EuiSystemDefaultsProvider } from './system_defaults';
|
|
18
18
|
import { EuiProviderNestedCheck, useIsNestedEuiProvider } from './nested';
|
|
19
19
|
import { EuiComponentDefaultsProvider } from './component_defaults';
|
|
20
|
+
import { EuiFlyoutManager } from '../flyout/manager';
|
|
20
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
22
|
var isEmotionCacheObject = function isEmotionCacheObject(obj) {
|
|
22
23
|
return obj.hasOwnProperty('key');
|
|
@@ -79,5 +80,5 @@ export var EuiProvider = function EuiProvider(_ref) {
|
|
|
79
80
|
children: Utilities && ___EmotionJSX(Utilities, null)
|
|
80
81
|
})), ___EmotionJSX(EuiComponentDefaultsProvider, {
|
|
81
82
|
componentDefaults: componentDefaults
|
|
82
|
-
}, children)))));
|
|
83
|
+
}, ___EmotionJSX(EuiFlyoutManager, null, children))))));
|
|
83
84
|
};
|
|
@@ -188,7 +188,7 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
188
188
|
var isHintVisible = (_hint$popoverProps$is = hint === null || hint === void 0 || (_hint$popoverProps = hint.popoverProps) === null || _hint$popoverProps === void 0 ? void 0 : _hint$popoverProps.isOpen) !== null && _hint$popoverProps$is !== void 0 ? _hint$popoverProps$is : isHintVisibleState;
|
|
189
189
|
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiTheme) {
|
|
190
190
|
return ___EmotionJSX(EuiFlexGroup, {
|
|
191
|
-
gutterSize: "
|
|
191
|
+
gutterSize: "s",
|
|
192
192
|
alignItems: "center",
|
|
193
193
|
wrap: true
|
|
194
194
|
}, toolsLeftEl, ___EmotionJSX(EuiFlexItem, {
|
|
@@ -19,7 +19,7 @@ export var SIZES = ['xs', 's', 'm', 'l', 'xl', 'xxl'];
|
|
|
19
19
|
export var EuiSpacer = function EuiSpacer(_ref) {
|
|
20
20
|
var className = _ref.className,
|
|
21
21
|
_ref$size = _ref.size,
|
|
22
|
-
size = _ref$size === void 0 ? '
|
|
22
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
23
23
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
24
24
|
var styles = useEuiMemoizedStyles(euiSpacerStyles);
|
|
25
25
|
var classes = classNames('euiSpacer', _defineProperty({}, "euiSpacer--".concat(size), size), className);
|
|
@@ -13,6 +13,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { css } from '@emotion/react';
|
|
16
|
+
import { useEuiTheme } from '../../services';
|
|
16
17
|
import { EuiIcon } from '../icon';
|
|
17
18
|
import { EuiI18n } from '../i18n';
|
|
18
19
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -29,7 +30,11 @@ export var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) {
|
|
|
29
30
|
number = _ref2.number,
|
|
30
31
|
status = _ref2.status,
|
|
31
32
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
33
|
+
var _useEuiTheme = useEuiTheme(),
|
|
34
|
+
euiTheme = _useEuiTheme.euiTheme;
|
|
32
35
|
var classes = classNames('euiTourStepIndicator', className);
|
|
36
|
+
var inactiveColor = euiTheme.components.tourStepIndicatorInactiveColor;
|
|
37
|
+
var activeColor = euiTheme.components.tourStepIndicatorActiveColor;
|
|
33
38
|
var indicatorIcon;
|
|
34
39
|
if (status === 'active') {
|
|
35
40
|
indicatorIcon = ___EmotionJSX(EuiI18n, {
|
|
@@ -39,7 +44,7 @@ export var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) {
|
|
|
39
44
|
return ___EmotionJSX(EuiIcon, {
|
|
40
45
|
type: "dot",
|
|
41
46
|
"aria-label": isActive,
|
|
42
|
-
color:
|
|
47
|
+
color: activeColor,
|
|
43
48
|
"aria-current": "step"
|
|
44
49
|
});
|
|
45
50
|
});
|
|
@@ -51,7 +56,7 @@ export var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) {
|
|
|
51
56
|
return ___EmotionJSX(EuiIcon, {
|
|
52
57
|
type: "dot",
|
|
53
58
|
"aria-label": isComplete,
|
|
54
|
-
color:
|
|
59
|
+
color: inactiveColor
|
|
55
60
|
});
|
|
56
61
|
});
|
|
57
62
|
} else if (status === 'incomplete') {
|
|
@@ -62,7 +67,7 @@ export var EuiTourStepIndicator = function EuiTourStepIndicator(_ref2) {
|
|
|
62
67
|
return ___EmotionJSX(EuiIcon, {
|
|
63
68
|
type: "dot",
|
|
64
69
|
"aria-label": isIncomplete,
|
|
65
|
-
color:
|
|
70
|
+
color: inactiveColor
|
|
66
71
|
});
|
|
67
72
|
});
|
|
68
73
|
}
|
|
@@ -36,7 +36,18 @@ var getButtonVariantTokenValues = function getButtonVariantTokenValues(_ref, col
|
|
|
36
36
|
color: foreground,
|
|
37
37
|
background: euiTheme.components.buttons[backgroundTokenName],
|
|
38
38
|
backgroundHover: euiTheme.components.buttons[backgroundHoverTokenName],
|
|
39
|
-
backgroundActive: euiTheme.components.buttons[backgroundActiveTokenName]
|
|
39
|
+
backgroundActive: euiTheme.components.buttons[backgroundActiveTokenName],
|
|
40
|
+
borderColor: highContrastMode ? foreground : color === 'text' ? euiTheme.colors.borderBasePlain : 'transparent'
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export var getEuiButtonColors = function getEuiButtonColors(euiThemeContext, color) {
|
|
44
|
+
var buttonColors = getButtonVariantTokenValues(euiThemeContext, color, 'base');
|
|
45
|
+
var foreground = buttonColors.color;
|
|
46
|
+
var background = buttonColors.background;
|
|
47
|
+
return {
|
|
48
|
+
color: background === 'transparent' || color === 'disabled' ? foreground : makeHighContrastColor(foreground)(background),
|
|
49
|
+
backgroundColor: background,
|
|
50
|
+
borderColor: buttonColors.borderColor
|
|
40
51
|
};
|
|
41
52
|
};
|
|
42
53
|
|
|
@@ -47,13 +58,21 @@ var getButtonVariantTokenValues = function getButtonVariantTokenValues(_ref, col
|
|
|
47
58
|
* @returns Style object `{ backgroundColor, color }`
|
|
48
59
|
*/
|
|
49
60
|
export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
50
|
-
var buttonColors =
|
|
61
|
+
var buttonColors = getEuiButtonColors(euiThemeContext, color);
|
|
62
|
+
return _objectSpread({
|
|
63
|
+
color: buttonColors.color,
|
|
64
|
+
backgroundColor: buttonColors.backgroundColor
|
|
65
|
+
}, _highContrastBorder(euiThemeContext, buttonColors.borderColor));
|
|
66
|
+
};
|
|
67
|
+
export var getEuiFilledButtonColors = function getEuiFilledButtonColors(euiThemeContext, color) {
|
|
68
|
+
var buttonColors = getButtonVariantTokenValues(euiThemeContext, color, 'filled');
|
|
51
69
|
var foreground = buttonColors.color;
|
|
52
70
|
var background = buttonColors.background;
|
|
53
|
-
return
|
|
54
|
-
color:
|
|
55
|
-
backgroundColor: background
|
|
56
|
-
|
|
71
|
+
return {
|
|
72
|
+
color: foreground,
|
|
73
|
+
backgroundColor: background,
|
|
74
|
+
borderColor: color === 'disabled' ? foreground : background
|
|
75
|
+
};
|
|
57
76
|
};
|
|
58
77
|
|
|
59
78
|
/**
|
|
@@ -63,13 +82,13 @@ export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
|
63
82
|
* @returns Style object `{ backgroundColor, color }`
|
|
64
83
|
*/
|
|
65
84
|
export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
|
|
66
|
-
var buttonColors =
|
|
85
|
+
var buttonColors = getEuiFilledButtonColors(euiThemeContext, color);
|
|
67
86
|
var foreground = buttonColors.color;
|
|
68
|
-
var background = buttonColors.
|
|
87
|
+
var background = buttonColors.backgroundColor;
|
|
69
88
|
return _objectSpread({
|
|
70
89
|
color: foreground,
|
|
71
90
|
backgroundColor: background
|
|
72
|
-
}, _highContrastBorder(euiThemeContext,
|
|
91
|
+
}, _highContrastBorder(euiThemeContext, buttonColors.borderColor // The border is necessary for Windows high contrast themes, which ignore background-color
|
|
73
92
|
));
|
|
74
93
|
};
|
|
75
94
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
var CONTAINER_TYPES = ['normal', 'size', 'inline-size'];
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Type of container context used in container queries.
|
|
14
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/container-type}
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Establish element as a query container.
|
|
19
|
+
* The scroll state is applied through the `scrollState` argument
|
|
20
|
+
* and not the `type` argument.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Export container name to use across the application
|
|
24
|
+
* export const PAGE_CONTENT_CONTAINER_NAME = 'my-app-page-content';
|
|
25
|
+
* const pageContentStyles = css`
|
|
26
|
+
* ${euiContainer('inline-size', PAGE_CONTENT_CONTAINER_NAME)}
|
|
27
|
+
* margin: 0 auto;
|
|
28
|
+
* `;
|
|
29
|
+
*
|
|
30
|
+
* @returns A style string to be used inside Emotion's `css` template literal
|
|
31
|
+
* @beta
|
|
32
|
+
*/
|
|
33
|
+
export var euiContainer = function euiContainer(type, name, scrollState) {
|
|
34
|
+
var finalType = '';
|
|
35
|
+
if (type !== 'normal') {
|
|
36
|
+
finalType += type;
|
|
37
|
+
}
|
|
38
|
+
if (scrollState) {
|
|
39
|
+
if (finalType.length) {
|
|
40
|
+
finalType += ' ';
|
|
41
|
+
}
|
|
42
|
+
finalType += 'scroll-state';
|
|
43
|
+
}
|
|
44
|
+
return [!!name && "container-name: ".concat(name), !!finalType && "container-type: ".concat(finalType)].filter(Boolean).join(';');
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Establish element as a query container.
|
|
49
|
+
* The scroll state is applied through the `scrollState` argument
|
|
50
|
+
* and not the `type` argument.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Export container name to use across the application
|
|
54
|
+
* export const PAGE_CONTENT_CONTAINER_NAME = 'my-app-page-content';
|
|
55
|
+
* const PageContent = ({ children }: PropsWithChildren) => (
|
|
56
|
+
* <main css={euiContainerCSS('inline-size', PAGE_CONTENT_CONTAINER_NAME)}>
|
|
57
|
+
* {children}
|
|
58
|
+
* </main>
|
|
59
|
+
* );
|
|
60
|
+
* @returns Emotion's `SerializedStyles` object to be passed to the `css` prop
|
|
61
|
+
* of a React component.
|
|
62
|
+
* @beta
|
|
63
|
+
*/
|
|
64
|
+
export var euiContainerCSS = function euiContainerCSS(type, name, scrollState) {
|
|
65
|
+
return /*#__PURE__*/css(euiContainer(type, name, scrollState), ";label:euiContainerCSS;");
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get a @container rule for given conditions and an optional container name.
|
|
70
|
+
*
|
|
71
|
+
* Container queries can be used to apply conditional styles based on container
|
|
72
|
+
* size, its scroll state or even its styles.
|
|
73
|
+
*
|
|
74
|
+
* It's hugely useful to conditionally show or hide information based
|
|
75
|
+
* on the **container** dimensions instead of the **viewport** dimensions.
|
|
76
|
+
*
|
|
77
|
+
* When container name is provided, it will be used to target the containment
|
|
78
|
+
* context. When skipped, it will target the nearest ancestor with containment.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* const itemDetailsStyles = css`
|
|
82
|
+
* background: red;
|
|
83
|
+
*
|
|
84
|
+
* ${euiContainerQuery('(width > 250px)')} {
|
|
85
|
+
* background: blue;
|
|
86
|
+
* }
|
|
87
|
+
* `;
|
|
88
|
+
*
|
|
89
|
+
* @param conditions one or many conditions to query the container with.
|
|
90
|
+
* Similarly to media queries, you can use
|
|
91
|
+
* size queries (e.g., `(width > 300px)`),
|
|
92
|
+
* scroll state queries (e.g., `(scroll-state(scrollable: top))`),
|
|
93
|
+
* or even style queries.
|
|
94
|
+
* You can use the `and`, `or` and `not` logical keywords to define container
|
|
95
|
+
* conditions. Note that all conditions must be wrapped in parentheses.
|
|
96
|
+
*
|
|
97
|
+
* @param containerName When provided, it will be used to target
|
|
98
|
+
* the containment context and run queries against it. Otherwise, the nearest
|
|
99
|
+
* ancestor with containment will be queried instead.
|
|
100
|
+
*
|
|
101
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@container}
|
|
102
|
+
* @beta
|
|
103
|
+
*/
|
|
104
|
+
export var euiContainerQuery = function euiContainerQuery(conditions, containerName) {
|
|
105
|
+
return "@container ".concat(containerName !== null && containerName !== void 0 ? containerName : '').concat(containerName ? ' ' : '').concat(conditions);
|
|
106
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
+
* Side Public License, v 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { useEffect, useState, useRef } from 'react';
|
|
11
|
+
import { matchContainer } from './match_container';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* React hook that subscribes to CSS container query changes.
|
|
15
|
+
*
|
|
16
|
+
* For this to work:
|
|
17
|
+
* - a proper container (an element with e.g. `container-type: inline-size`) is needed, and
|
|
18
|
+
* - the container MUST to be a parent of the element being observed
|
|
19
|
+
*
|
|
20
|
+
* @param containerCondition - A CSS `<container-condition>` string, e.g. `(width > 400px)` or `(min-width: 600px)`
|
|
21
|
+
* @param name - Optional container name, e.g. `sidebar`
|
|
22
|
+
* @returns An object containing:
|
|
23
|
+
* - `ref`: A ref to attach to the container element
|
|
24
|
+
* - `matches`: `true` if the container matches the condition, `false` otherwise
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { ref, matches } = useEuiContainerQuery('(width > 400px)');
|
|
29
|
+
* return <div ref={ref}>{matches ? 'Wide' : 'Narrow'}</div>;
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@container | MDN: @container}
|
|
33
|
+
* @beta
|
|
34
|
+
*/
|
|
35
|
+
export function useEuiContainerQuery(containerCondition, name) {
|
|
36
|
+
var containerQueryString = name ? "".concat(name, " ").concat(containerCondition) : containerCondition;
|
|
37
|
+
var ref = useRef(null);
|
|
38
|
+
var _useState = useState(false),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
matches = _useState2[0],
|
|
41
|
+
setMatches = _useState2[1];
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
if (!ref.current) return;
|
|
44
|
+
var queryList = matchContainer(ref.current, containerQueryString);
|
|
45
|
+
var handleChange = function handleChange() {
|
|
46
|
+
setMatches(queryList.matches);
|
|
47
|
+
};
|
|
48
|
+
setMatches(queryList.matches);
|
|
49
|
+
queryList.addEventListener('change', handleChange);
|
|
50
|
+
return function () {
|
|
51
|
+
queryList.removeEventListener('change', handleChange);
|
|
52
|
+
queryList.dispose();
|
|
53
|
+
};
|
|
54
|
+
}, [ref, containerQueryString]);
|
|
55
|
+
return {
|
|
56
|
+
ref: ref,
|
|
57
|
+
matches: matches
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
+
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
10
|
+
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
11
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
12
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
13
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
14
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
15
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
16
|
+
/*
|
|
17
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
+
* Side Public License, v 1.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @license MIT License
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) 2025 Martin Winkler
|
|
28
|
+
*
|
|
29
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
30
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
31
|
+
* in the Software without restriction, including without limitation the rights
|
|
32
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
33
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
34
|
+
* furnished to do so, subject to the following conditions:
|
|
35
|
+
*
|
|
36
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
37
|
+
* copies or substantial portions of the Software.
|
|
38
|
+
*
|
|
39
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
40
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
41
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
42
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
43
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
44
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
45
|
+
* SOFTWARE.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://github.com/teetotum/match-container/blob/main/matchContainer.js}
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
import { v1 as uuid } from 'uuid';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Listen for changes on a container query.
|
|
54
|
+
* Just like `window.matchMedia`.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```js
|
|
58
|
+
* const cql = matchContainer(element, '(width > 42rem)');
|
|
59
|
+
* cql.addEventListener('change', ({ matches }) {
|
|
60
|
+
* // ..
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param element
|
|
65
|
+
* @param containerQueryString e.g. (width > 42rem)
|
|
66
|
+
* @returns ContainerQueryList
|
|
67
|
+
*/
|
|
68
|
+
export function matchContainer(element, containerQueryString) {
|
|
69
|
+
return new ContainerQueryList(element, containerQueryString);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* `change` event dispatched by instances of {@link ContainerQueryList}
|
|
74
|
+
* whenever the value of `matches` changes
|
|
75
|
+
*/
|
|
76
|
+
export var ContainerQueryListChangeEvent = /*#__PURE__*/function (_Event) {
|
|
77
|
+
function ContainerQueryListChangeEvent(matches, container) {
|
|
78
|
+
var _this;
|
|
79
|
+
_classCallCheck(this, ContainerQueryListChangeEvent);
|
|
80
|
+
_this = _callSuper(this, ContainerQueryListChangeEvent, ['change']);
|
|
81
|
+
/** Whether the container query matches */
|
|
82
|
+
_defineProperty(_this, "matches", void 0);
|
|
83
|
+
/** A string representation of the container query list e.g. "(width > 1000px)" */
|
|
84
|
+
_defineProperty(_this, "container", void 0);
|
|
85
|
+
_this.matches = matches;
|
|
86
|
+
_this.container = container;
|
|
87
|
+
return _this;
|
|
88
|
+
}
|
|
89
|
+
_inherits(ContainerQueryListChangeEvent, _Event);
|
|
90
|
+
return _createClass(ContainerQueryListChangeEvent);
|
|
91
|
+
}( /*#__PURE__*/_wrapNativeSuper(Event));
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A hacky implementation of a possible native `ContainerQueryList`
|
|
95
|
+
* based on the teetotum/match-container polyfill:
|
|
96
|
+
* - based on a API proposal in W3C CSS WG {@link https://github.com/w3c/csswg-drafts/issues/6205})
|
|
97
|
+
* - mimicking MediaQueryList {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList}
|
|
98
|
+
*
|
|
99
|
+
* Not meant to be used directly, but rather call `matchContainer`.
|
|
100
|
+
*
|
|
101
|
+
* It works by listening on a `transitionrun` event on the element,
|
|
102
|
+
* that gets triggered by a container query changing a custom property.
|
|
103
|
+
* Setting `transition-behavior: allow-discrete` is what makes it possible
|
|
104
|
+
* to have a CSS `transition` for a custom property.
|
|
105
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/transition-behavior}
|
|
106
|
+
*/
|
|
107
|
+
var _matches = /*#__PURE__*/new WeakMap();
|
|
108
|
+
export var ContainerQueryList = /*#__PURE__*/function (_EventTarget) {
|
|
109
|
+
function ContainerQueryList(element, containerQueryString) {
|
|
110
|
+
var _this2;
|
|
111
|
+
_classCallCheck(this, ContainerQueryList);
|
|
112
|
+
_this2 = _callSuper(this, ContainerQueryList);
|
|
113
|
+
_defineProperty(_this2, "element", null);
|
|
114
|
+
_defineProperty(_this2, "styleSheet", null);
|
|
115
|
+
_defineProperty(_this2, "markerAttributeName", '');
|
|
116
|
+
_defineProperty(_this2, "sentinelPropertyName", '');
|
|
117
|
+
_defineProperty(_this2, "computedStyle", null);
|
|
118
|
+
_defineProperty(_this2, "transitionRunListener", null);
|
|
119
|
+
_classPrivateFieldInitSpec(_this2, _matches, false);
|
|
120
|
+
/**
|
|
121
|
+
* A string representation of the container query list e.g. "(width > 1000px)"
|
|
122
|
+
* (the name is weird but it is so for consistency with mediaQueryList.media)
|
|
123
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/media}
|
|
124
|
+
* */
|
|
125
|
+
_defineProperty(_this2, "container", void 0);
|
|
126
|
+
_this2.container = containerQueryString;
|
|
127
|
+
_this2.element = element;
|
|
128
|
+
// we call this only once to try to avoid any impact on performance
|
|
129
|
+
_this2.computedStyle = getComputedStyle(_this2.element);
|
|
130
|
+
var uniqueName = "container-query-observer-".concat(uuid());
|
|
131
|
+
_this2.markerAttributeName = "data-".concat(uniqueName);
|
|
132
|
+
_this2.sentinelPropertyName = "--".concat(uniqueName);
|
|
133
|
+
|
|
134
|
+
// order is important (as in life)
|
|
135
|
+
_this2.applyMarkerAttribute();
|
|
136
|
+
_this2.createStyleSheet();
|
|
137
|
+
_classPrivateFieldSet(_matches, _this2, _this2.computedStyle.getPropertyValue(_this2.sentinelPropertyName) === '--true');
|
|
138
|
+
_this2.setupTransitionListener();
|
|
139
|
+
return _this2;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The marker attribute is `data-container-query-observer-{UUID}`,
|
|
144
|
+
* it will be used as a selector in the container query,
|
|
145
|
+
* in the global CSS that's being added below.
|
|
146
|
+
*/
|
|
147
|
+
_inherits(ContainerQueryList, _EventTarget);
|
|
148
|
+
return _createClass(ContainerQueryList, [{
|
|
149
|
+
key: "matches",
|
|
150
|
+
get: /** Whether the container query matches */
|
|
151
|
+
function get() {
|
|
152
|
+
return _classPrivateFieldGet(_matches, this);
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "applyMarkerAttribute",
|
|
156
|
+
value: function applyMarkerAttribute() {
|
|
157
|
+
this.element.setAttribute(this.markerAttributeName, '');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Create a CSS custom property with values either `--true` or `--false`,
|
|
162
|
+
* and add container query targetting the element.
|
|
163
|
+
* Whenever the container query matches, the custom property will be `--true`.
|
|
164
|
+
* This styles are added globaly via `document.adoptedStyleSheets`.
|
|
165
|
+
*/
|
|
166
|
+
}, {
|
|
167
|
+
key: "createStyleSheet",
|
|
168
|
+
value: function createStyleSheet() {
|
|
169
|
+
var css = "\n @property ".concat(this.sentinelPropertyName, " {\n syntax: '<custom-ident>';\n inherits: false;\n initial-value: --false;\n }\n @container ").concat(this.container, " {\n [").concat(this.markerAttributeName, "] {\n ").concat(this.sentinelPropertyName, ": --true;\n }\n }\n ");
|
|
170
|
+
var styleSheet = new CSSStyleSheet();
|
|
171
|
+
styleSheet.replaceSync(css);
|
|
172
|
+
document.adoptedStyleSheets = [].concat(_toConsumableArray(document.adoptedStyleSheets), [styleSheet]);
|
|
173
|
+
this.styleSheet = styleSheet;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* This is the key to the hack:
|
|
178
|
+
* - a `transition` style is added for the custom property
|
|
179
|
+
* - the `transitionrun` event will fire whenever the custom property value changes
|
|
180
|
+
* because of the container query
|
|
181
|
+
* - we get the value from computed styles
|
|
182
|
+
* - the `matches` value is updated and
|
|
183
|
+
* - a ContainerQueryListChangeEvent event is dispatched
|
|
184
|
+
*/
|
|
185
|
+
}, {
|
|
186
|
+
key: "setupTransitionListener",
|
|
187
|
+
value: function setupTransitionListener() {
|
|
188
|
+
var _this3 = this;
|
|
189
|
+
var element = this.element,
|
|
190
|
+
computedStyle = this.computedStyle,
|
|
191
|
+
sentinelPropertyName = this.sentinelPropertyName;
|
|
192
|
+
if (!element) return;
|
|
193
|
+
var currentValue = computedStyle.getPropertyValue(sentinelPropertyName);
|
|
194
|
+
element.style.setProperty('transition', "".concat(sentinelPropertyName, " 0.001ms step-start"));
|
|
195
|
+
element.style.setProperty('transition-behavior', 'allow-discrete');
|
|
196
|
+
this.transitionRunListener = function (event) {
|
|
197
|
+
if (event.target !== element) return;
|
|
198
|
+
var nextValue = computedStyle.getPropertyValue(sentinelPropertyName);
|
|
199
|
+
if (nextValue === currentValue) return;
|
|
200
|
+
currentValue = nextValue;
|
|
201
|
+
_classPrivateFieldSet(_matches, _this3, nextValue === '--true');
|
|
202
|
+
_this3.dispatchEvent(new ContainerQueryListChangeEvent(_classPrivateFieldGet(_matches, _this3), _this3.container));
|
|
203
|
+
};
|
|
204
|
+
element.addEventListener('transitionrun', this.transitionRunListener);
|
|
205
|
+
}
|
|
206
|
+
}, {
|
|
207
|
+
key: "dispose",
|
|
208
|
+
value: function dispose() {
|
|
209
|
+
var _this4 = this;
|
|
210
|
+
// remove the stylesheet from adoptedStyleSheets
|
|
211
|
+
if (this.styleSheet) {
|
|
212
|
+
document.adoptedStyleSheets = document.adoptedStyleSheets.filter(function (sheet) {
|
|
213
|
+
return sheet !== _this4.styleSheet;
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
if (!this.element) return;
|
|
217
|
+
if (this.transitionRunListener) {
|
|
218
|
+
this.element.removeEventListener('transitionrun', this.transitionRunListener);
|
|
219
|
+
}
|
|
220
|
+
this.element.removeAttribute(this.markerAttributeName);
|
|
221
|
+
this.element.style.removeProperty('transition');
|
|
222
|
+
this.element.style.removeProperty('transition-behavior');
|
|
223
|
+
this.element = null;
|
|
224
|
+
this.styleSheet = null;
|
|
225
|
+
this.computedStyle = null;
|
|
226
|
+
this.transitionRunListener = null;
|
|
227
|
+
}
|
|
228
|
+
}]);
|
|
229
|
+
}( /*#__PURE__*/_wrapNativeSuper(EventTarget));
|