@elastic/eui 110.0.0 → 111.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (572) hide show
  1. package/es/components/avatar/avatar.js +1 -1
  2. package/es/components/badge/badge.js +1 -1
  3. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  4. package/es/components/basic_table/basic_table.js +36 -55
  5. package/es/components/basic_table/in_memory_table.js +6 -6
  6. package/es/components/beacon/beacon.styles.js +1 -1
  7. package/es/components/button/button_display/_button_display_content.js +1 -1
  8. package/es/components/button/button_empty/button_empty.js +1 -1
  9. package/es/components/button/button_group/button_group.js +1 -1
  10. package/es/components/button/button_group/button_group_button.js +1 -1
  11. package/es/components/button/button_icon/button_icon.js +1 -1
  12. package/es/components/button/index.js +2 -1
  13. package/es/components/button/split_button/index.js +10 -0
  14. package/es/components/button/split_button/split_button.js +120 -0
  15. package/es/components/button/split_button/split_button.styles.js +51 -0
  16. package/es/components/button/split_button/split_button_actions.js +115 -0
  17. package/{optimize/es/components/flyout/flyout_context.js → es/components/button/split_button/split_button_context.js} +5 -7
  18. package/es/components/call_out/call_out.js +1 -1
  19. package/es/components/card/card.js +1 -1
  20. package/es/components/collapsible_nav/collapsible_nav.js +20 -101
  21. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  22. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  23. package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  24. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  25. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  26. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  27. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  28. package/es/components/comment_list/comment.js +2 -2
  29. package/es/components/comment_list/comment_event.js +1 -1
  30. package/es/components/comment_list/comment_list.js +2 -2
  31. package/es/components/comment_list/comment_timeline.js +1 -1
  32. package/es/components/context_menu/context_menu_item.js +1 -1
  33. package/es/components/datagrid/body/cell/data_grid_cell.js +12 -12
  34. package/es/components/datagrid/body/data_grid_body.js +7 -7
  35. package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
  36. package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  37. package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  38. package/es/components/datagrid/controls/column_sorting.js +7 -7
  39. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  40. package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  41. package/es/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
  42. package/es/components/datagrid/utils/in_memory.js +6 -6
  43. package/es/components/date_picker/date_picker.js +2 -2
  44. package/es/components/date_picker/date_picker_range.js +1 -1
  45. package/es/components/empty_prompt/empty_prompt.js +2 -2
  46. package/es/components/flex/flex_group.js +1 -1
  47. package/es/components/flyout/_flyout_overlay.js +52 -0
  48. package/es/components/flyout/_flyout_resize_button.js +32 -0
  49. package/es/components/flyout/{flyout_resizable.styles.js → _flyout_resize_button.styles.js} +11 -11
  50. package/es/components/flyout/const.js +42 -0
  51. package/es/components/flyout/flyout.component.js +481 -0
  52. package/es/components/flyout/flyout.js +77 -379
  53. package/es/components/flyout/flyout.styles.js +106 -7
  54. package/es/components/flyout/flyout_menu.js +241 -0
  55. package/es/components/flyout/flyout_menu.styles.js +19 -0
  56. package/es/components/flyout/{flyout_context.js → flyout_menu_context.js} +1 -7
  57. package/es/components/flyout/flyout_parent_context.js +36 -0
  58. package/es/components/flyout/flyout_resizable.js +33 -144
  59. package/es/components/flyout/hooks.js +25 -0
  60. package/es/components/flyout/index.js +5 -2
  61. package/es/components/flyout/manager/actions.js +153 -0
  62. package/es/components/flyout/manager/activity_stage.js +95 -0
  63. package/es/components/flyout/manager/const.js +56 -0
  64. package/es/components/flyout/manager/context.js +33 -0
  65. package/es/components/flyout/manager/flyout_child.js +75 -0
  66. package/es/components/flyout/manager/flyout_main.js +65 -0
  67. package/es/components/flyout/manager/flyout_main.styles.js +25 -0
  68. package/es/components/flyout/manager/flyout_managed.js +227 -0
  69. package/es/components/flyout/manager/flyout_managed.styles.js +69 -0
  70. package/es/components/flyout/manager/hooks.js +55 -0
  71. package/es/components/flyout/manager/index.js +31 -0
  72. package/es/components/flyout/manager/layout_mode.js +167 -0
  73. package/es/components/flyout/manager/provider.js +57 -0
  74. package/es/components/flyout/manager/reducer.js +320 -0
  75. package/es/components/flyout/manager/selectors.js +116 -0
  76. package/es/components/flyout/manager/store.js +113 -0
  77. package/es/components/flyout/manager/validation.js +85 -0
  78. package/es/components/flyout/use_flyout_resizable.js +149 -0
  79. package/es/components/flyout/use_flyout_z_index.js +46 -0
  80. package/es/components/form/field_number/field_number.js +2 -2
  81. package/es/components/form/field_text/field_text.js +2 -2
  82. package/es/components/form/form_control_button/form_control_button.js +1 -1
  83. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  84. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  85. package/es/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  86. package/es/components/form/text_area/text_area.js +2 -2
  87. package/es/components/header/header_links/header_link.js +1 -1
  88. package/es/components/header/header_links/header_links.js +1 -1
  89. package/es/components/header/header_logo/header_logo.js +1 -1
  90. package/es/components/header/header_section/header_section_item_button.js +1 -1
  91. package/es/components/horizontal_rule/horizontal_rule.js +1 -1
  92. package/es/components/icon/assets/agentBuilderRobot.js +37 -0
  93. package/es/components/icon/assets/cross_project_search.js +35 -0
  94. package/es/components/icon/assets/dashed_circle.js +35 -0
  95. package/es/components/icon/assets/product_robot.js +37 -0
  96. package/es/components/icon/icon.js +1 -1
  97. package/es/components/icon/icon_map.js +3 -0
  98. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  99. package/es/components/link/external_link_icon.js +6 -3
  100. package/es/components/list_group/list_group.js +2 -2
  101. package/es/components/list_group/list_group_item.js +2 -2
  102. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  103. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  104. package/es/components/loading/loading_logo.js +1 -1
  105. package/es/components/markdown_editor/markdown_editor.js +1 -1
  106. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  107. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  108. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  109. package/es/components/overlay_mask/overlay_mask.js +13 -3
  110. package/es/components/overlay_mask/overlay_mask.styles.js +11 -2
  111. package/es/components/page/page_header/page_header_content.js +2 -2
  112. package/es/components/pagination/pagination_button.js +1 -1
  113. package/es/components/provider/provider.js +2 -1
  114. package/es/components/search_bar/search_bar.js +1 -1
  115. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  116. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  117. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  118. package/es/components/spacer/spacer.js +1 -1
  119. package/es/components/table/table_header_cell.js +1 -1
  120. package/es/components/timeline/timeline_item_icon.js +1 -1
  121. package/es/components/toast/global_toast_list.js +1 -1
  122. package/es/components/toast/toast.js +1 -1
  123. package/es/components/tool_tip/icon_tip.js +1 -1
  124. package/es/components/tour/tour_step_indicator.js +8 -3
  125. package/es/global_styling/mixins/_button.js +28 -9
  126. package/es/global_styling/mixins/_container_query.js +106 -0
  127. package/es/global_styling/mixins/index.js +1 -0
  128. package/es/services/container_query/container_query_hook.js +64 -0
  129. package/es/{components/flyout/sessions → services/container_query}/index.js +1 -2
  130. package/es/services/container_query/match_container.js +242 -0
  131. package/eui.d.ts +7558 -6642
  132. package/i18ntokens.json +1438 -1384
  133. package/lib/components/avatar/avatar.js +1 -1
  134. package/lib/components/badge/badge.js +1 -1
  135. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  136. package/lib/components/basic_table/basic_table.js +36 -55
  137. package/lib/components/basic_table/in_memory_table.js +6 -6
  138. package/lib/components/beacon/beacon.styles.js +1 -1
  139. package/lib/components/button/button_display/_button_display_content.js +1 -1
  140. package/lib/components/button/button_empty/button_empty.js +1 -1
  141. package/lib/components/button/button_group/button_group.js +1 -1
  142. package/lib/components/button/button_group/button_group_button.js +1 -1
  143. package/lib/components/button/button_icon/button_icon.js +1 -1
  144. package/lib/components/button/index.js +8 -1
  145. package/lib/components/button/split_button/index.js +25 -0
  146. package/lib/components/button/split_button/split_button.js +129 -0
  147. package/lib/components/button/split_button/split_button.styles.js +55 -0
  148. package/lib/components/button/split_button/split_button_actions.js +123 -0
  149. package/{optimize/lib/components/flyout/flyout_context.js → lib/components/button/split_button/split_button_context.js} +6 -7
  150. package/lib/components/call_out/call_out.js +1 -1
  151. package/lib/components/card/card.js +1 -1
  152. package/lib/components/collapsible_nav/collapsible_nav.js +20 -101
  153. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  154. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  155. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  156. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  157. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  158. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  159. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  160. package/lib/components/comment_list/comment.js +2 -2
  161. package/lib/components/comment_list/comment_event.js +1 -1
  162. package/lib/components/comment_list/comment_list.js +2 -2
  163. package/lib/components/comment_list/comment_timeline.js +1 -1
  164. package/lib/components/context_menu/context_menu_item.js +1 -1
  165. package/lib/components/datagrid/body/cell/data_grid_cell.js +12 -12
  166. package/lib/components/datagrid/body/data_grid_body.js +7 -7
  167. package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
  168. package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  169. package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  170. package/lib/components/datagrid/controls/column_sorting.js +7 -7
  171. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  172. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  173. package/lib/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
  174. package/lib/components/datagrid/utils/in_memory.js +6 -6
  175. package/lib/components/date_picker/date_picker.js +2 -2
  176. package/lib/components/date_picker/date_picker_range.js +1 -1
  177. package/lib/components/empty_prompt/empty_prompt.js +2 -2
  178. package/lib/components/flex/flex_group.js +1 -1
  179. package/lib/components/flyout/_flyout_overlay.js +59 -0
  180. package/lib/components/flyout/_flyout_resize_button.js +38 -0
  181. package/{test-env/components/flyout/flyout_resizable.styles.js → lib/components/flyout/_flyout_resize_button.styles.js} +12 -12
  182. package/lib/components/flyout/const.js +49 -0
  183. package/lib/components/flyout/flyout.component.js +488 -0
  184. package/lib/components/flyout/flyout.js +102 -379
  185. package/lib/components/flyout/flyout.styles.js +106 -7
  186. package/lib/components/flyout/flyout_menu.js +243 -0
  187. package/lib/components/flyout/flyout_menu.styles.js +25 -0
  188. package/lib/components/flyout/{flyout_context.js → flyout_menu_context.js} +2 -7
  189. package/lib/components/flyout/flyout_parent_context.js +43 -0
  190. package/lib/components/flyout/flyout_resizable.js +36 -147
  191. package/lib/components/flyout/hooks.js +30 -0
  192. package/lib/components/flyout/index.js +21 -14
  193. package/lib/components/flyout/manager/actions.js +159 -0
  194. package/lib/components/flyout/manager/activity_stage.js +101 -0
  195. package/lib/components/flyout/manager/const.js +62 -0
  196. package/lib/components/flyout/manager/context.js +41 -0
  197. package/lib/components/flyout/manager/flyout_child.js +80 -0
  198. package/lib/components/flyout/manager/flyout_main.js +70 -0
  199. package/lib/components/flyout/manager/flyout_main.styles.js +31 -0
  200. package/lib/components/flyout/manager/flyout_managed.js +233 -0
  201. package/lib/components/flyout/manager/flyout_managed.styles.js +73 -0
  202. package/lib/components/flyout/manager/hooks.js +131 -0
  203. package/lib/components/flyout/manager/index.js +168 -0
  204. package/lib/components/flyout/manager/layout_mode.js +171 -0
  205. package/lib/components/flyout/manager/provider.js +63 -0
  206. package/lib/components/flyout/manager/reducer.js +325 -0
  207. package/lib/components/flyout/manager/selectors.js +122 -0
  208. package/lib/components/flyout/manager/store.js +120 -0
  209. package/lib/components/flyout/manager/validation.js +94 -0
  210. package/lib/components/flyout/use_flyout_resizable.js +153 -0
  211. package/lib/components/flyout/use_flyout_z_index.js +51 -0
  212. package/lib/components/form/field_number/field_number.js +2 -2
  213. package/lib/components/form/field_text/field_text.js +2 -2
  214. package/lib/components/form/form_control_button/form_control_button.js +1 -1
  215. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  216. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  217. package/lib/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  218. package/lib/components/form/text_area/text_area.js +2 -2
  219. package/lib/components/header/header_links/header_link.js +1 -1
  220. package/lib/components/header/header_links/header_links.js +1 -1
  221. package/lib/components/header/header_logo/header_logo.js +1 -1
  222. package/lib/components/header/header_section/header_section_item_button.js +1 -1
  223. package/lib/components/horizontal_rule/horizontal_rule.js +1 -1
  224. package/lib/components/icon/assets/agentBuilderRobot.js +44 -0
  225. package/lib/components/icon/assets/cross_project_search.js +42 -0
  226. package/lib/components/icon/assets/dashed_circle.js +42 -0
  227. package/lib/components/icon/assets/product_robot.js +44 -0
  228. package/lib/components/icon/icon.js +1 -1
  229. package/lib/components/icon/icon_map.js +3 -0
  230. package/lib/components/icon/svgs/cross_project_search.svg +3 -0
  231. package/lib/components/icon/svgs/dashed_circle.svg +5 -0
  232. package/lib/components/icon/svgs/product_robot.svg +4 -0
  233. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  234. package/lib/components/link/external_link_icon.js +6 -3
  235. package/lib/components/list_group/list_group.js +2 -2
  236. package/lib/components/list_group/list_group_item.js +2 -2
  237. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  238. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  239. package/lib/components/loading/loading_logo.js +1 -1
  240. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  241. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  242. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  243. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  244. package/lib/components/overlay_mask/overlay_mask.js +12 -2
  245. package/lib/components/overlay_mask/overlay_mask.styles.js +11 -4
  246. package/lib/components/page/page_header/page_header_content.js +2 -2
  247. package/lib/components/pagination/pagination_button.js +1 -1
  248. package/lib/components/provider/provider.js +2 -1
  249. package/lib/components/search_bar/search_bar.js +1 -1
  250. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  251. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  252. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  253. package/lib/components/spacer/spacer.js +1 -1
  254. package/lib/components/table/table_header_cell.js +1 -1
  255. package/lib/components/timeline/timeline_item_icon.js +1 -1
  256. package/lib/components/toast/global_toast_list.js +1 -1
  257. package/lib/components/toast/toast.js +1 -1
  258. package/lib/components/tool_tip/icon_tip.js +1 -1
  259. package/lib/components/tour/tour_step_indicator.js +8 -3
  260. package/lib/global_styling/mixins/_button.js +29 -10
  261. package/lib/global_styling/mixins/_container_query.js +112 -0
  262. package/lib/global_styling/mixins/index.js +11 -0
  263. package/lib/services/container_query/container_query_hook.js +67 -0
  264. package/lib/services/container_query/index.js +16 -0
  265. package/lib/services/container_query/match_container.js +243 -0
  266. package/optimize/es/components/basic_table/basic_table.js +30 -49
  267. package/optimize/es/components/beacon/beacon.styles.js +1 -1
  268. package/optimize/es/components/button/index.js +2 -1
  269. package/optimize/es/components/button/split_button/index.js +10 -0
  270. package/optimize/es/components/button/split_button/split_button.js +98 -0
  271. package/optimize/es/components/button/split_button/split_button.styles.js +51 -0
  272. package/optimize/es/components/button/split_button/split_button_actions.js +89 -0
  273. package/optimize/es/components/button/split_button/split_button_context.js +14 -0
  274. package/optimize/es/components/collapsible_nav/collapsible_nav.js +1 -0
  275. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  276. package/optimize/es/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
  277. package/optimize/es/components/empty_prompt/empty_prompt.js +1 -1
  278. package/optimize/es/components/flex/flex_group.js +1 -1
  279. package/optimize/es/components/flyout/_flyout_overlay.js +52 -0
  280. package/optimize/es/components/flyout/_flyout_resize_button.js +31 -0
  281. package/optimize/es/components/flyout/{flyout_resizable.styles.js → _flyout_resize_button.styles.js} +11 -11
  282. package/optimize/es/components/flyout/const.js +42 -0
  283. package/optimize/es/components/flyout/flyout.component.js +469 -0
  284. package/optimize/es/components/flyout/flyout.js +53 -349
  285. package/optimize/es/components/flyout/flyout.styles.js +103 -7
  286. package/optimize/es/components/flyout/flyout_menu.js +162 -0
  287. package/optimize/es/components/flyout/flyout_menu.styles.js +19 -0
  288. package/optimize/es/components/flyout/flyout_menu_context.js +10 -0
  289. package/optimize/es/components/flyout/flyout_parent_context.js +36 -0
  290. package/optimize/es/components/flyout/flyout_resizable.js +7 -138
  291. package/optimize/es/components/flyout/hooks.js +25 -0
  292. package/optimize/es/components/flyout/index.js +5 -2
  293. package/optimize/es/components/flyout/manager/actions.js +153 -0
  294. package/optimize/es/components/flyout/manager/activity_stage.js +95 -0
  295. package/optimize/es/components/flyout/manager/const.js +56 -0
  296. package/optimize/es/components/flyout/manager/context.js +33 -0
  297. package/optimize/es/components/flyout/manager/flyout_child.js +71 -0
  298. package/optimize/es/components/flyout/manager/flyout_main.js +61 -0
  299. package/optimize/es/components/flyout/manager/flyout_main.styles.js +25 -0
  300. package/optimize/es/components/flyout/manager/flyout_managed.js +223 -0
  301. package/optimize/es/components/flyout/manager/flyout_managed.styles.js +69 -0
  302. package/optimize/es/components/flyout/manager/hooks.js +55 -0
  303. package/optimize/es/components/flyout/manager/index.js +31 -0
  304. package/optimize/es/components/flyout/manager/layout_mode.js +162 -0
  305. package/optimize/es/components/flyout/manager/provider.js +53 -0
  306. package/optimize/es/components/flyout/manager/reducer.js +312 -0
  307. package/optimize/es/components/flyout/manager/selectors.js +116 -0
  308. package/optimize/es/components/flyout/manager/store.js +113 -0
  309. package/optimize/es/components/flyout/manager/types.js +1 -0
  310. package/optimize/es/components/flyout/manager/validation.js +85 -0
  311. package/optimize/es/components/flyout/types.js +1 -0
  312. package/optimize/es/components/flyout/use_flyout_resizable.js +144 -0
  313. package/optimize/es/components/flyout/use_flyout_z_index.js +46 -0
  314. package/optimize/es/components/horizontal_rule/horizontal_rule.js +1 -1
  315. package/optimize/es/components/icon/assets/agentBuilderRobot.js +36 -0
  316. package/optimize/es/components/icon/assets/cross_project_search.js +34 -0
  317. package/optimize/es/components/icon/assets/dashed_circle.js +34 -0
  318. package/optimize/es/components/icon/assets/product_robot.js +36 -0
  319. package/optimize/es/components/icon/icon_map.js +3 -0
  320. package/optimize/es/components/link/external_link_icon.js +6 -3
  321. package/optimize/es/components/overlay_mask/overlay_mask.js +13 -3
  322. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +11 -2
  323. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  324. package/optimize/es/components/provider/provider.js +2 -1
  325. package/optimize/es/components/search_bar/search_bar.js +1 -1
  326. package/optimize/es/components/spacer/spacer.js +1 -1
  327. package/optimize/es/components/tour/tour_step_indicator.js +8 -3
  328. package/optimize/es/global_styling/mixins/_button.js +28 -9
  329. package/optimize/es/global_styling/mixins/_container_query.js +106 -0
  330. package/optimize/es/global_styling/mixins/index.js +1 -0
  331. package/optimize/es/services/container_query/container_query_hook.js +59 -0
  332. package/optimize/es/{components/flyout/sessions → services/container_query}/index.js +1 -2
  333. package/optimize/es/services/container_query/match_container.js +229 -0
  334. package/optimize/lib/components/basic_table/basic_table.js +30 -49
  335. package/optimize/lib/components/beacon/beacon.styles.js +1 -1
  336. package/optimize/lib/components/button/index.js +8 -1
  337. package/optimize/lib/components/button/split_button/index.js +25 -0
  338. package/optimize/lib/components/button/split_button/split_button.js +107 -0
  339. package/optimize/lib/components/button/split_button/split_button.styles.js +55 -0
  340. package/optimize/lib/components/button/split_button/split_button_actions.js +98 -0
  341. package/{test-env/components/flyout/flyout_context.js → optimize/lib/components/button/split_button/split_button_context.js} +6 -7
  342. package/optimize/lib/components/collapsible_nav/collapsible_nav.js +1 -0
  343. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  344. package/optimize/lib/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
  345. package/optimize/lib/components/empty_prompt/empty_prompt.js +1 -1
  346. package/optimize/lib/components/flex/flex_group.js +1 -1
  347. package/optimize/lib/components/flyout/_flyout_overlay.js +62 -0
  348. package/optimize/lib/components/flyout/_flyout_resize_button.js +37 -0
  349. package/{lib/components/flyout/flyout_resizable.styles.js → optimize/lib/components/flyout/_flyout_resize_button.styles.js} +12 -12
  350. package/optimize/lib/components/flyout/const.js +49 -0
  351. package/optimize/lib/components/flyout/flyout.component.js +477 -0
  352. package/optimize/lib/components/flyout/flyout.js +77 -349
  353. package/optimize/lib/components/flyout/flyout.styles.js +103 -7
  354. package/optimize/lib/components/flyout/flyout_menu.js +168 -0
  355. package/optimize/lib/components/flyout/flyout_menu.styles.js +25 -0
  356. package/optimize/lib/components/flyout/flyout_menu_context.js +16 -0
  357. package/optimize/lib/components/flyout/flyout_parent_context.js +43 -0
  358. package/optimize/lib/components/flyout/flyout_resizable.js +9 -139
  359. package/optimize/lib/components/flyout/hooks.js +30 -0
  360. package/optimize/lib/components/flyout/index.js +21 -14
  361. package/optimize/lib/components/flyout/manager/actions.js +159 -0
  362. package/optimize/lib/components/flyout/manager/activity_stage.js +101 -0
  363. package/optimize/lib/components/flyout/manager/const.js +62 -0
  364. package/optimize/lib/components/flyout/manager/context.js +41 -0
  365. package/optimize/lib/components/flyout/manager/flyout_child.js +76 -0
  366. package/optimize/lib/components/flyout/manager/flyout_main.js +66 -0
  367. package/optimize/lib/components/flyout/manager/flyout_main.styles.js +31 -0
  368. package/optimize/lib/components/flyout/manager/flyout_managed.js +231 -0
  369. package/optimize/lib/components/flyout/manager/flyout_managed.styles.js +74 -0
  370. package/optimize/lib/components/flyout/manager/hooks.js +131 -0
  371. package/optimize/lib/components/flyout/manager/index.js +168 -0
  372. package/optimize/lib/components/flyout/manager/layout_mode.js +169 -0
  373. package/optimize/lib/components/flyout/manager/provider.js +61 -0
  374. package/optimize/lib/components/flyout/manager/reducer.js +318 -0
  375. package/optimize/lib/components/flyout/manager/selectors.js +122 -0
  376. package/optimize/lib/components/flyout/manager/store.js +120 -0
  377. package/optimize/lib/components/flyout/manager/validation.js +94 -0
  378. package/optimize/lib/components/flyout/types.js +5 -0
  379. package/optimize/lib/components/flyout/use_flyout_resizable.js +151 -0
  380. package/optimize/lib/components/flyout/use_flyout_z_index.js +51 -0
  381. package/optimize/lib/components/horizontal_rule/horizontal_rule.js +1 -1
  382. package/optimize/lib/components/icon/assets/agentBuilderRobot.js +44 -0
  383. package/optimize/lib/components/icon/assets/cross_project_search.js +42 -0
  384. package/optimize/lib/components/icon/assets/dashed_circle.js +42 -0
  385. package/optimize/lib/components/icon/assets/product_robot.js +44 -0
  386. package/optimize/lib/components/icon/icon_map.js +3 -0
  387. package/optimize/lib/components/icon/svgs/cross_project_search.svg +3 -0
  388. package/optimize/lib/components/icon/svgs/dashed_circle.svg +5 -0
  389. package/optimize/lib/components/icon/svgs/product_robot.svg +4 -0
  390. package/optimize/lib/components/link/external_link_icon.js +6 -3
  391. package/optimize/lib/components/overlay_mask/overlay_mask.js +12 -2
  392. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +11 -4
  393. package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
  394. package/optimize/lib/components/provider/provider.js +2 -1
  395. package/optimize/lib/components/search_bar/search_bar.js +1 -1
  396. package/optimize/lib/components/spacer/spacer.js +1 -1
  397. package/optimize/lib/components/tour/tour_step_indicator.js +8 -3
  398. package/optimize/lib/global_styling/mixins/_button.js +29 -10
  399. package/optimize/lib/global_styling/mixins/_container_query.js +112 -0
  400. package/optimize/lib/global_styling/mixins/index.js +11 -0
  401. package/optimize/lib/services/container_query/container_query_hook.js +65 -0
  402. package/optimize/lib/services/container_query/index.js +16 -0
  403. package/optimize/lib/services/container_query/match_container.js +231 -0
  404. package/package.json +5 -4
  405. package/test-env/components/avatar/avatar.js +1 -1
  406. package/test-env/components/badge/badge.js +1 -1
  407. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  408. package/test-env/components/basic_table/basic_table.js +36 -55
  409. package/test-env/components/basic_table/in_memory_table.js +6 -6
  410. package/test-env/components/beacon/beacon.styles.js +1 -1
  411. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  412. package/test-env/components/button/button_empty/button_empty.js +1 -1
  413. package/test-env/components/button/button_group/button_group.js +1 -1
  414. package/test-env/components/button/button_group/button_group_button.js +1 -1
  415. package/test-env/components/button/button_icon/button_icon.js +1 -1
  416. package/test-env/components/button/index.js +8 -1
  417. package/test-env/components/button/split_button/index.js +25 -0
  418. package/test-env/components/button/split_button/split_button.js +123 -0
  419. package/test-env/components/button/split_button/split_button.styles.js +55 -0
  420. package/test-env/components/button/split_button/split_button_actions.js +120 -0
  421. package/test-env/components/button/split_button/split_button_context.js +20 -0
  422. package/test-env/components/call_out/call_out.js +1 -1
  423. package/test-env/components/card/card.js +1 -1
  424. package/test-env/components/collapsible_nav/collapsible_nav.js +20 -101
  425. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  426. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  427. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +1 -0
  428. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  429. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  430. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  431. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  432. package/test-env/components/comment_list/comment.js +2 -2
  433. package/test-env/components/comment_list/comment_event.js +1 -1
  434. package/test-env/components/comment_list/comment_list.js +2 -2
  435. package/test-env/components/comment_list/comment_timeline.js +1 -1
  436. package/test-env/components/context_menu/context_menu_item.js +1 -1
  437. package/test-env/components/datagrid/body/cell/data_grid_cell.js +12 -12
  438. package/test-env/components/datagrid/body/data_grid_body.js +7 -7
  439. package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
  440. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  441. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  442. package/test-env/components/datagrid/controls/column_sorting.js +7 -7
  443. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  444. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  445. package/test-env/components/datagrid/controls/fullscreen_selector.styles.js +1 -1
  446. package/test-env/components/datagrid/utils/in_memory.js +6 -6
  447. package/test-env/components/date_picker/date_picker.js +2 -2
  448. package/test-env/components/date_picker/date_picker_range.js +1 -1
  449. package/test-env/components/empty_prompt/empty_prompt.js +2 -2
  450. package/test-env/components/flex/flex_group.js +1 -1
  451. package/test-env/components/flyout/_flyout_overlay.js +62 -0
  452. package/test-env/components/flyout/_flyout_resize_button.js +37 -0
  453. package/{optimize/lib/components/flyout/flyout_resizable.styles.js → test-env/components/flyout/_flyout_resize_button.styles.js} +12 -12
  454. package/test-env/components/flyout/const.js +49 -0
  455. package/test-env/components/flyout/flyout.component.js +477 -0
  456. package/test-env/components/flyout/flyout.styles.js +103 -7
  457. package/test-env/components/flyout/flyout_menu.js +241 -0
  458. package/test-env/components/flyout/flyout_menu.styles.js +25 -0
  459. package/test-env/components/flyout/flyout_menu_context.js +16 -0
  460. package/test-env/components/flyout/flyout_parent_context.js +43 -0
  461. package/test-env/components/flyout/flyout_resizable.js +35 -139
  462. package/test-env/components/flyout/hooks.js +30 -0
  463. package/test-env/components/flyout/index.js +21 -14
  464. package/test-env/components/flyout/manager/actions.js +159 -0
  465. package/test-env/components/flyout/manager/activity_stage.js +101 -0
  466. package/test-env/components/flyout/manager/const.js +62 -0
  467. package/test-env/components/flyout/manager/context.js +41 -0
  468. package/test-env/components/flyout/manager/flyout_child.js +76 -0
  469. package/test-env/components/flyout/manager/flyout_main.js +66 -0
  470. package/test-env/components/flyout/manager/flyout_main.styles.js +31 -0
  471. package/test-env/components/flyout/manager/flyout_managed.js +231 -0
  472. package/test-env/components/flyout/manager/flyout_managed.styles.js +74 -0
  473. package/test-env/components/flyout/manager/hooks.js +131 -0
  474. package/test-env/components/flyout/manager/index.js +168 -0
  475. package/test-env/components/flyout/manager/layout_mode.js +169 -0
  476. package/test-env/components/flyout/manager/provider.js +61 -0
  477. package/test-env/components/flyout/manager/reducer.js +318 -0
  478. package/test-env/components/flyout/manager/selectors.js +122 -0
  479. package/test-env/components/flyout/manager/store.js +120 -0
  480. package/test-env/components/flyout/manager/types.js +5 -0
  481. package/test-env/components/flyout/manager/validation.js +94 -0
  482. package/test-env/components/flyout/types.js +5 -0
  483. package/test-env/components/flyout/use_flyout_resizable.js +151 -0
  484. package/test-env/components/flyout/use_flyout_z_index.js +51 -0
  485. package/test-env/components/form/field_number/field_number.js +2 -2
  486. package/test-env/components/form/field_text/field_text.js +2 -2
  487. package/test-env/components/form/form_control_button/form_control_button.js +1 -1
  488. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  489. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  490. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +2 -2
  491. package/test-env/components/form/text_area/text_area.js +2 -2
  492. package/test-env/components/header/header_links/header_link.js +1 -1
  493. package/test-env/components/header/header_links/header_links.js +1 -1
  494. package/test-env/components/header/header_logo/header_logo.js +1 -1
  495. package/test-env/components/header/header_section/header_section_item_button.js +1 -1
  496. package/test-env/components/horizontal_rule/horizontal_rule.js +1 -1
  497. package/test-env/components/icon/assets/agentBuilderRobot.js +44 -0
  498. package/test-env/components/icon/assets/cross_project_search.js +42 -0
  499. package/test-env/components/icon/assets/dashed_circle.js +42 -0
  500. package/test-env/components/icon/assets/product_robot.js +44 -0
  501. package/test-env/components/icon/icon_map.js +3 -0
  502. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  503. package/test-env/components/link/external_link_icon.js +6 -3
  504. package/test-env/components/list_group/list_group.js +2 -2
  505. package/test-env/components/list_group/list_group_item.js +2 -2
  506. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  507. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  508. package/test-env/components/loading/loading_logo.js +1 -1
  509. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  510. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  511. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  512. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  513. package/test-env/components/overlay_mask/overlay_mask.js +12 -2
  514. package/test-env/components/overlay_mask/overlay_mask.styles.js +11 -4
  515. package/test-env/components/page/page_header/page_header_content.js +2 -2
  516. package/test-env/components/pagination/pagination_button.js +1 -1
  517. package/test-env/components/provider/provider.js +2 -1
  518. package/test-env/components/search_bar/search_bar.js +1 -1
  519. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  520. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  521. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  522. package/test-env/components/spacer/spacer.js +1 -1
  523. package/test-env/components/table/table_header_cell.js +1 -1
  524. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  525. package/test-env/components/toast/global_toast_list.js +1 -1
  526. package/test-env/components/toast/toast.js +1 -1
  527. package/test-env/components/tool_tip/icon_tip.js +1 -1
  528. package/test-env/components/tour/tour_step_indicator.js +8 -3
  529. package/test-env/global_styling/mixins/_button.js +29 -10
  530. package/test-env/global_styling/mixins/_container_query.js +112 -0
  531. package/test-env/global_styling/mixins/index.js +11 -0
  532. package/test-env/services/container_query/container_query_hook.js +65 -0
  533. package/test-env/services/container_query/index.js +16 -0
  534. package/test-env/services/container_query/match_container.js +231 -0
  535. package/es/components/flyout/flyout_child.js +0 -223
  536. package/es/components/flyout/flyout_child.styles.js +0 -32
  537. package/es/components/flyout/flyout_child_manager.js +0 -114
  538. package/es/components/flyout/sessions/flyout_provider.js +0 -95
  539. package/es/components/flyout/sessions/flyout_reducer.js +0 -195
  540. package/es/components/flyout/sessions/use_eui_flyout.js +0 -82
  541. package/lib/components/flyout/flyout_child.js +0 -231
  542. package/lib/components/flyout/flyout_child.styles.js +0 -38
  543. package/lib/components/flyout/flyout_child_manager.js +0 -122
  544. package/lib/components/flyout/sessions/flyout_provider.js +0 -102
  545. package/lib/components/flyout/sessions/flyout_reducer.js +0 -202
  546. package/lib/components/flyout/sessions/index.js +0 -25
  547. package/lib/components/flyout/sessions/use_eui_flyout.js +0 -88
  548. package/optimize/es/components/flyout/flyout_child.js +0 -178
  549. package/optimize/es/components/flyout/flyout_child.styles.js +0 -32
  550. package/optimize/es/components/flyout/flyout_child_manager.js +0 -100
  551. package/optimize/es/components/flyout/sessions/flyout_provider.js +0 -90
  552. package/optimize/es/components/flyout/sessions/flyout_reducer.js +0 -187
  553. package/optimize/es/components/flyout/sessions/use_eui_flyout.js +0 -82
  554. package/optimize/lib/components/flyout/flyout_child.js +0 -186
  555. package/optimize/lib/components/flyout/flyout_child.styles.js +0 -38
  556. package/optimize/lib/components/flyout/flyout_child_manager.js +0 -110
  557. package/optimize/lib/components/flyout/sessions/flyout_provider.js +0 -100
  558. package/optimize/lib/components/flyout/sessions/flyout_reducer.js +0 -195
  559. package/optimize/lib/components/flyout/sessions/index.js +0 -25
  560. package/optimize/lib/components/flyout/sessions/use_eui_flyout.js +0 -88
  561. package/test-env/components/flyout/flyout_child.js +0 -230
  562. package/test-env/components/flyout/flyout_child.styles.js +0 -38
  563. package/test-env/components/flyout/flyout_child_manager.js +0 -119
  564. package/test-env/components/flyout/sessions/flyout_provider.js +0 -100
  565. package/test-env/components/flyout/sessions/flyout_reducer.js +0 -195
  566. package/test-env/components/flyout/sessions/index.js +0 -25
  567. package/test-env/components/flyout/sessions/use_eui_flyout.js +0 -88
  568. /package/es/components/flyout/{sessions → manager}/types.js +0 -0
  569. /package/{optimize/es/components/flyout/sessions → es/components/flyout}/types.js +0 -0
  570. /package/lib/components/flyout/{sessions → manager}/types.js +0 -0
  571. /package/{optimize/lib/components/flyout/sessions → lib/components/flyout}/types.js +0 -0
  572. /package/{test-env/components/flyout/sessions → optimize/lib/components/flyout/manager}/types.js +0 -0
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useEuiContainerQuery = useEuiContainerQuery;
7
+ var _react = require("react");
8
+ var _match_container = require("./match_container");
9
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
14
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
21
+ /**
22
+ * React hook that subscribes to CSS container query changes.
23
+ *
24
+ * For this to work:
25
+ * - a proper container (an element with e.g. `container-type: inline-size`) is needed, and
26
+ * - the container MUST to be a parent of the element being observed
27
+ *
28
+ * @param containerCondition - A CSS `<container-condition>` string, e.g. `(width > 400px)` or `(min-width: 600px)`
29
+ * @param name - Optional container name, e.g. `sidebar`
30
+ * @returns An object containing:
31
+ * - `ref`: A ref to attach to the container element
32
+ * - `matches`: `true` if the container matches the condition, `false` otherwise
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * const { ref, matches } = useEuiContainerQuery('(width > 400px)');
37
+ * return <div ref={ref}>{matches ? 'Wide' : 'Narrow'}</div>;
38
+ * ```
39
+ *
40
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@container | MDN: @container}
41
+ * @beta
42
+ */
43
+ function useEuiContainerQuery(containerCondition, name) {
44
+ var containerQueryString = name ? "".concat(name, " ").concat(containerCondition) : containerCondition;
45
+ var ref = (0, _react.useRef)(null);
46
+ var _useState = (0, _react.useState)(false),
47
+ _useState2 = _slicedToArray(_useState, 2),
48
+ matches = _useState2[0],
49
+ setMatches = _useState2[1];
50
+ (0, _react.useEffect)(function () {
51
+ if (!ref.current) return;
52
+ var queryList = (0, _match_container.matchContainer)(ref.current, containerQueryString);
53
+ var handleChange = function handleChange() {
54
+ setMatches(queryList.matches);
55
+ };
56
+ setMatches(queryList.matches);
57
+ queryList.addEventListener('change', handleChange);
58
+ return function () {
59
+ queryList.removeEventListener('change', handleChange);
60
+ queryList.dispose();
61
+ };
62
+ }, [ref, containerQueryString]);
63
+ return {
64
+ ref: ref,
65
+ matches: matches
66
+ };
67
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _container_query_hook = require("./container_query_hook");
7
+ Object.keys(_container_query_hook).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _container_query_hook[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _container_query_hook[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ContainerQueryListChangeEvent = exports.ContainerQueryList = void 0;
7
+ exports.matchContainer = matchContainer;
8
+ var _uuid = require("uuid");
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
11
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
14
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
15
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
16
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
17
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
18
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
19
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
20
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
21
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
22
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
23
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
24
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
25
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
26
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
27
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
28
+ function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, _getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), _setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
29
+ function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
30
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
31
+ function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
32
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
33
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
34
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
35
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
36
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
37
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
38
+ * or more contributor license agreements. Licensed under the Elastic License
39
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
40
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
41
+ * Side Public License, v 1.
42
+ */ /**
43
+ * @license MIT License
44
+ *
45
+ * Copyright (c) 2025 Martin Winkler
46
+ *
47
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
48
+ * of this software and associated documentation files (the "Software"), to deal
49
+ * in the Software without restriction, including without limitation the rights
50
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
51
+ * copies of the Software, and to permit persons to whom the Software is
52
+ * furnished to do so, subject to the following conditions:
53
+ *
54
+ * The above copyright notice and this permission notice shall be included in all
55
+ * copies or substantial portions of the Software.
56
+ *
57
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
58
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
59
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
60
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
61
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
62
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
63
+ * SOFTWARE.
64
+ *
65
+ * @see {@link https://github.com/teetotum/match-container/blob/main/matchContainer.js}
66
+ */
67
+ /**
68
+ * Listen for changes on a container query.
69
+ * Just like `window.matchMedia`.
70
+ *
71
+ * @example
72
+ * ```js
73
+ * const cql = matchContainer(element, '(width > 42rem)');
74
+ * cql.addEventListener('change', ({ matches }) {
75
+ * // ..
76
+ * })
77
+ * ```
78
+ *
79
+ * @param element
80
+ * @param containerQueryString e.g. (width > 42rem)
81
+ * @returns ContainerQueryList
82
+ */
83
+ function matchContainer(element, containerQueryString) {
84
+ return new ContainerQueryList(element, containerQueryString);
85
+ }
86
+
87
+ /**
88
+ * `change` event dispatched by instances of {@link ContainerQueryList}
89
+ * whenever the value of `matches` changes
90
+ */
91
+ var ContainerQueryListChangeEvent = exports.ContainerQueryListChangeEvent = /*#__PURE__*/function (_Event) {
92
+ function ContainerQueryListChangeEvent(matches, container) {
93
+ var _this;
94
+ _classCallCheck(this, ContainerQueryListChangeEvent);
95
+ _this = _callSuper(this, ContainerQueryListChangeEvent, ['change']);
96
+ /** Whether the container query matches */
97
+ _defineProperty(_this, "matches", void 0);
98
+ /** A string representation of the container query list e.g. "(width > 1000px)" */
99
+ _defineProperty(_this, "container", void 0);
100
+ _this.matches = matches;
101
+ _this.container = container;
102
+ return _this;
103
+ }
104
+ _inherits(ContainerQueryListChangeEvent, _Event);
105
+ return _createClass(ContainerQueryListChangeEvent);
106
+ }( /*#__PURE__*/_wrapNativeSuper(Event));
107
+ /**
108
+ * A hacky implementation of a possible native `ContainerQueryList`
109
+ * based on the teetotum/match-container polyfill:
110
+ * - based on a API proposal in W3C CSS WG {@link https://github.com/w3c/csswg-drafts/issues/6205})
111
+ * - mimicking MediaQueryList {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList}
112
+ *
113
+ * Not meant to be used directly, but rather call `matchContainer`.
114
+ *
115
+ * It works by listening on a `transitionrun` event on the element,
116
+ * that gets triggered by a container query changing a custom property.
117
+ * Setting `transition-behavior: allow-discrete` is what makes it possible
118
+ * to have a CSS `transition` for a custom property.
119
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/transition-behavior}
120
+ */
121
+ var _matches = /*#__PURE__*/new WeakMap();
122
+ var ContainerQueryList = exports.ContainerQueryList = /*#__PURE__*/function (_EventTarget) {
123
+ function ContainerQueryList(element, containerQueryString) {
124
+ var _this2;
125
+ _classCallCheck(this, ContainerQueryList);
126
+ _this2 = _callSuper(this, ContainerQueryList);
127
+ _defineProperty(_this2, "element", null);
128
+ _defineProperty(_this2, "styleSheet", null);
129
+ _defineProperty(_this2, "markerAttributeName", '');
130
+ _defineProperty(_this2, "sentinelPropertyName", '');
131
+ _defineProperty(_this2, "computedStyle", null);
132
+ _defineProperty(_this2, "transitionRunListener", null);
133
+ _classPrivateFieldInitSpec(_this2, _matches, false);
134
+ /**
135
+ * A string representation of the container query list e.g. "(width > 1000px)"
136
+ * (the name is weird but it is so for consistency with mediaQueryList.media)
137
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/media}
138
+ * */
139
+ _defineProperty(_this2, "container", void 0);
140
+ _this2.container = containerQueryString;
141
+ _this2.element = element;
142
+ // we call this only once to try to avoid any impact on performance
143
+ _this2.computedStyle = getComputedStyle(_this2.element);
144
+ var uniqueName = "container-query-observer-".concat((0, _uuid.v1)());
145
+ _this2.markerAttributeName = "data-".concat(uniqueName);
146
+ _this2.sentinelPropertyName = "--".concat(uniqueName);
147
+
148
+ // order is important (as in life)
149
+ _this2.applyMarkerAttribute();
150
+ _this2.createStyleSheet();
151
+ _classPrivateFieldSet(_matches, _this2, _this2.computedStyle.getPropertyValue(_this2.sentinelPropertyName) === '--true');
152
+ _this2.setupTransitionListener();
153
+ return _this2;
154
+ }
155
+
156
+ /**
157
+ * The marker attribute is `data-container-query-observer-{UUID}`,
158
+ * it will be used as a selector in the container query,
159
+ * in the global CSS that's being added below.
160
+ */
161
+ _inherits(ContainerQueryList, _EventTarget);
162
+ return _createClass(ContainerQueryList, [{
163
+ key: "matches",
164
+ get: /** Whether the container query matches */
165
+ function get() {
166
+ return _classPrivateFieldGet(_matches, this);
167
+ }
168
+ }, {
169
+ key: "applyMarkerAttribute",
170
+ value: function applyMarkerAttribute() {
171
+ this.element.setAttribute(this.markerAttributeName, '');
172
+ }
173
+
174
+ /**
175
+ * Create a CSS custom property with values either `--true` or `--false`,
176
+ * and add container query targetting the element.
177
+ * Whenever the container query matches, the custom property will be `--true`.
178
+ * This styles are added globaly via `document.adoptedStyleSheets`.
179
+ */
180
+ }, {
181
+ key: "createStyleSheet",
182
+ value: function createStyleSheet() {
183
+ var css = "\n @property ".concat(this.sentinelPropertyName, " {\n syntax: '<custom-ident>';\n inherits: false;\n initial-value: --false;\n }\n @container ").concat(this.container, " {\n [").concat(this.markerAttributeName, "] {\n ").concat(this.sentinelPropertyName, ": --true;\n }\n }\n ");
184
+ var styleSheet = new CSSStyleSheet();
185
+ styleSheet.replaceSync(css);
186
+ document.adoptedStyleSheets = [].concat(_toConsumableArray(document.adoptedStyleSheets), [styleSheet]);
187
+ this.styleSheet = styleSheet;
188
+ }
189
+
190
+ /**
191
+ * This is the key to the hack:
192
+ * - a `transition` style is added for the custom property
193
+ * - the `transitionrun` event will fire whenever the custom property value changes
194
+ * because of the container query
195
+ * - we get the value from computed styles
196
+ * - the `matches` value is updated and
197
+ * - a ContainerQueryListChangeEvent event is dispatched
198
+ */
199
+ }, {
200
+ key: "setupTransitionListener",
201
+ value: function setupTransitionListener() {
202
+ var _this3 = this;
203
+ var element = this.element,
204
+ computedStyle = this.computedStyle,
205
+ sentinelPropertyName = this.sentinelPropertyName;
206
+ if (!element) return;
207
+ var currentValue = computedStyle.getPropertyValue(sentinelPropertyName);
208
+ element.style.setProperty('transition', "".concat(sentinelPropertyName, " 0.001ms step-start"));
209
+ element.style.setProperty('transition-behavior', 'allow-discrete');
210
+ this.transitionRunListener = function (event) {
211
+ if (event.target !== element) return;
212
+ var nextValue = computedStyle.getPropertyValue(sentinelPropertyName);
213
+ if (nextValue === currentValue) return;
214
+ currentValue = nextValue;
215
+ _classPrivateFieldSet(_matches, _this3, nextValue === '--true');
216
+ _this3.dispatchEvent(new ContainerQueryListChangeEvent(_classPrivateFieldGet(_matches, _this3), _this3.container));
217
+ };
218
+ element.addEventListener('transitionrun', this.transitionRunListener);
219
+ }
220
+ }, {
221
+ key: "dispose",
222
+ value: function dispose() {
223
+ var _this4 = this;
224
+ // remove the stylesheet from adoptedStyleSheets
225
+ if (this.styleSheet) {
226
+ document.adoptedStyleSheets = document.adoptedStyleSheets.filter(function (sheet) {
227
+ return sheet !== _this4.styleSheet;
228
+ });
229
+ }
230
+ if (!this.element) return;
231
+ if (this.transitionRunListener) {
232
+ this.element.removeEventListener('transitionrun', this.transitionRunListener);
233
+ }
234
+ this.element.removeAttribute(this.markerAttributeName);
235
+ this.element.style.removeProperty('transition');
236
+ this.element.style.removeProperty('transition-behavior');
237
+ this.element = null;
238
+ this.styleSheet = null;
239
+ this.computedStyle = null;
240
+ this.transitionRunListener = null;
241
+ }
242
+ }]);
243
+ }( /*#__PURE__*/_wrapNativeSuper(EventTarget));
@@ -428,59 +428,40 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
428
428
  var totalItemCount = pagination ? pagination.totalItemCount : itemCount;
429
429
  var page = pagination ? pagination.pageIndex + 1 : 1;
430
430
  var pageCount = pagination ? Math.ceil(pagination.totalItemCount / this.pageSize) : 1;
431
- var captionElement;
432
- if (tableCaption) {
433
- if (pagination) {
434
- captionElement = ___EmotionJSX(EuiI18n, {
435
- token: "euiBasicTable.tableCaptionWithPagination",
436
- default: "{tableCaption}; Page {page} of {pageCount}.",
437
- values: {
438
- tableCaption: tableCaption,
439
- page: page,
440
- pageCount: pageCount
441
- }
442
- });
443
- } else {
444
- captionElement = tableCaption;
445
- }
446
- } else {
447
- if (pagination) {
448
- if (pagination.totalItemCount > 0) {
449
- captionElement = ___EmotionJSX(EuiI18n, {
450
- token: "euiBasicTable.tableAutoCaptionWithPagination",
451
- default: "This table contains {itemCount} rows out of {totalItemCount} rows; Page {page} of {pageCount}.",
452
- values: {
453
- totalItemCount: totalItemCount,
454
- itemCount: itemCount,
455
- page: page,
456
- pageCount: pageCount
457
- }
458
- });
459
- } else {
460
- captionElement = ___EmotionJSX(EuiI18n, {
461
- token: "euiBasicTable.tableSimpleAutoCaptionWithPagination",
462
- default: "This table contains {itemCount} rows; Page {page} of {pageCount}.",
463
- values: {
464
- itemCount: itemCount,
465
- page: page,
466
- pageCount: pageCount
467
- }
468
- });
431
+ var itemCountPart = null;
432
+ if (!itemCount) {
433
+ itemCountPart = "".concat(this.props.noItemsMessage, ",");
434
+ } else if (pagination && totalItemCount > 0) {
435
+ itemCountPart = ___EmotionJSX("p", null, ___EmotionJSX(EuiI18n, {
436
+ token: "euiBasicTable.caption.itemCountPart.withTotalItemCount",
437
+ default: "Showing {itemCount} of {totalItemCount} data rows.",
438
+ values: {
439
+ itemCount: itemCount,
440
+ totalItemCount: totalItemCount
469
441
  }
470
- } else {
471
- captionElement = ___EmotionJSX(EuiI18n, {
472
- token: "euiBasicTable.tableAutoCaptionWithoutPagination",
473
- default: "This table contains {itemCount} rows.",
474
- values: {
475
- itemCount: itemCount
476
- }
477
- });
478
- }
442
+ }));
443
+ }
444
+ var paginationPart = null;
445
+ if (pagination && pageCount > 1) {
446
+ paginationPart = ___EmotionJSX("p", null, ___EmotionJSX(EuiI18n, {
447
+ token: "euiBasicTable.caption.paginationPart.withPageCount",
448
+ default: "Page {page} of {pageCount}.",
449
+ values: {
450
+ page: page,
451
+ pageCount: pageCount
452
+ }
453
+ }));
479
454
  }
480
455
  return ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("caption", {
481
456
  css: euiTableCaptionStyles,
482
457
  className: "euiTableCaption"
483
- }, tabularCopyMarkers.hiddenNoCopyBoundary, ___EmotionJSX(EuiDelayRender, null, captionElement), tabularCopyMarkers.hiddenNoCopyBoundary));
458
+ }, tabularCopyMarkers.hiddenNoCopyBoundary, ___EmotionJSX(EuiDelayRender, null, ___EmotionJSX("p", null, tableCaption || ___EmotionJSX(EuiI18n, {
459
+ token: "euiBasicTable.caption.tableName",
460
+ default: "Data table"
461
+ }), itemCount === 0 && ___EmotionJSX(React.Fragment, null, ' ', ___EmotionJSX(EuiI18n, {
462
+ token: "euiBasicTable.caption.emptyState",
463
+ default: "(empty)"
464
+ })), ','), itemCountPart, paginationPart), tabularCopyMarkers.hiddenNoCopyBoundary));
484
465
  }
