@elastic/eui 116.5.0 → 117.0.0-snapshot.1783939453438

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 (299) 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 +4 -4
  5. package/es/components/basic_table/in_memory_table.js +13 -4
  6. package/es/components/button/button_display/_button_display_content.js +1 -1
  7. package/es/components/button/button_empty/button_empty.js +1 -1
  8. package/es/components/button/button_icon/button_icon.js +1 -1
  9. package/es/components/call_out/call_out.js +230 -30
  10. package/es/components/call_out/call_out.styles.js +36 -43
  11. package/es/components/call_out/call_out_action.js +45 -0
  12. package/es/components/call_out/types.js +11 -0
  13. package/es/components/call_out/use_layout_observer.js +54 -0
  14. package/es/components/card/card.js +1 -1
  15. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  16. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  17. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  18. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  19. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  20. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  21. package/es/components/comment_list/comment.js +2 -2
  22. package/es/components/comment_list/comment_event.js +1 -1
  23. package/es/components/comment_list/comment_list.js +2 -2
  24. package/es/components/comment_list/comment_timeline.js +1 -1
  25. package/es/components/context_menu/context_menu_item.js +1 -1
  26. package/es/components/datagrid/body/cell/data_grid_cell.js +12 -12
  27. package/es/components/datagrid/body/data_grid_body.js +7 -7
  28. package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
  29. package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  30. package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  31. package/es/components/datagrid/controls/column_sorting.js +7 -7
  32. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  33. package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -20
  34. package/es/components/datagrid/utils/in_memory.js +6 -6
  35. package/es/components/date_picker/date_picker.js +2 -2
  36. package/es/components/date_picker/date_picker_range.js +1 -1
  37. package/es/components/empty_prompt/empty_prompt.js +1 -1
  38. package/es/components/flyout/flyout.component.js +12 -7
  39. package/es/components/flyout/flyout.styles.js +1 -1
  40. package/es/components/flyout/flyout_body.styles.js +1 -4
  41. package/es/components/flyout/flyout_menu.js +2 -2
  42. package/es/components/flyout/manager/flyout_child.js +1 -1
  43. package/es/components/flyout/manager/flyout_managed.js +1 -1
  44. package/es/components/form/field_number/field_number.js +2 -2
  45. package/es/components/form/field_text/field_text.js +2 -2
  46. package/es/components/form/form_control_button/form_control_button.js +1 -1
  47. package/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  48. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  49. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  50. package/es/components/form/text_area/text_area.js +2 -2
  51. package/es/components/header/header_links/header_link.js +1 -1
  52. package/es/components/header/header_links/header_links.js +1 -1
  53. package/es/components/header/header_logo/header_logo.js +1 -1
  54. package/es/components/header/header_section/header_section_item_button.js +1 -1
  55. package/es/components/icon/assets/add_to_chat.js +43 -0
  56. package/es/components/icon/icon.js +1 -1
  57. package/es/components/icon/icon_map.js +3 -0
  58. package/es/components/illustration/illustration.js +86 -0
  59. package/es/components/illustration/illustration.styles.js +16 -0
  60. package/es/components/illustration/index.js +9 -0
  61. package/es/components/index.js +1 -0
  62. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  63. package/es/components/list_group/list_group.js +2 -2
  64. package/es/components/list_group/list_group_item.js +2 -2
  65. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  66. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  67. package/es/components/loading/loading_logo.js +1 -1
  68. package/es/components/markdown_editor/markdown_editor.js +1 -1
  69. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  70. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  71. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  72. package/es/components/page/page_header/page_header_content.js +1 -1
  73. package/es/components/pagination/pagination_button.js +1 -1
  74. package/es/components/popover/with_popover.js +17 -0
  75. package/es/components/search_bar/search_bar.js +190 -376
  76. package/es/components/search_bar/search_filters.js +10 -3
  77. package/es/components/selectable/selectable_list/selectable_list.js +8 -1
  78. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  79. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  80. package/es/components/table/table_header_cell.js +1 -1
  81. package/es/components/timeline/timeline_item_icon.js +1 -1
  82. package/es/components/toast/global_toast_list.js +2 -2
  83. package/es/components/toast/toast.js +2 -2
  84. package/es/components/toast/toast.styles.js +2 -2
  85. package/es/components/tool_tip/icon_tip.js +1 -1
  86. package/es/components/tool_tip/with_tooltip.js +14 -0
  87. package/eui.d.ts +625 -448
  88. package/lib/components/avatar/avatar.js +1 -1
  89. package/lib/components/badge/badge.js +1 -1
  90. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  91. package/lib/components/basic_table/basic_table.js +4 -4
  92. package/lib/components/basic_table/in_memory_table.js +13 -4
  93. package/lib/components/button/button_display/_button_display_content.js +1 -1
  94. package/lib/components/button/button_empty/button_empty.js +1 -1
  95. package/lib/components/button/button_icon/button_icon.js +1 -1
  96. package/lib/components/call_out/call_out.js +230 -30
  97. package/lib/components/call_out/call_out.styles.js +37 -42
  98. package/lib/components/call_out/call_out_action.js +51 -0
  99. package/lib/components/call_out/types.js +17 -0
  100. package/lib/components/call_out/use_layout_observer.js +58 -0
  101. package/lib/components/card/card.js +1 -1
  102. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  103. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  104. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  105. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  106. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  107. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  108. package/lib/components/comment_list/comment.js +2 -2
  109. package/lib/components/comment_list/comment_event.js +1 -1
  110. package/lib/components/comment_list/comment_list.js +2 -2
  111. package/lib/components/comment_list/comment_timeline.js +1 -1
  112. package/lib/components/context_menu/context_menu_item.js +1 -1
  113. package/lib/components/datagrid/body/cell/data_grid_cell.js +12 -12
  114. package/lib/components/datagrid/body/data_grid_body.js +7 -7
  115. package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
  116. package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  117. package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  118. package/lib/components/datagrid/controls/column_sorting.js +7 -7
  119. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  120. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -20
  121. package/lib/components/datagrid/utils/in_memory.js +6 -6
  122. package/lib/components/date_picker/date_picker.js +2 -2
  123. package/lib/components/date_picker/date_picker_range.js +1 -1
  124. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  125. package/lib/components/flyout/flyout.component.js +11 -6
  126. package/lib/components/flyout/flyout.styles.js +1 -1
  127. package/lib/components/flyout/flyout_body.styles.js +1 -4
  128. package/lib/components/flyout/flyout_menu.js +2 -2
  129. package/lib/components/flyout/manager/flyout_child.js +1 -1
  130. package/lib/components/form/field_number/field_number.js +2 -2
  131. package/lib/components/form/field_text/field_text.js +2 -2
  132. package/lib/components/form/form_control_button/form_control_button.js +1 -1
  133. package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  134. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  135. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  136. package/lib/components/form/text_area/text_area.js +2 -2
  137. package/lib/components/header/header_links/header_link.js +1 -1
  138. package/lib/components/header/header_links/header_links.js +1 -1
  139. package/lib/components/header/header_logo/header_logo.js +1 -1
  140. package/lib/components/header/header_section/header_section_item_button.js +1 -1
  141. package/lib/components/icon/assets/add_to_chat.js +50 -0
  142. package/lib/components/icon/icon.js +1 -1
  143. package/lib/components/icon/icon_map.js +5 -0
  144. package/lib/components/icon/svgs/add_to_chat.svg +6 -0
  145. package/lib/components/illustration/illustration.js +91 -0
  146. package/lib/components/illustration/illustration.styles.js +22 -0
  147. package/lib/components/illustration/index.js +12 -0
  148. package/lib/components/index.js +11 -0
  149. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  150. package/lib/components/list_group/list_group.js +2 -2
  151. package/lib/components/list_group/list_group_item.js +2 -2
  152. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  153. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  154. package/lib/components/loading/loading_logo.js +1 -1
  155. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  156. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  157. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  158. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  159. package/lib/components/page/page_header/page_header_content.js +1 -1
  160. package/lib/components/pagination/pagination_button.js +1 -1
  161. package/lib/components/popover/with_popover.js +22 -0
  162. package/lib/components/search_bar/search_bar.js +193 -380
  163. package/lib/components/search_bar/search_filters.js +10 -3
  164. package/lib/components/selectable/selectable_list/selectable_list.js +8 -1
  165. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  166. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  167. package/lib/components/table/table_header_cell.js +1 -1
  168. package/lib/components/timeline/timeline_item_icon.js +1 -1
  169. package/lib/components/toast/global_toast_list.js +2 -2
  170. package/lib/components/toast/toast.js +2 -2
  171. package/lib/components/toast/toast.styles.js +2 -2
  172. package/lib/components/tool_tip/icon_tip.js +1 -1
  173. package/lib/components/tool_tip/with_tooltip.js +21 -0
  174. package/optimize/es/components/call_out/call_out.js +123 -28
  175. package/optimize/es/components/call_out/call_out.styles.js +36 -43
  176. package/optimize/es/components/call_out/call_out_action.js +44 -0
  177. package/optimize/es/components/call_out/types.js +11 -0
  178. package/optimize/es/components/call_out/use_layout_observer.js +49 -0
  179. package/optimize/es/components/flyout/flyout.component.js +12 -7
  180. package/optimize/es/components/flyout/flyout.styles.js +1 -1
  181. package/optimize/es/components/flyout/flyout_body.styles.js +1 -4
  182. package/optimize/es/components/icon/assets/add_to_chat.js +42 -0
  183. package/optimize/es/components/icon/icon_map.js +3 -0
  184. package/optimize/es/components/illustration/illustration.js +57 -0
  185. package/optimize/es/components/illustration/illustration.styles.js +16 -0
  186. package/optimize/es/components/illustration/index.js +9 -0
  187. package/optimize/es/components/index.js +1 -0
  188. package/optimize/es/components/popover/with_popover.js +17 -0
  189. package/optimize/es/components/search_bar/search_bar.js +184 -193
  190. package/optimize/es/components/search_bar/search_filters.js +5 -2
  191. package/optimize/es/components/selectable/selectable_list/selectable_list.js +7 -0
  192. package/optimize/es/components/toast/toast.styles.js +2 -2
  193. package/optimize/es/components/tool_tip/with_tooltip.js +14 -0
  194. package/optimize/lib/components/call_out/call_out.js +123 -28
  195. package/optimize/lib/components/call_out/call_out.styles.js +37 -42
  196. package/optimize/lib/components/call_out/call_out_action.js +50 -0
  197. package/optimize/lib/components/call_out/types.js +17 -0
  198. package/optimize/lib/components/call_out/use_layout_observer.js +56 -0
  199. package/optimize/lib/components/flyout/flyout.component.js +11 -6
  200. package/optimize/lib/components/flyout/flyout.styles.js +1 -1
  201. package/optimize/lib/components/flyout/flyout_body.styles.js +1 -4
  202. package/optimize/lib/components/icon/assets/add_to_chat.js +50 -0
  203. package/optimize/lib/components/icon/icon_map.js +5 -0
  204. package/optimize/lib/components/icon/svgs/add_to_chat.svg +6 -0
  205. package/optimize/lib/components/illustration/illustration.js +62 -0
  206. package/optimize/lib/components/illustration/illustration.styles.js +22 -0
  207. package/optimize/lib/components/illustration/index.js +12 -0
  208. package/optimize/lib/components/index.js +11 -0
  209. package/optimize/lib/components/popover/with_popover.js +24 -0
  210. package/optimize/lib/components/search_bar/search_bar.js +192 -200
  211. package/optimize/lib/components/search_bar/search_filters.js +5 -2
  212. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +7 -0
  213. package/optimize/lib/components/toast/toast.styles.js +2 -2
  214. package/optimize/lib/components/tool_tip/with_tooltip.js +21 -0
  215. package/package.json +8 -7
  216. package/test-env/components/avatar/avatar.js +1 -1
  217. package/test-env/components/badge/badge.js +1 -1
  218. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  219. package/test-env/components/basic_table/basic_table.js +4 -4
  220. package/test-env/components/basic_table/in_memory_table.js +13 -4
  221. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  222. package/test-env/components/button/button_empty/button_empty.js +1 -1
  223. package/test-env/components/button/button_icon/button_icon.js +1 -1
  224. package/test-env/components/call_out/call_out.js +230 -30
  225. package/test-env/components/call_out/call_out.styles.js +37 -42
  226. package/test-env/components/call_out/call_out_action.js +50 -0
  227. package/test-env/components/call_out/types.js +17 -0
  228. package/test-env/components/call_out/use_layout_observer.js +56 -0
  229. package/test-env/components/card/card.js +1 -1
  230. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  231. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  232. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  233. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  234. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  235. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  236. package/test-env/components/comment_list/comment.js +2 -2
  237. package/test-env/components/comment_list/comment_event.js +1 -1
  238. package/test-env/components/comment_list/comment_list.js +2 -2
  239. package/test-env/components/comment_list/comment_timeline.js +1 -1
  240. package/test-env/components/context_menu/context_menu_item.js +1 -1
  241. package/test-env/components/datagrid/body/cell/data_grid_cell.js +12 -12
  242. package/test-env/components/datagrid/body/data_grid_body.js +7 -7
  243. package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
  244. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  245. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  246. package/test-env/components/datagrid/controls/column_sorting.js +7 -7
  247. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  248. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -20
  249. package/test-env/components/datagrid/utils/in_memory.js +6 -6
  250. package/test-env/components/date_picker/date_picker.js +2 -2
  251. package/test-env/components/date_picker/date_picker_range.js +1 -1
  252. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  253. package/test-env/components/flyout/flyout.component.js +11 -6
  254. package/test-env/components/flyout/flyout.styles.js +1 -1
  255. package/test-env/components/flyout/flyout_body.styles.js +1 -4
  256. package/test-env/components/flyout/flyout_menu.js +2 -2
  257. package/test-env/components/flyout/manager/flyout_child.js +1 -1
  258. package/test-env/components/form/field_number/field_number.js +2 -2
  259. package/test-env/components/form/field_text/field_text.js +2 -2
  260. package/test-env/components/form/form_control_button/form_control_button.js +1 -1
  261. package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  262. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  263. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  264. package/test-env/components/form/text_area/text_area.js +2 -2
  265. package/test-env/components/header/header_links/header_link.js +1 -1
  266. package/test-env/components/header/header_links/header_links.js +1 -1
  267. package/test-env/components/header/header_logo/header_logo.js +1 -1
  268. package/test-env/components/header/header_section/header_section_item_button.js +1 -1
  269. package/test-env/components/icon/assets/add_to_chat.js +50 -0
  270. package/test-env/components/icon/icon_map.js +5 -0
  271. package/test-env/components/illustration/illustration.js +90 -0
  272. package/test-env/components/illustration/illustration.styles.js +22 -0
  273. package/test-env/components/illustration/index.js +12 -0
  274. package/test-env/components/index.js +11 -0
  275. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  276. package/test-env/components/list_group/list_group.js +2 -2
  277. package/test-env/components/list_group/list_group_item.js +2 -2
  278. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  279. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  280. package/test-env/components/loading/loading_logo.js +1 -1
  281. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  282. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  283. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  284. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  285. package/test-env/components/page/page_header/page_header_content.js +1 -1
  286. package/test-env/components/pagination/pagination_button.js +1 -1
  287. package/test-env/components/popover/with_popover.js +24 -0
  288. package/test-env/components/search_bar/search_bar.js +192 -379
  289. package/test-env/components/search_bar/search_filters.js +10 -3
  290. package/test-env/components/selectable/selectable_list/selectable_list.js +8 -1
  291. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  292. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  293. package/test-env/components/table/table_header_cell.js +1 -1
  294. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  295. package/test-env/components/toast/global_toast_list.js +2 -2
  296. package/test-env/components/toast/toast.js +2 -2
  297. package/test-env/components/toast/toast.styles.js +2 -2
  298. package/test-env/components/tool_tip/icon_tip.js +1 -1
  299. package/test-env/components/tool_tip/with_tooltip.js +21 -0
