@elastic/eui 64.0.0 → 65.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +330 -330
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +217 -1614
- 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 +244 -1641
- 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 +2 -3
- package/es/components/basic_table/in_memory_table.js +1 -1
- package/es/components/beacon/beacon.styles.js +2 -2
- package/es/components/breadcrumbs/breadcrumb.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/description_list/description_list_title.js +1 -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 +7 -6
- 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/text/text.styles.js +1 -1
- package/es/components/title/title.styles.js +2 -2
- package/es/components/toast/global_toast_list.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 +16 -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 +18 -5
- package/es/global_styling/mixins/_states.js +3 -4
- package/es/global_styling/mixins/_typography.js +3 -1
- package/es/global_styling/reset/global_styles.js +2 -1
- package/es/global_styling/utility/utility.js +10 -2
- package/es/themes/amsterdam/global_styling/mixins/button.js +165 -16
- package/eui.d.ts +1156 -1013
- package/i18ntokens.json +19 -19
- 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 +2 -3
- package/lib/components/basic_table/in_memory_table.js +1 -1
- package/lib/components/beacon/beacon.styles.js +1 -1
- package/lib/components/breadcrumbs/breadcrumb.styles.js +2 -2
- 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/description_list/description_list_title.js +1 -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 +6 -5
- 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/text/text.styles.js +1 -1
- package/lib/components/title/title.styles.js +1 -1
- package/lib/components/toast/global_toast_list.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 +22 -74
- 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 +24 -6
- package/lib/global_styling/mixins/_states.js +3 -4
- package/lib/global_styling/mixins/_typography.js +4 -1
- package/lib/global_styling/reset/global_styles.js +3 -1
- package/lib/global_styling/utility/utility.js +16 -3
- 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/basic_table/collapsed_item_actions.js +1 -2
- package/optimize/es/components/beacon/beacon.styles.js +2 -2
- package/optimize/es/components/breadcrumbs/breadcrumb.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/description_list/description_list_title.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 +7 -6
- 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/text/text.styles.js +1 -1
- package/optimize/es/components/title/title.styles.js +2 -2
- package/optimize/es/components/toast/global_toast_list.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 +16 -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 +18 -5
- package/optimize/es/global_styling/mixins/_states.js +3 -4
- package/optimize/es/global_styling/mixins/_typography.js +3 -1
- package/optimize/es/global_styling/reset/global_styles.js +2 -1
- package/optimize/es/global_styling/utility/utility.js +10 -2
- 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/basic_table/collapsed_item_actions.js +1 -2
- package/optimize/lib/components/beacon/beacon.styles.js +1 -1
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +2 -2
- 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/description_list/description_list_title.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 +6 -5
- 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/text/text.styles.js +1 -1
- package/optimize/lib/components/title/title.styles.js +1 -1
- package/optimize/lib/components/toast/global_toast_list.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 +28 -74
- 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 +24 -6
- package/optimize/lib/global_styling/mixins/_states.js +3 -4
- package/optimize/lib/global_styling/mixins/_typography.js +4 -1
- package/optimize/lib/global_styling/reset/global_styles.js +3 -1
- package/optimize/lib/global_styling/utility/utility.js +16 -3
- 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/_helpers.scss +9 -0
- package/src/global_styling/mixins/_index.scss +0 -1
- package/src/global_styling/utility/_utility.scss +0 -127
- 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 +2 -3
- 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/breadcrumbs/breadcrumb.styles.js +2 -2
- 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/description_list/description_list_title.js +1 -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 +6 -5
- 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/text/text.styles.js +1 -1
- package/test-env/components/title/title.styles.js +1 -1
- package/test-env/components/toast/global_toast_list.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 +28 -74
- 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 +24 -6
- package/test-env/global_styling/mixins/_states.js +3 -4
- package/test-env/global_styling/mixins/_typography.js +4 -1
- package/test-env/global_styling/reset/global_styles.js +3 -1
- package/test-env/global_styling/utility/utility.js +16 -3
- 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
|
@@ -46,15 +46,7 @@ export var EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
46
46
|
type = _ref$type === void 0 ? 'single' : _ref$type,
|
|
47
47
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
var badColorCombo = buttonSize === 'compressed' && color === 'ghost';
|
|
51
|
-
var resolvedColor = badColorCombo ? 'text' : color;
|
|
52
|
-
|
|
53
|
-
if (badColorCombo) {
|
|
54
|
-
console.warn('EuiButtonGroup of compressed size does not support the ghost color. It will render as text instead.');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var classes = classNames('euiButtonGroup', "euiButtonGroup".concat(groupSizeToClassNameMap[buttonSize]), "euiButtonGroup".concat(colorToClassNameMap[resolvedColor]), {
|
|
49
|
+
var classes = classNames('euiButtonGroup', "euiButtonGroup".concat(groupSizeToClassNameMap[buttonSize]), "euiButtonGroup".concat(colorToClassNameMap[color]), {
|
|
58
50
|
'euiButtonGroup--fullWidth': isFullWidth,
|
|
59
51
|
'euiButtonGroup--isDisabled': isDisabled
|
|
60
52
|
}, className);
|
|
@@ -76,7 +68,7 @@ export var EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
76
68
|
}, option, {
|
|
77
69
|
element: typeIsSingle ? 'label' : 'button',
|
|
78
70
|
isSelected: typeIsSingle ? option.id === idSelected : idToSelectedMap[option.id],
|
|
79
|
-
color:
|
|
71
|
+
color: color,
|
|
80
72
|
size: buttonSize,
|
|
81
73
|
isIconOnly: isIconOnly,
|
|
82
74
|
onChange: onChange
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "name", "onChange", "size", "value", "element", "type"];
|
|
5
|
+
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "name", "onChange", "size", "value", "color", "element", "type"];
|
|
6
6
|
|
|
7
7
|
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
8
|
|
|
@@ -20,6 +20,7 @@ import React from 'react';
|
|
|
20
20
|
import { EuiButtonDisplayDeprecated as EuiButtonDisplay } from '../button';
|
|
21
21
|
import { useInnerText } from '../../inner_text';
|
|
22
22
|
import { useGeneratedHtmlId } from '../../../services';
|
|
23
|
+
import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
23
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
24
25
|
export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
25
26
|
var className = _ref.className,
|
|
@@ -33,6 +34,8 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
33
34
|
_onChange = _ref.onChange,
|
|
34
35
|
size = _ref.size,
|
|
35
36
|
value = _ref.value,
|
|
37
|
+
_ref$color = _ref.color,
|
|
38
|
+
_color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
36
39
|
_ref$element = _ref.element,
|
|
37
40
|
element = _ref$element === void 0 ? 'button' : _ref$element,
|
|
38
41
|
_ref$type = _ref.type,
|
|
@@ -72,8 +75,15 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
72
75
|
return _onChange(id);
|
|
73
76
|
}
|
|
74
77
|
});
|
|
75
|
-
}
|
|
78
|
+
} // eslint-disable-next-line no-nested-ternary
|
|
76
79
|
|
|
80
|
+
|
|
81
|
+
var color = isDisabled ? 'disabled' : _color; // eslint-disable-next-line no-nested-ternary
|
|
82
|
+
|
|
83
|
+
var display = isSelected ? 'fill' : size === 'compressed' ? 'empty' : 'base';
|
|
84
|
+
var buttonColorStyles = useEuiButtonColorCSS({
|
|
85
|
+
display: display
|
|
86
|
+
})[color];
|
|
77
87
|
var buttonClasses = classNames({
|
|
78
88
|
'euiButtonGroupButton-isSelected': isSelected,
|
|
79
89
|
'euiButtonGroupButton-isIconOnly': isIconOnly
|
|
@@ -90,10 +100,10 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
90
100
|
innerText = _useInnerText2[1];
|
|
91
101
|
|
|
92
102
|
return ___EmotionJSX(EuiButtonDisplay, _extends({
|
|
103
|
+
css: [buttonColorStyles, ";label:EuiButtonGroupButton;"],
|
|
93
104
|
baseClassName: "euiButtonGroupButton",
|
|
94
105
|
className: buttonClasses,
|
|
95
106
|
element: el,
|
|
96
|
-
fill: size !== 'compressed' && isSelected,
|
|
97
107
|
isDisabled: isDisabled,
|
|
98
108
|
size: size === 'compressed' ? 's' : size,
|
|
99
109
|
textProps: {
|
|
@@ -11,11 +11,13 @@ var _excluded = ["className", "iconType", "iconSize", "color", "isDisabled", "di
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
import { getSecureRelForTarget } from '../../../services';
|
|
14
|
+
import { EuiThemeProvider, getSecureRelForTarget, useEuiTheme } from '../../../services';
|
|
15
15
|
import { keysOf } from '../../common';
|
|
16
16
|
import { EuiIcon } from '../../icon';
|
|
17
17
|
import { EuiLoadingSpinner } from '../../loading';
|
|
18
|
-
import {
|
|
18
|
+
import { euiButtonEmptyColor, useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
19
|
+
import { isButtonDisabled } from '../button_display/_button_display';
|
|
20
|
+
import { css } from '@emotion/react';
|
|
19
21
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
22
|
var displayToClassNameMap = {
|
|
21
23
|
base: null,
|
|
@@ -23,57 +25,66 @@ var displayToClassNameMap = {
|
|
|
23
25
|
fill: 'euiButtonIcon--fill'
|
|
24
26
|
};
|
|
25
27
|
export var DISPLAYS = keysOf(displayToClassNameMap);
|
|
26
|
-
var colorToClassNameMap = {
|
|
27
|
-
accent: 'euiButtonIcon--accent',
|
|
28
|
-
danger: 'euiButtonIcon--danger',
|
|
29
|
-
ghost: 'euiButtonIcon--ghost',
|
|
30
|
-
primary: 'euiButtonIcon--primary',
|
|
31
|
-
success: 'euiButtonIcon--success',
|
|
32
|
-
text: 'euiButtonIcon--text',
|
|
33
|
-
warning: 'euiButtonIcon--warning'
|
|
34
|
-
};
|
|
35
|
-
export var COLORS = keysOf(colorToClassNameMap);
|
|
36
28
|
var sizeToClassNameMap = {
|
|
37
29
|
xs: 'euiButtonIcon--xSmall',
|
|
38
30
|
s: 'euiButtonIcon--small',
|
|
39
31
|
m: 'euiButtonIcon--medium'
|
|
40
32
|
};
|
|
41
33
|
export var SIZES = keysOf(sizeToClassNameMap);
|
|
42
|
-
export var EuiButtonIcon = function EuiButtonIcon(
|
|
43
|
-
var className =
|
|
44
|
-
iconType =
|
|
45
|
-
|
|
46
|
-
iconSize =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
_isDisabled =
|
|
50
|
-
disabled =
|
|
51
|
-
href =
|
|
52
|
-
|
|
53
|
-
type =
|
|
54
|
-
|
|
55
|
-
display =
|
|
56
|
-
target =
|
|
57
|
-
rel =
|
|
58
|
-
|
|
59
|
-
size =
|
|
60
|
-
buttonRef =
|
|
61
|
-
isSelected =
|
|
62
|
-
isLoading =
|
|
63
|
-
rest = _objectWithoutProperties(
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
var isDisabled =
|
|
34
|
+
export var EuiButtonIcon = function EuiButtonIcon(props) {
|
|
35
|
+
var className = props.className,
|
|
36
|
+
iconType = props.iconType,
|
|
37
|
+
_props$iconSize = props.iconSize,
|
|
38
|
+
iconSize = _props$iconSize === void 0 ? 'm' : _props$iconSize,
|
|
39
|
+
_props$color = props.color,
|
|
40
|
+
_color = _props$color === void 0 ? 'primary' : _props$color,
|
|
41
|
+
_isDisabled = props.isDisabled,
|
|
42
|
+
disabled = props.disabled,
|
|
43
|
+
href = props.href,
|
|
44
|
+
_props$type = props.type,
|
|
45
|
+
type = _props$type === void 0 ? 'button' : _props$type,
|
|
46
|
+
_props$display = props.display,
|
|
47
|
+
display = _props$display === void 0 ? 'empty' : _props$display,
|
|
48
|
+
target = props.target,
|
|
49
|
+
rel = props.rel,
|
|
50
|
+
_props$size = props.size,
|
|
51
|
+
size = _props$size === void 0 ? 'xs' : _props$size,
|
|
52
|
+
buttonRef = props.buttonRef,
|
|
53
|
+
isSelected = props.isSelected,
|
|
54
|
+
isLoading = props.isLoading,
|
|
55
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
56
|
+
|
|
57
|
+
var euiThemeContext = useEuiTheme();
|
|
58
|
+
var isDisabled = isButtonDisabled({
|
|
59
|
+
isDisabled: _isDisabled || disabled,
|
|
60
|
+
href: href,
|
|
61
|
+
isLoading: isLoading
|
|
62
|
+
});
|
|
67
63
|
var ariaHidden = rest['aria-hidden'];
|
|
68
64
|
var isAriaHidden = ariaHidden === 'true' || ariaHidden === true;
|
|
69
65
|
|
|
70
66
|
if (!rest['aria-label'] && !rest['aria-labelledby'] && !isAriaHidden) {
|
|
71
67
|
console.warn("EuiButtonIcon requires aria-label or aria-labelledby to be specified because icon-only\n buttons are screen-reader-inaccessible without them.");
|
|
72
|
-
}
|
|
68
|
+
} // eslint-disable-next-line no-nested-ternary
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
|
|
72
|
+
var buttonColorStyles = useEuiButtonColorCSS({
|
|
73
|
+
display: display
|
|
74
|
+
})[color]; // Temporary extra style for empty `:hover` state until we decide how to handle universally
|
|
75
|
+
|
|
76
|
+
var hoverStyles = display === 'empty' ? /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;") : /*#__PURE__*/css(";label:hoverStyles;");
|
|
77
|
+
var classes = classNames('euiButtonIcon', size && sizeToClassNameMap[size], className);
|
|
78
|
+
|
|
79
|
+
if (_color === 'ghost') {
|
|
80
|
+
// INCEPTION: If `ghost`, re-implement with a wrapping dark mode theme provider
|
|
81
|
+
return ___EmotionJSX(EuiThemeProvider, {
|
|
82
|
+
colorMode: "dark"
|
|
83
|
+
}, ___EmotionJSX(EuiButtonIcon, _extends({}, props, {
|
|
84
|
+
color: "text"
|
|
85
|
+
})));
|
|
86
|
+
} // Add an icon to the button if one exists.
|
|
73
87
|
|
|
74
|
-
var classes = classNames('euiButtonIcon', {
|
|
75
|
-
'euiButtonIcon-isDisabled': isDisabled
|
|
76
|
-
}, colorToClassNameMap[color], display && displayToClassNameMap[display], size && sizeToClassNameMap[size], className); // Add an icon to the button if one exists.
|
|
77
88
|
|
|
78
89
|
var buttonIcon;
|
|
79
90
|
|
|
@@ -108,6 +119,7 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
108
119
|
rel: rel
|
|
109
120
|
});
|
|
110
121
|
return ___EmotionJSX("a", _extends({
|
|
122
|
+
css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
|
|
111
123
|
tabIndex: isAriaHidden ? -1 : undefined,
|
|
112
124
|
className: classes,
|
|
113
125
|
href: href,
|
|
@@ -119,6 +131,7 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
119
131
|
|
|
120
132
|
var buttonType;
|
|
121
133
|
return ___EmotionJSX("button", _extends({
|
|
134
|
+
css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
|
|
122
135
|
tabIndex: isAriaHidden ? -1 : undefined,
|
|
123
136
|
disabled: isDisabled,
|
|
124
137
|
className: classes,
|
|
@@ -18,7 +18,8 @@ export var euiCallOutStyles = function euiCallOutStyles(_ref) {
|
|
|
18
18
|
export var euiCallOutHeadingStyles = function euiCallOutHeadingStyles(_ref2) {
|
|
19
19
|
var euiTheme = _ref2.euiTheme;
|
|
20
20
|
return {
|
|
21
|
-
euiCallOutHeader: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";margin-bottom
|
|
21
|
+
euiCallOutHeader: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";", logicalCSS('margin-bottom', '0 !important' // In case it's nested inside EuiText
|
|
22
|
+
), ";;label:euiCallOutHeader;"),
|
|
22
23
|
primary: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
23
24
|
success: /*#__PURE__*/css("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
24
25
|
warning: /*#__PURE__*/css("color:", euiTheme.colors.warningText, ";;label:warning;"),
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "description", "isDisabled", "title", "titleElement", "titleSize", "icon", "image", "children", "footer", "onClick", "href", "rel", "target", "textAlign", "betaBadgeProps", "layout", "selectable", "display", "paddingSize"]
|
|
4
|
+
var _excluded = ["className", "description", "isDisabled", "title", "titleElement", "titleSize", "icon", "image", "children", "footer", "onClick", "href", "rel", "target", "textAlign", "betaBadgeProps", "layout", "selectable", "display", "paddingSize"],
|
|
5
|
+
_excluded2 = ["anchorProps"];
|
|
6
|
+
|
|
7
|
+
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
|
+
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
10
|
|
|
5
11
|
/*
|
|
6
12
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -12,7 +18,7 @@ var _excluded = ["className", "description", "isDisabled", "title", "titleElemen
|
|
|
12
18
|
import React, { isValidElement } from 'react';
|
|
13
19
|
import classNames from 'classnames';
|
|
14
20
|
import { keysOf } from '../common';
|
|
15
|
-
import { getSecureRelForTarget } from '../../services';
|
|
21
|
+
import { getSecureRelForTarget, useEuiTheme } from '../../services';
|
|
16
22
|
import { EuiText } from '../text';
|
|
17
23
|
import { EuiTitle } from '../title';
|
|
18
24
|
import { EuiBetaBadge } from '../badge/beta_badge';
|
|
@@ -20,6 +26,8 @@ import { EuiCardSelect, euiCardSelectableColor } from './card_select';
|
|
|
20
26
|
import { useGeneratedHtmlId } from '../../services/accessibility';
|
|
21
27
|
import { validateHref } from '../../services/security/href_validator';
|
|
22
28
|
import { EuiPanel } from '../panel';
|
|
29
|
+
import { EuiSpacer } from '../spacer';
|
|
30
|
+
import { euiCardBetaBadgeStyles, euiCardStyles, euiCardTextStyles } from './card.styles';
|
|
23
31
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
24
32
|
var textAlignToClassNameMap = {
|
|
25
33
|
left: 'euiCard--leftAligned',
|
|
@@ -42,7 +50,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
42
50
|
_isDisabled = _ref.isDisabled,
|
|
43
51
|
title = _ref.title,
|
|
44
52
|
_ref$titleElement = _ref.titleElement,
|
|
45
|
-
titleElement = _ref$titleElement === void 0 ? '
|
|
53
|
+
titleElement = _ref$titleElement === void 0 ? 'p' : _ref$titleElement,
|
|
46
54
|
_ref$titleSize = _ref.titleSize,
|
|
47
55
|
titleSize = _ref$titleSize === void 0 ? 's' : _ref$titleSize,
|
|
48
56
|
icon = _ref.icon,
|
|
@@ -60,12 +68,21 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
60
68
|
layout = _ref$layout === void 0 ? 'vertical' : _ref$layout,
|
|
61
69
|
selectable = _ref.selectable,
|
|
62
70
|
display = _ref.display,
|
|
63
|
-
paddingSize = _ref.paddingSize,
|
|
71
|
+
_ref$paddingSize = _ref.paddingSize,
|
|
72
|
+
paddingSize = _ref$paddingSize === void 0 ? 'm' : _ref$paddingSize,
|
|
64
73
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
65
74
|
|
|
66
75
|
var isHrefValid = !href || validateHref(href);
|
|
67
76
|
var isDisabled = _isDisabled || !isHrefValid;
|
|
68
77
|
var isClickable = !isDisabled && (onClick || href || selectable && !selectable.isDisabled);
|
|
78
|
+
var euiThemeContext = useEuiTheme();
|
|
79
|
+
var styles = euiCardStyles(euiThemeContext, paddingSize, display);
|
|
80
|
+
var cardStyles = [styles.card.euiCard, // Text alignment should always be left when horizontal
|
|
81
|
+
styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign], styles.card.layout[layout], isDisabled && styles.card.disabled];
|
|
82
|
+
var contentStyles = [styles.content.euiCard__content, styles.content.layout[layout]];
|
|
83
|
+
var textStyles = euiCardTextStyles(euiThemeContext);
|
|
84
|
+
var textCSS = [textStyles.euiCard__text, // Text alignment should always be left when horizontal
|
|
85
|
+
textStyles.aligned[layout === 'horizontal' ? 'left' : textAlign], isClickable && textStyles.interactive, isDisabled && textStyles.disabled];
|
|
69
86
|
/**
|
|
70
87
|
* For a11y, we simulate the same click that's provided on the title when clicking the whole card
|
|
71
88
|
* without having to make the whole card a button or anchor tag.
|
|
@@ -105,8 +122,10 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
105
122
|
|
|
106
123
|
if (image && layout === 'vertical') {
|
|
107
124
|
if ( /*#__PURE__*/isValidElement(image) || typeof image === 'string') {
|
|
125
|
+
var imageStyles = [styles.euiCard__image];
|
|
108
126
|
imageNode = ___EmotionJSX("div", {
|
|
109
|
-
className: "euiCard__image"
|
|
127
|
+
className: "euiCard__image",
|
|
128
|
+
css: imageStyles
|
|
110
129
|
}, /*#__PURE__*/isValidElement(image) ? image : ___EmotionJSX("img", {
|
|
111
130
|
src: image,
|
|
112
131
|
alt: ""
|
|
@@ -119,16 +138,20 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
119
138
|
var iconNode;
|
|
120
139
|
|
|
121
140
|
if (icon) {
|
|
141
|
+
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
122
142
|
iconNode = /*#__PURE__*/React.cloneElement(icon, {
|
|
123
|
-
className: classNames(icon.props.className, 'euiCard__icon')
|
|
143
|
+
className: classNames(icon.props.className, 'euiCard__icon'),
|
|
144
|
+
css: iconStyles
|
|
124
145
|
});
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
var optionalCardTop;
|
|
128
149
|
|
|
129
150
|
if (imageNode || iconNode) {
|
|
151
|
+
var topStyles = [styles.top.euiCard__top, styles.top.layout[layout], isDisabled && styles.top.disabled];
|
|
130
152
|
optionalCardTop = ___EmotionJSX("div", {
|
|
131
|
-
className: "euiCard__top"
|
|
153
|
+
className: "euiCard__top",
|
|
154
|
+
css: topStyles
|
|
132
155
|
}, imageNode, iconNode);
|
|
133
156
|
}
|
|
134
157
|
/**
|
|
@@ -138,18 +161,28 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
138
161
|
|
|
139
162
|
var optionalBetaBadge;
|
|
140
163
|
var optionalBetaBadgeID = '';
|
|
164
|
+
var optionalBetaCSS;
|
|
141
165
|
|
|
142
166
|
if (betaBadgeProps !== null && betaBadgeProps !== void 0 && betaBadgeProps.label) {
|
|
167
|
+
var betaStyles = euiCardBetaBadgeStyles(euiThemeContext, paddingSize);
|
|
168
|
+
optionalBetaCSS = betaStyles.hasBetaBadge;
|
|
169
|
+
var anchorCSS = [betaStyles.euiCard__betaBadgeAnchor];
|
|
170
|
+
var badgeCSS = [betaStyles.euiCard__betaBadge];
|
|
171
|
+
|
|
172
|
+
var anchorProps = betaBadgeProps.anchorProps,
|
|
173
|
+
cleanedBetaBadgeProps = _objectWithoutProperties(betaBadgeProps, _excluded2);
|
|
174
|
+
|
|
143
175
|
optionalBetaBadgeID = "".concat(ariaId, "BetaBadge");
|
|
144
|
-
optionalBetaBadge = ___EmotionJSX(
|
|
145
|
-
|
|
146
|
-
|
|
176
|
+
optionalBetaBadge = ___EmotionJSX(EuiBetaBadge, _extends({
|
|
177
|
+
css: badgeCSS,
|
|
178
|
+
color: isDisabled && !betaBadgeProps.onClick && !betaBadgeProps.href ? 'subdued' : 'hollow'
|
|
179
|
+
}, cleanedBetaBadgeProps, {
|
|
180
|
+
anchorProps: _objectSpread({
|
|
181
|
+
css: anchorCSS
|
|
182
|
+
}, anchorProps),
|
|
147
183
|
id: optionalBetaBadgeID
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
}))); // Increase padding size when there is a beta badge unless it's already determined
|
|
151
|
-
|
|
152
|
-
paddingSize = paddingSize || 'l';
|
|
184
|
+
})); // Increase padding size when there is a beta badge unless it's already determined
|
|
185
|
+
// paddingSize = paddingSize || 'l';
|
|
153
186
|
}
|
|
154
187
|
/**
|
|
155
188
|
* Optional selectable button
|
|
@@ -163,25 +196,29 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
163
196
|
var optionalSelectButton;
|
|
164
197
|
|
|
165
198
|
if (selectable) {
|
|
166
|
-
optionalSelectButton = ___EmotionJSX(
|
|
199
|
+
optionalSelectButton = ___EmotionJSX(React.Fragment, null, paddingSize !== 'none' && ___EmotionJSX(EuiSpacer, {
|
|
200
|
+
size: paddingSize || 'm'
|
|
201
|
+
}), ___EmotionJSX(EuiCardSelect, _extends({
|
|
167
202
|
"aria-describedby": "".concat(ariaId, "Title ").concat(ariaDesc)
|
|
168
203
|
}, selectable, {
|
|
169
204
|
buttonRef: function buttonRef(node) {
|
|
170
205
|
link = node;
|
|
171
206
|
}
|
|
172
|
-
}));
|
|
207
|
+
})));
|
|
173
208
|
}
|
|
209
|
+
|
|
210
|
+
var TitleElement = titleElement;
|
|
174
211
|
/**
|
|
175
212
|
* Wraps the title with the link (<a>) or button.
|
|
176
213
|
* This makes the title element a11y friendly and gets described by its content if its interactable.
|
|
177
214
|
*/
|
|
178
215
|
|
|
179
|
-
|
|
180
216
|
var theTitle;
|
|
181
217
|
|
|
182
218
|
if (!isDisabled && href) {
|
|
183
219
|
theTitle = ___EmotionJSX("a", {
|
|
184
220
|
className: "euiCard__titleAnchor",
|
|
221
|
+
css: textCSS,
|
|
185
222
|
onClick: onClick,
|
|
186
223
|
href: href,
|
|
187
224
|
target: target,
|
|
@@ -198,6 +235,7 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
198
235
|
} else if (isDisabled || onClick) {
|
|
199
236
|
theTitle = ___EmotionJSX("button", {
|
|
200
237
|
className: "euiCard__titleButton",
|
|
238
|
+
css: textCSS,
|
|
201
239
|
onClick: onClick,
|
|
202
240
|
disabled: isDisabled,
|
|
203
241
|
"aria-describedby": "".concat(optionalBetaBadgeID, " ").concat(ariaDesc),
|
|
@@ -206,35 +244,63 @@ export var EuiCard = function EuiCard(_ref) {
|
|
|
206
244
|
}
|
|
207
245
|
}, title);
|
|
208
246
|
} else {
|
|
209
|
-
theTitle =
|
|
247
|
+
theTitle = ___EmotionJSX("span", {
|
|
248
|
+
css: textCSS
|
|
249
|
+
}, title);
|
|
210
250
|
}
|
|
211
251
|
/**
|
|
212
|
-
*
|
|
252
|
+
* Children and/or Description content
|
|
213
253
|
*/
|
|
214
254
|
|
|
215
255
|
|
|
216
|
-
var
|
|
256
|
+
var optionalChildren;
|
|
257
|
+
|
|
258
|
+
if (children) {
|
|
259
|
+
var childrenStyles = [styles.euiCard__children];
|
|
260
|
+
optionalChildren = ___EmotionJSX("div", {
|
|
261
|
+
css: childrenStyles
|
|
262
|
+
}, children);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
var optionalDescription;
|
|
266
|
+
|
|
267
|
+
if (description) {
|
|
268
|
+
var descriptionStyles = [styles.euiCard__description];
|
|
269
|
+
optionalDescription = ___EmotionJSX(EuiText, {
|
|
270
|
+
id: ariaDesc,
|
|
271
|
+
size: "s",
|
|
272
|
+
css: descriptionStyles
|
|
273
|
+
}, ___EmotionJSX("p", null, description));
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Footer content
|
|
277
|
+
*/
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
var optionalFooter;
|
|
281
|
+
|
|
282
|
+
if (layout === 'vertical' && footer) {
|
|
283
|
+
var footerStyles = [styles.euiCard__footer];
|
|
284
|
+
optionalFooter = ___EmotionJSX("div", {
|
|
285
|
+
css: footerStyles
|
|
286
|
+
}, footer);
|
|
287
|
+
}
|
|
288
|
+
|
|
217
289
|
return ___EmotionJSX(EuiPanel, _extends({
|
|
218
290
|
element: "div",
|
|
219
291
|
className: classes,
|
|
292
|
+
css: [].concat(cardStyles, [optionalBetaCSS]),
|
|
220
293
|
onClick: isClickable ? outerOnClick : undefined,
|
|
221
294
|
color: isDisabled ? 'subdued' : display,
|
|
222
295
|
hasShadow: isDisabled || display ? false : true,
|
|
223
296
|
hasBorder: display ? false : undefined,
|
|
224
297
|
paddingSize: paddingSize
|
|
225
298
|
}, rest), optionalCardTop, ___EmotionJSX("div", {
|
|
226
|
-
className: "euiCard__content"
|
|
299
|
+
className: "euiCard__content",
|
|
300
|
+
css: contentStyles
|
|
227
301
|
}, ___EmotionJSX(EuiTitle, {
|
|
228
302
|
id: "".concat(ariaId, "Title"),
|
|
229
303
|
className: "euiCard__title",
|
|
230
304
|
size: titleSize
|
|
231
|
-
}, ___EmotionJSX(TitleElement, null, theTitle)),
|
|
232
|
-
id: ariaDesc,
|
|
233
|
-
size: "s",
|
|
234
|
-
className: "euiCard__description"
|
|
235
|
-
}, ___EmotionJSX("p", null, description)), children && ___EmotionJSX("div", {
|
|
236
|
-
className: "euiCard__children"
|
|
237
|
-
}, children)), optionalBetaBadge, layout === 'vertical' && footer && ___EmotionJSX("div", {
|
|
238
|
-
className: "euiCard__footer"
|
|
239
|
-
}, footer), optionalSelectButton);
|
|
305
|
+
}, ___EmotionJSX(TitleElement, null, theTitle)), optionalDescription, optionalChildren), optionalBetaBadge, optionalFooter, optionalSelectButton);
|
|
240
306
|
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { euiPaddingSize, euiSupportsHas, logicalCSS, logicals, logicalTextAlignCSS } from '../../global_styling';
|
|
12
|
+
import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins';
|
|
13
|
+
var paddingKey = 'm';
|
|
14
|
+
var halfPaddingKey = 's';
|
|
15
|
+
/**
|
|
16
|
+
* 1. Footer is always at the bottom.
|
|
17
|
+
* 3. Horizontal layouts should always top left align no matter the textAlign prop
|
|
18
|
+
* 4. Ensures the contents always stretch no matter the flex layout
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
22
|
+
name: "reymun-disabled",
|
|
23
|
+
styles: "filter:grayscale(100%);label:disabled;"
|
|
24
|
+
} : {
|
|
25
|
+
name: "reymun-disabled",
|
|
26
|
+
styles: "filter:grayscale(100%);label:disabled;",
|
|
27
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
31
|
+
name: "cr3wz7-euiCard__content",
|
|
32
|
+
styles: "flex-grow:1;label:euiCard__content;"
|
|
33
|
+
} : {
|
|
34
|
+
name: "cr3wz7-euiCard__content",
|
|
35
|
+
styles: "flex-grow:1;label:euiCard__content;",
|
|
36
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
40
|
+
name: "1kw0yxn-horizontal",
|
|
41
|
+
styles: "flex-direction:row;align-items:flex-start;label:horizontal;"
|
|
42
|
+
} : {
|
|
43
|
+
name: "1kw0yxn-horizontal",
|
|
44
|
+
styles: "flex-direction:row;align-items:flex-start;label:horizontal;",
|
|
45
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
49
|
+
name: "omnk2l-vertical",
|
|
50
|
+
styles: "flex-direction:column;label:vertical;"
|
|
51
|
+
} : {
|
|
52
|
+
name: "omnk2l-vertical",
|
|
53
|
+
styles: "flex-direction:column;label:vertical;",
|
|
54
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize, color) {
|
|
58
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
59
|
+
var paddingAmount = euiPaddingSize(euiThemeContext, paddingSize);
|
|
60
|
+
var spacing = euiPaddingSize(euiThemeContext, paddingKey);
|
|
61
|
+
var halfSpacing = euiPaddingSize(euiThemeContext, halfPaddingKey);
|
|
62
|
+
return {
|
|
63
|
+
card: {
|
|
64
|
+
euiCard: /*#__PURE__*/css("display:flex;&:has([class*='euiCard__text'][class*='-interactive']:focus:focus-visible){outline:", euiTheme.focus.width, " solid currentColor;};label:euiCard;"),
|
|
65
|
+
aligned: {
|
|
66
|
+
center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";align-items:center;;label:center;"),
|
|
67
|
+
left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";align-items:flex-start;;label:left;"),
|
|
68
|
+
right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";align-items:flex-end;;label:right;")
|
|
69
|
+
},
|
|
70
|
+
layout: {
|
|
71
|
+
vertical: _ref5,
|
|
72
|
+
horizontal: _ref4
|
|
73
|
+
},
|
|
74
|
+
disabled: /*#__PURE__*/css("cursor:not-allowed;background-color:", euiButtonColor(euiThemeContext, 'disabled'), ";color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
75
|
+
},
|
|
76
|
+
content: {
|
|
77
|
+
euiCard__content: _ref3,
|
|
78
|
+
layout: {
|
|
79
|
+
vertical: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:vertical;"),
|
|
80
|
+
horizontal: /*#__PURE__*/css(logicalCSS('width', 'auto'), ";;label:horizontal;")
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
euiCard__children: /*#__PURE__*/css(logicalCSS('margin-top', halfSpacing), ";;label:euiCard__children;"),
|
|
84
|
+
euiCard__description: /*#__PURE__*/css(logicalCSS('margin-top', halfSpacing), ";;label:euiCard__description;"),
|
|
85
|
+
euiCard__footer: /*#__PURE__*/css("flex-grow:0;", logicalCSS('width', '100%'), ";", logicalCSS('margin-top', spacing), ";;label:euiCard__footer;"),
|
|
86
|
+
top: {
|
|
87
|
+
euiCard__top: /*#__PURE__*/css("flex-grow:0;font-size:0;position:relative;", logicalCSS('min-height', '1px'), ";", logicalCSS('margin-bottom', spacing), ";;label:euiCard__top;"),
|
|
88
|
+
layout: {
|
|
89
|
+
vertical: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:vertical;"),
|
|
90
|
+
horizontal: /*#__PURE__*/css(logicalCSS('width', 'auto'), ";;label:horizontal;")
|
|
91
|
+
},
|
|
92
|
+
disabled: _ref2
|
|
93
|
+
},
|
|
94
|
+
euiCard__image: /*#__PURE__*/css("position:relative;overflow:hidden;", logicalCSS('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", logicalCSS('left', "-".concat(paddingAmount)), ";", logicalCSS('top', "-".concat(paddingAmount)), ";", logicalCSS('margin-bottom', "-".concat(paddingAmount)), ";", logicals['border-top-left-radius'], ":calc(", euiTheme.border.radius.medium, " - 1px);", logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - 1px);", color === 'transparent' ? "border-radius: ".concat(euiTheme.border.radius.medium, ";") : undefined, " img{", logicalCSS('width', '100%'), ";};label:euiCard__image;"),
|
|
95
|
+
icon: {
|
|
96
|
+
euiCard__icon: /*#__PURE__*/css(";label:euiCard__icon;"),
|
|
97
|
+
withImage: /*#__PURE__*/css("position:absolute;", logicalCSS('top', '50%'), ";", logicalCSS('left', '50%'), ";transform:translate(-50%, calc(-50% + -", paddingAmount, "))!important;;label:withImage;"),
|
|
98
|
+
layout: {
|
|
99
|
+
vertical: /*#__PURE__*/css(logicalCSS('margin-top', halfSpacing), ";;label:vertical;"),
|
|
100
|
+
horizontal: /*#__PURE__*/css(logicalCSS('margin-right', spacing), ";;label:horizontal;")
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
107
|
+
name: "r8agzg-euiCard__text",
|
|
108
|
+
styles: "font:inherit;color:inherit;cursor:inherit;label:euiCard__text;"
|
|
109
|
+
} : {
|
|
110
|
+
name: "r8agzg-euiCard__text",
|
|
111
|
+
styles: "font:inherit;color:inherit;cursor:inherit;label:euiCard__text;",
|
|
112
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export var euiCardTextStyles = function euiCardTextStyles(euiThemeContext) {
|
|
116
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
117
|
+
return {
|
|
118
|
+
euiCard__text: _ref,
|
|
119
|
+
interactive: /*#__PURE__*/css("outline-offset:", euiTheme.size.xxs, ";.euiCard:hover &,.euiCard:focus &,&:hover,&:focus{text-decoration:underline;}", euiSupportsHas, "{outline:none!important;};label:interactive;"),
|
|
120
|
+
aligned: {
|
|
121
|
+
center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;"),
|
|
122
|
+
left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;"),
|
|
123
|
+
right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;")
|
|
124
|
+
},
|
|
125
|
+
disabled: /*#__PURE__*/css("color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
export var euiCardBetaBadgeStyles = function euiCardBetaBadgeStyles(euiThemeContext, paddingSize) {
|
|
129
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
130
|
+
var padding = euiPaddingSize(euiThemeContext, paddingSize);
|
|
131
|
+
return {
|
|
132
|
+
hasBetaBadge: /*#__PURE__*/css("position:relative;overflow:visible;", logicalCSS('padding-top', "calc(".concat(padding, " + ").concat(euiTheme.size.s, ")")), ";;label:hasBetaBadge;"),
|
|
133
|
+
euiCard__betaBadgeAnchor: /*#__PURE__*/css("line-height:0;position:absolute;", logicalCSS('top', '0'), ";", logicalCSS('left', '50%'), ";transform:translateX(-50%) translateY(-50%);z-index:3;", logicalCSS('min-width', 'min(30%, 112px)'), ";", logicalCSS('max-width', "calc(100% - (".concat(padding, " * 2))")), ";;label:euiCard__betaBadgeAnchor;"),
|
|
134
|
+
euiCard__betaBadge: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:euiCard__betaBadge;")
|
|
135
|
+
};
|
|
136
|
+
};
|