@elastic/eui 93.3.0 → 93.5.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/dist/eui_charts_theme.d.ts +9 -0
- package/dist/eui_charts_theme.js +56 -14
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +3 -0
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -0
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/_breadcrumb_content.js +362 -0
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/es/components/breadcrumbs/breadcrumb.js +10 -327
- package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/es/components/breadcrumbs/types.js +1 -0
- package/es/components/button/button_group/button_group.js +16 -2
- package/es/components/button/button_group/button_group.styles.js +1 -1
- package/es/components/button/button_group/button_group_button.js +59 -5
- package/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +97 -58
- package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/es/components/datagrid/body/cell/index.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +13 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +52 -36
- package/es/components/datagrid/body/data_grid_body_virtualized.js +84 -56
- package/es/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
- package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
- package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
- package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/es/components/datagrid/controls/column_selector.js +126 -123
- package/es/components/datagrid/controls/column_sorting.js +605 -103
- package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/es/components/datagrid/controls/display_selector.js +109 -107
- package/es/components/datagrid/data_grid.a11y.js +13 -12
- package/es/components/datagrid/data_grid.js +45 -22
- package/es/components/datagrid/utils/col_widths.js +12 -8
- package/es/components/datagrid/utils/focus.js +10 -8
- package/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/es/components/datagrid/utils/ref.js +1 -1
- package/es/components/datagrid/utils/row_heights.js +2 -2
- package/es/components/datagrid/utils/sorting.js +29 -27
- package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/es/components/flex/flex_grid.js +22 -8
- package/es/components/flex/flex_grid.styles.js +13 -6
- package/es/components/flex/flex_group.js +10 -11
- package/es/components/flex/flex_item.js +9 -11
- package/es/components/flex/flex_item.styles.js +107 -122
- package/es/components/flyout/flyout.js +16 -18
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/es/components/header/header_links/header_links.js +10 -2
- package/es/components/icon/icon.js +3 -3
- package/es/components/modal/confirm_modal.js +2 -1
- package/es/components/modal/modal.js +12 -3
- package/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/es/components/panel/panel.js +2 -3
- package/es/components/resizable_container/resizable_button.js +2 -3
- package/es/components/resizable_container/resizable_collapse_button.js +2 -3
- package/es/components/resizable_container/resizable_container.js +1 -2
- package/es/components/resizable_container/resizable_container.styles.js +11 -14
- package/es/components/resizable_container/resizable_panel.js +6 -8
- package/es/components/resizable_container/resizable_panel.styles.js +18 -29
- package/es/components/selectable/selectable_list/selectable_list.js +26 -6
- package/es/components/spacer/spacer.js +2 -3
- package/es/components/toast/global_toast_list.js +70 -73
- package/es/components/toast/toast.js +27 -42
- package/es/components/toast/toast.styles.js +2 -17
- package/es/components/tool_tip/icon_tip.js +4 -3
- package/es/global_styling/mixins/_color.js +60 -32
- package/es/global_styling/mixins/_padding.js +60 -16
- package/es/services/color/eui_palettes.js +21 -13
- package/es/services/color/index.js +1 -1
- package/es/services/hooks/index.js +1 -0
- package/es/services/hooks/useDeepEqual.js +23 -0
- package/es/services/index.js +1 -1
- package/es/services/theme/style_memoization.js +1 -3
- package/eui.d.ts +2558 -2470
- package/i18ntokens.json +297 -279
- package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/lib/components/breadcrumbs/breadcrumb.js +11 -331
- package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/lib/components/breadcrumbs/types.js +5 -0
- package/lib/components/button/button_group/button_group.js +16 -2
- package/lib/components/button/button_group/button_group.styles.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +59 -5
- package/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/lib/components/datagrid/body/cell/data_grid_cell.js +95 -57
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/lib/components/datagrid/body/cell/index.js +2 -2
- package/lib/components/datagrid/body/data_grid_body.js +13 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +51 -35
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +83 -55
- package/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/lib/components/datagrid/controls/column_selector.js +126 -123
- package/lib/components/datagrid/controls/column_sorting.js +615 -110
- package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/lib/components/datagrid/controls/display_selector.js +109 -107
- package/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/lib/components/datagrid/data_grid.js +43 -20
- package/lib/components/datagrid/utils/col_widths.js +12 -8
- package/lib/components/datagrid/utils/focus.js +10 -8
- package/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/lib/components/datagrid/utils/ref.js +1 -1
- package/lib/components/datagrid/utils/row_heights.js +1 -1
- package/lib/components/datagrid/utils/sorting.js +31 -29
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/lib/components/flex/flex_grid.js +23 -7
- package/lib/components/flex/flex_grid.styles.js +13 -6
- package/lib/components/flex/flex_group.js +10 -10
- package/lib/components/flex/flex_item.js +13 -13
- package/lib/components/flex/flex_item.styles.js +107 -122
- package/lib/components/flyout/flyout.js +16 -18
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/lib/components/header/header_links/header_links.js +10 -2
- package/lib/components/icon/icon.js +3 -3
- package/lib/components/modal/confirm_modal.js +2 -1
- package/lib/components/modal/modal.js +12 -3
- package/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/lib/components/panel/panel.js +1 -2
- package/lib/components/resizable_container/resizable_button.js +1 -2
- package/lib/components/resizable_container/resizable_collapse_button.js +1 -2
- package/lib/components/resizable_container/resizable_container.js +1 -2
- package/lib/components/resizable_container/resizable_container.styles.js +11 -14
- package/lib/components/resizable_container/resizable_panel.js +3 -5
- package/lib/components/resizable_container/resizable_panel.styles.js +17 -28
- package/lib/components/selectable/selectable_list/selectable_list.js +26 -6
- package/lib/components/spacer/spacer.js +1 -2
- package/lib/components/toast/global_toast_list.js +68 -71
- package/lib/components/toast/toast.js +25 -40
- package/lib/components/toast/toast.styles.js +11 -25
- package/lib/components/tool_tip/icon_tip.js +4 -3
- package/lib/global_styling/mixins/_color.js +65 -40
- package/lib/global_styling/mixins/_padding.js +66 -25
- package/lib/services/color/eui_palettes.js +24 -14
- package/lib/services/color/index.js +14 -0
- package/lib/services/hooks/index.js +11 -0
- package/lib/services/hooks/useDeepEqual.js +30 -0
- package/lib/services/index.js +15 -1
- package/lib/services/theme/style_memoization.js +1 -3
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -110
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/optimize/es/components/breadcrumbs/types.js +1 -0
- package/optimize/es/components/button/button_group/button_group.js +2 -2
- package/optimize/es/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/es/components/button/button_group/button_group_button.js +36 -4
- package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +80 -55
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/optimize/es/components/datagrid/body/cell/index.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +39 -36
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +69 -49
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
- package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/es/components/datagrid/data_grid.js +45 -22
- package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/es/components/datagrid/utils/focus.js +10 -8
- package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/optimize/es/components/datagrid/utils/ref.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
- package/optimize/es/components/datagrid/utils/sorting.js +29 -27
- package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/es/components/flex/flex_grid.js +19 -8
- package/optimize/es/components/flex/flex_grid.styles.js +13 -6
- package/optimize/es/components/flex/flex_group.js +9 -10
- package/optimize/es/components/flex/flex_item.js +9 -11
- package/optimize/es/components/flex/flex_item.styles.js +107 -122
- package/optimize/es/components/flyout/flyout.js +16 -18
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/es/components/header/header_links/header_links.js +3 -2
- package/optimize/es/components/icon/icon.js +3 -3
- package/optimize/es/components/modal/confirm_modal.js +2 -1
- package/optimize/es/components/modal/modal.js +6 -2
- package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/es/components/panel/panel.js +2 -3
- package/optimize/es/components/resizable_container/resizable_button.js +2 -3
- package/optimize/es/components/resizable_container/resizable_collapse_button.js +2 -3
- package/optimize/es/components/resizable_container/resizable_container.js +1 -2
- package/optimize/es/components/resizable_container/resizable_container.styles.js +11 -14
- package/optimize/es/components/resizable_container/resizable_panel.js +6 -8
- package/optimize/es/components/resizable_container/resizable_panel.styles.js +18 -26
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +26 -6
- package/optimize/es/components/spacer/spacer.js +2 -3
- package/optimize/es/components/toast/global_toast_list.js +70 -73
- package/optimize/es/components/toast/toast.js +27 -42
- package/optimize/es/components/toast/toast.styles.js +2 -17
- package/optimize/es/components/tool_tip/icon_tip.js +4 -3
- package/optimize/es/global_styling/mixins/_color.js +57 -32
- package/optimize/es/global_styling/mixins/_padding.js +52 -16
- package/optimize/es/services/color/eui_palettes.js +21 -13
- package/optimize/es/services/color/index.js +1 -1
- package/optimize/es/services/hooks/index.js +1 -0
- package/optimize/es/services/hooks/useDeepEqual.js +23 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/services/theme/style_memoization.js +1 -3
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -113
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/optimize/lib/components/breadcrumbs/types.js +5 -0
- package/optimize/lib/components/button/button_group/button_group.js +2 -2
- package/optimize/lib/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +78 -54
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +38 -35
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +70 -50
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
- package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/lib/components/datagrid/data_grid.js +43 -20
- package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/lib/components/datagrid/utils/focus.js +10 -8
- package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/optimize/lib/components/datagrid/utils/ref.js +1 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
- package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
- package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/lib/components/flex/flex_grid.js +21 -7
- package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
- package/optimize/lib/components/flex/flex_group.js +9 -9
- package/optimize/lib/components/flex/flex_item.js +13 -13
- package/optimize/lib/components/flex/flex_item.styles.js +107 -122
- package/optimize/lib/components/flyout/flyout.js +16 -18
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/lib/components/header/header_links/header_links.js +3 -2
- package/optimize/lib/components/icon/icon.js +3 -3
- package/optimize/lib/components/modal/confirm_modal.js +2 -1
- package/optimize/lib/components/modal/modal.js +6 -2
- package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/lib/components/panel/panel.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_button.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_collapse_button.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_container.js +1 -2
- package/optimize/lib/components/resizable_container/resizable_container.styles.js +11 -14
- package/optimize/lib/components/resizable_container/resizable_panel.js +3 -5
- package/optimize/lib/components/resizable_container/resizable_panel.styles.js +17 -26
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +26 -6
- package/optimize/lib/components/spacer/spacer.js +1 -2
- package/optimize/lib/components/toast/global_toast_list.js +68 -71
- package/optimize/lib/components/toast/toast.js +25 -40
- package/optimize/lib/components/toast/toast.styles.js +11 -25
- package/optimize/lib/components/tool_tip/icon_tip.js +4 -3
- package/optimize/lib/global_styling/mixins/_color.js +63 -40
- package/optimize/lib/global_styling/mixins/_padding.js +59 -25
- package/optimize/lib/services/color/eui_palettes.js +24 -14
- package/optimize/lib/services/color/index.js +14 -0
- package/optimize/lib/services/hooks/index.js +11 -0
- package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
- package/optimize/lib/services/index.js +15 -1
- package/optimize/lib/services/theme/style_memoization.js +1 -3
- package/package.json +8 -11
- package/src/components/form/text_area/_text_area.scss +5 -0
- package/src/components/selectable/selectable_list/_selectable_list.scss +2 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +11 -326
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/test-env/components/breadcrumbs/breadcrumbs.js +3 -3
- package/test-env/components/breadcrumbs/types.js +5 -0
- package/test-env/components/button/button_group/button_group.js +16 -2
- package/test-env/components/button/button_group/button_group.styles.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +56 -5
- package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +95 -57
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/test-env/components/datagrid/body/cell/index.js +2 -2
- package/test-env/components/datagrid/body/data_grid_body.js +13 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +51 -35
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +83 -55
- package/test-env/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/test-env/components/datagrid/controls/column_selector.js +126 -123
- package/test-env/components/datagrid/controls/column_sorting.js +607 -106
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/test-env/components/datagrid/controls/display_selector.js +109 -107
- package/test-env/components/datagrid/data_grid.a11y.js +13 -12
- package/test-env/components/datagrid/data_grid.js +43 -20
- package/test-env/components/datagrid/utils/col_widths.js +9 -5
- package/test-env/components/datagrid/utils/focus.js +10 -8
- package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
- package/test-env/components/datagrid/utils/ref.js +1 -1
- package/test-env/components/datagrid/utils/row_heights.js +1 -1
- package/test-env/components/datagrid/utils/sorting.js +31 -29
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/test-env/components/flex/flex_grid.js +21 -7
- package/test-env/components/flex/flex_grid.styles.js +13 -6
- package/test-env/components/flex/flex_group.js +10 -10
- package/test-env/components/flex/flex_item.js +13 -13
- package/test-env/components/flex/flex_item.styles.js +107 -122
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/test-env/components/header/header_links/header_links.js +10 -2
- package/test-env/components/modal/confirm_modal.js +2 -1
- package/test-env/components/modal/modal.js +12 -3
- package/test-env/components/panel/panel.js +1 -2
- package/test-env/components/resizable_container/resizable_button.js +1 -2
- package/test-env/components/resizable_container/resizable_collapse_button.js +1 -2
- package/test-env/components/resizable_container/resizable_container.js +1 -2
- package/test-env/components/resizable_container/resizable_container.styles.js +11 -14
- package/test-env/components/resizable_container/resizable_panel.js +3 -5
- package/test-env/components/resizable_container/resizable_panel.styles.js +17 -26
- package/test-env/components/selectable/selectable_list/selectable_list.js +26 -6
- package/test-env/components/spacer/spacer.js +1 -2
- package/test-env/components/toast/global_toast_list.js +68 -71
- package/test-env/components/toast/toast.js +25 -40
- package/test-env/components/toast/toast.styles.js +11 -25
- package/test-env/components/tool_tip/icon_tip.js +4 -3
- package/test-env/global_styling/mixins/_color.js +63 -40
- package/test-env/global_styling/mixins/_padding.js +59 -25
- package/test-env/services/color/eui_palettes.js +24 -14
- package/test-env/services/color/index.js +14 -0
- package/test-env/services/hooks/index.js +11 -0
- package/test-env/services/hooks/useDeepEqual.js +30 -0
- package/test-env/services/index.js +15 -1
- package/test-env/services/theme/style_memoization.js +1 -3
- package/src/themes/charts/theme.scss +0 -5
|
@@ -37,8 +37,7 @@ var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
|
|
|
37
37
|
var isHorizontal = direction === 'horizontal';
|
|
38
38
|
var showOnFocus = !isCollapsed && !isVisible;
|
|
39
39
|
var screenReaderOnlyStyles = (0, _screen_reader_only.euiScreenReaderOnlyStyles)(showOnFocus).euiScreenReaderOnly;
|
|
40
|
-
var
|
|
41
|
-
var styles = (0, _resizable_collapse_button.euiResizableCollapseButtonStyles)(euiTheme);
|
|
40
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_resizable_collapse_button.euiResizableCollapseButtonStyles);
|
|
42
41
|
var collapsedStyles = [styles.collapsed.collapsed, styles.collapsed[direction], styles.collapsed["".concat(direction, "Positions")][internalPosition]];
|
|
43
42
|
var collapsibleStyles = [styles.collapsible.collapsible, styles.collapsible[direction][externalPosition], styles.collapsible[direction][internalPosition]];
|
|
44
43
|
var cssStyles = [styles.euiResizableCollapseButton, showOnFocus && screenReaderOnlyStyles].concat((0, _toConsumableArray2.default)(isCollapsed ? collapsedStyles : collapsibleStyles));
|
|
@@ -58,8 +58,7 @@ var EuiResizableContainer = function EuiResizableContainer(_ref) {
|
|
|
58
58
|
var containerRef = (0, _react.useRef)(null);
|
|
59
59
|
var isHorizontal = direction === 'horizontal';
|
|
60
60
|
var classes = (0, _classnames.default)('euiResizableContainer', className);
|
|
61
|
-
var
|
|
62
|
-
var cssStyles = [styles.euiResizableContainer, styles[direction]];
|
|
61
|
+
var cssStyles = [_resizable_container.euiResizableContainerStyles.euiResizableContainer, _resizable_container.euiResizableContainerStyles[direction]];
|
|
63
62
|
var _useContainerCallback = (0, _helpers.useContainerCallbacks)({
|
|
64
63
|
initialState: _objectSpread(_objectSpread({}, initialState), {}, {
|
|
65
64
|
isHorizontal: isHorizontal
|
|
@@ -13,19 +13,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
13
13
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
|
|
28
|
-
vertical: _ref
|
|
29
|
-
};
|
|
16
|
+
var euiResizableContainerStyles = {
|
|
17
|
+
euiResizableContainer: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:euiResizableContainer;"),
|
|
18
|
+
horizontal: /*#__PURE__*/(0, _react.css)(";label:horizontal;"),
|
|
19
|
+
vertical: process.env.NODE_ENV === "production" ? {
|
|
20
|
+
name: "omnk2l-vertical",
|
|
21
|
+
styles: "flex-direction:column;label:vertical;"
|
|
22
|
+
} : {
|
|
23
|
+
name: "omnk2l-vertical",
|
|
24
|
+
styles: "flex-direction:column;label:vertical;",
|
|
25
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
26
|
+
}
|
|
30
27
|
};
|
|
31
28
|
exports.euiResizableContainerStyles = euiResizableContainerStyles;
|
|
@@ -145,15 +145,13 @@ var EuiResizablePanel = function EuiResizablePanel(_ref) {
|
|
|
145
145
|
return direction;
|
|
146
146
|
}, [isCollapsed, isCollapsible, position, panels, panelId]);
|
|
147
147
|
var axis = isHorizontal ? 'horizontal' : 'vertical';
|
|
148
|
-
var
|
|
149
|
-
var
|
|
150
|
-
var cssStyles = [styles.euiResizablePanel, isCollapsed && styles.collapsed, styles.paddingSizes[wrapperPadding], wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
|
|
151
|
-
var contentStyles = (0, _resizable_panel.euiResizablePanelContentStyles)(euiTheme);
|
|
148
|
+
var cssStyles = [_resizable_panel.euiResizablePanelStyles.euiResizablePanel, isCollapsed && _resizable_panel.euiResizablePanelStyles.collapsed, (0, _global_styling.useEuiPaddingCSS)()[wrapperPadding], wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.css];
|
|
149
|
+
var contentStyles = (0, _services.useEuiMemoizedStyles)(_resizable_panel.euiResizablePanelContentStyles);
|
|
152
150
|
var contentCssStyles = [contentStyles.euiResizablePanel__content, scrollable && contentStyles.scrollable, isCollapsed && contentStyles.collapsedChildren, isCollapsed && !isCollapsible && contentStyles[axis].collapsed, isCollapsible && contentStyles[axis].hasCollapsibleButton];
|
|
153
151
|
var classes = (0, _classnames.default)('euiResizablePanel', wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.className);
|
|
154
152
|
var panelClasses = (0, _classnames.default)('euiResizablePanel__content', className);
|
|
155
153
|
var inlineStyles = _objectSpread(_objectSpread({}, wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.style), isHorizontal ? (0, _global_styling.logicalSizeStyle)("".concat(size || innerSize, "%"), 'auto') : (0, _global_styling.logicalSizeStyle)('100%', "".concat(size || innerSize, "%")));
|
|
156
|
-
var padding = (0, _global_styling.
|
|
154
|
+
var padding = (0, _global_styling.useEuiPaddingSize)(paddingSize) || '0px';
|
|
157
155
|
(0, _react.useEffect)(function () {
|
|
158
156
|
if (!registration) return;
|
|
159
157
|
var initSize = size !== null && size !== void 0 ? size : initialSize || 0;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.euiResizablePanelStyles = exports.euiResizablePanelContentStyles = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _react = require("@emotion/react");
|
|
10
8
|
var _global_styling = require("../../global_styling");
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
9
|
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)."; } /*
|
|
14
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
11
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,28 +13,23 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
17
13
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
14
|
* Side Public License, v 1.
|
|
19
15
|
*/
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
euiResizablePanel: _ref3,
|
|
39
|
-
collapsed: _ref2,
|
|
40
|
-
paddingSizes: _objectSpread({}, (0, _global_styling.euiPaddingSizeCSS)(euiThemeContext))
|
|
41
|
-
};
|
|
16
|
+
var euiResizablePanelStyles = {
|
|
17
|
+
euiResizablePanel: process.env.NODE_ENV === "production" ? {
|
|
18
|
+
name: "15ifdgc-euiResizablePanel",
|
|
19
|
+
styles: "position:relative;label:euiResizablePanel;"
|
|
20
|
+
} : {
|
|
21
|
+
name: "15ifdgc-euiResizablePanel",
|
|
22
|
+
styles: "position:relative;label:euiResizablePanel;",
|
|
23
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
24
|
+
},
|
|
25
|
+
collapsed: process.env.NODE_ENV === "production" ? {
|
|
26
|
+
name: "11qmbh3-collapsed",
|
|
27
|
+
styles: "overflow:hidden;label:collapsed;"
|
|
28
|
+
} : {
|
|
29
|
+
name: "11qmbh3-collapsed",
|
|
30
|
+
styles: "overflow:hidden;label:collapsed;",
|
|
31
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
32
|
+
}
|
|
42
33
|
};
|
|
43
34
|
exports.euiResizablePanelStyles = euiResizablePanelStyles;
|
|
44
35
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -421,14 +421,30 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
421
421
|
key: "componentDidUpdate",
|
|
422
422
|
value: function componentDidUpdate(prevProps) {
|
|
423
423
|
var _this$props9 = this.props,
|
|
424
|
+
isVirtualized = _this$props9.isVirtualized,
|
|
424
425
|
activeOptionIndex = _this$props9.activeOptionIndex,
|
|
425
426
|
visibleOptions = _this$props9.visibleOptions,
|
|
426
427
|
options = _this$props9.options;
|
|
427
|
-
if (
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
if (prevProps.activeOptionIndex !== activeOptionIndex) {
|
|
429
|
+
var makeOptionId = this.props.makeOptionId;
|
|
430
|
+
if (this.listBoxRef && this.props.searchable !== true) {
|
|
431
|
+
this.listBoxRef.setAttribute('aria-activedescendant', makeOptionId(activeOptionIndex));
|
|
432
|
+
}
|
|
433
|
+
if (typeof activeOptionIndex !== 'undefined') {
|
|
434
|
+
if (isVirtualized) {
|
|
435
|
+
var _this$listRef;
|
|
436
|
+
(_this$listRef = this.listRef) === null || _this$listRef === void 0 ? void 0 : _this$listRef.scrollToItem(activeOptionIndex, 'auto');
|
|
437
|
+
} else {
|
|
438
|
+
var _this$listBoxRef;
|
|
439
|
+
var activeOptionId = "#".concat(makeOptionId(activeOptionIndex));
|
|
440
|
+
var activeOptionEl = (_this$listBoxRef = this.listBoxRef) === null || _this$listBoxRef === void 0 ? void 0 : _this$listBoxRef.querySelector(activeOptionId);
|
|
441
|
+
if (activeOptionEl) {
|
|
442
|
+
activeOptionEl.scrollIntoView({
|
|
443
|
+
block: 'nearest'
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
432
448
|
}
|
|
433
449
|
if (prevProps.visibleOptions !== visibleOptions || prevProps.options !== options) {
|
|
434
450
|
var optionArray = visibleOptions || options;
|
|
@@ -471,14 +487,18 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
471
487
|
textWrap = _this$props10.textWrap,
|
|
472
488
|
truncationProps = _this$props10.truncationProps,
|
|
473
489
|
rest = (0, _objectWithoutProperties2.default)(_this$props10, _excluded3);
|
|
490
|
+
var heightIsFull = forcedHeight === 'full';
|
|
474
491
|
var classes = (0, _classnames.default)('euiSelectableList', {
|
|
475
|
-
'euiSelectableList-fullHeight':
|
|
492
|
+
'euiSelectableList-fullHeight': heightIsFull,
|
|
476
493
|
'euiSelectableList-bordered': bordered
|
|
477
494
|
}, className);
|
|
478
495
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
479
496
|
className: classes
|
|
480
497
|
}, rest), isVirtualized ? this.renderVirtualizedList() : (0, _react2.jsx)("div", {
|
|
481
498
|
className: "euiSelectableList__list",
|
|
499
|
+
style: !heightIsFull ? {
|
|
500
|
+
blockSize: forcedHeight
|
|
501
|
+
} : undefined,
|
|
482
502
|
ref: this.removeScrollableTabStop
|
|
483
503
|
}, (0, _react2.jsx)("ul", {
|
|
484
504
|
ref: this.setListBoxRef
|
|
@@ -28,8 +28,7 @@ var EuiSpacer = function EuiSpacer(_ref) {
|
|
|
28
28
|
_ref$size = _ref.size,
|
|
29
29
|
size = _ref$size === void 0 ? 'l' : _ref$size,
|
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
|
-
var
|
|
32
|
-
var styles = (0, _spacer.euiSpacerStyles)(euiTheme);
|
|
31
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_spacer.euiSpacerStyles);
|
|
33
32
|
var classes = (0, _classnames.default)('euiSpacer', (0, _defineProperty2.default)({}, "euiSpacer--".concat(size), size), className);
|
|
34
33
|
var cssStyles = [styles.euiSpacer, styles[size]];
|
|
35
34
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
@@ -76,10 +76,9 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
76
76
|
var isScrollingAnimationFrame = (0, _react.useRef)(0);
|
|
77
77
|
var startScrollingAnimationFrame = (0, _react.useRef)(0);
|
|
78
78
|
var listElement = (0, _react.useRef)(null);
|
|
79
|
-
var
|
|
80
|
-
var styles = (0, _global_toast_list.euiGlobalToastListStyles)(euiTheme);
|
|
79
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_global_toast_list.euiGlobalToastListStyles);
|
|
81
80
|
var cssStyles = [styles.euiGlobalToastList, styles[side]];
|
|
82
|
-
var startScrollingToBottom = function
|
|
81
|
+
var startScrollingToBottom = (0, _react.useCallback)(function () {
|
|
83
82
|
isScrollingToBottom.current = true;
|
|
84
83
|
var scrollToBottom = function scrollToBottom() {
|
|
85
84
|
// Although we cancel the requestAnimationFrame in componentWillUnmount,
|
|
@@ -102,8 +101,8 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
102
101
|
}
|
|
103
102
|
};
|
|
104
103
|
startScrollingAnimationFrame.current = window.requestAnimationFrame(scrollToBottom);
|
|
105
|
-
};
|
|
106
|
-
var onMouseEnter = function
|
|
104
|
+
}, []);
|
|
105
|
+
var onMouseEnter = (0, _react.useCallback)(function () {
|
|
107
106
|
// Stop scrolling to bottom if we're in mid-scroll, because the user wants to interact with
|
|
108
107
|
// the list.
|
|
109
108
|
isScrollingToBottom.current = false;
|
|
@@ -116,8 +115,8 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
116
115
|
timer.pause();
|
|
117
116
|
}
|
|
118
117
|
}
|
|
119
|
-
};
|
|
120
|
-
var onMouseLeave = function
|
|
118
|
+
}, []);
|
|
119
|
+
var onMouseLeave = (0, _react.useCallback)(function () {
|
|
121
120
|
isUserInteracting.current = false;
|
|
122
121
|
for (var _toastId2 in toastIdToTimerMap.current) {
|
|
123
122
|
if (toastIdToTimerMap.current.hasOwnProperty(_toastId2)) {
|
|
@@ -125,8 +124,8 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
125
124
|
timer.resume();
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
|
-
};
|
|
129
|
-
var onScroll = function
|
|
127
|
+
}, []);
|
|
128
|
+
var onScroll = (0, _react.useCallback)(function () {
|
|
130
129
|
// Given that this method also gets invoked by the synthetic scroll that happens when a new toast gets added,
|
|
131
130
|
// we want to evaluate if the scroll bottom has been reached only when the user is interacting with the toast,
|
|
132
131
|
// this way we always retain the scroll position the user has set despite adding in new toasts.
|
|
@@ -134,7 +133,7 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
134
133
|
if (listElement.current && isUserInteracting.current) {
|
|
135
134
|
isScrolledToBottom.current = listElement.current.scrollHeight - listElement.current.scrollTop === listElement.current.clientHeight;
|
|
136
135
|
}
|
|
137
|
-
};
|
|
136
|
+
}, []);
|
|
138
137
|
var dismissToast = (0, _react.useCallback)(function (toast) {
|
|
139
138
|
// Remove the toast after it's done fading out.
|
|
140
139
|
dismissTimeoutIds.current.push(window.setTimeout(function () {
|
|
@@ -157,34 +156,29 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
157
156
|
}
|
|
158
157
|
});
|
|
159
158
|
}, [scheduleToastForDismissal, toasts]);
|
|
160
|
-
var addListeners = function addListeners() {
|
|
161
|
-
if (listElement.current) {
|
|
162
|
-
listElement.current.addEventListener('scroll', onScroll);
|
|
163
|
-
listElement.current.addEventListener('mouseenter', onMouseEnter);
|
|
164
|
-
listElement.current.addEventListener('mouseleave', onMouseLeave);
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
var removeListeners = function removeListeners() {
|
|
168
|
-
if (listElement.current) {
|
|
169
|
-
listElement.current.removeEventListener('scroll', onScroll);
|
|
170
|
-
listElement.current.removeEventListener('mouseenter', onMouseEnter);
|
|
171
|
-
listElement.current.removeEventListener('mouseleave', onMouseLeave);
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
159
|
|
|
175
160
|
// componentDidMount
|
|
176
161
|
(0, _react.useEffect)(function () {
|
|
177
|
-
|
|
162
|
+
var listenerEl = listElement.current;
|
|
163
|
+
if (listenerEl) {
|
|
164
|
+
listenerEl.addEventListener('scroll', onScroll);
|
|
165
|
+
listenerEl.addEventListener('mouseenter', onMouseEnter);
|
|
166
|
+
listenerEl.addEventListener('mouseleave', onMouseLeave);
|
|
167
|
+
}
|
|
178
168
|
|
|
179
169
|
// componentWillUnmount
|
|
180
170
|
return function () {
|
|
171
|
+
if (listenerEl) {
|
|
172
|
+
listenerEl.removeEventListener('scroll', onScroll);
|
|
173
|
+
listenerEl.removeEventListener('mouseenter', onMouseEnter);
|
|
174
|
+
listenerEl.removeEventListener('mouseleave', onMouseLeave);
|
|
175
|
+
}
|
|
181
176
|
if (isScrollingAnimationFrame.current !== 0) {
|
|
182
177
|
window.cancelAnimationFrame(isScrollingAnimationFrame.current);
|
|
183
178
|
}
|
|
184
179
|
if (startScrollingAnimationFrame.current !== 0) {
|
|
185
180
|
window.cancelAnimationFrame(startScrollingAnimationFrame.current);
|
|
186
181
|
}
|
|
187
|
-
removeListeners();
|
|
188
182
|
dismissTimeoutIds.current.forEach(clearTimeout); // eslint-disable-line react-hooks/exhaustive-deps
|
|
189
183
|
for (var _toastId3 in toastIdToTimerMap.current) {
|
|
190
184
|
if (toastIdToTimerMap.current.hasOwnProperty(_toastId3)) {
|
|
@@ -193,7 +187,7 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
193
187
|
}
|
|
194
188
|
}
|
|
195
189
|
};
|
|
196
|
-
}, []);
|
|
190
|
+
}, [onMouseEnter, onMouseLeave, onScroll]);
|
|
197
191
|
|
|
198
192
|
// componentDidUpdate
|
|
199
193
|
(0, _react.useEffect)(function () {
|
|
@@ -208,7 +202,7 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
208
202
|
}
|
|
209
203
|
}
|
|
210
204
|
prevToasts.current = toasts;
|
|
211
|
-
}, [toasts, scheduleAllToastsForDismissal]);
|
|
205
|
+
}, [toasts, scheduleAllToastsForDismissal, startScrollingToBottom]);
|
|
212
206
|
|
|
213
207
|
// Toast dismissal side effect
|
|
214
208
|
// Ensure the callback has correct state by not enclosing it in `setTimeout`
|
|
@@ -229,49 +223,52 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
229
223
|
});
|
|
230
224
|
}
|
|
231
225
|
}, [toastToDismiss, dismissToastProp]);
|
|
232
|
-
var renderedToasts =
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
key: toast.id,
|
|
241
|
-
isDismissed: toastIdToDismissedMap[toast.id]
|
|
242
|
-
}, (0, _react2.jsx)(_toast.EuiToast, (0, _extends2.default)({
|
|
243
|
-
onClose: onClose,
|
|
244
|
-
onFocus: onMouseEnter,
|
|
245
|
-
onBlur: onMouseLeave
|
|
246
|
-
}, rest), text));
|
|
247
|
-
});
|
|
248
|
-
if (showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
|
|
249
|
-
var dismissAllToasts = function dismissAllToasts() {
|
|
250
|
-
toasts.forEach(function (toast) {
|
|
251
|
-
return dismissToastProp(toast);
|
|
252
|
-
});
|
|
253
|
-
onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
|
|
254
|
-
};
|
|
255
|
-
renderedToasts.push((0, _react2.jsx)(_i18n.EuiI18n, {
|
|
256
|
-
key: "euiClearAllToasts",
|
|
257
|
-
tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
|
|
258
|
-
defaults: ['Clear all toast notifications', 'Clear all']
|
|
259
|
-
}, function (_ref2) {
|
|
260
|
-
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
261
|
-
clearAllToastsButtonAriaLabel = _ref3[0],
|
|
262
|
-
clearAllToastsButtonDisplayText = _ref3[1];
|
|
226
|
+
var renderedToasts = (0, _react.useMemo)(function () {
|
|
227
|
+
return toasts.map(function (toast) {
|
|
228
|
+
var text = toast.text,
|
|
229
|
+
toastLifeTimeMs = toast.toastLifeTimeMs,
|
|
230
|
+
rest = (0, _objectWithoutProperties2.default)(toast, _excluded2);
|
|
231
|
+
var onClose = function onClose() {
|
|
232
|
+
return dismissToast(toast);
|
|
233
|
+
};
|
|
263
234
|
return (0, _react2.jsx)(_global_toast_list_item.EuiGlobalToastListItem, {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
235
|
+
key: toast.id,
|
|
236
|
+
isDismissed: toastIdToDismissedMap[toast.id]
|
|
237
|
+
}, (0, _react2.jsx)(_toast.EuiToast, (0, _extends2.default)({
|
|
238
|
+
onClose: onClose,
|
|
239
|
+
onFocus: onMouseEnter,
|
|
240
|
+
onBlur: onMouseLeave
|
|
241
|
+
}, rest), text));
|
|
242
|
+
});
|
|
243
|
+
}, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave]);
|
|
244
|
+
var clearAllButton = (0, _react.useMemo)(function () {
|
|
245
|
+
if (toasts.length && showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
|
|
246
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
247
|
+
key: "euiClearAllToasts",
|
|
248
|
+
tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
|
|
249
|
+
defaults: ['Clear all toast notifications', 'Clear all']
|
|
250
|
+
}, function (_ref2) {
|
|
251
|
+
var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
|
|
252
|
+
clearAllToastsButtonAriaLabel = _ref3[0],
|
|
253
|
+
clearAllToastsButtonDisplayText = _ref3[1];
|
|
254
|
+
return (0, _react2.jsx)(_global_toast_list_item.EuiGlobalToastListItem, {
|
|
255
|
+
isDismissed: false
|
|
256
|
+
}, (0, _react2.jsx)(_button.EuiButton, {
|
|
257
|
+
fill: true,
|
|
258
|
+
color: "text",
|
|
259
|
+
onClick: function onClick() {
|
|
260
|
+
toasts.forEach(function (toast) {
|
|
261
|
+
return dismissToastProp(toast);
|
|
262
|
+
});
|
|
263
|
+
onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
|
|
264
|
+
},
|
|
265
|
+
css: styles.euiGlobalToastListDismissButton,
|
|
266
|
+
"aria-label": clearAllToastsButtonAriaLabel,
|
|
267
|
+
"data-test-subj": "euiClearAllToastsButton"
|
|
268
|
+
}, clearAllToastsButtonDisplayText));
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}, [showClearAllButtonAt, onClearAllToasts, toasts, dismissToastProp, styles]);
|
|
275
272
|
var classes = (0, _classnames.default)('euiGlobalToastList', className);
|
|
276
273
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
277
274
|
"aria-live": "polite",
|
|
@@ -279,6 +276,6 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
279
276
|
ref: listElement,
|
|
280
277
|
css: cssStyles,
|
|
281
278
|
className: classes
|
|
282
|
-
}, rest), renderedToasts);
|
|
279
|
+
}, rest), renderedToasts, clearAllButton);
|
|
283
280
|
};
|
|
284
281
|
exports.EuiGlobalToastList = EuiGlobalToastList;
|
|
@@ -35,47 +35,11 @@ var EuiToast = function EuiToast(_ref) {
|
|
|
35
35
|
children = _ref.children,
|
|
36
36
|
className = _ref.className,
|
|
37
37
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
|
-
var
|
|
39
|
-
var baseStyles = (0, _toast.euiToastStyles)(euiTheme);
|
|
38
|
+
var baseStyles = (0, _services.useEuiMemoizedStyles)(_toast.euiToastStyles);
|
|
40
39
|
var baseCss = [baseStyles.euiToast, color && baseStyles[color]];
|
|
41
|
-
var
|
|
42
|
-
var headerStyles = (0, _toast.euiToastHeaderStyles)(euiTheme);
|
|
40
|
+
var headerStyles = (0, _services.useEuiMemoizedStyles)(_toast.euiToastHeaderStyles);
|
|
43
41
|
var headerCss = [headerStyles.euiToastHeader, children && headerStyles.withBody];
|
|
44
42
|
var classes = (0, _classnames.default)('euiToast', className);
|
|
45
|
-
var headerIcon;
|
|
46
|
-
if (iconType) {
|
|
47
|
-
headerIcon = (0, _react2.jsx)(_icon.EuiIcon, {
|
|
48
|
-
css: headerStyles.euiToastHeader__icon,
|
|
49
|
-
type: iconType,
|
|
50
|
-
size: "m",
|
|
51
|
-
"aria-hidden": "true"
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
var closeButton;
|
|
55
|
-
if (onClose) {
|
|
56
|
-
closeButton = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
57
|
-
token: "euiToast.dismissToast",
|
|
58
|
-
default: "Dismiss toast"
|
|
59
|
-
}, function (dismissToast) {
|
|
60
|
-
return (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
61
|
-
css: baseStyles.euiToast__closeButton,
|
|
62
|
-
iconType: "cross",
|
|
63
|
-
color: "text",
|
|
64
|
-
size: "xs",
|
|
65
|
-
"aria-label": dismissToast,
|
|
66
|
-
onClick: onClose,
|
|
67
|
-
"data-test-subj": "toastCloseButton"
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
var optionalBody;
|
|
72
|
-
if (children) {
|
|
73
|
-
optionalBody = (0, _react2.jsx)(_text.EuiText, {
|
|
74
|
-
css: bodyStyles.euiToastBody,
|
|
75
|
-
size: "s",
|
|
76
|
-
"data-test-subj": "euiToastBody"
|
|
77
|
-
}, children);
|
|
78
|
-
}
|
|
79
43
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
80
44
|
css: baseCss,
|
|
81
45
|
className: classes
|
|
@@ -90,10 +54,31 @@ var EuiToast = function EuiToast(_ref) {
|
|
|
90
54
|
css: headerCss,
|
|
91
55
|
"aria-label": notification,
|
|
92
56
|
"data-test-subj": "euiToastHeader"
|
|
93
|
-
},
|
|
57
|
+
}, iconType && (0, _react2.jsx)(_icon.EuiIcon, {
|
|
58
|
+
css: headerStyles.euiToastHeader__icon,
|
|
59
|
+
type: iconType,
|
|
60
|
+
size: "m",
|
|
61
|
+
"aria-hidden": "true"
|
|
62
|
+
}), (0, _react2.jsx)("span", {
|
|
94
63
|
css: headerStyles.euiToastHeader__title,
|
|
95
64
|
"data-test-subj": "euiToastHeader__title"
|
|
96
65
|
}, title));
|
|
97
|
-
}),
|
|
66
|
+
}), onClose && (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
67
|
+
token: "euiToast.dismissToast",
|
|
68
|
+
default: "Dismiss toast"
|
|
69
|
+
}, function (dismissToast) {
|
|
70
|
+
return (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
71
|
+
css: baseStyles.euiToast__closeButton,
|
|
72
|
+
iconType: "cross",
|
|
73
|
+
color: "text",
|
|
74
|
+
size: "xs",
|
|
75
|
+
"aria-label": dismissToast,
|
|
76
|
+
onClick: onClose,
|
|
77
|
+
"data-test-subj": "toastCloseButton"
|
|
78
|
+
});
|
|
79
|
+
}), children && (0, _react2.jsx)(_text.EuiText, {
|
|
80
|
+
size: "s",
|
|
81
|
+
"data-test-subj": "euiToastBody"
|
|
82
|
+
}, children));
|
|
98
83
|
};
|
|
99
84
|
exports.EuiToast = EuiToast;
|
|
@@ -3,23 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.euiToastStyles = exports.euiToastHeaderStyles =
|
|
6
|
+
exports.euiToastStyles = exports.euiToastHeaderStyles = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _global_styling = require("../../global_styling");
|
|
9
9
|
var _amsterdam = require("../../themes/amsterdam");
|
|
10
10
|
var _title = require("../title/title.styles");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/*
|
|
12
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
|
+
* Side Public License, v 1.
|
|
17
|
+
*/
|
|
18
|
+
|
|
18
19
|
var euiToastStyles = function euiToastStyles(euiThemeContext) {
|
|
19
20
|
var euiTheme = euiThemeContext.euiTheme;
|
|
20
21
|
return {
|
|
21
22
|
// Base
|
|
22
|
-
euiToast: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";", (0, _amsterdam.euiShadowLarge)(euiThemeContext), " position:relative;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), " background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('width', '100%'), " &:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
|
|
23
|
+
euiToast: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";", (0, _amsterdam.euiShadowLarge)(euiThemeContext), " position:relative;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), " background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.euiTextBreakWord)(), "&:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
|
|
23
24
|
// Elements
|
|
24
25
|
euiToast__closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('top', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('right', euiTheme.size.base), ";;label:euiToast__closeButton;"),
|
|
25
26
|
// Variants
|
|
@@ -42,19 +43,4 @@ var euiToastHeaderStyles = function euiToastHeaderStyles(euiThemeContext) {
|
|
|
42
43
|
withBody: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:withBody;")
|
|
43
44
|
};
|
|
44
45
|
};
|
|
45
|
-
exports.euiToastHeaderStyles = euiToastHeaderStyles;
|
|
46
|
-
var _ref = process.env.NODE_ENV === "production" ? {
|
|
47
|
-
name: "1xv63y1-euiToastBody",
|
|
48
|
-
styles: "word-wrap:break-word;label:euiToastBody;"
|
|
49
|
-
} : {
|
|
50
|
-
name: "1xv63y1-euiToastBody",
|
|
51
|
-
styles: "word-wrap:break-word;label:euiToastBody;",
|
|
52
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
53
|
-
};
|
|
54
|
-
var euiToastBodyStyles = function euiToastBodyStyles() {
|
|
55
|
-
return {
|
|
56
|
-
// Base
|
|
57
|
-
euiToastBody: _ref
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
exports.euiToastBodyStyles = euiToastBodyStyles;
|
|
46
|
+
exports.euiToastHeaderStyles = euiToastHeaderStyles;
|
|
@@ -8,6 +8,7 @@ exports.EuiIconTip = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _i18n = require("../i18n");
|
|
11
12
|
var _icon = require("../icon");
|
|
12
13
|
var _tool_tip = require("./tool_tip");
|
|
13
14
|
var _react2 = require("@emotion/react");
|
|
@@ -22,8 +23,7 @@ var _excluded = ["type", "aria-label", "color", "size", "iconProps", "position",
|
|
|
22
23
|
var EuiIconTip = function EuiIconTip(_ref) {
|
|
23
24
|
var _ref$type = _ref.type,
|
|
24
25
|
type = _ref$type === void 0 ? 'questionInCircle' : _ref$type,
|
|
25
|
-
|
|
26
|
-
ariaLabel = _ref$ariaLabel === void 0 ? 'Info' : _ref$ariaLabel,
|
|
26
|
+
ariaLabel = _ref['aria-label'],
|
|
27
27
|
color = _ref.color,
|
|
28
28
|
size = _ref.size,
|
|
29
29
|
iconProps = _ref.iconProps,
|
|
@@ -32,6 +32,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
32
32
|
_ref$delay = _ref.delay,
|
|
33
33
|
delay = _ref$delay === void 0 ? 'regular' : _ref$delay,
|
|
34
34
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
35
|
+
var defaultAriaLabel = (0, _i18n.useEuiI18n)('euiIconTip.defaultAriaLabel', 'Info');
|
|
35
36
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
36
37
|
position: position,
|
|
37
38
|
delay: delay
|
|
@@ -40,7 +41,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
40
41
|
type: type,
|
|
41
42
|
color: color,
|
|
42
43
|
size: size,
|
|
43
|
-
"aria-label": ariaLabel
|
|
44
|
+
"aria-label": ariaLabel || defaultAriaLabel
|
|
44
45
|
}, iconProps)));
|
|
45
46
|
};
|
|
46
47
|
exports.EuiIconTip = EuiIconTip;
|