@elastic/eui 64.0.1 → 65.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +330 -330
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +160 -1248
- package/dist/eui_theme_dark.json +0 -32
- package/dist/eui_theme_dark.json.d.ts +0 -32
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +132 -1220
- package/dist/eui_theme_light.json +0 -32
- package/dist/eui_theme_light.json.d.ts +0 -32
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +2 -1
- package/es/components/accessibility/skip_link/skip_link.js +4 -54
- package/es/components/accordion/accordion.js +2 -1
- package/es/components/accordion/accordion.styles.js +17 -27
- package/es/components/badge/beta_badge/beta_badge.js +16 -3
- package/es/components/basic_table/basic_table.js +1 -1
- package/es/components/basic_table/collapsed_item_actions.js +1 -1
- package/es/components/basic_table/in_memory_table.js +1 -1
- package/es/components/beacon/beacon.styles.js +2 -2
- package/es/components/button/button.js +112 -215
- package/es/components/button/button_display/_button_display.js +90 -40
- package/es/components/button/button_display/_button_display.styles.js +7 -16
- package/es/components/button/button_display/_button_display_content.js +6 -3
- package/es/components/button/button_display/_button_display_content.styles.js +7 -17
- package/es/components/button/button_empty/button_empty.js +63 -53
- package/es/components/button/button_empty/index.js +1 -1
- package/es/components/button/button_group/button_group.js +4 -12
- package/es/components/button/button_group/button_group_button.js +14 -4
- package/es/components/button/button_icon/button_icon.js +61 -42
- package/es/components/call_out/call_out.styles.js +2 -1
- package/es/components/card/card.js +173 -89
- package/es/components/card/card.styles.js +136 -0
- package/es/components/card/card_select/card_select.js +133 -0
- package/es/components/card/card_select/card_select.styles.js +25 -0
- package/es/components/card/card_select/index.js +8 -0
- package/es/components/card/checkable_card/checkable_card.js +14 -9
- package/es/components/card/checkable_card/checkable_card.styles.js +22 -0
- package/es/components/comment_list/comment_event.styles.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +7 -6
- package/es/components/datagrid/body/data_grid_cell.js +13 -12
- package/es/components/datagrid/body/header/data_grid_header_cell.js +7 -6
- package/es/components/datagrid/body/header/data_grid_header_row.js +7 -6
- package/es/components/datagrid/data_grid.js +7 -6
- package/es/components/datagrid/utils/in_memory.js +7 -6
- package/es/components/date_picker/auto_refresh/auto_refresh.js +3 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +17 -1
- package/es/components/date_picker/super_date_picker/super_update_button.js +11 -1
- package/es/components/expression/expression.styles.js +13 -31
- package/es/components/facet/facet_button.js +5 -4
- package/es/components/header/header_links/header_link.js +5 -3
- package/es/components/image/image_button.styles.js +1 -1
- package/es/components/image/image_wrapper.styles.js +3 -3
- package/es/components/link/link.styles.js +2 -2
- package/es/components/list_group/list_group.js +2 -1
- package/es/components/list_group/list_group_item.js +2 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
- package/es/components/loading/loading_chart.styles.js +16 -26
- package/es/components/loading/loading_content.styles.js +2 -2
- package/es/components/loading/loading_logo.styles.js +4 -4
- package/es/components/loading/loading_spinner.styles.js +6 -6
- package/es/components/markdown_editor/markdown_editor_toolbar.js +2 -0
- package/es/components/modal/confirm_modal.js +1 -1
- package/es/components/notification/notification_event.js +5 -3
- package/es/components/notification/notification_event_read_button.js +2 -1
- package/es/components/page/page_template.js +2 -2
- package/es/components/page_template/inner/page_inner.styles.js +2 -2
- package/es/components/page_template/outer/page_outer.styles.js +3 -1
- package/es/components/pagination/pagination_button.js +5 -3
- package/es/components/panel/panel.js +1 -1
- package/es/components/panel/{panel.style.js → panel.styles.js} +2 -2
- package/es/components/progress/progress.styles.js +2 -2
- package/es/components/title/title.styles.js +2 -2
- package/es/components/toast/toast.styles.js +4 -4
- package/es/components/tool_tip/icon_tip.js +11 -1
- package/es/components/tool_tip/tool_tip.js +18 -6
- package/es/global_styling/functions/logicals.js +2 -72
- package/es/global_styling/functions/typography.js +2 -1
- package/es/global_styling/mixins/_color.js +1 -1
- package/es/global_styling/mixins/_helpers.js +7 -1
- package/es/global_styling/reset/global_styles.js +2 -1
- package/es/themes/amsterdam/global_styling/mixins/button.js +165 -16
- package/eui.d.ts +1062 -936
- package/i18ntokens.json +15 -15
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
- package/lib/components/accessibility/skip_link/skip_link.js +4 -54
- package/lib/components/accordion/accordion.js +3 -1
- package/lib/components/accordion/accordion.styles.js +17 -26
- package/lib/components/badge/beta_badge/beta_badge.js +16 -3
- package/lib/components/basic_table/basic_table.js +1 -1
- package/lib/components/basic_table/collapsed_item_actions.js +1 -1
- package/lib/components/basic_table/in_memory_table.js +1 -1
- package/lib/components/beacon/beacon.styles.js +1 -1
- package/lib/components/button/button.js +124 -229
- package/lib/components/button/button_display/_button_display.js +94 -33
- package/lib/components/button/button_display/_button_display.styles.js +7 -16
- package/lib/components/button/button_display/_button_display_content.js +7 -3
- package/lib/components/button/button_display/_button_display_content.styles.js +7 -17
- package/lib/components/button/button_empty/button_empty.js +64 -54
- package/lib/components/button/button_empty/index.js +0 -6
- package/lib/components/button/button_group/button_group.js +4 -12
- package/lib/components/button/button_group/button_group_button.js +15 -4
- package/lib/components/button/button_icon/button_icon.js +61 -43
- package/lib/components/call_out/call_out.styles.js +2 -1
- package/lib/components/card/card.js +174 -88
- package/lib/components/card/card.styles.js +146 -0
- package/lib/components/card/card_select/card_select.js +144 -0
- package/lib/components/card/card_select/card_select.styles.js +27 -0
- package/lib/components/card/card_select/index.js +19 -0
- package/lib/components/card/checkable_card/checkable_card.js +16 -9
- package/lib/components/card/checkable_card/checkable_card.styles.js +33 -0
- package/lib/components/comment_list/comment_event.styles.js +1 -1
- package/lib/components/datagrid/body/data_grid_body.js +7 -6
- package/lib/components/datagrid/body/data_grid_cell.js +13 -12
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +7 -6
- package/lib/components/datagrid/body/header/data_grid_header_row.js +7 -6
- package/lib/components/datagrid/data_grid.js +7 -6
- package/lib/components/datagrid/utils/in_memory.js +7 -6
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +3 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +17 -1
- package/lib/components/date_picker/super_date_picker/super_update_button.js +11 -1
- package/lib/components/expression/expression.styles.js +12 -30
- package/lib/components/facet/facet_button.js +4 -3
- package/lib/components/header/header_links/header_link.js +5 -3
- package/lib/components/image/image_button.styles.js +1 -1
- package/lib/components/image/image_wrapper.styles.js +2 -2
- package/lib/components/link/link.styles.js +1 -1
- package/lib/components/list_group/list_group.js +2 -1
- package/lib/components/list_group/list_group_item.js +2 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
- package/lib/components/loading/loading_chart.styles.js +16 -25
- package/lib/components/loading/loading_content.styles.js +1 -1
- package/lib/components/loading/loading_logo.styles.js +4 -4
- package/lib/components/loading/loading_spinner.styles.js +5 -5
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +2 -0
- package/lib/components/modal/confirm_modal.js +1 -1
- package/lib/components/notification/notification_event.js +5 -3
- package/lib/components/notification/notification_event_read_button.js +2 -1
- package/lib/components/page/page_template.js +1 -1
- package/lib/components/page_template/inner/page_inner.styles.js +2 -2
- package/lib/components/page_template/outer/page_outer.styles.js +4 -1
- package/lib/components/panel/panel.js +1 -1
- package/{optimize/lib/components/panel/panel.style.js → lib/components/panel/panel.styles.js} +1 -1
- package/lib/components/progress/progress.styles.js +2 -2
- package/lib/components/title/title.styles.js +1 -1
- package/lib/components/toast/toast.styles.js +4 -4
- package/lib/components/tool_tip/icon_tip.js +11 -1
- package/lib/components/tool_tip/tool_tip.js +18 -6
- package/lib/global_styling/functions/logicals.js +3 -72
- package/lib/global_styling/functions/typography.js +3 -1
- package/lib/global_styling/mixins/_color.js +1 -1
- package/lib/global_styling/mixins/_helpers.js +9 -2
- package/lib/global_styling/reset/global_styles.js +3 -1
- package/lib/themes/amsterdam/global_styling/mixins/button.js +178 -24
- package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +2 -1
- package/optimize/es/components/accordion/accordion.js +2 -1
- package/optimize/es/components/accordion/accordion.styles.js +17 -27
- package/optimize/es/components/badge/beta_badge/beta_badge.js +6 -3
- package/optimize/es/components/beacon/beacon.styles.js +2 -2
- package/optimize/es/components/button/button.js +88 -100
- package/optimize/es/components/button/button_display/_button_display.js +67 -32
- package/optimize/es/components/button/button_display/_button_display.styles.js +7 -16
- package/optimize/es/components/button/button_display/_button_display_content.js +5 -2
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +7 -17
- package/optimize/es/components/button/button_empty/button_empty.js +55 -47
- package/optimize/es/components/button/button_empty/index.js +1 -1
- package/optimize/es/components/button/button_group/button_group.js +2 -10
- package/optimize/es/components/button/button_group/button_group_button.js +13 -3
- package/optimize/es/components/button/button_icon/button_icon.js +54 -41
- package/optimize/es/components/call_out/call_out.styles.js +2 -1
- package/optimize/es/components/card/card.js +97 -31
- package/optimize/es/components/card/card.styles.js +136 -0
- package/optimize/es/components/card/{card_select.js → card_select/card_select.js} +16 -14
- package/optimize/es/components/card/card_select/card_select.styles.js +25 -0
- package/optimize/es/components/card/card_select/index.js +8 -0
- package/optimize/es/components/card/checkable_card/checkable_card.js +14 -9
- package/optimize/es/components/card/checkable_card/checkable_card.styles.js +22 -0
- package/optimize/es/components/comment_list/comment_event.styles.js +1 -1
- package/optimize/es/components/expression/expression.styles.js +13 -31
- package/optimize/es/components/facet/facet_button.js +5 -3
- package/optimize/es/components/image/image_button.styles.js +1 -1
- package/optimize/es/components/image/image_wrapper.styles.js +3 -3
- package/optimize/es/components/link/link.styles.js +2 -2
- package/optimize/es/components/loading/loading_chart.styles.js +16 -26
- package/optimize/es/components/loading/loading_content.styles.js +2 -2
- package/optimize/es/components/loading/loading_logo.styles.js +4 -4
- package/optimize/es/components/loading/loading_spinner.styles.js +6 -6
- package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +2 -0
- package/optimize/es/components/page/page_template.js +2 -2
- package/optimize/es/components/page_template/inner/page_inner.styles.js +2 -2
- package/optimize/es/components/page_template/outer/page_outer.styles.js +3 -1
- package/optimize/es/components/panel/panel.js +1 -1
- package/optimize/es/components/panel/{panel.style.js → panel.styles.js} +2 -2
- package/optimize/es/components/progress/progress.styles.js +2 -2
- package/optimize/es/components/title/title.styles.js +2 -2
- package/optimize/es/components/toast/toast.styles.js +4 -4
- package/optimize/es/components/tool_tip/tool_tip.js +7 -5
- package/optimize/es/global_styling/functions/logicals.js +2 -72
- package/optimize/es/global_styling/functions/typography.js +2 -1
- package/optimize/es/global_styling/mixins/_color.js +1 -1
- package/optimize/es/global_styling/mixins/_helpers.js +7 -1
- package/optimize/es/global_styling/reset/global_styles.js +2 -1
- package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +155 -16
- package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
- package/optimize/lib/components/accordion/accordion.js +3 -1
- package/optimize/lib/components/accordion/accordion.styles.js +17 -26
- package/optimize/lib/components/badge/beta_badge/beta_badge.js +6 -3
- package/optimize/lib/components/beacon/beacon.styles.js +1 -1
- package/optimize/lib/components/button/button.js +92 -103
- package/optimize/lib/components/button/button_display/_button_display.js +71 -25
- package/optimize/lib/components/button/button_display/_button_display.styles.js +7 -16
- package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +7 -17
- package/optimize/lib/components/button/button_empty/button_empty.js +59 -50
- package/optimize/lib/components/button/button_empty/index.js +0 -6
- package/optimize/lib/components/button/button_group/button_group.js +2 -10
- package/optimize/lib/components/button/button_group/button_group_button.js +15 -3
- package/optimize/lib/components/button/button_icon/button_icon.js +54 -41
- package/optimize/lib/components/call_out/call_out.styles.js +2 -1
- package/optimize/lib/components/card/card.js +97 -30
- package/optimize/lib/components/card/card.styles.js +146 -0
- package/optimize/lib/components/card/{card_select.js → card_select/card_select.js} +16 -14
- package/optimize/lib/components/card/card_select/card_select.styles.js +27 -0
- package/optimize/lib/components/card/card_select/index.js +19 -0
- package/optimize/lib/components/card/checkable_card/checkable_card.js +16 -9
- package/optimize/lib/components/card/checkable_card/checkable_card.styles.js +33 -0
- package/optimize/lib/components/comment_list/comment_event.styles.js +1 -1
- package/optimize/lib/components/expression/expression.styles.js +12 -30
- package/optimize/lib/components/facet/facet_button.js +4 -2
- package/optimize/lib/components/image/image_button.styles.js +1 -1
- package/optimize/lib/components/image/image_wrapper.styles.js +2 -2
- package/optimize/lib/components/link/link.styles.js +1 -1
- package/optimize/lib/components/loading/loading_chart.styles.js +16 -25
- package/optimize/lib/components/loading/loading_content.styles.js +1 -1
- package/optimize/lib/components/loading/loading_logo.styles.js +4 -4
- package/optimize/lib/components/loading/loading_spinner.styles.js +5 -5
- package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +2 -0
- package/optimize/lib/components/page/page_template.js +1 -1
- package/optimize/lib/components/page_template/inner/page_inner.styles.js +2 -2
- package/optimize/lib/components/page_template/outer/page_outer.styles.js +4 -1
- package/optimize/lib/components/panel/panel.js +1 -1
- package/{test-env/components/panel/panel.style.js → optimize/lib/components/panel/panel.styles.js} +1 -1
- package/optimize/lib/components/progress/progress.styles.js +2 -2
- package/optimize/lib/components/title/title.styles.js +1 -1
- package/optimize/lib/components/toast/toast.styles.js +4 -4
- package/optimize/lib/components/tool_tip/tool_tip.js +7 -5
- package/optimize/lib/global_styling/functions/logicals.js +10 -73
- package/optimize/lib/global_styling/functions/typography.js +3 -1
- package/optimize/lib/global_styling/mixins/_color.js +1 -1
- package/optimize/lib/global_styling/mixins/_helpers.js +9 -2
- package/optimize/lib/global_styling/reset/global_styles.js +3 -1
- package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +170 -17
- package/package.json +2 -2
- package/src/components/badge/beta_badge/_beta_badge.scss +5 -1
- package/src/components/button/_index.scss +0 -1
- package/src/components/button/button_empty/_button_empty.scss +4 -48
- package/src/components/button/button_group/_button_group.scss +0 -1
- package/src/components/button/button_group/_button_group_button.scss +55 -83
- package/src/components/button/button_icon/_button_icon.scss +3 -103
- package/src/components/control_bar/_control_bar.scss +2 -6
- package/src/components/flyout/_flyout.scss +4 -1
- package/src/components/index.scss +0 -1
- package/src/global_styling/mixins/_button.scss +55 -11
- package/src/global_styling/mixins/_index.scss +0 -1
- package/src/themes/amsterdam/global_styling/mixins/_index.scss +0 -2
- package/src/themes/amsterdam/overrides/_header.scss +0 -2
- package/src/themes/amsterdam/overrides/_index.scss +0 -4
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +3 -1
- package/test-env/components/accessibility/skip_link/skip_link.js +4 -54
- package/test-env/components/accordion/accordion.js +3 -1
- package/test-env/components/accordion/accordion.styles.js +17 -26
- package/test-env/components/badge/beta_badge/beta_badge.js +16 -3
- package/test-env/components/basic_table/basic_table.js +1 -1
- package/test-env/components/basic_table/collapsed_item_actions.js +1 -1
- package/test-env/components/basic_table/in_memory_table.js +1 -1
- package/test-env/components/beacon/beacon.styles.js +1 -1
- package/test-env/components/button/button.js +111 -225
- package/test-env/components/button/button_display/_button_display.js +93 -32
- package/test-env/components/button/button_display/_button_display.styles.js +7 -16
- package/test-env/components/button/button_display/_button_display_content.js +7 -3
- package/test-env/components/button/button_display/_button_display_content.styles.js +7 -17
- package/test-env/components/button/button_empty/button_empty.js +64 -53
- package/test-env/components/button/button_empty/index.js +0 -6
- package/test-env/components/button/button_group/button_group.js +4 -12
- package/test-env/components/button/button_group/button_group_button.js +16 -4
- package/test-env/components/button/button_icon/button_icon.js +61 -42
- package/test-env/components/call_out/call_out.styles.js +2 -1
- package/test-env/components/card/card.js +172 -88
- package/test-env/components/card/card.styles.js +146 -0
- package/test-env/components/card/card_select/card_select.js +141 -0
- package/test-env/components/card/card_select/card_select.styles.js +27 -0
- package/test-env/components/card/card_select/index.js +19 -0
- package/test-env/components/card/checkable_card/checkable_card.js +16 -9
- package/test-env/components/card/checkable_card/checkable_card.styles.js +33 -0
- package/test-env/components/comment_list/comment_event.styles.js +1 -1
- package/test-env/components/datagrid/body/data_grid_body.js +7 -6
- package/test-env/components/datagrid/body/data_grid_cell.js +13 -12
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +7 -6
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +7 -6
- package/test-env/components/datagrid/data_grid.js +7 -6
- package/test-env/components/datagrid/utils/in_memory.js +7 -6
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +3 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +17 -1
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +11 -1
- package/test-env/components/expression/expression.styles.js +12 -30
- package/test-env/components/facet/facet_button.js +4 -3
- package/test-env/components/header/header_links/header_link.js +5 -3
- package/test-env/components/image/image_button.styles.js +1 -1
- package/test-env/components/image/image_wrapper.styles.js +2 -2
- package/test-env/components/link/link.styles.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -1
- package/test-env/components/list_group/list_group_item.js +2 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +3 -2
- package/test-env/components/loading/loading_chart.styles.js +16 -25
- package/test-env/components/loading/loading_content.styles.js +1 -1
- package/test-env/components/loading/loading_logo.styles.js +4 -4
- package/test-env/components/loading/loading_spinner.styles.js +5 -5
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +2 -0
- package/test-env/components/modal/confirm_modal.js +1 -1
- package/test-env/components/notification/notification_event.js +5 -3
- package/test-env/components/notification/notification_event_read_button.js +2 -1
- package/test-env/components/page/page_template.js +1 -1
- package/test-env/components/page_template/inner/page_inner.styles.js +2 -2
- package/test-env/components/page_template/outer/page_outer.styles.js +4 -1
- package/test-env/components/panel/panel.js +1 -1
- package/{lib/components/panel/panel.style.js → test-env/components/panel/panel.styles.js} +1 -1
- package/test-env/components/progress/progress.styles.js +2 -2
- package/test-env/components/title/title.styles.js +1 -1
- package/test-env/components/toast/toast.styles.js +4 -4
- package/test-env/components/tool_tip/icon_tip.js +11 -1
- package/test-env/components/tool_tip/tool_tip.js +18 -6
- package/test-env/global_styling/functions/logicals.js +10 -73
- package/test-env/global_styling/functions/typography.js +3 -1
- package/test-env/global_styling/mixins/_color.js +1 -1
- package/test-env/global_styling/mixins/_helpers.js +9 -2
- package/test-env/global_styling/reset/global_styles.js +3 -1
- package/test-env/themes/amsterdam/global_styling/mixins/button.js +170 -17
- package/es/components/card/card_select.js +0 -176
- package/lib/components/card/card_select.js +0 -187
- package/src/components/button/_button.scss +0 -143
- package/src/components/button/button_icon/_variables.scss +0 -11
- package/src/components/card/_card.scss +0 -239
- package/src/components/card/_card_select.scss +0 -21
- package/src/components/card/_index.scss +0 -5
- package/src/components/card/_mixins.scss +0 -11
- package/src/components/card/_variables.scss +0 -25
- package/src/components/card/checkable_card/_checkable_card.scss +0 -29
- package/src/components/card/checkable_card/_index.scss +0 -1
- package/src/global_styling/mixins/_beta_badge.scss +0 -30
- package/src/themes/amsterdam/global_styling/mixins/_button.scss +0 -60
- package/src/themes/amsterdam/overrides/_button.scss +0 -119
- package/src/themes/amsterdam/overrides/_button_empty.scss +0 -20
- package/src/themes/amsterdam/overrides/_button_group.scss +0 -91
- package/src/themes/amsterdam/overrides/_card.scss +0 -6
- package/test-env/components/card/card_select.js +0 -184
|
@@ -43,7 +43,7 @@ var nativeVsIndeterminateColor = function nativeVsIndeterminateColor(color, isNa
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
var nonStaticPositioning = function nonStaticPositioning(isNative) {
|
|
46
|
-
return "\n top
|
|
46
|
+
return "\n ".concat(logicalCSS('top', 0), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('right', 0), "\n background-color: transparent;\n ").concat(isNative ? "\n &::-webkit-progress-bar {\n background-color: transparent;\n }" : '', "\n");
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Animations
|
|
@@ -75,7 +75,7 @@ export var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
|
|
|
75
75
|
// An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
|
|
76
76
|
// we apply this style to a <div> instead of a <progress> element.
|
|
77
77
|
// See https://css-tricks.com/html5-progress-element/ for more info.
|
|
78
|
-
indeterminate: /*#__PURE__*/css("&:before{position:absolute;content:'';", logicalCSS('width', '100%'), " top
|
|
78
|
+
indeterminate: /*#__PURE__*/css("&:before{position:absolute;content:'';", logicalCSS('width', '100%'), " ", logicalCSS('top', 0), " ", logicalCSS('bottom', 0), " ", logicalCSS('left', 0), " transform:scaleX(0) translateX(0%);animation:", euiIndeterminateAnimation, " 1s ", euiTheme.animation.resistance, " infinite;", euiCantAnimate, "{animation-duration:2s;animation-timing-function:linear;}};label:indeterminate;"),
|
|
79
79
|
// Sizes
|
|
80
80
|
xs: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.xxs), ";;label:xs;"),
|
|
81
81
|
s: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.xs), ";;label:s;"),
|
|
@@ -15,7 +15,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
15
15
|
*/
|
|
16
16
|
import { css } from '@emotion/react';
|
|
17
17
|
import { useEuiTheme } from '../../services';
|
|
18
|
-
import { euiTextBreakWord, euiFontSize } from '../../global_styling';
|
|
18
|
+
import { euiTextBreakWord, euiFontSize, logicalCSS } from '../../global_styling';
|
|
19
19
|
export var euiTitle = function euiTitle(euiThemeContext) {
|
|
20
20
|
var scale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'm';
|
|
21
21
|
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -53,7 +53,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
53
53
|
|
|
54
54
|
export var euiTitleStyles = function euiTitleStyles(euiThemeContext) {
|
|
55
55
|
return {
|
|
56
|
-
euiTitle: /*#__PURE__*/css(euiTextBreakWord(), " &+&{margin-top
|
|
56
|
+
euiTitle: /*#__PURE__*/css(euiTextBreakWord(), " &+&{", logicalCSS('margin-top', euiThemeContext.euiTheme.size.l), ";};label:euiTitle;"),
|
|
57
57
|
uppercase: _ref,
|
|
58
58
|
// Sizes
|
|
59
59
|
xxxs: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xxxs'), ";;label:xxxs;"),
|
|
@@ -19,10 +19,10 @@ export var euiToastStyles = function euiToastStyles(euiThemeContext) {
|
|
|
19
19
|
// Elements
|
|
20
20
|
euiToast__closeButton: /*#__PURE__*/css("position:absolute;", logicalCSS('top', euiTheme.size.base), ";", logicalCSS('right', euiTheme.size.base), ";;label:euiToast__closeButton;"),
|
|
21
21
|
// Variants
|
|
22
|
-
primary: /*#__PURE__*/css(
|
|
23
|
-
success: /*#__PURE__*/css(
|
|
24
|
-
warning: /*#__PURE__*/css(
|
|
25
|
-
danger: /*#__PURE__*/css(
|
|
22
|
+
primary: /*#__PURE__*/css(logicalCSS('border-top', "2px solid ".concat(euiTheme.colors.primary)), ";;label:primary;"),
|
|
23
|
+
success: /*#__PURE__*/css(logicalCSS('border-top', "2px solid ".concat(euiTheme.colors.success)), ";;label:success;"),
|
|
24
|
+
warning: /*#__PURE__*/css(logicalCSS('border-top', "2px solid ".concat(euiTheme.colors.warning)), ";;label:warning;"),
|
|
25
|
+
danger: /*#__PURE__*/css(logicalCSS('border-top', "2px solid ".concat(euiTheme.colors.danger)), ";;label:danger;")
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
28
|
export var euiToastHeaderStyles = function euiToastHeaderStyles(euiThemeContext) {
|
|
@@ -45,10 +45,20 @@ export var EuiIconTip = function EuiIconTip(_ref) {
|
|
|
45
45
|
};
|
|
46
46
|
EuiIconTip.propTypes = {
|
|
47
47
|
/**
|
|
48
|
-
* Passes onto the the trigger.
|
|
48
|
+
* Passes onto the span wrapping the trigger.
|
|
49
49
|
*/
|
|
50
50
|
anchorClassName: PropTypes.string,
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Passes onto the span wrapping the trigger.
|
|
54
|
+
*/
|
|
55
|
+
anchorProps: PropTypes.shape({
|
|
56
|
+
className: PropTypes.string,
|
|
57
|
+
"aria-label": PropTypes.string,
|
|
58
|
+
"data-test-subj": PropTypes.string,
|
|
59
|
+
css: PropTypes.any
|
|
60
|
+
}),
|
|
61
|
+
|
|
52
62
|
/**
|
|
53
63
|
* Passes onto the tooltip itself, not the trigger.
|
|
54
64
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
var _excluded = ["children", "className", "anchorClassName", "content", "title", "delay", "display"];
|
|
3
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display"];
|
|
4
4
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
@@ -273,6 +273,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
273
273
|
children = _this$props.children,
|
|
274
274
|
className = _this$props.className,
|
|
275
275
|
anchorClassName = _this$props.anchorClassName,
|
|
276
|
+
anchorProps = _this$props.anchorProps,
|
|
276
277
|
content = _this$props.content,
|
|
277
278
|
title = _this$props.title,
|
|
278
279
|
delay = _this$props.delay,
|
|
@@ -285,7 +286,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
285
286
|
toolTipStyles = _this$state.toolTipStyles,
|
|
286
287
|
visible = _this$state.visible;
|
|
287
288
|
var classes = classNames('euiToolTip', positionsToClassNameMap[this.state.calculatedPosition], className);
|
|
288
|
-
var anchorClasses = classNames('euiToolTipAnchor', display ? displayToClassNameMap[display] : null, anchorClassName);
|
|
289
|
+
var anchorClasses = classNames('euiToolTipAnchor', display ? displayToClassNameMap[display] : null, anchorClassName, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.className);
|
|
289
290
|
var tooltip;
|
|
290
291
|
|
|
291
292
|
if (visible && (content || title)) {
|
|
@@ -310,14 +311,15 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
310
311
|
}
|
|
311
312
|
|
|
312
313
|
var anchor = // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events
|
|
313
|
-
___EmotionJSX("span", {
|
|
314
|
+
___EmotionJSX("span", _extends({
|
|
314
315
|
ref: function ref(anchor) {
|
|
315
316
|
return _this2.anchor = anchor;
|
|
316
|
-
}
|
|
317
|
+
}
|
|
318
|
+
}, anchorProps, {
|
|
317
319
|
className: anchorClasses,
|
|
318
320
|
onMouseOver: this.showToolTip,
|
|
319
321
|
onMouseOut: this.onMouseOut
|
|
320
|
-
}, /*#__PURE__*/cloneElement(children, _objectSpread({
|
|
322
|
+
}), /*#__PURE__*/cloneElement(children, _objectSpread({
|
|
321
323
|
onFocus: function onFocus(e) {
|
|
322
324
|
_this2.onFocus();
|
|
323
325
|
|
|
@@ -347,10 +349,20 @@ _defineProperty(EuiToolTip, "defaultProps", {
|
|
|
347
349
|
|
|
348
350
|
EuiToolTip.propTypes = {
|
|
349
351
|
/**
|
|
350
|
-
* Passes onto the the trigger.
|
|
352
|
+
* Passes onto the span wrapping the trigger.
|
|
351
353
|
*/
|
|
352
354
|
anchorClassName: PropTypes.string,
|
|
353
355
|
|
|
356
|
+
/**
|
|
357
|
+
* Passes onto the span wrapping the trigger.
|
|
358
|
+
*/
|
|
359
|
+
anchorProps: PropTypes.shape({
|
|
360
|
+
className: PropTypes.string,
|
|
361
|
+
"aria-label": PropTypes.string,
|
|
362
|
+
"data-test-subj": PropTypes.string,
|
|
363
|
+
css: PropTypes.any
|
|
364
|
+
}),
|
|
365
|
+
|
|
354
366
|
/**
|
|
355
367
|
* The in-view trigger for your tooltip.
|
|
356
368
|
*/
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
4
|
-
|
|
5
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
2
|
|
|
7
3
|
/*
|
|
@@ -12,6 +8,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
12
8
|
* Side Public License, v 1.
|
|
13
9
|
*/
|
|
14
10
|
import { keysOf } from '../../components/common';
|
|
11
|
+
import LOGICALS from './logicals.json';
|
|
15
12
|
/**
|
|
16
13
|
* EUI utilizes logical CSS properties to enable directional writing-modes.
|
|
17
14
|
* To encourage use of logical properties, we provide a few helper utilities to
|
|
@@ -28,74 +25,7 @@ export var logicalSide = {
|
|
|
28
25
|
vertical: 'block'
|
|
29
26
|
};
|
|
30
27
|
export var LOGICAL_SIDES = keysOf(logicalSide);
|
|
31
|
-
var
|
|
32
|
-
'margin-left': 'margin-inline-start',
|
|
33
|
-
'margin-right': 'margin-inline-end',
|
|
34
|
-
'margin-top': 'margin-block-start',
|
|
35
|
-
'margin-bottom': 'margin-block-end',
|
|
36
|
-
'margin-horizontal': 'margin-inline',
|
|
37
|
-
'margin-vertical': 'margin-block'
|
|
38
|
-
};
|
|
39
|
-
var logicalPaddings = {
|
|
40
|
-
'padding-left': 'padding-inline-start',
|
|
41
|
-
'padding-right': 'padding-inline-end',
|
|
42
|
-
'padding-top': 'padding-block-start',
|
|
43
|
-
'padding-bottom': 'padding-block-end',
|
|
44
|
-
'padding-horizontal': 'padding-inline',
|
|
45
|
-
'padding-vertical': 'padding-block'
|
|
46
|
-
};
|
|
47
|
-
var logicalPosition = {
|
|
48
|
-
top: 'inset-block-start',
|
|
49
|
-
right: 'inset-inline-end',
|
|
50
|
-
bottom: 'inset-block-end',
|
|
51
|
-
left: 'inset-inline-start',
|
|
52
|
-
horizontal: 'inset-block',
|
|
53
|
-
vertical: 'inset-inline',
|
|
54
|
-
inset: 'inset'
|
|
55
|
-
};
|
|
56
|
-
var logicalSize = {
|
|
57
|
-
height: 'block-size',
|
|
58
|
-
width: 'inline-size',
|
|
59
|
-
'max-height': 'max-block-size',
|
|
60
|
-
'max-width': 'max-inline-size',
|
|
61
|
-
'min-height': 'min-block-size',
|
|
62
|
-
'min-width': 'min-inline-size'
|
|
63
|
-
};
|
|
64
|
-
var logicalOverflow = {
|
|
65
|
-
'overflow-x': 'overflow-inline',
|
|
66
|
-
'overflow-y': 'overflow-block'
|
|
67
|
-
};
|
|
68
|
-
var logicalBorders = {
|
|
69
|
-
'border-horizontal': 'border-inline',
|
|
70
|
-
'border-horizontal-color': 'border-inline-color',
|
|
71
|
-
'border-horizontal-width': 'border-inline-width',
|
|
72
|
-
'border-horizontal-style': 'border-inline-style',
|
|
73
|
-
'border-vertical': 'border-block',
|
|
74
|
-
'border-vertical-color': 'border-block-color',
|
|
75
|
-
'border-vertical-width': 'border-block-width',
|
|
76
|
-
'border-vertical-style': 'border-block-style',
|
|
77
|
-
'border-bottom': 'border-block-end',
|
|
78
|
-
'border-bottom-color': 'border-block-end-color',
|
|
79
|
-
'border-bottom-style': 'border-block-end-style',
|
|
80
|
-
'border-bottom-width': 'border-block-end-width',
|
|
81
|
-
'border-top': 'border-block-start',
|
|
82
|
-
'border-top-color': 'border-block-start-color',
|
|
83
|
-
'border-top-style': 'border-block-start-style',
|
|
84
|
-
'border-top-width': 'border-block-start-width',
|
|
85
|
-
'border-right': 'border-inline-end',
|
|
86
|
-
'border-right-color': 'border-inline-end-color',
|
|
87
|
-
'border-right-style': 'border-inline-end-style',
|
|
88
|
-
'border-right-width': 'border-inline-end-width',
|
|
89
|
-
'border-left': 'border-inline-start',
|
|
90
|
-
'border-left-color': 'border-inline-start-color',
|
|
91
|
-
'border-left-style': 'border-inline-start-style',
|
|
92
|
-
'border-left-width': 'border-inline-start-width',
|
|
93
|
-
'border-top-left-radius': 'border-start-start-radius',
|
|
94
|
-
'border-top-right-radius': 'border-start-end-radius',
|
|
95
|
-
'border-bottom-left-radius': 'border-end-start-radius',
|
|
96
|
-
'border-bottom-right-radius': 'border-end-end-radius'
|
|
97
|
-
};
|
|
98
|
-
export var logicals = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, logicalMargins), logicalPaddings), logicalPosition), logicalSize), logicalOverflow), logicalBorders);
|
|
28
|
+
export var logicals = LOGICALS;
|
|
99
29
|
export var LOGICAL_PROPERTIES = keysOf(logicals);
|
|
100
30
|
|
|
101
31
|
/**
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
|
+
import { logicalCSS } from './logicals';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Calculates the font-size value based on the provided scale key
|
|
@@ -82,5 +83,5 @@ export var euiTextShift = function euiTextShift() {
|
|
|
82
83
|
var fontWeight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bold';
|
|
83
84
|
var attribute = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'data-text';
|
|
84
85
|
var euiTheme = arguments.length > 2 ? arguments[2] : undefined;
|
|
85
|
-
return "\n &::after {\n display: block;\n content: attr(".concat(attribute, ");\n font-weight: ").concat(euiTheme.font.weight[fontWeight], ";\n height
|
|
86
|
+
return "\n &::after {\n display: block;\n content: attr(".concat(attribute, ");\n font-weight: ").concat(euiTheme.font.weight[fontWeight], ";\n ").concat(logicalCSS('height', 0), "\n overflow: hidden;\n visibility: hidden;\n }");
|
|
86
87
|
};
|
|
@@ -21,7 +21,7 @@ export var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
|
|
|
21
21
|
if (color === 'plain') {
|
|
22
22
|
return transparentize(euiTheme.colors.ghost, 0.2);
|
|
23
23
|
} else if (color === 'subdued') {
|
|
24
|
-
return transparentize(euiTheme.colors.lightShade, 0.2);
|
|
24
|
+
return colorMode === 'DARK' ? transparentize(euiTheme.colors.lightShade, 0.4) : transparentize(euiTheme.colors.lightShade, 0.2);
|
|
25
25
|
} else {
|
|
26
26
|
return transparentize(euiTheme.colors[color], 0.1);
|
|
27
27
|
}
|
|
@@ -165,4 +165,10 @@ export var useEuiOverflowScroll = function useEuiOverflowScroll(direction) {
|
|
|
165
165
|
|
|
166
166
|
export var euiFullHeight = function euiFullHeight() {
|
|
167
167
|
return "\n ".concat(logicalCSS('height', '100%'), "\n flex: 1 1 auto;\n overflow: hidden;\n");
|
|
168
|
-
};
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* A constant storing the support for the `:has()` selector through a
|
|
171
|
+
* media query that will only apply the content it is supported.
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
export var euiSupportsHas = '@supports(selector(:has(p)))';
|
|
@@ -10,6 +10,7 @@ function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { Global, css } from '@emotion/react';
|
|
12
12
|
import { euiFocusRing, euiScrollBarStyles } from '../mixins';
|
|
13
|
+
import { logicalCSS } from '../functions';
|
|
13
14
|
import { shade, tint, transparentize } from '../../services/color';
|
|
14
15
|
import { useEuiTheme } from '../../services/theme';
|
|
15
16
|
import { resetStyles as reset } from './reset';
|
|
@@ -42,7 +43,7 @@ export var EuiGlobalStyles = function EuiGlobalStyles(_ref) {
|
|
|
42
43
|
* Final styles
|
|
43
44
|
*/
|
|
44
45
|
|
|
45
|
-
var styles = /*#__PURE__*/css(reset, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height
|
|
46
|
+
var styles = /*#__PURE__*/css(reset, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;", logicalCSS('height', '100%'), " background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", euiFocusRing(euiThemeContext), ";}::selection{background:", transparentize(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
|
|
46
47
|
return ___EmotionJSX(Global, {
|
|
47
48
|
styles: styles
|
|
48
49
|
});
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
|
|
3
|
+
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."); }
|
|
4
|
+
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
11
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
12
|
+
|
|
1
13
|
/*
|
|
2
14
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
15
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -6,36 +18,173 @@
|
|
|
6
18
|
* Side Public License, v 1.
|
|
7
19
|
*/
|
|
8
20
|
import { css } from '@emotion/react';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
export var
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
import { euiBackgroundColor, euiCanAnimate } from '../../../../global_styling';
|
|
22
|
+
import { hexToRgb, isColorDark, makeHighContrastColor, shade, tint, transparentize, useEuiTheme } from '../../../../services';
|
|
23
|
+
export var BUTTON_COLORS = ['text', 'accent', 'primary', 'success', 'warning', 'danger'];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Creates the `base` version of button styles with proper text contrast.
|
|
27
|
+
* @param euiThemeContext
|
|
28
|
+
* @param color One of the named button colors or 'disabled'
|
|
29
|
+
* @returns Style object `{ backgroundColor, color }`
|
|
30
|
+
*/
|
|
31
|
+
export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
32
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
33
|
+
colorMode = euiThemeContext.colorMode;
|
|
14
34
|
|
|
15
35
|
function tintOrShade(color) {
|
|
16
36
|
return colorMode === 'DARK' ? shade(color, 0.7) : tint(color, 0.8);
|
|
17
37
|
}
|
|
18
38
|
|
|
39
|
+
var foreground;
|
|
40
|
+
var background;
|
|
41
|
+
|
|
42
|
+
switch (color) {
|
|
43
|
+
case 'disabled':
|
|
44
|
+
return {
|
|
45
|
+
color: euiTheme.colors.disabledText,
|
|
46
|
+
backgroundColor: transparentize(euiTheme.colors.lightShade, 0.15)
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
case 'text':
|
|
50
|
+
foreground = euiTheme.colors[color];
|
|
51
|
+
background = colorMode === 'DARK' ? shade(euiTheme.colors.lightShade, 0.2) : tint(euiTheme.colors.lightShade, 0.5);
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
default:
|
|
55
|
+
foreground = euiTheme.colors["".concat(color, "Text")];
|
|
56
|
+
background = tintOrShade(euiTheme.colors[color]);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
color: makeHighContrastColor(foreground)(background),
|
|
62
|
+
backgroundColor: background
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Creates the `fill` version of buttons styles with proper text contrast.
|
|
67
|
+
* @param euiThemeContext
|
|
68
|
+
* @param color One of the named button colors or 'disabled'
|
|
69
|
+
* @returns Style object `{ backgroundColor, color }`
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
|
|
73
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
74
|
+
colorMode = euiThemeContext.colorMode;
|
|
75
|
+
var background;
|
|
76
|
+
var foreground;
|
|
77
|
+
|
|
19
78
|
switch (color) {
|
|
20
79
|
case 'disabled':
|
|
21
|
-
|
|
80
|
+
background = euiButtonColor(euiThemeContext, color).backgroundColor;
|
|
81
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
82
|
+
break;
|
|
22
83
|
|
|
23
84
|
case 'text':
|
|
24
|
-
|
|
85
|
+
background = colorMode === 'DARK' ? euiTheme.colors.text : euiTheme.colors.darkShade;
|
|
86
|
+
foreground = isColorDark.apply(void 0, _toConsumableArray(hexToRgb(background))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
|
|
87
|
+
break;
|
|
25
88
|
|
|
26
89
|
default:
|
|
27
|
-
|
|
90
|
+
background = euiTheme.colors[color];
|
|
91
|
+
foreground = isColorDark.apply(void 0, _toConsumableArray(hexToRgb(euiTheme.colors[color]))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
|
|
92
|
+
break;
|
|
28
93
|
}
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
color: foreground,
|
|
97
|
+
backgroundColor: background
|
|
98
|
+
};
|
|
29
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Creates the `empty` version of button styles using the text-variant and adding interactive styles.
|
|
102
|
+
* @param euiThemeContext
|
|
103
|
+
* @param color One of the named button colors or 'disabled'
|
|
104
|
+
* @returns Style object `{ backgroundColor, color }` where `background` is typically used for interactive states
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
export var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, color) {
|
|
108
|
+
var foreground;
|
|
109
|
+
var background;
|
|
110
|
+
|
|
111
|
+
switch (color) {
|
|
112
|
+
case 'disabled':
|
|
113
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
114
|
+
background = 'transparent';
|
|
115
|
+
break;
|
|
116
|
+
|
|
117
|
+
case 'text':
|
|
118
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
119
|
+
background = euiBackgroundColor(euiThemeContext, 'subdued', {
|
|
120
|
+
method: 'transparent'
|
|
121
|
+
});
|
|
122
|
+
break;
|
|
123
|
+
|
|
124
|
+
default:
|
|
125
|
+
foreground = euiButtonColor(euiThemeContext, color).color;
|
|
126
|
+
background = euiBackgroundColor(euiThemeContext, color, {
|
|
127
|
+
method: 'transparent'
|
|
128
|
+
});
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
color: foreground,
|
|
134
|
+
backgroundColor: background
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Given the button display type, returns the Emotion based color keys.
|
|
139
|
+
* @param options Button display type
|
|
140
|
+
* @returns An object of `_EuiButtonColor` keys including `disabled`
|
|
141
|
+
*/
|
|
142
|
+
|
|
30
143
|
export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
|
|
31
|
-
var
|
|
144
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
145
|
+
var euiThemeContext = useEuiTheme();
|
|
146
|
+
|
|
147
|
+
function stylesByDisplay(color) {
|
|
148
|
+
return {
|
|
149
|
+
base: /*#__PURE__*/css(euiButtonColor(euiThemeContext, color), ";;label:base;"),
|
|
150
|
+
fill: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:fill;"),
|
|
151
|
+
empty: /*#__PURE__*/css("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:empty;")
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
32
155
|
return {
|
|
33
|
-
text: /*#__PURE__*/css(
|
|
34
|
-
accent: /*#__PURE__*/css(
|
|
35
|
-
primary: /*#__PURE__*/css(
|
|
36
|
-
success: /*#__PURE__*/css(
|
|
37
|
-
warning: /*#__PURE__*/css(
|
|
38
|
-
danger: /*#__PURE__*/css(
|
|
39
|
-
disabled: /*#__PURE__*/css(
|
|
156
|
+
text: /*#__PURE__*/css(stylesByDisplay('text')[options.display || 'base'], ";label:text;"),
|
|
157
|
+
accent: /*#__PURE__*/css(stylesByDisplay('accent')[options.display || 'base'], ";label:accent;"),
|
|
158
|
+
primary: /*#__PURE__*/css(stylesByDisplay('primary')[options.display || 'base'], ";label:primary;"),
|
|
159
|
+
success: /*#__PURE__*/css(stylesByDisplay('success')[options.display || 'base'], ";label:success;"),
|
|
160
|
+
warning: /*#__PURE__*/css(stylesByDisplay('warning')[options.display || 'base'], ";label:warning;"),
|
|
161
|
+
danger: /*#__PURE__*/css(stylesByDisplay('danger')[options.display || 'base'], ";label:danger;"),
|
|
162
|
+
disabled: /*#__PURE__*/css(stylesByDisplay('disabled')[options.display || 'base'], ";label:disabled;")
|
|
40
163
|
};
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Based on the button size, creates the style properties.
|
|
167
|
+
* @returns An object of button size keys with Emption styles for `border-radius`
|
|
168
|
+
*/
|
|
169
|
+
|
|
170
|
+
export var useEuiButtonRadiusCSS = function useEuiButtonRadiusCSS() {
|
|
171
|
+
var _useEuiTheme = useEuiTheme(),
|
|
172
|
+
euiTheme = _useEuiTheme.euiTheme;
|
|
173
|
+
|
|
174
|
+
return {
|
|
175
|
+
xs: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.small, ";;label:xs;"),
|
|
176
|
+
s: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.small, ";;label:s;"),
|
|
177
|
+
m: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";;label:m;")
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Creates the translate animation when button is in focus.
|
|
182
|
+
* @returns string
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
export var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
|
|
186
|
+
var _useEuiTheme2 = useEuiTheme(),
|
|
187
|
+
euiTheme = _useEuiTheme2.euiTheme;
|
|
188
|
+
|
|
189
|
+
return "\n ".concat(euiCanAnimate, " {\n transition: transform ").concat(euiTheme.animation.normal, " ease-in-out,\n background-color ").concat(euiTheme.animation.normal, " ease-in-out;\n\n &:hover:not(:disabled) {\n transform: translateY(-1px);\n }\n\n &:focus {\n animation: euiButtonActive ").concat(euiTheme.animation.normal, "\n ").concat(euiTheme.animation.bounce, ";\n }\n\n &:active:not(:disabled) {\n transform: translateY(1px);\n }\n }\n ");
|
|
41
190
|
};
|