@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.
Files changed (537) hide show
  1. package/dist/eui-icons.json +90 -87
  2. package/dist/svgs/cloud_bolt.svg +4 -0
  3. package/dist/svgs/cloud_rain.svg +4 -0
  4. package/dist/svgs/cloud_sun.svg +4 -0
  5. package/dist/svgs/cube.svg +3 -0
  6. package/dist/svgs/cursor_default.svg +3 -0
  7. package/dist/svgs/kubernetes_namespace.svg +4 -0
  8. package/dist/svgs/log_in.svg +4 -0
  9. package/dist/svgs/memory.svg +1 -10
  10. package/dist/svgs/product_timelion.svg +3 -0
  11. package/dist/svgs/product_tsvb.svg +5 -0
  12. package/dist/svgs/push.svg +4 -0
  13. package/dist/svgs/route_split.svg +3 -0
  14. package/dist/svgs/transition_right_in.svg +4 -0
  15. package/dist/svgs/transition_right_out.svg +4 -0
  16. package/dist/svgs/wrench.svg +1 -1
  17. package/es/components/avatar/avatar.js +1 -1
  18. package/es/components/badge/badge.js +1 -1
  19. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  20. package/es/components/basic_table/basic_table.js +4 -4
  21. package/es/components/basic_table/in_memory_table.js +4 -4
  22. package/es/components/button/button.js +20 -6
  23. package/es/components/button/button_display/_button_display_content.js +1 -1
  24. package/es/components/button/button_empty/button_empty.js +1 -1
  25. package/es/components/button/button_group/button_group.js +180 -20
  26. package/es/components/button/button_group/button_group.styles.js +61 -9
  27. package/es/components/button/button_group/use_button_group_selection.js +30 -0
  28. package/es/components/button/button_icon/button_icon.js +21 -8
  29. package/es/components/button/split_button/split_button.js +39 -16
  30. package/es/components/button/split_button/split_button.styles.js +28 -32
  31. package/es/components/button/split_button/split_button_actions.js +16 -5
  32. package/es/components/button/use_button_common_props.js +18 -5
  33. package/es/components/call_out/call_out.js +2 -2
  34. package/es/components/card/card.js +1 -1
  35. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  36. package/es/components/comment_list/comment.js +2 -2
  37. package/es/components/comment_list/comment_event.js +1 -1
  38. package/es/components/comment_list/comment_list.js +2 -2
  39. package/es/components/comment_list/comment_timeline.js +1 -1
  40. package/es/components/context_menu/context_menu_item.js +1 -1
  41. package/es/components/datagrid/body/cell/data_grid_cell.js +27 -27
  42. package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
  43. package/es/components/datagrid/body/data_grid_body.js +13 -13
  44. package/es/components/datagrid/body/data_grid_body_custom.js +13 -13
  45. package/es/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  46. package/es/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
  47. package/es/components/datagrid/body/header/column_actions.js +3 -1
  48. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
  49. package/es/components/datagrid/body/header/data_grid_header_cell.js +17 -13
  50. package/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +9 -3
  51. package/es/components/datagrid/body/header/data_grid_header_row.js +6 -0
  52. package/es/components/datagrid/controls/column_sorting.js +13 -13
  53. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  54. package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  55. package/es/components/datagrid/utils/in_memory.js +12 -12
  56. package/es/components/datagrid/utils/last_copy_column.js +11 -0
  57. package/es/components/date_picker/date_picker.js +2 -2
  58. package/es/components/date_picker/date_picker_range.js +1 -1
  59. package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +224 -253
  60. package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  61. package/es/components/empty_prompt/empty_prompt.js +1 -1
  62. package/es/components/flyout/flyout_menu/flyout_menu.js +39 -14
  63. package/es/components/form/field_number/field_number.js +2 -2
  64. package/es/components/form/field_text/field_text.js +2 -2
  65. package/es/components/form/file_picker/file_picker.js +187 -224
  66. package/es/components/form/file_picker/file_picker.styles.js +1 -1
  67. package/es/components/form/form_control_button/form_control_button.js +1 -1
  68. package/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  69. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  70. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  71. package/es/components/form/text_area/text_area.js +2 -2
  72. package/es/components/header/header_links/header_link.js +1 -1
  73. package/es/components/header/header_links/header_links.js +1 -1
  74. package/es/components/header/header_logo/header_logo.js +1 -1
  75. package/es/components/header/header_section/header_section_item_button.js +1 -1
  76. package/es/components/icon/assets/{cloud_stormy.js → cloud_bolt.js} +5 -3
  77. package/es/components/icon/assets/{cloud_sunny.js → cloud_rain.js} +5 -3
  78. package/es/components/icon/assets/cloud_sun.js +33 -0
  79. package/es/components/icon/assets/{kubernetes_pod.js → cube.js} +3 -3
  80. package/es/components/icon/assets/cursor_default.js +35 -0
  81. package/es/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
  82. package/es/components/icon/assets/{kql_function.js → log_in.js} +5 -3
  83. package/es/components/icon/assets/memory.js +1 -3
  84. package/es/components/icon/assets/product_timelion.js +33 -0
  85. package/es/components/icon/assets/product_tsvb.js +37 -0
  86. package/es/components/icon/assets/{namespace.js → push.js} +3 -6
  87. package/es/components/icon/assets/route_split.js +33 -0
  88. package/es/components/icon/assets/transition_right_in.js +35 -0
  89. package/es/components/icon/assets/transition_right_out.js +35 -0
  90. package/es/components/icon/assets/wrench.js +1 -3
  91. package/es/components/icon/icon.js +1 -1
  92. package/es/components/icon/icon_glyphs.a11y.js +1 -1
  93. package/es/components/icon/icon_map.js +96 -18
  94. package/es/components/icon/svgs/cloud_bolt.svg +4 -0
  95. package/es/components/icon/svgs/cloud_rain.svg +4 -0
  96. package/es/components/icon/svgs/cloud_sun.svg +4 -0
  97. package/es/components/icon/svgs/cube.svg +3 -0
  98. package/es/components/icon/svgs/cursor_default.svg +3 -0
  99. package/es/components/icon/svgs/kubernetes_namespace.svg +4 -0
  100. package/es/components/icon/svgs/log_in.svg +4 -0
  101. package/es/components/icon/svgs/memory.svg +1 -10
  102. package/es/components/icon/svgs/product_timelion.svg +3 -0
  103. package/es/components/icon/svgs/product_tsvb.svg +5 -0
  104. package/es/components/icon/svgs/push.svg +4 -0
  105. package/es/components/icon/svgs/route_split.svg +3 -0
  106. package/es/components/icon/svgs/transition_right_in.svg +4 -0
  107. package/es/components/icon/svgs/transition_right_out.svg +4 -0
  108. package/es/components/icon/svgs/wrench.svg +1 -1
  109. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  110. package/es/components/list_group/list_group.js +2 -2
  111. package/es/components/list_group/list_group_item.js +2 -2
  112. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  113. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  114. package/es/components/loading/loading_logo.js +1 -1
  115. package/es/components/markdown_editor/markdown_editor.js +1 -1
  116. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  117. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  118. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  119. package/es/components/page/page_header/page_header_content.js +1 -1
  120. package/es/components/pagination/pagination_button.js +1 -1
  121. package/es/components/resizable_container/resizable_collapse_button.js +4 -4
  122. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  123. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  124. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  125. package/es/components/table/table_header_cell.js +1 -1
  126. package/es/components/timeline/timeline_item_icon.js +1 -1
  127. package/es/components/toast/global_toast_list.js +2 -2
  128. package/es/components/toast/toast.js +2 -2
  129. package/es/components/tool_tip/icon_tip.js +1 -1
  130. package/es/global_styling/mixins/_button.js +6 -0
  131. package/es/services/accessibility/html_id_generator.js +26 -1
  132. package/eui.d.ts +425 -417
  133. package/i18ntokens.json +2678 -2660
  134. package/lib/components/avatar/avatar.js +1 -1
  135. package/lib/components/badge/badge.js +1 -1
  136. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  137. package/lib/components/basic_table/basic_table.js +4 -4
  138. package/lib/components/basic_table/in_memory_table.js +4 -4
  139. package/lib/components/button/button.js +20 -6
  140. package/lib/components/button/button_display/_button_display_content.js +1 -1
  141. package/lib/components/button/button_empty/button_empty.js +1 -1
  142. package/lib/components/button/button_group/button_group.js +179 -21
  143. package/lib/components/button/button_group/button_group.styles.js +60 -8
  144. package/lib/components/button/button_group/use_button_group_selection.js +36 -0
  145. package/lib/components/button/button_icon/button_icon.js +21 -8
  146. package/lib/components/button/split_button/split_button.js +37 -15
  147. package/lib/components/button/split_button/split_button.styles.js +29 -31
  148. package/lib/components/button/split_button/split_button_actions.js +15 -4
  149. package/lib/components/button/use_button_common_props.js +18 -5
  150. package/lib/components/call_out/call_out.js +2 -2
  151. package/lib/components/card/card.js +1 -1
  152. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  153. package/lib/components/comment_list/comment.js +2 -2
  154. package/lib/components/comment_list/comment_event.js +1 -1
  155. package/lib/components/comment_list/comment_list.js +2 -2
  156. package/lib/components/comment_list/comment_timeline.js +1 -1
  157. package/lib/components/context_menu/context_menu_item.js +1 -1
  158. package/lib/components/datagrid/body/cell/data_grid_cell.js +27 -27
  159. package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
  160. package/lib/components/datagrid/body/data_grid_body.js +13 -13
  161. package/lib/components/datagrid/body/data_grid_body_custom.js +13 -13
  162. package/lib/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  163. package/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
  164. package/lib/components/datagrid/body/header/column_actions.js +3 -1
  165. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
  166. package/lib/components/datagrid/body/header/data_grid_header_cell.js +17 -13
  167. package/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +9 -3
  168. package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -0
  169. package/lib/components/datagrid/controls/column_sorting.js +13 -13
  170. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  171. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  172. package/lib/components/datagrid/utils/in_memory.js +12 -12
  173. package/lib/components/datagrid/utils/last_copy_column.js +17 -0
  174. package/lib/components/date_picker/date_picker.js +2 -2
  175. package/lib/components/date_picker/date_picker_range.js +1 -1
  176. package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +224 -253
  177. package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  178. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  179. package/lib/components/flyout/flyout_menu/flyout_menu.js +39 -14
  180. package/lib/components/form/field_number/field_number.js +2 -2
  181. package/lib/components/form/field_text/field_text.js +2 -2
  182. package/lib/components/form/file_picker/file_picker.js +193 -227
  183. package/lib/components/form/file_picker/file_picker.styles.js +1 -1
  184. package/lib/components/form/form_control_button/form_control_button.js +1 -1
  185. package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  186. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  187. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  188. package/lib/components/form/text_area/text_area.js +2 -2
  189. package/lib/components/header/header_links/header_link.js +1 -1
  190. package/lib/components/header/header_links/header_links.js +1 -1
  191. package/lib/components/header/header_logo/header_logo.js +1 -1
  192. package/lib/components/header/header_section/header_section_item_button.js +1 -1
  193. package/lib/components/icon/assets/{cloud_stormy.js → cloud_bolt.js} +5 -3
  194. package/lib/components/icon/assets/{cloud_sunny.js → cloud_rain.js} +5 -3
  195. package/lib/components/icon/assets/cloud_sun.js +40 -0
  196. package/lib/components/icon/assets/{kubernetes_pod.js → cube.js} +3 -3
  197. package/lib/components/icon/assets/cursor_default.js +42 -0
  198. package/lib/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
  199. package/lib/components/icon/assets/{kql_function.js → log_in.js} +5 -3
  200. package/lib/components/icon/assets/memory.js +1 -3
  201. package/lib/components/icon/assets/product_timelion.js +40 -0
  202. package/lib/components/icon/assets/product_tsvb.js +44 -0
  203. package/lib/components/icon/assets/{namespace.js → push.js} +3 -6
  204. package/lib/components/icon/assets/route_split.js +40 -0
  205. package/lib/components/icon/assets/transition_right_in.js +42 -0
  206. package/lib/components/icon/assets/transition_right_out.js +42 -0
  207. package/lib/components/icon/assets/wrench.js +1 -3
  208. package/lib/components/icon/icon.js +1 -1
  209. package/lib/components/icon/icon_glyphs.a11y.js +1 -1
  210. package/lib/components/icon/icon_map.js +120 -18
  211. package/lib/components/icon/svgs/cloud_bolt.svg +4 -0
  212. package/lib/components/icon/svgs/cloud_rain.svg +4 -0
  213. package/lib/components/icon/svgs/cloud_sun.svg +4 -0
  214. package/lib/components/icon/svgs/cube.svg +3 -0
  215. package/lib/components/icon/svgs/cursor_default.svg +3 -0
  216. package/lib/components/icon/svgs/kubernetes_namespace.svg +4 -0
  217. package/lib/components/icon/svgs/log_in.svg +4 -0
  218. package/lib/components/icon/svgs/memory.svg +1 -10
  219. package/lib/components/icon/svgs/product_timelion.svg +3 -0
  220. package/lib/components/icon/svgs/product_tsvb.svg +5 -0
  221. package/lib/components/icon/svgs/push.svg +4 -0
  222. package/lib/components/icon/svgs/route_split.svg +3 -0
  223. package/lib/components/icon/svgs/transition_right_in.svg +4 -0
  224. package/lib/components/icon/svgs/transition_right_out.svg +4 -0
  225. package/lib/components/icon/svgs/wrench.svg +1 -1
  226. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  227. package/lib/components/list_group/list_group.js +2 -2
  228. package/lib/components/list_group/list_group_item.js +2 -2
  229. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  230. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  231. package/lib/components/loading/loading_logo.js +1 -1
  232. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  233. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  234. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  235. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  236. package/lib/components/page/page_header/page_header_content.js +1 -1
  237. package/lib/components/pagination/pagination_button.js +1 -1
  238. package/lib/components/resizable_container/resizable_collapse_button.js +4 -4
  239. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  240. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  241. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  242. package/lib/components/table/table_header_cell.js +1 -1
  243. package/lib/components/timeline/timeline_item_icon.js +1 -1
  244. package/lib/components/toast/global_toast_list.js +2 -2
  245. package/lib/components/toast/toast.js +2 -2
  246. package/lib/components/tool_tip/icon_tip.js +1 -1
  247. package/lib/global_styling/mixins/_button.js +6 -0
  248. package/lib/services/accessibility/html_id_generator.js +26 -1
  249. package/optimize/es/components/button/button.js +20 -6
  250. package/optimize/es/components/button/button_group/button_group.js +89 -10
  251. package/optimize/es/components/button/button_group/button_group.styles.js +61 -9
  252. package/optimize/es/components/button/button_group/use_button_group_selection.js +30 -0
  253. package/optimize/es/components/button/button_icon/button_icon.js +20 -7
  254. package/optimize/es/components/button/split_button/split_button.js +36 -16
  255. package/optimize/es/components/button/split_button/split_button.styles.js +28 -32
  256. package/optimize/es/components/button/split_button/split_button_actions.js +16 -5
  257. package/optimize/es/components/button/use_button_common_props.js +18 -5
  258. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +3 -3
  259. package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
  260. package/optimize/es/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
  261. package/optimize/es/components/datagrid/body/header/column_actions.js +3 -1
  262. package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
  263. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +3 -0
  264. package/optimize/es/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -3
  265. package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +6 -0
  266. package/optimize/es/components/datagrid/utils/last_copy_column.js +11 -0
  267. package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +220 -225
  268. package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  269. package/optimize/es/components/flyout/flyout_menu/flyout_menu.js +32 -9
  270. package/optimize/es/components/form/file_picker/file_picker.js +182 -216
  271. package/optimize/es/components/form/file_picker/file_picker.styles.js +1 -1
  272. package/optimize/es/components/icon/assets/{cloud_stormy.js → cloud_bolt.js} +5 -3
  273. package/optimize/es/components/icon/assets/{cloud_sunny.js → cloud_rain.js} +5 -3
  274. package/optimize/es/components/icon/assets/cloud_sun.js +32 -0
  275. package/optimize/es/components/icon/assets/{kubernetes_pod.js → cube.js} +3 -3
  276. package/optimize/es/components/icon/assets/cursor_default.js +34 -0
  277. package/optimize/es/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
  278. package/optimize/es/components/icon/assets/{kql_function.js → log_in.js} +5 -3
  279. package/optimize/es/components/icon/assets/memory.js +1 -3
  280. package/optimize/es/components/icon/assets/product_timelion.js +32 -0
  281. package/optimize/es/components/icon/assets/product_tsvb.js +36 -0
  282. package/optimize/es/components/icon/assets/{namespace.js → push.js} +3 -6
  283. package/optimize/es/components/icon/assets/route_split.js +32 -0
  284. package/optimize/es/components/icon/assets/transition_right_in.js +34 -0
  285. package/optimize/es/components/icon/assets/transition_right_out.js +34 -0
  286. package/optimize/es/components/icon/assets/wrench.js +1 -3
  287. package/optimize/es/components/icon/icon_glyphs.a11y.js +1 -1
  288. package/optimize/es/components/icon/icon_map.js +96 -18
  289. package/optimize/es/components/icon/svgs/cloud_bolt.svg +4 -0
  290. package/optimize/es/components/icon/svgs/cloud_rain.svg +4 -0
  291. package/optimize/es/components/icon/svgs/cloud_sun.svg +4 -0
  292. package/optimize/es/components/icon/svgs/cube.svg +3 -0
  293. package/optimize/es/components/icon/svgs/cursor_default.svg +3 -0
  294. package/optimize/es/components/icon/svgs/kubernetes_namespace.svg +4 -0
  295. package/optimize/es/components/icon/svgs/log_in.svg +4 -0
  296. package/optimize/es/components/icon/svgs/memory.svg +1 -10
  297. package/optimize/es/components/icon/svgs/product_timelion.svg +3 -0
  298. package/optimize/es/components/icon/svgs/product_tsvb.svg +5 -0
  299. package/optimize/es/components/icon/svgs/push.svg +4 -0
  300. package/optimize/es/components/icon/svgs/route_split.svg +3 -0
  301. package/optimize/es/components/icon/svgs/transition_right_in.svg +4 -0
  302. package/optimize/es/components/icon/svgs/transition_right_out.svg +4 -0
  303. package/optimize/es/components/icon/svgs/wrench.svg +1 -1
  304. package/optimize/es/components/resizable_container/resizable_collapse_button.js +4 -4
  305. package/optimize/es/global_styling/mixins/_button.js +6 -0
  306. package/optimize/es/services/accessibility/html_id_generator.js +26 -1
  307. package/optimize/lib/components/button/button.js +20 -6
  308. package/optimize/lib/components/button/button_group/button_group.js +89 -11
  309. package/optimize/lib/components/button/button_group/button_group.styles.js +60 -8
  310. package/optimize/lib/components/button/button_group/use_button_group_selection.js +36 -0
  311. package/optimize/lib/components/button/button_icon/button_icon.js +20 -7
  312. package/optimize/lib/components/button/split_button/split_button.js +35 -15
  313. package/optimize/lib/components/button/split_button/split_button.styles.js +29 -31
  314. package/optimize/lib/components/button/split_button/split_button_actions.js +15 -4
  315. package/optimize/lib/components/button/use_button_common_props.js +18 -5
  316. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +3 -3
  317. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
  318. package/optimize/lib/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
  319. package/optimize/lib/components/datagrid/body/header/column_actions.js +3 -1
  320. package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
  321. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +3 -0
  322. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell_wrapper.js +7 -3
  323. package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +6 -0
  324. package/optimize/lib/components/datagrid/utils/last_copy_column.js +17 -0
  325. package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +219 -224
  326. package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  327. package/optimize/lib/components/flyout/flyout_menu/flyout_menu.js +32 -9
  328. package/optimize/lib/components/form/file_picker/file_picker.js +183 -215
  329. package/optimize/lib/components/form/file_picker/file_picker.styles.js +1 -1
  330. package/optimize/lib/components/icon/assets/{kubernetes_pod.js → cloud_bolt.js} +5 -3
  331. package/optimize/lib/components/icon/assets/{cloud_stormy.js → cloud_rain.js} +5 -3
  332. package/optimize/lib/components/icon/assets/cloud_sun.js +40 -0
  333. package/optimize/lib/components/icon/assets/cube.js +40 -0
  334. package/{test-env/components/icon/assets/kubernetes_pod.js → optimize/lib/components/icon/assets/cursor_default.js} +5 -3
  335. package/optimize/lib/components/icon/assets/{cloud_drizzle.js → kubernetes_namespace.js} +5 -3
  336. package/{test-env/components/icon/assets/kql_function.js → optimize/lib/components/icon/assets/log_in.js} +5 -3
  337. package/optimize/lib/components/icon/assets/memory.js +1 -3
  338. package/optimize/lib/components/icon/assets/product_timelion.js +40 -0
  339. package/optimize/lib/components/icon/assets/product_tsvb.js +44 -0
  340. package/{test-env/components/icon/assets/namespace.js → optimize/lib/components/icon/assets/push.js} +3 -6
  341. package/optimize/lib/components/icon/assets/route_split.js +40 -0
  342. package/optimize/lib/components/icon/assets/transition_right_in.js +42 -0
  343. package/optimize/lib/components/icon/assets/transition_right_out.js +42 -0
  344. package/optimize/lib/components/icon/assets/wrench.js +1 -3
  345. package/optimize/lib/components/icon/icon_glyphs.a11y.js +1 -1
  346. package/optimize/lib/components/icon/icon_map.js +120 -18
  347. package/optimize/lib/components/icon/svgs/cloud_bolt.svg +4 -0
  348. package/optimize/lib/components/icon/svgs/cloud_rain.svg +4 -0
  349. package/optimize/lib/components/icon/svgs/cloud_sun.svg +4 -0
  350. package/optimize/lib/components/icon/svgs/cube.svg +3 -0
  351. package/optimize/lib/components/icon/svgs/cursor_default.svg +3 -0
  352. package/optimize/lib/components/icon/svgs/kubernetes_namespace.svg +4 -0
  353. package/optimize/lib/components/icon/svgs/log_in.svg +4 -0
  354. package/optimize/lib/components/icon/svgs/memory.svg +1 -10
  355. package/optimize/lib/components/icon/svgs/product_timelion.svg +3 -0
  356. package/optimize/lib/components/icon/svgs/product_tsvb.svg +5 -0
  357. package/optimize/lib/components/icon/svgs/push.svg +4 -0
  358. package/optimize/lib/components/icon/svgs/route_split.svg +3 -0
  359. package/optimize/lib/components/icon/svgs/transition_right_in.svg +4 -0
  360. package/optimize/lib/components/icon/svgs/transition_right_out.svg +4 -0
  361. package/optimize/lib/components/icon/svgs/wrench.svg +1 -1
  362. package/optimize/lib/components/resizable_container/resizable_collapse_button.js +4 -4
  363. package/optimize/lib/global_styling/mixins/_button.js +6 -0
  364. package/optimize/lib/services/accessibility/html_id_generator.js +26 -1
  365. package/package.json +18 -23
  366. package/test-env/components/avatar/avatar.js +1 -1
  367. package/test-env/components/badge/badge.js +1 -1
  368. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  369. package/test-env/components/basic_table/basic_table.js +4 -4
  370. package/test-env/components/basic_table/in_memory_table.js +4 -4
  371. package/test-env/components/button/button.js +20 -6
  372. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  373. package/test-env/components/button/button_empty/button_empty.js +1 -1
  374. package/test-env/components/button/button_group/button_group.js +177 -21
  375. package/test-env/components/button/button_group/button_group.styles.js +60 -8
  376. package/test-env/components/button/button_group/use_button_group_selection.js +36 -0
  377. package/test-env/components/button/button_icon/button_icon.js +21 -8
  378. package/test-env/components/button/split_button/split_button.js +35 -15
  379. package/test-env/components/button/split_button/split_button.styles.js +29 -31
  380. package/test-env/components/button/split_button/split_button_actions.js +15 -4
  381. package/test-env/components/button/use_button_common_props.js +18 -5
  382. package/test-env/components/call_out/call_out.js +2 -2
  383. package/test-env/components/card/card.js +1 -1
  384. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  385. package/test-env/components/comment_list/comment.js +2 -2
  386. package/test-env/components/comment_list/comment_event.js +1 -1
  387. package/test-env/components/comment_list/comment_list.js +2 -2
  388. package/test-env/components/comment_list/comment_timeline.js +1 -1
  389. package/test-env/components/context_menu/context_menu_item.js +1 -1
  390. package/test-env/components/datagrid/body/cell/data_grid_cell.js +27 -27
  391. package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -1
  392. package/test-env/components/datagrid/body/data_grid_body.js +13 -13
  393. package/test-env/components/datagrid/body/data_grid_body_custom.js +13 -13
  394. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  395. package/test-env/components/datagrid/body/footer/data_grid_footer_row.js +5 -2
  396. package/test-env/components/datagrid/body/header/column_actions.js +3 -1
  397. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +2 -1
  398. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +17 -13
  399. package/test-env/components/datagrid/body/header/data_grid_header_cell_wrapper.js +9 -3
  400. package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -0
  401. package/test-env/components/datagrid/controls/column_sorting.js +13 -13
  402. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  403. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  404. package/test-env/components/datagrid/utils/in_memory.js +12 -12
  405. package/test-env/components/datagrid/utils/last_copy_column.js +17 -0
  406. package/test-env/components/date_picker/date_picker.js +2 -2
  407. package/test-env/components/date_picker/date_picker_range.js +1 -1
  408. package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +218 -249
  409. package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
  410. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  411. package/test-env/components/flyout/flyout_menu/flyout_menu.js +39 -14
  412. package/test-env/components/form/field_number/field_number.js +2 -2
  413. package/test-env/components/form/field_text/field_text.js +2 -2
  414. package/test-env/components/form/file_picker/file_picker.js +184 -216
  415. package/test-env/components/form/file_picker/file_picker.styles.js +1 -1
  416. package/test-env/components/form/form_control_button/form_control_button.js +1 -1
  417. package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  418. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  419. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  420. package/test-env/components/form/text_area/text_area.js +2 -2
  421. package/test-env/components/header/header_links/header_link.js +1 -1
  422. package/test-env/components/header/header_links/header_links.js +1 -1
  423. package/test-env/components/header/header_logo/header_logo.js +1 -1
  424. package/test-env/components/header/header_section/header_section_item_button.js +1 -1
  425. package/test-env/components/icon/assets/cloud_bolt.js +42 -0
  426. package/{optimize/lib/components/icon/assets/cloud_sunny.js → test-env/components/icon/assets/cloud_rain.js} +5 -3
  427. package/test-env/components/icon/assets/cloud_sun.js +40 -0
  428. package/test-env/components/icon/assets/cube.js +40 -0
  429. package/test-env/components/icon/assets/cursor_default.js +42 -0
  430. package/test-env/components/icon/assets/kubernetes_namespace.js +42 -0
  431. package/{optimize/lib/components/icon/assets/kql_function.js → test-env/components/icon/assets/log_in.js} +5 -3
  432. package/test-env/components/icon/assets/memory.js +1 -3
  433. package/test-env/components/icon/assets/product_timelion.js +40 -0
  434. package/test-env/components/icon/assets/product_tsvb.js +44 -0
  435. package/{optimize/lib/components/icon/assets/namespace.js → test-env/components/icon/assets/push.js} +3 -6
  436. package/test-env/components/icon/assets/route_split.js +40 -0
  437. package/test-env/components/icon/assets/transition_right_in.js +42 -0
  438. package/test-env/components/icon/assets/transition_right_out.js +42 -0
  439. package/test-env/components/icon/assets/wrench.js +1 -3
  440. package/test-env/components/icon/icon_glyphs.a11y.js +1 -1
  441. package/test-env/components/icon/icon_map.js +120 -18
  442. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  443. package/test-env/components/list_group/list_group.js +2 -2
  444. package/test-env/components/list_group/list_group_item.js +2 -2
  445. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  446. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  447. package/test-env/components/loading/loading_logo.js +1 -1
  448. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  449. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  450. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  451. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  452. package/test-env/components/page/page_header/page_header_content.js +1 -1
  453. package/test-env/components/pagination/pagination_button.js +1 -1
  454. package/test-env/components/resizable_container/resizable_collapse_button.js +4 -4
  455. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  456. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  457. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  458. package/test-env/components/table/table_header_cell.js +1 -1
  459. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  460. package/test-env/components/toast/global_toast_list.js +2 -2
  461. package/test-env/components/toast/toast.js +2 -2
  462. package/test-env/components/tool_tip/icon_tip.js +1 -1
  463. package/test-env/global_styling/mixins/_button.js +6 -0
  464. package/test-env/services/accessibility/html_id_generator.js +11 -0
  465. package/dist/svgs/cloud_drizzle.svg +0 -3
  466. package/dist/svgs/cloud_stormy.svg +0 -3
  467. package/dist/svgs/cloud_sunny.svg +0 -3
  468. package/dist/svgs/kql_function.svg +0 -5
  469. package/dist/svgs/kubernetes_pod.svg +0 -3
  470. package/dist/svgs/menu_down.svg +0 -3
  471. package/dist/svgs/menu_up.svg +0 -3
  472. package/dist/svgs/namespace.svg +0 -3
  473. package/dist/svgs/vis_timelion.svg +0 -3
  474. package/dist/svgs/vis_visual_builder.svg +0 -3
  475. package/es/components/icon/assets/menu_down.js +0 -33
  476. package/es/components/icon/assets/menu_up.js +0 -33
  477. package/es/components/icon/assets/vis_timelion.js +0 -33
  478. package/es/components/icon/assets/vis_visual_builder.js +0 -33
  479. package/es/components/icon/svgs/cloud_drizzle.svg +0 -3
  480. package/es/components/icon/svgs/cloud_stormy.svg +0 -3
  481. package/es/components/icon/svgs/cloud_sunny.svg +0 -3
  482. package/es/components/icon/svgs/kql_function.svg +0 -5
  483. package/es/components/icon/svgs/kubernetes_pod.svg +0 -3
  484. package/es/components/icon/svgs/menu_down.svg +0 -3
  485. package/es/components/icon/svgs/menu_up.svg +0 -3
  486. package/es/components/icon/svgs/namespace.svg +0 -3
  487. package/es/components/icon/svgs/vis_timelion.svg +0 -3
  488. package/es/components/icon/svgs/vis_visual_builder.svg +0 -3
  489. package/lib/components/icon/assets/menu_down.js +0 -40
  490. package/lib/components/icon/assets/menu_up.js +0 -40
  491. package/lib/components/icon/assets/vis_timelion.js +0 -40
  492. package/lib/components/icon/assets/vis_visual_builder.js +0 -40
  493. package/lib/components/icon/svgs/cloud_drizzle.svg +0 -3
  494. package/lib/components/icon/svgs/cloud_stormy.svg +0 -3
  495. package/lib/components/icon/svgs/cloud_sunny.svg +0 -3
  496. package/lib/components/icon/svgs/kql_function.svg +0 -5
  497. package/lib/components/icon/svgs/kubernetes_pod.svg +0 -3
  498. package/lib/components/icon/svgs/menu_down.svg +0 -3
  499. package/lib/components/icon/svgs/menu_up.svg +0 -3
  500. package/lib/components/icon/svgs/namespace.svg +0 -3
  501. package/lib/components/icon/svgs/vis_timelion.svg +0 -3
  502. package/lib/components/icon/svgs/vis_visual_builder.svg +0 -3
  503. package/optimize/es/components/icon/assets/menu_down.js +0 -32
  504. package/optimize/es/components/icon/assets/menu_up.js +0 -32
  505. package/optimize/es/components/icon/assets/vis_timelion.js +0 -32
  506. package/optimize/es/components/icon/assets/vis_visual_builder.js +0 -32
  507. package/optimize/es/components/icon/svgs/cloud_drizzle.svg +0 -3
  508. package/optimize/es/components/icon/svgs/cloud_stormy.svg +0 -3
  509. package/optimize/es/components/icon/svgs/cloud_sunny.svg +0 -3
  510. package/optimize/es/components/icon/svgs/kql_function.svg +0 -5
  511. package/optimize/es/components/icon/svgs/kubernetes_pod.svg +0 -3
  512. package/optimize/es/components/icon/svgs/menu_down.svg +0 -3
  513. package/optimize/es/components/icon/svgs/menu_up.svg +0 -3
  514. package/optimize/es/components/icon/svgs/namespace.svg +0 -3
  515. package/optimize/es/components/icon/svgs/vis_timelion.svg +0 -3
  516. package/optimize/es/components/icon/svgs/vis_visual_builder.svg +0 -3
  517. package/optimize/lib/components/icon/assets/menu_down.js +0 -40
  518. package/optimize/lib/components/icon/assets/menu_up.js +0 -40
  519. package/optimize/lib/components/icon/assets/vis_timelion.js +0 -40
  520. package/optimize/lib/components/icon/assets/vis_visual_builder.js +0 -40
  521. package/optimize/lib/components/icon/svgs/cloud_drizzle.svg +0 -3
  522. package/optimize/lib/components/icon/svgs/cloud_stormy.svg +0 -3
  523. package/optimize/lib/components/icon/svgs/cloud_sunny.svg +0 -3
  524. package/optimize/lib/components/icon/svgs/kql_function.svg +0 -5
  525. package/optimize/lib/components/icon/svgs/kubernetes_pod.svg +0 -3
  526. package/optimize/lib/components/icon/svgs/menu_down.svg +0 -3
  527. package/optimize/lib/components/icon/svgs/menu_up.svg +0 -3
  528. package/optimize/lib/components/icon/svgs/namespace.svg +0 -3
  529. package/optimize/lib/components/icon/svgs/vis_timelion.svg +0 -3
  530. package/optimize/lib/components/icon/svgs/vis_visual_builder.svg +0 -3
  531. package/test-env/components/icon/assets/cloud_drizzle.js +0 -40
  532. package/test-env/components/icon/assets/cloud_stormy.js +0 -40
  533. package/test-env/components/icon/assets/cloud_sunny.js +0 -40
  534. package/test-env/components/icon/assets/menu_down.js +0 -40
  535. package/test-env/components/icon/assets/menu_up.js +0 -40
  536. package/test-env/components/icon/assets/vis_timelion.js +0 -40
  537. 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 ? 'menuLeft' : 'menuUp';
