@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
|
@@ -14,10 +14,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
17
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { keysOf } from '../common';
|
|
20
|
-
import {
|
|
20
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
21
21
|
import { Timer } from '../../services/time';
|
|
22
22
|
import { EuiGlobalToastListItem } from './global_toast_list_item';
|
|
23
23
|
import { EuiToast } from './toast';
|
|
@@ -64,10 +64,9 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
64
64
|
var isScrollingAnimationFrame = useRef(0);
|
|
65
65
|
var startScrollingAnimationFrame = useRef(0);
|
|
66
66
|
var listElement = useRef(null);
|
|
67
|
-
var
|
|
68
|
-
var styles = euiGlobalToastListStyles(euiTheme);
|
|
67
|
+
var styles = useEuiMemoizedStyles(euiGlobalToastListStyles);
|
|
69
68
|
var cssStyles = [styles.euiGlobalToastList, styles[side]];
|
|
70
|
-
var startScrollingToBottom = function
|
|
69
|
+
var startScrollingToBottom = useCallback(function () {
|
|
71
70
|
isScrollingToBottom.current = true;
|
|
72
71
|
var scrollToBottom = function scrollToBottom() {
|
|
73
72
|
// Although we cancel the requestAnimationFrame in componentWillUnmount,
|
|
@@ -90,8 +89,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
90
89
|
}
|
|
91
90
|
};
|
|
92
91
|
startScrollingAnimationFrame.current = window.requestAnimationFrame(scrollToBottom);
|
|
93
|
-
};
|
|
94
|
-
var onMouseEnter = function
|
|
92
|
+
}, []);
|
|
93
|
+
var onMouseEnter = useCallback(function () {
|
|
95
94
|
// Stop scrolling to bottom if we're in mid-scroll, because the user wants to interact with
|
|
96
95
|
// the list.
|
|
97
96
|
isScrollingToBottom.current = false;
|
|
@@ -104,8 +103,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
104
103
|
timer.pause();
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
|
-
};
|
|
108
|
-
var onMouseLeave = function
|
|
106
|
+
}, []);
|
|
107
|
+
var onMouseLeave = useCallback(function () {
|
|
109
108
|
isUserInteracting.current = false;
|
|
110
109
|
for (var _toastId2 in toastIdToTimerMap.current) {
|
|
111
110
|
if (toastIdToTimerMap.current.hasOwnProperty(_toastId2)) {
|
|
@@ -113,8 +112,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
113
112
|
timer.resume();
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
|
-
};
|
|
117
|
-
var onScroll = function
|
|
115
|
+
}, []);
|
|
116
|
+
var onScroll = useCallback(function () {
|
|
118
117
|
// Given that this method also gets invoked by the synthetic scroll that happens when a new toast gets added,
|
|
119
118
|
// we want to evaluate if the scroll bottom has been reached only when the user is interacting with the toast,
|
|
120
119
|
// this way we always retain the scroll position the user has set despite adding in new toasts.
|
|
@@ -122,7 +121,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
122
121
|
if (listElement.current && isUserInteracting.current) {
|
|
123
122
|
isScrolledToBottom.current = listElement.current.scrollHeight - listElement.current.scrollTop === listElement.current.clientHeight;
|
|
124
123
|
}
|
|
125
|
-
};
|
|
124
|
+
}, []);
|
|
126
125
|
var dismissToast = useCallback(function (toast) {
|
|
127
126
|
// Remove the toast after it's done fading out.
|
|
128
127
|
dismissTimeoutIds.current.push(window.setTimeout(function () {
|
|
@@ -145,34 +144,29 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
145
144
|
}
|
|
146
145
|
});
|
|
147
146
|
}, [scheduleToastForDismissal, toasts]);
|
|
148
|
-
var addListeners = function addListeners() {
|
|
149
|
-
if (listElement.current) {
|
|
150
|
-
listElement.current.addEventListener('scroll', onScroll);
|
|
151
|
-
listElement.current.addEventListener('mouseenter', onMouseEnter);
|
|
152
|
-
listElement.current.addEventListener('mouseleave', onMouseLeave);
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
var removeListeners = function removeListeners() {
|
|
156
|
-
if (listElement.current) {
|
|
157
|
-
listElement.current.removeEventListener('scroll', onScroll);
|
|
158
|
-
listElement.current.removeEventListener('mouseenter', onMouseEnter);
|
|
159
|
-
listElement.current.removeEventListener('mouseleave', onMouseLeave);
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
147
|
|
|
163
148
|
// componentDidMount
|
|
164
149
|
useEffect(function () {
|
|
165
|
-
|
|
150
|
+
var listenerEl = listElement.current;
|
|
151
|
+
if (listenerEl) {
|
|
152
|
+
listenerEl.addEventListener('scroll', onScroll);
|
|
153
|
+
listenerEl.addEventListener('mouseenter', onMouseEnter);
|
|
154
|
+
listenerEl.addEventListener('mouseleave', onMouseLeave);
|
|
155
|
+
}
|
|
166
156
|
|
|
167
157
|
// componentWillUnmount
|
|
168
158
|
return function () {
|
|
159
|
+
if (listenerEl) {
|
|
160
|
+
listenerEl.removeEventListener('scroll', onScroll);
|
|
161
|
+
listenerEl.removeEventListener('mouseenter', onMouseEnter);
|
|
162
|
+
listenerEl.removeEventListener('mouseleave', onMouseLeave);
|
|
163
|
+
}
|
|
169
164
|
if (isScrollingAnimationFrame.current !== 0) {
|
|
170
165
|
window.cancelAnimationFrame(isScrollingAnimationFrame.current);
|
|
171
166
|
}
|
|
172
167
|
if (startScrollingAnimationFrame.current !== 0) {
|
|
173
168
|
window.cancelAnimationFrame(startScrollingAnimationFrame.current);
|
|
174
169
|
}
|
|
175
|
-
removeListeners();
|
|
176
170
|
dismissTimeoutIds.current.forEach(clearTimeout); // eslint-disable-line react-hooks/exhaustive-deps
|
|
177
171
|
for (var _toastId3 in toastIdToTimerMap.current) {
|
|
178
172
|
if (toastIdToTimerMap.current.hasOwnProperty(_toastId3)) {
|
|
@@ -181,7 +175,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
181
175
|
}
|
|
182
176
|
}
|
|
183
177
|
};
|
|
184
|
-
}, []);
|
|
178
|
+
}, [onMouseEnter, onMouseLeave, onScroll]);
|
|
185
179
|
|
|
186
180
|
// componentDidUpdate
|
|
187
181
|
useEffect(function () {
|
|
@@ -196,7 +190,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
196
190
|
}
|
|
197
191
|
}
|
|
198
192
|
prevToasts.current = toasts;
|
|
199
|
-
}, [toasts, scheduleAllToastsForDismissal]);
|
|
193
|
+
}, [toasts, scheduleAllToastsForDismissal, startScrollingToBottom]);
|
|
200
194
|
|
|
201
195
|
// Toast dismissal side effect
|
|
202
196
|
// Ensure the callback has correct state by not enclosing it in `setTimeout`
|
|
@@ -217,49 +211,52 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
217
211
|
});
|
|
218
212
|
}
|
|
219
213
|
}, [toastToDismiss, dismissToastProp]);
|
|
220
|
-
var renderedToasts =
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
key: toast.id,
|
|
229
|
-
isDismissed: toastIdToDismissedMap[toast.id]
|
|
230
|
-
}, ___EmotionJSX(EuiToast, _extends({
|
|
231
|
-
onClose: onClose,
|
|
232
|
-
onFocus: onMouseEnter,
|
|
233
|
-
onBlur: onMouseLeave
|
|
234
|
-
}, rest), text));
|
|
235
|
-
});
|
|
236
|
-
if (showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
|
|
237
|
-
var dismissAllToasts = function dismissAllToasts() {
|
|
238
|
-
toasts.forEach(function (toast) {
|
|
239
|
-
return dismissToastProp(toast);
|
|
240
|
-
});
|
|
241
|
-
onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
|
|
242
|
-
};
|
|
243
|
-
renderedToasts.push(___EmotionJSX(EuiI18n, {
|
|
244
|
-
key: "euiClearAllToasts",
|
|
245
|
-
tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
|
|
246
|
-
defaults: ['Clear all toast notifications', 'Clear all']
|
|
247
|
-
}, function (_ref2) {
|
|
248
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
249
|
-
clearAllToastsButtonAriaLabel = _ref3[0],
|
|
250
|
-
clearAllToastsButtonDisplayText = _ref3[1];
|
|
214
|
+
var renderedToasts = useMemo(function () {
|
|
215
|
+
return toasts.map(function (toast) {
|
|
216
|
+
var text = toast.text,
|
|
217
|
+
toastLifeTimeMs = toast.toastLifeTimeMs,
|
|
218
|
+
rest = _objectWithoutProperties(toast, _excluded2);
|
|
219
|
+
var onClose = function onClose() {
|
|
220
|
+
return dismissToast(toast);
|
|
221
|
+
};
|
|
251
222
|
return ___EmotionJSX(EuiGlobalToastListItem, {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
223
|
+
key: toast.id,
|
|
224
|
+
isDismissed: toastIdToDismissedMap[toast.id]
|
|
225
|
+
}, ___EmotionJSX(EuiToast, _extends({
|
|
226
|
+
onClose: onClose,
|
|
227
|
+
onFocus: onMouseEnter,
|
|
228
|
+
onBlur: onMouseLeave
|
|
229
|
+
}, rest), text));
|
|
230
|
+
});
|
|
231
|
+
}, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave]);
|
|
232
|
+
var clearAllButton = useMemo(function () {
|
|
233
|
+
if (toasts.length && showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
|
|
234
|
+
return ___EmotionJSX(EuiI18n, {
|
|
235
|
+
key: "euiClearAllToasts",
|
|
236
|
+
tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
|
|
237
|
+
defaults: ['Clear all toast notifications', 'Clear all']
|
|
238
|
+
}, function (_ref2) {
|
|
239
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
240
|
+
clearAllToastsButtonAriaLabel = _ref3[0],
|
|
241
|
+
clearAllToastsButtonDisplayText = _ref3[1];
|
|
242
|
+
return ___EmotionJSX(EuiGlobalToastListItem, {
|
|
243
|
+
isDismissed: false
|
|
244
|
+
}, ___EmotionJSX(EuiButton, {
|
|
245
|
+
fill: true,
|
|
246
|
+
color: "text",
|
|
247
|
+
onClick: function onClick() {
|
|
248
|
+
toasts.forEach(function (toast) {
|
|
249
|
+
return dismissToastProp(toast);
|
|
250
|
+
});
|
|
251
|
+
onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
|
|
252
|
+
},
|
|
253
|
+
css: styles.euiGlobalToastListDismissButton,
|
|
254
|
+
"aria-label": clearAllToastsButtonAriaLabel,
|
|
255
|
+
"data-test-subj": "euiClearAllToastsButton"
|
|
256
|
+
}, clearAllToastsButtonDisplayText));
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}, [showClearAllButtonAt, onClearAllToasts, toasts, dismissToastProp, styles]);
|
|
263
260
|
var classes = classNames('euiGlobalToastList', className);
|
|
264
261
|
return ___EmotionJSX("div", _extends({
|
|
265
262
|
"aria-live": "polite",
|
|
@@ -267,5 +264,5 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
267
264
|
ref: listElement,
|
|
268
265
|
css: cssStyles,
|
|
269
266
|
className: classes
|
|
270
|
-
}, rest), renderedToasts);
|
|
267
|
+
}, rest), renderedToasts, clearAllButton);
|
|
271
268
|
};
|
|
@@ -11,13 +11,13 @@ var _excluded = ["title", "color", "iconType", "onClose", "children", "className
|
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import {
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
15
15
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
16
16
|
import { EuiButtonIcon } from '../button';
|
|
17
17
|
import { EuiI18n } from '../i18n';
|
|
18
18
|
import { EuiIcon } from '../icon';
|
|
19
19
|
import { EuiText } from '../text';
|
|
20
|
-
import { euiToastStyles,
|
|
20
|
+
import { euiToastStyles, euiToastHeaderStyles } from './toast.styles';
|
|
21
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
22
|
export var COLORS = ['primary', 'success', 'warning', 'danger'];
|
|
23
23
|
export var EuiToast = function EuiToast(_ref) {
|
|
@@ -28,47 +28,11 @@ export var EuiToast = function EuiToast(_ref) {
|
|
|
28
28
|
children = _ref.children,
|
|
29
29
|
className = _ref.className,
|
|
30
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
var
|
|
32
|
-
var baseStyles = euiToastStyles(euiTheme);
|
|
31
|
+
var baseStyles = useEuiMemoizedStyles(euiToastStyles);
|
|
33
32
|
var baseCss = [baseStyles.euiToast, color && baseStyles[color]];
|
|
34
|
-
var
|
|
35
|
-
var headerStyles = euiToastHeaderStyles(euiTheme);
|
|
33
|
+
var headerStyles = useEuiMemoizedStyles(euiToastHeaderStyles);
|
|
36
34
|
var headerCss = [headerStyles.euiToastHeader, children && headerStyles.withBody];
|
|
37
35
|
var classes = classNames('euiToast', className);
|
|
38
|
-
var headerIcon;
|
|
39
|
-
if (iconType) {
|
|
40
|
-
headerIcon = ___EmotionJSX(EuiIcon, {
|
|
41
|
-
css: headerStyles.euiToastHeader__icon,
|
|
42
|
-
type: iconType,
|
|
43
|
-
size: "m",
|
|
44
|
-
"aria-hidden": "true"
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
var closeButton;
|
|
48
|
-
if (onClose) {
|
|
49
|
-
closeButton = ___EmotionJSX(EuiI18n, {
|
|
50
|
-
token: "euiToast.dismissToast",
|
|
51
|
-
default: "Dismiss toast"
|
|
52
|
-
}, function (dismissToast) {
|
|
53
|
-
return ___EmotionJSX(EuiButtonIcon, {
|
|
54
|
-
css: baseStyles.euiToast__closeButton,
|
|
55
|
-
iconType: "cross",
|
|
56
|
-
color: "text",
|
|
57
|
-
size: "xs",
|
|
58
|
-
"aria-label": dismissToast,
|
|
59
|
-
onClick: onClose,
|
|
60
|
-
"data-test-subj": "toastCloseButton"
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
var optionalBody;
|
|
65
|
-
if (children) {
|
|
66
|
-
optionalBody = ___EmotionJSX(EuiText, {
|
|
67
|
-
css: bodyStyles.euiToastBody,
|
|
68
|
-
size: "s",
|
|
69
|
-
"data-test-subj": "euiToastBody"
|
|
70
|
-
}, children);
|
|
71
|
-
}
|
|
72
36
|
return ___EmotionJSX("div", _extends({
|
|
73
37
|
css: baseCss,
|
|
74
38
|
className: classes
|
|
@@ -83,9 +47,30 @@ export var EuiToast = function EuiToast(_ref) {
|
|
|
83
47
|
css: headerCss,
|
|
84
48
|
"aria-label": notification,
|
|
85
49
|
"data-test-subj": "euiToastHeader"
|
|
86
|
-
},
|
|
50
|
+
}, iconType && ___EmotionJSX(EuiIcon, {
|
|
51
|
+
css: headerStyles.euiToastHeader__icon,
|
|
52
|
+
type: iconType,
|
|
53
|
+
size: "m",
|
|
54
|
+
"aria-hidden": "true"
|
|
55
|
+
}), ___EmotionJSX("span", {
|
|
87
56
|
css: headerStyles.euiToastHeader__title,
|
|
88
57
|
"data-test-subj": "euiToastHeader__title"
|
|
89
58
|
}, title));
|
|
90
|
-
}),
|
|
59
|
+
}), onClose && ___EmotionJSX(EuiI18n, {
|
|
60
|
+
token: "euiToast.dismissToast",
|
|
61
|
+
default: "Dismiss toast"
|
|
62
|
+
}, function (dismissToast) {
|
|
63
|
+
return ___EmotionJSX(EuiButtonIcon, {
|
|
64
|
+
css: baseStyles.euiToast__closeButton,
|
|
65
|
+
iconType: "cross",
|
|
66
|
+
color: "text",
|
|
67
|
+
size: "xs",
|
|
68
|
+
"aria-label": dismissToast,
|
|
69
|
+
onClick: onClose,
|
|
70
|
+
"data-test-subj": "toastCloseButton"
|
|
71
|
+
});
|
|
72
|
+
}), children && ___EmotionJSX(EuiText, {
|
|
73
|
+
size: "s",
|
|
74
|
+
"data-test-subj": "euiToastBody"
|
|
75
|
+
}, children));
|
|
91
76
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
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)."; }
|
|
2
1
|
/*
|
|
3
2
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
3
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -8,14 +7,14 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
import { css } from '@emotion/react';
|
|
11
|
-
import { logicalCSS } from '../../global_styling';
|
|
10
|
+
import { euiTextBreakWord, logicalCSS } from '../../global_styling';
|
|
12
11
|
import { euiShadowLarge } from '../../themes/amsterdam';
|
|
13
12
|
import { euiTitle } from '../title/title.styles';
|
|
14
13
|
export var euiToastStyles = function euiToastStyles(euiThemeContext) {
|
|
15
14
|
var euiTheme = euiThemeContext.euiTheme;
|
|
16
15
|
return {
|
|
17
16
|
// Base
|
|
18
|
-
euiToast: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";", euiShadowLarge(euiThemeContext), " position:relative;", logicalCSS('padding-horizontal', euiTheme.size.base), " ", logicalCSS('padding-vertical', euiTheme.size.base), " background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('width', '100%'), " &:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
|
|
17
|
+
euiToast: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";", euiShadowLarge(euiThemeContext), " position:relative;", logicalCSS('padding-horizontal', euiTheme.size.base), " ", logicalCSS('padding-vertical', euiTheme.size.base), " background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('width', '100%'), " ", euiTextBreakWord(), "&:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
|
|
19
18
|
// Elements
|
|
20
19
|
euiToast__closeButton: /*#__PURE__*/css("position:absolute;", logicalCSS('top', euiTheme.size.base), " ", logicalCSS('right', euiTheme.size.base), ";;label:euiToast__closeButton;"),
|
|
21
20
|
// Variants
|
|
@@ -36,18 +35,4 @@ export var euiToastHeaderStyles = function euiToastHeaderStyles(euiThemeContext)
|
|
|
36
35
|
// Variants
|
|
37
36
|
withBody: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.s), ";;label:withBody;")
|
|
38
37
|
};
|
|
39
|
-
};
|
|
40
|
-
var _ref = process.env.NODE_ENV === "production" ? {
|
|
41
|
-
name: "1xv63y1-euiToastBody",
|
|
42
|
-
styles: "word-wrap:break-word;label:euiToastBody;"
|
|
43
|
-
} : {
|
|
44
|
-
name: "1xv63y1-euiToastBody",
|
|
45
|
-
styles: "word-wrap:break-word;label:euiToastBody;",
|
|
46
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
47
|
-
};
|
|
48
|
-
export var euiToastBodyStyles = function euiToastBodyStyles() {
|
|
49
|
-
return {
|
|
50
|
-
// Base
|
|
51
|
-
euiToastBody: _ref
|
|
52
|
-
};
|
|
53
38
|
};
|
|
@@ -10,14 +10,14 @@ var _excluded = ["type", "aria-label", "color", "size", "iconProps", "position",
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import React from 'react';
|
|
13
|
+
import { useEuiI18n } from '../i18n';
|
|
13
14
|
import { EuiIcon } from '../icon';
|
|
14
15
|
import { EuiToolTip } from './tool_tip';
|
|
15
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
17
|
export var EuiIconTip = function EuiIconTip(_ref) {
|
|
17
18
|
var _ref$type = _ref.type,
|
|
18
19
|
type = _ref$type === void 0 ? 'questionInCircle' : _ref$type,
|
|
19
|
-
|
|
20
|
-
ariaLabel = _ref$ariaLabel === void 0 ? 'Info' : _ref$ariaLabel,
|
|
20
|
+
ariaLabel = _ref['aria-label'],
|
|
21
21
|
color = _ref.color,
|
|
22
22
|
size = _ref.size,
|
|
23
23
|
iconProps = _ref.iconProps,
|
|
@@ -26,6 +26,7 @@ export var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
26
26
|
_ref$delay = _ref.delay,
|
|
27
27
|
delay = _ref$delay === void 0 ? 'regular' : _ref$delay,
|
|
28
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
|
+
var defaultAriaLabel = useEuiI18n('euiIconTip.defaultAriaLabel', 'Info');
|
|
29
30
|
return ___EmotionJSX(EuiToolTip, _extends({
|
|
30
31
|
position: position,
|
|
31
32
|
delay: delay
|
|
@@ -34,6 +35,6 @@ export var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
34
35
|
type: type,
|
|
35
36
|
color: color,
|
|
36
37
|
size: size,
|
|
37
|
-
"aria-label": ariaLabel
|
|
38
|
+
"aria-label": ariaLabel || defaultAriaLabel
|
|
38
39
|
}, iconProps)));
|
|
39
40
|
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
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; }
|
|
3
|
+
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) { _defineProperty(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; }
|
|
1
4
|
/*
|
|
2
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -6,10 +9,12 @@
|
|
|
6
9
|
* Side Public License, v 1.
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
|
-
import { useMemo } from 'react';
|
|
10
12
|
import { css } from '@emotion/react';
|
|
11
|
-
import { shade, tint, tintOrShade, transparentize,
|
|
13
|
+
import { shade, tint, tintOrShade, transparentize, useEuiMemoizedStyles } from '../../services';
|
|
12
14
|
export var BACKGROUND_COLORS = ['transparent', 'plain', 'subdued', 'accent', 'primary', 'success', 'warning', 'danger'];
|
|
15
|
+
/**
|
|
16
|
+
* @returns A single background color with optional alpha transparency
|
|
17
|
+
*/
|
|
13
18
|
export var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
|
|
14
19
|
var euiTheme = _ref.euiTheme,
|
|
15
20
|
colorMode = _ref.colorMode;
|
|
@@ -38,29 +43,51 @@ export var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
|
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @returns An object map of color keys to color values, categorized by
|
|
49
|
+
* opaque (default) vs transparency (hover/focus states) methods.
|
|
50
|
+
* e.g. {
|
|
51
|
+
* opaque: { danger: '#000', success: '#fff', ... },
|
|
52
|
+
* transparent: { danger: 'rgba(0,0,0,0.1)', success: 'rgba(255,255,255,0.1)', ... },
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
var _euiBackgroundColorMap = function _euiBackgroundColorMap(euiThemeContext) {
|
|
56
|
+
return {
|
|
57
|
+
opaque: BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
58
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, euiBackgroundColor(euiThemeContext, color)));
|
|
59
|
+
}, {}),
|
|
60
|
+
transparent: BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
61
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, euiBackgroundColor(euiThemeContext, color, {
|
|
62
|
+
method: 'transparent'
|
|
63
|
+
})));
|
|
64
|
+
}, {})
|
|
65
|
+
};
|
|
66
|
+
};
|
|
41
67
|
export var useEuiBackgroundColor = function useEuiBackgroundColor(color) {
|
|
42
68
|
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
43
69
|
method = _ref3.method;
|
|
44
|
-
var
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
70
|
+
var backgroundColorMap = useEuiMemoizedStyles(_euiBackgroundColorMap);
|
|
71
|
+
return backgroundColorMap[method || 'opaque'][color];
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @returns An object map of color keys to CSS,
|
|
76
|
+
* e.g. { danger: css``, success: css``, ... }
|
|
77
|
+
*/
|
|
78
|
+
var _euiBackgroundColors = function _euiBackgroundColors(euiThemeContext) {
|
|
79
|
+
return BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
80
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, color), ";label:", color, ";")));
|
|
81
|
+
}, {});
|
|
48
82
|
};
|
|
49
83
|
export var useEuiBackgroundColorCSS = function useEuiBackgroundColorCSS() {
|
|
50
|
-
|
|
51
|
-
return useMemo(function () {
|
|
52
|
-
return {
|
|
53
|
-
transparent: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
|
|
54
|
-
plain: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'plain'), ";;label:plain;"),
|
|
55
|
-
subdued: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
|
|
56
|
-
accent: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'accent'), ";;label:accent;"),
|
|
57
|
-
primary: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'primary'), ";;label:primary;"),
|
|
58
|
-
success: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'success'), ";;label:success;"),
|
|
59
|
-
warning: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'warning'), ";;label:warning;"),
|
|
60
|
-
danger: /*#__PURE__*/css("background-color:", euiBackgroundColor(euiThemeContext, 'danger'), ";;label:danger;")
|
|
61
|
-
};
|
|
62
|
-
}, [euiThemeContext]);
|
|
84
|
+
return useEuiMemoizedStyles(_euiBackgroundColors);
|
|
63
85
|
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Border colors
|
|
89
|
+
*/
|
|
90
|
+
|
|
64
91
|
export var euiBorderColor = function euiBorderColor(_ref4, color) {
|
|
65
92
|
var euiTheme = _ref4.euiTheme,
|
|
66
93
|
colorMode = _ref4.colorMode;
|
|
@@ -75,18 +102,16 @@ export var euiBorderColor = function euiBorderColor(_ref4, color) {
|
|
|
75
102
|
return tintOrShade(euiTheme.colors[color], 0.6, colorMode);
|
|
76
103
|
}
|
|
77
104
|
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @returns An object map of color keys to CSS,
|
|
108
|
+
* e.g. { danger: css``, success: css``, ... }
|
|
109
|
+
*/
|
|
110
|
+
var _euiBorderColors = function _euiBorderColors(euiThemeContext) {
|
|
111
|
+
return BACKGROUND_COLORS.reduce(function (acc, color) {
|
|
112
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, color), ";label:", color, ";")));
|
|
113
|
+
}, {});
|
|
114
|
+
};
|
|
78
115
|
export var useEuiBorderColorCSS = function useEuiBorderColorCSS() {
|
|
79
|
-
|
|
80
|
-
return useMemo(function () {
|
|
81
|
-
return {
|
|
82
|
-
transparent: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
|
|
83
|
-
plain: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'plain'), ";;label:plain;"),
|
|
84
|
-
subdued: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
|
|
85
|
-
accent: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'accent'), ";;label:accent;"),
|
|
86
|
-
primary: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'primary'), ";;label:primary;"),
|
|
87
|
-
success: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'success'), ";;label:success;"),
|
|
88
|
-
warning: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'warning'), ";;label:warning;"),
|
|
89
|
-
danger: /*#__PURE__*/css("border-color:", euiBorderColor(euiThemeContext, 'danger'), ";;label:danger;")
|
|
90
|
-
};
|
|
91
|
-
}, [euiThemeContext]);
|
|
116
|
+
return useEuiMemoizedStyles(_euiBorderColors);
|
|
92
117
|
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
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; }
|
|
4
|
+
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) { _defineProperty(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; }
|
|
1
5
|
/*
|
|
2
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
7
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -7,9 +11,12 @@
|
|
|
7
11
|
*/
|
|
8
12
|
|
|
9
13
|
import { css } from '@emotion/react';
|
|
10
|
-
import {
|
|
11
|
-
import { logicalSide } from '../functions';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../services/theme';
|
|
12
15
|
export var PADDING_SIZES = ['none', 'xs', 's', 'm', 'l', 'xl'];
|
|
16
|
+
/**
|
|
17
|
+
* Get a single padding size
|
|
18
|
+
*/
|
|
19
|
+
|
|
13
20
|
export var euiPaddingSize = function euiPaddingSize(_ref, size) {
|
|
14
21
|
var euiTheme = _ref.euiTheme;
|
|
15
22
|
switch (size) {
|
|
@@ -21,22 +28,51 @@ export var euiPaddingSize = function euiPaddingSize(_ref, size) {
|
|
|
21
28
|
return euiTheme.size[size];
|
|
22
29
|
}
|
|
23
30
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @returns An object map of padding size keys to padding values,
|
|
34
|
+
* e.g. { s: '8px', m: '16px', ... }
|
|
35
|
+
*/
|
|
36
|
+
var _getEuiPaddingSize = function _getEuiPaddingSize(euiThemeContext) {
|
|
37
|
+
return PADDING_SIZES.reduce(function (stylesAcc, size) {
|
|
38
|
+
return _objectSpread(_objectSpread({}, stylesAcc), {}, _defineProperty({}, size, size === 'none' ? null : euiPaddingSize(euiThemeContext, size)));
|
|
39
|
+
}, {});
|
|
34
40
|
};
|
|
35
41
|
export var useEuiPaddingSize = function useEuiPaddingSize(size) {
|
|
36
|
-
var
|
|
37
|
-
return
|
|
42
|
+
var sizes = useEuiMemoizedStyles(_getEuiPaddingSize);
|
|
43
|
+
return sizes[size];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @returns An object map of all padding sizes for all padding sides properties
|
|
48
|
+
* e.g., {
|
|
49
|
+
* padding: { s: css`padding-size: 8px`, ... }
|
|
50
|
+
* left: { s: css`padding-inline-start: 8px`, ... }
|
|
51
|
+
* }
|
|
52
|
+
*/
|
|
53
|
+
var _euiPaddingSidesAndSizes = function _euiPaddingSidesAndSizes(euiThemeContext) {
|
|
54
|
+
var sizesMap = _getEuiPaddingSize(euiThemeContext);
|
|
55
|
+
// The `_` prefix stops Emotion from applying the function name as a label
|
|
56
|
+
var _generateSizeStyles = function _generateSizeStyles(cssProperty) {
|
|
57
|
+
return Object.fromEntries(Object.entries(sizesMap).map(function (_ref2) {
|
|
58
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
59
|
+
sizeKey = _ref3[0],
|
|
60
|
+
sizeValue = _ref3[1];
|
|
61
|
+
return [sizeKey, sizeValue === null ? null : /*#__PURE__*/css(cssProperty, ":", sizeValue, ";label:", sizeKey, ";")];
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
var sidesMap = {
|
|
65
|
+
padding: _generateSizeStyles('padding'),
|
|
66
|
+
vertical: _generateSizeStyles('padding-block'),
|
|
67
|
+
top: _generateSizeStyles('padding-block-start'),
|
|
68
|
+
bottom: _generateSizeStyles('padding-block-end'),
|
|
69
|
+
horizontal: _generateSizeStyles('padding-inline'),
|
|
70
|
+
left: _generateSizeStyles('padding-inline-start'),
|
|
71
|
+
right: _generateSizeStyles('padding-inline-end')
|
|
72
|
+
};
|
|
73
|
+
return sidesMap;
|
|
38
74
|
};
|
|
39
75
|
export var useEuiPaddingCSS = function useEuiPaddingCSS(side) {
|
|
40
|
-
var
|
|
41
|
-
return
|
|
76
|
+
var memoizedSideMap = useEuiMemoizedStyles(_euiPaddingSidesAndSizes);
|
|
77
|
+
return memoizedSideMap[side || 'padding'];
|
|
42
78
|
};
|