@@ -1,7 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["title", "color", "size", "iconType", "children", "className", "heading", "onDismiss", "dismissButtonProps", "announceOnMount"];
4
+ var _excluded = ["title", "text", "color", "size", "iconType", "children", "actionProps", "className", "heading", "onDismiss", "dismissButtonProps", "announceOnMount", "style", "data-test-subj"];
5
+ 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; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
7
  /*
6
8
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
9
  * or more contributor license agreements. Licensed under the Elastic License
@@ -12,28 +14,43 @@ var _excluded = ["title", "color", "size", "iconType", "children", "className",
12
14
 
13
15
  import React, { forwardRef, useMemo } from 'react';
14
16
  import classNames from 'classnames';
15
- import { useEuiMemoizedStyles } from '../../services';
17
+ import { getTokenName } from '@elastic/eui-theme-common';
18
+ import { useCombinedRefs, useEuiMemoizedStyles, useEuiTheme } from '../../services';
19
+ import { useEuiBorderColorCSS } from '../../global_styling';
16
20
  import { EuiIcon } from '../icon';
17
21
  import { EuiButtonIcon } from '../button';
18
22
  import { EuiText } from '../text';
19
23
  import { EuiPanel } from '../panel';
20
- import { EuiSpacer } from '../spacer';
21
24
  import { EuiTitle } from '../title';
22
25
  import { EuiI18n } from '../i18n';
23
26
  import { EuiLiveAnnouncer } from '../accessibility/live_announcer';
27
+ import { EuiNotificationIcon } from '../notification_icon/notification_icon';
28
+ import { useLayoutObserver } from './use_layout_observer';
29
+ import { EuiCallOutAction } from './call_out_action';
24
30
  import { euiCallOutStyles, euiCallOutHeaderStyles } from './call_out.styles';
31
+ import { euiNotificationIconStyles } from '../notification_icon/notification_icon.styles';
25
32
  import { jsx as ___EmotionJSX } from "@emotion/react";
26
- export var COLORS = ['primary', 'success', 'warning', 'danger', 'accent'];
27
- export var HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];
28
- export var SIZES = ['s', 'm'];
33
+ export var COLOR_TO_NOTIFICATION_ICON_MAP = {
34
+ primary: 'info',
35
+ success: 'success',
36
+ warning: 'warning',
37
+ danger: 'error'
38
+ };
39
+
40
+ /** Get correct color with fallback */
41
+ var getCallOutColor = function getCallOutColor(color) {
42
+ return typeof color === 'string' && COLOR_TO_NOTIFICATION_ICON_MAP.hasOwnProperty(color) ? color : 'primary';
43
+ };
29
44
  export var EuiCallOut = /*#__PURE__*/forwardRef(function (_ref, ref) {
30
45
  var title = _ref.title,
46
+ text = _ref.text,
31
47
  _ref$color = _ref.color,
32
- color = _ref$color === void 0 ? 'primary' : _ref$color,
48
+ _color = _ref$color === void 0 ? 'primary' : _ref$color,
33
49
  _ref$size = _ref.size,
34
50
  size = _ref$size === void 0 ? 'm' : _ref$size,
35
51
  iconType = _ref.iconType,
36
52
  children = _ref.children,
53
+ actionProps = _ref.actionProps,
37
54
  className = _ref.className,
38
55
  _ref$heading = _ref.heading,
39
56
  heading = _ref$heading === void 0 ? 'p' : _ref$heading,
@@ -41,13 +58,36 @@ export var EuiCallOut = /*#__PURE__*/forwardRef(function (_ref, ref) {
41
58
  dismissButtonProps = _ref.dismissButtonProps,
42
59
  _ref$announceOnMount = _ref.announceOnMount,
43
60
  announceOnMount = _ref$announceOnMount === void 0 ? false : _ref$announceOnMount,
61
+ style = _ref.style,
62
+ dataTestSubj = _ref['data-test-subj'],
44
63
  rest = _objectWithoutProperties(_ref, _excluded);
64
+ var _useEuiTheme = useEuiTheme(),
65
+ euiTheme = _useEuiTheme.euiTheme;
66
+ var color = getCallOutColor(_color);
67
+
68
+ /* Uses resize observer to determine the container width/layout instead of native container queries,
69
+ because callouts can be placed in containers without defined size (absolute positioned, no-grow flex layout etc.)
70
+ where container queries would collapse by design instead of adjusting to the content dimensions. */
71
+ var layoutRef = useLayoutObserver(size);
72
+ // Memoize the refs array so `useCombinedRefs` returns a stable callback-ref across renders
73
+ var combinedRefs = useMemo(function () {
74
+ return [layoutRef, ref];
75
+ }, [layoutRef, ref]);
76
+ var panelRef = useCombinedRefs(combinedRefs);
77
+ var borderColors = useEuiBorderColorCSS();
45
78
  var styles = useEuiMemoizedStyles(euiCallOutStyles);
46
- var cssStyles = [styles.euiCallOut, onDismiss && styles.hasDismissButton.hasDimissButton, onDismiss && styles.hasDismissButton[size]];
79
+ var cssStyles = [styles.euiCallOut, borderColors[color], onDismiss && styles.hasDismissButton];
80
+ var highlightColorToken = getTokenName('borderStrong', color);
81
+ var typeColor = euiTheme.colors[highlightColorToken];
82
+ var cssVariables = useMemo(function () {
83
+ return {
84
+ '--euiCallOutTypeColor': typeColor
85
+ };
86
+ }, [typeColor]);
47
87
  var classes = classNames('euiCallOut', _defineProperty({}, "euiCallOut--".concat(color), color), className);
48
88
  var dismissButton = useMemo(function () {
49
89
  if (!onDismiss) return;
50
- var cssStyles = [styles.dismissButton.euiCallOut__dismissButton, styles.dismissButton[size]];
90
+ var cssStyles = [styles.dismissButton.euiCallOut__dismissButton];
51
91
  return ___EmotionJSX(EuiI18n, {
52
92
  token: "euiCallOut.dismissAriaLabel",
53
93
  default: "Dismiss this callout"
@@ -59,46 +99,101 @@ export var EuiCallOut = /*#__PURE__*/forwardRef(function (_ref, ref) {
59
99
  }, dismissButtonProps, {
60
100
  iconType: "cross",
61
101
  color: color,
102
+ size: "xs",
62
103
  onClick: onDismiss
63
104
  }));
64
105
  });
65
- }, [onDismiss, styles, color, size]);
106
+ }, [onDismiss, styles, color, dismissButtonProps]);
66
107
  var headerStyles = useEuiMemoizedStyles(euiCallOutHeaderStyles);
108
+ var iconStyles = useEuiMemoizedStyles(euiNotificationIconStyles);
67
109
  var header = useMemo(function () {
68
110
  if (!title) return;
69
111
  var H = heading;
70
- var cssStyles = [headerStyles.euiCallOutHeader, headerStyles[color]];
112
+ var cssStyles = [headerStyles.euiCallOutHeader];
71
113
  return ___EmotionJSX(EuiTitle, {
72
114
  size: size === 's' ? 'xxs' : 'xs',
73
115
  css: cssStyles
74
116
  }, ___EmotionJSX(H, {
75
117
  className: "euiCallOutHeader__title"
76
- }, iconType && ___EmotionJSX(EuiIcon, {
77
- css: headerStyles.euiCallOut__icon,
118
+ }, title));
119
+ }, [title, heading, size, headerStyles]);
120
+ var icon = useMemo(function () {
121
+ if (!iconType) {
122
+ var _COLOR_TO_NOTIFICATIO;
123
+ var _iconType = (_COLOR_TO_NOTIFICATIO = COLOR_TO_NOTIFICATION_ICON_MAP[color]) !== null && _COLOR_TO_NOTIFICATIO !== void 0 ? _COLOR_TO_NOTIFICATIO : 'info';
124
+ return ___EmotionJSX(EuiNotificationIcon, {
125
+ css: styles.icon,
126
+ type: _iconType,
127
+ size: size === 's' ? 'm' : 'l'
128
+ });
129
+ }
130
+ return ___EmotionJSX(EuiIcon, {
131
+ css: [styles.icon, size === 'm' && iconStyles.size.l, ";label:icon;"],
78
132
  type: iconType,
79
- size: "m",
133
+ size: size === 's' ? 'm' : 'l',
80
134
  "aria-hidden": "true",
81
- color: "inherit"
82
- }), title));
83
- }, [title, heading, iconType, size, color, headerStyles]);
84
- var optionalChildren = children && ___EmotionJSX(EuiText, {
135
+ color: typeColor
136
+ });
137
+ }, [iconType, color, size, typeColor, styles, iconStyles]);
138
+ var optionalChildren = (text || children) && ___EmotionJSX(React.Fragment, null, text && ___EmotionJSX(EuiText, {
139
+ size: "s",
140
+ color: "default",
141
+ className: "euiCallOut__text",
142
+ "data-test-subj": dataTestSubj && "".concat(dataTestSubj, "__message")
143
+ }, text), children && ___EmotionJSX(EuiText, {
144
+ className: "euiCallOut__additionalContent",
85
145
  size: size === 's' ? 'xs' : 's',
86
- color: "default"
87
- }, children);
146
+ color: "default",
147
+ "data-test-subj": dataTestSubj && "".concat(dataTestSubj, "__content")
148
+ }, children));
149
+ var actionControls = useMemo(function () {
150
+ var actionPrimaryProps = _objectSpread(_objectSpread({}, actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary), {}, {
151
+ color: color
152
+ });
153
+ var actionSecondaryProps = _objectSpread(_objectSpread({}, actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary), {}, {
154
+ color: color
155
+ });
156
+ var hasActionPrimary = Boolean(actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary);
157
+ var hasActionSecondary = Boolean(actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary);
158
+ if (!hasActionPrimary && !hasActionSecondary) return null;
159
+ var actionPrimary = hasActionPrimary && ___EmotionJSX(EuiCallOutAction, _extends({
160
+ actionType: "primary"
161
+ }, actionPrimaryProps));
162
+ var actionSecondary = hasActionSecondary && ___EmotionJSX(EuiCallOutAction, _extends({
163
+ actionType: "secondary"
164
+ }, actionSecondaryProps));
165
+ return ___EmotionJSX("div", {
166
+ css: styles.actions,
167
+ "data-test-subj": dataTestSubj && "".concat(dataTestSubj, "__actions")
168
+ }, actionPrimary, actionSecondary);
169
+ }, [actionProps, color, styles, dataTestSubj]);
170
+ var announcement = useMemo(function () {
171
+ if (!announceOnMount || !(title || text || children)) return null;
172
+ return ___EmotionJSX(EuiLiveAnnouncer, null, title, title && text && ",\xA0", text, (title || text) && children && ",\xA0", children);
173
+ }, [announceOnMount, title, text, children]);
88
174
  return ___EmotionJSX(EuiPanel, _extends({
89
175
  borderRadius: "none",
90
176
  color: color,
91
- css: cssStyles,
92
- paddingSize: size === 's' ? 's' : 'm',
177
+ css: cssStyles
178
+ // uses custom padding
179
+ ,
180
+ paddingSize: "none",
93
181
  className: classes,
94
- panelRef: ref,
95
- grow: false
96
- }, rest),
182
+ panelRef: panelRef,
183
+ grow: false,
184
+ style: _objectSpread(_objectSpread({}, cssVariables), style),
185
+ "data-size": size,
186
+ "data-test-subj": dataTestSubj
187
+ }, rest), ___EmotionJSX("div", {
188
+ css: styles.wrapper
189
+ }, ___EmotionJSX("div", {
190
+ css: styles.body
191
+ }, icon, ___EmotionJSX("div", {
192
+ css: styles.content
193
+ },
97
194
  // Note: the DOM position of the dismiss button matters to screen reader users.
98
195
  // We generally want them to have some context of _what_ they're dismissing,
99
196
  // instead of navigating to the dismiss button first before the callout content
100
- header && optionalChildren ? ___EmotionJSX(React.Fragment, null, header, dismissButton, ___EmotionJSX(EuiSpacer, {
101
- size: "s"
102
- }), optionalChildren) : ___EmotionJSX(React.Fragment, null, header || optionalChildren, dismissButton), announceOnMount && (title || children) && ___EmotionJSX(EuiLiveAnnouncer, null, title && "".concat(title, ", "), children));
197
+ header && optionalChildren ? ___EmotionJSX(React.Fragment, null, header, dismissButton, optionalChildren) : ___EmotionJSX(React.Fragment, null, header || optionalChildren, dismissButton))), actionControls, announcement));
103
198
  });
