@elastic/eui 102.1.0 → 102.2.0-snapshot.1748601905883
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_theme_borealis_dark.json +1 -1
- package/es/components/badge/color_utils.js +1 -3
- package/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/es/components/basic_table/basic_table.js +14 -10
- package/es/components/basic_table/in_memory_table.js +22 -17
- package/es/components/breadcrumbs/_breadcrumb_content.js +1 -1
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
- package/es/components/breadcrumbs/breadcrumbs.js +3 -3
- package/es/components/button/button_display/_button_display.js +1 -1
- package/es/components/button/button_display/_button_display.styles.js +11 -2
- package/es/components/button/button_display/_button_display_content.styles.js +6 -3
- package/es/components/button/button_empty/button_empty.styles.js +9 -12
- package/es/components/button/button_group/button_group.js +1 -1
- package/es/components/button/button_group/button_group.styles.js +5 -3
- package/es/components/button/button_group/button_group_button.js +19 -9
- package/es/components/button/button_group/button_group_button.styles.js +43 -19
- package/es/components/button/button_icon/button_icon.js +4 -2
- package/es/components/collapsible_nav/collapsible_nav.js +1 -0
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/es/components/color_picker/color_palette_display/color_palette_display.js +2 -2
- package/es/components/color_picker/color_palette_display/color_palette_display_fixed.js +1 -1
- package/es/components/color_picker/color_palette_display/color_palette_display_gradient.js +1 -1
- package/es/components/color_picker/color_palette_picker/color_palette_picker.js +4 -4
- package/es/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/es/components/comment_list/comment_list.js +1 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +9 -9
- package/es/components/datagrid/body/data_grid_body.js +14 -9
- package/es/components/datagrid/body/data_grid_body_custom.js +14 -9
- package/es/components/datagrid/body/data_grid_body_virtualized.js +58 -10
- package/es/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/es/components/datagrid/body/header/draggable_columns.js +1 -1
- package/es/components/datagrid/controls/column_sorting.js +6 -6
- package/es/components/datagrid/controls/column_sorting_draggable.js +3 -3
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/es/components/datagrid/utils/focus.js +2 -2
- package/es/components/datagrid/utils/in_memory.js +3 -3
- package/es/components/datagrid/utils/scrolling.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +4 -4
- package/es/components/filter_group/filter_button.js +88 -23
- package/es/components/filter_group/filter_button.styles.js +51 -15
- package/es/components/filter_group/filter_group.styles.js +18 -6
- package/es/components/form/range/dual_range.js +1 -1
- package/es/components/form/range/range.js +1 -1
- package/es/components/form/range/range_track.js +1 -1
- package/es/components/form/select/select.js +1 -1
- package/es/components/header/header.js +10 -10
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -3
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/icon/assets/logo_elastic.js +23 -17
- package/es/components/icon/icon.styles.js +1 -1
- package/es/components/key_pad_menu/key_pad_menu.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_elastic.styles.js +2 -2
- package/es/components/loading/loading_spinner.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +9 -4
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/popover/popover.js +1 -1
- package/es/components/responsive/hide_for.js +1 -1
- package/es/components/responsive/show_for.js +1 -1
- package/es/components/search_bar/filters/field_value_selection_filter.js +2 -1
- package/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/es/components/search_bar/filters/field_value_toggle_group_filter.js +4 -2
- package/es/components/search_bar/filters/is_filter.js +3 -1
- package/es/components/search_bar/search_bar.a11y.js +3 -3
- package/es/components/search_bar/search_bar.js +3 -3
- package/es/components/search_bar/search_filters.js +2 -2
- package/es/components/selectable/selectable.js +13 -12
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
- package/es/components/side_nav/side_nav.js +2 -2
- package/es/components/table/table_row_cell.js +1 -1
- package/es/components/timeline/timeline.js +1 -1
- package/es/components/toast/global_toast_list.js +27 -20
- package/es/components/tour/tour_step.js +1 -1
- package/es/global_styling/mixins/_button.js +95 -28
- package/es/services/theme/hooks.js +11 -0
- package/es/services/theme/index.js +3 -2
- package/es/services/theme/provider.js +28 -2
- package/es/services/theme/theme_variant.js +22 -0
- package/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/es/themes/amsterdam/theme.js +2 -1
- package/es/themes/json/eui_theme_amsterdam_dark.json +427 -0
- package/es/themes/json/eui_theme_amsterdam_light.json +427 -0
- package/es/themes/json/eui_theme_borealis_dark.json +427 -0
- package/es/themes/json/eui_theme_borealis_light.json +427 -0
- package/eui.d.ts +2034 -249
- package/lib/components/badge/color_utils.js +1 -3
- package/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/lib/components/basic_table/basic_table.js +14 -10
- package/lib/components/basic_table/in_memory_table.js +22 -17
- package/lib/components/breadcrumbs/_breadcrumb_content.js +1 -1
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
- package/lib/components/breadcrumbs/breadcrumbs.js +2 -2
- package/lib/components/button/button_display/_button_display.js +1 -1
- package/lib/components/button/button_display/_button_display.styles.js +11 -2
- package/lib/components/button/button_display/_button_display_content.styles.js +6 -3
- package/lib/components/button/button_empty/button_empty.styles.js +10 -11
- package/lib/components/button/button_group/button_group.js +1 -1
- package/lib/components/button/button_group/button_group.styles.js +5 -3
- package/lib/components/button/button_group/button_group_button.js +18 -8
- package/lib/components/button/button_group/button_group_button.styles.js +41 -17
- package/lib/components/button/button_icon/button_icon.js +3 -1
- package/lib/components/collapsible_nav/collapsible_nav.js +1 -0
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/lib/components/color_picker/color_palette_display/color_palette_display.js +2 -2
- package/lib/components/color_picker/color_palette_display/color_palette_display_fixed.js +1 -1
- package/lib/components/color_picker/color_palette_display/color_palette_display_gradient.js +1 -1
- package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +4 -4
- package/lib/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/lib/components/comment_list/comment_list.js +1 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +9 -9
- package/lib/components/datagrid/body/data_grid_body.js +14 -9
- package/lib/components/datagrid/body/data_grid_body_custom.js +14 -9
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +58 -10
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/lib/components/datagrid/body/header/draggable_columns.js +1 -1
- package/lib/components/datagrid/controls/column_sorting.js +6 -6
- package/lib/components/datagrid/controls/column_sorting_draggable.js +3 -3
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/lib/components/datagrid/utils/focus.js +1 -1
- package/lib/components/datagrid/utils/in_memory.js +3 -3
- package/lib/components/datagrid/utils/scrolling.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +4 -4
- package/lib/components/empty_prompt/images/illustration.svg +939 -0
- package/lib/components/filter_group/filter_button.js +86 -21
- package/lib/components/filter_group/filter_button.styles.js +51 -15
- package/lib/components/filter_group/filter_group.styles.js +18 -6
- package/lib/components/form/range/dual_range.js +1 -1
- package/lib/components/form/range/range.js +1 -1
- package/lib/components/form/range/range_track.js +1 -1
- package/lib/components/form/select/select.js +1 -1
- package/lib/components/header/header.js +10 -10
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +2 -2
- package/lib/components/icon/assets/logo_elastic.js +23 -17
- package/lib/components/icon/icon.styles.js +1 -1
- package/lib/components/icon/svgs/logo_elastic.svg +7 -9
- package/lib/components/key_pad_menu/key_pad_menu.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_elastic.styles.js +2 -2
- package/lib/components/loading/loading_spinner.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +8 -3
- package/lib/components/popover/popover.js +1 -1
- package/lib/components/responsive/hide_for.js +1 -1
- package/lib/components/responsive/show_for.js +1 -1
- package/lib/components/search_bar/filters/field_value_selection_filter.js +2 -1
- package/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/lib/components/search_bar/filters/field_value_toggle_group_filter.js +4 -2
- package/lib/components/search_bar/filters/is_filter.js +3 -1
- package/lib/components/search_bar/search_bar.a11y.js +3 -3
- package/lib/components/search_bar/search_bar.js +3 -3
- package/lib/components/search_bar/search_filters.js +2 -2
- package/lib/components/selectable/selectable.js +13 -12
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
- package/lib/components/side_nav/side_nav.js +2 -2
- package/lib/components/table/table_row_cell.js +1 -1
- package/lib/components/timeline/timeline.js +1 -1
- package/lib/components/toast/global_toast_list.js +27 -20
- package/lib/global_styling/mixins/_button.js +94 -27
- package/lib/services/theme/hooks.js +12 -1
- package/lib/services/theme/index.js +48 -1
- package/lib/services/theme/provider.js +28 -2
- package/lib/services/theme/theme_variant.js +28 -0
- package/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/lib/themes/amsterdam/theme.js +2 -1
- package/lib/themes/json/eui_theme_amsterdam_dark.json +427 -0
- package/lib/themes/json/eui_theme_amsterdam_light.json +427 -0
- package/lib/themes/json/eui_theme_borealis_dark.json +427 -0
- package/lib/themes/json/eui_theme_borealis_light.json +427 -0
- package/optimize/es/components/badge/color_utils.js +1 -3
- package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
- package/optimize/es/components/button/button_display/_button_display.js +1 -1
- package/optimize/es/components/button/button_display/_button_display.styles.js +11 -2
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +6 -3
- package/optimize/es/components/button/button_empty/button_empty.styles.js +9 -12
- package/optimize/es/components/button/button_group/button_group.styles.js +5 -3
- package/optimize/es/components/button/button_group/button_group_button.js +12 -8
- package/optimize/es/components/button/button_group/button_group_button.styles.js +43 -19
- package/optimize/es/components/button/button_icon/button_icon.js +4 -2
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +44 -1
- package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/optimize/es/components/datagrid/utils/focus.js +2 -2
- package/optimize/es/components/datagrid/utils/scrolling.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -2
- package/optimize/es/components/filter_group/filter_button.js +78 -21
- package/optimize/es/components/filter_group/filter_button.styles.js +51 -15
- package/optimize/es/components/filter_group/filter_group.styles.js +18 -6
- package/optimize/es/components/form/select/select.js +1 -1
- package/optimize/es/components/icon/assets/logo_elastic.js +23 -17
- package/optimize/es/components/icon/icon.styles.js +1 -1
- package/optimize/es/components/loading/loading_elastic.styles.js +2 -2
- package/optimize/es/components/markdown_editor/markdown_editor_footer.js +9 -4
- package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +1 -0
- package/optimize/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/optimize/es/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
- package/optimize/es/components/search_bar/filters/is_filter.js +3 -1
- package/optimize/es/components/search_bar/search_bar.a11y.js +3 -3
- package/optimize/es/components/selectable/selectable.js +10 -9
- package/optimize/es/components/toast/global_toast_list.js +24 -20
- package/optimize/es/global_styling/mixins/_button.js +95 -28
- package/optimize/es/services/theme/hooks.js +11 -0
- package/optimize/es/services/theme/index.js +3 -2
- package/optimize/es/services/theme/provider.js +28 -2
- package/optimize/es/services/theme/theme_variant.js +22 -0
- package/optimize/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/optimize/es/themes/amsterdam/theme.js +2 -1
- package/optimize/es/themes/json/eui_theme_amsterdam_dark.json +427 -0
- package/optimize/es/themes/json/eui_theme_amsterdam_light.json +427 -0
- package/optimize/es/themes/json/eui_theme_borealis_dark.json +427 -0
- package/optimize/es/themes/json/eui_theme_borealis_light.json +427 -0
- package/optimize/lib/components/badge/color_utils.js +1 -3
- package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
- package/optimize/lib/components/button/button_display/_button_display.js +1 -1
- package/optimize/lib/components/button/button_display/_button_display.styles.js +11 -2
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +6 -3
- package/optimize/lib/components/button/button_empty/button_empty.styles.js +10 -11
- package/optimize/lib/components/button/button_group/button_group.styles.js +5 -3
- package/optimize/lib/components/button/button_group/button_group_button.js +11 -7
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +41 -17
- package/optimize/lib/components/button/button_icon/button_icon.js +3 -1
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +44 -1
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/optimize/lib/components/datagrid/utils/focus.js +1 -1
- package/optimize/lib/components/datagrid/utils/scrolling.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -2
- package/optimize/lib/components/empty_prompt/images/illustration.svg +939 -0
- package/optimize/lib/components/filter_group/filter_button.js +76 -19
- package/optimize/lib/components/filter_group/filter_button.styles.js +51 -15
- package/optimize/lib/components/filter_group/filter_group.styles.js +18 -6
- package/optimize/lib/components/form/select/select.js +1 -1
- package/optimize/lib/components/icon/assets/logo_elastic.js +23 -17
- package/optimize/lib/components/icon/icon.styles.js +1 -1
- package/optimize/lib/components/icon/svgs/logo_elastic.svg +7 -9
- package/optimize/lib/components/loading/loading_elastic.styles.js +2 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +8 -3
- package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +1 -0
- package/optimize/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/optimize/lib/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
- package/optimize/lib/components/search_bar/filters/is_filter.js +3 -1
- package/optimize/lib/components/search_bar/search_bar.a11y.js +3 -3
- package/optimize/lib/components/selectable/selectable.js +10 -9
- package/optimize/lib/components/toast/global_toast_list.js +24 -20
- package/optimize/lib/global_styling/mixins/_button.js +94 -27
- package/optimize/lib/services/theme/hooks.js +12 -1
- package/optimize/lib/services/theme/index.js +48 -1
- package/optimize/lib/services/theme/provider.js +28 -2
- package/optimize/lib/services/theme/theme_variant.js +28 -0
- package/optimize/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/optimize/lib/themes/amsterdam/theme.js +2 -1
- package/optimize/lib/themes/json/eui_theme_amsterdam_dark.json +427 -0
- package/optimize/lib/themes/json/eui_theme_amsterdam_light.json +427 -0
- package/optimize/lib/themes/json/eui_theme_borealis_dark.json +427 -0
- package/optimize/lib/themes/json/eui_theme_borealis_light.json +427 -0
- package/package.json +8 -9
- package/test-env/components/badge/color_utils.js +1 -3
- package/test-env/components/badge/notification_badge/badge_notification.styles.js +6 -1
- package/test-env/components/basic_table/basic_table.js +14 -10
- package/test-env/components/basic_table/in_memory_table.js +22 -17
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +1 -1
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
- package/test-env/components/breadcrumbs/breadcrumbs.js +2 -2
- package/test-env/components/button/button_display/_button_display.js +1 -1
- package/test-env/components/button/button_display/_button_display.styles.js +11 -2
- package/test-env/components/button/button_display/_button_display_content.styles.js +6 -3
- package/test-env/components/button/button_empty/button_empty.styles.js +10 -11
- package/test-env/components/button/button_group/button_group.js +1 -1
- package/test-env/components/button/button_group/button_group.styles.js +5 -3
- package/test-env/components/button/button_group/button_group_button.js +18 -8
- package/test-env/components/button/button_group/button_group_button.styles.js +41 -17
- package/test-env/components/button/button_icon/button_icon.js +3 -1
- package/test-env/components/collapsible_nav/collapsible_nav.js +1 -0
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
- package/test-env/components/color_picker/color_palette_display/color_palette_display.js +2 -2
- package/test-env/components/color_picker/color_palette_display/color_palette_display_fixed.js +1 -1
- package/test-env/components/color_picker/color_palette_display/color_palette_display_gradient.js +1 -1
- package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +4 -4
- package/test-env/components/combo_box/combo_box_options_list/combo_box_options_list.js +1 -1
- package/test-env/components/comment_list/comment_list.js +1 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +9 -9
- package/test-env/components/datagrid/body/data_grid_body.js +14 -9
- package/test-env/components/datagrid/body/data_grid_body_custom.js +14 -9
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +58 -10
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +3 -3
- package/test-env/components/datagrid/body/header/draggable_columns.js +1 -1
- package/test-env/components/datagrid/controls/column_sorting.js +6 -6
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +3 -3
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
- package/test-env/components/datagrid/utils/focus.js +1 -1
- package/test-env/components/datagrid/utils/in_memory.js +3 -3
- package/test-env/components/datagrid/utils/scrolling.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +4 -4
- package/test-env/components/filter_group/filter_button.js +86 -21
- package/test-env/components/filter_group/filter_button.styles.js +51 -15
- package/test-env/components/filter_group/filter_group.styles.js +18 -6
- package/test-env/components/form/range/dual_range.js +1 -1
- package/test-env/components/form/range/range.js +1 -1
- package/test-env/components/form/range/range_track.js +1 -1
- package/test-env/components/form/select/select.js +1 -1
- package/test-env/components/header/header.js +10 -10
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +2 -2
- package/test-env/components/icon/assets/logo_elastic.js +23 -17
- package/test-env/components/icon/icon.styles.js +1 -1
- package/test-env/components/key_pad_menu/key_pad_menu.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_elastic.styles.js +2 -2
- package/test-env/components/loading/loading_spinner.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +8 -3
- package/test-env/components/popover/popover.js +1 -1
- package/test-env/components/responsive/hide_for.js +1 -1
- package/test-env/components/responsive/show_for.js +1 -1
- package/test-env/components/search_bar/filters/field_value_selection_filter.js +2 -1
- package/test-env/components/search_bar/filters/field_value_toggle_filter.js +3 -1
- package/test-env/components/search_bar/filters/field_value_toggle_group_filter.js +4 -2
- package/test-env/components/search_bar/filters/is_filter.js +3 -1
- package/test-env/components/search_bar/search_bar.a11y.js +3 -3
- package/test-env/components/search_bar/search_bar.js +3 -3
- package/test-env/components/search_bar/search_filters.js +2 -2
- package/test-env/components/selectable/selectable.js +13 -12
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
- package/test-env/components/side_nav/side_nav.js +2 -2
- package/test-env/components/table/table_row_cell.js +1 -1
- package/test-env/components/timeline/timeline.js +1 -1
- package/test-env/components/toast/global_toast_list.js +24 -20
- package/test-env/global_styling/mixins/_button.js +94 -27
- package/test-env/services/theme/hooks.js +12 -1
- package/test-env/services/theme/index.js +48 -1
- package/test-env/services/theme/provider.js +28 -2
- package/test-env/services/theme/theme_variant.js +28 -0
- package/test-env/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
- package/test-env/themes/amsterdam/global_styling/variables/_components.js +229 -224
- package/test-env/themes/amsterdam/theme.js +2 -1
- package/test-env/themes/json/eui_theme_amsterdam_dark.json +427 -0
- package/test-env/themes/json/eui_theme_amsterdam_light.json +427 -0
- package/test-env/themes/json/eui_theme_borealis_dark.json +427 -0
- package/test-env/themes/json/eui_theme_borealis_light.json +427 -0
|
@@ -189,7 +189,7 @@ describe('EuiSearchBar', function () {
|
|
|
189
189
|
cy.checkAxe();
|
|
190
190
|
});
|
|
191
191
|
it('has zero violations after filtering on Open items', function () {
|
|
192
|
-
cy.get('button.
|
|
192
|
+
cy.get('button.euiFilterButton').first().focus();
|
|
193
193
|
cy.realPress('Enter');
|
|
194
194
|
cy.get('table.euiTable tbody').find('tr').should('have.length', 3);
|
|
195
195
|
cy.checkAxe();
|
|
@@ -200,12 +200,12 @@ describe('EuiSearchBar', function () {
|
|
|
200
200
|
cy.checkAxe();
|
|
201
201
|
});
|
|
202
202
|
it('has zero violations after filtering by Tags', function () {
|
|
203
|
-
cy.get('button.
|
|
203
|
+
cy.get('button.euiFilterButton').last().focus();
|
|
204
204
|
cy.realPress('Enter');
|
|
205
205
|
cy.realPress('ArrowDown');
|
|
206
206
|
cy.realPress('Enter');
|
|
207
207
|
cy.realPress('Escape');
|
|
208
|
-
cy.get('button.
|
|
208
|
+
cy.get('button.euiFilterButton').last().should('have.focus');
|
|
209
209
|
cy.get('table.euiTable tbody').find('tr').should('have.length', 3);
|
|
210
210
|
cy.checkAxe();
|
|
211
211
|
cy.repeatRealPress(['Shift', 'Tab'], 3);
|
|
@@ -310,7 +310,7 @@ EuiSearchBar.propTypes = {
|
|
|
310
310
|
}).isRequired, PropTypes.bool.isRequired])
|
|
311
311
|
}),
|
|
312
312
|
/**
|
|
313
|
-
An array of search filters. See
|
|
313
|
+
An array of search filters. See {@link SearchFilterConfig}.
|
|
314
314
|
*/
|
|
315
315
|
filters: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.shape({
|
|
316
316
|
type: PropTypes.oneOf(["is"]).isRequired,
|
|
@@ -323,7 +323,7 @@ EuiSearchBar.propTypes = {
|
|
|
323
323
|
field: PropTypes.string,
|
|
324
324
|
name: PropTypes.string.isRequired,
|
|
325
325
|
/**
|
|
326
|
-
* See
|
|
326
|
+
* See {@link FieldValueOptionType}
|
|
327
327
|
*/
|
|
328
328
|
options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
329
329
|
field: PropTypes.string,
|
|
@@ -379,7 +379,7 @@ EuiSearchBar.propTypes = {
|
|
|
379
379
|
type: PropTypes.oneOf(["field_value_toggle_group"]).isRequired,
|
|
380
380
|
field: PropTypes.string.isRequired,
|
|
381
381
|
/**
|
|
382
|
-
* See
|
|
382
|
+
* See {@link FieldValueToggleGroupFilterItemType}
|
|
383
383
|
*/
|
|
384
384
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
385
385
|
value: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired, PropTypes.bool.isRequired]).isRequired,
|
|
@@ -71,7 +71,7 @@ EuiSearchBarFilters.propTypes = {
|
|
|
71
71
|
field: PropTypes.string,
|
|
72
72
|
name: PropTypes.string.isRequired,
|
|
73
73
|
/**
|
|
74
|
-
* See
|
|
74
|
+
* See {@link FieldValueOptionType}
|
|
75
75
|
*/
|
|
76
76
|
options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.shape({
|
|
77
77
|
field: PropTypes.string,
|
|
@@ -127,7 +127,7 @@ EuiSearchBarFilters.propTypes = {
|
|
|
127
127
|
type: PropTypes.oneOf(["field_value_toggle_group"]).isRequired,
|
|
128
128
|
field: PropTypes.string.isRequired,
|
|
129
129
|
/**
|
|
130
|
-
* See
|
|
130
|
+
* See {@link FieldValueToggleGroupFilterItemType}
|
|
131
131
|
*/
|
|
132
132
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
133
133
|
value: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.number.isRequired, PropTypes.bool.isRequired]).isRequired,
|
|
@@ -48,15 +48,16 @@ import { EuiSelectableList } from './selectable_list';
|
|
|
48
48
|
import { createPartialStringEqualityOptionMatcher, getMatchingOptions } from './matching_options';
|
|
49
49
|
import { euiSelectableStyles as styles } from './selectable.styles';
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
/**
|
|
52
|
+
* The `searchable` prop has significant implications for a11y. When present, we effectively change from adhering to the
|
|
53
|
+
* - ARIA `listbox` spec (@see https://www.w3.org/TR/wai-aria-practices-1.2/#Listbox)
|
|
54
|
+
* - ARIA `combobox` spec (@see https://www.w3.org/TR/wai-aria-practices-1.2/#combobox)
|
|
55
|
+
*
|
|
56
|
+
* and (re)implement all relevant attributes and keyboard interactions.
|
|
57
|
+
* Take note of logic that relies on `searchable` to ensure that any modifications remain in alignment.
|
|
58
|
+
*
|
|
59
|
+
* `searchProps` can only be specified when `searchable` is `true`.
|
|
60
|
+
*/
|
|
60
61
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
61
62
|
export var EuiSelectable = /*#__PURE__*/function (_Component) {
|
|
62
63
|
function EuiSelectable(props) {
|
|
@@ -592,7 +593,7 @@ EuiSelectable.propTypes = {
|
|
|
592
593
|
searchable: PropTypes.oneOfType([PropTypes.oneOf([false]).isRequired, PropTypes.oneOf([true]).isRequired]).isRequired,
|
|
593
594
|
/**
|
|
594
595
|
* Passes props down to the `EuiFieldSearch`.
|
|
595
|
-
*
|
|
596
|
+
* {@link EuiSelectableSearchProps}
|
|
596
597
|
*/
|
|
597
598
|
searchProps: PropTypes.any,
|
|
598
599
|
/**
|
|
@@ -601,7 +602,7 @@ EuiSelectable.propTypes = {
|
|
|
601
602
|
*/
|
|
602
603
|
children: PropTypes.func,
|
|
603
604
|
/**
|
|
604
|
-
* Array of EuiSelectableOption objects. See
|
|
605
|
+
* Array of EuiSelectableOption objects. See {@link EuiSelectableOption}
|
|
605
606
|
*/
|
|
606
607
|
options: PropTypes.arrayOf(PropTypes.shape({
|
|
607
608
|
/**
|
|
@@ -706,7 +707,7 @@ EuiSelectable.propTypes = {
|
|
|
706
707
|
*/
|
|
707
708
|
height: PropTypes.oneOfType([PropTypes.number.isRequired, PropTypes.oneOf(["full"])]),
|
|
708
709
|
/**
|
|
709
|
-
* See
|
|
710
|
+
* See {@link EuiSelectableOptionsListPropsWithDefaults}
|
|
710
711
|
*/
|
|
711
712
|
listProps: PropTypes.any,
|
|
712
713
|
/**
|
|
@@ -227,8 +227,8 @@ export var EuiSelectableTemplateSitewide = function EuiSelectableTemplateSitewid
|
|
|
227
227
|
};
|
|
228
228
|
EuiSelectableTemplateSitewide.propTypes = {
|
|
229
229
|
/**
|
|
230
|
-
* Extends the typical
|
|
231
|
-
* such as `icon`, `avatar`and `meta`
|
|
230
|
+
* Extends the typical EuiSelectable {@link EuiSelectableTemplateSitewideOption} with the addition of pre-composed elements
|
|
231
|
+
* such as `icon`, `avatar` and `meta`
|
|
232
232
|
*/
|
|
233
233
|
options: PropTypes.arrayOf(PropTypes.shape({
|
|
234
234
|
/**
|
|
@@ -326,7 +326,7 @@ EuiSelectableTemplateSitewide.propTypes = {
|
|
|
326
326
|
isDisabled: PropTypes.bool
|
|
327
327
|
}),
|
|
328
328
|
/**
|
|
329
|
-
* An array of inline
|
|
329
|
+
* An array of inline {@link EuiSelectableTemplateSitewideMetaData} displayed beneath the label and separated by bullets.
|
|
330
330
|
*/
|
|
331
331
|
meta: PropTypes.arrayOf(PropTypes.shape({
|
|
332
332
|
/**
|
|
@@ -200,7 +200,7 @@ EuiSideNavClass.propTypes = {
|
|
|
200
200
|
*/
|
|
201
201
|
heading: PropTypes.node,
|
|
202
202
|
/**
|
|
203
|
-
* Adds a couple extra
|
|
203
|
+
* Adds a couple extra {@link EuiSideNavHeading} props and extends the props of EuiTitle that wraps the `heading`
|
|
204
204
|
*/
|
|
205
205
|
headingProps: PropTypes.any,
|
|
206
206
|
/**
|
|
@@ -221,7 +221,7 @@ EuiSideNavClass.propTypes = {
|
|
|
221
221
|
*/
|
|
222
222
|
mobileBreakpoints: PropTypes.arrayOf(PropTypes.any.isRequired),
|
|
223
223
|
/**
|
|
224
|
-
* An array of
|
|
224
|
+
* An array of {@link EuiSideNavItem} objects. Lists navigation menu items.
|
|
225
225
|
*/
|
|
226
226
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
227
227
|
/**
|
|
@@ -124,7 +124,7 @@ EuiTableRowCell.propTypes = {
|
|
|
124
124
|
isExpander: PropTypes.bool,
|
|
125
125
|
/**
|
|
126
126
|
* Mobile options for displaying differently at small screens;
|
|
127
|
-
* See
|
|
127
|
+
* See {@link EuiTableRowCellMobileOptionsShape}
|
|
128
128
|
*/
|
|
129
129
|
mobileOptions: PropTypes.shape({
|
|
130
130
|
/**
|
|
@@ -45,7 +45,7 @@ export var EuiTimeline = function EuiTimeline(_ref) {
|
|
|
45
45
|
};
|
|
46
46
|
EuiTimeline.propTypes = {
|
|
47
47
|
/**
|
|
48
|
-
* List of timeline items to render. See
|
|
48
|
+
* List of timeline items to render. See {@link EuiTimelineItem}
|
|
49
49
|
*/
|
|
50
50
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
51
51
|
/**
|
|
@@ -7,6 +7,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
8
8
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
10
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
11
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
13
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
10
14
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
11
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
16
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -58,10 +62,10 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
58
62
|
_useState2 = _slicedToArray(_useState, 2),
|
|
59
63
|
toastIdToDismissedMap = _useState2[0],
|
|
60
64
|
setToastIdToDismissedMap = _useState2[1];
|
|
61
|
-
var _useState3 = useState(),
|
|
65
|
+
var _useState3 = useState([]),
|
|
62
66
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
toastsToDismiss = _useState4[0],
|
|
68
|
+
setToastsToDismiss = _useState4[1];
|
|
65
69
|
var prevToasts = useRef([]);
|
|
66
70
|
var dismissTimeoutIds = useRef([]);
|
|
67
71
|
var toastIdToTimerMap = useRef({});
|
|
@@ -135,7 +139,9 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
135
139
|
var dismissToast = useCallback(function (toast) {
|
|
136
140
|
// Remove the toast after it's done fading out.
|
|
137
141
|
dismissTimeoutIds.current.push(window.setTimeout(function () {
|
|
138
|
-
|
|
142
|
+
setToastsToDismiss(function (toasts) {
|
|
143
|
+
return [].concat(_toConsumableArray(toasts), [toast]);
|
|
144
|
+
});
|
|
139
145
|
}, TOAST_FADE_OUT_MS));
|
|
140
146
|
setToastIdToDismissedMap(function (prev) {
|
|
141
147
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, toast.id, true));
|
|
@@ -205,22 +211,23 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
|
|
|
205
211
|
// Toast dismissal side effect
|
|
206
212
|
// Ensure the callback has correct state by not enclosing it in `setTimeout`
|
|
207
213
|
useEffect(function () {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
214
|
+
toastsToDismiss.forEach(function (toast) {
|
|
215
|
+
// Because this is triggered by a setTimeout, and because React does not guarantee when
|
|
216
|
+
// state updates happen, it is possible to double-dismiss a toast
|
|
217
|
+
// including by double-clicking the "x" button on the toast
|
|
218
|
+
// so, first check to make sure we haven't already dismissed this toast
|
|
219
|
+
if (toast && toastIdToTimerMap.current.hasOwnProperty(toast.id)) {
|
|
220
|
+
dismissToastProp(toast);
|
|
221
|
+
toastIdToTimerMap.current[toast.id].clear();
|
|
222
|
+
delete toastIdToTimerMap.current[toast.id];
|
|
223
|
+
setToastIdToDismissedMap(function (prev) {
|
|
224
|
+
var toastIdToDismissedMap = _objectSpread({}, prev);
|
|
225
|
+
delete toastIdToDismissedMap[toast.id];
|
|
226
|
+
return toastIdToDismissedMap;
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}, [toastsToDismiss, dismissToastProp]);
|
|
224
231
|
var renderedToasts = useMemo(function () {
|
|
225
232
|
return toasts.map(function (toast) {
|
|
226
233
|
var text = toast.text,
|
|
@@ -207,7 +207,7 @@ EuiTourStep.propTypes = {
|
|
|
207
207
|
*/
|
|
208
208
|
panelStyle: PropTypes.any,
|
|
209
209
|
/**
|
|
210
|
-
* Object of props passed to EuiPanel. See
|
|
210
|
+
* Object of props passed to EuiPanel. See {@link EuiPopoverPanelProps}
|
|
211
211
|
*/
|
|
212
212
|
panelProps: PropTypes.shape({
|
|
213
213
|
element: PropTypes.oneOf(["div"]),
|
|
@@ -21,14 +21,34 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { css, keyframes } from '@emotion/react';
|
|
24
|
-
import { getTokenName, euiCanAnimate } from '@elastic/eui-theme-common';
|
|
25
|
-
import { makeHighContrastColor, useEuiMemoizedStyles } from '../../services';
|
|
24
|
+
import { getTokenName, euiCanAnimate, mathWithUnits } from '@elastic/eui-theme-common';
|
|
25
|
+
import { makeHighContrastColor, useEuiMemoizedStyles, isEuiThemeRefreshVariant } from '../../services';
|
|
26
|
+
import { highContrastModeStyles, logicalCSS } from '../functions';
|
|
26
27
|
|
|
27
28
|
/** Tentative usage; these exist only to be used as button directly when used within other components */
|
|
28
29
|
export var SEVERITY_COLORS = ['neutral', 'risk'];
|
|
29
30
|
export var BUTTON_COLORS = ['text', 'accent', 'accentSecondary', 'primary', 'success', 'warning', 'danger'];
|
|
30
31
|
export var EXTENDED_BUTTON_COLORS = [].concat(BUTTON_COLORS, SEVERITY_COLORS);
|
|
31
32
|
export var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
|
|
33
|
+
var getButtonVariantTokenValues = function getButtonVariantTokenValues(_ref, color, variant) {
|
|
34
|
+
var euiTheme = _ref.euiTheme,
|
|
35
|
+
highContrastMode = _ref.highContrastMode;
|
|
36
|
+
var backgroundTokenBase = variant === 'base' ? 'background' : "background".concat(variant.charAt(0).toUpperCase() + variant.slice(1));
|
|
37
|
+
var textTokenBase = variant === 'filled' ? 'textColorFilled' : 'textColor';
|
|
38
|
+
var backgroundTokenName = getTokenName(backgroundTokenBase, color);
|
|
39
|
+
var textTokenName = getTokenName(textTokenBase, color);
|
|
40
|
+
var backgroundHoverTokenName = getTokenName(backgroundTokenBase, color, 'hover');
|
|
41
|
+
var backgroundActiveTokenName = getTokenName(backgroundTokenBase, color, 'active');
|
|
42
|
+
var highContrastForeground = ['warning', 'neutral', 'risk'].includes(color) ? euiTheme.colors.ink : color === 'disabled' ? euiTheme.components.buttons[textTokenName] : euiTheme.colors.textInverse;
|
|
43
|
+
var foreground = variant === 'filled' ? highContrastMode ? highContrastForeground : euiTheme.components.buttons[textTokenName] : euiTheme.components.buttons[textTokenName];
|
|
44
|
+
return {
|
|
45
|
+
color: foreground,
|
|
46
|
+
background: euiTheme.components.buttons[backgroundTokenName],
|
|
47
|
+
backgroundHover: euiTheme.components.buttons[backgroundHoverTokenName],
|
|
48
|
+
backgroundActive: euiTheme.components.buttons[backgroundActiveTokenName]
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
32
52
|
/**
|
|
33
53
|
* Creates the `base` version of button styles with proper text contrast.
|
|
34
54
|
* @param euiThemeContext
|
|
@@ -36,11 +56,9 @@ export var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
|
|
|
36
56
|
* @returns Style object `{ backgroundColor, color }`
|
|
37
57
|
*/
|
|
38
58
|
export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var foreground = euiTheme.components.buttons[textTokenName];
|
|
43
|
-
var background = euiTheme.components.buttons[backgroundTokenName];
|
|
59
|
+
var buttonColors = getButtonVariantTokenValues(euiThemeContext, color, 'base');
|
|
60
|
+
var foreground = buttonColors.color;
|
|
61
|
+
var background = buttonColors.background;
|
|
44
62
|
return _objectSpread({
|
|
45
63
|
color: background === 'transparent' || color === 'disabled' ? foreground : makeHighContrastColor(foreground)(background),
|
|
46
64
|
backgroundColor: background
|
|
@@ -54,13 +72,9 @@ export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
|
54
72
|
* @returns Style object `{ backgroundColor, color }`
|
|
55
73
|
*/
|
|
56
74
|
export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
|
|
57
|
-
var
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
var textColorTokenName = getTokenName('textColorFilled', color);
|
|
61
|
-
var highContrastForeground = ['warning', 'neutral', 'risk'].includes(color) ? euiTheme.colors.ink : color === 'disabled' ? euiTheme.components.buttons[textColorTokenName] : euiTheme.colors.textInverse;
|
|
62
|
-
var foreground = highContrastMode ? highContrastForeground : euiTheme.components.buttons[textColorTokenName];
|
|
63
|
-
var background = euiTheme.components.buttons[backgroundTokenName];
|
|
75
|
+
var buttonColors = getButtonVariantTokenValues(euiThemeContext, color, 'filled');
|
|
76
|
+
var foreground = buttonColors.color;
|
|
77
|
+
var background = buttonColors.background;
|
|
64
78
|
return _objectSpread({
|
|
65
79
|
color: foreground,
|
|
66
80
|
backgroundColor: background
|
|
@@ -84,9 +98,9 @@ export var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, c
|
|
|
84
98
|
break;
|
|
85
99
|
default:
|
|
86
100
|
{
|
|
87
|
-
var
|
|
101
|
+
var buttonColors = getButtonVariantTokenValues(euiThemeContext, color, 'empty');
|
|
88
102
|
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
89
|
-
background =
|
|
103
|
+
background = buttonColors.backgroundHover;
|
|
90
104
|
break;
|
|
91
105
|
}
|
|
92
106
|
}
|
|
@@ -109,6 +123,8 @@ export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
|
|
|
109
123
|
return colorsDisplaysMap[display];
|
|
110
124
|
};
|
|
111
125
|
var euiButtonDisplaysColors = function euiButtonDisplaysColors(euiThemeContext) {
|
|
126
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
127
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
112
128
|
var COLORS = [].concat(_toConsumableArray(EXTENDED_BUTTON_COLORS), ['disabled']);
|
|
113
129
|
var displaysColorsMap = {};
|
|
114
130
|
BUTTON_DISPLAYS.forEach(function (display) {
|
|
@@ -116,14 +132,28 @@ var euiButtonDisplaysColors = function euiButtonDisplaysColors(euiThemeContext)
|
|
|
116
132
|
COLORS.forEach(function (color) {
|
|
117
133
|
switch (display) {
|
|
118
134
|
case 'base':
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
{
|
|
136
|
+
var buttonColors = getButtonVariantTokenValues(euiThemeContext, color, 'base');
|
|
137
|
+
var borderStyle = color === 'text' && "\n border: ".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.borderBasePlain, ";\n ");
|
|
138
|
+
var refreshVariantStyles = isRefreshVariant && "\n ".concat(_interactionStyles(euiThemeContext, buttonColors, 'overlay'), "\n ").concat(borderStyle, "\n ");
|
|
139
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonColor(euiThemeContext, color), " ", refreshVariantStyles, ";;label:displaysColorsMap-display-color;");
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
121
142
|
case 'fill':
|
|
122
|
-
|
|
123
|
-
|
|
143
|
+
{
|
|
144
|
+
var _buttonColors = getButtonVariantTokenValues(euiThemeContext, color, 'filled');
|
|
145
|
+
var _refreshVariantStyles = isRefreshVariant && _interactionStyles(euiThemeContext, _buttonColors);
|
|
146
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";", _refreshVariantStyles, ";;label:displaysColorsMap-display-color;");
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
124
149
|
case 'empty':
|
|
125
|
-
|
|
126
|
-
|
|
150
|
+
{
|
|
151
|
+
var _buttonColors2 = getButtonVariantTokenValues(euiThemeContext, color, 'empty');
|
|
152
|
+
var classicVariantStyles = !isRefreshVariant && "\n &:focus,\n &:active {\n background-color: ".concat(euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";\n }\n ");
|
|
153
|
+
var _refreshVariantStyles2 = isRefreshVariant && _interactionStyles(euiThemeContext, _buttonColors2, 'overlay');
|
|
154
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";", classicVariantStyles, " ", _refreshVariantStyles2, ";;label:displaysColorsMap-display-color;");
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
127
157
|
}
|
|
128
158
|
|
|
129
159
|
// Tweak auto-generated Emotion label/className output
|
|
@@ -142,9 +172,10 @@ export var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
|
|
|
142
172
|
return useEuiMemoizedStyles(euiButtonFocusCSS);
|
|
143
173
|
};
|
|
144
174
|
var euiButtonFocusAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 50% {\n transform: translateY(1px);\n }\n"])));
|
|
145
|
-
var euiButtonFocusCSS = function euiButtonFocusCSS(
|
|
146
|
-
var euiTheme =
|
|
147
|
-
var
|
|
175
|
+
var euiButtonFocusCSS = function euiButtonFocusCSS(euiThemeContext) {
|
|
176
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
177
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
178
|
+
var focusCSS = isRefreshVariant ? /*#__PURE__*/css(";label:focusCSS;") : /*#__PURE__*/css(euiCanAnimate, "{transition:transform ", euiTheme.animation.normal, " ease-in-out,background-color ", euiTheme.animation.normal, " ease-in-out;&:hover:not(:disabled){transform:translateY(-1px);}&:focus{animation:", euiButtonFocusAnimation, " ", euiTheme.animation.normal, " ", euiTheme.animation.bounce, ";}&:active:not(:disabled){transform:translateY(1px);}};label:focusCSS;");
|
|
148
179
|
// Remove the auto-generated label.
|
|
149
180
|
// We could typically avoid a label by using a plain string `` instead of css``,
|
|
150
181
|
// but we need css`` for keyframes`` to work for the focus animation
|
|
@@ -156,27 +187,63 @@ var euiButtonFocusCSS = function euiButtonFocusCSS(_ref) {
|
|
|
156
187
|
* Map of `size` props to various sizings/scales
|
|
157
188
|
* that should remain consistent across all buttons
|
|
158
189
|
*/
|
|
159
|
-
export var euiButtonSizeMap = function euiButtonSizeMap(
|
|
160
|
-
var euiTheme =
|
|
190
|
+
export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
191
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
192
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
161
193
|
return {
|
|
162
194
|
xs: {
|
|
195
|
+
minWidth: euiTheme.base * (isRefreshVariant ? 6 : 7),
|
|
163
196
|
height: euiTheme.size.l,
|
|
164
197
|
radius: euiTheme.border.radius.small,
|
|
165
198
|
fontScale: 'xs'
|
|
166
199
|
},
|
|
167
200
|
s: {
|
|
201
|
+
minWidth: euiTheme.base * (isRefreshVariant ? 6 : 7),
|
|
168
202
|
height: euiTheme.size.xl,
|
|
169
203
|
radius: euiTheme.border.radius.small,
|
|
170
204
|
fontScale: 's'
|
|
171
205
|
},
|
|
172
206
|
m: {
|
|
207
|
+
minWidth: euiTheme.base * 7,
|
|
173
208
|
height: euiTheme.size.xxl,
|
|
174
|
-
radius: euiTheme.border.radius.medium,
|
|
209
|
+
radius: isRefreshVariant ? euiTheme.border.radius.small : euiTheme.border.radius.medium,
|
|
175
210
|
fontScale: 's'
|
|
176
211
|
}
|
|
177
212
|
};
|
|
178
213
|
};
|
|
179
214
|
|
|
215
|
+
/**
|
|
216
|
+
* internal styles util for applying button background color on hover
|
|
217
|
+
*/
|
|
218
|
+
var _interactionStyles = function _interactionStyles(euiThemeContext, buttonColors) {
|
|
219
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'fill';
|
|
220
|
+
var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
|
|
221
|
+
if (!isRefreshVariant) return "";
|
|
222
|
+
var baseStyles = function baseStyles() {
|
|
223
|
+
// button hover is applied as pseudo element with a transparent background-color
|
|
224
|
+
if (type === 'overlay') {
|
|
225
|
+
return "\n position: relative;\n overflow: hidden;\n\n &:hover:not(:disabled) {\n &::before {\n content: '';\n position: absolute;\n /* should stay under the content */\n z-index: 0;\n inset: 0;\n background-color: ".concat(buttonColors.backgroundHover, ";\n pointer-events: none;\n }\n }\n\n &:active:not(:disabled) {\n &::before {\n ").concat(logicalCSS('width', '100%'), "\n ").concat(logicalCSS('height', '100%'), "\n\n content: '';\n position: absolute;\n inset: 0;\n background-color: ").concat(buttonColors.backgroundActive, ";\n }\n }\n ");
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// button hover is applied as opaque color
|
|
229
|
+
return "\n &:hover:not(:disabled) {\n background-color: ".concat(buttonColors.backgroundHover, ";\n }\n\n &:active:not(:disabled) {\n background-color: ").concat(buttonColors.backgroundActive, ";\n }\n ");
|
|
230
|
+
};
|
|
231
|
+
return " \n ".concat(highContrastModeStyles(euiThemeContext, {
|
|
232
|
+
none: baseStyles(),
|
|
233
|
+
forced: "\n position: relative;\n overflow: hidden;\n\n ".concat(highContrastHoverIndicatorStyles(euiThemeContext), "\n ")
|
|
234
|
+
}), "\n ");
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* creates a bottom border on hover/focus to ensure a visible change as forced mode removed background colors
|
|
239
|
+
*/
|
|
240
|
+
export var highContrastHoverIndicatorStyles = function highContrastHoverIndicatorStyles(_ref2) {
|
|
241
|
+
var euiTheme = _ref2.euiTheme;
|
|
242
|
+
return "\n &:hover:not(:disabled) {\n transition: none;\n\n /* using pseudo border to be able to control the color */\n &::after {\n content: '';\n position: absolute;\n inset: ".concat(euiTheme.border.width.thin, ";\n border: ").concat(euiTheme.border.width.thick, " solid var(--highContrastHoverIndicatorColor, ").concat(euiTheme.border.color, ");\n border-radius: ").concat(mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
243
|
+
return x / 2;
|
|
244
|
+
}), ";\n background-color: transparent;\n pointer-events: none;\n }\n }\n");
|
|
245
|
+
};
|
|
246
|
+
|
|
180
247
|
/**
|
|
181
248
|
* Internal util for high contrast button borders
|
|
182
249
|
*/
|
|
@@ -8,6 +8,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import React, { forwardRef, useContext, useMemo } from 'react';
|
|
11
|
+
import { COLOR_MODES_STANDARD } from '@elastic/eui-theme-common';
|
|
11
12
|
import { EuiThemeContext, EuiModificationsContext, EuiColorModeContext, EuiHighContrastModeContext, defaultComputedTheme, EuiNestedThemeContext } from './context';
|
|
12
13
|
import { emitEuiProviderWarning } from './warning';
|
|
13
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -83,4 +84,14 @@ export var useEuiThemeCSSVariables = function useEuiThemeCSSVariables() {
|
|
|
83
84
|
setNearestThemeCSSVariables: setNearestThemeCSSVariables,
|
|
84
85
|
themeCSSVariables: themeCSSVariables
|
|
85
86
|
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Checks whether the current active `colorMode` is set to `DARK`;
|
|
91
|
+
* In case of nested providers this returns the value of the nearest provider context.
|
|
92
|
+
*/
|
|
93
|
+
export var useIsDarkMode = function useIsDarkMode() {
|
|
94
|
+
var _useEuiTheme = useEuiTheme(),
|
|
95
|
+
colorMode = _useEuiTheme.colorMode;
|
|
96
|
+
return colorMode === COLOR_MODES_STANDARD.dark;
|
|
86
97
|
};
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export { EuiSystemContext, EuiThemeContext, EuiNestedThemeContext, EuiModificationsContext, EuiColorModeContext, EuiHighContrastModeContext } from './context';
|
|
10
|
-
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme, useEuiThemeCSSVariables } from './hooks';
|
|
10
|
+
export { useEuiTheme, withEuiTheme, RenderWithEuiTheme, useEuiThemeCSSVariables, useIsDarkMode } from './hooks';
|
|
11
11
|
export { EuiThemeProvider } from './provider';
|
|
12
12
|
export { useEuiMemoizedStyles, withEuiStylesMemoizer, RenderWithEuiStylesMemoizer } from './style_memoization';
|
|
13
13
|
export { getEuiDevProviderWarning, setEuiDevProviderWarning } from './warning';
|
|
14
14
|
export { buildTheme, computed, isInverseColorMode, getColorMode, getComputed, getOn, mergeDeep, setOn, Computed } from './utils';
|
|
15
|
-
export { COLOR_MODES_STANDARD } from './types';
|
|
15
|
+
export { COLOR_MODES_STANDARD } from './types';
|
|
16
|
+
export * from './theme_variant';
|
|
@@ -143,9 +143,35 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
143
143
|
}, [highContrastMode]);
|
|
144
144
|
useEffect(function () {
|
|
145
145
|
if (!isParentTheme.current) {
|
|
146
|
-
|
|
146
|
+
/* Enables recomputation of component colors when flags are overridden on the provider
|
|
147
|
+
by adding the respective key to modifications to trigger a recomputation. */
|
|
148
|
+
// TODO: remove once visual refresh is completed and flags are obsolete
|
|
149
|
+
var flagsToRecompute = [{
|
|
150
|
+
flag: 'buttonVariant',
|
|
151
|
+
componentKey: 'buttons'
|
|
152
|
+
}];
|
|
153
|
+
var keys = {};
|
|
154
|
+
var forceRecomputeComponents = flagsToRecompute.some(function (item) {
|
|
155
|
+
var _modifications$flags, _modifications$compon;
|
|
156
|
+
if (Object.keys((_modifications$flags = modifications.flags) !== null && _modifications$flags !== void 0 ? _modifications$flags : {}).includes(item.flag) && !Object.keys((_modifications$compon = modifications.components) !== null && _modifications$compon !== void 0 ? _modifications$compon : {}).includes(item.componentKey)) {
|
|
157
|
+
keys[item.componentKey] = {
|
|
158
|
+
LIGHT: {},
|
|
159
|
+
DARK: {}
|
|
160
|
+
};
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
return false;
|
|
164
|
+
});
|
|
165
|
+
var componentModifications = forceRecomputeComponents ? {
|
|
166
|
+
components: keys
|
|
167
|
+
} : {};
|
|
168
|
+
|
|
169
|
+
// force recomputing of color & component tokens based on flag changes
|
|
170
|
+
var enhancedModifications = _objectSpread(_objectSpread({}, modificationsWithHighContrast), componentModifications);
|
|
171
|
+
var rebuiltTheme = getComputed(system, buildTheme(enhancedModifications, "_".concat(system.key)), colorMode, highContrastMode);
|
|
172
|
+
setTheme(rebuiltTheme);
|
|
147
173
|
}
|
|
148
|
-
}, [colorMode, highContrastMode, system, modificationsWithHighContrast]);
|
|
174
|
+
}, [colorMode, highContrastMode, system, modificationsWithHighContrast, modifications]);
|
|
149
175
|
var _useState9 = useState(),
|
|
150
176
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
151
177
|
themeCSSVariables = _useState10[0],
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useEuiTheme } from './hooks';
|
|
10
|
+
export var isEuiThemeRefreshVariant = function isEuiThemeRefreshVariant(_ref, flag) {
|
|
11
|
+
var euiTheme = _ref.euiTheme;
|
|
12
|
+
return euiTheme.flags[flag] === 'refresh';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Util to retrieve visual variant for UI elements
|
|
17
|
+
* Note: Temporary only - will be removed once the visual refresh is completed.
|
|
18
|
+
*/
|
|
19
|
+
export var useEuiThemeRefreshVariant = function useEuiThemeRefreshVariant(flag) {
|
|
20
|
+
var euiThemeContext = useEuiTheme();
|
|
21
|
+
return isEuiThemeRefreshVariant(euiThemeContext, flag);
|
|
22
|
+
};
|