@elastic/eui 119.0.0 → 119.1.0-snapshot.1787665877015
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui-icons.json +90 -87
- package/dist/svgs/cloud_bolt.svg +4 -0
- package/dist/svgs/cloud_rain.svg +4 -0
- package/dist/svgs/cloud_sun.svg +4 -0
- package/dist/svgs/cube.svg +3 -0
- package/dist/svgs/cursor_default.svg +3 -0
- package/dist/svgs/kubernetes_namespace.svg +4 -0
- package/dist/svgs/log_in.svg +4 -0
- package/dist/svgs/memory.svg +1 -10
- package/dist/svgs/product_timelion.svg +3 -0
- package/dist/svgs/product_tsvb.svg +5 -0
- package/dist/svgs/push.svg +4 -0
- package/dist/svgs/route_split.svg +3 -0
- package/dist/svgs/transition_right_in.svg +4 -0
- package/dist/svgs/transition_right_out.svg +4 -0
- package/dist/svgs/wrench.svg +1 -1
- package/es/components/avatar/avatar.js +1 -1
- package/es/components/badge/badge.js +1 -1
- package/es/components/badge/beta_badge/beta_badge.js +1 -1
- package/es/components/basic_table/basic_table.js +4 -4
- package/es/components/basic_table/in_memory_table.js +4 -4
- package/es/components/button/button.js +20 -6
- package/es/components/button/button_display/_button_display_content.js +1 -1
- package/es/components/button/button_empty/button_empty.js +1 -1
- package/es/components/button/button_group/button_group.js +180 -20
- package/es/components/button/button_group/button_group.styles.js +61 -9
- package/es/components/button/button_group/use_button_group_selection.js +30 -0
- package/es/components/button/button_icon/button_icon.js +21 -8
- package/es/components/button/split_button/split_button.js +39 -16
- package/es/components/button/split_button/split_button.styles.js +28 -32
- package/es/components/button/split_button/split_button_actions.js +16 -5
- package/es/components/button/use_button_common_props.js +18 -5
- package/es/components/call_out/call_out.js +2 -2
- package/es/components/card/card.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/es/components/comment_list/comment.js +2 -2
- package/es/components/comment_list/comment_event.js +1 -1
- package/es/components/comment_list/comment_list.js +2 -2
- package/es/components/comment_list/comment_timeline.js +1 -1
- package/es/components/context_menu/context_menu_item.js +1 -1
- package/es/components/datagrid/body/cell/data_grid_cell.js +27 -27
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
- package/es/components/datagrid/body/data_grid_body.js +13 -13
- package/es/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/es/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/es/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
- package/es/components/datagrid/body/header/column_actions.js +3 -1
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
- package/es/components/datagrid/body/header/data_grid_header_cell.js +17 -13
- package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +9 -3
- package/es/components/datagrid/body/header/data_grid_header_row.js +6 -0
- package/es/components/datagrid/controls/column_sorting.js +13 -13
- package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/es/components/datagrid/utils/in_memory.js +12 -12
- package/es/components/datagrid/utils/last_copy_column.js +11 -0
- package/es/components/date_picker/date_picker.js +2 -2
- package/es/components/date_picker/date_picker_range.js +1 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +224 -253
- package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/flyout/flyout_menu/flyout_menu.js +39 -14
- package/es/components/form/field_number/field_number.js +2 -2
- package/es/components/form/field_text/field_text.js +2 -2
- package/es/components/form/file_picker/file_picker.js +187 -224
- package/es/components/form/file_picker/file_picker.styles.js +1 -1
- package/es/components/form/form_control_button/form_control_button.js +1 -1
- package/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout.js +2 -2
- package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/es/components/form/text_area/text_area.js +2 -2
- package/es/components/header/header_links/header_link.js +1 -1
- package/es/components/header/header_links/header_links.js +1 -1
- package/es/components/header/header_logo/header_logo.js +1 -1
- package/es/components/header/header_section/header_section_item_button.js +1 -1
- package/es/components/icon/assets/{cloud_stormy.js → cloud_bolt.js} +5 -3
- package/es/components/icon/assets/{cloud_sunny.js → cloud_rain.js} +5 -3
- package/es/components/icon/assets/cloud_sun.js +33 -0
- package/es/components/icon/assets/{kubernetes_pod.js → cube.js} +3 -3
- package/es/components/icon/assets/cursor_default.js +35 -0
- package/es/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
- package/es/components/icon/assets/{kql_function.js → log_in.js} +5 -3
- package/es/components/icon/assets/memory.js +1 -3
- package/es/components/icon/assets/product_timelion.js +33 -0
- package/es/components/icon/assets/product_tsvb.js +37 -0
- package/es/components/icon/assets/{namespace.js → push.js} +3 -6
- package/es/components/icon/assets/route_split.js +33 -0
- package/es/components/icon/assets/transition_right_in.js +35 -0
- package/es/components/icon/assets/transition_right_out.js +35 -0
- package/es/components/icon/assets/wrench.js +1 -3
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon/icon_glyphs.a11y.js +1 -1
- package/es/components/icon/icon_map.js +96 -18
- package/es/components/icon/svgs/cloud_bolt.svg +4 -0
- package/es/components/icon/svgs/cloud_rain.svg +4 -0
- package/es/components/icon/svgs/cloud_sun.svg +4 -0
- package/es/components/icon/svgs/cube.svg +3 -0
- package/es/components/icon/svgs/cursor_default.svg +3 -0
- package/es/components/icon/svgs/kubernetes_namespace.svg +4 -0
- package/es/components/icon/svgs/log_in.svg +4 -0
- package/es/components/icon/svgs/memory.svg +1 -10
- package/es/components/icon/svgs/product_timelion.svg +3 -0
- package/es/components/icon/svgs/product_tsvb.svg +5 -0
- package/es/components/icon/svgs/push.svg +4 -0
- package/es/components/icon/svgs/route_split.svg +3 -0
- package/es/components/icon/svgs/transition_right_in.svg +4 -0
- package/es/components/icon/svgs/transition_right_out.svg +4 -0
- package/es/components/icon/svgs/wrench.svg +1 -1
- package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/es/components/list_group/list_group.js +2 -2
- package/es/components/list_group/list_group_item.js +2 -2
- package/es/components/list_group/list_group_item_extra_action.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/es/components/loading/loading_logo.js +1 -1
- package/es/components/markdown_editor/markdown_editor.js +1 -1
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/pagination/pagination_button.js +1 -1
- package/es/components/resizable_container/resizable_collapse_button.js +4 -4
- package/es/components/selectable/selectable_list/selectable_list.js +1 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/timeline/timeline_item_icon.js +1 -1
- package/es/components/toast/global_toast_list.js +2 -2
- package/es/components/toast/toast.js +2 -2
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/global_styling/mixins/_button.js +6 -0
- package/es/services/accessibility/html_id_generator.js +26 -1
- package/eui.d.ts +425 -417
- package/i18ntokens.json +2678 -2660
- package/lib/components/avatar/avatar.js +1 -1
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/badge/beta_badge/beta_badge.js +1 -1
- package/lib/components/basic_table/basic_table.js +4 -4
- package/lib/components/basic_table/in_memory_table.js +4 -4
- package/lib/components/button/button.js +20 -6
- package/lib/components/button/button_display/_button_display_content.js +1 -1
- package/lib/components/button/button_empty/button_empty.js +1 -1
- package/lib/components/button/button_group/button_group.js +179 -21
- package/lib/components/button/button_group/button_group.styles.js +60 -8
- package/lib/components/button/button_group/use_button_group_selection.js +36 -0
- package/lib/components/button/button_icon/button_icon.js +21 -8
- package/lib/components/button/split_button/split_button.js +37 -15
- package/lib/components/button/split_button/split_button.styles.js +29 -31
- package/lib/components/button/split_button/split_button_actions.js +15 -4
- package/lib/components/button/use_button_common_props.js +18 -5
- package/lib/components/call_out/call_out.js +2 -2
- package/lib/components/card/card.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/lib/components/comment_list/comment.js +2 -2
- package/lib/components/comment_list/comment_event.js +1 -1
- package/lib/components/comment_list/comment_list.js +2 -2
- package/lib/components/comment_list/comment_timeline.js +1 -1
- package/lib/components/context_menu/context_menu_item.js +1 -1
- package/lib/components/datagrid/body/cell/data_grid_cell.js +27 -27
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
- package/lib/components/datagrid/body/data_grid_body.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
- package/lib/components/datagrid/body/header/column_actions.js +3 -1
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +17 -13
- package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +9 -3
- package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -0
- package/lib/components/datagrid/controls/column_sorting.js +13 -13
- package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/lib/components/datagrid/utils/in_memory.js +12 -12
- package/lib/components/datagrid/utils/last_copy_column.js +17 -0
- package/lib/components/date_picker/date_picker.js +2 -2
- package/lib/components/date_picker/date_picker_range.js +1 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +224 -253
- package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/flyout/flyout_menu/flyout_menu.js +39 -14
- package/lib/components/form/field_number/field_number.js +2 -2
- package/lib/components/form/field_text/field_text.js +2 -2
- package/lib/components/form/file_picker/file_picker.js +193 -227
- package/lib/components/form/file_picker/file_picker.styles.js +1 -1
- package/lib/components/form/form_control_button/form_control_button.js +1 -1
- package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
- package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/lib/components/form/text_area/text_area.js +2 -2
- package/lib/components/header/header_links/header_link.js +1 -1
- package/lib/components/header/header_links/header_links.js +1 -1
- package/lib/components/header/header_logo/header_logo.js +1 -1
- package/lib/components/header/header_section/header_section_item_button.js +1 -1
- package/lib/components/icon/assets/{cloud_stormy.js → cloud_bolt.js} +5 -3
- package/lib/components/icon/assets/{cloud_sunny.js → cloud_rain.js} +5 -3
- package/lib/components/icon/assets/cloud_sun.js +40 -0
- package/lib/components/icon/assets/{kubernetes_pod.js → cube.js} +3 -3
- package/lib/components/icon/assets/cursor_default.js +42 -0
- package/lib/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
- package/lib/components/icon/assets/{kql_function.js → log_in.js} +5 -3
- package/lib/components/icon/assets/memory.js +1 -3
- package/lib/components/icon/assets/product_timelion.js +40 -0
- package/lib/components/icon/assets/product_tsvb.js +44 -0
- package/lib/components/icon/assets/{namespace.js → push.js} +3 -6
- package/lib/components/icon/assets/route_split.js +40 -0
- package/lib/components/icon/assets/transition_right_in.js +42 -0
- package/lib/components/icon/assets/transition_right_out.js +42 -0
- package/lib/components/icon/assets/wrench.js +1 -3
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon_glyphs.a11y.js +1 -1
- package/lib/components/icon/icon_map.js +120 -18
- package/lib/components/icon/svgs/cloud_bolt.svg +4 -0
- package/lib/components/icon/svgs/cloud_rain.svg +4 -0
- package/lib/components/icon/svgs/cloud_sun.svg +4 -0
- package/lib/components/icon/svgs/cube.svg +3 -0
- package/lib/components/icon/svgs/cursor_default.svg +3 -0
- package/lib/components/icon/svgs/kubernetes_namespace.svg +4 -0
- package/lib/components/icon/svgs/log_in.svg +4 -0
- package/lib/components/icon/svgs/memory.svg +1 -10
- package/lib/components/icon/svgs/product_timelion.svg +3 -0
- package/lib/components/icon/svgs/product_tsvb.svg +5 -0
- package/lib/components/icon/svgs/push.svg +4 -0
- package/lib/components/icon/svgs/route_split.svg +3 -0
- package/lib/components/icon/svgs/transition_right_in.svg +4 -0
- package/lib/components/icon/svgs/transition_right_out.svg +4 -0
- package/lib/components/icon/svgs/wrench.svg +1 -1
- package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/lib/components/list_group/list_group.js +2 -2
- package/lib/components/list_group/list_group_item.js +2 -2
- package/lib/components/list_group/list_group_item_extra_action.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/lib/components/loading/loading_logo.js +1 -1
- package/lib/components/markdown_editor/markdown_editor.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/pagination/pagination_button.js +1 -1
- package/lib/components/resizable_container/resizable_collapse_button.js +4 -4
- package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/timeline/timeline_item_icon.js +1 -1
- package/lib/components/toast/global_toast_list.js +2 -2
- package/lib/components/toast/toast.js +2 -2
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/global_styling/mixins/_button.js +6 -0
- package/lib/services/accessibility/html_id_generator.js +26 -1
- package/optimize/es/components/button/button.js +20 -6
- package/optimize/es/components/button/button_group/button_group.js +89 -10
- package/optimize/es/components/button/button_group/button_group.styles.js +61 -9
- package/optimize/es/components/button/button_group/use_button_group_selection.js +30 -0
- package/optimize/es/components/button/button_icon/button_icon.js +20 -7
- package/optimize/es/components/button/split_button/split_button.js +36 -16
- package/optimize/es/components/button/split_button/split_button.styles.js +28 -32
- package/optimize/es/components/button/split_button/split_button_actions.js +16 -5
- package/optimize/es/components/button/use_button_common_props.js +18 -5
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +3 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
- package/optimize/es/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
- package/optimize/es/components/datagrid/body/header/column_actions.js +3 -1
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -0
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +6 -0
- package/optimize/es/components/datagrid/utils/last_copy_column.js +11 -0
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +220 -225
- package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/optimize/es/components/flyout/flyout_menu/flyout_menu.js +32 -9
- package/optimize/es/components/form/file_picker/file_picker.js +182 -216
- package/optimize/es/components/form/file_picker/file_picker.styles.js +1 -1
- package/optimize/es/components/icon/assets/{cloud_stormy.js → cloud_bolt.js} +5 -3
- package/optimize/es/components/icon/assets/{cloud_sunny.js → cloud_rain.js} +5 -3
- package/optimize/es/components/icon/assets/cloud_sun.js +32 -0
- package/optimize/es/components/icon/assets/{kubernetes_pod.js → cube.js} +3 -3
- package/optimize/es/components/icon/assets/cursor_default.js +34 -0
- package/optimize/es/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
- package/optimize/es/components/icon/assets/{kql_function.js → log_in.js} +5 -3
- package/optimize/es/components/icon/assets/memory.js +1 -3
- package/optimize/es/components/icon/assets/product_timelion.js +32 -0
- package/optimize/es/components/icon/assets/product_tsvb.js +36 -0
- package/optimize/es/components/icon/assets/{namespace.js → push.js} +3 -6
- package/optimize/es/components/icon/assets/route_split.js +32 -0
- package/optimize/es/components/icon/assets/transition_right_in.js +34 -0
- package/optimize/es/components/icon/assets/transition_right_out.js +34 -0
- package/optimize/es/components/icon/assets/wrench.js +1 -3
- package/optimize/es/components/icon/icon_glyphs.a11y.js +1 -1
- package/optimize/es/components/icon/icon_map.js +96 -18
- package/optimize/es/components/icon/svgs/cloud_bolt.svg +4 -0
- package/optimize/es/components/icon/svgs/cloud_rain.svg +4 -0
- package/optimize/es/components/icon/svgs/cloud_sun.svg +4 -0
- package/optimize/es/components/icon/svgs/cube.svg +3 -0
- package/optimize/es/components/icon/svgs/cursor_default.svg +3 -0
- package/optimize/es/components/icon/svgs/kubernetes_namespace.svg +4 -0
- package/optimize/es/components/icon/svgs/log_in.svg +4 -0
- package/optimize/es/components/icon/svgs/memory.svg +1 -10
- package/optimize/es/components/icon/svgs/product_timelion.svg +3 -0
- package/optimize/es/components/icon/svgs/product_tsvb.svg +5 -0
- package/optimize/es/components/icon/svgs/push.svg +4 -0
- package/optimize/es/components/icon/svgs/route_split.svg +3 -0
- package/optimize/es/components/icon/svgs/transition_right_in.svg +4 -0
- package/optimize/es/components/icon/svgs/transition_right_out.svg +4 -0
- package/optimize/es/components/icon/svgs/wrench.svg +1 -1
- package/optimize/es/components/resizable_container/resizable_collapse_button.js +4 -4
- package/optimize/es/global_styling/mixins/_button.js +6 -0
- package/optimize/es/services/accessibility/html_id_generator.js +26 -1
- package/optimize/lib/components/button/button.js +20 -6
- package/optimize/lib/components/button/button_group/button_group.js +89 -11
- package/optimize/lib/components/button/button_group/button_group.styles.js +60 -8
- package/optimize/lib/components/button/button_group/use_button_group_selection.js +36 -0
- package/optimize/lib/components/button/button_icon/button_icon.js +20 -7
- package/optimize/lib/components/button/split_button/split_button.js +35 -15
- package/optimize/lib/components/button/split_button/split_button.styles.js +29 -31
- package/optimize/lib/components/button/split_button/split_button_actions.js +15 -4
- package/optimize/lib/components/button/use_button_common_props.js +18 -5
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +3 -3
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
- package/optimize/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
- package/optimize/lib/components/datagrid/body/header/column_actions.js +3 -1
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -0
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -3
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +6 -0
- package/optimize/lib/components/datagrid/utils/last_copy_column.js +17 -0
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +219 -224
- package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/optimize/lib/components/flyout/flyout_menu/flyout_menu.js +32 -9
- package/optimize/lib/components/form/file_picker/file_picker.js +183 -215
- package/optimize/lib/components/form/file_picker/file_picker.styles.js +1 -1
- package/optimize/lib/components/icon/assets/{kubernetes_pod.js → cloud_bolt.js} +5 -3
- package/optimize/lib/components/icon/assets/{cloud_stormy.js → cloud_rain.js} +5 -3
- package/optimize/lib/components/icon/assets/cloud_sun.js +40 -0
- package/optimize/lib/components/icon/assets/cube.js +40 -0
- package/{test-env/components/icon/assets/kubernetes_pod.js → optimize/lib/components/icon/assets/cursor_default.js} +5 -3
- package/optimize/lib/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
- package/{test-env/components/icon/assets/kql_function.js → optimize/lib/components/icon/assets/log_in.js} +5 -3
- package/optimize/lib/components/icon/assets/memory.js +1 -3
- package/optimize/lib/components/icon/assets/product_timelion.js +40 -0
- package/optimize/lib/components/icon/assets/product_tsvb.js +44 -0
- package/{test-env/components/icon/assets/namespace.js → optimize/lib/components/icon/assets/push.js} +3 -6
- package/optimize/lib/components/icon/assets/route_split.js +40 -0
- package/optimize/lib/components/icon/assets/transition_right_in.js +42 -0
- package/optimize/lib/components/icon/assets/transition_right_out.js +42 -0
- package/optimize/lib/components/icon/assets/wrench.js +1 -3
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +1 -1
- package/optimize/lib/components/icon/icon_map.js +120 -18
- package/optimize/lib/components/icon/svgs/cloud_bolt.svg +4 -0
- package/optimize/lib/components/icon/svgs/cloud_rain.svg +4 -0
- package/optimize/lib/components/icon/svgs/cloud_sun.svg +4 -0
- package/optimize/lib/components/icon/svgs/cube.svg +3 -0
- package/optimize/lib/components/icon/svgs/cursor_default.svg +3 -0
- package/optimize/lib/components/icon/svgs/kubernetes_namespace.svg +4 -0
- package/optimize/lib/components/icon/svgs/log_in.svg +4 -0
- package/optimize/lib/components/icon/svgs/memory.svg +1 -10
- package/optimize/lib/components/icon/svgs/product_timelion.svg +3 -0
- package/optimize/lib/components/icon/svgs/product_tsvb.svg +5 -0
- package/optimize/lib/components/icon/svgs/push.svg +4 -0
- package/optimize/lib/components/icon/svgs/route_split.svg +3 -0
- package/optimize/lib/components/icon/svgs/transition_right_in.svg +4 -0
- package/optimize/lib/components/icon/svgs/transition_right_out.svg +4 -0
- package/optimize/lib/components/icon/svgs/wrench.svg +1 -1
- package/optimize/lib/components/resizable_container/resizable_collapse_button.js +4 -4
- package/optimize/lib/global_styling/mixins/_button.js +6 -0
- package/optimize/lib/services/accessibility/html_id_generator.js +26 -1
- package/package.json +18 -23
- package/test-env/components/avatar/avatar.js +1 -1
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
- package/test-env/components/basic_table/basic_table.js +4 -4
- package/test-env/components/basic_table/in_memory_table.js +4 -4
- package/test-env/components/button/button.js +20 -6
- package/test-env/components/button/button_display/_button_display_content.js +1 -1
- package/test-env/components/button/button_empty/button_empty.js +1 -1
- package/test-env/components/button/button_group/button_group.js +177 -21
- package/test-env/components/button/button_group/button_group.styles.js +60 -8
- package/test-env/components/button/button_group/use_button_group_selection.js +36 -0
- package/test-env/components/button/button_icon/button_icon.js +21 -8
- package/test-env/components/button/split_button/split_button.js +35 -15
- package/test-env/components/button/split_button/split_button.styles.js +29 -31
- package/test-env/components/button/split_button/split_button_actions.js +15 -4
- package/test-env/components/button/use_button_common_props.js +18 -5
- package/test-env/components/call_out/call_out.js +2 -2
- package/test-env/components/card/card.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
- package/test-env/components/comment_list/comment.js +2 -2
- package/test-env/components/comment_list/comment_event.js +1 -1
- package/test-env/components/comment_list/comment_list.js +2 -2
- package/test-env/components/comment_list/comment_timeline.js +1 -1
- package/test-env/components/context_menu/context_menu_item.js +1 -1
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +27 -27
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
- package/test-env/components/datagrid/body/data_grid_body.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_custom.js +13 -13
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +13 -13
- package/test-env/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
- package/test-env/components/datagrid/body/header/column_actions.js +3 -1
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +17 -13
- package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +9 -3
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -0
- package/test-env/components/datagrid/controls/column_sorting.js +13 -13
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
- package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
- package/test-env/components/datagrid/utils/in_memory.js +12 -12
- package/test-env/components/datagrid/utils/last_copy_column.js +17 -0
- package/test-env/components/date_picker/date_picker.js +2 -2
- package/test-env/components/date_picker/date_picker_range.js +1 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +218 -249
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/flyout/flyout_menu/flyout_menu.js +39 -14
- package/test-env/components/form/field_number/field_number.js +2 -2
- package/test-env/components/form/field_text/field_text.js +2 -2
- package/test-env/components/form/file_picker/file_picker.js +184 -216
- package/test-env/components/form/file_picker/file_picker.styles.js +1 -1
- package/test-env/components/form/form_control_button/form_control_button.js +1 -1
- package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
- package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
- package/test-env/components/form/text_area/text_area.js +2 -2
- package/test-env/components/header/header_links/header_link.js +1 -1
- package/test-env/components/header/header_links/header_links.js +1 -1
- package/test-env/components/header/header_logo/header_logo.js +1 -1
- package/test-env/components/header/header_section/header_section_item_button.js +1 -1
- package/test-env/components/icon/assets/cloud_bolt.js +42 -0
- package/{optimize/lib/components/icon/assets/cloud_sunny.js → test-env/components/icon/assets/cloud_rain.js} +5 -3
- package/test-env/components/icon/assets/cloud_sun.js +40 -0
- package/test-env/components/icon/assets/cube.js +40 -0
- package/test-env/components/icon/assets/cursor_default.js +42 -0
- package/test-env/components/icon/assets/kubernetes_namespace.js +42 -0
- package/{optimize/lib/components/icon/assets/kql_function.js → test-env/components/icon/assets/log_in.js} +5 -3
- package/test-env/components/icon/assets/memory.js +1 -3
- package/test-env/components/icon/assets/product_timelion.js +40 -0
- package/test-env/components/icon/assets/product_tsvb.js +44 -0
- package/{optimize/lib/components/icon/assets/namespace.js → test-env/components/icon/assets/push.js} +3 -6
- package/test-env/components/icon/assets/route_split.js +40 -0
- package/test-env/components/icon/assets/transition_right_in.js +42 -0
- package/test-env/components/icon/assets/transition_right_out.js +42 -0
- package/test-env/components/icon/assets/wrench.js +1 -3
- package/test-env/components/icon/icon_glyphs.a11y.js +1 -1
- package/test-env/components/icon/icon_map.js +120 -18
- package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
- package/test-env/components/list_group/list_group.js +2 -2
- package/test-env/components/list_group/list_group_item.js +2 -2
- package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
- package/test-env/components/loading/loading_logo.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/pagination/pagination_button.js +1 -1
- package/test-env/components/resizable_container/resizable_collapse_button.js +4 -4
- package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/timeline/timeline_item_icon.js +1 -1
- package/test-env/components/toast/global_toast_list.js +2 -2
- package/test-env/components/toast/toast.js +2 -2
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/global_styling/mixins/_button.js +6 -0
- package/test-env/services/accessibility/html_id_generator.js +11 -0
- package/dist/svgs/cloud_drizzle.svg +0 -3
- package/dist/svgs/cloud_stormy.svg +0 -3
- package/dist/svgs/cloud_sunny.svg +0 -3
- package/dist/svgs/kql_function.svg +0 -5
- package/dist/svgs/kubernetes_pod.svg +0 -3
- package/dist/svgs/menu_down.svg +0 -3
- package/dist/svgs/menu_up.svg +0 -3
- package/dist/svgs/namespace.svg +0 -3
- package/dist/svgs/vis_timelion.svg +0 -3
- package/dist/svgs/vis_visual_builder.svg +0 -3
- package/es/components/icon/assets/menu_down.js +0 -33
- package/es/components/icon/assets/menu_up.js +0 -33
- package/es/components/icon/assets/vis_timelion.js +0 -33
- package/es/components/icon/assets/vis_visual_builder.js +0 -33
- package/es/components/icon/svgs/cloud_drizzle.svg +0 -3
- package/es/components/icon/svgs/cloud_stormy.svg +0 -3
- package/es/components/icon/svgs/cloud_sunny.svg +0 -3
- package/es/components/icon/svgs/kql_function.svg +0 -5
- package/es/components/icon/svgs/kubernetes_pod.svg +0 -3
- package/es/components/icon/svgs/menu_down.svg +0 -3
- package/es/components/icon/svgs/menu_up.svg +0 -3
- package/es/components/icon/svgs/namespace.svg +0 -3
- package/es/components/icon/svgs/vis_timelion.svg +0 -3
- package/es/components/icon/svgs/vis_visual_builder.svg +0 -3
- package/lib/components/icon/assets/menu_down.js +0 -40
- package/lib/components/icon/assets/menu_up.js +0 -40
- package/lib/components/icon/assets/vis_timelion.js +0 -40
- package/lib/components/icon/assets/vis_visual_builder.js +0 -40
- package/lib/components/icon/svgs/cloud_drizzle.svg +0 -3
- package/lib/components/icon/svgs/cloud_stormy.svg +0 -3
- package/lib/components/icon/svgs/cloud_sunny.svg +0 -3
- package/lib/components/icon/svgs/kql_function.svg +0 -5
- package/lib/components/icon/svgs/kubernetes_pod.svg +0 -3
- package/lib/components/icon/svgs/menu_down.svg +0 -3
- package/lib/components/icon/svgs/menu_up.svg +0 -3
- package/lib/components/icon/svgs/namespace.svg +0 -3
- package/lib/components/icon/svgs/vis_timelion.svg +0 -3
- package/lib/components/icon/svgs/vis_visual_builder.svg +0 -3
- package/optimize/es/components/icon/assets/menu_down.js +0 -32
- package/optimize/es/components/icon/assets/menu_up.js +0 -32
- package/optimize/es/components/icon/assets/vis_timelion.js +0 -32
- package/optimize/es/components/icon/assets/vis_visual_builder.js +0 -32
- package/optimize/es/components/icon/svgs/cloud_drizzle.svg +0 -3
- package/optimize/es/components/icon/svgs/cloud_stormy.svg +0 -3
- package/optimize/es/components/icon/svgs/cloud_sunny.svg +0 -3
- package/optimize/es/components/icon/svgs/kql_function.svg +0 -5
- package/optimize/es/components/icon/svgs/kubernetes_pod.svg +0 -3
- package/optimize/es/components/icon/svgs/menu_down.svg +0 -3
- package/optimize/es/components/icon/svgs/menu_up.svg +0 -3
- package/optimize/es/components/icon/svgs/namespace.svg +0 -3
- package/optimize/es/components/icon/svgs/vis_timelion.svg +0 -3
- package/optimize/es/components/icon/svgs/vis_visual_builder.svg +0 -3
- package/optimize/lib/components/icon/assets/menu_down.js +0 -40
- package/optimize/lib/components/icon/assets/menu_up.js +0 -40
- package/optimize/lib/components/icon/assets/vis_timelion.js +0 -40
- package/optimize/lib/components/icon/assets/vis_visual_builder.js +0 -40
- package/optimize/lib/components/icon/svgs/cloud_drizzle.svg +0 -3
- package/optimize/lib/components/icon/svgs/cloud_stormy.svg +0 -3
- package/optimize/lib/components/icon/svgs/cloud_sunny.svg +0 -3
- package/optimize/lib/components/icon/svgs/kql_function.svg +0 -5
- package/optimize/lib/components/icon/svgs/kubernetes_pod.svg +0 -3
- package/optimize/lib/components/icon/svgs/menu_down.svg +0 -3
- package/optimize/lib/components/icon/svgs/menu_up.svg +0 -3
- package/optimize/lib/components/icon/svgs/namespace.svg +0 -3
- package/optimize/lib/components/icon/svgs/vis_timelion.svg +0 -3
- package/optimize/lib/components/icon/svgs/vis_visual_builder.svg +0 -3
- package/test-env/components/icon/assets/cloud_drizzle.js +0 -40
- package/test-env/components/icon/assets/cloud_stormy.js +0 -40
- package/test-env/components/icon/assets/cloud_sunny.js +0 -40
- package/test-env/components/icon/assets/menu_down.js +0 -40
- package/test-env/components/icon/assets/menu_up.js +0 -40
- package/test-env/components/icon/assets/vis_timelion.js +0 -40
- package/test-env/components/icon/assets/vis_visual_builder.js +0 -40
|
@@ -38,12 +38,12 @@ export var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref
|
|
|
38
38
|
var NOT_COLLAPSED_ICON = '';
|
|
39
39
|
switch (externalPosition) {
|
|
40
40
|
case 'before':
|
|
41
|
-
COLLAPSED_ICON = isHorizontal ? '
|
|
42
|
-
NOT_COLLAPSED_ICON = isHorizontal ? '
|
|
41
|
+
COLLAPSED_ICON = isHorizontal ? 'transitionLeftOut' : 'transitionTopOut';
|
|
42
|
+
NOT_COLLAPSED_ICON = isHorizontal ? 'transitionLeftIn' : 'transitionTopIn';
|
|
43
43
|
break;
|
|
44
44
|
case 'after':
|
|
45
|
-
COLLAPSED_ICON = isHorizontal ? '
|
|
46
|
-
NOT_COLLAPSED_ICON = isHorizontal ? '
|
|
45
|
+
COLLAPSED_ICON = isHorizontal ? 'transitionRightOut' : 'transitionBottomOut';
|
|
46
|
+
NOT_COLLAPSED_ICON = isHorizontal ? 'transitionRightIn' : 'transitionBottomIn';
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
var classes = classNames('euiResizableCollapseButton', className);
|
|
@@ -198,6 +198,9 @@ var euiButtonFocusCSS = function euiButtonFocusCSS(_euiThemeContext) {
|
|
|
198
198
|
*/
|
|
199
199
|
export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
200
200
|
var euiTheme = euiThemeContext.euiTheme;
|
|
201
|
+
|
|
202
|
+
// TODO: replace with token once available
|
|
203
|
+
var radiusInset = '2px';
|
|
201
204
|
return {
|
|
202
205
|
xs: {
|
|
203
206
|
minWidth: euiTheme.base * 6,
|
|
@@ -206,6 +209,7 @@ export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
|
206
209
|
return x / 2;
|
|
207
210
|
}),
|
|
208
211
|
radius: euiTheme.border.radius.small,
|
|
212
|
+
radiusInset: radiusInset,
|
|
209
213
|
fontScale: 'xs'
|
|
210
214
|
},
|
|
211
215
|
s: {
|
|
@@ -213,6 +217,7 @@ export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
|
213
217
|
height: euiTheme.size.xl,
|
|
214
218
|
padding: euiTheme.size.s,
|
|
215
219
|
radius: euiTheme.border.radius.small,
|
|
220
|
+
radiusInset: radiusInset,
|
|
216
221
|
fontScale: 's'
|
|
217
222
|
},
|
|
218
223
|
m: {
|
|
@@ -220,6 +225,7 @@ export var euiButtonSizeMap = function euiButtonSizeMap(euiThemeContext) {
|
|
|
220
225
|
height: euiTheme.size.xxl,
|
|
221
226
|
padding: euiTheme.size.m,
|
|
222
227
|
radius: euiTheme.border.radius.small,
|
|
228
|
+
radiusInset: radiusInset,
|
|
223
229
|
fontScale: 's'
|
|
224
230
|
}
|
|
225
231
|
};
|
|
@@ -8,6 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { useMemo } from 'react';
|
|
10
10
|
import { v1 as uuidv1 } from 'uuid';
|
|
11
|
+
import { warnOnce } from '../console';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* IDs containing whitespace are invalid HTML, and silently break attributes
|
|
15
|
+
* that take a space-separated list of ID references (`aria-controls`,
|
|
16
|
+
* `aria-labelledby`, `aria-describedby`, `for`), as each "word" is then parsed
|
|
17
|
+
* as a separate reference to a non-existent element.
|
|
18
|
+
*
|
|
19
|
+
* This most commonly happens when a human-readable or localized string is
|
|
20
|
+
* passed as a prefix/suffix, so warn consumers as early as possible.
|
|
21
|
+
*/
|
|
22
|
+
var warnOnWhitespace = function warnOnWhitespace(value) {
|
|
23
|
+
if (process.env.NODE_ENV === 'production') return;
|
|
24
|
+
if (value && /\s/.test(value)) {
|
|
25
|
+
warnOnce("generatedHtmlIdWhitespace:".concat(value), "[EUI] Generated HTML ID: \"".concat(value, "\" contains whitespace, which generates an invalid HTML id ") + 'and breaks attributes referencing it, such as `aria-controls` or `for`. ' + 'Pass a static identifier instead of a human-readable or localized string.');
|
|
26
|
+
}
|
|
27
|
+
};
|
|
11
28
|
|
|
12
29
|
/**
|
|
13
30
|
* This function returns a function to generate ids.
|
|
@@ -19,8 +36,10 @@ import { v1 as uuidv1 } from 'uuid';
|
|
|
19
36
|
export function htmlIdGenerator() {
|
|
20
37
|
var idPrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
21
38
|
var staticUuid = uuidv1();
|
|
39
|
+
warnOnWhitespace(idPrefix);
|
|
22
40
|
return function () {
|
|
23
41
|
var idSuffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
42
|
+
warnOnWhitespace(idSuffix);
|
|
24
43
|
var prefix = "".concat(idPrefix).concat(idPrefix !== '' ? '_' : 'i');
|
|
25
44
|
var suffix = idSuffix ? "_".concat(idSuffix) : '';
|
|
26
45
|
return "".concat(prefix).concat(suffix ? staticUuid : uuidv1()).concat(suffix);
|
|
@@ -53,7 +72,13 @@ var useNewGeneratedHtmlId = function useNewGeneratedHtmlId() {
|
|
|
53
72
|
// to prevent React <18 import errors.
|
|
54
73
|
var id = React.useId();
|
|
55
74
|
return useMemo(function () {
|
|
56
|
-
|
|
75
|
+
if (conditionalId) return conditionalId;
|
|
76
|
+
|
|
77
|
+
// Memoized so that the check only runs when the prefix/suffix change,
|
|
78
|
+
// as this hook is called on virtually every EUI render
|
|
79
|
+
warnOnWhitespace(prefix);
|
|
80
|
+
warnOnWhitespace(suffix);
|
|
81
|
+
return "".concat(prefix).concat(id).concat(suffix);
|
|
57
82
|
}, [id, conditionalId, prefix, suffix]);
|
|
58
83
|
};
|
|
59
84
|
export var useGeneratedHtmlId = 'useId' in React ? useNewGeneratedHtmlId : useDeprecatedGeneratedHtmlId;
|
|
@@ -13,7 +13,7 @@ var _button = require("../../global_styling/mixins/_button");
|
|
|
13
13
|
var _button_display = require("./button_display/_button_display");
|
|
14
14
|
var _use_button_common_props = require("./use_button_common_props");
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["className", "buttonRef", "size", "color", "fill", "isDisabled", "hasAriaDisabled", "fullWidth"];
|
|
16
|
+
var _excluded = ["className", "buttonRef", "size", "color", "fill", "isDisabled", "hasAriaDisabled", "fullWidth", "id", "onClick", "isSelected"];
|
|
17
17
|
/*
|
|
18
18
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
19
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -38,10 +38,13 @@ var EuiButton = exports.EuiButton = function EuiButton(_ref) {
|
|
|
38
38
|
_size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
39
39
|
_ref$color = _ref.color,
|
|
40
40
|
_color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
41
|
-
|
|
41
|
+
_fill = _ref.fill,
|
|
42
42
|
_isDisabled = _ref.isDisabled,
|
|
43
43
|
_hasAriaDisabled = _ref.hasAriaDisabled,
|
|
44
44
|
_fullWidth = _ref.fullWidth,
|
|
45
|
+
id = _ref.id,
|
|
46
|
+
_onClick = _ref.onClick,
|
|
47
|
+
_isSelected = _ref.isSelected,
|
|
45
48
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
49
|
var _useEuiButtonCommonPr = (0, _use_button_common_props.useEuiButtonCommonProps)({
|
|
47
50
|
size: _size,
|
|
@@ -49,15 +52,22 @@ var EuiButton = exports.EuiButton = function EuiButton(_ref) {
|
|
|
49
52
|
isDisabled: _isDisabled,
|
|
50
53
|
hasAriaDisabled: _hasAriaDisabled,
|
|
51
54
|
fullWidth: _fullWidth,
|
|
55
|
+
fill: _fill,
|
|
56
|
+
isSelected: _isSelected,
|
|
52
57
|
href: rest.href,
|
|
53
58
|
disabled: rest.disabled,
|
|
54
|
-
isLoading: rest.isLoading
|
|
59
|
+
isLoading: rest.isLoading,
|
|
60
|
+
id: id,
|
|
61
|
+
onClick: _onClick
|
|
55
62
|
}),
|
|
56
63
|
size = _useEuiButtonCommonPr.size,
|
|
57
64
|
color = _useEuiButtonCommonPr.color,
|
|
58
65
|
isDisabled = _useEuiButtonCommonPr.isDisabled,
|
|
59
66
|
hasAriaDisabled = _useEuiButtonCommonPr.hasAriaDisabled,
|
|
60
|
-
fullWidth = _useEuiButtonCommonPr.fullWidth
|
|
67
|
+
fullWidth = _useEuiButtonCommonPr.fullWidth,
|
|
68
|
+
fill = _useEuiButtonCommonPr.fill,
|
|
69
|
+
isSelected = _useEuiButtonCommonPr.isSelected,
|
|
70
|
+
onClick = _useEuiButtonCommonPr.onClick;
|
|
61
71
|
var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
|
|
62
72
|
display: fill ? 'fill' : 'base'
|
|
63
73
|
})[isDisabled ? 'disabled' : color];
|
|
@@ -65,13 +75,17 @@ var EuiButton = exports.EuiButton = function EuiButton(_ref) {
|
|
|
65
75
|
var classes = (0, _classnames.default)('euiButton', className);
|
|
66
76
|
var cssStyles = [buttonColorStyles, buttonFocusStyle];
|
|
67
77
|
return (0, _react2.jsx)(_button_display.EuiButtonDisplay, (0, _extends2.default)({
|
|
78
|
+
ref: buttonRef,
|
|
68
79
|
className: classes,
|
|
69
80
|
css: cssStyles,
|
|
70
|
-
ref: buttonRef,
|
|
71
81
|
size: size,
|
|
72
82
|
isDisabled: isDisabled,
|
|
73
83
|
hasAriaDisabled: hasAriaDisabled,
|
|
74
84
|
fullWidth: fullWidth
|
|
75
|
-
}, rest
|
|
85
|
+
}, rest, {
|
|
86
|
+
id: id,
|
|
87
|
+
isSelected: isSelected,
|
|
88
|
+
onClick: onClick
|
|
89
|
+
}));
|
|
76
90
|
};
|
|
77
91
|
EuiButton.displayName = 'EuiButton';
|
|
@@ -5,19 +5,21 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.EuiButtonGroup = exports.BUTTON_GROUP_GUTTER_SIZES = void 0;
|
|
8
|
+
exports.EuiButtonGroupChildren = exports.EuiButtonGroup = exports.BUTTON_GROUP_GUTTER_SIZES = void 0;
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _services = require("../../../services");
|
|
14
15
|
var _accessibility = require("../../accessibility");
|
|
15
|
-
var _button_group_button = require("./button_group_button");
|
|
16
16
|
var _button_context = require("../button_context");
|
|
17
|
+
var _button_group_button = require("./button_group_button");
|
|
18
|
+
var _use_button_group_selection = require("./use_button_group_selection");
|
|
17
19
|
var _button_group = require("./button_group.styles");
|
|
18
20
|
var _react2 = require("@emotion/react");
|
|
19
21
|
var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelectedMap", "isDisabled", "hasAriaDisabled", "isFullWidth", "isIconOnly", "legend", "name", "onChange", "options", "type"],
|
|
20
|
-
_excluded2 = ["className", "children", "legend", "buttonSize", "variant", "gutterSize", "isDisabled", "hasAriaDisabled", "isFullWidth", "onChange"];
|
|
22
|
+
_excluded2 = ["className", "children", "legend", "buttonSize", "variant", "gutterSize", "isDisabled", "hasAriaDisabled", "isFullWidth", "showDividers", "wrap", "layout", "display", "type", "idSelected", "idToSelectedMap", "onChange"];
|
|
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
|
|
@@ -25,8 +27,26 @@ var _excluded = ["className", "buttonSize", "color", "idSelected", "idToSelected
|
|
|
25
27
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
28
|
* Side Public License, v 1.
|
|
27
29
|
*/
|
|
30
|
+
// removes outer fragment wrappers only; no nested traversal of children
|
|
31
|
+
// uses forEach over .toArray() to avoid mutating keys; only unwraps one Fragment level
|
|
28
32
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
29
33
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
34
|
+
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; }
|
|
35
|
+
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; }
|
|
36
|
+
function flattenButtonGroupChildren(children) {
|
|
37
|
+
var result = [];
|
|
38
|
+
_react.default.Children.forEach(children, function (child) {
|
|
39
|
+
if (! /*#__PURE__*/_react.default.isValidElement(child)) return;
|
|
40
|
+
if (child.type === _react.default.Fragment) {
|
|
41
|
+
_react.default.Children.forEach(child.props.children, function (fragmentChild) {
|
|
42
|
+
if ( /*#__PURE__*/_react.default.isValidElement(fragmentChild)) result.push(fragmentChild);
|
|
43
|
+
});
|
|
44
|
+
} else {
|
|
45
|
+
result.push(child);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
30
50
|
var EuiButtonGroupOptions = function EuiButtonGroupOptions(_ref) {
|
|
31
51
|
var className = _ref.className,
|
|
32
52
|
_ref$buttonSize = _ref.buttonSize,
|
|
@@ -89,9 +109,9 @@ var EuiButtonGroupOptions = function EuiButtonGroupOptions(_ref) {
|
|
|
89
109
|
})));
|
|
90
110
|
};
|
|
91
111
|
var BUTTON_GROUP_GUTTER_SIZES = exports.BUTTON_GROUP_GUTTER_SIZES = ['none', 'xs', 's', 'm', 'l', 'xl'];
|
|
92
|
-
var EuiButtonGroupChildren = function EuiButtonGroupChildren(_ref2) {
|
|
112
|
+
var EuiButtonGroupChildren = exports.EuiButtonGroupChildren = function EuiButtonGroupChildren(_ref2) {
|
|
93
113
|
var className = _ref2.className,
|
|
94
|
-
|
|
114
|
+
_children = _ref2.children,
|
|
95
115
|
legend = _ref2.legend,
|
|
96
116
|
_ref2$buttonSize = _ref2.buttonSize,
|
|
97
117
|
buttonSize = _ref2$buttonSize === void 0 ? 's' : _ref2$buttonSize,
|
|
@@ -105,36 +125,94 @@ var EuiButtonGroupChildren = function EuiButtonGroupChildren(_ref2) {
|
|
|
105
125
|
hasAriaDisabled = _ref2$hasAriaDisabled === void 0 ? false : _ref2$hasAriaDisabled,
|
|
106
126
|
_ref2$isFullWidth = _ref2.isFullWidth,
|
|
107
127
|
isFullWidth = _ref2$isFullWidth === void 0 ? false : _ref2$isFullWidth,
|
|
108
|
-
|
|
128
|
+
_ref2$showDividers = _ref2.showDividers,
|
|
129
|
+
showDividers = _ref2$showDividers === void 0 ? false : _ref2$showDividers,
|
|
130
|
+
_ref2$wrap = _ref2.wrap,
|
|
131
|
+
wrap = _ref2$wrap === void 0 ? true : _ref2$wrap,
|
|
132
|
+
_ref2$layout = _ref2.layout,
|
|
133
|
+
layout = _ref2$layout === void 0 ? 'horizontal' : _ref2$layout,
|
|
134
|
+
_ref2$display = _ref2.display,
|
|
135
|
+
display = _ref2$display === void 0 ? 'regular' : _ref2$display,
|
|
136
|
+
type = _ref2.type,
|
|
137
|
+
idSelected = _ref2.idSelected,
|
|
138
|
+
idToSelectedMap = _ref2.idToSelectedMap,
|
|
139
|
+
onChange = _ref2.onChange,
|
|
109
140
|
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
|
141
|
+
var isSegmented = variant === 'segmented';
|
|
142
|
+
var isSelection = variant === 'selection';
|
|
143
|
+
var hasSegmentedStyle = isSegmented || isSelection;
|
|
144
|
+
var hasGutterSize = variant === 'default' && gutterSize !== 'none';
|
|
145
|
+
var _useEuiButtonGroupSel = (0, _use_button_group_selection.useEuiButtonGroupSelection)({
|
|
146
|
+
type: type,
|
|
147
|
+
idSelected: idSelected,
|
|
148
|
+
idToSelectedMap: idToSelectedMap,
|
|
149
|
+
onChange: onChange
|
|
150
|
+
}),
|
|
151
|
+
isSelected = _useEuiButtonGroupSel.isSelected,
|
|
152
|
+
_onSelect = _useEuiButtonGroupSel.onSelect;
|
|
110
153
|
var wrapperCssStyles = [_button_group.euiButtonGroupStyles.euiButtonGroup, isFullWidth && _button_group.euiButtonGroupStyles.fullWidth];
|
|
111
154
|
var styles = (0, _services.useEuiMemoizedStyles)(_button_group.euiButtonGroupButtonsStyles);
|
|
112
|
-
var cssStyles = [styles.euiButtonGroup__buttons,
|
|
155
|
+
var cssStyles = [styles.euiButtonGroup__buttons, hasGutterSize && styles.gutterSize[gutterSize], hasSegmentedStyle && !wrap && styles.noWrap];
|
|
156
|
+
var containerCssStyles = [styles.euiButtonGroup__container, isFullWidth && layout !== 'vertical' && styles.fullWidth];
|
|
113
157
|
var classes = (0, _classnames.default)('euiButtonGroup', {
|
|
114
158
|
'euiButtonGroup-isDisabled': isDisabled
|
|
115
159
|
}, className);
|
|
116
160
|
var contextValue = (0, _react.useMemo)(function () {
|
|
117
|
-
return {
|
|
161
|
+
return _objectSpread(_objectSpread(_objectSpread({
|
|
118
162
|
size: buttonSize,
|
|
119
163
|
isDisabled: isDisabled || undefined,
|
|
120
164
|
hasAriaDisabled: hasAriaDisabled || undefined,
|
|
121
165
|
fullWidth: isFullWidth
|
|
122
|
-
}
|
|
123
|
-
|
|
166
|
+
}, (isSegmented || isSelection) && {
|
|
167
|
+
color: 'text'
|
|
168
|
+
}), isSegmented && {
|
|
169
|
+
display: 'base',
|
|
170
|
+
fill: false
|
|
171
|
+
}), isSelection && {
|
|
172
|
+
getSelectionProps: function getSelectionProps(id) {
|
|
173
|
+
var selected = isSelected(id);
|
|
174
|
+
var isInverse = display === 'inverse';
|
|
175
|
+
var hasFill = selected && display === 'highlighted';
|
|
176
|
+
return {
|
|
177
|
+
isSelected: selected,
|
|
178
|
+
fill: isInverse ? false : hasFill,
|
|
179
|
+
display: isInverse ? 'base' : hasFill ? 'fill' : undefined,
|
|
180
|
+
onSelect: function onSelect() {
|
|
181
|
+
return _onSelect(id);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}, [buttonSize, isDisabled, hasAriaDisabled, isFullWidth, isSegmented, isSelection, isSelected, _onSelect, display]);
|
|
187
|
+
|
|
188
|
+
// wrap children in a wrapper to apply required inset styles
|
|
189
|
+
var children = isSegmented || isSelection ? flattenButtonGroupChildren(_children).map(function (child, index) {
|
|
190
|
+
var _child$key;
|
|
191
|
+
return (0, _react2.jsx)("div", {
|
|
192
|
+
key: (_child$key = child.key) !== null && _child$key !== void 0 ? _child$key : "euiButtonGroupItem-".concat(index),
|
|
193
|
+
className: "euiButtonGroup__item"
|
|
194
|
+
}, child);
|
|
195
|
+
}) : _children;
|
|
124
196
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
125
197
|
css: wrapperCssStyles,
|
|
126
198
|
className: classes,
|
|
127
199
|
role: "group",
|
|
128
200
|
"data-variant": variant,
|
|
129
201
|
"data-size": buttonSize,
|
|
202
|
+
"data-display": isSelection ? display : undefined,
|
|
203
|
+
"data-layout": hasSegmentedStyle ? layout : undefined,
|
|
204
|
+
"data-dividers": hasSegmentedStyle && showDividers || undefined,
|
|
130
205
|
"aria-label": legend,
|
|
131
206
|
"aria-disabled": isDisabled || undefined
|
|
132
207
|
}, rest), (0, _react2.jsx)("div", {
|
|
208
|
+
css: containerCssStyles,
|
|
209
|
+
className: "euiButtonGroup__container"
|
|
210
|
+
}, (0, _react2.jsx)("div", {
|
|
133
211
|
css: cssStyles,
|
|
134
212
|
className: "euiButtonGroup__buttons"
|
|
135
213
|
}, (0, _react2.jsx)(_button_context.EuiButtonContext.Provider, {
|
|
136
214
|
value: contextValue
|
|
137
|
-
}, children)));
|
|
215
|
+
}, children))));
|
|
138
216
|
};
|
|
139
217
|
|
|
140
218
|
/* Overloaded call signatures let one `EuiButtonGroup` component support both
|
|
@@ -15,8 +15,13 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
15
15
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
|
+
var hasButtonOnlySelector = ':not(:has(.euiButtonIcon))';
|
|
19
|
+
var hasButtonIconOnlySelector = ':not(:has(.euiButton, .euiButtonEmpty))';
|
|
20
|
+
var buttonItemSelector = '.euiButtonGroup__item, .euiToolTipAnchor, .euiPopover, .euiButton';
|
|
21
|
+
var buttonOnlyItemSelector = "*:is(".concat(buttonItemSelector, "):not(:has(.euiButtonIcon))");
|
|
22
|
+
var segmentedStyledSelector = "*:is([data-variant='segmented'], [data-variant='selection'])";
|
|
18
23
|
var euiButtonGroupStyles = exports.euiButtonGroupStyles = {
|
|
19
|
-
euiButtonGroup: /*#__PURE__*/(0, _react.css)("display:inline-block;", (0, _global_styling.logicalCSS)('max-width', '100%'), " position:relative
|
|
24
|
+
euiButtonGroup: /*#__PURE__*/(0, _react.css)("display:inline-block;", (0, _global_styling.logicalCSS)('max-width', '100%'), " position:relative;&:where(", segmentedStyledSelector, "){&", hasButtonIconOnlySelector, "{display:flex;}};label:euiButtonGroup;"),
|
|
20
25
|
fullWidth: process.env.NODE_ENV === "production" ? {
|
|
21
26
|
name: "jl0hie-fullWidth",
|
|
22
27
|
styles: "display:block;label:fullWidth;"
|
|
@@ -28,23 +33,70 @@ var euiButtonGroupStyles = exports.euiButtonGroupStyles = {
|
|
|
28
33
|
};
|
|
29
34
|
var euiButtonGroupButtonsStyles = exports.euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(euiThemeContext) {
|
|
30
35
|
var euiTheme = euiThemeContext.euiTheme;
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
var buttonSizeMap = (0, _global_styling.euiButtonSizeMap)(euiThemeContext);
|
|
37
|
+
var containerPadding = euiTheme.size.xs;
|
|
38
|
+
var splitPadding = (0, _global_styling.mathWithUnits)(containerPadding, function (x) {
|
|
39
|
+
return x / 2;
|
|
40
|
+
});
|
|
41
|
+
var insetSize = function insetSize(height) {
|
|
42
|
+
return (0, _global_styling.mathWithUnits)([height, containerPadding], function (x, y) {
|
|
43
|
+
return x - y * 2;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
var buttonGroupVariables = {
|
|
47
|
+
gap: {
|
|
48
|
+
regular: euiTheme.size.xs,
|
|
49
|
+
dividers: (0, _global_styling.mathWithUnits)([euiTheme.size.xs, euiTheme.border.width.thin], function (x, y) {
|
|
50
|
+
return x + y;
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
// TODO: use from buttonSizeMap once added via EuiSplitButton:
|
|
54
|
+
// https://github.com/elastic/eui/pull/9865
|
|
55
|
+
radius: {
|
|
56
|
+
outer: euiTheme.border.radius.medium,
|
|
57
|
+
inner: '2px' // should eventually be a token, but currently small and medium have the same value
|
|
58
|
+
},
|
|
59
|
+
size: {
|
|
60
|
+
s: insetSize(buttonSizeMap.s.height),
|
|
61
|
+
m: insetSize(buttonSizeMap.m.height)
|
|
62
|
+
}
|
|
34
63
|
};
|
|
64
|
+
var dividerOffset = (0, _global_styling.mathWithUnits)([buttonGroupVariables.gap.dividers, euiTheme.border.width.thin], function (x, y) {
|
|
65
|
+
return (x + y) / 2;
|
|
66
|
+
});
|
|
35
67
|
var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
|
|
36
68
|
controlCompressedHeight = _euiFormVariables.controlCompressedHeight,
|
|
37
69
|
controlCompressedBorderRadius = _euiFormVariables.controlCompressedBorderRadius,
|
|
38
70
|
backgroundColor = _euiFormVariables.backgroundColor,
|
|
39
71
|
borderColor = _euiFormVariables.borderColor;
|
|
72
|
+
var dividerStyles = "\n gap: ".concat(buttonGroupVariables.gap.dividers, ";\n\n .euiButtonGroup__item {\n position: relative;\n\n /* block border */\n &::before {\n content: '';\n position: absolute;\n inset-block-start: -").concat(dividerOffset, ";\n inset-inline-start: -").concat((0, _global_styling.mathWithUnits)(containerPadding, function (x) {
|
|
73
|
+
return x / 2;
|
|
74
|
+
}), ";\n inline-size: calc(\n 100% + ").concat((0, _global_styling.mathWithUnits)(containerPadding, function (x) {
|
|
75
|
+
return x * 2;
|
|
76
|
+
}), "\n );\n block-size: ").concat(euiTheme.border.width.thin, ";\n border-block-start: ").concat(euiTheme.border.width.thin, " solid\n ").concat(euiTheme.colors.borderBasePlain, ";\n pointer-events: none;\n }\n\n /* inline border */\n &::after {\n content: '';\n position: absolute;\n inset-inline-start: -").concat(dividerOffset, ";\n block-size: calc(\n var(--euiButtonGroupButtonInsetSize) - ").concat(euiTheme.size.s, "\n );\n inline-size: ").concat(euiTheme.border.width.thin, ";\n border-inline-start: ").concat(euiTheme.border.width.thin, " solid\n ").concat(euiTheme.colors.borderBasePlain, ";\n pointer-events: none;\n }\n }\n\n &:where([data-layout='horizontal'] &) {\n &:where(:is(").concat(hasButtonIconOnlySelector, ") &) {\n .euiButtonGroup__item::before {\n inset-inline-start: 0;\n inline-size: 100%;\n }\n }\n }\n\n &:where([data-layout='vertical'] &) {\n &:where(:is(").concat(hasButtonIconOnlySelector, ") &) {\n .euiButtonGroup__item::before {\n inset-inline-start: auto;\n inline-size: calc(\n var(--euiButtonGroupButtonInsetSize) - ").concat(euiTheme.size.s, "\n );\n }\n }\n }\n ");
|
|
77
|
+
|
|
78
|
+
// Shared inset styles for both segmented and selection variants.
|
|
79
|
+
var segmentedChildrenStyles = "\n /* Buttons are used inset and shouldn't have their own borders */\n .euiButton,\n .euiButtonIcon {\n border: none;\n pointer-events: auto; /* Ensure buttons are still clickable in jsdom */\n\n &::before {\n border-radius: inherit;\n }\n\n &:focus-visible {\n outline-offset: 0;\n }\n }\n\n /* Adjust children for inset behavior */\n ".concat(buttonItemSelector, ",\n .euiButtonIcon {\n display: inline-flex;\n align-items: center;\n block-size: var(--euiButtonGroupButtonInsetSize);\n border-radius: ").concat(buttonGroupVariables.radius.inner, ";\n }\n\n .euiButtonIcon {\n inline-size: var(--euiButtonGroupButtonInsetSize);\n }\n\n /* Only non-icon buttons auto-grow/shrink */\n .euiButton,\n ").concat(buttonOnlyItemSelector, " {\n flex: 1;\n min-inline-size: auto;\n }\n ");
|
|
40
80
|
return {
|
|
41
81
|
// Base
|
|
42
|
-
|
|
43
|
-
|
|
82
|
+
euiButtonGroup__container: /*#__PURE__*/(0, _react.css)("&:where(", segmentedStyledSelector, " &){position:relative;display:inline-flex;align-items:center;max-inline-size:100%;padding:", splitPadding, ";border-radius:", buttonGroupVariables.radius.outer, ";background-color:", euiTheme.colors.backgroundBasePlain, ";&:where([data-size='s'] &){--euiButtonGroupButtonInsetSize:", buttonGroupVariables.size.s, ";min-block-size:", buttonSizeMap.s.height, ";}&:where([data-size='m'] &){--euiButtonGroupButtonInsetSize:", buttonGroupVariables.size.m, ";min-block-size:", buttonSizeMap.m.height, ";}&::after{content:'';position:absolute;inset:0;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.borderBasePlain, ";border-radius:inherit;pointer-events:none;}}&:where([data-variant='selection'][data-display='inverse'] &){background-color:", euiTheme.colors.backgroundBaseSubdued, ";};label:euiButtonGroup__container;"),
|
|
83
|
+
euiButtonGroup__buttons: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), " display:flex;align-items:center;&:where([data-variant='default'] &){flex-wrap:wrap;}&:where(", segmentedStyledSelector, " &){position:relative;display:inline-flex;align-items:center;flex-wrap:wrap;gap:", buttonGroupVariables.gap.regular, ";max-inline-size:100%;padding:", splitPadding, ";overflow:hidden;", segmentedChildrenStyles, " *:where(.euiButton, .euiButtonIcon):is(", _global_styling.euiDisabledSelector, "){background-color:transparent;}&:where([data-dividers='true'] &){", dividerStyles, ";}&:where([data-layout='vertical'] &){flex-direction:column;.euiButtonGroup__item{justify-content:center;}}}&:where([data-variant='segmented'] &){*:where(.euiButton, .euiButtonIcon):is(", _global_styling.euiDisabledSelector, "){background-color:transparent;}}&:where([data-variant='selection'] &){*:where(.euiButton, .euiButtonIcon){&:is(", _global_styling.euiDisabledSelector, "){", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
84
|
+
forced: "\n opacity: 0.5;\n "
|
|
85
|
+
}), ";}&:is([aria-pressed='true']){", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
86
|
+
forced: "\n --highContrastHoverIndicatorColor: ".concat(euiTheme.colors.textInverse, ";\n ").concat((0, _high_contrast.preventForcedColors)(euiThemeContext), "\n background-color: ").concat(euiTheme.colors.fullShade, ";\n color: ").concat(euiTheme.colors.emptyShade, ";\n ")
|
|
87
|
+
}), ";}&:is([aria-pressed='false']){background-color:transparent;}}}&:where([data-variant='selection'][data-display='regular'] &){*:where(.euiButton, .euiButtonIcon):is([aria-pressed='true']){background-color:", euiTheme.colors.backgroundLightText, ";", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
88
|
+
none: "\n background-color: ".concat(euiTheme.colors.backgroundLightText, ";\n "),
|
|
89
|
+
preferred: "\n border: ".concat(euiTheme.border.thin, ";\n "),
|
|
90
|
+
forced: "\n background-color: ".concat(euiTheme.colors.fullShade, ";\n border: none;\n ")
|
|
91
|
+
}), ";}}&:where([data-variant='selection'][data-display='inverse'] &){*:where(.euiButton, .euiButtonIcon):is([aria-pressed='true']){", (0, _global_styling.euiShadowXSmall)(euiThemeContext), " ", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
92
|
+
forced: "\n border: none;\n "
|
|
93
|
+
}), ";}};label:euiButtonGroup__buttons;"),
|
|
94
|
+
noWrap: /*#__PURE__*/(0, _react.css)("&:where(", segmentedStyledSelector, " &){flex-wrap:nowrap;", buttonOnlyItemSelector, "{flex:0 1 auto;min-inline-size:0;.euiButton .eui-textTruncate{min-inline-size:0;}}&", hasButtonIconOnlySelector, "{overflow-inline:auto;}};label:noWrap;"),
|
|
95
|
+
fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), " .euiButtonGroupButton,.euiButtonGroup__tooltipWrapper{flex:1;", (0, _global_styling.logicalCSS)('width', '100%'), ";}&:where([data-variant='default'] &){.euiButton{flex-grow:1;inline-size:auto;}.euiButtonEmpty{flex-shrink:0;}}&:where(", segmentedStyledSelector, " &){&", hasButtonIconOnlySelector, "{inline-size:auto;}&", hasButtonOnlySelector, "{.euiButtonGroup__buttons{inline-size:100%;}", buttonOnlyItemSelector, "{flex-grow:1;}}};label:fullWidth;"),
|
|
44
96
|
// Sizes
|
|
45
97
|
size: {
|
|
46
|
-
m: /*#__PURE__*/(0, _react.css)(
|
|
47
|
-
s: /*#__PURE__*/(0, _react.css)(
|
|
98
|
+
m: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";", _highContrastStyles(euiThemeContext), ";;label:m;"),
|
|
99
|
+
s: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.small, ";", _highContrastStyles(euiThemeContext), ";;label:s;"),
|
|
48
100
|
compressed: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', controlCompressedHeight), " background-color:", backgroundColor, ";border:", euiTheme.border.width.thin, " solid ", borderColor, ";border-radius:", controlCompressedBorderRadius, ";", _highContrastStyles(euiThemeContext, true), ";;label:compressed;")
|
|
49
101
|
},
|
|
50
102
|
gutterSize: {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useEuiButtonGroupSelection = useEuiButtonGroupSelection;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
/*
|
|
9
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
10
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
11
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
12
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
13
|
+
* Side Public License, v 1.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Purely controlled selection state for `EuiButtonGroup` with `variant="selection"`.
|
|
18
|
+
* The consumer owns state via `idSelected` (single) or `idToSelectedMap` (multi)
|
|
19
|
+
* and updates it through `onChange`.
|
|
20
|
+
*/
|
|
21
|
+
function useEuiButtonGroupSelection(_ref) {
|
|
22
|
+
var type = _ref.type,
|
|
23
|
+
idSelected = _ref.idSelected,
|
|
24
|
+
idToSelectedMap = _ref.idToSelectedMap,
|
|
25
|
+
onChange = _ref.onChange;
|
|
26
|
+
var isSelected = (0, _react.useCallback)(function (id) {
|
|
27
|
+
return type === 'multi' ? !!(idToSelectedMap !== null && idToSelectedMap !== void 0 && idToSelectedMap[id]) : id === idSelected;
|
|
28
|
+
}, [type, idSelected, idToSelectedMap]);
|
|
29
|
+
var onSelect = (0, _react.useCallback)(function (id) {
|
|
30
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(id);
|
|
31
|
+
}, [onChange]);
|
|
32
|
+
return {
|
|
33
|
+
isSelected: isSelected,
|
|
34
|
+
onSelect: onSelect
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -17,7 +17,7 @@ var _loading = require("../../loading");
|
|
|
17
17
|
var _use_button_common_props = require("../use_button_common_props");
|
|
18
18
|
var _button_icon = require("./button_icon.styles");
|
|
19
19
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["className", "iconType", "iconSize", "color", "isDisabled", "disabled", "hasAriaDisabled", "href", "type", "display", "target", "rel", "size", "buttonRef", "isSelected", "isLoading"],
|
|
20
|
+
var _excluded = ["className", "iconType", "iconSize", "color", "isDisabled", "disabled", "hasAriaDisabled", "href", "type", "display", "target", "rel", "size", "buttonRef", "isSelected", "isLoading", "id", "onClick"],
|
|
21
21
|
_excluded2 = ["ref"];
|
|
22
22
|
/*
|
|
23
23
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -42,29 +42,38 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
42
42
|
_ref$type = _ref.type,
|
|
43
43
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
44
44
|
_ref$display = _ref.display,
|
|
45
|
-
|
|
45
|
+
_display = _ref$display === void 0 ? 'empty' : _ref$display,
|
|
46
46
|
target = _ref.target,
|
|
47
47
|
rel = _ref.rel,
|
|
48
48
|
_ref$size = _ref.size,
|
|
49
49
|
_size = _ref$size === void 0 ? 'xs' : _ref$size,
|
|
50
50
|
buttonRef = _ref.buttonRef,
|
|
51
|
-
|
|
51
|
+
_isSelected = _ref.isSelected,
|
|
52
52
|
isLoading = _ref.isLoading,
|
|
53
|
+
id = _ref.id,
|
|
54
|
+
_onClick = _ref.onClick,
|
|
53
55
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
54
56
|
var _useEuiButtonCommonPr = (0, _use_button_common_props.useEuiButtonCommonProps)({
|
|
55
57
|
size: _size,
|
|
56
58
|
color: _color,
|
|
57
59
|
isDisabled: _isDisabled,
|
|
58
60
|
hasAriaDisabled: _hasAriaDisabled,
|
|
61
|
+
display: _display,
|
|
59
62
|
href: href,
|
|
60
63
|
disabled: disabled,
|
|
61
|
-
isLoading: isLoading
|
|
64
|
+
isLoading: isLoading,
|
|
65
|
+
id: id,
|
|
66
|
+
isSelected: _isSelected,
|
|
67
|
+
onClick: _onClick
|
|
62
68
|
}),
|
|
63
69
|
size = _useEuiButtonCommonPr.size,
|
|
64
70
|
color = _useEuiButtonCommonPr.color,
|
|
65
71
|
isDisabled = _useEuiButtonCommonPr.isDisabled,
|
|
66
72
|
_useEuiButtonCommonPr2 = _useEuiButtonCommonPr.hasAriaDisabled,
|
|
67
|
-
hasAriaDisabled = _useEuiButtonCommonPr2 === void 0 ? false : _useEuiButtonCommonPr2
|
|
73
|
+
hasAriaDisabled = _useEuiButtonCommonPr2 === void 0 ? false : _useEuiButtonCommonPr2,
|
|
74
|
+
display = _useEuiButtonCommonPr.display,
|
|
75
|
+
isSelected = _useEuiButtonCommonPr.isSelected,
|
|
76
|
+
onClick = _useEuiButtonCommonPr.onClick;
|
|
68
77
|
var _useEuiDisabledElemen = (0, _useEuiDisabledElement.useEuiDisabledElement)({
|
|
69
78
|
isDisabled: isDisabled,
|
|
70
79
|
hasAriaDisabled: hasAriaDisabled,
|
|
@@ -132,7 +141,9 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
132
141
|
href: href,
|
|
133
142
|
target: target,
|
|
134
143
|
rel: secureRel,
|
|
135
|
-
ref: setCombinedRef
|
|
144
|
+
ref: setCombinedRef,
|
|
145
|
+
id: id,
|
|
146
|
+
onClick: onClick
|
|
136
147
|
}, rest), buttonIcon);
|
|
137
148
|
}
|
|
138
149
|
var buttonType;
|
|
@@ -143,6 +154,8 @@ var EuiButtonIcon = exports.EuiButtonIcon = function EuiButtonIcon(_ref) {
|
|
|
143
154
|
className: classes,
|
|
144
155
|
"aria-pressed": isSelected,
|
|
145
156
|
type: type,
|
|
146
|
-
ref: setCombinedRef
|
|
157
|
+
ref: setCombinedRef,
|
|
158
|
+
id: id,
|
|
159
|
+
onClick: onClick
|
|
147
160
|
}, rest, disabledButtonProps), buttonIcon);
|
|
148
161
|
};
|