104
199
  EuiCallOut.displayName = 'EuiCallOut';
@@ -1,4 +1,3 @@
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
1
  /*
3
2
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
3
  * or more contributor license agreements. Licensed under the Elastic License
@@ -8,53 +7,47 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
7
  */
9
8
 
10
9
  import { css } from '@emotion/react';
11
- import { logicalCSS } from '../../global_styling';
12
- var _ref = process.env.NODE_ENV === "production" ? {
13
- name: "173v8a4-euiCallOut__dismissButton",
14
- styles: "position:absolute;label:euiCallOut__dismissButton;"
15
- } : {
16
- name: "173v8a4-euiCallOut__dismissButton",
17
- styles: "position:absolute;label:euiCallOut__dismissButton;",
18
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
19
- };
20
- var _ref2 = process.env.NODE_ENV === "production" ? {
21
- name: "192kin0-euiCallOut",
22
- styles: "position:relative;label:euiCallOut;"
23
- } : {
24
- name: "192kin0-euiCallOut",
25
- styles: "position:relative;label:euiCallOut;",
26
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
27
- };
28
- export var euiCallOutStyles = function euiCallOutStyles(_ref3) {
29
- var euiTheme = _ref3.euiTheme;
10
+ import { logicalCSS, logicalShorthandCSS, mathWithUnits, preventForcedColors } from '../../global_styling';
11
+ /** Maximum reading width for `text` and `children` slots. */
12
+ var TEXT_MAX_WIDTH = 1200;
13
+ export var euiCallOutStyles = function euiCallOutStyles(euiThemeContext) {
14
+ var euiTheme = euiThemeContext.euiTheme;
15
+ var paddingSizes = {
16
+ s: euiTheme.size.m,
17
+ m: euiTheme.size.base
18
+ };
19
+ var borderRadius = euiTheme.border.radius.small;
20
+ var highlightSize = mathWithUnits([euiTheme.border.width.thin, euiTheme.border.width.thick], function (x, y) {
21
+ return x + y;
22
+ });
23
+ var highlightOffset = euiTheme.border.width.thin;
24
+ var highlightSizeOffset = mathWithUnits([highlightOffset], function (x) {
25
+ return x * 2;
26
+ });
27
+ var separatorSize = mathWithUnits([euiTheme.size.s, euiTheme.size.xxs], function (x, y) {
28
+ return x + y;
29
+ });
30
30
  return {
31
- euiCallOut: _ref2,
32
- hasDismissButton: {
33
- // Ensure that only the top-most (first-child) title or child text
34
- // has a padding-right on it (to account for the dismiss button)
35
- hasDimissButton: /*#__PURE__*/css("&>:first-child:is(.euiTitle),&>:first-child:is(.euiText)>:first-child{", logicalCSS('padding-right', euiTheme.size.base), ";};label:hasDimissButton;"),
36
- // Ensure the callout always has enough height for the button
37
- s: /*#__PURE__*/css(logicalCSS('min-height', euiTheme.size.xl), ";;label:s;"),
38
- m: /*#__PURE__*/css(logicalCSS('min-height', euiTheme.size.xxl), ";;label:m;")
39
- },
31
+ euiCallOut: /*#__PURE__*/css("position:relative;display:flex;max-inline-size:100%;align-items:center;border:", euiTheme.border.width.thin, " solid;border-radius:", borderRadius, ";&:focus{outline-offset:2px;}&::before{content:'';position:absolute;inset-block-start:-", euiTheme.border.width.thin, ";inset-inline-start:-", euiTheme.border.width.thin, ";block-size:calc(100% + ", highlightSizeOffset, ");border-inline-start:", highlightSize, " solid var(--euiCallOutTypeColor);border-start-start-radius:", borderRadius, ";border-end-start-radius:", borderRadius, ";pointer-events:none;", preventForcedColors(euiThemeContext), ";}&:where([data-size='s']){", logicalShorthandCSS('padding', "".concat(paddingSizes.s, " ").concat(paddingSizes.m)), ";}&:where([data-size='m']){padding:", paddingSizes.m, ";};label:euiCallOut;"),
32
+ // handles content + actions layout
33
+ wrapper: /*#__PURE__*/css("display:flex;flex-direction:column;inline-size:100%;&:where([data-size='s'] &){gap:", euiTheme.size.s, ";}&:where([data-size='m'] &){gap:", euiTheme.size.m, ";}&:where([data-layout='wide'] &){flex-direction:row;gap:", euiTheme.size.xxl, ";};label:wrapper;"),
34
+ // handles icon + text layout
35
+ body: /*#__PURE__*/css("display:flex;flex-direction:row;align-self:center;inline-size:100%;&:where([data-size='s'] &){gap:", euiTheme.size.s, ";}&:where([data-size='m'] &){gap:", euiTheme.size.m, ";};label:body;"),
36
+ // handles text layout
37
+ content: /*#__PURE__*/css("align-self:center;inline-size:100%;max-inline-size:", TEXT_MAX_WIDTH, "px;&:where([data-size='s'] &){gap:", euiTheme.size.s, ";block-size:min-content;>.euiTitle{display:inline;", logicalCSS('margin-right', euiTheme.size.xxs), ";}>.euiCallOut__text{display:inline;*{display:inline;}&:where(:not(:first-child)){&::before{content:'\xB7';display:inline-block;inline-size:", separatorSize, ";text-align:center;color:", euiTheme.colors.textHeading, ";}}}.euiCallOut__additionalContent:not(:first-child){", logicalCSS('margin-top', euiTheme.size.xs), ";}}&:where([data-size='m'] &){display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";.euiCallOut__text+.euiCallOut__additionalContent{", logicalCSS('margin-top', euiTheme.size.s), ";}};label:content;"),
38
+ hasDismissButton: /*#__PURE__*/css("&:where([data-size]){padding-inline-end:", euiTheme.size.xxl, ";};label:hasDismissButton;"),
40
39
  dismissButton: {
41
- euiCallOut__dismissButton: _ref,
42
- s: /*#__PURE__*/css(logicalCSS('top', euiTheme.size.xs), " ", logicalCSS('right', euiTheme.size.xs), ";;label:s;"),
43
- m: /*#__PURE__*/css(logicalCSS('top', euiTheme.size.s), " ", logicalCSS('right', euiTheme.size.s), ";;label:m;")
44
- }
40
+ euiCallOut__dismissButton: /*#__PURE__*/css("position:absolute;", logicalCSS('top', euiTheme.size.s), " ", logicalCSS('right', euiTheme.size.s), ";;label:euiCallOut__dismissButton;")
41
+ },
42
+ icon: /*#__PURE__*/css("position:relative;", logicalCSS('margin-vertical', euiTheme.size.xxs), ";;label:icon;"),
43
+ actions: /*#__PURE__*/css("display:flex;gap:", euiTheme.size.s, ";&:where([data-size='s'] &){", logicalCSS('margin-left', euiTheme.size.l), ";}&:where([data-size='m'] &){", logicalCSS('margin-left', euiTheme.size.xl), ";}&:where([data-layout='superNarrow'] &){flex-wrap:wrap;*:has(.euiCallOutAction),.euiCallOutAction{inline-size:100%;}}&:where([data-layout='wide'] &){", logicalCSS('margin-left', '0'), " align-self:center;flex-shrink:0;flex-direction:row-reverse;};label:actions;")
45
44
  };
46
45
  };
