@elastic/eui 93.2.0 → 93.4.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.d.ts +9 -0
- package/dist/eui_charts_theme.js +56 -14
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +3 -0
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +3 -0
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/breadcrumbs/_breadcrumb_content.js +362 -0
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/es/components/breadcrumbs/breadcrumb.js +10 -324
- package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/es/components/breadcrumbs/breadcrumbs.js +8 -6
- package/es/components/breadcrumbs/types.js +1 -0
- package/es/components/button/button_display/_button_display.js +2 -3
- package/es/components/button/button_empty/button_empty.js +2 -3
- package/es/components/button/button_group/button_group.js +19 -7
- package/es/components/button/button_group/button_group.styles.js +11 -14
- package/es/components/button/button_group/button_group_button.js +59 -5
- package/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/es/components/button/button_icon/button_icon.js +4 -5
- package/es/components/button/button_icon/button_icon.styles.js +11 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +102 -59
- package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/es/components/datagrid/body/cell/index.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +14 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +54 -35
- package/es/components/datagrid/body/data_grid_body_virtualized.js +87 -56
- package/es/components/datagrid/body/data_grid_row_manager.js +7 -5
- package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
- package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
- package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
- package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/es/components/datagrid/controls/column_selector.js +126 -123
- package/es/components/datagrid/controls/column_sorting.js +605 -103
- package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/es/components/datagrid/controls/display_selector.js +109 -107
- package/es/components/datagrid/data_grid.a11y.js +13 -12
- package/es/components/datagrid/data_grid.js +47 -22
- package/es/components/datagrid/utils/col_widths.js +12 -8
- package/es/components/datagrid/utils/focus.js +10 -8
- package/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/es/components/datagrid/utils/ref.js +1 -1
- package/es/components/datagrid/utils/row_heights.js +2 -2
- package/es/components/datagrid/utils/sorting.js +29 -27
- package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/es/components/facet/facet_button.styles.js +1 -2
- package/es/components/flex/flex_grid.js +22 -8
- package/es/components/flex/flex_grid.styles.js +13 -6
- package/es/components/flex/flex_group.js +10 -11
- package/es/components/flex/flex_item.js +9 -11
- package/es/components/flex/flex_item.styles.js +107 -122
- package/es/components/flyout/flyout.js +16 -18
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
- package/es/components/icon/icon.js +13 -16
- package/es/components/icon/icon.styles.js +6 -9
- package/es/components/link/external_link_icon.js +11 -8
- package/es/components/link/link.js +2 -3
- package/es/components/link/link.styles.js +4 -10
- package/es/components/modal/confirm_modal.js +2 -1
- package/es/components/modal/modal.js +12 -3
- package/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/es/components/page/page_header/page_header_content.js +4 -2
- package/es/components/progress/progress.styles.js +2 -2
- package/es/components/skeleton/skeleton_circle.js +2 -3
- package/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/es/components/skeleton/skeleton_text.js +16 -12
- package/es/components/skeleton/skeleton_title.js +2 -3
- package/es/components/spacer/spacer.js +2 -3
- package/es/components/text/text.js +2 -3
- package/es/components/text/text_align.js +1 -2
- package/es/components/text/text_align.styles.js +5 -7
- package/es/components/text/text_color.js +2 -3
- package/es/components/title/title.js +2 -3
- package/es/components/title/title.styles.js +0 -7
- package/es/components/toast/global_toast_list.js +70 -73
- package/es/components/toast/toast.js +27 -42
- package/es/components/toast/toast.styles.js +2 -17
- package/es/global_styling/mixins/_typography.js +17 -6
- package/es/services/color/eui_palettes.js +21 -13
- package/es/services/color/index.js +1 -1
- package/es/services/hooks/index.js +1 -0
- package/es/services/hooks/useDeepEqual.js +23 -0
- package/es/services/index.js +1 -1
- package/es/services/theme/index.js +1 -1
- package/es/services/theme/style_memoization.js +47 -14
- package/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/eui.d.ts +2862 -2748
- package/i18ntokens.json +267 -267
- package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/lib/components/breadcrumbs/breadcrumb.js +11 -328
- package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/lib/components/breadcrumbs/breadcrumbs.js +7 -5
- package/lib/components/breadcrumbs/types.js +5 -0
- package/lib/components/button/button_display/_button_display.js +1 -2
- package/lib/components/button/button_empty/button_empty.js +1 -2
- package/lib/components/button/button_group/button_group.js +18 -6
- package/lib/components/button/button_group/button_group.styles.js +11 -14
- package/lib/components/button/button_group/button_group_button.js +59 -5
- package/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/lib/components/button/button_icon/button_icon.js +3 -4
- package/lib/components/button/button_icon/button_icon.styles.js +10 -2
- package/lib/components/datagrid/body/cell/data_grid_cell.js +100 -58
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/lib/components/datagrid/body/cell/index.js +2 -2
- package/lib/components/datagrid/body/data_grid_body.js +14 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +53 -34
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +86 -55
- package/lib/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/lib/components/datagrid/controls/column_selector.js +126 -123
- package/lib/components/datagrid/controls/column_sorting.js +615 -110
- package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/lib/components/datagrid/controls/display_selector.js +109 -107
- package/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/lib/components/datagrid/data_grid.js +45 -20
- package/lib/components/datagrid/utils/col_widths.js +12 -8
- package/lib/components/datagrid/utils/focus.js +10 -8
- package/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/lib/components/datagrid/utils/ref.js +1 -1
- package/lib/components/datagrid/utils/row_heights.js +1 -1
- package/lib/components/datagrid/utils/sorting.js +31 -29
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/lib/components/facet/facet_button.styles.js +1 -2
- package/lib/components/flex/flex_grid.js +23 -7
- package/lib/components/flex/flex_grid.styles.js +13 -6
- package/lib/components/flex/flex_group.js +10 -10
- package/lib/components/flex/flex_item.js +13 -13
- package/lib/components/flex/flex_item.styles.js +107 -122
- package/lib/components/flyout/flyout.js +16 -18
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
- package/lib/components/icon/icon.js +12 -15
- package/lib/components/icon/icon.styles.js +5 -8
- package/lib/components/link/external_link_icon.js +10 -7
- package/lib/components/link/link.js +1 -2
- package/lib/components/link/link.styles.js +6 -14
- package/lib/components/modal/confirm_modal.js +2 -1
- package/lib/components/modal/modal.js +12 -3
- package/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/lib/components/page/page_header/page_header_content.js +4 -2
- package/lib/components/progress/progress.styles.js +1 -1
- package/lib/components/skeleton/skeleton_circle.js +1 -2
- package/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/lib/components/skeleton/skeleton_text.js +18 -11
- package/lib/components/skeleton/skeleton_title.js +1 -2
- package/lib/components/spacer/spacer.js +1 -2
- package/lib/components/text/text.js +1 -2
- package/lib/components/text/text_align.js +1 -2
- package/lib/components/text/text_align.styles.js +5 -7
- package/lib/components/text/text_color.js +1 -2
- package/lib/components/title/title.js +1 -2
- package/lib/components/title/title.styles.js +2 -10
- package/lib/components/toast/global_toast_list.js +68 -71
- package/lib/components/toast/toast.js +25 -40
- package/lib/components/toast/toast.styles.js +11 -25
- package/lib/global_styling/mixins/_typography.js +27 -19
- package/lib/services/color/eui_palettes.js +24 -14
- package/lib/services/color/index.js +14 -0
- package/lib/services/hooks/index.js +11 -0
- package/lib/services/hooks/useDeepEqual.js +30 -0
- package/lib/services/index.js +15 -1
- package/lib/services/theme/index.js +6 -0
- package/lib/services/theme/style_memoization.js +49 -16
- package/lib/themes/amsterdam/global_styling/mixins/button.js +49 -25
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -109
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/optimize/es/components/breadcrumbs/types.js +1 -0
- package/optimize/es/components/button/button_display/_button_display.js +2 -3
- package/optimize/es/components/button/button_empty/button_empty.js +2 -3
- package/optimize/es/components/button/button_group/button_group.js +5 -7
- package/optimize/es/components/button/button_group/button_group.styles.js +11 -14
- package/optimize/es/components/button/button_group/button_group_button.js +36 -4
- package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/optimize/es/components/button/button_icon/button_icon.js +4 -5
- package/optimize/es/components/button/button_icon/button_icon.styles.js +8 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +83 -56
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/optimize/es/components/datagrid/body/cell/index.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +40 -35
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +71 -49
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +7 -5
- package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
- package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/es/components/datagrid/data_grid.js +47 -22
- package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/es/components/datagrid/utils/focus.js +10 -8
- package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/optimize/es/components/datagrid/utils/ref.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
- package/optimize/es/components/datagrid/utils/sorting.js +29 -27
- package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/es/components/facet/facet_button.styles.js +1 -2
- package/optimize/es/components/flex/flex_grid.js +19 -8
- package/optimize/es/components/flex/flex_grid.styles.js +13 -6
- package/optimize/es/components/flex/flex_group.js +9 -10
- package/optimize/es/components/flex/flex_item.js +9 -11
- package/optimize/es/components/flex/flex_item.styles.js +107 -122
- package/optimize/es/components/flyout/flyout.js +16 -18
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/es/components/icon/icon.js +13 -16
- package/optimize/es/components/icon/icon.styles.js +6 -9
- package/optimize/es/components/link/external_link_icon.js +11 -8
- package/optimize/es/components/link/link.js +2 -3
- package/optimize/es/components/link/link.styles.js +4 -10
- package/optimize/es/components/modal/confirm_modal.js +2 -1
- package/optimize/es/components/modal/modal.js +6 -2
- package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/es/components/progress/progress.styles.js +2 -2
- package/optimize/es/components/skeleton/skeleton_circle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_rectangle.js +2 -3
- package/optimize/es/components/skeleton/skeleton_text.js +16 -12
- package/optimize/es/components/skeleton/skeleton_title.js +2 -3
- package/optimize/es/components/spacer/spacer.js +2 -3
- package/optimize/es/components/text/text.js +2 -3
- package/optimize/es/components/text/text_align.js +1 -2
- package/optimize/es/components/text/text_align.styles.js +5 -7
- package/optimize/es/components/text/text_color.js +2 -3
- package/optimize/es/components/title/title.js +2 -3
- package/optimize/es/components/title/title.styles.js +0 -7
- package/optimize/es/components/toast/global_toast_list.js +70 -73
- package/optimize/es/components/toast/toast.js +27 -42
- package/optimize/es/components/toast/toast.styles.js +2 -17
- package/optimize/es/global_styling/mixins/_typography.js +14 -6
- package/optimize/es/services/color/eui_palettes.js +21 -13
- package/optimize/es/services/color/index.js +1 -1
- package/optimize/es/services/hooks/index.js +1 -0
- package/optimize/es/services/hooks/useDeepEqual.js +23 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/es/services/theme/style_memoization.js +47 -14
- package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -112
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/optimize/lib/components/breadcrumbs/types.js +5 -0
- package/optimize/lib/components/button/button_display/_button_display.js +1 -2
- package/optimize/lib/components/button/button_empty/button_empty.js +1 -2
- package/optimize/lib/components/button/button_group/button_group.js +4 -6
- package/optimize/lib/components/button/button_group/button_group.styles.js +11 -14
- package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/optimize/lib/components/button/button_icon/button_icon.js +3 -4
- package/optimize/lib/components/button/button_icon/button_icon.styles.js +8 -2
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +81 -55
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +39 -34
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +72 -50
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
- package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/lib/components/datagrid/data_grid.js +45 -20
- package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/lib/components/datagrid/utils/focus.js +10 -8
- package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/optimize/lib/components/datagrid/utils/ref.js +1 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
- package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
- package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/lib/components/facet/facet_button.styles.js +1 -2
- package/optimize/lib/components/flex/flex_grid.js +21 -7
- package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
- package/optimize/lib/components/flex/flex_group.js +9 -9
- package/optimize/lib/components/flex/flex_item.js +13 -13
- package/optimize/lib/components/flex/flex_item.styles.js +107 -122
- package/optimize/lib/components/flyout/flyout.js +16 -18
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/lib/components/icon/icon.js +12 -15
- package/optimize/lib/components/icon/icon.styles.js +5 -8
- package/optimize/lib/components/link/external_link_icon.js +10 -7
- package/optimize/lib/components/link/link.js +1 -2
- package/optimize/lib/components/link/link.styles.js +6 -14
- package/optimize/lib/components/modal/confirm_modal.js +2 -1
- package/optimize/lib/components/modal/modal.js +6 -2
- package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/lib/components/progress/progress.styles.js +1 -1
- package/optimize/lib/components/skeleton/skeleton_circle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_rectangle.js +1 -2
- package/optimize/lib/components/skeleton/skeleton_text.js +18 -11
- package/optimize/lib/components/skeleton/skeleton_title.js +1 -2
- package/optimize/lib/components/spacer/spacer.js +1 -2
- package/optimize/lib/components/text/text.js +1 -2
- package/optimize/lib/components/text/text_align.js +1 -2
- package/optimize/lib/components/text/text_align.styles.js +5 -7
- package/optimize/lib/components/text/text_color.js +1 -2
- package/optimize/lib/components/title/title.js +1 -2
- package/optimize/lib/components/title/title.styles.js +2 -10
- package/optimize/lib/components/toast/global_toast_list.js +68 -71
- package/optimize/lib/components/toast/toast.js +25 -40
- package/optimize/lib/components/toast/toast.styles.js +11 -25
- package/optimize/lib/global_styling/mixins/_typography.js +25 -19
- package/optimize/lib/services/color/eui_palettes.js +24 -14
- package/optimize/lib/services/color/index.js +14 -0
- package/optimize/lib/services/hooks/index.js +11 -0
- package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
- package/optimize/lib/services/index.js +15 -1
- package/optimize/lib/services/theme/index.js +6 -0
- package/optimize/lib/services/theme/style_memoization.js +49 -16
- package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +49 -26
- package/package.json +3 -3
- package/src/components/datagrid/_data_grid_data_row.scss +4 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +11 -323
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/test-env/components/breadcrumbs/breadcrumbs.js +7 -5
- package/test-env/components/breadcrumbs/types.js +5 -0
- package/test-env/components/button/button_display/_button_display.js +1 -2
- package/test-env/components/button/button_empty/button_empty.js +1 -2
- package/test-env/components/button/button_group/button_group.js +18 -6
- package/test-env/components/button/button_group/button_group.styles.js +11 -14
- package/test-env/components/button/button_group/button_group_button.js +56 -5
- package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
- package/test-env/components/button/button_icon/button_icon.js +3 -4
- package/test-env/components/button/button_icon/button_icon.styles.js +8 -2
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +100 -58
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
- package/test-env/components/datagrid/body/cell/index.js +2 -2
- package/test-env/components/datagrid/body/data_grid_body.js +14 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +53 -34
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +86 -55
- package/test-env/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/test-env/components/datagrid/controls/column_selector.js +126 -123
- package/test-env/components/datagrid/controls/column_sorting.js +607 -106
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/test-env/components/datagrid/controls/display_selector.js +109 -107
- package/test-env/components/datagrid/data_grid.a11y.js +13 -12
- package/test-env/components/datagrid/data_grid.js +45 -20
- package/test-env/components/datagrid/utils/col_widths.js +9 -5
- package/test-env/components/datagrid/utils/focus.js +10 -8
- package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
- package/test-env/components/datagrid/utils/ref.js +1 -1
- package/test-env/components/datagrid/utils/row_heights.js +1 -1
- package/test-env/components/datagrid/utils/sorting.js +31 -29
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/test-env/components/facet/facet_button.styles.js +1 -2
- package/test-env/components/flex/flex_grid.js +21 -7
- package/test-env/components/flex/flex_grid.styles.js +13 -6
- package/test-env/components/flex/flex_group.js +10 -10
- package/test-env/components/flex/flex_item.js +13 -13
- package/test-env/components/flex/flex_item.styles.js +107 -122
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
- package/test-env/components/icon/icon.styles.js +5 -8
- package/test-env/components/link/external_link_icon.js +10 -7
- package/test-env/components/link/link.js +1 -2
- package/test-env/components/link/link.styles.js +6 -14
- package/test-env/components/modal/confirm_modal.js +2 -1
- package/test-env/components/modal/modal.js +12 -3
- package/test-env/components/page/page_header/page_header_content.js +4 -2
- package/test-env/components/progress/progress.styles.js +1 -1
- package/test-env/components/skeleton/skeleton_circle.js +1 -2
- package/test-env/components/skeleton/skeleton_rectangle.js +1 -2
- package/test-env/components/skeleton/skeleton_text.js +18 -11
- package/test-env/components/skeleton/skeleton_title.js +1 -2
- package/test-env/components/spacer/spacer.js +1 -2
- package/test-env/components/text/text.js +1 -2
- package/test-env/components/text/text_align.js +1 -2
- package/test-env/components/text/text_align.styles.js +5 -7
- package/test-env/components/text/text_color.js +1 -2
- package/test-env/components/title/title.js +1 -2
- package/test-env/components/title/title.styles.js +2 -10
- package/test-env/components/toast/global_toast_list.js +68 -71
- package/test-env/components/toast/toast.js +25 -40
- package/test-env/components/toast/toast.styles.js +11 -25
- package/test-env/global_styling/mixins/_typography.js +25 -19
- package/test-env/services/color/eui_palettes.js +24 -14
- package/test-env/services/color/index.js +14 -0
- package/test-env/services/hooks/index.js +11 -0
- package/test-env/services/hooks/useDeepEqual.js +30 -0
- package/test-env/services/index.js +15 -1
- package/test-env/services/theme/index.js +6 -0
- package/test-env/services/theme/style_memoization.js +49 -16
- package/test-env/themes/amsterdam/global_styling/mixins/button.js +49 -26
- package/src/themes/charts/theme.scss +0 -5
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["text", "truncate", "type", "href", "rel", "onClick", "popoverContent", "popoverProps", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb", "truncateLastBreadcrumb"],
|
|
6
|
+
_excluded2 = ["css"],
|
|
7
|
+
_excluded3 = ["popoverContent", "popoverProps", "color", "type", "title", "aria-current", "className", "isLastBreadcrumb", "breadcrumbCss", "truncationCss", "children"];
|
|
8
|
+
/*
|
|
9
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
11
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
12
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
13
|
+
* Side Public License, v 1.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import React, { useState, useCallback, forwardRef } from 'react';
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
19
|
+
import { EuiInnerText } from '../inner_text';
|
|
20
|
+
import { EuiTextColor } from '../text';
|
|
21
|
+
import { EuiLink } from '../link';
|
|
22
|
+
import { EuiPopover } from '../popover';
|
|
23
|
+
import { EuiIcon } from '../icon';
|
|
24
|
+
import { useEuiI18n } from '../i18n';
|
|
25
|
+
import { euiBreadcrumbContentStyles, euiBreadcrumbPopoverStyles } from './_breadcrumb_content.styles';
|
|
26
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
|
+
export var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref) {
|
|
28
|
+
var text = _ref.text,
|
|
29
|
+
truncate = _ref.truncate,
|
|
30
|
+
type = _ref.type,
|
|
31
|
+
href = _ref.href,
|
|
32
|
+
rel = _ref.rel,
|
|
33
|
+
onClick = _ref.onClick,
|
|
34
|
+
popoverContent = _ref.popoverContent,
|
|
35
|
+
popoverProps = _ref.popoverProps,
|
|
36
|
+
className = _ref.className,
|
|
37
|
+
color = _ref.color,
|
|
38
|
+
isFirstBreadcrumb = _ref.isFirstBreadcrumb,
|
|
39
|
+
isLastBreadcrumb = _ref.isLastBreadcrumb,
|
|
40
|
+
isOnlyBreadcrumb = _ref.isOnlyBreadcrumb,
|
|
41
|
+
highlightLastBreadcrumb = _ref.highlightLastBreadcrumb,
|
|
42
|
+
truncateLastBreadcrumb = _ref.truncateLastBreadcrumb,
|
|
43
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
+
var classes = classNames('euiBreadcrumb__content', className);
|
|
45
|
+
var styles = useEuiMemoizedStyles(euiBreadcrumbContentStyles);
|
|
46
|
+
var cssStyles = [styles.euiBreadcrumb__content, styles[type]];
|
|
47
|
+
if (type === 'application') {
|
|
48
|
+
if (isOnlyBreadcrumb) {
|
|
49
|
+
cssStyles.push(styles.applicationStyles.onlyChild);
|
|
50
|
+
} else if (isFirstBreadcrumb) {
|
|
51
|
+
cssStyles.push(styles.applicationStyles.firstChild);
|
|
52
|
+
} else if (isLastBreadcrumb) {
|
|
53
|
+
cssStyles.push(styles.applicationStyles.lastChild);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var truncationStyles = [truncate && !truncateLastBreadcrumb && styles.isTruncated, truncateLastBreadcrumb && styles.isTruncatedLast];
|
|
57
|
+
var isBreadcrumbWithPopover = !!popoverContent;
|
|
58
|
+
var isInteractiveBreadcrumb = href || onClick;
|
|
59
|
+
var linkColor = color || (highlightLastBreadcrumb ? 'text' : 'subdued');
|
|
60
|
+
var plainTextColor = highlightLastBreadcrumb ? 'default' : 'subdued'; // Does not inherit `color` prop
|
|
61
|
+
var ariaCurrent = highlightLastBreadcrumb ? 'page' : undefined;
|
|
62
|
+
return ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
|
|
63
|
+
var title = innerText === '' ? undefined : innerText;
|
|
64
|
+
var baseProps = {
|
|
65
|
+
ref: ref,
|
|
66
|
+
title: title,
|
|
67
|
+
'aria-current': ariaCurrent,
|
|
68
|
+
className: classes,
|
|
69
|
+
css: [].concat(cssStyles, truncationStyles)
|
|
70
|
+
};
|
|
71
|
+
if (isBreadcrumbWithPopover) {
|
|
72
|
+
var _ = baseProps.css,
|
|
73
|
+
popoverButtonProps = _objectWithoutProperties(baseProps, _excluded2);
|
|
74
|
+
return ___EmotionJSX(EuiBreadcrumbPopover, _extends({}, popoverButtonProps, {
|
|
75
|
+
breadcrumbCss: cssStyles,
|
|
76
|
+
truncationCss: truncationStyles,
|
|
77
|
+
isLastBreadcrumb: isLastBreadcrumb,
|
|
78
|
+
type: type,
|
|
79
|
+
color: linkColor,
|
|
80
|
+
popoverContent: popoverContent,
|
|
81
|
+
popoverProps: popoverProps
|
|
82
|
+
}, rest), text);
|
|
83
|
+
} else if (isInteractiveBreadcrumb) {
|
|
84
|
+
return ___EmotionJSX(EuiLink, _extends({}, baseProps, {
|
|
85
|
+
color: linkColor,
|
|
86
|
+
onClick: onClick,
|
|
87
|
+
href: href,
|
|
88
|
+
rel: rel
|
|
89
|
+
}, rest), text);
|
|
90
|
+
} else {
|
|
91
|
+
return ___EmotionJSX(EuiTextColor, {
|
|
92
|
+
color: plainTextColor,
|
|
93
|
+
cloneElement: true
|
|
94
|
+
}, ___EmotionJSX("span", _extends({}, baseProps, rest), text));
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
var EuiBreadcrumbPopover = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
99
|
+
var popoverContent = _ref2.popoverContent,
|
|
100
|
+
popoverProps = _ref2.popoverProps,
|
|
101
|
+
color = _ref2.color,
|
|
102
|
+
type = _ref2.type,
|
|
103
|
+
title = _ref2.title,
|
|
104
|
+
ariaCurrent = _ref2['aria-current'],
|
|
105
|
+
className = _ref2.className,
|
|
106
|
+
isLastBreadcrumb = _ref2.isLastBreadcrumb,
|
|
107
|
+
breadcrumbCss = _ref2.breadcrumbCss,
|
|
108
|
+
truncationCss = _ref2.truncationCss,
|
|
109
|
+
children = _ref2.children,
|
|
110
|
+
rest = _objectWithoutProperties(_ref2, _excluded3);
|
|
111
|
+
var _useState = useState(false),
|
|
112
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
113
|
+
isPopoverOpen = _useState2[0],
|
|
114
|
+
setIsPopoverOpen = _useState2[1];
|
|
115
|
+
var closePopover = useCallback(function () {
|
|
116
|
+
return setIsPopoverOpen(false);
|
|
117
|
+
}, []);
|
|
118
|
+
var togglePopover = useCallback(function () {
|
|
119
|
+
return setIsPopoverOpen(function (isOpen) {
|
|
120
|
+
return !isOpen;
|
|
121
|
+
});
|
|
122
|
+
}, []);
|
|
123
|
+
var popoverAriaLabel = useEuiI18n(
|
|
124
|
+
// This component was moved into another file for organization/dev readability,
|
|
125
|
+
// but we're keeping the i18n token the same as before for consumer consistency
|
|
126
|
+
// eslint-disable-next-line local/i18n
|
|
127
|
+
'euiBreadcrumb.popoverAriaLabel', 'Clicking this button will toggle a popover dialog.');
|
|
128
|
+
var styles = useEuiMemoizedStyles(euiBreadcrumbPopoverStyles);
|
|
129
|
+
var wrapperStyles = [styles.popoverWrapper.euiBreadcrumb__popoverWrapper, !isLastBreadcrumb && styles.popoverWrapper[type]];
|
|
130
|
+
var buttonStyles = [styles.euiBreadcrumb__popoverButton].concat(_toConsumableArray(breadcrumbCss));
|
|
131
|
+
var truncationStyles = [styles.euiBreadcrumb__popoverTruncation].concat(_toConsumableArray(truncationCss));
|
|
132
|
+
return ___EmotionJSX(EuiPopover, _extends({}, popoverProps, {
|
|
133
|
+
isOpen: isPopoverOpen,
|
|
134
|
+
closePopover: closePopover,
|
|
135
|
+
css: wrapperStyles,
|
|
136
|
+
button: ___EmotionJSX(EuiLink, _extends({
|
|
137
|
+
ref: ref,
|
|
138
|
+
title: title,
|
|
139
|
+
"aria-current": ariaCurrent,
|
|
140
|
+
className: className,
|
|
141
|
+
css: buttonStyles,
|
|
142
|
+
color: color,
|
|
143
|
+
onClick: togglePopover
|
|
144
|
+
}, rest), ___EmotionJSX("span", {
|
|
145
|
+
css: truncationStyles
|
|
146
|
+
}, children), ___EmotionJSX(EuiIcon, {
|
|
147
|
+
type: "arrowDown",
|
|
148
|
+
size: "s",
|
|
149
|
+
"aria-label": " - ".concat(popoverAriaLabel)
|
|
150
|
+
}))
|
|
151
|
+
}), typeof popoverContent === 'function' ? popoverContent(closePopover) : popoverContent);
|
|
152
|
+
});
|
|
153
|
+
EuiBreadcrumbPopover.displayName = 'EuiBreadcrumbPopover';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { css } from '@emotion/react';
|
|
10
|
+
import { transparentize } from '../../services/color';
|
|
11
|
+
import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, logicalBorderRadiusCSS, mathWithUnits } from '../../global_styling';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Styles cast to inner <a>, <button>, <span> elements
|
|
15
|
+
*/
|
|
16
|
+
export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiThemeContext) {
|
|
17
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
18
|
+
return {
|
|
19
|
+
euiBreadcrumb__content: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
|
|
20
|
+
// Truncation styles
|
|
21
|
+
isTruncated: /*#__PURE__*/css(euiTextTruncate(mathWithUnits(euiTheme.size.base, function (x) {
|
|
22
|
+
return x * 10;
|
|
23
|
+
})), ";;label:isTruncated;"),
|
|
24
|
+
isTruncatedLast: /*#__PURE__*/css(euiTextTruncate('none'), ";;label:isTruncatedLast;"),
|
|
25
|
+
// Types
|
|
26
|
+
page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiThemeContext, 'center'), ";};label:page;"),
|
|
27
|
+
application: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), " background-color:", transparentize(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", logicalCSS('padding-vertical', euiTheme.size.xs), " ", logicalCSS('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", transparentize(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", euiFocusRing(euiThemeContext, 'inset'), " :focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
|
|
28
|
+
applicationStyles: {
|
|
29
|
+
onlyChild: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";clip-path:none;", logicalCSS('padding-horizontal', euiTheme.size.m), ";;label:onlyChild;"),
|
|
30
|
+
firstChild: /*#__PURE__*/css(logicalBorderRadiusCSS("".concat(euiTheme.border.radius.medium, " 0 0 ").concat(euiTheme.border.radius.medium), true), " clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%\n );", logicalCSS('padding-left', euiTheme.size.m), ";;label:firstChild;"),
|
|
31
|
+
lastChild: /*#__PURE__*/css(logicalBorderRadiusCSS("0 ".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium, " 0"), true), " clip-path:polygon(\n 0 0,\n 100% 0,\n 100% 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );", logicalCSS('padding-right', euiTheme.size.m), ";;label:lastChild;")
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export var euiBreadcrumbPopoverStyles = function euiBreadcrumbPopoverStyles(_ref) {
|
|
36
|
+
var euiTheme = _ref.euiTheme;
|
|
37
|
+
return {
|
|
38
|
+
euiBreadcrumb__popoverButton: /*#__PURE__*/css("max-inline-size:100%;display:inline-flex;align-items:center;gap:", euiTheme.size.xs, ";;label:euiBreadcrumb__popoverButton;"),
|
|
39
|
+
euiBreadcrumb__popoverTruncation: /*#__PURE__*/css(";label:euiBreadcrumb__popoverTruncation;"),
|
|
40
|
+
popoverWrapper: {
|
|
41
|
+
euiBreadcrumb__popoverWrapper: /*#__PURE__*/css(";label:euiBreadcrumb__popoverWrapper;"),
|
|
42
|
+
page: /*#__PURE__*/css("max-inline-size:calc(\n 100% - ", mathWithUnits(euiTheme.size.base, function (x) {
|
|
43
|
+
return x + 1;
|
|
44
|
+
}), "\n );;label:page;"),
|
|
45
|
+
application: null
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "className", "type", "truncate"]
|
|
5
|
-
_excluded2 = ["text", "truncate", "type", "href", "rel", "onClick", "popoverContent", "popoverProps", "className", "color", "isFirstBreadcrumb", "isLastBreadcrumb", "isOnlyBreadcrumb", "highlightLastBreadcrumb", "truncateLastBreadcrumb"];
|
|
3
|
+
var _excluded = ["children", "className", "type", "truncate"];
|
|
6
4
|
/*
|
|
7
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
8
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -11,18 +9,12 @@ var _excluded = ["children", "className", "type", "truncate"],
|
|
|
11
9
|
* Side Public License, v 1.
|
|
12
10
|
*/
|
|
13
11
|
|
|
14
|
-
import React
|
|
12
|
+
import React from 'react';
|
|
15
13
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
17
|
-
import { EuiInnerText } from '../inner_text';
|
|
18
|
-
import { EuiTextColor } from '../text';
|
|
19
|
-
import { EuiLink } from '../link';
|
|
20
|
-
import { EuiPopover } from '../popover';
|
|
21
|
-
import { EuiIcon } from '../icon';
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../services';
|
|
22
15
|
import { useEuiI18n } from '../i18n';
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
// Used internally only by the parent EuiBreadcrumbs
|
|
16
|
+
import { EuiBreadcrumbContent } from './_breadcrumb_content';
|
|
17
|
+
import { euiBreadcrumbStyles } from './breadcrumb.styles';
|
|
26
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
19
|
export var EuiBreadcrumb = function EuiBreadcrumb(_ref) {
|
|
28
20
|
var children = _ref.children,
|
|
@@ -31,8 +23,7 @@ export var EuiBreadcrumb = function EuiBreadcrumb(_ref) {
|
|
|
31
23
|
truncate = _ref.truncate,
|
|
32
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
25
|
var classes = classNames('euiBreadcrumb', className);
|
|
34
|
-
var
|
|
35
|
-
var styles = euiBreadcrumbStyles(euiTheme);
|
|
26
|
+
var styles = useEuiMemoizedStyles(euiBreadcrumbStyles);
|
|
36
27
|
var cssStyles = [styles.euiBreadcrumb, styles[type], truncate && styles.isTruncated];
|
|
37
28
|
return ___EmotionJSX("li", _extends({
|
|
38
29
|
className: classes,
|
|
@@ -40,101 +31,11 @@ export var EuiBreadcrumb = function EuiBreadcrumb(_ref) {
|
|
|
40
31
|
"data-test-subj": "euiBreadcrumb"
|
|
41
32
|
}, rest), children);
|
|
42
33
|
};
|
|
43
|
-
export var
|
|
44
|
-
var
|
|
45
|
-
truncate = _ref2.truncate,
|
|
46
|
-
type = _ref2.type,
|
|
47
|
-
href = _ref2.href,
|
|
48
|
-
rel = _ref2.rel,
|
|
49
|
-
onClick = _ref2.onClick,
|
|
50
|
-
popoverContent = _ref2.popoverContent,
|
|
51
|
-
popoverProps = _ref2.popoverProps,
|
|
52
|
-
className = _ref2.className,
|
|
53
|
-
color = _ref2.color,
|
|
34
|
+
export var EuiBreadcrumbCollapsed = function EuiBreadcrumbCollapsed(_ref2) {
|
|
35
|
+
var children = _ref2.children,
|
|
54
36
|
isFirstBreadcrumb = _ref2.isFirstBreadcrumb,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
highlightLastBreadcrumb = _ref2.highlightLastBreadcrumb,
|
|
58
|
-
truncateLastBreadcrumb = _ref2.truncateLastBreadcrumb,
|
|
59
|
-
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
60
|
-
var classes = classNames('euiBreadcrumb__content', className);
|
|
61
|
-
var euiTheme = useEuiTheme();
|
|
62
|
-
var styles = euiBreadcrumbContentStyles(euiTheme);
|
|
63
|
-
var cssStyles = [styles.euiBreadcrumb__content, styles[type], truncate && !truncateLastBreadcrumb && styles.isTruncated, truncateLastBreadcrumb && styles.isTruncatedLast];
|
|
64
|
-
if (type === 'application') {
|
|
65
|
-
if (isOnlyBreadcrumb) {
|
|
66
|
-
cssStyles.push(styles.applicationStyles.onlyChild);
|
|
67
|
-
} else if (isFirstBreadcrumb) {
|
|
68
|
-
cssStyles.push(styles.applicationStyles.firstChild);
|
|
69
|
-
} else if (isLastBreadcrumb) {
|
|
70
|
-
cssStyles.push(styles.applicationStyles.lastChild);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
var isInteractiveBreadcrumb = href || onClick;
|
|
74
|
-
var linkColor = color || (highlightLastBreadcrumb ? 'text' : 'subdued');
|
|
75
|
-
var plainTextColor = highlightLastBreadcrumb ? 'default' : 'subdued'; // Does not inherit `color` prop
|
|
76
|
-
var ariaCurrent = highlightLastBreadcrumb ? 'page' : undefined;
|
|
77
|
-
var isPopoverBreadcrumb = !!popoverContent;
|
|
78
|
-
var _useState = useState(false),
|
|
79
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
80
|
-
isPopoverOpen = _useState2[0],
|
|
81
|
-
setIsPopoverOpen = _useState2[1];
|
|
82
|
-
var popoverAriaLabel = useEuiI18n('euiBreadcrumb.popoverAriaLabel', 'Clicking this button will toggle a popover dialog.');
|
|
83
|
-
return ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
|
|
84
|
-
var title = innerText === '' ? undefined : innerText;
|
|
85
|
-
var baseProps = {
|
|
86
|
-
ref: ref,
|
|
87
|
-
title: title,
|
|
88
|
-
'aria-current': ariaCurrent
|
|
89
|
-
};
|
|
90
|
-
var styleProps = {
|
|
91
|
-
className: classes,
|
|
92
|
-
css: cssStyles
|
|
93
|
-
};
|
|
94
|
-
if (isPopoverBreadcrumb) {
|
|
95
|
-
return ___EmotionJSX(EuiPopover, _extends({}, popoverProps, {
|
|
96
|
-
isOpen: isPopoverOpen,
|
|
97
|
-
closePopover: function closePopover() {
|
|
98
|
-
return setIsPopoverOpen(false);
|
|
99
|
-
},
|
|
100
|
-
css: !isLastBreadcrumb && styles.euiBreadcrumb__popoverWrapper,
|
|
101
|
-
button: ___EmotionJSX(EuiLink, _extends({}, baseProps, {
|
|
102
|
-
color: linkColor,
|
|
103
|
-
css: styles.euiBreadcrumb__popoverButton
|
|
104
|
-
// Avoid passing href and onClick - should only toggle the popover
|
|
105
|
-
,
|
|
106
|
-
onClick: function onClick() {
|
|
107
|
-
return setIsPopoverOpen(function (isOpen) {
|
|
108
|
-
return !isOpen;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}, rest), ___EmotionJSX("span", styleProps, text), ___EmotionJSX(EuiIcon, {
|
|
112
|
-
type: "arrowDown",
|
|
113
|
-
size: "s",
|
|
114
|
-
"aria-label": " - ".concat(popoverAriaLabel)
|
|
115
|
-
}))
|
|
116
|
-
}), popoverContent);
|
|
117
|
-
} else if (isInteractiveBreadcrumb) {
|
|
118
|
-
return ___EmotionJSX(EuiLink, _extends({}, baseProps, styleProps, {
|
|
119
|
-
color: linkColor,
|
|
120
|
-
onClick: onClick,
|
|
121
|
-
href: href,
|
|
122
|
-
rel: rel
|
|
123
|
-
}, rest), text);
|
|
124
|
-
} else {
|
|
125
|
-
return ___EmotionJSX(EuiTextColor, {
|
|
126
|
-
color: plainTextColor,
|
|
127
|
-
cloneElement: true
|
|
128
|
-
}, ___EmotionJSX("span", _extends({}, baseProps, styleProps, rest), text));
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
export var EuiBreadcrumbCollapsed = function EuiBreadcrumbCollapsed(_ref3) {
|
|
133
|
-
var children = _ref3.children,
|
|
134
|
-
isFirstBreadcrumb = _ref3.isFirstBreadcrumb,
|
|
135
|
-
type = _ref3.type;
|
|
136
|
-
var euiTheme = useEuiTheme();
|
|
137
|
-
var styles = euiBreadcrumbStyles(euiTheme);
|
|
37
|
+
type = _ref2.type;
|
|
38
|
+
var styles = useEuiMemoizedStyles(euiBreadcrumbStyles);
|
|
138
39
|
var cssStyles = [styles.isCollapsed];
|
|
139
40
|
var ariaLabel = useEuiI18n('euiBreadcrumb.collapsedBadge.ariaLabel', 'See collapsed breadcrumbs');
|
|
140
41
|
return ___EmotionJSX(EuiBreadcrumb, {
|
|
@@ -8,8 +8,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import {
|
|
12
|
-
|
|
11
|
+
import { logicalCSS } from '../../global_styling';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Styles cast to <li> element
|
|
15
|
+
*/
|
|
13
16
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
17
|
name: "1k7t4ns-isCollapsed",
|
|
15
18
|
styles: "flex-shrink:0;label:isCollapsed;"
|
|
@@ -27,7 +30,6 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
27
30
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
28
31
|
};
|
|
29
32
|
export var euiBreadcrumbStyles = function euiBreadcrumbStyles(euiThemeContext) {
|
|
30
|
-
// Styles cast to <li> element
|
|
31
33
|
var euiTheme = euiThemeContext.euiTheme;
|
|
32
34
|
return {
|
|
33
35
|
euiBreadcrumb: /*#__PURE__*/css("align-items:center;display:flex;", logicalCSS(
|
|
@@ -39,28 +41,4 @@ export var euiBreadcrumbStyles = function euiBreadcrumbStyles(euiThemeContext) {
|
|
|
39
41
|
page: /*#__PURE__*/css("&:not(:last-of-type){&::after{background:", euiTheme.colors.lightShade, ";content:'';flex-shrink:0;", logicalCSS('margin-top', euiTheme.size.xs), " ", logicalCSS('margin-bottom', 0), " ", logicalCSS('margin-horizontal', euiTheme.size.s), " ", logicalCSS('height', euiTheme.size.base), " ", logicalCSS('width', '1px'), " transform:translateY(-1px) rotate(15deg);}};label:page;"),
|
|
40
42
|
application: /*#__PURE__*/css("&:not(:last-of-type){", logicalCSS('margin-right', "-".concat(euiTheme.size.xs)), ";};label:application;")
|
|
41
43
|
};
|
|
42
|
-
};
|
|
43
|
-
export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiThemeContext) {
|
|
44
|
-
// Styles cast to <a>, <span>, or collapsed <button> elements
|
|
45
|
-
var euiTheme = euiThemeContext.euiTheme;
|
|
46
|
-
return {
|
|
47
|
-
euiBreadcrumb__content: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
|
|
48
|
-
isTruncated: /*#__PURE__*/css(euiTextTruncate(mathWithUnits(euiTheme.size.base, function (x) {
|
|
49
|
-
return x * 10;
|
|
50
|
-
})), ";;label:isTruncated;"),
|
|
51
|
-
isTruncatedLast: /*#__PURE__*/css(euiTextTruncate('none'), ";;label:isTruncatedLast;"),
|
|
52
|
-
// Popover styles
|
|
53
|
-
euiBreadcrumb__popoverButton: /*#__PURE__*/css("max-inline-size:100%;display:inline-flex;align-items:center;gap:", euiTheme.size.xs, ";;label:euiBreadcrumb__popoverButton;"),
|
|
54
|
-
euiBreadcrumb__popoverWrapper: /*#__PURE__*/css("max-inline-size:calc(\n 100% - ", mathWithUnits(euiTheme.size.base, function (x) {
|
|
55
|
-
return x + 1;
|
|
56
|
-
}), "\n );;label:euiBreadcrumb__popoverWrapper;"),
|
|
57
|
-
// Types
|
|
58
|
-
page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiThemeContext, 'center'), ";};label:page;"),
|
|
59
|
-
application: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), " background-color:", transparentize(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", logicalCSS('padding-vertical', euiTheme.size.xs), " ", logicalCSS('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", transparentize(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", euiFocusRing(euiThemeContext, 'inset'), " :focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
|
|
60
|
-
applicationStyles: {
|
|
61
|
-
onlyChild: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";clip-path:none;", logicalCSS('padding-horizontal', euiTheme.size.m), ";;label:onlyChild;"),
|
|
62
|
-
firstChild: /*#__PURE__*/css(logicalBorderRadiusCSS("".concat(euiTheme.border.radius.medium, " 0 0 ").concat(euiTheme.border.radius.medium), true), " clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%\n );", logicalCSS('padding-left', euiTheme.size.m), ";;label:firstChild;"),
|
|
63
|
-
lastChild: /*#__PURE__*/css(logicalBorderRadiusCSS("0 ".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium, " 0"), true), " clip-path:polygon(\n 0 0,\n 100% 0,\n 100% 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );", logicalCSS('padding-right', euiTheme.size.m), ";;label:lastChild;")
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
44
|
};
|
|
@@ -13,8 +13,9 @@ var _excluded = ["breadcrumbs", "className", "responsive", "truncate", "max", "t
|
|
|
13
13
|
import React, { useMemo } from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import { useEuiI18n } from '../i18n';
|
|
16
|
-
import {
|
|
17
|
-
import { EuiBreadcrumb,
|
|
16
|
+
import { useEuiMemoizedStyles, useCurrentEuiBreakpoint } from '../../services';
|
|
17
|
+
import { EuiBreadcrumb, EuiBreadcrumbCollapsed } from './breadcrumb';
|
|
18
|
+
import { EuiBreadcrumbContent } from './_breadcrumb_content';
|
|
18
19
|
import { euiBreadcrumbsListStyles } from './breadcrumbs.styles';
|
|
19
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
21
|
var responsiveDefault = {
|
|
@@ -37,8 +38,7 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
37
38
|
lastBreadcrumbIsCurrentPage = _ref$lastBreadcrumbIs === void 0 ? true : _ref$lastBreadcrumbIs,
|
|
38
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
39
40
|
var ariaLabel = useEuiI18n('euiBreadcrumbs.nav.ariaLabel', 'Breadcrumbs');
|
|
40
|
-
var
|
|
41
|
-
var breadcrumbsListStyles = euiBreadcrumbsListStyles(euiTheme);
|
|
41
|
+
var breadcrumbsListStyles = useEuiMemoizedStyles(euiBreadcrumbsListStyles);
|
|
42
42
|
var cssBreadcrumbsListStyles = [breadcrumbsListStyles.euiBreadcrumbs__list, truncate && breadcrumbsListStyles.isTruncated];
|
|
43
43
|
var responsiveMax = useResponsiveMax(responsive, max);
|
|
44
44
|
var visibleBreadcrumbs = useMemo(function () {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,7 +16,7 @@ import React, { forwardRef } from 'react';
|
|
|
16
16
|
|
|
17
17
|
// @ts-ignore module doesn't export `createElement`
|
|
18
18
|
import { createElement } from '@emotion/react';
|
|
19
|
-
import { getSecureRelForTarget,
|
|
19
|
+
import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../../services';
|
|
20
20
|
import { euiButtonDisplayStyles } from './_button_display.styles';
|
|
21
21
|
import { EuiButtonDisplayContent } from './_button_display_content';
|
|
22
22
|
import { validateHref } from '../../../services/security/href_validator';
|
|
@@ -70,8 +70,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
70
70
|
isDisabled: isDisabled || disabled,
|
|
71
71
|
isLoading: isLoading
|
|
72
72
|
});
|
|
73
|
-
var
|
|
74
|
-
var styles = euiButtonDisplayStyles(theme);
|
|
73
|
+
var styles = useEuiMemoizedStyles(euiButtonDisplayStyles);
|
|
75
74
|
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && styles.defaultMinWidth, buttonIsDisabled && styles.isDisabled];
|
|
76
75
|
var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
|
|
77
76
|
isLoading: isLoading,
|
|
@@ -14,7 +14,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import classNames from 'classnames';
|
|
17
|
-
import {
|
|
17
|
+
import { useEuiMemoizedStyles, getSecureRelForTarget } from '../../../services';
|
|
18
18
|
import { EuiButtonDisplayContent } from '../button_display/_button_display_content';
|
|
19
19
|
import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/mixins/button';
|
|
20
20
|
import { isButtonDisabled } from '../button_display/_button_display';
|
|
@@ -62,8 +62,7 @@ export var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
62
62
|
var buttonColorStyles = useEuiButtonColorCSS({
|
|
63
63
|
display: 'empty'
|
|
64
64
|
});
|
|
65
|
-
var
|
|
66
|
-
var styles = euiButtonEmptyStyles(euiTheme);
|
|
65
|
+
var styles = useEuiMemoizedStyles(euiButtonEmptyStyles);
|
|
67
66
|
var cssStyles = [styles.euiButtonEmpty, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], flush && styles.flush, flush && styles[flush], isDisabled && styles.isDisabled];
|
|
68
67
|
var classes = classNames('euiButtonEmpty', className);
|
|
69
68
|
var contentClassNames = classNames('euiButtonEmpty__content', contentProps === null || contentProps === void 0 ? void 0 : contentProps.className);
|
|
@@ -11,7 +11,7 @@ var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelected
|
|
|
11
11
|
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { useEuiMemoizedStyles } from '../../../services';
|
|
15
15
|
import { EuiScreenReaderOnly } from '../../accessibility';
|
|
16
16
|
import { EuiButtonGroupButton } from './button_group_button';
|
|
17
17
|
import { euiButtonGroupStyles, euiButtonGroupButtonsStyles } from './button_group.styles';
|
|
@@ -40,10 +40,8 @@ export var EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
40
40
|
_ref$type = _ref.type,
|
|
41
41
|
type = _ref$type === void 0 ? 'single' : _ref$type,
|
|
42
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
var
|
|
44
|
-
var
|
|
45
|
-
var wrapperCssStyles = [wrapperStyles.euiButtonGroup, isFullWidth && wrapperStyles.fullWidth];
|
|
46
|
-
var styles = euiButtonGroupButtonsStyles(euiTheme);
|
|
43
|
+
var wrapperCssStyles = [euiButtonGroupStyles.euiButtonGroup, isFullWidth && euiButtonGroupStyles.fullWidth];
|
|
44
|
+
var styles = useEuiMemoizedStyles(euiButtonGroupButtonsStyles);
|
|
47
45
|
var cssStyles = [styles.euiButtonGroup__buttons, isFullWidth && styles.fullWidth, styles[buttonSize]];
|
|
48
46
|
var classes = classNames('euiButtonGroup', {
|
|
49
47
|
'euiButtonGroup-isDisabled': isDisabled
|
|
@@ -57,9 +55,9 @@ export var EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
57
55
|
}), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("legend", null, legend)), ___EmotionJSX("div", {
|
|
58
56
|
css: cssStyles,
|
|
59
57
|
className: "euiButtonGroup__buttons"
|
|
60
|
-
}, options.map(function (option
|
|
58
|
+
}, options.map(function (option) {
|
|
61
59
|
return ___EmotionJSX(EuiButtonGroupButton, _extends({
|
|
62
|
-
key:
|
|
60
|
+
key: option.id,
|
|
63
61
|
isDisabled: isDisabled
|
|
64
62
|
}, option, {
|
|
65
63
|
onClick: typeIsSingle ? function () {
|
|
@@ -10,19 +10,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { logicalCSS } from '../../../global_styling';
|
|
12
12
|
import { euiFormVariables } from '../../form/form.styles';
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
euiButtonGroup: /*#__PURE__*/css("display:inline-block;", logicalCSS('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
|
|
24
|
-
fullWidth: _ref
|
|
25
|
-
};
|
|
13
|
+
export var euiButtonGroupStyles = {
|
|
14
|
+
euiButtonGroup: /*#__PURE__*/css("display:inline-block;", logicalCSS('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
|
|
15
|
+
fullWidth: process.env.NODE_ENV === "production" ? {
|
|
16
|
+
name: "jl0hie-fullWidth",
|
|
17
|
+
styles: "display:block;label:fullWidth;"
|
|
18
|
+
} : {
|
|
19
|
+
name: "jl0hie-fullWidth",
|
|
20
|
+
styles: "display:block;label:fullWidth;",
|
|
21
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
22
|
+
}
|
|
26
23
|
};
|
|
27
24
|
export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(euiThemeContext) {
|
|
28
25
|
var euiTheme = euiThemeContext.euiTheme;
|
|
@@ -34,7 +31,7 @@ export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(eu
|
|
|
34
31
|
return {
|
|
35
32
|
// Base
|
|
36
33
|
euiButtonGroup__buttons: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " display:flex;;label:euiButtonGroup__buttons;"),
|
|
37
|
-
fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), " .euiButtonGroupButton{flex:1;};label:fullWidth;"),
|
|
34
|
+
fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), " .euiButtonGroupButton,.euiButtonGroup__tooltipWrapper{flex:1;", logicalCSS('width', '100%'), ";};label:fullWidth;"),
|
|
38
35
|
// Sizes
|
|
39
36
|
m: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";;label:m;"),
|
|
40
37
|
s: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.small, ";;label:s;"),
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color"];
|
|
5
|
+
var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps"];
|
|
6
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
8
|
/*
|
|
6
9
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
10
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -17,6 +20,7 @@ import { useEuiButtonColorCSS } from '../../../themes/amsterdam/global_styling/m
|
|
|
17
20
|
import { useInnerText } from '../../inner_text';
|
|
18
21
|
import { EuiButtonDisplay } from '../button_display/_button_display';
|
|
19
22
|
import { euiButtonGroupButtonStyles, _compressedButtonFocusColor, _uncompressedButtonFocus } from './button_group_button.styles';
|
|
23
|
+
import { EuiToolTip } from '../../../components/tool_tip';
|
|
20
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
25
|
export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
22
26
|
var className = _ref.className,
|
|
@@ -30,17 +34,21 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
30
34
|
size = _ref.size,
|
|
31
35
|
_ref$color = _ref.color,
|
|
32
36
|
_color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
37
|
+
toolTipContent = _ref.toolTipContent,
|
|
38
|
+
toolTipProps = _ref.toolTipProps,
|
|
33
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
34
40
|
var isCompressed = size === 'compressed';
|
|
35
41
|
var color = isDisabled ? 'disabled' : _color;
|
|
36
42
|
var display = isSelected ? 'fill' : isCompressed ? 'empty' : 'base';
|
|
43
|
+
var hasToolTip = !!toolTipContent;
|
|
37
44
|
var euiTheme = useEuiTheme();
|
|
38
45
|
var buttonColorStyles = useEuiButtonColorCSS({
|
|
39
46
|
display: display
|
|
40
47
|
})[color];
|
|
41
48
|
var focusColorStyles = isCompressed ? _compressedButtonFocusColor(euiTheme, color) : _uncompressedButtonFocus(euiTheme);
|
|
42
49
|
var styles = euiButtonGroupButtonStyles(euiTheme);
|
|
43
|
-
var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, styles[size],
|
|
50
|
+
var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, !isCompressed && (hasToolTip ? styles.uncompressed.hasToolTip : styles.uncompressed[size]), isCompressed ? styles.compressed : styles.uncompressed.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && focusColorStyles];
|
|
51
|
+
var tooltipWrapperStyles = [styles.tooltipWrapper, !isCompressed && styles.uncompressed[size]];
|
|
44
52
|
var contentStyles = [styles.content.euiButtonGroupButton__content, isCompressed && styles.content.compressed];
|
|
45
53
|
var textStyles = [isIconOnly ? styles.text.euiButtonGroupButton__iconOnly : styles.text.euiButtonGroupButton__text];
|
|
46
54
|
var buttonClasses = classNames('euiButtonGroupButton', {
|
|
@@ -57,7 +65,12 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
57
65
|
_useInnerText2 = _slicedToArray(_useInnerText, 2),
|
|
58
66
|
buttonTextRef = _useInnerText2[0],
|
|
59
67
|
innerText = _useInnerText2[1];
|
|
60
|
-
return ___EmotionJSX(
|
|
68
|
+
return ___EmotionJSX(EuiButtonGroupButtonWithToolTip, {
|
|
69
|
+
toolTipContent: toolTipContent,
|
|
70
|
+
toolTipProps: toolTipProps,
|
|
71
|
+
wrapperCss: tooltipWrapperStyles,
|
|
72
|
+
isSelected: isSelected
|
|
73
|
+
}, ___EmotionJSX(EuiButtonDisplay, _extends({
|
|
61
74
|
css: cssStyles,
|
|
62
75
|
className: buttonClasses,
|
|
63
76
|
isDisabled: isDisabled,
|
|
@@ -73,5 +86,24 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
|
|
|
73
86
|
title: innerText,
|
|
74
87
|
"data-test-subj": id,
|
|
75
88
|
isSelected: isSelected
|
|
76
|
-
}, rest), label);
|
|
89
|
+
}, rest), label));
|
|
90
|
+
};
|
|
91
|
+
var EuiButtonGroupButtonWithToolTip = function EuiButtonGroupButtonWithToolTip(_ref2) {
|
|
92
|
+
var _toolTipProps$anchorP, _toolTipProps$anchorP2;
|
|
93
|
+
var toolTipContent = _ref2.toolTipContent,
|
|
94
|
+
toolTipProps = _ref2.toolTipProps,
|
|
95
|
+
wrapperCss = _ref2.wrapperCss,
|
|
96
|
+
isSelected = _ref2.isSelected,
|
|
97
|
+
children = _ref2.children;
|
|
98
|
+
return toolTipContent ? ___EmotionJSX(EuiToolTip, _extends({
|
|
99
|
+
content: toolTipContent,
|
|
100
|
+
position: "top"
|
|
101
|
+
}, toolTipProps, {
|
|
102
|
+
anchorProps: _objectSpread(_objectSpread({}, toolTipProps === null || toolTipProps === void 0 ? void 0 : toolTipProps.anchorProps), {}, {
|
|
103
|
+
className: classNames('euiButtonGroup__tooltipWrapper', {
|
|
104
|
+
'euiButtonGroup__tooltipWrapper-isSelected': isSelected
|
|
105
|
+
}, toolTipProps === null || toolTipProps === void 0 ? void 0 : (_toolTipProps$anchorP = toolTipProps.anchorProps) === null || _toolTipProps$anchorP === void 0 ? void 0 : _toolTipProps$anchorP.className),
|
|
106
|
+
css: [wrapperCss, toolTipProps === null || toolTipProps === void 0 ? void 0 : (_toolTipProps$anchorP2 = toolTipProps.anchorProps) === null || _toolTipProps$anchorP2 === void 0 ? void 0 : _toolTipProps$anchorP2.css]
|
|
107
|
+
})
|
|
108
|
+
}), children) : children;
|
|
77
109
|
};
|