485
466
  }, {
486
467
  key: "renderTableHead",
@@ -960,7 +941,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
960
941
  key: "getDerivedStateFromProps",
961
942
  value: function getDerivedStateFromProps(nextProps, prevState) {
962
943
  if (!nextProps.selection) {
963
- // next props doesn't have a selection, reset our state
944
+ // next props don't have a selection, reset our state
964
945
  return {
965
946
  selection: []
966
947
  };
@@ -23,7 +23,7 @@ export var euiBeaconStyles = function euiBeaconStyles(euiThemeContext) {
23
23
  euiBeacon: /*#__PURE__*/css("position:relative;display:flex;justify-content:center;border-radius:50%;", preventForcedColors(euiThemeContext), " svg{", logicalSizeCSS('100%'), ";}&::before,&::after{position:absolute;content:'';", logicalSizeCSS('100%'), " ", logicalCSS('left', 0), " ", logicalCSS('top', 0), " background-color:transparent;border-radius:50%;}&::before{transform:scale(1.6);opacity:0.4;}&::after{opacity:0;}", euiCanAnimate, "{&::before{animation:", euiBeaconPulseLarge, " 2.5s infinite ease-out;}&::after{animation:", euiBeaconPulseSmall, " 2.5s infinite ease-out 0.25s;}};label:euiBeacon;"),
24
24
  subdued: /*#__PURE__*/css(_colorCSS(euiTheme.colors.textSubdued), ";label:subdued;"),
25
25
  primary: /*#__PURE__*/css(_colorCSS(euiTheme.colors.primary), ";label:primary;"),
26
- success: /*#__PURE__*/css(_colorCSS(euiTheme.colors.accentSecondary), ";label:success;"),
26
+ success: /*#__PURE__*/css(_colorCSS(euiTheme.colors.success), ";label:success;"),
27
27
  warning: /*#__PURE__*/css(_colorCSS(euiTheme.colors.warning), ";label:warning;"),
28
28
  danger: /*#__PURE__*/css(_colorCSS(euiTheme.colors.danger), ";label:danger;"),
29
29
  accent: /*#__PURE__*/css(_colorCSS(euiTheme.colors.accent), ";label:accent;")
@@ -9,4 +9,5 @@
9
9
  export { COLORS, EuiButton } from './button';
10
10
  export { EuiButtonEmpty } from './button_empty';
11
11
  export { EuiButtonIcon } from './button_icon';
12
- export { EuiButtonGroup } from './button_group';
12
+ export { EuiButtonGroup } from './button_group';
13
+ export { EuiSplitButton } from './split_button';
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ export { EuiSplitButton } from './split_button';
10
+ export { EuiSplitButtonActionPrimary, EuiSplitButtonActionSecondary } from './split_button_actions';
@@ -0,0 +1,98 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["className", "children", "size", "color", "fill", "isDisabled", "hasAriaDisabled", "isLoading"];
5
+ /*
6
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
+ * or more contributor license agreements. Licensed under the Elastic License
8
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
10
+ * Side Public License, v 1.
11
+ */
12
+
13
+ import classNames from 'classnames';
14
+ import React, { Children, Fragment, isValidElement, useMemo } from 'react';
15
+ import { useEuiMemoizedStyles, useEuiTheme, useGeneratedHtmlId } from '../../../services';
16
+ import { getEuiButtonColors, getEuiFilledButtonColors } from '../../../global_styling';
17
+ import { EuiSplitButtonContext } from './split_button_context';
18
+ import { EuiSplitButtonActionPrimary, EuiSplitButtonActionSecondary } from './split_button_actions';
19
+ import { euiSplitButtonDividerStyles, euiSplitButtonStyles } from './split_button.styles';
20
+ import { jsx as ___EmotionJSX } from "@emotion/react";
21
+ export var _EuiSplitButton = function _EuiSplitButton(_ref) {
22
+ var className = _ref.className,
23
+ children = _ref.children,
24
+ _ref$size = _ref.size,
25
+ size = _ref$size === void 0 ? 'm' : _ref$size,
26
+ _ref$color = _ref.color,
27
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
28
+ _ref$fill = _ref.fill,
29
+ fill = _ref$fill === void 0 ? false : _ref$fill,
30
+ isDisabled = _ref.isDisabled,
31
+ hasAriaDisabled = _ref.hasAriaDisabled,
32
+ isLoading = _ref.isLoading,
33
+ rest = _objectWithoutProperties(_ref, _excluded);
34
+ var euiThemeContext = useEuiTheme();
35
+ var highContrastMode = euiThemeContext.highContrastMode;
36
+ var _children = _slicedToArray(children, 2),
37
+ primaryAction = _children[0],
38
+ secondaryAction = _children[1];
39
+ var key = useGeneratedHtmlId({
40
+ suffix: 'EuiSplitButton'
41
+ });
42
+ var commonProps = {
43
+ size: size,
44
+ color: color,
45
+ fill: fill,
46
+ isDisabled: isDisabled,
47
+ hasAriaDisabled: hasAriaDisabled,
48
+ isLoading: isLoading
49
+ };
50
+ var buttonFilledColors = getEuiFilledButtonColors(euiThemeContext, isDisabled ? 'disabled' : color);
51
+ var buttonColors = getEuiButtonColors(euiThemeContext, isDisabled ? 'disabled' : color);
52
+ var classes = classNames('euiSplitButton', className);
53
+ var styles = useEuiMemoizedStyles(euiSplitButtonStyles);
54
+ var cssStyles = [styles.euiSplitButton, fill && styles.fill];
55
+ var dividerStyles = useMemo(function () {
56
+ return euiSplitButtonDividerStyles(euiThemeContext, !fill ? buttonColors.borderColor : highContrastMode && fill ? buttonFilledColors.backgroundColor : 'transparent');
57
+ }, [euiThemeContext, highContrastMode, fill, buttonFilledColors.backgroundColor, buttonColors.borderColor]);
58
+
59
+ // NOTE: dev-mode-only runtime check to evaluate if correct child components are passed
60
+ if (process.env.NODE_ENV !== 'production') {
61
+ var childArray = Children.toArray(children);
62
+ var expectedTypes = [['EuiSplitButton.ActionPrimary', 'EuiSplitButtonActionPrimary'], ['EuiSplitButton.ActionSecondary', 'EuiSplitButtonActionSecondary']];
63
+ childArray.forEach(function (child, index) {
64
+ if (! /*#__PURE__*/isValidElement(child)) return;
65
+ var componentName = getComponentName(child.type);
66
+ var expectedComponents = expectedTypes[index];
67
+ if (!expectedComponents.includes(componentName)) {
68
+ console.warn("\u26A0\uFE0F EuiSplitButton: Expected <".concat(expectedComponents[0], "> at position ").concat(index + 1, ", got <").concat(componentName, ">. You might be using a wrapper. Using e.g. React.memo() or React.lazy() is valid, other component wrappers are not and will break styling.\n To verify expected usage, please check the documentation: https://eui.elastic.co/docs/components/navigation/buttons/split-button/"));
69
+ }
70
+ });
71
+ }
72
+ return ___EmotionJSX("div", _extends({
73
+ role: "group",
74
+ className: classes,
75
+ css: cssStyles
76
+ }, rest), ___EmotionJSX(EuiSplitButtonContext.Provider, {
77
+ value: commonProps
78
+ }, ___EmotionJSX(Fragment, {
79
+ key: "".concat(key, "-primaryAction")
80
+ }, primaryAction), ___EmotionJSX("div", {
81
+ className: "euiSplitButton__divider",
82
+ css: dividerStyles.divider,
83
+ "aria-hidden": "true"
84
+ }), ___EmotionJSX(Fragment, {
85
+ key: "".concat(key, "-secondaryAction")
86
+ }, secondaryAction)));
87
+ };
88
+ export var EuiSplitButton = Object.assign(_EuiSplitButton, {
89
+ ActionPrimary: EuiSplitButtonActionPrimary,
90
+ ActionSecondary: EuiSplitButtonActionSecondary
91
+ });
92
+
93
+ /* internal utils */
94
+
95
+ var getComponentName = function getComponentName(type) {
96
+ if (typeof type === 'string') return type;
97
+ return type.displayName || type.name || 'Unknown';
98
+ };
@@ -0,0 +1,51 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+
10
+ import { css } from '@emotion/react';
11
+ import { euiDisabledSelector, highContrastModeStyles } from '../../../global_styling';
12
+ export var euiSplitButtonStyles = function euiSplitButtonStyles(euiThemeContext) {
13
+ var euiTheme = euiThemeContext.euiTheme;
14
+ var primaryDisabledSelector = ".euiSplitButtonActionPrimary:is(".concat(euiDisabledSelector, ")");
15
+ var secondaryDisabledSelector = ".euiSplitButtonActionSecondary:is(".concat(euiDisabledSelector, ")");
16
+ var dividerSelector = ".euiSplitButton__divider";
17
+ return {
18
+ euiSplitButton: /*#__PURE__*/css("display:inline-flex;flex-wrap:nowrap;&:has(", primaryDisabledSelector, "):has(", secondaryDisabledSelector, "){", dividerSelector, "{", highContrastModeStyles(euiThemeContext, {
19
+ // When both buttons are disabled set as visual gap
20
+ none: "\n border-color: transparent;\n ",
21
+ // When both buttons are disabled set a disabled divider color
22
+ preferred: "\n border-color: ".concat(euiTheme.colors.borderBaseDisabled, ";\n ")
23
+ }), ";}};label:euiSplitButton;"),
24
+ // When both buttons are enabled set as visual gap
25
+ fill: /*#__PURE__*/css("&:not(:has(", primaryDisabledSelector, ")):not(\n :has(", secondaryDisabledSelector, ")\n ){", dividerSelector, "{border-color:transparent;}};label:fill;")
26
+ };
27
+ };
28
+ export var euiSplitButtonActionStyles = {
29
+ euiSplitButtonActionPrimary: process.env.NODE_ENV === "production" ? {
30
+ name: "12txneb-euiSplitButtonActionPrimary",
31
+ styles: "z-index:0;border-inline-end:none;border-start-end-radius:0;border-end-end-radius:0;label:euiSplitButtonActionPrimary;"
32
+ } : {
33
+ name: "12txneb-euiSplitButtonActionPrimary",
34
+ styles: "z-index:0;border-inline-end:none;border-start-end-radius:0;border-end-end-radius:0;label:euiSplitButtonActionPrimary;",
35
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
36
+ },
37
+ euiSplitButtonActionSecondary: process.env.NODE_ENV === "production" ? {
38
+ name: "5uh4vx-euiSplitButtonActionSecondary",
39
+ styles: "border-inline-start:none;border-start-start-radius:0;border-end-start-radius:0;label:euiSplitButtonActionSecondary;"
40
+ } : {
41
+ name: "5uh4vx-euiSplitButtonActionSecondary",
42
+ styles: "border-inline-start:none;border-start-start-radius:0;border-end-start-radius:0;label:euiSplitButtonActionSecondary;",
43
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
44
+ }
45
+ };
46
+ export var euiSplitButtonDividerStyles = function euiSplitButtonDividerStyles(euiThemeContext, color) {
47
+ var euiTheme = euiThemeContext.euiTheme;
48
+ return {
49
+ divider: /*#__PURE__*/css("border-inline-start:", euiTheme.border.width.thin, " solid ", color, ";;label:divider;")
50
+ };
51
+ };