47
- export var euiCallOutHeaderStyles = function euiCallOutHeaderStyles(_ref4) {
48
- var euiTheme = _ref4.euiTheme;
46
+ export var euiCallOutHeaderStyles = function euiCallOutHeaderStyles(_ref) {
47
+ var euiTheme = _ref.euiTheme;
49
48
  return {
50
- euiCallOutHeader: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";", logicalCSS('margin-bottom', '0 !important'
49
+ euiCallOutHeader: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.bold, ";", logicalCSS('margin-bottom', '0 !important'
51
50
  // In case it's nested inside EuiText
52
- ), ";;label:euiCallOutHeader;"),
53
- primary: /*#__PURE__*/css("color:", euiTheme.colors.textPrimary, ";;label:primary;"),
54
- success: /*#__PURE__*/css("color:", euiTheme.colors.textSuccess, ";;label:success;"),
55
- warning: /*#__PURE__*/css("color:", euiTheme.colors.textWarning, ";;label:warning;"),
56
- danger: /*#__PURE__*/css("color:", euiTheme.colors.textDanger, ";;label:danger;"),
57
- accent: /*#__PURE__*/css("color:", euiTheme.colors.textAccent, ";;label:accent;"),
58
- euiCallOut__icon: /*#__PURE__*/css("position:relative;", logicalCSS('top', '-1px'), " ", logicalCSS('margin-right', euiTheme.size.s), ";;label:euiCallOut__icon;")
51
+ ), "&&{color:", euiTheme.colors.textHeading, ";};label:euiCallOutHeader;")
59
52
  };
