@elastic/eui 109.0.0 → 109.1.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/es/components/accessibility/skip_link/skip_link.js +10 -1
- package/es/components/bottom_bar/bottom_bar.js +12 -2
- package/es/components/button/button.js +20 -25
- package/es/components/button/button_display/_button_display.js +32 -30
- package/es/components/button/button_display/_button_display.styles.js +4 -4
- package/es/components/button/button_empty/button_empty.js +32 -14
- package/es/components/button/button_group/button_group.js +49 -31
- package/es/components/button/button_group/button_group_button.js +14 -2
- package/es/components/button/button_group/button_group_button.styles.js +12 -8
- package/es/components/button/button_icon/button_icon.js +30 -6
- package/es/components/card/card.js +20 -25
- package/es/components/card/card_select/card_select.js +20 -25
- package/es/components/code/code_block_virtualized.js +9 -7
- package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +13 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +35 -12
- package/es/components/datagrid/body/data_grid_body.js +23 -6
- package/es/components/datagrid/body/data_grid_body_custom.js +23 -6
- package/es/components/datagrid/body/data_grid_body_virtualized.js +23 -6
- package/es/components/datagrid/body/header/data_grid_header_cell.js +23 -6
- package/es/components/datagrid/controls/column_selector.js +36 -19
- package/es/components/datagrid/controls/column_sorting.js +23 -6
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +13 -7
- package/es/components/datagrid/data_grid.js +5 -1
- package/es/components/datagrid/utils/in_memory.js +25 -7
- package/es/components/date_picker/auto_refresh/auto_refresh.js +11 -2
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +31 -5
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +24 -3
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +26 -4
- package/es/components/date_picker/super_date_picker/date_popover/relative_tab.js +29 -3
- package/es/components/date_picker/super_date_picker/date_popover/timezone_display.js +98 -0
- package/es/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +19 -0
- package/es/components/date_picker/super_date_picker/pretty_duration.js +1 -8
- package/es/components/date_picker/super_date_picker/relative_utils.js +8 -0
- package/es/components/date_picker/super_date_picker/super_date_picker.js +118 -26
- package/es/components/date_picker/super_date_picker/time_window_buttons.js +185 -0
- package/es/components/facet/facet_button.js +9 -19
- package/es/components/filter_group/filter_button.js +14 -1
- package/es/components/flyout/flyout.js +27 -10
- package/es/components/form/form_control_button/form_control_button.js +13 -7
- package/es/components/header/header_links/header_link.js +13 -7
- package/es/components/header/header_section/header_section_item_button.js +13 -7
- package/es/components/icon/assets/boxes_vertical.js +1 -1
- package/es/components/icon/assets/checkInCircleFilled.js +1 -2
- package/es/components/icon/assets/errorFilled.js +1 -2
- package/es/components/icon/assets/warningFilled.js +1 -2
- package/es/components/icon/icon_map.js +3 -6
- package/es/components/list_group/list_group.js +13 -1
- package/es/components/list_group/list_group_item.js +13 -1
- package/es/components/list_group/list_group_item_extra_action.js +13 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +15 -2
- package/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/es/components/pagination/pagination_button.js +13 -7
- package/es/components/popover/popover.js +22 -16
- package/es/components/provider/component_defaults/component_defaults.js +22 -2
- package/es/components/table/table_row.styles.js +1 -1
- package/es/components/tool_tip/tool_tip.js +24 -24
- package/es/global_styling/index.js +2 -1
- package/es/global_styling/mixins/_button.js +1 -1
- package/es/global_styling/utility/selectors.js +9 -0
- package/es/services/focus_trap/focus_trap_pub_sub.js +74 -0
- package/es/services/focus_trap/index.js +9 -0
- package/es/services/hooks/index.js +2 -1
- package/es/services/hooks/useEuiDisabledElement.js +195 -0
- package/es/services/index.js +1 -0
- package/es/services/popover/reposition_on_scroll.js +61 -0
- package/es/test/cypress/index.d.ts +12 -0
- package/es/test/cypress/index.js +9 -0
- package/es/test/cypress/matchers.d.ts +20 -0
- package/es/test/cypress/matchers.js +54 -0
- package/es/test/cypress/test_reposition_on_scroll.js +66 -0
- package/es/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/es/test/enzyme/enzyme_matchers.js +43 -0
- package/es/test/enzyme/index.d.ts +14 -0
- package/es/test/enzyme/index.js +10 -0
- package/es/test/rtl/index.d.ts +9 -1
- package/es/test/rtl/index.js +2 -1
- package/es/test/rtl/matchers.d.ts +36 -0
- package/es/test/rtl/matchers.js +82 -0
- package/es/utils/element_can_be_disabled.js +16 -0
- package/es/utils/index.js +2 -1
- package/eui.d.ts +588 -180
- package/i18ntokens.json +1357 -1231
- package/lib/components/accessibility/skip_link/skip_link.js +10 -1
- package/lib/components/bottom_bar/bottom_bar.js +11 -1
- package/lib/components/button/button.js +21 -26
- package/lib/components/button/button_display/_button_display.js +31 -29
- package/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/lib/components/button/button_empty/button_empty.js +31 -13
- package/lib/components/button/button_group/button_group.js +49 -31
- package/lib/components/button/button_group/button_group_button.js +14 -2
- package/lib/components/button/button_group/button_group_button.styles.js +10 -6
- package/lib/components/button/button_icon/button_icon.js +29 -5
- package/lib/components/card/card.js +21 -26
- package/lib/components/card/card_select/card_select.js +21 -26
- package/lib/components/code/code_block_virtualized.js +9 -7
- package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +13 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +35 -12
- package/lib/components/datagrid/body/data_grid_body.js +23 -6
- package/lib/components/datagrid/body/data_grid_body_custom.js +23 -6
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +23 -6
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +23 -6
- package/lib/components/datagrid/controls/column_selector.js +36 -19
- package/lib/components/datagrid/controls/column_sorting.js +23 -6
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +13 -7
- package/lib/components/datagrid/data_grid.js +5 -1
- package/lib/components/datagrid/utils/in_memory.js +25 -7
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +12 -3
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +30 -4
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +24 -3
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +26 -4
- package/lib/components/date_picker/super_date_picker/date_popover/relative_tab.js +29 -3
- package/lib/components/date_picker/super_date_picker/date_popover/timezone_display.js +104 -0
- package/lib/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +25 -0
- package/lib/components/date_picker/super_date_picker/pretty_duration.js +2 -9
- package/lib/components/date_picker/super_date_picker/relative_utils.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +118 -26
- package/lib/components/date_picker/super_date_picker/time_window_buttons.js +193 -0
- package/lib/components/facet/facet_button.js +9 -19
- package/lib/components/filter_group/filter_button.js +14 -1
- package/lib/components/flyout/flyout.js +26 -9
- package/lib/components/form/form_control_button/form_control_button.js +13 -7
- package/lib/components/header/header_links/header_link.js +13 -7
- package/lib/components/header/header_section/header_section_item_button.js +13 -7
- package/lib/components/icon/assets/boxes_vertical.js +1 -1
- package/lib/components/icon/assets/checkInCircleFilled.js +1 -2
- package/lib/components/icon/assets/errorFilled.js +1 -2
- package/lib/components/icon/assets/warningFilled.js +1 -2
- package/lib/components/icon/icon_map.js +3 -6
- package/lib/components/icon/svgs/boxes_vertical.svg +1 -1
- package/lib/components/icon/svgs/checkInCircleFilled.svg +1 -1
- package/lib/components/icon/svgs/errorFilled.svg +1 -1
- package/lib/components/icon/svgs/warningFilled.svg +1 -1
- package/lib/components/list_group/list_group.js +13 -1
- package/lib/components/list_group/list_group_item.js +13 -1
- package/lib/components/list_group/list_group_item_extra_action.js +13 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +15 -2
- package/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/lib/components/pagination/pagination_button.js +13 -7
- package/lib/components/popover/popover.js +21 -15
- package/lib/components/provider/component_defaults/component_defaults.js +22 -2
- package/lib/components/table/table_row.styles.js +1 -1
- package/lib/components/tool_tip/tool_tip.js +24 -24
- package/lib/global_styling/index.js +16 -1
- package/lib/global_styling/mixins/_button.js +1 -1
- package/lib/global_styling/utility/selectors.js +15 -0
- package/lib/services/focus_trap/focus_trap_pub_sub.js +80 -0
- package/lib/services/focus_trap/index.js +12 -0
- package/lib/services/hooks/index.js +18 -1
- package/lib/services/hooks/useEuiDisabledElement.js +199 -0
- package/lib/services/index.js +8 -0
- package/lib/services/popover/reposition_on_scroll.js +67 -0
- package/lib/test/cypress/index.d.ts +12 -0
- package/lib/test/cypress/index.js +18 -0
- package/lib/test/cypress/matchers.d.ts +20 -0
- package/lib/test/cypress/matchers.js +61 -0
- package/lib/test/cypress/test_reposition_on_scroll.js +69 -0
- package/lib/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/lib/test/enzyme/enzyme_matchers.js +49 -0
- package/lib/test/enzyme/index.d.ts +14 -0
- package/lib/test/enzyme/index.js +24 -0
- package/lib/test/rtl/index.d.ts +9 -1
- package/lib/test/rtl/index.js +24 -2
- package/lib/test/rtl/matchers.d.ts +36 -0
- package/lib/test/rtl/matchers.js +86 -0
- package/lib/utils/element_can_be_disabled.js +22 -0
- package/lib/utils/index.js +14 -1
- package/optimize/es/components/bottom_bar/bottom_bar.js +12 -2
- package/optimize/es/components/button/button_display/_button_display.js +24 -12
- package/optimize/es/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/es/components/button/button_empty/button_empty.js +18 -6
- package/optimize/es/components/button/button_group/button_group.js +10 -5
- package/optimize/es/components/button/button_group/button_group_button.js +1 -1
- package/optimize/es/components/button/button_group/button_group_button.styles.js +12 -8
- package/optimize/es/components/button/button_icon/button_icon.js +17 -5
- package/optimize/es/components/code/code_block_virtualized.js +9 -7
- package/optimize/es/components/datagrid/controls/column_selector.js +36 -19
- package/optimize/es/components/datagrid/data_grid.js +5 -1
- package/optimize/es/components/datagrid/utils/in_memory.js +2 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +12 -4
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_content.js +7 -3
- package/optimize/es/components/date_picker/super_date_picker/date_popover/relative_tab.js +10 -2
- package/optimize/es/components/date_picker/super_date_picker/date_popover/timezone_display.js +97 -0
- package/optimize/es/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +19 -0
- package/optimize/es/components/date_picker/super_date_picker/pretty_duration.js +1 -8
- package/optimize/es/components/date_picker/super_date_picker/relative_utils.js +8 -0
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +49 -25
- package/optimize/es/components/date_picker/super_date_picker/time_window_buttons.js +185 -0
- package/optimize/es/components/flyout/flyout.js +27 -10
- package/optimize/es/components/icon/assets/boxes_vertical.js +1 -1
- package/optimize/es/components/icon/assets/checkInCircleFilled.js +1 -2
- package/optimize/es/components/icon/assets/errorFilled.js +1 -2
- package/optimize/es/components/icon/assets/warningFilled.js +1 -2
- package/optimize/es/components/icon/icon_map.js +3 -6
- package/optimize/es/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/es/components/popover/popover.js +22 -16
- package/optimize/es/components/table/table_row.styles.js +1 -1
- package/optimize/es/components/tool_tip/tool_tip.js +24 -24
- package/optimize/es/global_styling/index.js +2 -1
- package/optimize/es/global_styling/mixins/_button.js +1 -1
- package/optimize/es/global_styling/utility/selectors.js +9 -0
- package/optimize/es/services/focus_trap/focus_trap_pub_sub.js +74 -0
- package/optimize/es/services/focus_trap/index.js +9 -0
- package/optimize/es/services/hooks/index.js +2 -1
- package/optimize/es/services/hooks/useEuiDisabledElement.js +192 -0
- package/optimize/es/services/index.js +1 -0
- package/optimize/es/services/popover/reposition_on_scroll.js +61 -0
- package/optimize/es/test/cypress/index.d.ts +12 -0
- package/optimize/es/test/cypress/index.js +9 -0
- package/optimize/es/test/cypress/matchers.d.ts +20 -0
- package/optimize/es/test/cypress/matchers.js +54 -0
- package/optimize/es/test/cypress/test_reposition_on_scroll.js +63 -0
- package/optimize/es/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/optimize/es/test/enzyme/enzyme_matchers.js +43 -0
- package/optimize/es/test/enzyme/index.d.ts +14 -0
- package/optimize/es/test/enzyme/index.js +10 -0
- package/optimize/es/test/rtl/index.d.ts +9 -1
- package/optimize/es/test/rtl/index.js +2 -1
- package/optimize/es/test/rtl/matchers.d.ts +36 -0
- package/optimize/es/test/rtl/matchers.js +82 -0
- package/optimize/es/utils/element_can_be_disabled.js +16 -0
- package/optimize/es/utils/index.js +2 -1
- package/optimize/lib/components/bottom_bar/bottom_bar.js +11 -1
- package/optimize/lib/components/button/button_display/_button_display.js +23 -11
- package/optimize/lib/components/button/button_display/_button_display.styles.js +4 -4
- package/optimize/lib/components/button/button_empty/button_empty.js +17 -5
- package/optimize/lib/components/button/button_group/button_group.js +10 -5
- package/optimize/lib/components/button/button_group/button_group_button.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +10 -6
- package/optimize/lib/components/button/button_icon/button_icon.js +16 -4
- package/optimize/lib/components/code/code_block_virtualized.js +9 -7
- package/optimize/lib/components/datagrid/controls/column_selector.js +36 -19
- package/optimize/lib/components/datagrid/data_grid.js +5 -1
- package/optimize/lib/components/datagrid/utils/in_memory.js +2 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +11 -3
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/date_popover_content.js +7 -3
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/relative_tab.js +10 -2
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/timezone_display.js +103 -0
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +25 -0
- package/optimize/lib/components/date_picker/super_date_picker/pretty_duration.js +2 -9
- package/optimize/lib/components/date_picker/super_date_picker/relative_utils.js +9 -0
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +49 -25
- package/optimize/lib/components/date_picker/super_date_picker/time_window_buttons.js +193 -0
- package/optimize/lib/components/flyout/flyout.js +26 -9
- package/optimize/lib/components/icon/assets/boxes_vertical.js +1 -1
- package/optimize/lib/components/icon/assets/checkInCircleFilled.js +1 -2
- package/optimize/lib/components/icon/assets/errorFilled.js +1 -2
- package/optimize/lib/components/icon/assets/warningFilled.js +1 -2
- package/optimize/lib/components/icon/icon_map.js +3 -6
- package/optimize/lib/components/icon/svgs/boxes_vertical.svg +1 -1
- package/optimize/lib/components/icon/svgs/checkInCircleFilled.svg +1 -1
- package/optimize/lib/components/icon/svgs/errorFilled.svg +1 -1
- package/optimize/lib/components/icon/svgs/warningFilled.svg +1 -1
- package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/optimize/lib/components/popover/popover.js +21 -15
- package/optimize/lib/components/table/table_row.styles.js +1 -1
- package/optimize/lib/components/tool_tip/tool_tip.js +24 -24
- package/optimize/lib/global_styling/index.js +16 -1
- package/optimize/lib/global_styling/mixins/_button.js +1 -1
- package/optimize/lib/global_styling/utility/selectors.js +15 -0
- package/optimize/lib/services/focus_trap/focus_trap_pub_sub.js +80 -0
- package/optimize/lib/services/focus_trap/index.js +12 -0
- package/optimize/lib/services/hooks/index.js +18 -1
- package/optimize/lib/services/hooks/useEuiDisabledElement.js +197 -0
- package/optimize/lib/services/index.js +8 -0
- package/optimize/lib/services/popover/reposition_on_scroll.js +67 -0
- package/optimize/lib/test/cypress/index.d.ts +12 -0
- package/optimize/lib/test/cypress/index.js +18 -0
- package/optimize/lib/test/cypress/matchers.d.ts +20 -0
- package/optimize/lib/test/cypress/matchers.js +61 -0
- package/optimize/lib/test/cypress/test_reposition_on_scroll.js +70 -0
- package/optimize/lib/test/enzyme/enzyme_matchers.d.ts +36 -0
- package/optimize/lib/test/enzyme/enzyme_matchers.js +50 -0
- package/optimize/lib/test/enzyme/index.d.ts +14 -0
- package/optimize/lib/test/enzyme/index.js +24 -0
- package/optimize/lib/test/rtl/index.d.ts +9 -1
- package/optimize/lib/test/rtl/index.js +24 -2
- package/optimize/lib/test/rtl/matchers.d.ts +36 -0
- package/optimize/lib/test/rtl/matchers.js +86 -0
- package/optimize/lib/utils/element_can_be_disabled.js +22 -0
- package/optimize/lib/utils/index.js +14 -1
- package/package.json +1 -1
- package/test-env/components/accessibility/skip_link/skip_link.js +10 -1
- package/test-env/components/bottom_bar/bottom_bar.js +11 -1
- package/test-env/components/button/button.js +21 -26
- package/test-env/components/button/button_display/_button_display.js +31 -29
- package/test-env/components/button/button_display/_button_display.styles.js +4 -4
- package/test-env/components/button/button_empty/button_empty.js +31 -13
- package/test-env/components/button/button_group/button_group.js +49 -31
- package/test-env/components/button/button_group/button_group_button.js +14 -2
- package/test-env/components/button/button_group/button_group_button.styles.js +10 -6
- package/test-env/components/button/button_icon/button_icon.js +29 -5
- package/test-env/components/card/card.js +21 -26
- package/test-env/components/card/card_select/card_select.js +21 -26
- package/test-env/components/code/code_block_virtualized.js +9 -7
- package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +13 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +35 -12
- package/test-env/components/datagrid/body/data_grid_body.js +23 -6
- package/test-env/components/datagrid/body/data_grid_body_custom.js +23 -6
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +23 -6
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +23 -6
- package/test-env/components/datagrid/controls/column_selector.js +36 -19
- package/test-env/components/datagrid/controls/column_sorting.js +23 -6
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +13 -7
- package/test-env/components/datagrid/data_grid.js +5 -1
- package/test-env/components/datagrid/utils/in_memory.js +25 -7
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +12 -3
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +30 -4
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +24 -3
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_content.js +26 -4
- package/test-env/components/date_picker/super_date_picker/date_popover/relative_tab.js +29 -3
- package/test-env/components/date_picker/super_date_picker/date_popover/timezone_display.js +103 -0
- package/test-env/components/date_picker/super_date_picker/date_popover/timezone_display.styles.js +25 -0
- package/test-env/components/date_picker/super_date_picker/pretty_duration.js +2 -9
- package/test-env/components/date_picker/super_date_picker/relative_utils.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +118 -26
- package/test-env/components/date_picker/super_date_picker/time_window_buttons.js +193 -0
- package/test-env/components/facet/facet_button.js +9 -19
- package/test-env/components/filter_group/filter_button.js +14 -1
- package/test-env/components/form/form_control_button/form_control_button.js +13 -7
- package/test-env/components/header/header_links/header_link.js +13 -7
- package/test-env/components/header/header_section/header_section_item_button.js +13 -7
- package/test-env/components/icon/assets/boxes_vertical.js +1 -1
- package/test-env/components/icon/assets/checkInCircleFilled.js +1 -2
- package/test-env/components/icon/assets/errorFilled.js +1 -2
- package/test-env/components/icon/assets/warningFilled.js +1 -2
- package/test-env/components/icon/icon_map.js +3 -6
- package/test-env/components/list_group/list_group.js +13 -1
- package/test-env/components/list_group/list_group_item.js +13 -1
- package/test-env/components/list_group/list_group_item_extra_action.js +13 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +15 -2
- package/test-env/components/overlay_mask/overlay_mask.styles.js +1 -1
- package/test-env/components/pagination/pagination_button.js +13 -7
- package/test-env/components/popover/popover.js +21 -15
- package/test-env/components/provider/component_defaults/component_defaults.js +22 -2
- package/test-env/components/table/table_row.styles.js +1 -1
- package/test-env/components/tool_tip/tool_tip.js +24 -24
- package/test-env/global_styling/index.js +16 -1
- package/test-env/global_styling/mixins/_button.js +1 -1
- package/test-env/global_styling/utility/selectors.js +15 -0
- package/test-env/services/focus_trap/focus_trap_pub_sub.js +80 -0
- package/test-env/services/focus_trap/index.js +12 -0
- package/test-env/services/hooks/index.js +18 -1
- package/test-env/services/hooks/useEuiDisabledElement.js +197 -0
- package/test-env/services/index.js +8 -0
- package/test-env/services/popover/reposition_on_scroll.js +67 -0
- package/test-env/test/cypress/index.js +18 -0
- package/test-env/test/cypress/matchers.js +61 -0
- package/test-env/test/cypress/test_reposition_on_scroll.js +70 -0
- package/test-env/test/enzyme/enzyme_matchers.js +50 -0
- package/test-env/test/enzyme/index.js +24 -0
- package/test-env/test/rtl/index.js +24 -2
- package/test-env/test/rtl/matchers.js +86 -0
- package/test-env/utils/element_can_be_disabled.js +22 -0
- package/test-env/utils/index.js +14 -1
|
@@ -152,9 +152,18 @@ EuiSkipLink.propTypes = {
|
|
|
152
152
|
*/
|
|
153
153
|
size: _propTypes.default.any,
|
|
154
154
|
/**
|
|
155
|
-
* `disabled`
|
|
155
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
156
156
|
*/
|
|
157
157
|
isDisabled: _propTypes.default.bool,
|
|
158
|
+
/**
|
|
159
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
160
|
+
*
|
|
161
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
162
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
163
|
+
*
|
|
164
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
165
|
+
*/
|
|
166
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
158
167
|
className: _propTypes.default.string,
|
|
159
168
|
"aria-label": _propTypes.default.string,
|
|
160
169
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -65,6 +65,8 @@ var _EuiBottomBar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
65
65
|
style = _ref.style,
|
|
66
66
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
67
67
|
var styles = (0, _services.useEuiMemoizedStyles)(_bottom_bar.euiBottomBarStyles);
|
|
68
|
+
var _useEuiThemeCSSVariab = (0, _services.useEuiThemeCSSVariables)(),
|
|
69
|
+
setGlobalCSSVariables = _useEuiThemeCSSVariab.setGlobalCSSVariables;
|
|
68
70
|
|
|
69
71
|
// Force some props if `fixed` position, but not if the user has supplied these
|
|
70
72
|
affordForDisplacement = position !== 'fixed' ? false : affordForDisplacement;
|
|
@@ -79,6 +81,11 @@ var _EuiBottomBar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
79
81
|
(0, _react.useEffect)(function () {
|
|
80
82
|
if (affordForDisplacement && usePortal) {
|
|
81
83
|
document.body.style.paddingBottom = "".concat(dimensions.height, "px");
|
|
84
|
+
|
|
85
|
+
// EUI doesn't use this css variable, but it is useful for consumers
|
|
86
|
+
setGlobalCSSVariables({
|
|
87
|
+
'--euiBottomBarOffset': "".concat(dimensions.height, "px")
|
|
88
|
+
});
|
|
82
89
|
}
|
|
83
90
|
if (bodyClassName) {
|
|
84
91
|
document.body.classList.add(bodyClassName);
|
|
@@ -86,12 +93,15 @@ var _EuiBottomBar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
86
93
|
return function () {
|
|
87
94
|
if (affordForDisplacement && usePortal) {
|
|
88
95
|
document.body.style.paddingBottom = '';
|
|
96
|
+
setGlobalCSSVariables({
|
|
97
|
+
'--euiBottomBarOffset': null
|
|
98
|
+
});
|
|
89
99
|
}
|
|
90
100
|
if (bodyClassName) {
|
|
91
101
|
document.body.classList.remove(bodyClassName);
|
|
92
102
|
}
|
|
93
103
|
};
|
|
94
|
-
}, [affordForDisplacement, usePortal, dimensions, bodyClassName]);
|
|
104
|
+
}, [affordForDisplacement, usePortal, dimensions, bodyClassName, setGlobalCSSVariables]);
|
|
95
105
|
var classes = (0, _classnames.default)('euiBottomBar', "euiBottomBar--".concat(position), className);
|
|
96
106
|
var cssStyles = [styles.euiBottomBar, styles[position], styles[paddingSize]];
|
|
97
107
|
var newStyle = _objectSpread({
|
|
@@ -88,12 +88,29 @@ EuiButton.propTypes = {
|
|
|
88
88
|
*/
|
|
89
89
|
size: _propTypes.default.any,
|
|
90
90
|
/**
|
|
91
|
-
* `disabled`
|
|
91
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
92
92
|
*/
|
|
93
93
|
/**
|
|
94
|
-
* `disabled`
|
|
94
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
95
95
|
*/
|
|
96
|
-
isDisabled: _propTypes.default.bool,
|
|
96
|
+
isDisabled: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.bool])]),
|
|
97
|
+
/**
|
|
98
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
99
|
+
*
|
|
100
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
101
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
102
|
+
*
|
|
103
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
104
|
+
*/
|
|
105
|
+
/**
|
|
106
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
107
|
+
*
|
|
108
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
109
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
110
|
+
*
|
|
111
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
112
|
+
*/
|
|
113
|
+
hasAriaDisabled: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.bool])]),
|
|
97
114
|
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string])]),
|
|
98
115
|
"aria-label": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string])]),
|
|
99
116
|
"data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string])]),
|
|
@@ -127,27 +144,5 @@ EuiButton.propTypes = {
|
|
|
127
144
|
css: _propTypes.default.any
|
|
128
145
|
}),
|
|
129
146
|
style: _propTypes.default.any,
|
|
130
|
-
type: _propTypes.default.any
|
|
131
|
-
/**
|
|
132
|
-
* Any `type` accepted by EuiIcon
|
|
133
|
-
*/
|
|
134
|
-
iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "alert", "analyzeEvent", "annotation", "anomalyChart", "anomalySwimLane", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "backgroundTask", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "check", "checkCircle", "checkInCircleFilled", "cheer", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "comment", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "diff", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "errorFilled", "esqlVis", "exit", "expand", "expandMini", "export", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "minusInSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusInCircle", "plusInCircleFilled", "plusInSquare", "popout", "push", "question", "quote", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "streamsClassic", "streamsWired", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "thumbDown", "thumbUp", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workflowsApp", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
|
|
135
|
-
/**
|
|
136
|
-
* Can only be one side `left` or `right`
|
|
137
|
-
*/
|
|
138
|
-
iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
|
|
139
|
-
/**
|
|
140
|
-
* Object of props passed to the `<span>` wrapping the content's text/children only (not icon)
|
|
141
|
-
*
|
|
142
|
-
* This span wrapper can be removed by passing `textProps={false}`.
|
|
143
|
-
*/
|
|
144
|
-
textProps: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
145
|
-
className: _propTypes.default.string,
|
|
146
|
-
"aria-label": _propTypes.default.string,
|
|
147
|
-
"data-test-subj": _propTypes.default.string,
|
|
148
|
-
css: _propTypes.default.any,
|
|
149
|
-
ref: _propTypes.default.any,
|
|
150
|
-
"data-text": _propTypes.default.string
|
|
151
|
-
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
152
|
-
iconSize: _propTypes.default.any
|
|
147
|
+
type: _propTypes.default.any
|
|
153
148
|
};
|
|
@@ -10,10 +10,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _services = require("../../../services");
|
|
13
|
+
var _href_validator = require("../../../services/security/href_validator");
|
|
14
|
+
var _useEuiDisabledElement = require("../../../services/hooks/useEuiDisabledElement");
|
|
13
15
|
var _button_display = require("./_button_display.styles");
|
|
14
16
|
var _button_display_content = require("./_button_display_content");
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
+
var _excluded = ["element", "type", "children", "iconType", "iconSide", "iconSize", "size", "isDisabled", "disabled", "hasAriaDisabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "style"],
|
|
18
|
+
_excluded2 = ["ref"];
|
|
17
19
|
/*
|
|
18
20
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
21
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -66,6 +68,8 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
66
68
|
size = _ref2$size === void 0 ? 'm' : _ref2$size,
|
|
67
69
|
isDisabled = _ref2.isDisabled,
|
|
68
70
|
disabled = _ref2.disabled,
|
|
71
|
+
_ref2$hasAriaDisabled = _ref2.hasAriaDisabled,
|
|
72
|
+
hasAriaDisabled = _ref2$hasAriaDisabled === void 0 ? false : _ref2$hasAriaDisabled,
|
|
69
73
|
isLoading = _ref2.isLoading,
|
|
70
74
|
isSelected = _ref2.isSelected,
|
|
71
75
|
fullWidth = _ref2.fullWidth,
|
|
@@ -82,6 +86,14 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
82
86
|
isDisabled: isDisabled || disabled,
|
|
83
87
|
isLoading: isLoading
|
|
84
88
|
});
|
|
89
|
+
var _useEuiDisabledElemen = (0, _useEuiDisabledElement.useEuiDisabledElement)({
|
|
90
|
+
isDisabled: buttonIsDisabled,
|
|
91
|
+
hasAriaDisabled: hasAriaDisabled,
|
|
92
|
+
onKeyDown: rest.onKeyDown
|
|
93
|
+
}),
|
|
94
|
+
disabledRef = _useEuiDisabledElemen.ref,
|
|
95
|
+
disabledButtonProps = _objectWithoutProperties(_useEuiDisabledElemen, _excluded2);
|
|
96
|
+
var setCombinedRef = (0, _services.useCombinedRefs)([disabledRef, ref]);
|
|
85
97
|
var styles = (0, _services.useEuiMemoizedStyles)(_button_display.euiButtonDisplayStyles);
|
|
86
98
|
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && [styles.defaultMinWidth.defaultMinWidth, styles.defaultMinWidth[size]], buttonIsDisabled && styles.isDisabled];
|
|
87
99
|
var innerNode = (0, _react2.jsx)(_button_display_content.EuiButtonDisplayContent, _extends({
|
|
@@ -93,13 +105,14 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
93
105
|
textProps: textProps
|
|
94
106
|
}, contentProps), children);
|
|
95
107
|
var element = buttonIsDisabled ? 'button' : href ? 'a' : _element;
|
|
96
|
-
var elementProps = {
|
|
97
|
-
|
|
108
|
+
var elementProps = {
|
|
109
|
+
ref: setCombinedRef
|
|
110
|
+
};
|
|
111
|
+
var buttonProps = {};
|
|
98
112
|
if (element === 'button') {
|
|
99
|
-
|
|
100
|
-
disabled: buttonIsDisabled,
|
|
113
|
+
buttonProps = _objectSpread({
|
|
101
114
|
'aria-pressed': isSelected
|
|
102
|
-
});
|
|
115
|
+
}, disabledButtonProps);
|
|
103
116
|
}
|
|
104
117
|
var relObj = {};
|
|
105
118
|
if (href && !buttonIsDisabled) {
|
|
@@ -113,13 +126,12 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
113
126
|
} else {
|
|
114
127
|
relObj.type = type;
|
|
115
128
|
}
|
|
116
|
-
return (0, _react2.createElement)(element, _objectSpread(_objectSpread(_objectSpread({
|
|
129
|
+
return (0, _react2.createElement)(element, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
117
130
|
css: cssStyles,
|
|
118
131
|
style: minWidth ? _objectSpread(_objectSpread({}, style), {}, {
|
|
119
132
|
minInlineSize: minWidth
|
|
120
|
-
}) : style
|
|
121
|
-
|
|
122
|
-
}, elementProps), relObj), rest), innerNode);
|
|
133
|
+
}) : style
|
|
134
|
+
}, elementProps), relObj), rest), buttonProps), innerNode);
|
|
123
135
|
});
|
|
124
136
|
EuiButtonDisplay.propTypes = {
|
|
125
137
|
href: _propTypes.default.string,
|
|
@@ -172,28 +184,18 @@ EuiButtonDisplay.propTypes = {
|
|
|
172
184
|
style: _propTypes.default.any,
|
|
173
185
|
type: _propTypes.default.any,
|
|
174
186
|
/**
|
|
175
|
-
*
|
|
187
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
176
188
|
*/
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Can only be one side `left` or `right`
|
|
180
|
-
*/
|
|
181
|
-
iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
|
|
189
|
+
isDisabled: _propTypes.default.bool,
|
|
182
190
|
/**
|
|
183
|
-
*
|
|
191
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
184
192
|
*
|
|
185
|
-
*
|
|
193
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
194
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
195
|
+
*
|
|
196
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
186
197
|
*/
|
|
187
|
-
|
|
188
|
-
className: _propTypes.default.string,
|
|
189
|
-
"aria-label": _propTypes.default.string,
|
|
190
|
-
"data-test-subj": _propTypes.default.string,
|
|
191
|
-
css: _propTypes.default.any,
|
|
192
|
-
ref: _propTypes.default.any,
|
|
193
|
-
"data-text": _propTypes.default.string
|
|
194
|
-
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
195
|
-
iconSize: _propTypes.default.any,
|
|
196
|
-
isDisabled: _propTypes.default.bool,
|
|
198
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
197
199
|
className: _propTypes.default.string,
|
|
198
200
|
"aria-label": _propTypes.default.string,
|
|
199
201
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -20,11 +20,11 @@ var euiButtonBaseCSS = exports.euiButtonBaseCSS = function euiButtonBaseCSS() {
|
|
|
20
20
|
return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat((0, _global_styling.logicalTextAlignCSS)('center'), ";\n white-space: nowrap;\n ").concat((0, _global_styling.logicalCSS)('max-width', '100%'), ";\n vertical-align: middle;\n ");
|
|
21
21
|
};
|
|
22
22
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
23
|
-
name: "
|
|
24
|
-
styles: "cursor:not-allowed;label:isDisabled;"
|
|
23
|
+
name: "col2gx-isDisabled",
|
|
24
|
+
styles: "cursor:not-allowed;&[aria-disabled='true']{pointer-events:none;>*{pointer-events:none;}};label:isDisabled;"
|
|
25
25
|
} : {
|
|
26
|
-
name: "
|
|
27
|
-
styles: "cursor:not-allowed;label:isDisabled;",
|
|
26
|
+
name: "col2gx-isDisabled",
|
|
27
|
+
styles: "cursor:not-allowed;&[aria-disabled='true']{pointer-events:none;>*{pointer-events:none;}};label:isDisabled;",
|
|
28
28
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
29
|
};
|
|
30
30
|
var euiButtonDisplayStyles = exports.euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext) {
|
|
@@ -9,12 +9,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _services = require("../../../services");
|
|
12
|
-
var
|
|
12
|
+
var _useEuiDisabledElement = require("../../../services/hooks/useEuiDisabledElement");
|
|
13
13
|
var _button = require("../../../global_styling/mixins/_button");
|
|
14
|
+
var _button_display_content = require("../button_display/_button_display_content");
|
|
14
15
|
var _button_display = require("../button_display/_button_display");
|
|
15
16
|
var _button_empty = require("./button_empty.styles");
|
|
16
17
|
var _react2 = require("@emotion/react");
|
|
17
|
-
var _excluded = ["children", "className", "iconType", "iconSide", "iconSize", "color", "size", "flush", "isDisabled", "disabled", "isLoading", "href", "target", "rel", "type", "buttonRef", "contentProps", "textProps", "isSelected"]
|
|
18
|
+
var _excluded = ["children", "className", "iconType", "iconSide", "iconSize", "color", "size", "flush", "isDisabled", "disabled", "hasAriaDisabled", "isLoading", "href", "target", "rel", "type", "buttonRef", "contentProps", "textProps", "isSelected"],
|
|
19
|
+
_excluded2 = ["ref"];
|
|
18
20
|
/*
|
|
19
21
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
20
22
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -54,6 +56,8 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
54
56
|
flush = _ref.flush,
|
|
55
57
|
_isDisabled = _ref.isDisabled,
|
|
56
58
|
disabled = _ref.disabled,
|
|
59
|
+
_ref$hasAriaDisabled = _ref.hasAriaDisabled,
|
|
60
|
+
hasAriaDisabled = _ref$hasAriaDisabled === void 0 ? false : _ref$hasAriaDisabled,
|
|
57
61
|
isLoading = _ref.isLoading,
|
|
58
62
|
href = _ref.href,
|
|
59
63
|
target = _ref.target,
|
|
@@ -70,6 +74,14 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
70
74
|
href: href,
|
|
71
75
|
isLoading: isLoading
|
|
72
76
|
});
|
|
77
|
+
var _useEuiDisabledElemen = (0, _useEuiDisabledElement.useEuiDisabledElement)({
|
|
78
|
+
isDisabled: isDisabled,
|
|
79
|
+
hasAriaDisabled: hasAriaDisabled,
|
|
80
|
+
onKeyDown: rest.onKeyDown
|
|
81
|
+
}),
|
|
82
|
+
disabledRef = _useEuiDisabledElemen.ref,
|
|
83
|
+
disabledButtonProps = _objectWithoutProperties(_useEuiDisabledElemen, _excluded2);
|
|
84
|
+
var setCombinedRef = (0, _services.useCombinedRefs)([disabledRef, buttonRef]);
|
|
73
85
|
var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
|
|
74
86
|
display: 'empty'
|
|
75
87
|
});
|
|
@@ -105,7 +117,7 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
105
117
|
href: href,
|
|
106
118
|
target: target,
|
|
107
119
|
rel: secureRel,
|
|
108
|
-
ref:
|
|
120
|
+
ref: setCombinedRef
|
|
109
121
|
}, rest), innerNode);
|
|
110
122
|
}
|
|
111
123
|
return (0, _react2.jsx)("button", _extends({
|
|
@@ -113,9 +125,9 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
113
125
|
className: classes,
|
|
114
126
|
css: cssStyles,
|
|
115
127
|
type: type,
|
|
116
|
-
ref:
|
|
128
|
+
ref: setCombinedRef,
|
|
117
129
|
"aria-pressed": isSelected
|
|
118
|
-
}, rest), innerNode);
|
|
130
|
+
}, rest, disabledButtonProps), innerNode);
|
|
119
131
|
};
|
|
120
132
|
EuiButtonEmpty.propTypes = {
|
|
121
133
|
href: _propTypes.default.string,
|
|
@@ -139,13 +151,6 @@ EuiButtonEmpty.propTypes = {
|
|
|
139
151
|
* Ensure the text of the button sits flush to the left, right, or both sides of its container
|
|
140
152
|
*/
|
|
141
153
|
flush: _propTypes.default.any,
|
|
142
|
-
/**
|
|
143
|
-
* `disabled` is also allowed
|
|
144
|
-
*/
|
|
145
|
-
/**
|
|
146
|
-
* `disabled` is also allowed
|
|
147
|
-
*/
|
|
148
|
-
isDisabled: _propTypes.default.bool,
|
|
149
154
|
/**
|
|
150
155
|
* Force disables the button and changes the icon to a loading spinner
|
|
151
156
|
*/
|
|
@@ -200,8 +205,21 @@ EuiButtonEmpty.propTypes = {
|
|
|
200
205
|
"data-text": _propTypes.default.string
|
|
201
206
|
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
202
207
|
iconSize: _propTypes.default.any,
|
|
208
|
+
/**
|
|
209
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
210
|
+
*/
|
|
211
|
+
isDisabled: _propTypes.default.bool,
|
|
203
212
|
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
204
213
|
"aria-label": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
205
214
|
"data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
206
|
-
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any])
|
|
215
|
+
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any]),
|
|
216
|
+
/**
|
|
217
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
218
|
+
*
|
|
219
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
220
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
221
|
+
*
|
|
222
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
223
|
+
*/
|
|
224
|
+
hasAriaDisabled: _propTypes.default.bool
|
|
207
225
|
};
|
|
@@ -12,7 +12,7 @@ var _accessibility = require("../../accessibility");
|
|
|
12
12
|
var _button_group_button = require("./button_group_button");
|
|
13
13
|
var _button_group = require("./button_group.styles");
|
|
14
14
|
var _react2 = require("@emotion/react");
|
|
15
|
-
var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelectedMap", "isDisabled", "isFullWidth", "isIconOnly", "legend", "name", "onChange", "options", "type"];
|
|
15
|
+
var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelectedMap", "isDisabled", "hasAriaDisabled", "isFullWidth", "isIconOnly", "legend", "name", "onChange", "options", "type"];
|
|
16
16
|
/*
|
|
17
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
18
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -36,6 +36,8 @@ var EuiButtonGroup = exports.EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
36
36
|
idToSelectedMap = _ref$idToSelectedMap === void 0 ? {} : _ref$idToSelectedMap,
|
|
37
37
|
_ref$isDisabled = _ref.isDisabled,
|
|
38
38
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
39
|
+
_ref$hasAriaDisabled = _ref.hasAriaDisabled,
|
|
40
|
+
hasAriaDisabled = _ref$hasAriaDisabled === void 0 ? false : _ref$hasAriaDisabled,
|
|
39
41
|
_ref$isFullWidth = _ref.isFullWidth,
|
|
40
42
|
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
|
41
43
|
_ref$isIconOnly = _ref.isIconOnly,
|
|
@@ -55,18 +57,21 @@ var EuiButtonGroup = exports.EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
55
57
|
'euiButtonGroup-isDisabled': isDisabled
|
|
56
58
|
}, className);
|
|
57
59
|
var typeIsSingle = type === 'single';
|
|
60
|
+
var groupDisabledProps = {
|
|
61
|
+
disabled: hasAriaDisabled ? undefined : isDisabled,
|
|
62
|
+
'aria-disabled': hasAriaDisabled ? isDisabled : undefined
|
|
63
|
+
};
|
|
58
64
|
return (0, _react2.jsx)("fieldset", _extends({
|
|
59
65
|
css: wrapperCssStyles,
|
|
60
66
|
className: classes
|
|
61
|
-
}, rest, {
|
|
62
|
-
disabled: isDisabled
|
|
63
|
-
}), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("legend", null, legend)), (0, _react2.jsx)("div", {
|
|
67
|
+
}, rest, groupDisabledProps), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("legend", null, legend)), (0, _react2.jsx)("div", {
|
|
64
68
|
css: cssStyles,
|
|
65
69
|
className: "euiButtonGroup__buttons"
|
|
66
70
|
}, options.map(function (option) {
|
|
67
71
|
return (0, _react2.jsx)(_button_group_button.EuiButtonGroupButton, _extends({
|
|
68
72
|
key: option.id,
|
|
69
|
-
isDisabled: isDisabled
|
|
73
|
+
isDisabled: isDisabled,
|
|
74
|
+
hasAriaDisabled: hasAriaDisabled
|
|
70
75
|
}, option, {
|
|
71
76
|
onClick: typeIsSingle ? function () {
|
|
72
77
|
return onChange(option.id, option.value);
|
|
@@ -86,46 +91,50 @@ EuiButtonGroup.propTypes = {
|
|
|
86
91
|
"data-test-subj": _propTypes.default.string,
|
|
87
92
|
css: _propTypes.default.any,
|
|
88
93
|
/**
|
|
89
|
-
*
|
|
90
|
-
* `compressed` is meant to be used alongside and within compressed forms.
|
|
94
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
91
95
|
*/
|
|
92
|
-
buttonSize: _propTypes.default.oneOf(["s", "m", "compressed"]),
|
|
93
96
|
isDisabled: _propTypes.default.bool,
|
|
97
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
94
98
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
99
|
+
* Typical sizing is `s`. Medium `m` size should be reserved for major features.
|
|
100
|
+
* `compressed` is meant to be used alongside and within compressed forms.
|
|
101
|
+
*/
|
|
102
|
+
buttonSize: _propTypes.default.oneOf(["s", "m", "compressed"]),
|
|
103
|
+
/**
|
|
104
|
+
* Expands the whole group to the full width of the container.
|
|
105
|
+
* Each button gets equal widths no matter the content
|
|
106
|
+
*/
|
|
98
107
|
isFullWidth: _propTypes.default.bool,
|
|
99
108
|
/**
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
* Hides the label to only show the `iconType` provided by the `option`
|
|
110
|
+
*/
|
|
102
111
|
isIconOnly: _propTypes.default.bool,
|
|
103
112
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
* A hidden group title (required for accessibility)
|
|
114
|
+
*/
|
|
106
115
|
legend: _propTypes.default.string.isRequired,
|
|
107
116
|
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
117
|
+
* Any of the named color palette options.
|
|
118
|
+
*
|
|
119
|
+
* Do not use the following colors for standalone buttons directly,
|
|
120
|
+
* they exist to serve other components:
|
|
121
|
+
* - accent
|
|
122
|
+
* - warning
|
|
123
|
+
*/
|
|
115
124
|
color: _propTypes.default.any,
|
|
116
125
|
/**
|
|
117
126
|
* Default for `type` is single so it can also be excluded
|
|
118
127
|
*/
|
|
119
128
|
/**
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
* Actual type is `'single' | 'multi'`.
|
|
130
|
+
* Determines how the selection of the group should be handled.
|
|
131
|
+
* With `'single'` only one option can be selected at a time (similar to radio group).
|
|
132
|
+
* With `'multi'` multiple options selected (similar to checkbox group).
|
|
133
|
+
*/
|
|
125
134
|
type: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOf(["single", "multi"]), _propTypes.default.oneOf(["single"])]), _propTypes.default.oneOf(["multi"])]),
|
|
126
135
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
* An array of {@link EuiButtonGroupOptionProps}
|
|
137
|
+
*/
|
|
129
138
|
options: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
130
139
|
/**
|
|
131
140
|
* Each option must have a unique `id` for maintaining selection
|
|
@@ -135,7 +144,6 @@ EuiButtonGroup.propTypes = {
|
|
|
135
144
|
* Each option must have a `label` even for icons which will be applied as the `aria-label`
|
|
136
145
|
*/
|
|
137
146
|
label: _propTypes.default.node.isRequired,
|
|
138
|
-
isDisabled: _propTypes.default.bool,
|
|
139
147
|
/**
|
|
140
148
|
* The value of the radio input.
|
|
141
149
|
*/
|
|
@@ -181,10 +189,20 @@ EuiButtonGroup.propTypes = {
|
|
|
181
189
|
"data-text": _propTypes.default.string
|
|
182
190
|
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
183
191
|
iconSize: _propTypes.default.any,
|
|
192
|
+
isDisabled: _propTypes.default.bool,
|
|
184
193
|
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
185
194
|
"aria-label": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
186
195
|
"data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
187
|
-
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any])
|
|
196
|
+
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any]),
|
|
197
|
+
/**
|
|
198
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
199
|
+
*
|
|
200
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
201
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
202
|
+
*
|
|
203
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
204
|
+
*/
|
|
205
|
+
hasAriaDisabled: _propTypes.default.bool
|
|
188
206
|
}).isRequired).isRequired,
|
|
189
207
|
/**
|
|
190
208
|
* @deprecated No longer needed. You can safely remove this prop entirely
|
|
@@ -63,7 +63,7 @@ var EuiButtonGroupButton = exports.EuiButtonGroupButton = function EuiButtonGrou
|
|
|
63
63
|
var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
|
|
64
64
|
display: display
|
|
65
65
|
})[color];
|
|
66
|
-
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 && isCompressed && focusColorStyles[color], hasBorder && styles.hasBorder];
|
|
66
|
+
var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly.iconOnly, isIconOnly && styles.iconOnly[size], !isCompressed && (hasToolTip ? styles.uncompressed.hasToolTip : styles.uncompressed[size]), isCompressed ? styles.compressed : styles.uncompressed.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && isCompressed && focusColorStyles[color], hasBorder && styles.hasBorder];
|
|
67
67
|
var tooltipWrapperStyles = [styles.tooltipWrapper, !isCompressed && styles.uncompressed[size]];
|
|
68
68
|
var contentStyles = [styles.content.euiButtonGroupButton__content, isCompressed && styles.content.compressed];
|
|
69
69
|
var textStyles = [isIconOnly ? styles.text.euiButtonGroupButton__iconOnly : styles.text.euiButtonGroupButton__text];
|
|
@@ -113,7 +113,6 @@ EuiButtonGroupButton.propTypes = {
|
|
|
113
113
|
* Each option must have a `label` even for icons which will be applied as the `aria-label`
|
|
114
114
|
*/
|
|
115
115
|
label: _propTypes.default.node.isRequired,
|
|
116
|
-
isDisabled: _propTypes.default.bool,
|
|
117
116
|
/**
|
|
118
117
|
* The value of the radio input.
|
|
119
118
|
*/
|
|
@@ -159,10 +158,23 @@ EuiButtonGroupButton.propTypes = {
|
|
|
159
158
|
"data-text": _propTypes.default.string
|
|
160
159
|
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
161
160
|
iconSize: _propTypes.default.any,
|
|
161
|
+
/**
|
|
162
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
163
|
+
*/
|
|
164
|
+
isDisabled: _propTypes.default.bool,
|
|
162
165
|
className: _propTypes.default.string,
|
|
163
166
|
"aria-label": _propTypes.default.string,
|
|
164
167
|
"data-test-subj": _propTypes.default.string,
|
|
165
168
|
css: _propTypes.default.any,
|
|
169
|
+
/**
|
|
170
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
171
|
+
*
|
|
172
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
173
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
174
|
+
*
|
|
175
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
176
|
+
*/
|
|
177
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
166
178
|
/**
|
|
167
179
|
* Styles the selected button to look selected (usually with `fill`)
|
|
168
180
|
*/
|
|
@@ -9,7 +9,6 @@ var _react = require("@emotion/react");
|
|
|
9
9
|
var _global_styling = require("../../../global_styling");
|
|
10
10
|
var _button = require("../../../global_styling/mixins/_button");
|
|
11
11
|
var _accessibility = require("../../accessibility");
|
|
12
|
-
var _form = require("../../form/form.styles");
|
|
13
12
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
13
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
14
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -47,9 +46,8 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
47
46
|
var euiButtonGroupButtonStyles = exports.euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeContext) {
|
|
48
47
|
var euiTheme = euiThemeContext.euiTheme,
|
|
49
48
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
var compressedButtonHeight = (0, _global_styling.mathWithUnits)([controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
|
|
49
|
+
var buttonSizes = (0, _button.euiButtonSizeMap)(euiThemeContext);
|
|
50
|
+
var compressedButtonHeight = (0, _global_styling.mathWithUnits)([buttonSizes.s.height, euiTheme.border.width.thin], function (x, y) {
|
|
53
51
|
return x - y * 6;
|
|
54
52
|
});
|
|
55
53
|
var selectedSelectors = '.euiButtonGroupButton-isSelected, .euiButtonGroup__tooltipWrapper-isSelected';
|
|
@@ -61,10 +59,16 @@ var euiButtonGroupButtonStyles = exports.euiButtonGroupButtonStyles = function e
|
|
|
61
59
|
euiButtonGroupButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', 0), " flex-shrink:1;flex-grow:0;z-index:0;&:focus-visible{z-index:2;}", _global_styling.euiCanAnimate, "{transition:background-color ", euiTheme.animation.normal, " ease-in-out,color ", euiTheme.animation.normal, " ease-in-out;}&:is(", selectedSelectors, "){", (0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
62
60
|
forced: "\n --highContrastHoverIndicatorColor: ".concat(euiTheme.colors.textInverse, ";\n border: none;\n\n /* styles the content manually instead of the button itself to preserve the system\n focus style, as otherwise preventForcedColors() would require manual styling */\n > [class*=\"euiButtonDisplayContent\"] {\n ").concat((0, _global_styling.preventForcedColors)(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n border: none;\n }\n ")
|
|
63
61
|
}), ";};label:euiButtonGroupButton;"),
|
|
64
|
-
iconOnly:
|
|
62
|
+
iconOnly: {
|
|
63
|
+
// used only as classname, sizes are added separately
|
|
64
|
+
iconOnly: /*#__PURE__*/(0, _react.css)(";label:iconOnly;"),
|
|
65
|
+
s: "\n ".concat((0, _global_styling.logicalCSS)('width', buttonSizes.s.height), "\n "),
|
|
66
|
+
m: "\n ".concat((0, _global_styling.logicalCSS)('width', buttonSizes.m.height), "\n "),
|
|
67
|
+
compressed: "\n ".concat((0, _global_styling.logicalCSS)('width', compressedButtonHeight), "\n ")
|
|
68
|
+
},
|
|
65
69
|
// Sizes
|
|
66
70
|
uncompressed: {
|
|
67
|
-
uncompressed: /*#__PURE__*/(0, _react.css)("&:focus-visible{", (0, _global_styling.euiOutline)(euiThemeContext, 'inset', euiTheme.components.buttonGroupFocusColor), ";}&:is(", selectedSelectors, "):not(
|
|
71
|
+
uncompressed: /*#__PURE__*/(0, _react.css)("&:focus-visible{", (0, _global_styling.euiOutline)(euiThemeContext, 'inset', euiTheme.components.buttonGroupFocusColor), ";}&:is(", selectedSelectors, "):not(", _global_styling.euiDisabledSelector, "){z-index:1;border:", euiTheme.border.width.thin, " solid transparent;", (0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
68
72
|
forced: "\n /* use inset focus outline to ensure visibility, same as custom hover.\n NOTE: temp solution - this will be revisited once we handle global focus styles */\n &:focus-visible {\n outline-color: ".concat(euiTheme.colors.textInverse, ";\n /* has to be inset due to overflow: hidden */\n outline-offset: -").concat((0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
69
73
|
return x * 4;
|
|
70
74
|
}), ";\n }\n ")
|