42
- NOT_COLLAPSED_ICON = isHorizontal ? 'menuRight' : 'menuDown';
41
+ COLLAPSED_ICON = isHorizontal ? 'transitionLeftOut' : 'transitionTopOut';
42
+ NOT_COLLAPSED_ICON = isHorizontal ? 'transitionLeftIn' : 'transitionTopIn';
43
43
  break;
44
44
  case 'after':
45
- COLLAPSED_ICON = isHorizontal ? 'menuRight' : 'menuDown';
46
- NOT_COLLAPSED_ICON = isHorizontal ? 'menuLeft' : 'menuUp';
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
- return conditionalId || "".concat(prefix).concat(id).concat(suffix);
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
- fill = _ref.fill,
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
- children = _ref2.children,
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
- _onChange = _ref2.onChange,
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, isFullWidth && styles.fullWidth, gutterSize && gutterSize !== 'none' && styles.gutterSize[gutterSize]];
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
- }, [buttonSize, isDisabled, hasAriaDisabled, isFullWidth]);
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;;label:euiButtonGroup;"),
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 buttonSizes = {
32
- s: "\n border-radius: ".concat(euiTheme.border.radius.small, ";\n ").concat(_highContrastStyles(euiThemeContext), "\n "),
33
- m: "\n border-radius: ".concat(euiTheme.border.radius.medium, ";\n ").concat(_highContrastStyles(euiThemeContext), "\n ")
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
- 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([data-size='s'] &){", buttonSizes.s, ";}&:where([data-size='m'] &){", buttonSizes.m, ";};label:euiButtonGroup__buttons;"),
43
- fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), " .euiButtonGroupButton,.euiButtonGroup__tooltipWrapper{flex:1;", (0, _global_styling.logicalCSS)('width', '100%'), ";}.euiButton{flex-grow:1;inline-size:auto;}.euiButtonEmpty{flex-shrink:0;};label:fullWidth;"),
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)(buttonSizes.m, ";;label:m;"),
47
- s: /*#__PURE__*/(0, _react.css)(buttonSizes.s, ";;label:s;"),
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
- display = _ref$display === void 0 ? 'empty' : _ref$display,
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
- isSelected = _ref.isSelected,
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
  };