60
53
  };
@@ -0,0 +1,44 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "actionType", "color", "tooltipProps", "popoverProps", "className"];
4
+ /*
5
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
+ * or more contributor license agreements. Licensed under the Elastic License
7
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
8
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
9
+ * Side Public License, v 1.
10
+ */
11
+
12
+ import React from 'react';
13
+ import classNames from 'classnames';
14
+ import { EuiButton, EuiButtonEmpty } from '../button';
15
+ import { withEuiPopover } from '../popover/with_popover';
16
+ import { withEuiToolTip } from '../tool_tip/with_tooltip';
17
+ import { jsx as ___EmotionJSX } from "@emotion/react";
18
+ export var EuiCallOutAction = function EuiCallOutAction(_ref) {
19
+ var children = _ref.children,
20
+ _ref$actionType = _ref.actionType,
21
+ actionType = _ref$actionType === void 0 ? 'primary' : _ref$actionType,
22
+ _ref$color = _ref.color,
23
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
24
+ tooltipProps = _ref.tooltipProps,
25
+ popoverProps = _ref.popoverProps,
26
+ className = _ref.className,
27
+ rest = _objectWithoutProperties(_ref, _excluded);
28
+ var classes = classNames('euiCallOutAction', className);
29
+ if (actionType === 'primary') {
30
+ var button = ___EmotionJSX(EuiButton, _extends({
31
+ className: classes,
32
+ size: "s",
33
+ color: color
34
+ }, rest), children);
35
+ return withEuiPopover(withEuiToolTip(button, tooltipProps), popoverProps);
36
+ } else {
37
+ var _button = ___EmotionJSX(EuiButtonEmpty, _extends({
38
+ className: classes,
39
+ size: "s",
40
+ color: color
41
+ }, rest), children);
42
+ return withEuiPopover(withEuiToolTip(_button, tooltipProps), popoverProps);
43
+ }
44
+ };
@@ -0,0 +1,11 @@
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 var COLORS = ['primary', 'success', 'warning', 'danger'];
10
+ export var SIZES = ['s', 'm'];
11
+ export var HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];
@@ -0,0 +1,49 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
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 { useEffect, useRef } from 'react';
11
+ import { hasResizeObserver } from '../observer/resize_observer/resize_observer';
12
+ var SUPER_NARROW_WIDTH = 400;
13
+ var WIDE_BREAKPOINTS = {
14
+ s: 800,
15
+ m: 1000
16
+ };
17
+
18
+ /**
19
+ * Observes the rendered width and sets `data-layout` on the root
20
+ * element so that CSS can respond to size changes.
21
+ *
22
+ * This is an alternative to native CSS container queries. Its purpose is to handle cases where
23
+ * container queries would collapse if the element is placed inside a container without a defined size.
24
+ */
25
+ export var useLayoutObserver = function useLayoutObserver(size) {
26
+ var elementRef = useRef(null);
27
+ useEffect(function () {
28
+ var element = elementRef.current;
29
+ if (!element || !hasResizeObserver) return;
30
+ var wide = WIDE_BREAKPOINTS[size];
31
+ var observer = new ResizeObserver(function (_ref) {
32
+ var _ref2 = _slicedToArray(_ref, 1),
33
+ entry = _ref2[0];
34
+ var width = entry.borderBoxSize[0].inlineSize;
35
+ if (width <= SUPER_NARROW_WIDTH) {
36
+ element.setAttribute('data-layout', 'superNarrow');
37
+ } else if (width >= wide) {
38
+ element.setAttribute('data-layout', 'wide');
39
+ } else {
40
+ element.removeAttribute('data-layout');
41
+ }
42
+ });
43
+ observer.observe(element);
44
+ return function () {
45
+ return observer.disconnect();
46
+ };
47
+ }, [size]);
48
+ return elementRef;
49
+ };
@@ -18,7 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
18
18
 
