@elastic/eui 98.2.1-borealis.0 → 98.2.1
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_amsterdam_dark.json.d.ts → eui_theme_dark.json.d.ts} +1 -1
- package/dist/{eui_theme_amsterdam_light.json.d.ts → eui_theme_light.json.d.ts} +1 -1
- package/es/components/avatar/avatar.js +4 -10
- package/es/components/badge/badge.styles.js +2 -1
- package/es/components/badge/beta_badge/beta_badge.styles.js +1 -3
- package/es/components/badge/color_utils.js +8 -9
- package/es/components/beacon/beacon.styles.js +2 -2
- package/es/components/bottom_bar/bottom_bar.styles.js +2 -1
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +7 -5
- package/es/components/button/button.js +1 -1
- package/es/components/button/button_display/_button_display.styles.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_group/button_group_button.js +1 -1
- package/es/components/button/button_group/button_group_button.styles.js +6 -6
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/card/card.js +1 -1
- package/es/components/card/card.styles.js +3 -6
- package/es/components/code/code_block_annotations.js +1 -1
- package/es/components/code/code_block_line.styles.js +2 -1
- package/es/components/code/code_syntax.styles.js +27 -23
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +5 -3
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
- package/es/components/color_picker/color_palette_display/color_palette_display.styles.js +2 -1
- package/es/components/color_picker/color_picker.js +3 -9
- package/es/components/color_picker/color_picker.styles.js +2 -1
- package/es/components/color_picker/color_picker_swatch.styles.js +1 -1
- package/es/components/comment_list/comment.js +1 -1
- package/es/components/comment_list/comment_event.js +4 -5
- package/es/components/comment_list/comment_list.js +1 -1
- package/es/components/common.js +28 -0
- package/es/components/datagrid/data_grid.styles.js +7 -6
- package/es/components/date_picker/react_date_picker.styles.js +1 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -3
- package/es/components/drag_and_drop/droppable.styles.js +4 -2
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/empty_prompt/empty_prompt.styles.js +2 -6
- package/es/components/filter_group/filter_select_item.styles.js +2 -1
- package/es/components/flyout/_flyout_close_button.styles.js +2 -1
- package/es/components/flyout/flyout.js +1 -1
- package/es/components/flyout/flyout.styles.js +2 -7
- package/es/components/flyout/flyout_footer.styles.js +1 -1
- package/es/components/form/form.styles.js +32 -28
- package/es/components/form/range/range_tooltip.styles.js +13 -11
- package/es/components/form/switch/switch.js +7 -3
- package/es/components/form/switch/switch.styles.js +19 -16
- package/es/components/header/header.styles.js +7 -6
- package/es/components/icon/icon.styles.js +8 -9
- package/es/components/icon/named_colors.js +1 -1
- package/es/components/inline_edit/inline_edit_form.styles.js +2 -1
- package/es/components/key_pad_menu/key_pad_menu_item.styles.js +2 -1
- package/es/components/list_group/list_group_item.styles.js +11 -9
- package/es/components/loading/loading_chart.styles.js +5 -18
- package/es/components/mark/mark.styles.js +9 -2
- package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +3 -2
- package/es/components/markdown_editor/markdown_format.styles.js +2 -2
- package/es/components/modal/modal.styles.js +1 -1
- package/es/components/overlay_mask/overlay_mask.styles.js +2 -1
- package/es/components/page_template/inner/page_inner.styles.js +2 -2
- package/es/components/panel/panel.js +1 -1
- package/es/components/panel/panel.styles.js +1 -1
- package/es/components/panel/split_panel/split_panel.js +1 -1
- package/es/components/popover/popover.js +1 -1
- package/es/components/popover/popover_arrow/_popover_arrow.js +3 -8
- package/es/components/popover/popover_arrow/_popover_arrow.styles.js +13 -18
- package/es/components/popover/popover_footer.styles.js +1 -1
- package/es/components/popover/popover_panel/_popover_panel.styles.js +4 -4
- package/es/components/progress/progress.js +1 -1
- package/es/components/progress/progress.styles.js +28 -30
- package/es/components/resizable_container/resizable_panel.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.styles.js +2 -1
- package/es/components/side_nav/side_nav_item.styles.js +2 -1
- package/es/components/skeleton/utils.js +7 -5
- package/es/components/steps/step_number.styles.js +1 -1
- package/es/components/table/table_cells_shared.styles.js +7 -2
- package/es/components/table/table_row.styles.js +10 -8
- package/es/components/text/text.styles.js +2 -2
- package/es/components/text/text_color.js +1 -1
- package/es/components/text/text_color.styles.js +5 -6
- package/es/components/toast/toast.styles.js +1 -1
- package/es/components/token/token.js +4 -10
- package/es/components/token/token.styles.js +3 -12
- package/es/components/token/token_map.js +1 -243
- package/es/components/tool_tip/tool_tip.styles.js +24 -12
- package/es/components/tour/_tour_footer.styles.js +4 -2
- package/es/components/tour/tour.styles.js +12 -8
- package/es/components/tree_view/tree_view_item.styles.js +2 -1
- package/es/global_styling/functions/math.js +49 -1
- package/es/global_styling/functions/size.js +17 -1
- package/es/global_styling/mixins/_color.js +31 -39
- package/es/global_styling/mixins/index.js +1 -2
- package/es/global_styling/reset/global_styles.js +2 -2
- package/es/global_styling/variables/_colors_vis.js +53 -1
- package/es/global_styling/variables/animations.js +22 -1
- package/es/global_styling/variables/breakpoint.js +7 -1
- package/es/global_styling/variables/levels.js +17 -1
- package/es/global_styling/variables/shadow.js +11 -1
- package/es/global_styling/variables/size.js +1 -1
- package/es/global_styling/variables/typography.js +32 -1
- package/es/services/color/eui_palettes.js +47 -116
- package/es/services/color/index.js +0 -1
- package/es/services/index.js +1 -1
- package/es/services/popover/index.js +1 -4
- package/es/services/popover/popover_positioning.js +17 -6
- package/es/services/theme/provider.js +2 -26
- package/es/services/theme/types.js +6 -1
- package/es/services/theme/utils.js +303 -1
- package/es/themes/amsterdam/global_styling/mixins/button.js +203 -1
- package/es/themes/amsterdam/global_styling/variables/_borders.js +3 -3
- package/es/themes/amsterdam/global_styling/variables/_colors.js +19 -612
- package/es/themes/amsterdam/theme.js +1 -7
- package/es/themes/index.js +1 -1
- package/es/themes/themes.js +6 -9
- package/eui.d.ts +2831 -2383
- package/lib/components/avatar/avatar.js +2 -8
- package/lib/components/badge/badge.styles.js +2 -1
- package/lib/components/badge/beta_badge/beta_badge.styles.js +1 -3
- package/lib/components/badge/color_utils.js +13 -14
- package/lib/components/beacon/beacon.styles.js +2 -2
- package/lib/components/bottom_bar/bottom_bar.styles.js +2 -1
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +7 -5
- package/lib/components/button/button.js +1 -1
- package/lib/components/button/button_display/_button_display.styles.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +1 -1
- package/lib/components/button/button_group/button_group_button.styles.js +5 -5
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/card/card.js +1 -1
- package/lib/components/card/card.styles.js +2 -5
- package/lib/components/code/code_block_annotations.js +1 -1
- package/lib/components/code/code_block_line.styles.js +2 -1
- package/lib/components/code/code_syntax.styles.js +27 -23
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +5 -3
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
- package/lib/components/color_picker/color_palette_display/color_palette_display.styles.js +2 -1
- package/lib/components/color_picker/color_picker.js +2 -8
- package/lib/components/color_picker/color_picker.styles.js +2 -1
- package/lib/components/color_picker/color_picker_swatch.styles.js +1 -1
- package/lib/components/comment_list/comment.js +1 -1
- package/lib/components/comment_list/comment_event.js +4 -5
- package/lib/components/comment_list/comment_list.js +1 -1
- package/lib/components/common.js +28 -0
- package/lib/components/datagrid/data_grid.styles.js +7 -6
- package/lib/components/date_picker/react_date_picker.styles.js +2 -3
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +3 -2
- package/lib/components/drag_and_drop/droppable.styles.js +4 -2
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.styles.js +1 -5
- package/lib/components/filter_group/filter_select_item.styles.js +2 -1
- package/lib/components/flyout/_flyout_close_button.styles.js +2 -1
- package/lib/components/flyout/flyout.js +1 -1
- package/lib/components/flyout/flyout.styles.js +2 -7
- package/lib/components/flyout/flyout_footer.styles.js +1 -1
- package/lib/components/form/form.styles.js +31 -27
- package/lib/components/form/range/range_tooltip.styles.js +13 -11
- package/lib/components/form/switch/switch.js +7 -3
- package/lib/components/form/switch/switch.styles.js +19 -16
- package/lib/components/header/header.styles.js +6 -5
- package/lib/components/icon/icon.styles.js +8 -9
- package/lib/components/icon/named_colors.js +1 -1
- package/lib/components/inline_edit/inline_edit_form.styles.js +2 -1
- package/lib/components/key_pad_menu/key_pad_menu_item.styles.js +2 -1
- package/lib/components/list_group/list_group_item.styles.js +10 -8
- package/lib/components/loading/loading_chart.styles.js +5 -18
- package/lib/components/mark/mark.styles.js +9 -2
- package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +3 -2
- package/lib/components/markdown_editor/markdown_format.styles.js +2 -2
- package/lib/components/modal/modal.styles.js +1 -1
- package/lib/components/overlay_mask/overlay_mask.styles.js +2 -1
- package/lib/components/page_template/inner/page_inner.styles.js +1 -1
- package/lib/components/panel/panel.js +1 -1
- package/lib/components/panel/panel.styles.js +1 -1
- package/lib/components/panel/split_panel/split_panel.js +1 -1
- package/lib/components/popover/popover.js +1 -1
- package/lib/components/popover/popover_arrow/_popover_arrow.js +3 -8
- package/lib/components/popover/popover_arrow/_popover_arrow.styles.js +15 -18
- package/lib/components/popover/popover_footer.styles.js +1 -1
- package/lib/components/popover/popover_panel/_popover_panel.styles.js +4 -4
- package/lib/components/progress/progress.js +1 -1
- package/lib/components/progress/progress.styles.js +27 -29
- package/lib/components/resizable_container/resizable_panel.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.styles.js +2 -1
- package/lib/components/side_nav/side_nav_item.styles.js +2 -1
- package/lib/components/skeleton/utils.js +6 -4
- package/lib/components/steps/step_number.styles.js +1 -1
- package/lib/components/table/table_cells_shared.styles.js +7 -2
- package/lib/components/table/table_row.styles.js +9 -7
- package/lib/components/text/text.styles.js +1 -1
- package/lib/components/text/text_color.js +1 -1
- package/lib/components/text/text_color.styles.js +5 -6
- package/lib/components/toast/toast.styles.js +1 -1
- package/lib/components/token/token.js +4 -12
- package/lib/components/token/token.styles.js +3 -12
- package/lib/components/token/token_map.js +2 -244
- package/lib/components/tool_tip/tool_tip.styles.js +23 -11
- package/lib/components/tour/_tour_footer.styles.js +4 -2
- package/lib/components/tour/tour.styles.js +12 -8
- package/lib/components/tree_view/tree_view_item.styles.js +2 -1
- package/lib/global_styling/functions/math.js +58 -7
- package/lib/global_styling/functions/size.js +26 -7
- package/lib/global_styling/mixins/_color.js +30 -38
- package/lib/global_styling/mixins/index.js +0 -11
- package/lib/global_styling/reset/global_styles.js +1 -1
- package/lib/global_styling/variables/_colors_vis.js +61 -6
- package/lib/global_styling/variables/animations.js +31 -25
- package/lib/global_styling/variables/breakpoint.js +16 -7
- package/lib/global_styling/variables/levels.js +26 -7
- package/lib/global_styling/variables/shadow.js +20 -13
- package/lib/global_styling/variables/size.js +10 -7
- package/lib/global_styling/variables/typography.js +41 -19
- package/lib/services/color/eui_palettes.js +47 -116
- package/lib/services/color/index.js +0 -8
- package/lib/services/index.js +0 -7
- package/lib/services/popover/index.js +1 -8
- package/lib/services/popover/popover_positioning.js +17 -6
- package/lib/services/theme/provider.js +2 -26
- package/lib/services/theme/types.js +14 -13
- package/lib/services/theme/utils.js +303 -54
- package/lib/themes/amsterdam/global_styling/mixins/button.js +206 -45
- package/lib/themes/amsterdam/global_styling/variables/_borders.js +3 -3
- package/lib/themes/amsterdam/global_styling/variables/_colors.js +19 -611
- package/lib/themes/amsterdam/theme.js +1 -7
- package/lib/themes/index.js +0 -7
- package/lib/themes/themes.js +7 -10
- package/optimize/es/components/avatar/avatar.js +4 -10
- package/optimize/es/components/badge/badge.styles.js +2 -1
- package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +1 -3
- package/optimize/es/components/badge/color_utils.js +8 -9
- package/optimize/es/components/beacon/beacon.styles.js +2 -2
- package/optimize/es/components/bottom_bar/bottom_bar.styles.js +2 -1
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +7 -5
- package/optimize/es/components/button/button.js +1 -1
- package/optimize/es/components/button/button_display/_button_display.styles.js +1 -1
- package/optimize/es/components/button/button_empty/button_empty.js +1 -1
- package/optimize/es/components/button/button_group/button_group_button.js +1 -1
- package/optimize/es/components/button/button_group/button_group_button.styles.js +6 -6
- package/optimize/es/components/button/button_icon/button_icon.js +1 -1
- package/optimize/es/components/card/card.styles.js +3 -6
- package/optimize/es/components/code/code_block_annotations.js +1 -1
- package/optimize/es/components/code/code_block_line.styles.js +2 -1
- package/optimize/es/components/code/code_syntax.styles.js +27 -23
- package/optimize/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +5 -3
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
- package/optimize/es/components/color_picker/color_palette_display/color_palette_display.styles.js +2 -1
- package/optimize/es/components/color_picker/color_picker.js +3 -9
- package/optimize/es/components/color_picker/color_picker.styles.js +2 -1
- package/optimize/es/components/color_picker/color_picker_swatch.styles.js +1 -1
- package/optimize/es/components/comment_list/comment_event.js +3 -4
- package/optimize/es/components/common.js +28 -0
- package/optimize/es/components/datagrid/data_grid.styles.js +7 -6
- package/optimize/es/components/date_picker/react_date_picker.styles.js +1 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +4 -3
- package/optimize/es/components/drag_and_drop/droppable.styles.js +4 -2
- package/optimize/es/components/empty_prompt/empty_prompt.styles.js +2 -6
- package/optimize/es/components/filter_group/filter_select_item.styles.js +2 -1
- package/optimize/es/components/flyout/_flyout_close_button.styles.js +2 -1
- package/optimize/es/components/flyout/flyout.js +1 -1
- package/optimize/es/components/flyout/flyout.styles.js +2 -7
- package/optimize/es/components/flyout/flyout_footer.styles.js +1 -1
- package/optimize/es/components/form/form.styles.js +32 -28
- package/optimize/es/components/form/range/range_tooltip.styles.js +13 -11
- package/optimize/es/components/form/switch/switch.js +2 -3
- package/optimize/es/components/form/switch/switch.styles.js +19 -16
- package/optimize/es/components/header/header.styles.js +7 -6
- package/optimize/es/components/icon/icon.styles.js +8 -9
- package/optimize/es/components/icon/named_colors.js +1 -1
- package/optimize/es/components/inline_edit/inline_edit_form.styles.js +2 -1
- package/optimize/es/components/key_pad_menu/key_pad_menu_item.styles.js +2 -1
- package/optimize/es/components/list_group/list_group_item.styles.js +11 -9
- package/optimize/es/components/loading/loading_chart.styles.js +5 -13
- package/optimize/es/components/mark/mark.styles.js +9 -2
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +3 -2
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +2 -2
- package/optimize/es/components/modal/modal.styles.js +1 -1
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +2 -1
- package/optimize/es/components/page_template/inner/page_inner.styles.js +2 -2
- package/optimize/es/components/panel/panel.styles.js +1 -1
- package/optimize/es/components/popover/popover.js +1 -1
- package/optimize/es/components/popover/popover_arrow/_popover_arrow.js +3 -8
- package/optimize/es/components/popover/popover_arrow/_popover_arrow.styles.js +13 -15
- package/optimize/es/components/popover/popover_footer.styles.js +1 -1
- package/optimize/es/components/popover/popover_panel/_popover_panel.styles.js +4 -4
- package/optimize/es/components/progress/progress.js +1 -1
- package/optimize/es/components/progress/progress.styles.js +28 -30
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.styles.js +2 -1
- package/optimize/es/components/side_nav/side_nav_item.styles.js +2 -1
- package/optimize/es/components/skeleton/utils.js +7 -5
- package/optimize/es/components/steps/step_number.styles.js +1 -1
- package/optimize/es/components/table/table_cells_shared.styles.js +7 -2
- package/optimize/es/components/table/table_row.styles.js +10 -8
- package/optimize/es/components/text/text.styles.js +2 -2
- package/optimize/es/components/text/text_color.js +1 -1
- package/optimize/es/components/text/text_color.styles.js +5 -6
- package/optimize/es/components/toast/toast.styles.js +1 -1
- package/optimize/es/components/token/token.js +4 -10
- package/optimize/es/components/token/token.styles.js +3 -12
- package/optimize/es/components/token/token_map.js +1 -243
- package/optimize/es/components/tool_tip/tool_tip.styles.js +24 -12
- package/optimize/es/components/tour/_tour_footer.styles.js +4 -2
- package/optimize/es/components/tour/tour.styles.js +12 -8
- package/optimize/es/components/tree_view/tree_view_item.styles.js +2 -1
- package/optimize/es/global_styling/functions/math.js +49 -1
- package/optimize/es/global_styling/functions/size.js +17 -1
- package/optimize/es/global_styling/mixins/_color.js +31 -39
- package/optimize/es/global_styling/mixins/index.js +1 -2
- package/optimize/es/global_styling/reset/global_styles.js +2 -2
- package/optimize/es/global_styling/variables/_colors_vis.js +53 -1
- package/optimize/es/global_styling/variables/animations.js +22 -1
- package/optimize/es/global_styling/variables/breakpoint.js +7 -1
- package/optimize/es/global_styling/variables/levels.js +17 -1
- package/optimize/es/global_styling/variables/shadow.js +11 -1
- package/optimize/es/global_styling/variables/size.js +1 -1
- package/optimize/es/global_styling/variables/typography.js +32 -1
- package/optimize/es/services/color/eui_palettes.js +47 -116
- package/optimize/es/services/color/index.js +0 -1
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/services/popover/index.js +1 -4
- package/optimize/es/services/popover/popover_positioning.js +17 -6
- package/optimize/es/services/theme/provider.js +2 -26
- package/optimize/es/services/theme/types.js +6 -1
- package/optimize/es/services/theme/utils.js +295 -1
- package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +198 -1
- package/optimize/es/themes/amsterdam/global_styling/variables/_borders.js +3 -3
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors.js +19 -612
- package/optimize/es/themes/amsterdam/theme.js +1 -7
- package/optimize/es/themes/index.js +1 -1
- package/optimize/es/themes/themes.js +6 -9
- package/optimize/lib/components/avatar/avatar.js +2 -8
- package/optimize/lib/components/badge/badge.styles.js +2 -1
- package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +1 -3
- package/optimize/lib/components/badge/color_utils.js +13 -14
- package/optimize/lib/components/beacon/beacon.styles.js +2 -2
- package/optimize/lib/components/bottom_bar/bottom_bar.styles.js +2 -1
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +7 -5
- package/optimize/lib/components/button/button.js +1 -1
- package/optimize/lib/components/button/button_display/_button_display.styles.js +1 -1
- package/optimize/lib/components/button/button_empty/button_empty.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +5 -5
- package/optimize/lib/components/button/button_icon/button_icon.js +1 -1
- package/optimize/lib/components/card/card.styles.js +2 -5
- package/optimize/lib/components/code/code_block_annotations.js +1 -1
- package/optimize/lib/components/code/code_block_line.styles.js +2 -1
- package/optimize/lib/components/code/code_syntax.styles.js +27 -23
- package/optimize/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +5 -3
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
- package/optimize/lib/components/color_picker/color_palette_display/color_palette_display.styles.js +2 -1
- package/optimize/lib/components/color_picker/color_picker.js +2 -8
- package/optimize/lib/components/color_picker/color_picker.styles.js +2 -1
- package/optimize/lib/components/color_picker/color_picker_swatch.styles.js +1 -1
- package/optimize/lib/components/comment_list/comment_event.js +3 -4
- package/optimize/lib/components/common.js +28 -0
- package/optimize/lib/components/datagrid/data_grid.styles.js +7 -6
- package/optimize/lib/components/date_picker/react_date_picker.styles.js +2 -3
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +3 -2
- package/optimize/lib/components/drag_and_drop/droppable.styles.js +4 -2
- package/optimize/lib/components/empty_prompt/empty_prompt.styles.js +1 -5
- package/optimize/lib/components/filter_group/filter_select_item.styles.js +2 -1
- package/optimize/lib/components/flyout/_flyout_close_button.styles.js +2 -1
- package/optimize/lib/components/flyout/flyout.js +1 -1
- package/optimize/lib/components/flyout/flyout.styles.js +2 -7
- package/optimize/lib/components/flyout/flyout_footer.styles.js +1 -1
- package/optimize/lib/components/form/form.styles.js +31 -27
- package/optimize/lib/components/form/range/range_tooltip.styles.js +13 -11
- package/optimize/lib/components/form/switch/switch.js +2 -3
- package/optimize/lib/components/form/switch/switch.styles.js +19 -16
- package/optimize/lib/components/header/header.styles.js +6 -5
- package/optimize/lib/components/icon/icon.styles.js +8 -9
- package/optimize/lib/components/icon/named_colors.js +1 -1
- package/optimize/lib/components/inline_edit/inline_edit_form.styles.js +2 -1
- package/optimize/lib/components/key_pad_menu/key_pad_menu_item.styles.js +2 -1
- package/optimize/lib/components/list_group/list_group_item.styles.js +10 -8
- package/optimize/lib/components/loading/loading_chart.styles.js +5 -13
- package/optimize/lib/components/mark/mark.styles.js +9 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +3 -2
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +2 -2
- package/optimize/lib/components/modal/modal.styles.js +1 -1
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +2 -1
- package/optimize/lib/components/page_template/inner/page_inner.styles.js +1 -1
- package/optimize/lib/components/panel/panel.styles.js +1 -1
- package/optimize/lib/components/popover/popover.js +1 -1
- package/optimize/lib/components/popover/popover_arrow/_popover_arrow.js +3 -8
- package/optimize/lib/components/popover/popover_arrow/_popover_arrow.styles.js +15 -16
- package/optimize/lib/components/popover/popover_footer.styles.js +1 -1
- package/optimize/lib/components/popover/popover_panel/_popover_panel.styles.js +4 -4
- package/optimize/lib/components/progress/progress.js +1 -1
- package/optimize/lib/components/progress/progress.styles.js +27 -29
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.styles.js +2 -1
- package/optimize/lib/components/side_nav/side_nav_item.styles.js +2 -1
- package/optimize/lib/components/skeleton/utils.js +6 -4
- package/optimize/lib/components/steps/step_number.styles.js +1 -1
- package/optimize/lib/components/table/table_cells_shared.styles.js +7 -2
- package/optimize/lib/components/table/table_row.styles.js +9 -7
- package/optimize/lib/components/text/text.styles.js +1 -1
- package/optimize/lib/components/text/text_color.js +1 -1
- package/optimize/lib/components/text/text_color.styles.js +5 -6
- package/optimize/lib/components/toast/toast.styles.js +1 -1
- package/optimize/lib/components/token/token.js +4 -13
- package/optimize/lib/components/token/token.styles.js +3 -12
- package/optimize/lib/components/token/token_map.js +2 -244
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +23 -11
- package/optimize/lib/components/tour/_tour_footer.styles.js +4 -2
- package/optimize/lib/components/tour/tour.styles.js +12 -8
- package/optimize/lib/components/tree_view/tree_view_item.styles.js +2 -1
- package/optimize/lib/global_styling/functions/math.js +59 -7
- package/optimize/lib/global_styling/functions/size.js +27 -7
- package/optimize/lib/global_styling/mixins/_color.js +30 -38
- package/optimize/lib/global_styling/mixins/index.js +0 -11
- package/optimize/lib/global_styling/reset/global_styles.js +1 -1
- package/optimize/lib/global_styling/variables/_colors_vis.js +61 -6
- package/optimize/lib/global_styling/variables/animations.js +31 -25
- package/optimize/lib/global_styling/variables/breakpoint.js +16 -7
- package/optimize/lib/global_styling/variables/levels.js +26 -7
- package/optimize/lib/global_styling/variables/shadow.js +20 -13
- package/optimize/lib/global_styling/variables/size.js +10 -7
- package/optimize/lib/global_styling/variables/typography.js +41 -19
- package/optimize/lib/services/color/eui_palettes.js +47 -116
- package/optimize/lib/services/color/index.js +0 -8
- package/optimize/lib/services/index.js +0 -7
- package/optimize/lib/services/popover/index.js +1 -8
- package/optimize/lib/services/popover/popover_positioning.js +17 -6
- package/optimize/lib/services/theme/provider.js +2 -26
- package/optimize/lib/services/theme/types.js +14 -13
- package/optimize/lib/services/theme/utils.js +296 -54
- package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +203 -45
- package/optimize/lib/themes/amsterdam/global_styling/variables/_borders.js +3 -3
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors.js +19 -611
- package/optimize/lib/themes/amsterdam/theme.js +1 -7
- package/optimize/lib/themes/index.js +0 -7
- package/optimize/lib/themes/themes.js +7 -10
- package/package.json +3 -7
- package/src/global_styling/functions/_index.scss +5 -1
- package/src/global_styling/index.scss +10 -1
- package/src/global_styling/variables/_animations.scss +8 -1
- package/src/global_styling/variables/_borders.scss +9 -1
- package/src/global_styling/variables/_buttons.scss +18 -1
- package/src/global_styling/variables/_colors_vis.scss +70 -1
- package/src/global_styling/variables/_font_weight.scss +7 -1
- package/src/global_styling/variables/_form.scss +21 -2
- package/src/global_styling/variables/_responsive.scss +9 -1
- package/src/global_styling/variables/_shadows.scss +1 -1
- package/src/global_styling/variables/_size.scss +13 -1
- package/src/global_styling/variables/_states.scss +14 -1
- package/src/global_styling/variables/_typography.scss +75 -1
- package/src/global_styling/variables/_z_index.scss +33 -1
- package/src/themes/amsterdam/_colors_dark.scss +8 -80
- package/src/themes/amsterdam/_colors_light.scss +8 -80
- package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -2
- package/test-env/components/avatar/avatar.js +2 -8
- package/test-env/components/badge/badge.styles.js +2 -1
- package/test-env/components/badge/beta_badge/beta_badge.styles.js +1 -3
- package/test-env/components/badge/color_utils.js +13 -14
- package/test-env/components/beacon/beacon.styles.js +2 -2
- package/test-env/components/bottom_bar/bottom_bar.styles.js +2 -1
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +7 -5
- package/test-env/components/button/button.js +1 -1
- package/test-env/components/button/button_display/_button_display.styles.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +1 -1
- package/test-env/components/button/button_group/button_group_button.styles.js +5 -5
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/card/card.styles.js +2 -5
- package/test-env/components/code/code_block_annotations.js +1 -1
- package/test-env/components/code/code_block_line.styles.js +2 -1
- package/test-env/components/code/code_syntax.styles.js +27 -23
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.styles.js +5 -3
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +1 -1
- package/test-env/components/color_picker/color_palette_display/color_palette_display.styles.js +2 -1
- package/test-env/components/color_picker/color_picker.js +2 -8
- package/test-env/components/color_picker/color_picker.styles.js +2 -1
- package/test-env/components/color_picker/color_picker_swatch.styles.js +1 -1
- package/test-env/components/comment_list/comment.js +1 -1
- package/test-env/components/comment_list/comment_event.js +4 -5
- package/test-env/components/comment_list/comment_list.js +1 -1
- package/test-env/components/common.js +28 -0
- package/test-env/components/datagrid/data_grid.styles.js +7 -6
- package/test-env/components/date_picker/react_date_picker.styles.js +2 -3
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +3 -2
- package/test-env/components/drag_and_drop/droppable.styles.js +4 -2
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.styles.js +1 -5
- package/test-env/components/filter_group/filter_select_item.styles.js +2 -1
- package/test-env/components/flyout/_flyout_close_button.styles.js +2 -1
- package/test-env/components/flyout/flyout.styles.js +2 -7
- package/test-env/components/flyout/flyout_footer.styles.js +1 -1
- package/test-env/components/form/form.styles.js +31 -27
- package/test-env/components/form/range/range_tooltip.styles.js +13 -11
- package/test-env/components/form/switch/switch.js +2 -3
- package/test-env/components/form/switch/switch.styles.js +19 -16
- package/test-env/components/header/header.styles.js +6 -5
- package/test-env/components/icon/icon.styles.js +8 -9
- package/test-env/components/icon/named_colors.js +1 -1
- package/test-env/components/inline_edit/inline_edit_form.styles.js +2 -1
- package/test-env/components/key_pad_menu/key_pad_menu_item.styles.js +2 -1
- package/test-env/components/list_group/list_group_item.styles.js +10 -8
- package/test-env/components/loading/loading_chart.styles.js +5 -13
- package/test-env/components/mark/mark.styles.js +9 -2
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +3 -2
- package/test-env/components/markdown_editor/markdown_format.styles.js +2 -2
- package/test-env/components/modal/modal.styles.js +1 -1
- package/test-env/components/overlay_mask/overlay_mask.styles.js +2 -1
- package/test-env/components/page_template/inner/page_inner.styles.js +1 -1
- package/test-env/components/panel/panel.js +1 -1
- package/test-env/components/panel/panel.styles.js +1 -1
- package/test-env/components/panel/split_panel/split_panel.js +1 -1
- package/test-env/components/popover/popover.js +1 -1
- package/test-env/components/popover/popover_arrow/_popover_arrow.js +3 -8
- package/test-env/components/popover/popover_arrow/_popover_arrow.styles.js +15 -16
- package/test-env/components/popover/popover_footer.styles.js +1 -1
- package/test-env/components/popover/popover_panel/_popover_panel.styles.js +4 -4
- package/test-env/components/progress/progress.js +1 -1
- package/test-env/components/progress/progress.styles.js +27 -29
- package/test-env/components/resizable_container/resizable_panel.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.styles.js +2 -1
- package/test-env/components/side_nav/side_nav_item.styles.js +2 -1
- package/test-env/components/skeleton/utils.js +6 -4
- package/test-env/components/steps/step_number.styles.js +1 -1
- package/test-env/components/table/table_cells_shared.styles.js +7 -2
- package/test-env/components/table/table_row.styles.js +9 -7
- package/test-env/components/text/text.styles.js +1 -1
- package/test-env/components/text/text_color.js +1 -1
- package/test-env/components/text/text_color.styles.js +5 -6
- package/test-env/components/toast/toast.styles.js +1 -1
- package/test-env/components/token/token.js +4 -13
- package/test-env/components/token/token.styles.js +3 -12
- package/test-env/components/token/token_map.js +2 -244
- package/test-env/components/tool_tip/tool_tip.styles.js +23 -11
- package/test-env/components/tour/_tour_footer.styles.js +4 -2
- package/test-env/components/tour/tour.styles.js +12 -8
- package/test-env/components/tree_view/tree_view_item.styles.js +2 -1
- package/test-env/global_styling/functions/math.js +59 -7
- package/test-env/global_styling/functions/size.js +27 -7
- package/test-env/global_styling/mixins/_color.js +30 -38
- package/test-env/global_styling/mixins/index.js +0 -11
- package/test-env/global_styling/reset/global_styles.js +1 -1
- package/test-env/global_styling/variables/_colors_vis.js +61 -6
- package/test-env/global_styling/variables/animations.js +31 -25
- package/test-env/global_styling/variables/breakpoint.js +16 -7
- package/test-env/global_styling/variables/levels.js +26 -7
- package/test-env/global_styling/variables/shadow.js +20 -13
- package/test-env/global_styling/variables/size.js +10 -7
- package/test-env/global_styling/variables/typography.js +41 -19
- package/test-env/services/color/eui_palettes.js +47 -116
- package/test-env/services/color/index.js +0 -8
- package/test-env/services/index.js +0 -7
- package/test-env/services/popover/index.js +1 -8
- package/test-env/services/popover/popover_positioning.js +17 -6
- package/test-env/services/theme/provider.js +2 -26
- package/test-env/services/theme/types.js +14 -13
- package/test-env/services/theme/utils.js +296 -54
- package/test-env/themes/amsterdam/global_styling/mixins/button.js +203 -45
- package/test-env/themes/amsterdam/global_styling/variables/_borders.js +3 -3
- package/test-env/themes/amsterdam/global_styling/variables/_colors.js +19 -611
- package/test-env/themes/amsterdam/theme.js +1 -7
- package/test-env/themes/index.js +0 -7
- package/test-env/themes/themes.js +7 -10
- package/dist/eui_theme_borealis_dark.json +0 -314
- package/dist/eui_theme_borealis_dark.json.d.ts +0 -317
- package/dist/eui_theme_borealis_light.json +0 -314
- package/dist/eui_theme_borealis_light.json.d.ts +0 -317
- package/es/global_styling/mixins/_button.js +0 -159
- package/es/services/color/vis_color_store.js +0 -13
- package/es/services/popover/popover_arrow.styles.js +0 -31
- package/es/themes/amsterdam/global_styling/variables/_buttons.js +0 -281
- package/es/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -94
- package/es/themes/amsterdam/global_styling/variables/_components.js +0 -604
- package/es/themes/amsterdam/global_styling/variables/_forms.js +0 -161
- package/lib/global_styling/mixins/_button.js +0 -164
- package/lib/services/color/vis_color_store.js +0 -18
- package/lib/services/popover/popover_arrow.styles.js +0 -37
- package/lib/themes/amsterdam/global_styling/variables/_buttons.js +0 -285
- package/lib/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -100
- package/lib/themes/amsterdam/global_styling/variables/_components.js +0 -608
- package/lib/themes/amsterdam/global_styling/variables/_forms.js +0 -165
- package/optimize/es/global_styling/mixins/_button.js +0 -159
- package/optimize/es/services/color/vis_color_store.js +0 -13
- package/optimize/es/services/popover/popover_arrow.styles.js +0 -31
- package/optimize/es/themes/amsterdam/global_styling/variables/_buttons.js +0 -270
- package/optimize/es/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -94
- package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +0 -596
- package/optimize/es/themes/amsterdam/global_styling/variables/_forms.js +0 -153
- package/optimize/lib/global_styling/mixins/_button.js +0 -165
- package/optimize/lib/services/color/vis_color_store.js +0 -18
- package/optimize/lib/services/popover/popover_arrow.styles.js +0 -37
- package/optimize/lib/themes/amsterdam/global_styling/variables/_buttons.js +0 -275
- package/optimize/lib/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -100
- package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +0 -601
- package/optimize/lib/themes/amsterdam/global_styling/variables/_forms.js +0 -158
- package/src/themes/amsterdam/global_styling/variables/_colors_vis.scss +0 -72
- package/src/themes/amsterdam/global_styling/variables/_forms.scss +0 -12
- package/test-env/global_styling/mixins/_button.js +0 -165
- package/test-env/services/color/vis_color_store.js +0 -18
- package/test-env/services/popover/popover_arrow.styles.js +0 -37
- package/test-env/themes/amsterdam/global_styling/variables/_buttons.js +0 -275
- package/test-env/themes/amsterdam/global_styling/variables/_colors_vis.js +0 -100
- package/test-env/themes/amsterdam/global_styling/variables/_components.js +0 -601
- package/test-env/themes/amsterdam/global_styling/variables/_forms.js +0 -158
- /package/dist/{eui_theme_amsterdam_dark.json → eui_theme_dark.json} +0 -0
- /package/dist/{eui_theme_amsterdam_light.json → eui_theme_light.json} +0 -0
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3
|
+
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; }
|
|
4
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
5
|
+
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."); }
|
|
6
|
+
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; } }
|
|
7
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
8
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); }
|
|
15
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
16
|
/*
|
|
2
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
18
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -6,4 +21,291 @@
|
|
|
6
21
|
* Side Public License, v 1.
|
|
7
22
|
*/
|
|
8
23
|
|
|
9
|
-
|
|
24
|
+
import { COLOR_MODES_STANDARD, COLOR_MODES_INVERSE } from './types';
|
|
25
|
+
export var DEFAULT_COLOR_MODE = COLOR_MODES_STANDARD.light;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Returns whether the parameter is an object
|
|
29
|
+
* @param {any} obj - Anything
|
|
30
|
+
*/
|
|
31
|
+
var isObject = function isObject(obj) {
|
|
32
|
+
return obj && _typeof(obj) === 'object';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns whether the provided color mode is `inverse`
|
|
37
|
+
* @param {string} colorMode - `light`, `dark`, or `inverse`
|
|
38
|
+
*/
|
|
39
|
+
export var isInverseColorMode = function isInverseColorMode(colorMode) {
|
|
40
|
+
return colorMode === COLOR_MODES_INVERSE;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the color mode configured in the current EuiThemeProvider.
|
|
45
|
+
* Returns the parent color mode if none is explicity set.
|
|
46
|
+
* @param {string} colorMode - `light`, `dark`, or `inverse`
|
|
47
|
+
* @param {string} parentColorMode - `LIGHT` or `DARK`; used as the fallback
|
|
48
|
+
*/
|
|
49
|
+
export var getColorMode = function getColorMode(colorMode, parentColorMode) {
|
|
50
|
+
if (colorMode == null) {
|
|
51
|
+
return parentColorMode || DEFAULT_COLOR_MODE;
|
|
52
|
+
}
|
|
53
|
+
var mode = colorMode.toUpperCase();
|
|
54
|
+
if (isInverseColorMode(mode)) {
|
|
55
|
+
return parentColorMode === COLOR_MODES_STANDARD.dark || parentColorMode === undefined ? COLOR_MODES_STANDARD.light : COLOR_MODES_STANDARD.dark;
|
|
56
|
+
} else {
|
|
57
|
+
return mode;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Returns a value at a given path on an object.
|
|
63
|
+
* If `colorMode` is provided, will scope the value to the appropriate color mode key (LIGHT\DARK)
|
|
64
|
+
* @param {object} model - Object
|
|
65
|
+
* @param {string} _path - Dot-notated string to a path on the object
|
|
66
|
+
* @param {string} colorMode - `light` or `dark`
|
|
67
|
+
*/
|
|
68
|
+
export var getOn = function getOn(model, _path, colorMode) {
|
|
69
|
+
var path = _path.split('.');
|
|
70
|
+
var node = model;
|
|
71
|
+
while (path.length) {
|
|
72
|
+
var segment = path.shift();
|
|
73
|
+
if (node.hasOwnProperty(segment) === false) {
|
|
74
|
+
if (colorMode && node.hasOwnProperty(colorMode) === true && node[colorMode].hasOwnProperty(segment) === true) {
|
|
75
|
+
if (node[colorMode][segment] instanceof Computed) {
|
|
76
|
+
node = node[colorMode][segment].getValue(null, null, node, colorMode);
|
|
77
|
+
} else {
|
|
78
|
+
node = node[colorMode][segment];
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
if (node[segment] instanceof Computed) {
|
|
85
|
+
node = node[segment].getValue(null, null, node, colorMode);
|
|
86
|
+
} else {
|
|
87
|
+
node = node[segment];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return node;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Sets a value at a given path on an object.
|
|
96
|
+
* @param {object} model - Object
|
|
97
|
+
* @param {string} _path - Dot-notated string to a path on the object
|
|
98
|
+
* @param {any} string - The value to set
|
|
99
|
+
*/
|
|
100
|
+
export var setOn = function setOn(model, _path, value) {
|
|
101
|
+
var path = _path.split('.');
|
|
102
|
+
var propertyName = path.pop();
|
|
103
|
+
var node = model;
|
|
104
|
+
while (path.length) {
|
|
105
|
+
var segment = path.shift();
|
|
106
|
+
if (node.hasOwnProperty(segment) === false) {
|
|
107
|
+
node[segment] = {};
|
|
108
|
+
}
|
|
109
|
+
node = node[segment];
|
|
110
|
+
}
|
|
111
|
+
node[propertyName] = value;
|
|
112
|
+
return true;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Creates a class to store the `computer` method and its eventual parameters.
|
|
117
|
+
* Allows for on-demand computation with up-to-date parameters via `getValue` method.
|
|
118
|
+
* @constructor
|
|
119
|
+
* @param {function} computer - Function to be computed
|
|
120
|
+
* @param {string | array} dependencies - Dependencies passed to the `computer` as parameters
|
|
121
|
+
*/
|
|
122
|
+
export var Computed = /*#__PURE__*/function () {
|
|
123
|
+
function Computed(computer) {
|
|
124
|
+
var dependencies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
125
|
+
_classCallCheck(this, Computed);
|
|
126
|
+
this.computer = computer;
|
|
127
|
+
this.dependencies = dependencies;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Executes the `computer` method with the current state of the theme
|
|
132
|
+
* by taking into account previously computed values and modifications.
|
|
133
|
+
* @param {Proxy | object} base - Computed or uncomputed theme
|
|
134
|
+
* @param {Proxy | object} modifications - Theme value overrides
|
|
135
|
+
* @param {object} working - Partially computed theme
|
|
136
|
+
* @param {string} colorMode - `light` or `dark`
|
|
137
|
+
*/
|
|
138
|
+
return _createClass(Computed, [{
|
|
139
|
+
key: "getValue",
|
|
140
|
+
value: function getValue(base) {
|
|
141
|
+
var modifications = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
142
|
+
var working = arguments.length > 2 ? arguments[2] : undefined;
|
|
143
|
+
var colorMode = arguments.length > 3 ? arguments[3] : undefined;
|
|
144
|
+
if (!this.dependencies.length) {
|
|
145
|
+
return this.computer(working);
|
|
146
|
+
}
|
|
147
|
+
if (!Array.isArray(this.dependencies)) {
|
|
148
|
+
var _ref, _getOn;
|
|
149
|
+
return this.computer((_ref = (_getOn = getOn(working, this.dependencies)) !== null && _getOn !== void 0 ? _getOn : getOn(modifications, this.dependencies, colorMode)) !== null && _ref !== void 0 ? _ref : getOn(base, this.dependencies, colorMode));
|
|
150
|
+
}
|
|
151
|
+
return this.computer(this.dependencies.map(function (dependency) {
|
|
152
|
+
var _ref2, _getOn2;
|
|
153
|
+
return (_ref2 = (_getOn2 = getOn(working, dependency)) !== null && _getOn2 !== void 0 ? _getOn2 : getOn(modifications, dependency, colorMode)) !== null && _ref2 !== void 0 ? _ref2 : getOn(base, dependency, colorMode);
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
}]);
|
|
157
|
+
}();
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Returns a Class (`Computed`) that stores the arbitrary computer method
|
|
161
|
+
* and references to its optional dependecies.
|
|
162
|
+
* @param {function} computer - Arbitrary method to be called at compute time.
|
|
163
|
+
* @param {string | array} dependencies - Values that will be provided to `computer` at compute time.
|
|
164
|
+
*/
|
|
165
|
+
|
|
166
|
+
export function computed(comp, dep) {
|
|
167
|
+
return new Computed(comp, dep);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Takes an uncomputed theme, and computes and returns all values taking
|
|
172
|
+
* into consideration value overrides and configured color mode.
|
|
173
|
+
* Overrides take precedence, and only values in the current color mode
|
|
174
|
+
* are computed and returned.
|
|
175
|
+
* @param {Proxy} base - Object to transform into Proxy
|
|
176
|
+
* @param {Proxy | object} over - Unique identifier or name
|
|
177
|
+
* @param {string} colorMode - `light` or `dark`
|
|
178
|
+
*/
|
|
179
|
+
export var getComputed = function getComputed(base, over, colorMode) {
|
|
180
|
+
var output = {
|
|
181
|
+
themeName: base.key
|
|
182
|
+
};
|
|
183
|
+
function loop(base, over) {
|
|
184
|
+
var checkExisting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
185
|
+
var path = arguments.length > 3 ? arguments[3] : undefined;
|
|
186
|
+
Object.keys(base).forEach(function (key) {
|
|
187
|
+
var newPath = path ? "".concat(path, ".").concat(key) : "".concat(key);
|
|
188
|
+
// @ts-expect-error `key` is not necessarily a colorMode key
|
|
189
|
+
if ([].concat(_toConsumableArray(Object.values(COLOR_MODES_STANDARD)), [colorMode]).includes(key)) {
|
|
190
|
+
if (key !== colorMode) {
|
|
191
|
+
return;
|
|
192
|
+
} else {
|
|
193
|
+
var colorModeSegment = new RegExp("(\\.".concat(colorMode, "\\b)|(\\b").concat(colorMode, "\\.)"));
|
|
194
|
+
newPath = newPath.replace(colorModeSegment, '');
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
var existing = checkExisting && getOn(output, newPath);
|
|
198
|
+
if (!existing || isObject(existing)) {
|
|
199
|
+
var baseValue = base[key] instanceof Computed ? base[key].getValue(base.root, over.root, output, colorMode) : base[key];
|
|
200
|
+
var overValue = over[key] instanceof Computed ? over[key].getValue(base.root, over.root, output, colorMode) : over[key];
|
|
201
|
+
if (isObject(baseValue) && !Array.isArray(baseValue)) {
|
|
202
|
+
loop(baseValue, overValue !== null && overValue !== void 0 ? overValue : {}, checkExisting, newPath);
|
|
203
|
+
} else {
|
|
204
|
+
setOn(output, newPath, overValue !== null && overValue !== void 0 ? overValue : baseValue);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
// Compute standard theme values and apply overrides
|
|
210
|
+
loop(base, over);
|
|
211
|
+
// Compute and apply extension values only
|
|
212
|
+
loop(over, {}, true);
|
|
213
|
+
return output;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Builds a Proxy with a custom `handler` designed to self-reference values
|
|
218
|
+
* and prevent arbitrary value overrides.
|
|
219
|
+
* @param {object} model - Object to transform into Proxy
|
|
220
|
+
* @param {string} key - Unique identifier or name
|
|
221
|
+
*/
|
|
222
|
+
export var buildTheme = function buildTheme(model, key) {
|
|
223
|
+
var handler = {
|
|
224
|
+
getPrototypeOf: function getPrototypeOf(target) {
|
|
225
|
+
return Reflect.getPrototypeOf(target.model);
|
|
226
|
+
},
|
|
227
|
+
setPrototypeOf: function setPrototypeOf(target, prototype) {
|
|
228
|
+
return Reflect.setPrototypeOf(target.model, prototype);
|
|
229
|
+
},
|
|
230
|
+
isExtensible: function isExtensible(target) {
|
|
231
|
+
return Reflect.isExtensible(target);
|
|
232
|
+
},
|
|
233
|
+
preventExtensions: function preventExtensions(target) {
|
|
234
|
+
return Reflect.preventExtensions(target.model);
|
|
235
|
+
},
|
|
236
|
+
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, key) {
|
|
237
|
+
return Reflect.getOwnPropertyDescriptor(target.model, key);
|
|
238
|
+
},
|
|
239
|
+
defineProperty: function defineProperty(target, property, attributes) {
|
|
240
|
+
return Reflect.defineProperty(target.model, property, attributes);
|
|
241
|
+
},
|
|
242
|
+
has: function has(target, property) {
|
|
243
|
+
return Reflect.has(target.model, property);
|
|
244
|
+
},
|
|
245
|
+
get: function get(_target, property) {
|
|
246
|
+
if (property === 'key') {
|
|
247
|
+
return _target[property];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// prevent Safari from locking up when the proxy is used in dev tools
|
|
251
|
+
// as it doesn't support getPrototypeOf
|
|
252
|
+
if (property === '__proto__') return {};
|
|
253
|
+
var target = property === 'root' ? _target : _target.model || _target;
|
|
254
|
+
// @ts-ignore `string` index signature
|
|
255
|
+
var value = target[property];
|
|
256
|
+
if (isObject(value) && !Array.isArray(value)) {
|
|
257
|
+
return new Proxy({
|
|
258
|
+
model: value,
|
|
259
|
+
root: _target.root,
|
|
260
|
+
key: "_".concat(_target.key)
|
|
261
|
+
}, handler);
|
|
262
|
+
} else {
|
|
263
|
+
return value;
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
set: function set(target) {
|
|
267
|
+
return target;
|
|
268
|
+
},
|
|
269
|
+
deleteProperty: function deleteProperty(target) {
|
|
270
|
+
return target;
|
|
271
|
+
},
|
|
272
|
+
ownKeys: function ownKeys(target) {
|
|
273
|
+
return Reflect.ownKeys(target.model);
|
|
274
|
+
},
|
|
275
|
+
apply: function apply(target) {
|
|
276
|
+
return target;
|
|
277
|
+
},
|
|
278
|
+
construct: function construct(target) {
|
|
279
|
+
return target;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
var themeProxy = new Proxy({
|
|
283
|
+
model: model,
|
|
284
|
+
root: model,
|
|
285
|
+
key: key
|
|
286
|
+
}, handler);
|
|
287
|
+
return themeProxy;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Deeply merges two objects, using `source` values whenever possible.
|
|
292
|
+
* @param {object} _target - Object with fallback values
|
|
293
|
+
* @param {object} source - Object with desired values
|
|
294
|
+
*/
|
|
295
|
+
export var mergeDeep = function mergeDeep(_target) {
|
|
296
|
+
var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
297
|
+
var target = _objectSpread({}, _target);
|
|
298
|
+
if (!isObject(target) || !isObject(source)) {
|
|
299
|
+
return source;
|
|
300
|
+
}
|
|
301
|
+
Object.keys(source).forEach(function (key) {
|
|
302
|
+
var targetValue = target[key];
|
|
303
|
+
var sourceValue = source[key];
|
|
304
|
+
if (isObject(targetValue) && isObject(sourceValue)) {
|
|
305
|
+
target[key] = mergeDeep(_objectSpread({}, targetValue), _objectSpread({}, sourceValue));
|
|
306
|
+
} else {
|
|
307
|
+
target[key] = sourceValue;
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
return target;
|
|
311
|
+
};
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
3
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
4
|
+
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."); }
|
|
5
|
+
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; } }
|
|
6
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
7
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
8
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1
9
|
/*
|
|
2
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
11
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -6,4 +14,198 @@
|
|
|
6
14
|
* Side Public License, v 1.
|
|
7
15
|
*/
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
import { css, keyframes } from '@emotion/react';
|
|
18
|
+
import { euiBackgroundColor, euiCanAnimate } from '../../../../global_styling';
|
|
19
|
+
import { hexToRgb, isColorDark, makeHighContrastColor, shade, tint, transparentize, useEuiMemoizedStyles } from '../../../../services';
|
|
20
|
+
export var BUTTON_COLORS = ['text', 'accent', 'primary', 'success', 'warning', 'danger'];
|
|
21
|
+
export var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
|
|
22
|
+
/**
|
|
23
|
+
* Creates the `base` version of button styles with proper text contrast.
|
|
24
|
+
* @param euiThemeContext
|
|
25
|
+
* @param color One of the named button colors or 'disabled'
|
|
26
|
+
* @returns Style object `{ backgroundColor, color }`
|
|
27
|
+
*/
|
|
28
|
+
export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
29
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
30
|
+
colorMode = euiThemeContext.colorMode;
|
|
31
|
+
function tintOrShade(color) {
|
|
32
|
+
return colorMode === 'DARK' ? shade(color, 0.7) : tint(color, 0.8);
|
|
33
|
+
}
|
|
34
|
+
var foreground;
|
|
35
|
+
var background;
|
|
36
|
+
switch (color) {
|
|
37
|
+
case 'disabled':
|
|
38
|
+
return {
|
|
39
|
+
color: euiTheme.colors.disabledText,
|
|
40
|
+
backgroundColor: transparentize(euiTheme.colors.lightShade, 0.15)
|
|
41
|
+
};
|
|
42
|
+
case 'text':
|
|
43
|
+
foreground = euiTheme.colors[color];
|
|
44
|
+
background = colorMode === 'DARK' ? shade(euiTheme.colors.lightShade, 0.2) : tint(euiTheme.colors.lightShade, 0.5);
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
foreground = euiTheme.colors["".concat(color, "Text")];
|
|
48
|
+
background = tintOrShade(euiTheme.colors[color]);
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
color: makeHighContrastColor(foreground)(background),
|
|
53
|
+
backgroundColor: background
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Creates the `fill` version of buttons styles with proper text contrast.
|
|
59
|
+
* @param euiThemeContext
|
|
60
|
+
* @param color One of the named button colors or 'disabled'
|
|
61
|
+
* @returns Style object `{ backgroundColor, color }`
|
|
62
|
+
*/
|
|
63
|
+
export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
|
|
64
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
65
|
+
colorMode = euiThemeContext.colorMode;
|
|
66
|
+
var getForegroundColor = function getForegroundColor(background) {
|
|
67
|
+
return isColorDark.apply(void 0, _toConsumableArray(hexToRgb(background))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
|
|
68
|
+
};
|
|
69
|
+
var background;
|
|
70
|
+
var foreground;
|
|
71
|
+
switch (color) {
|
|
72
|
+
case 'disabled':
|
|
73
|
+
background = euiButtonColor(euiThemeContext, color).backgroundColor;
|
|
74
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
75
|
+
break;
|
|
76
|
+
case 'text':
|
|
77
|
+
background = colorMode === 'DARK' ? euiTheme.colors.text : euiTheme.colors.darkShade;
|
|
78
|
+
foreground = getForegroundColor(background);
|
|
79
|
+
break;
|
|
80
|
+
case 'success':
|
|
81
|
+
case 'accent':
|
|
82
|
+
// Success / accent fills are hard to read on light mode even though they pass color contrast ratios
|
|
83
|
+
// TODO: If WCAG 3 gets adopted (which would calculates luminosity & would allow us to use white text instead),
|
|
84
|
+
// we can get rid of this case (https://blog.datawrapper.de/color-contrast-check-data-vis-wcag-apca/)
|
|
85
|
+
background = colorMode === 'LIGHT' ? tint(euiTheme.colors[color], 0.3) : euiTheme.colors[color];
|
|
86
|
+
foreground = getForegroundColor(background);
|
|
87
|
+
break;
|
|
88
|
+
default:
|
|
89
|
+
background = euiTheme.colors[color];
|
|
90
|
+
foreground = getForegroundColor(background);
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
color: foreground,
|
|
95
|
+
backgroundColor: background
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Creates the `empty` version of button styles using the text-variant and adding interactive styles.
|
|
101
|
+
* @param euiThemeContext
|
|
102
|
+
* @param color One of the named button colors or 'disabled'
|
|
103
|
+
* @returns Style object `{ backgroundColor, color }` where `background` is typically used for interactive states
|
|
104
|
+
*/
|
|
105
|
+
export var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, color) {
|
|
106
|
+
var foreground;
|
|
107
|
+
var background;
|
|
108
|
+
switch (color) {
|
|
109
|
+
case 'disabled':
|
|
110
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
111
|
+
background = 'transparent';
|
|
112
|
+
break;
|
|
113
|
+
case 'text':
|
|
114
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
115
|
+
background = euiBackgroundColor(euiThemeContext, 'subdued', {
|
|
116
|
+
method: 'transparent'
|
|
117
|
+
});
|
|
118
|
+
break;
|
|
119
|
+
default:
|
|
120
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
121
|
+
background = euiBackgroundColor(euiThemeContext, color, {
|
|
122
|
+
method: 'transparent'
|
|
123
|
+
});
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
color: foreground,
|
|
128
|
+
backgroundColor: background
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Given the button display type, returns the Emotion based color keys.
|
|
134
|
+
* @param options Button display type
|
|
135
|
+
* @returns An object of `_EuiButtonColor` keys including `disabled`
|
|
136
|
+
*/
|
|
137
|
+
export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
|
|
138
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
139
|
+
var _options$display = options.display,
|
|
140
|
+
display = _options$display === void 0 ? 'base' : _options$display;
|
|
141
|
+
var colorsDisplaysMap = useEuiMemoizedStyles(euiButtonDisplaysColors);
|
|
142
|
+
return colorsDisplaysMap[display];
|
|
143
|
+
};
|
|
144
|
+
var euiButtonDisplaysColors = function euiButtonDisplaysColors(euiThemeContext) {
|
|
145
|
+
var COLORS = [].concat(BUTTON_COLORS, ['disabled']);
|
|
146
|
+
var displaysColorsMap = {};
|
|
147
|
+
BUTTON_DISPLAYS.forEach(function (display) {
|
|
148
|
+
displaysColorsMap[display] = {};
|
|
149
|
+
COLORS.forEach(function (color) {
|
|
150
|
+
switch (display) {
|
|
151
|
+
case 'base':
|
|
152
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonColor(euiThemeContext, color), ";;label:displaysColorsMap-display-color;");
|
|
153
|
+
break;
|
|
154
|
+
case 'fill':
|
|
155
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:displaysColorsMap-display-color;");
|
|
156
|
+
break;
|
|
157
|
+
case 'empty':
|
|
158
|
+
displaysColorsMap[display][color] = /*#__PURE__*/css("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:displaysColorsMap-display-color;");
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Tweak auto-generated Emotion label/className output
|
|
163
|
+
var emotionOutput = displaysColorsMap[display][color];
|
|
164
|
+
emotionOutput.styles = emotionOutput.styles.replace('label:displaysColorsMap-display-color;', "label:".concat(display, "-").concat(color, ";"));
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
return displaysColorsMap;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Creates the translate animation when button is in focus.
|
|
172
|
+
* @returns string
|
|
173
|
+
*/
|
|
174
|
+
export var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
|
|
175
|
+
return useEuiMemoizedStyles(euiButtonFocusCSS);
|
|
176
|
+
};
|
|
177
|
+
var euiButtonFocusAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 50% {\n transform: translateY(1px);\n }\n"])));
|
|
178
|
+
var euiButtonFocusCSS = function euiButtonFocusCSS(_ref) {
|
|
179
|
+
var euiTheme = _ref.euiTheme;
|
|
180
|
+
var 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;");
|
|
181
|
+
// Remove the auto-generated label.
|
|
182
|
+
// We could typically avoid a label by using a plain string `` instead of css``,
|
|
183
|
+
// but we need css`` for keyframes`` to work for the focus animation
|
|
184
|
+
focusCSS.styles = focusCSS.styles.replace('label:focusCSS;', '');
|
|
185
|
+
return focusCSS;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Map of `size` props to various sizings/scales
|
|
190
|
+
* that should remain consistent across all buttons
|
|
191
|
+
*/
|
|
192
|
+
export var euiButtonSizeMap = function euiButtonSizeMap(_ref2) {
|
|
193
|
+
var euiTheme = _ref2.euiTheme;
|
|
194
|
+
return {
|
|
195
|
+
xs: {
|
|
196
|
+
height: euiTheme.size.l,
|
|
197
|
+
radius: euiTheme.border.radius.small,
|
|
198
|
+
fontScale: 'xs'
|
|
199
|
+
},
|
|
200
|
+
s: {
|
|
201
|
+
height: euiTheme.size.xl,
|
|
202
|
+
radius: euiTheme.border.radius.small,
|
|
203
|
+
fontScale: 's'
|
|
204
|
+
},
|
|
205
|
+
m: {
|
|
206
|
+
height: euiTheme.size.xxl,
|
|
207
|
+
radius: euiTheme.border.radius.medium,
|
|
208
|
+
fontScale: 's'
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
};
|
|
@@ -17,9 +17,9 @@ import { computed } from '../../../../services/theme/utils';
|
|
|
17
17
|
export var border = {
|
|
18
18
|
color: computed(function (_ref) {
|
|
19
19
|
var _ref2 = _slicedToArray(_ref, 1),
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
}, ['colors.
|
|
20
|
+
lightShade = _ref2[0];
|
|
21
|
+
return lightShade;
|
|
22
|
+
}, ['colors.lightShade']),
|
|
23
23
|
width: {
|
|
24
24
|
thin: '1px',
|
|
25
25
|
thick: '2px'
|