@elastic/eui 109.0.0 → 109.1.0-snapshot.1763390960850
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 +3 -2
- 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
|
@@ -14,10 +14,12 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
14
14
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
16
|
var _services = require("../../../services");
|
|
17
|
+
var _href_validator = require("../../../services/security/href_validator");
|
|
18
|
+
var _useEuiDisabledElement = require("../../../services/hooks/useEuiDisabledElement");
|
|
17
19
|
var _button_display = require("./_button_display.styles");
|
|
18
20
|
var _button_display_content = require("./_button_display_content");
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
+
var _excluded = ["element", "type", "children", "iconType", "iconSide", "iconSize", "size", "isDisabled", "disabled", "hasAriaDisabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "style"],
|
|
22
|
+
_excluded2 = ["ref"];
|
|
21
23
|
/*
|
|
22
24
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
25
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -63,6 +65,8 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
63
65
|
size = _ref2$size === void 0 ? 'm' : _ref2$size,
|
|
64
66
|
isDisabled = _ref2.isDisabled,
|
|
65
67
|
disabled = _ref2.disabled,
|
|
68
|
+
_ref2$hasAriaDisabled = _ref2.hasAriaDisabled,
|
|
69
|
+
hasAriaDisabled = _ref2$hasAriaDisabled === void 0 ? false : _ref2$hasAriaDisabled,
|
|
66
70
|
isLoading = _ref2.isLoading,
|
|
67
71
|
isSelected = _ref2.isSelected,
|
|
68
72
|
fullWidth = _ref2.fullWidth,
|
|
@@ -79,6 +83,14 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
79
83
|
isDisabled: isDisabled || disabled,
|
|
80
84
|
isLoading: isLoading
|
|
81
85
|
});
|
|
86
|
+
var _useEuiDisabledElemen = (0, _useEuiDisabledElement.useEuiDisabledElement)({
|
|
87
|
+
isDisabled: buttonIsDisabled,
|
|
88
|
+
hasAriaDisabled: hasAriaDisabled,
|
|
89
|
+
onKeyDown: rest.onKeyDown
|
|
90
|
+
}),
|
|
91
|
+
disabledRef = _useEuiDisabledElemen.ref,
|
|
92
|
+
disabledButtonProps = (0, _objectWithoutProperties2.default)(_useEuiDisabledElemen, _excluded2);
|
|
93
|
+
var setCombinedRef = (0, _services.useCombinedRefs)([disabledRef, ref]);
|
|
82
94
|
var styles = (0, _services.useEuiMemoizedStyles)(_button_display.euiButtonDisplayStyles);
|
|
83
95
|
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && [styles.defaultMinWidth.defaultMinWidth, styles.defaultMinWidth[size]], buttonIsDisabled && styles.isDisabled];
|
|
84
96
|
var innerNode = (0, _react2.jsx)(_button_display_content.EuiButtonDisplayContent, (0, _extends2.default)({
|
|
@@ -90,13 +102,14 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
90
102
|
textProps: textProps
|
|
91
103
|
}, contentProps), children);
|
|
92
104
|
var element = buttonIsDisabled ? 'button' : href ? 'a' : _element;
|
|
93
|
-
var elementProps = {
|
|
94
|
-
|
|
105
|
+
var elementProps = {
|
|
106
|
+
ref: setCombinedRef
|
|
107
|
+
};
|
|
108
|
+
var buttonProps = {};
|
|
95
109
|
if (element === 'button') {
|
|
96
|
-
|
|
97
|
-
disabled: buttonIsDisabled,
|
|
110
|
+
buttonProps = _objectSpread({
|
|
98
111
|
'aria-pressed': isSelected
|
|
99
|
-
});
|
|
112
|
+
}, disabledButtonProps);
|
|
100
113
|
}
|
|
101
114
|
var relObj = {};
|
|
102
115
|
if (href && !buttonIsDisabled) {
|
|
@@ -110,13 +123,12 @@ var EuiButtonDisplay = exports.EuiButtonDisplay = /*#__PURE__*/(0, _react.forwar
|
|
|
110
123
|
} else {
|
|
111
124
|
relObj.type = type;
|
|
112
125
|
}
|
|
113
|
-
return (0, _react2.createElement)(element, _objectSpread(_objectSpread(_objectSpread({
|
|
126
|
+
return (0, _react2.createElement)(element, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
114
127
|
css: cssStyles,
|
|
115
128
|
style: minWidth ? _objectSpread(_objectSpread({}, style), {}, {
|
|
116
129
|
minInlineSize: minWidth
|
|
117
|
-
}) : style
|
|
118
|
-
|
|
119
|
-
}, elementProps), relObj), rest), innerNode);
|
|
130
|
+
}) : style
|
|
131
|
+
}, elementProps), relObj), rest), buttonProps), innerNode);
|
|
120
132
|
});
|
|
121
133
|
EuiButtonDisplay.propTypes = {
|
|
122
134
|
href: _propTypes.default.string,
|
|
@@ -169,28 +181,18 @@ EuiButtonDisplay.propTypes = {
|
|
|
169
181
|
style: _propTypes.default.any,
|
|
170
182
|
type: _propTypes.default.any,
|
|
171
183
|
/**
|
|
172
|
-
*
|
|
184
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
173
185
|
*/
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* Can only be one side `left` or `right`
|
|
177
|
-
*/
|
|
178
|
-
iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
|
|
186
|
+
isDisabled: _propTypes.default.bool,
|
|
179
187
|
/**
|
|
180
|
-
*
|
|
188
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
181
189
|
*
|
|
182
|
-
*
|
|
190
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
191
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
192
|
+
*
|
|
193
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
183
194
|
*/
|
|
184
|
-
|
|
185
|
-
className: _propTypes.default.string,
|
|
186
|
-
"aria-label": _propTypes.default.string,
|
|
187
|
-
"data-test-subj": _propTypes.default.string,
|
|
188
|
-
css: _propTypes.default.any,
|
|
189
|
-
ref: _propTypes.default.any,
|
|
190
|
-
"data-text": _propTypes.default.string
|
|
191
|
-
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
192
|
-
iconSize: _propTypes.default.any,
|
|
193
|
-
isDisabled: _propTypes.default.bool,
|
|
195
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
194
196
|
className: _propTypes.default.string,
|
|
195
197
|
"aria-label": _propTypes.default.string,
|
|
196
198
|
"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) {
|
|
@@ -12,12 +12,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
12
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
var _services = require("../../../services");
|
|
15
|
-
var
|
|
15
|
+
var _useEuiDisabledElement = require("../../../services/hooks/useEuiDisabledElement");
|
|
16
16
|
var _button = require("../../../global_styling/mixins/_button");
|
|
17
|
+
var _button_display_content = require("../button_display/_button_display_content");
|
|
17
18
|
var _button_display = require("../button_display/_button_display");
|
|
18
19
|
var _button_empty = require("./button_empty.styles");
|
|
19
20
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["children", "className", "iconType", "iconSide", "iconSize", "color", "size", "flush", "isDisabled", "disabled", "isLoading", "href", "target", "rel", "type", "buttonRef", "contentProps", "textProps", "isSelected"]
|
|
21
|
+
var _excluded = ["children", "className", "iconType", "iconSide", "iconSize", "color", "size", "flush", "isDisabled", "disabled", "hasAriaDisabled", "isLoading", "href", "target", "rel", "type", "buttonRef", "contentProps", "textProps", "isSelected"],
|
|
22
|
+
_excluded2 = ["ref"];
|
|
21
23
|
/*
|
|
22
24
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
25
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -50,6 +52,8 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
50
52
|
flush = _ref.flush,
|
|
51
53
|
_isDisabled = _ref.isDisabled,
|
|
52
54
|
disabled = _ref.disabled,
|
|
55
|
+
_ref$hasAriaDisabled = _ref.hasAriaDisabled,
|
|
56
|
+
hasAriaDisabled = _ref$hasAriaDisabled === void 0 ? false : _ref$hasAriaDisabled,
|
|
53
57
|
isLoading = _ref.isLoading,
|
|
54
58
|
href = _ref.href,
|
|
55
59
|
target = _ref.target,
|
|
@@ -66,6 +70,14 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
66
70
|
href: href,
|
|
67
71
|
isLoading: isLoading
|
|
68
72
|
});
|
|
73
|
+
var _useEuiDisabledElemen = (0, _useEuiDisabledElement.useEuiDisabledElement)({
|
|
74
|
+
isDisabled: isDisabled,
|
|
75
|
+
hasAriaDisabled: hasAriaDisabled,
|
|
76
|
+
onKeyDown: rest.onKeyDown
|
|
77
|
+
}),
|
|
78
|
+
disabledRef = _useEuiDisabledElemen.ref,
|
|
79
|
+
disabledButtonProps = (0, _objectWithoutProperties2.default)(_useEuiDisabledElemen, _excluded2);
|
|
80
|
+
var setCombinedRef = (0, _services.useCombinedRefs)([disabledRef, buttonRef]);
|
|
69
81
|
var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
|
|
70
82
|
display: 'empty'
|
|
71
83
|
});
|
|
@@ -101,7 +113,7 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
101
113
|
href: href,
|
|
102
114
|
target: target,
|
|
103
115
|
rel: secureRel,
|
|
104
|
-
ref:
|
|
116
|
+
ref: setCombinedRef
|
|
105
117
|
}, rest), innerNode);
|
|
106
118
|
}
|
|
107
119
|
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
@@ -109,9 +121,9 @@ var EuiButtonEmpty = exports.EuiButtonEmpty = function EuiButtonEmpty(_ref) {
|
|
|
109
121
|
className: classes,
|
|
110
122
|
css: cssStyles,
|
|
111
123
|
type: type,
|
|
112
|
-
ref:
|
|
124
|
+
ref: setCombinedRef,
|
|
113
125
|
"aria-pressed": isSelected
|
|
114
|
-
}, rest), innerNode);
|
|
126
|
+
}, rest, disabledButtonProps), innerNode);
|
|
115
127
|
};
|
|
116
128
|
EuiButtonEmpty.propTypes = {
|
|
117
129
|
href: _propTypes.default.string,
|
|
@@ -135,13 +147,6 @@ EuiButtonEmpty.propTypes = {
|
|
|
135
147
|
* Ensure the text of the button sits flush to the left, right, or both sides of its container
|
|
136
148
|
*/
|
|
137
149
|
flush: _propTypes.default.any,
|
|
138
|
-
/**
|
|
139
|
-
* `disabled` is also allowed
|
|
140
|
-
*/
|
|
141
|
-
/**
|
|
142
|
-
* `disabled` is also allowed
|
|
143
|
-
*/
|
|
144
|
-
isDisabled: _propTypes.default.bool,
|
|
145
150
|
/**
|
|
146
151
|
* Force disables the button and changes the icon to a loading spinner
|
|
147
152
|
*/
|
|
@@ -196,8 +201,21 @@ EuiButtonEmpty.propTypes = {
|
|
|
196
201
|
"data-text": _propTypes.default.string
|
|
197
202
|
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
198
203
|
iconSize: _propTypes.default.any,
|
|
204
|
+
/**
|
|
205
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
206
|
+
*/
|
|
207
|
+
isDisabled: _propTypes.default.bool,
|
|
199
208
|
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
200
209
|
"aria-label": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
201
210
|
"data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
202
|
-
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any])
|
|
211
|
+
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any]),
|
|
212
|
+
/**
|
|
213
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
214
|
+
*
|
|
215
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
216
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
217
|
+
*
|
|
218
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
219
|
+
*/
|
|
220
|
+
hasAriaDisabled: _propTypes.default.bool
|
|
203
221
|
};
|
|
@@ -15,7 +15,7 @@ var _accessibility = require("../../accessibility");
|
|
|
15
15
|
var _button_group_button = require("./button_group_button");
|
|
16
16
|
var _button_group = require("./button_group.styles");
|
|
17
17
|
var _react2 = require("@emotion/react");
|
|
18
|
-
var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelectedMap", "isDisabled", "isFullWidth", "isIconOnly", "legend", "name", "onChange", "options", "type"];
|
|
18
|
+
var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelectedMap", "isDisabled", "hasAriaDisabled", "isFullWidth", "isIconOnly", "legend", "name", "onChange", "options", "type"];
|
|
19
19
|
/*
|
|
20
20
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
21
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -35,6 +35,8 @@ var EuiButtonGroup = exports.EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
35
35
|
idToSelectedMap = _ref$idToSelectedMap === void 0 ? {} : _ref$idToSelectedMap,
|
|
36
36
|
_ref$isDisabled = _ref.isDisabled,
|
|
37
37
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
38
|
+
_ref$hasAriaDisabled = _ref.hasAriaDisabled,
|
|
39
|
+
hasAriaDisabled = _ref$hasAriaDisabled === void 0 ? false : _ref$hasAriaDisabled,
|
|
38
40
|
_ref$isFullWidth = _ref.isFullWidth,
|
|
39
41
|
isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
|
|
40
42
|
_ref$isIconOnly = _ref.isIconOnly,
|
|
@@ -54,18 +56,21 @@ var EuiButtonGroup = exports.EuiButtonGroup = function EuiButtonGroup(_ref) {
|
|
|
54
56
|
'euiButtonGroup-isDisabled': isDisabled
|
|
55
57
|
}, className);
|
|
56
58
|
var typeIsSingle = type === 'single';
|
|
59
|
+
var groupDisabledProps = {
|
|
60
|
+
disabled: hasAriaDisabled ? undefined : isDisabled,
|
|
61
|
+
'aria-disabled': hasAriaDisabled ? isDisabled : undefined
|
|
62
|
+
};
|
|
57
63
|
return (0, _react2.jsx)("fieldset", (0, _extends2.default)({
|
|
58
64
|
css: wrapperCssStyles,
|
|
59
65
|
className: classes
|
|
60
|
-
}, rest, {
|
|
61
|
-
disabled: isDisabled
|
|
62
|
-
}), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("legend", null, legend)), (0, _react2.jsx)("div", {
|
|
66
|
+
}, rest, groupDisabledProps), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("legend", null, legend)), (0, _react2.jsx)("div", {
|
|
63
67
|
css: cssStyles,
|
|
64
68
|
className: "euiButtonGroup__buttons"
|
|
65
69
|
}, options.map(function (option) {
|
|
66
70
|
return (0, _react2.jsx)(_button_group_button.EuiButtonGroupButton, (0, _extends2.default)({
|
|
67
71
|
key: option.id,
|
|
68
|
-
isDisabled: isDisabled
|
|
72
|
+
isDisabled: isDisabled,
|
|
73
|
+
hasAriaDisabled: hasAriaDisabled
|
|
69
74
|
}, option, {
|
|
70
75
|
onClick: typeIsSingle ? function () {
|
|
71
76
|
return onChange(option.id, option.value);
|
|
@@ -85,46 +90,50 @@ EuiButtonGroup.propTypes = {
|
|
|
85
90
|
"data-test-subj": _propTypes.default.string,
|
|
86
91
|
css: _propTypes.default.any,
|
|
87
92
|
/**
|
|
88
|
-
*
|
|
89
|
-
* `compressed` is meant to be used alongside and within compressed forms.
|
|
93
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
90
94
|
*/
|
|
91
|
-
buttonSize: _propTypes.default.oneOf(["s", "m", "compressed"]),
|
|
92
95
|
isDisabled: _propTypes.default.bool,
|
|
96
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
93
97
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
* Typical sizing is `s`. Medium `m` size should be reserved for major features.
|
|
99
|
+
* `compressed` is meant to be used alongside and within compressed forms.
|
|
100
|
+
*/
|
|
101
|
+
buttonSize: _propTypes.default.oneOf(["s", "m", "compressed"]),
|
|
102
|
+
/**
|
|
103
|
+
* Expands the whole group to the full width of the container.
|
|
104
|
+
* Each button gets equal widths no matter the content
|
|
105
|
+
*/
|
|
97
106
|
isFullWidth: _propTypes.default.bool,
|
|
98
107
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
108
|
+
* Hides the label to only show the `iconType` provided by the `option`
|
|
109
|
+
*/
|
|
101
110
|
isIconOnly: _propTypes.default.bool,
|
|
102
111
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
* A hidden group title (required for accessibility)
|
|
113
|
+
*/
|
|
105
114
|
legend: _propTypes.default.string.isRequired,
|
|
106
115
|
/**
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
* Any of the named color palette options.
|
|
117
|
+
*
|
|
118
|
+
* Do not use the following colors for standalone buttons directly,
|
|
119
|
+
* they exist to serve other components:
|
|
120
|
+
* - accent
|
|
121
|
+
* - warning
|
|
122
|
+
*/
|
|
114
123
|
color: _propTypes.default.any,
|
|
115
124
|
/**
|
|
116
125
|
* Default for `type` is single so it can also be excluded
|
|
117
126
|
*/
|
|
118
127
|
/**
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
* Actual type is `'single' | 'multi'`.
|
|
129
|
+
* Determines how the selection of the group should be handled.
|
|
130
|
+
* With `'single'` only one option can be selected at a time (similar to radio group).
|
|
131
|
+
* With `'multi'` multiple options selected (similar to checkbox group).
|
|
132
|
+
*/
|
|
124
133
|
type: _propTypes.default.oneOfType([_propTypes.default.oneOfType([_propTypes.default.oneOf(["single", "multi"]), _propTypes.default.oneOf(["single"])]), _propTypes.default.oneOf(["multi"])]),
|
|
125
134
|
/**
|
|
126
|
-
|
|
127
|
-
|
|
135
|
+
* An array of {@link EuiButtonGroupOptionProps}
|
|
136
|
+
*/
|
|
128
137
|
options: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
129
138
|
/**
|
|
130
139
|
* Each option must have a unique `id` for maintaining selection
|
|
@@ -134,7 +143,6 @@ EuiButtonGroup.propTypes = {
|
|
|
134
143
|
* Each option must have a `label` even for icons which will be applied as the `aria-label`
|
|
135
144
|
*/
|
|
136
145
|
label: _propTypes.default.node.isRequired,
|
|
137
|
-
isDisabled: _propTypes.default.bool,
|
|
138
146
|
/**
|
|
139
147
|
* The value of the radio input.
|
|
140
148
|
*/
|
|
@@ -180,10 +188,20 @@ EuiButtonGroup.propTypes = {
|
|
|
180
188
|
"data-text": _propTypes.default.string
|
|
181
189
|
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
182
190
|
iconSize: _propTypes.default.any,
|
|
191
|
+
isDisabled: _propTypes.default.bool,
|
|
183
192
|
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
184
193
|
"aria-label": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
185
194
|
"data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
186
|
-
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any])
|
|
195
|
+
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any]),
|
|
196
|
+
/**
|
|
197
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
198
|
+
*
|
|
199
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
200
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
201
|
+
*
|
|
202
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
203
|
+
*/
|
|
204
|
+
hasAriaDisabled: _propTypes.default.bool
|
|
187
205
|
}).isRequired).isRequired,
|
|
188
206
|
/**
|
|
189
207
|
* @deprecated No longer needed. You can safely remove this prop entirely
|
|
@@ -54,7 +54,7 @@ var EuiButtonGroupButton = exports.EuiButtonGroupButton = function EuiButtonGrou
|
|
|
54
54
|
var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
|
|
55
55
|
display: display
|
|
56
56
|
})[color];
|
|
57
|
-
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];
|
|
57
|
+
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];
|
|
58
58
|
var tooltipWrapperStyles = [styles.tooltipWrapper, !isCompressed && styles.uncompressed[size]];
|
|
59
59
|
var contentStyles = [styles.content.euiButtonGroupButton__content, isCompressed && styles.content.compressed];
|
|
60
60
|
var textStyles = [isIconOnly ? styles.text.euiButtonGroupButton__iconOnly : styles.text.euiButtonGroupButton__text];
|
|
@@ -104,7 +104,6 @@ EuiButtonGroupButton.propTypes = {
|
|
|
104
104
|
* Each option must have a `label` even for icons which will be applied as the `aria-label`
|
|
105
105
|
*/
|
|
106
106
|
label: _propTypes.default.node.isRequired,
|
|
107
|
-
isDisabled: _propTypes.default.bool,
|
|
108
107
|
/**
|
|
109
108
|
* The value of the radio input.
|
|
110
109
|
*/
|
|
@@ -150,10 +149,23 @@ EuiButtonGroupButton.propTypes = {
|
|
|
150
149
|
"data-text": _propTypes.default.string
|
|
151
150
|
}).isRequired, _propTypes.default.oneOf([false])]),
|
|
152
151
|
iconSize: _propTypes.default.any,
|
|
152
|
+
/**
|
|
153
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
154
|
+
*/
|
|
155
|
+
isDisabled: _propTypes.default.bool,
|
|
153
156
|
className: _propTypes.default.string,
|
|
154
157
|
"aria-label": _propTypes.default.string,
|
|
155
158
|
"data-test-subj": _propTypes.default.string,
|
|
156
159
|
css: _propTypes.default.any,
|
|
160
|
+
/**
|
|
161
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
162
|
+
*
|
|
163
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
164
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
165
|
+
*
|
|
166
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
167
|
+
*/
|
|
168
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
157
169
|
/**
|
|
158
170
|
* Styles the selected button to look selected (usually with `fill`)
|
|
159
171
|
*/
|
|
@@ -11,7 +11,6 @@ var _react = require("@emotion/react");
|
|
|
11
11
|
var _global_styling = require("../../../global_styling");
|
|
12
12
|
var _button = require("../../../global_styling/mixins/_button");
|
|
13
13
|
var _accessibility = require("../../accessibility");
|
|
14
|
-
var _form = require("../../form/form.styles");
|
|
15
14
|
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; }
|
|
16
15
|
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) { (0, _defineProperty2.default)(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; }
|
|
17
16
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
|
|
@@ -40,9 +39,8 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
40
39
|
var euiButtonGroupButtonStyles = exports.euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeContext) {
|
|
41
40
|
var euiTheme = euiThemeContext.euiTheme,
|
|
42
41
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
var compressedButtonHeight = (0, _global_styling.mathWithUnits)([controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
|
|
42
|
+
var buttonSizes = (0, _button.euiButtonSizeMap)(euiThemeContext);
|
|
43
|
+
var compressedButtonHeight = (0, _global_styling.mathWithUnits)([buttonSizes.s.height, euiTheme.border.width.thin], function (x, y) {
|
|
46
44
|
return x - y * 6;
|
|
47
45
|
});
|
|
48
46
|
var selectedSelectors = '.euiButtonGroupButton-isSelected, .euiButtonGroup__tooltipWrapper-isSelected';
|
|
@@ -54,10 +52,16 @@ var euiButtonGroupButtonStyles = exports.euiButtonGroupButtonStyles = function e
|
|
|
54
52
|
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, {
|
|
55
53
|
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 ")
|
|
56
54
|
}), ";};label:euiButtonGroupButton;"),
|
|
57
|
-
iconOnly:
|
|
55
|
+
iconOnly: {
|
|
56
|
+
// used only as classname, sizes are added separately
|
|
57
|
+
iconOnly: /*#__PURE__*/(0, _react.css)(";label:iconOnly;"),
|
|
58
|
+
s: "\n ".concat((0, _global_styling.logicalCSS)('width', buttonSizes.s.height), "\n "),
|
|
59
|
+
m: "\n ".concat((0, _global_styling.logicalCSS)('width', buttonSizes.m.height), "\n "),
|
|
60
|
+
compressed: "\n ".concat((0, _global_styling.logicalCSS)('width', compressedButtonHeight), "\n ")
|
|
61
|
+
},
|
|
58
62
|
// Sizes
|
|
59
63
|
uncompressed: {
|
|
60
|
-
uncompressed: /*#__PURE__*/(0, _react.css)("&:focus-visible{", (0, _global_styling.euiOutline)(euiThemeContext, 'inset', euiTheme.components.buttonGroupFocusColor), ";}&:is(", selectedSelectors, "):not(
|
|
64
|
+
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, {
|
|
61
65
|
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) {
|
|
62
66
|
return x * 4;
|
|
63
67
|
}), ";\n }\n ")
|
|
@@ -11,13 +11,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _services = require("../../../services");
|
|
14
|
+
var _useEuiDisabledElement = require("../../../services/hooks/useEuiDisabledElement");
|
|
14
15
|
var _icon = require("../../icon");
|
|
15
16
|
var _loading = require("../../loading");
|
|
16
17
|
var _button = require("../../../global_styling/mixins/_button");
|
|
17
18
|
var _button_display = require("../button_display/_button_display");
|
|
18
19
|
var _button_icon = require("./button_icon.styles");
|
|
19
20
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["className", "iconType", "iconSize", "color", "isDisabled", "disabled", "href", "type", "display", "target", "rel", "size", "buttonRef", "isSelected", "isLoading"]
|
|
21
|
+
var _excluded = ["className", "iconType", "iconSize", "color", "isDisabled", "disabled", "hasAriaDisabled", "href", "type", "display", "target", "rel", "size", "buttonRef", "isSelected", "isLoading"],
|
|
22
|
+
_excluded2 = ["ref"];
|
|
21
23
|
/*
|
|
22
24
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
25
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -36,6 +38,8 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
36
38
|
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
37
39
|
_isDisabled = _ref.isDisabled,
|
|
38
40
|
disabled = _ref.disabled,
|
|
41
|
+
_ref$hasAriaDisabled = _ref.hasAriaDisabled,
|
|
42
|
+
hasAriaDisabled = _ref$hasAriaDisabled === void 0 ? false : _ref$hasAriaDisabled,
|
|
39
43
|
href = _ref.href,
|
|
40
44
|
_ref$type = _ref.type,
|
|
41
45
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
@@ -54,6 +58,14 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
54
58
|
href: href,
|
|
55
59
|
isLoading: isLoading
|
|
56
60
|
});
|
|
61
|
+
var _useEuiDisabledElemen = (0, _useEuiDisabledElement.useEuiDisabledElement)({
|
|
62
|
+
isDisabled: isDisabled,
|
|
63
|
+
hasAriaDisabled: hasAriaDisabled,
|
|
64
|
+
onKeyDown: rest.onKeyDown
|
|
65
|
+
}),
|
|
66
|
+
disabledRef = _useEuiDisabledElemen.ref,
|
|
67
|
+
disabledButtonProps = (0, _objectWithoutProperties2.default)(_useEuiDisabledElemen, _excluded2);
|
|
68
|
+
var setCombinedRef = (0, _services.useCombinedRefs)([disabledRef, buttonRef]);
|
|
57
69
|
var ariaHidden = rest['aria-hidden'];
|
|
58
70
|
var isAriaHidden = ariaHidden === 'true' || ariaHidden === true;
|
|
59
71
|
if (!rest['aria-label'] && !rest['aria-labelledby'] && !isAriaHidden) {
|
|
@@ -113,7 +125,7 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
113
125
|
href: href,
|
|
114
126
|
target: target,
|
|
115
127
|
rel: secureRel,
|
|
116
|
-
ref:
|
|
128
|
+
ref: setCombinedRef
|
|
117
129
|
}, rest), buttonIcon);
|
|
118
130
|
}
|
|
119
131
|
var buttonType;
|
|
@@ -124,8 +136,8 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
124
136
|
className: classes,
|
|
125
137
|
"aria-pressed": isSelected,
|
|
126
138
|
type: type,
|
|
127
|
-
ref:
|
|
128
|
-
}, rest), buttonIcon);
|
|
139
|
+
ref: setCombinedRef
|
|
140
|
+
}, rest, disabledButtonProps), buttonIcon);
|
|
129
141
|
};
|
|
130
142
|
EuiButtonIcon.propTypes = {
|
|
131
143
|
type: _propTypes.default.any,
|
|
@@ -145,7 +157,6 @@ EuiButtonIcon.propTypes = {
|
|
|
145
157
|
color: _propTypes.default.any,
|
|
146
158
|
"aria-label": _propTypes.default.string,
|
|
147
159
|
"aria-labelledby": _propTypes.default.string,
|
|
148
|
-
isDisabled: _propTypes.default.bool,
|
|
149
160
|
/**
|
|
150
161
|
* Overall size of button.
|
|
151
162
|
* Matches the sizes of other EuiButtons
|
|
@@ -192,5 +203,18 @@ EuiButtonIcon.propTypes = {
|
|
|
192
203
|
className: _propTypes.default.string,
|
|
193
204
|
"data-test-subj": _propTypes.default.string,
|
|
194
205
|
css: _propTypes.default.any,
|
|
206
|
+
/**
|
|
207
|
+
* Controls the disabled behavior via the native `disabled` attribute.
|
|
208
|
+
*/
|
|
209
|
+
isDisabled: _propTypes.default.bool,
|
|
210
|
+
/**
|
|
211
|
+
* NOTE: Beta feature, may be changed or removed in the future
|
|
212
|
+
*
|
|
213
|
+
* Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
|
|
214
|
+
* This results in a semantically disabled button without the default browser handling of the disabled state.
|
|
215
|
+
*
|
|
216
|
+
* Use e.g. when a disabled button should have a tooltip.
|
|
217
|
+
*/
|
|
218
|
+
hasAriaDisabled: _propTypes.default.bool,
|
|
195
219
|
buttonRef: _propTypes.default.any
|
|
196
220
|
};
|