19
19
  import React, { useEffect, useLayoutEffect, useRef, useMemo, useCallback, useState, forwardRef } from 'react';
20
20
  import classnames from 'classnames';
21
- import { keys, EuiWindowEvent, useCombinedRefs, useEuiMemoizedStyles, useGeneratedHtmlId, useEuiThemeCSSVariables, focusTrapPubSub } from '../../services';
21
+ import { keys, EuiWindowEvent, useCombinedRefs, useEuiTheme, useEuiMemoizedStyles, useGeneratedHtmlId, useEuiThemeCSSVariables, focusTrapPubSub } from '../../services';
22
22
  import { useIsInManagedFlyout, useFlyoutId, useFlyoutManager } from './manager';
23
23
  import { LAYOUT_MODE_SIDE_BY_SIDE, LAYOUT_MODE_STACKED, LEVEL_MAIN, PROPERTY_LEVEL } from './manager/const';
24
24
  import { EuiFocusTrap } from '../focus_trap';
@@ -422,6 +422,8 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
422
422
  }),
423
423
  flyoutZIndex = _useEuiFlyoutZIndex.flyoutZIndex,
424
424
  maskZIndex = _useEuiFlyoutZIndex.maskZIndex;
425
+ var _useEuiTheme = useEuiTheme(),
426
+ euiTheme = _useEuiTheme.euiTheme;
425
427
 
