@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
|
@@ -11,13 +11,13 @@ var _templateObject, _templateObject2;
|
|
|
11
11
|
*/
|
|
12
12
|
import { keyframes, css } from '@emotion/react';
|
|
13
13
|
import { euiPaletteColorBlind } from '../../services';
|
|
14
|
-
import { euiCanAnimate } from '../../global_styling';
|
|
14
|
+
import { euiCanAnimate, logicalCSS, logicalSizeCSS } from '../../global_styling';
|
|
15
15
|
var visColors = euiPaletteColorBlind();
|
|
16
16
|
var euiBeaconPulseLarge = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scale(.1);\n opacity: 1;\n }\n\n 70% {\n transform: scale(3);\n opacity: 0;\n }\n\n 100% {\n opacity: 0;\n }\n"])));
|
|
17
17
|
var euiBeaconPulseSmall = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n transform: scale(.1);\n opacity: 1;\n }\n\n 70% {\n transform: scale(2);\n opacity: 0;\n }\n\n 100% {\n opacity: 0;\n }\n"])));
|
|
18
18
|
export var euiBeaconStyles = function euiBeaconStyles() {
|
|
19
19
|
return {
|
|
20
20
|
// Base
|
|
21
|
-
euiBeacon: /*#__PURE__*/css("position:relative;background-color:", visColors[0], ";border-radius:50%;&:before,&:after{position:absolute;content:'';
|
|
21
|
+
euiBeacon: /*#__PURE__*/css("position:relative;background-color:", visColors[0], ";border-radius:50%;&:before,&:after{position:absolute;content:'';", logicalSizeCSS('100%', '100%'), " ", logicalCSS('left', 0), " ", logicalCSS('top', 0), " background-color:transparent;border-radius:50%;box-shadow:0 0 1px 1px ", visColors[0], ";}&:before{transform:scale(1.6);opacity:0.4;}&:after{opacity:0;}", euiCanAnimate, "{&:before{animation:", euiBeaconPulseLarge, " 2.5s infinite ease-out;}&:after{animation:", euiBeaconPulseSmall, " 2.5s infinite ease-out 0.25s;}};label:euiBeacon;")
|
|
22
22
|
};
|
|
23
23
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
|
+
var _excluded = ["buttonRef", "color", "fill"],
|
|
6
|
+
_excluded2 = ["element", "baseClassName", "children", "className", "iconType", "iconSide", "color", "size", "isDisabled", "isLoading", "isSelected", "contentProps", "textProps", "fullWidth", "minWidth", "style"];
|
|
6
7
|
|
|
7
8
|
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; }
|
|
8
9
|
|
|
@@ -17,87 +18,73 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
18
|
*/
|
|
18
19
|
import React, { forwardRef } from 'react';
|
|
19
20
|
import classNames from 'classnames';
|
|
20
|
-
import { keysOf } from '../common';
|
|
21
|
-
import { getSecureRelForTarget } from '../../services';
|
|
22
21
|
import { EuiButtonContentDeprecated as EuiButtonContent } from './_button_content_deprecated';
|
|
23
|
-
import {
|
|
22
|
+
import { BUTTON_COLORS, useEuiButtonColorCSS, useEuiButtonFocusCSS } from '../../themes/amsterdam/global_styling/mixins/button';
|
|
23
|
+
import { EuiButtonDisplay, isButtonDisabled } from './button_display/_button_display';
|
|
24
|
+
import { EuiThemeProvider } from '../../services';
|
|
24
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
|
-
export var
|
|
26
|
-
|
|
27
|
-
accent: '--accent',
|
|
28
|
-
success: '--success',
|
|
29
|
-
warning: '--warning',
|
|
30
|
-
danger: '--danger',
|
|
31
|
-
ghost: '--ghost',
|
|
32
|
-
text: '--text'
|
|
33
|
-
};
|
|
34
|
-
export var COLORS = keysOf(colorToClassNameMap);
|
|
35
|
-
export var sizeToClassNameMap = {
|
|
36
|
-
s: '--small',
|
|
37
|
-
m: null
|
|
38
|
-
};
|
|
39
|
-
export var SIZES = keysOf(sizeToClassNameMap);
|
|
40
|
-
/**
|
|
41
|
-
* Extends EuiButtonContentProps which provides
|
|
42
|
-
* `iconType`, `iconSide`, and `textProps`
|
|
43
|
-
*/
|
|
26
|
+
export var COLORS = [].concat(_toConsumableArray(BUTTON_COLORS), ['ghost']);
|
|
27
|
+
export var SIZES = ['s', 'm'];
|
|
44
28
|
|
|
45
29
|
/**
|
|
46
30
|
* EuiButton is largely responsible for providing relevant props
|
|
47
31
|
* and the logic for element-specific attributes
|
|
48
32
|
*/
|
|
49
|
-
export var EuiButton = function EuiButton(
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var relObj = {};
|
|
78
|
-
|
|
79
|
-
if (href && !buttonIsDisabled) {
|
|
80
|
-
relObj.href = href;
|
|
81
|
-
relObj.rel = getSecureRelForTarget({
|
|
82
|
-
href: href,
|
|
83
|
-
target: target,
|
|
84
|
-
rel: rel
|
|
85
|
-
});
|
|
86
|
-
relObj.target = target;
|
|
87
|
-
} else {
|
|
88
|
-
relObj.type = type;
|
|
33
|
+
export var EuiButton = function EuiButton(props) {
|
|
34
|
+
var buttonRef = props.buttonRef,
|
|
35
|
+
_props$color = props.color,
|
|
36
|
+
_color = _props$color === void 0 ? 'primary' : _props$color,
|
|
37
|
+
fill = props.fill,
|
|
38
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
39
|
+
|
|
40
|
+
var buttonIsDisabled = isButtonDisabled({
|
|
41
|
+
href: rest.href,
|
|
42
|
+
isDisabled: rest.isDisabled || rest.disabled,
|
|
43
|
+
isLoading: rest.isLoading
|
|
44
|
+
}); // eslint-disable-next-line no-nested-ternary
|
|
45
|
+
|
|
46
|
+
var color = buttonIsDisabled ? 'disabled' : _color;
|
|
47
|
+
var buttonColorStyles = useEuiButtonColorCSS({
|
|
48
|
+
display: fill ? 'fill' : 'base'
|
|
49
|
+
})[color === 'ghost' ? 'text' : color];
|
|
50
|
+
var buttonFocusStyle = useEuiButtonFocusCSS();
|
|
51
|
+
var cssStyles = [buttonColorStyles, buttonFocusStyle];
|
|
52
|
+
|
|
53
|
+
if (_color === 'ghost') {
|
|
54
|
+
// INCEPTION: If `ghost`, re-implement with a wrapping dark mode theme provider
|
|
55
|
+
return ___EmotionJSX(EuiThemeProvider, {
|
|
56
|
+
colorMode: "dark"
|
|
57
|
+
}, ___EmotionJSX(EuiButton, _extends({}, props, {
|
|
58
|
+
color: "text"
|
|
59
|
+
})));
|
|
89
60
|
}
|
|
90
61
|
|
|
91
|
-
return (
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}, elementProps, relObj, rest))
|
|
97
|
-
);
|
|
62
|
+
return ___EmotionJSX(EuiButtonDisplay, _extends({
|
|
63
|
+
className: "euiButton",
|
|
64
|
+
ref: buttonRef,
|
|
65
|
+
css: cssStyles
|
|
66
|
+
}, rest));
|
|
98
67
|
};
|
|
99
|
-
EuiButton.displayName = 'EuiButton';
|
|
68
|
+
EuiButton.displayName = 'EuiButton'; // Use defaultProps for simple pass-through props
|
|
100
69
|
|
|
70
|
+
EuiButton.defaultProps = {
|
|
71
|
+
minWidth: 112,
|
|
72
|
+
size: 'm',
|
|
73
|
+
color: 'primary'
|
|
74
|
+
};
|
|
75
|
+
export var sizeToClassNameMap = {
|
|
76
|
+
s: '--small',
|
|
77
|
+
m: null
|
|
78
|
+
};
|
|
79
|
+
export var colorToClassNameMap = {
|
|
80
|
+
primary: '--primary',
|
|
81
|
+
accent: '--accent',
|
|
82
|
+
success: '--success',
|
|
83
|
+
warning: '--warning',
|
|
84
|
+
danger: '--danger',
|
|
85
|
+
ghost: '--ghost',
|
|
86
|
+
text: '--text'
|
|
87
|
+
};
|
|
101
88
|
/**
|
|
102
89
|
* *DEPRECATED*
|
|
103
90
|
* EuiButtonDisplay is an internal-only component used for displaying
|
|
@@ -108,33 +95,34 @@ EuiButton.displayName = 'EuiButton';
|
|
|
108
95
|
* This component has been deprecated in favor of the new EuiButtonDisplay
|
|
109
96
|
* that can be found in `src/components/button/button_display/_button_display.tsx`
|
|
110
97
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
iconSide =
|
|
120
|
-
|
|
121
|
-
color =
|
|
122
|
-
|
|
123
|
-
size =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
98
|
+
|
|
99
|
+
export var EuiButtonDisplayDeprecated = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
100
|
+
var _ref$element = _ref.element,
|
|
101
|
+
element = _ref$element === void 0 ? 'button' : _ref$element,
|
|
102
|
+
baseClassName = _ref.baseClassName,
|
|
103
|
+
children = _ref.children,
|
|
104
|
+
className = _ref.className,
|
|
105
|
+
iconType = _ref.iconType,
|
|
106
|
+
_ref$iconSide = _ref.iconSide,
|
|
107
|
+
iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide,
|
|
108
|
+
color = _ref.color,
|
|
109
|
+
_ref$size = _ref.size,
|
|
110
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
111
|
+
isDisabled = _ref.isDisabled,
|
|
112
|
+
isLoading = _ref.isLoading,
|
|
113
|
+
isSelected = _ref.isSelected,
|
|
114
|
+
contentProps = _ref.contentProps,
|
|
115
|
+
textProps = _ref.textProps,
|
|
116
|
+
fullWidth = _ref.fullWidth,
|
|
117
|
+
minWidth = _ref.minWidth,
|
|
118
|
+
style = _ref.style,
|
|
119
|
+
rest = _objectWithoutProperties(_ref, _excluded2);
|
|
120
|
+
|
|
121
|
+
var buttonIsDisabled = isButtonDisabled({
|
|
122
|
+
isLoading: isLoading,
|
|
123
|
+
isDisabled: isDisabled
|
|
124
|
+
});
|
|
125
|
+
var classes = classNames(baseClassName, color && colorToClassNameMap[color] ? "".concat(baseClassName).concat(colorToClassNameMap[color]) : undefined, size && sizeToClassNameMap[size] ? "".concat(baseClassName).concat(sizeToClassNameMap[size]) : null, fullWidth && "".concat(baseClassName, "--fullWidth"), className);
|
|
138
126
|
/**
|
|
139
127
|
* Not changing the content or text class names to match baseClassName yet,
|
|
140
128
|
* as it is a major breaking change.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["
|
|
4
|
+
var _excluded = ["children", "iconType", "iconSide", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type"];
|
|
5
5
|
|
|
6
6
|
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; }
|
|
7
7
|
|
|
@@ -17,43 +17,56 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
import React, { forwardRef } from 'react'; // @ts-ignore module doesn't export `createElement`
|
|
18
18
|
|
|
19
19
|
import { createElement } from '@emotion/react';
|
|
20
|
-
import { useEuiTheme } from '../../../services';
|
|
20
|
+
import { getSecureRelForTarget, useEuiTheme } from '../../../services';
|
|
21
21
|
import { euiButtonDisplayStyles } from './_button_display.styles';
|
|
22
22
|
import { EuiButtonDisplayContent } from './_button_display_content';
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* `iconType`, `iconSide`, and `textProps`
|
|
26
|
-
*/
|
|
27
|
-
|
|
23
|
+
import { validateHref } from '../../../services/security/href_validator';
|
|
24
|
+
import { useEuiButtonRadiusCSS } from '../../../themes/amsterdam/global_styling/mixins';
|
|
28
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
|
-
|
|
26
|
+
var SIZES = ['xs', 's', 'm'];
|
|
27
|
+
export function isButtonDisabled(_ref) {
|
|
28
|
+
var href = _ref.href,
|
|
29
|
+
isDisabled = _ref.isDisabled,
|
|
30
|
+
isLoading = _ref.isLoading;
|
|
31
|
+
var isHrefValid = !href || validateHref(href);
|
|
32
|
+
return isLoading || isDisabled || !isHrefValid;
|
|
33
|
+
}
|
|
30
34
|
/**
|
|
31
35
|
* EuiButtonDisplay is an internal-only component used for displaying
|
|
32
36
|
* any element as a button.
|
|
33
37
|
*/
|
|
34
|
-
export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
35
|
-
var _ref$element = _ref.element,
|
|
36
|
-
element = _ref$element === void 0 ? 'button' : _ref$element,
|
|
37
|
-
children = _ref.children,
|
|
38
|
-
iconType = _ref.iconType,
|
|
39
|
-
iconSide = _ref.iconSide,
|
|
40
|
-
_ref$size = _ref.size,
|
|
41
|
-
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
42
|
-
_ref$isDisabled = _ref.isDisabled,
|
|
43
|
-
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
44
|
-
isLoading = _ref.isLoading,
|
|
45
|
-
isSelected = _ref.isSelected,
|
|
46
|
-
fullWidth = _ref.fullWidth,
|
|
47
|
-
minWidth = _ref.minWidth,
|
|
48
|
-
contentProps = _ref.contentProps,
|
|
49
|
-
textProps = _ref.textProps,
|
|
50
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
38
|
|
|
52
|
-
|
|
53
|
-
var
|
|
39
|
+
export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
40
|
+
var children = _ref2.children,
|
|
41
|
+
iconType = _ref2.iconType,
|
|
42
|
+
iconSide = _ref2.iconSide,
|
|
43
|
+
_ref2$size = _ref2.size,
|
|
44
|
+
size = _ref2$size === void 0 ? 'm' : _ref2$size,
|
|
45
|
+
isDisabled = _ref2.isDisabled,
|
|
46
|
+
disabled = _ref2.disabled,
|
|
47
|
+
isLoading = _ref2.isLoading,
|
|
48
|
+
isSelected = _ref2.isSelected,
|
|
49
|
+
fullWidth = _ref2.fullWidth,
|
|
50
|
+
minWidth = _ref2.minWidth,
|
|
51
|
+
contentProps = _ref2.contentProps,
|
|
52
|
+
textProps = _ref2.textProps,
|
|
53
|
+
href = _ref2.href,
|
|
54
|
+
target = _ref2.target,
|
|
55
|
+
rel = _ref2.rel,
|
|
56
|
+
_ref2$type = _ref2.type,
|
|
57
|
+
type = _ref2$type === void 0 ? 'button' : _ref2$type,
|
|
58
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
59
|
+
|
|
60
|
+
var buttonIsDisabled = isButtonDisabled({
|
|
61
|
+
href: href,
|
|
62
|
+
isDisabled: isDisabled || disabled,
|
|
63
|
+
isLoading: isLoading
|
|
64
|
+
});
|
|
65
|
+
var minWidthPx = typeof minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
|
|
54
66
|
var theme = useEuiTheme();
|
|
55
67
|
var styles = euiButtonDisplayStyles(theme, minWidthPx);
|
|
56
|
-
var
|
|
68
|
+
var buttonRadiusStyle = useEuiButtonRadiusCSS()[size];
|
|
69
|
+
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, buttonIsDisabled && styles.isDisabled, buttonRadiusStyle];
|
|
57
70
|
|
|
58
71
|
var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
|
|
59
72
|
isLoading: isLoading,
|
|
@@ -63,11 +76,33 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
63
76
|
textProps: _objectSpread({}, textProps)
|
|
64
77
|
}, contentProps), children);
|
|
65
78
|
|
|
66
|
-
|
|
79
|
+
var element = href && !buttonIsDisabled ? 'a' : 'button';
|
|
80
|
+
var elementProps = {}; // Element-specific attributes
|
|
81
|
+
|
|
82
|
+
if (element === 'button') {
|
|
83
|
+
elementProps = _objectSpread(_objectSpread({}, elementProps), {}, {
|
|
84
|
+
disabled: buttonIsDisabled,
|
|
85
|
+
'aria-pressed': isSelected
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
var relObj = {};
|
|
90
|
+
|
|
91
|
+
if (href && !buttonIsDisabled) {
|
|
92
|
+
relObj.href = href;
|
|
93
|
+
relObj.rel = getSecureRelForTarget({
|
|
94
|
+
href: href,
|
|
95
|
+
target: target,
|
|
96
|
+
rel: rel
|
|
97
|
+
});
|
|
98
|
+
relObj.target = target;
|
|
99
|
+
} else {
|
|
100
|
+
relObj.type = type;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return createElement(element, _objectSpread(_objectSpread(_objectSpread({
|
|
67
104
|
css: cssStyles,
|
|
68
|
-
disabled: element === 'button' && buttonIsDisabled,
|
|
69
|
-
'aria-pressed': element === 'button' ? isSelected : undefined,
|
|
70
105
|
ref: ref
|
|
71
|
-
}, rest), innerNode);
|
|
106
|
+
}, elementProps), relObj), rest), innerNode);
|
|
72
107
|
});
|
|
73
108
|
EuiButtonDisplay.displayName = 'EuiButtonDisplay';
|
|
@@ -20,20 +20,11 @@ var _buttonSize = function _buttonSize(size) {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
23
|
-
name: "
|
|
24
|
-
styles: "
|
|
23
|
+
name: "vifhyf-isDisabled",
|
|
24
|
+
styles: "pointer-events:none;cursor:not-allowed;label:isDisabled;"
|
|
25
25
|
} : {
|
|
26
|
-
name: "
|
|
27
|
-
styles: "
|
|
28
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
32
|
-
name: "8595p9-isDisabled",
|
|
33
|
-
styles: "cursor:not-allowed;label:isDisabled;"
|
|
34
|
-
} : {
|
|
35
|
-
name: "8595p9-isDisabled",
|
|
36
|
-
styles: "cursor:not-allowed;label:isDisabled;",
|
|
26
|
+
name: "vifhyf-isDisabled",
|
|
27
|
+
styles: "pointer-events:none;cursor:not-allowed;label:isDisabled;",
|
|
37
28
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
29
|
};
|
|
39
30
|
|
|
@@ -41,10 +32,10 @@ export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeCont
|
|
|
41
32
|
var euiTheme = euiThemeContext.euiTheme;
|
|
42
33
|
return {
|
|
43
34
|
// Base
|
|
44
|
-
euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", minWidth && logicalCSS('min-width', minWidth), "
|
|
35
|
+
euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", minWidth && logicalCSS('min-width', minWidth), ";font-weight:", euiTheme.font.weight.medium, ";padding:0 ", euiTheme.size.m, ";&:hover:not(:disabled),&:focus{text-decoration:underline;};label:euiButtonDisplay;"),
|
|
45
36
|
// States
|
|
46
|
-
isDisabled:
|
|
47
|
-
fullWidth:
|
|
37
|
+
isDisabled: _ref,
|
|
38
|
+
fullWidth: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), ";;label:fullWidth;"),
|
|
48
39
|
// Sizes
|
|
49
40
|
xs: /*#__PURE__*/css(_buttonSize(euiTheme.size.l), euiFontSize(euiThemeContext, 'xs'), ";label:xs;"),
|
|
50
41
|
s: /*#__PURE__*/css(_buttonSize(euiTheme.size.xl), euiFontSize(euiThemeContext, 's'), ";label:s;"),
|
|
@@ -14,6 +14,7 @@ import { useEuiTheme } from '../../../services';
|
|
|
14
14
|
import { EuiLoadingSpinner } from '../../loading';
|
|
15
15
|
import { EuiIcon } from '../../icon';
|
|
16
16
|
import { euiButtonDisplayContentStyles } from './_button_display_content.styles';
|
|
17
|
+
import classNames from 'classnames';
|
|
17
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
19
|
export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
19
20
|
var children = _ref.children,
|
|
@@ -30,7 +31,7 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
30
31
|
|
|
31
32
|
var theme = useEuiTheme();
|
|
32
33
|
var styles = euiButtonDisplayContentStyles(theme);
|
|
33
|
-
var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide]
|
|
34
|
+
var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide]];
|
|
34
35
|
var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
|
|
35
36
|
var cssIconStyles = [styles.euiButtonDisplayContent__icon]; // Add an icon to the button if one exists.
|
|
36
37
|
|
|
@@ -63,5 +64,7 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
63
64
|
var isText = typeof children === 'string';
|
|
64
65
|
return ___EmotionJSX("span", _extends({}, contentProps, {
|
|
65
66
|
css: cssStyles
|
|
66
|
-
}), icon, isText ? ___EmotionJSX("span", textProps,
|
|
67
|
+
}), icon, isText ? ___EmotionJSX("span", _extends({}, textProps, {
|
|
68
|
+
className: classNames('eui-textTruncate', textProps === null || textProps === void 0 ? void 0 : textProps.className)
|
|
69
|
+
}), children) : children);
|
|
67
70
|
};
|
|
@@ -11,15 +11,6 @@ import { css } from '@emotion/react';
|
|
|
11
11
|
import { logicalCSS } from '../../../global_styling';
|
|
12
12
|
|
|
13
13
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
-
name: "ske5nx-isDisabled",
|
|
15
|
-
styles: "pointer-events:auto;cursor:not-allowed;label:isDisabled;"
|
|
16
|
-
} : {
|
|
17
|
-
name: "ske5nx-isDisabled",
|
|
18
|
-
styles: "pointer-events:auto;cursor:not-allowed;label:isDisabled;",
|
|
19
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
23
14
|
name: "gtg6j-euiButtonDisplayContent__icon",
|
|
24
15
|
styles: "flex-shrink:0;label:euiButtonDisplayContent__icon;"
|
|
25
16
|
} : {
|
|
@@ -28,7 +19,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
28
19
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
20
|
};
|
|
30
21
|
|
|
31
|
-
var
|
|
22
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
32
23
|
name: "10wlo76-euiButtonDisplayContent__spinner",
|
|
33
24
|
styles: "flex-shrink:0;label:euiButtonDisplayContent__spinner;"
|
|
34
25
|
} : {
|
|
@@ -37,7 +28,7 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
|
37
28
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
29
|
};
|
|
39
30
|
|
|
40
|
-
var
|
|
31
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
41
32
|
name: "qfl6yj-right",
|
|
42
33
|
styles: "flex-direction:row-reverse;label:right;"
|
|
43
34
|
} : {
|
|
@@ -46,16 +37,15 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
|
46
37
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
47
38
|
};
|
|
48
39
|
|
|
49
|
-
export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(
|
|
50
|
-
var euiTheme =
|
|
40
|
+
export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref4) {
|
|
41
|
+
var euiTheme = _ref4.euiTheme;
|
|
51
42
|
return {
|
|
52
43
|
// Base
|
|
53
44
|
euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), ";", logicalCSS('width', '100%'), ";display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;"),
|
|
54
45
|
// Icon side
|
|
55
46
|
left: /*#__PURE__*/css(";label:left;"),
|
|
56
|
-
right:
|
|
57
|
-
euiButtonDisplayContent__spinner:
|
|
58
|
-
euiButtonDisplayContent__icon:
|
|
59
|
-
isDisabled: _ref
|
|
47
|
+
right: _ref3,
|
|
48
|
+
euiButtonDisplayContent__spinner: _ref2,
|
|
49
|
+
euiButtonDisplayContent__icon: _ref
|
|
60
50
|
};
|
|
61
51
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
var _excluded = ["children", "className", "iconType", "iconSide", "iconSize", "color", "size", "flush", "isDisabled", "disabled", "isLoading", "href", "target", "rel", "type", "buttonRef", "contentProps", "textProps", "isSelected"];
|
|
5
5
|
|
|
@@ -17,19 +17,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { keysOf } from '../../common';
|
|
20
|
-
import { getSecureRelForTarget } from '../../../services';
|
|
20
|
+
import { EuiThemeProvider, getSecureRelForTarget } from '../../../services';
|
|
21
21
|
import { EuiButtonContentDeprecated as EuiButtonContent } from '../_button_content_deprecated';
|
|
22
|
-
import {
|
|
22
|
+
import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
23
|
+
import { isButtonDisabled } from '../button_display/_button_display';
|
|
23
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
24
|
-
var colorToClassNameMap = {
|
|
25
|
-
primary: 'euiButtonEmpty--primary',
|
|
26
|
-
danger: 'euiButtonEmpty--danger',
|
|
27
|
-
text: 'euiButtonEmpty--text',
|
|
28
|
-
ghost: 'euiButtonEmpty--ghost',
|
|
29
|
-
success: 'euiButtonEmpty--success',
|
|
30
|
-
warning: 'euiButtonEmpty--warning'
|
|
31
|
-
};
|
|
32
|
-
export var COLORS = keysOf(colorToClassNameMap);
|
|
33
25
|
var sizeToClassNameMap = {
|
|
34
26
|
xs: 'euiButtonEmpty--xSmall',
|
|
35
27
|
s: 'euiButtonEmpty--small',
|
|
@@ -47,43 +39,57 @@ export var FLUSH_TYPES = keysOf(flushTypeToClassNameMap);
|
|
|
47
39
|
* `iconType`, `iconSide`, and `textProps`
|
|
48
40
|
*/
|
|
49
41
|
|
|
50
|
-
export var EuiButtonEmpty = function EuiButtonEmpty(
|
|
51
|
-
var children =
|
|
52
|
-
className =
|
|
53
|
-
iconType =
|
|
54
|
-
|
|
55
|
-
iconSide =
|
|
56
|
-
|
|
57
|
-
iconSize =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
size =
|
|
62
|
-
flush =
|
|
63
|
-
_isDisabled =
|
|
64
|
-
|
|
65
|
-
isLoading =
|
|
66
|
-
href =
|
|
67
|
-
target =
|
|
68
|
-
rel =
|
|
69
|
-
|
|
70
|
-
type =
|
|
71
|
-
buttonRef =
|
|
72
|
-
contentProps =
|
|
73
|
-
textProps =
|
|
74
|
-
isSelected =
|
|
75
|
-
rest = _objectWithoutProperties(
|
|
42
|
+
export var EuiButtonEmpty = function EuiButtonEmpty(props) {
|
|
43
|
+
var children = props.children,
|
|
44
|
+
className = props.className,
|
|
45
|
+
iconType = props.iconType,
|
|
46
|
+
_props$iconSide = props.iconSide,
|
|
47
|
+
iconSide = _props$iconSide === void 0 ? 'left' : _props$iconSide,
|
|
48
|
+
_props$iconSize = props.iconSize,
|
|
49
|
+
iconSize = _props$iconSize === void 0 ? 'm' : _props$iconSize,
|
|
50
|
+
_props$color = props.color,
|
|
51
|
+
_color = _props$color === void 0 ? 'primary' : _props$color,
|
|
52
|
+
_props$size = props.size,
|
|
53
|
+
size = _props$size === void 0 ? 'm' : _props$size,
|
|
54
|
+
flush = props.flush,
|
|
55
|
+
_isDisabled = props.isDisabled,
|
|
56
|
+
disabled = props.disabled,
|
|
57
|
+
isLoading = props.isLoading,
|
|
58
|
+
href = props.href,
|
|
59
|
+
target = props.target,
|
|
60
|
+
rel = props.rel,
|
|
61
|
+
_props$type = props.type,
|
|
62
|
+
type = _props$type === void 0 ? 'button' : _props$type,
|
|
63
|
+
buttonRef = props.buttonRef,
|
|
64
|
+
contentProps = props.contentProps,
|
|
65
|
+
textProps = props.textProps,
|
|
66
|
+
isSelected = props.isSelected,
|
|
67
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
76
68
|
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
var isDisabled = isButtonDisabled({
|
|
70
|
+
isDisabled: _isDisabled || disabled,
|
|
71
|
+
href: href,
|
|
72
|
+
isLoading: isLoading
|
|
73
|
+
}); // eslint-disable-next-line no-nested-ternary
|
|
74
|
+
|
|
75
|
+
var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
|
|
76
|
+
var buttonColorStyles = useEuiButtonColorCSS({
|
|
77
|
+
display: 'empty'
|
|
78
|
+
})[color];
|
|
79
|
+
|
|
80
|
+
if (_color === 'ghost') {
|
|
81
|
+
// INCEPTION: If `ghost`, re-implement with a wrapping dark mode theme provider
|
|
82
|
+
return ___EmotionJSX(EuiThemeProvider, {
|
|
83
|
+
colorMode: "dark"
|
|
84
|
+
}, ___EmotionJSX(EuiButtonEmpty, _extends({}, props, {
|
|
85
|
+
color: "text"
|
|
86
|
+
})));
|
|
87
|
+
}
|
|
80
88
|
|
|
81
|
-
var
|
|
82
|
-
var classes = classNames('euiButtonEmpty', colorToClassNameMap[color], size ? sizeToClassNameMap[size] : null, flush ? flushTypeToClassNameMap[flush] : null, {
|
|
83
|
-
'euiButtonEmpty-isDisabled': buttonIsDisabled
|
|
84
|
-
}, className);
|
|
89
|
+
var classes = classNames('euiButtonEmpty', size ? sizeToClassNameMap[size] : null, flush ? flushTypeToClassNameMap[flush] : null, className);
|
|
85
90
|
var contentClassNames = classNames('euiButtonEmpty__content', contentProps && contentProps.className);
|
|
86
91
|
var textClassNames = classNames('euiButtonEmpty__text', textProps && textProps.className);
|
|
92
|
+
var cssStyles = [buttonColorStyles];
|
|
87
93
|
|
|
88
94
|
var innerNode = ___EmotionJSX(EuiButtonContent, _extends({
|
|
89
95
|
isLoading: isLoading,
|
|
@@ -100,7 +106,7 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
100
106
|
// this is a button and piggyback off its disabled styles.
|
|
101
107
|
|
|
102
108
|
|
|
103
|
-
if (href && !
|
|
109
|
+
if (href && !isDisabled) {
|
|
104
110
|
var secureRel = getSecureRelForTarget({
|
|
105
111
|
href: href,
|
|
106
112
|
target: target,
|
|
@@ -108,6 +114,7 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
108
114
|
});
|
|
109
115
|
return ___EmotionJSX("a", _extends({
|
|
110
116
|
className: classes,
|
|
117
|
+
css: cssStyles,
|
|
111
118
|
href: href,
|
|
112
119
|
target: target,
|
|
113
120
|
rel: secureRel,
|
|
@@ -116,8 +123,9 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
116
123
|
}
|
|
117
124
|
|
|
118
125
|
return ___EmotionJSX("button", _extends({
|
|
119
|
-
disabled:
|
|
126
|
+
disabled: isDisabled,
|
|
120
127
|
className: classes,
|
|
128
|
+
css: cssStyles,
|
|
121
129
|
type: type,
|
|
122
130
|
ref: buttonRef,
|
|
123
131
|
"aria-pressed": isSelected
|