426
428
  /**
427
429
  * Inline styles position the flyout inside the reference container's
@@ -475,14 +477,17 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
475
477
  containerRelativeWidth = size;
476
478
  }
477
479
 
478
- // All container-scoped flyouts get top/height from the container rect.
479
- // Reset minInlineSize to 0 so that the CSS `min-inline-size` (which
480
- // resolves against the viewport for `position: fixed`) does not
481
- // prevent the container-relative width constraints from taking effect.
480
+ // Pixel-based min-widths for named sizes within containers
481
+ var containerMinWidthMap = {
482
+ s: Math.round(euiTheme.breakpoint.m * 0.42),
483
+ m: Math.round(euiTheme.breakpoint.m * 0.5)
484
+ };
485
+ var sizeMinWidth = typeof size === 'string' ? containerMinWidthMap[size] : undefined;
486
+ var containerMinInlineSize = sizeMinWidth !== undefined ? Math.min(sizeMinWidth, containerMaxWidth) : 0;
482
487
  containerPositionStyles = {
483
488
  top: containerRect.top,
484
489
  height: containerRect.height,
485
- minInlineSize: 0
490
+ minInlineSize: containerMinInlineSize
486
491
  };
487
492
  if (isChildFlyout) {
488
493
  // Child flyouts position themselves relative to the main flyout.
@@ -528,7 +533,7 @@ export var EuiFlyoutComponent = /*#__PURE__*/forwardRef(function (props, ref) {
528
533
  }
529
534
  }
530
535
  return _objectSpread(_objectSpread(_objectSpread({}, style), composedStyles), containerPositionStyles);
531
- }, [style, size, layoutMode, siblingFlyoutId, siblingFlyoutWidth, maxWidth, flyoutZIndex, containerRect, side, isChildFlyout]);
536
+ }, [style, size, layoutMode, siblingFlyoutId, siblingFlyoutWidth, maxWidth, flyoutZIndex, containerRect, side, isChildFlyout, euiTheme.breakpoint.m]);
532
537
  var styles = useEuiMemoizedStyles(euiFlyoutStyles);
533
538
  var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], !hasAnimation && styles.noAnimation, styles[side]];
534
539
  var classes = classnames('euiFlyout', isChildFlyout && hasChildBackground && 'euiFlyout--hasChildBackground', className);
@@ -160,7 +160,7 @@ var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddin
160
160
  return x / 1.5;
161
161
  }), " ").concat(euiTheme.size.l, ";")
162
162
  };
163
- return "\n .euiFlyoutHeader {\n ".concat(logicalCSS('padding-horizontal', paddingModifierMap[paddingSize]), "\n ").concat(logicalCSS('padding-top', paddingModifierMap[paddingSize]), "\n }\n\n [class*='euiFlyoutHeader-hasBorder'] {\n ").concat(logicalCSS('padding-bottom', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutBody__overflowContent {\n padding: ").concat(paddingModifierMap[paddingSize], ";\n }\n\n .euiFlyoutBody__banner .euiCallOut {\n ").concat(logicalCSS('padding-horizontal', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutFooter {\n padding: ").concat(footerPaddingSizes[paddingSize], ";\n }\n ");
163
+ return "\n .euiFlyoutHeader {\n ".concat(logicalCSS('padding-horizontal', paddingModifierMap[paddingSize]), "\n ").concat(logicalCSS('padding-top', paddingModifierMap[paddingSize]), "\n }\n\n [class*='euiFlyoutHeader-hasBorder'] {\n ").concat(logicalCSS('padding-bottom', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutBody__overflowContent {\n padding: ").concat(paddingModifierMap[paddingSize], ";\n }\n\n .euiFlyoutFooter {\n padding: ").concat(footerPaddingSizes[paddingSize], ";\n }\n ");
164
164
  };
165
165
 
166
166
  /**
@@ -8,7 +8,6 @@
8
8
 
9
9
  import { css } from '@emotion/react';
10
10
  import { logicalCSS, logicalCSSWithFallback, euiYScrollWithShadows } from '../../global_styling';
11
- import { highContrastModeStyles } from '../../global_styling/functions/high_contrast';
12
11
  export var euiFlyoutBodyStyles = function euiFlyoutBodyStyles(euiThemeContext) {
13
12
  var euiTheme = euiThemeContext.euiTheme;
14
13
  return {
@@ -20,8 +19,6 @@ export var euiFlyoutBodyStyles = function euiFlyoutBodyStyles(euiThemeContext) {
20
19
  side: 'end'
21
20
  }), ";;label:hasBanner;")
22
21
  },
23
- euiFlyoutBody__banner: /*#__PURE__*/css(logicalCSSWithFallback('overflow-x', 'hidden'), " ", highContrastModeStyles(euiThemeContext, {
24
- preferred: logicalCSS('border-bottom', euiTheme.border.thin)
25
- }), ";;label:euiFlyoutBody__banner;")
22
+ euiFlyoutBody__banner: /*#__PURE__*/css("overflow:hidden;.euiCallOut{", logicalCSS('margin-top', "".concat(euiTheme.size.s)), " ", logicalCSS('margin-left', "".concat(euiTheme.size.l)), " ", logicalCSS('margin-right', "".concat(euiTheme.size.l)), ";}.euiFlyout:not(:has(.euiFlyoutHeader)) &{.euiCallOut{", logicalCSS('margin-right', "".concat(euiTheme.size.xxl)), ";}};label:euiFlyoutBody__banner;")
26
23
  };
27
24
  };
@@ -0,0 +1,42 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["title", "titleId"];
4
+ /*
5
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
+ * or more contributor license agreements. Licensed under the Elastic License
7
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
8
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
9
+ * Side Public License, v 1.
10
+ */
11
+
12
+ // THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
13
+
14
+ import * as React from 'react';
15
+ import { jsx as ___EmotionJSX } from "@emotion/react";
16
+ var EuiIconAddToChat = function EuiIconAddToChat(_ref) {
17
+ var title = _ref.title,
18
+ titleId = _ref.titleId,
19
+ props = _objectWithoutProperties(_ref, _excluded);
20
+ return ___EmotionJSX("svg", _extends({
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ width: 16,
23
+ height: 16,
24
+ viewBox: "0 0 16 16",
25
+ "aria-labelledby": titleId
26
+ }, props), title ? ___EmotionJSX("title", {
27
+ id: titleId
28
+ }, title) : null, ___EmotionJSX("path", {
29
+ fillRule: "evenodd",
30
+ d: "M8 0a1.5 1.5 0 0 1 .5 2.912V4H11a3 3 0 0 1 3 3h1l.102.005A1 1 0 0 1 16 8v1h-1V8h-1v1h-1V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v7h6v1H3a1 1 0 0 1-1-1v-2H1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1a3 3 0 0 1 3-3h2.5V2.912A1.498 1.498 0 0 1 8 0ZM1 11h1V8H1v3ZM8 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z",
31
+ clipRule: "evenodd"
32
+ }), ___EmotionJSX("path", {
33
+ d: "M10.447 11.523C9.826 12.767 8.59 13 8 13c-.59 0-1.826-.233-2.447-1.477l.894-.447C6.826 11.833 7.59 12 8 12c.41 0 1.174-.167 1.553-.924l.894.447Z"
34
+ }), ___EmotionJSX("path", {
35
+ fillRule: "evenodd",
36
+ d: "M5.5 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm5-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z",
37
+ clipRule: "evenodd"
38
+ }), ___EmotionJSX("path", {
39
+ d: "M14 13h2v1h-2v2h-1v-2h-2v-1h2v-2h1v2Z"
40
+ }));
41
+ };
42
+ export var icon = EuiIconAddToChat;
@@ -13,6 +13,9 @@ export var typeToPathMap = {
13
13
  addDataApp: function addDataApp() {
14
14
  return import('./assets/app_add_data');
15
15
  },
16
+ addToChat: function addToChat() {
17
+ return import('./assets/add_to_chat');
18
+ },
16
19
  addToDashboard: function addToDashboard() {
17
20
  return import('./assets/add_to_dashboard');
18
21
  },
@@ -0,0 +1,57 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["type", "alt", "className", "fullWidth"];
4
+ /*
5
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
+ * or more contributor license agreements. Licensed under the Elastic License
7
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
8
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
9
+ * Side Public License, v 1.
10
+ */
11
+
12
+ import React from 'react';
13
+ import classNames from 'classnames';
14
+ import { useEuiMemoizedStyles, useEuiTheme } from '../../services';
15
+ import { euiIllustrationStyles } from './illustration.styles';
16
+
17
+ /**
18
+ * The data contract for an illustration asset (e.g. an export from `@elastic/eui-illustrations`).
19
+ * It is declared here so that `@elastic/eui` does not depend on the illustrations package.
20
+ * The illustrations package can be released independently as long as its assets satisfy this shape.
21
+ *
22
+ * @remarks
23
+ * The `light`/`dark` markup is inlined via `dangerouslySetInnerHTML`. Only pass
24
+ * trusted, package-authored SVGs — never untrusted or user-supplied markup, as
25
+ * it would be rendered as-is and could introduce an XSS vulnerability.
26
+ */
27
+ import { jsx as ___EmotionJSX } from "@emotion/react";
28
+ export var EuiIllustration = function EuiIllustration(_ref) {
29
+ var type = _ref.type,
30
+ alt = _ref.alt,
31
+ className = _ref.className,
32
+ _ref$fullWidth = _ref.fullWidth,
33
+ fullWidth = _ref$fullWidth === void 0 ? true : _ref$fullWidth,
34
+ rest = _objectWithoutProperties(_ref, _excluded);
35
+ var _useEuiTheme = useEuiTheme(),
36
+ colorMode = _useEuiTheme.colorMode;
37
+ var styles = useEuiMemoizedStyles(euiIllustrationStyles);
38
+ var classes = classNames('euiIllustration', className);
39
+ var cssStyles = [styles.euiIllustration, fullWidth && styles.fullWidth];
40
+ var svg = colorMode === 'DARK' ? type.dark : type.light;
41
+ var isDecorative = alt === '';
42
+ var a11yProps = isDecorative ? {
43
+ 'aria-hidden': true
44
+ } : {
45
+ role: 'img',
46
+ 'aria-label': alt !== null && alt !== void 0 ? alt : type.title
47
+ };
48
+ return ___EmotionJSX("span", _extends({
49
+ className: classes,
50
+ css: cssStyles
51
+ }, a11yProps, rest, {
52
+ dangerouslySetInnerHTML: {
53
+ __html: svg
54
+ }
55
+ }));
56
+ };
57
+ EuiIllustration.displayName = 'EuiIllustration';