@elastic/eui 116.3.1 → 116.5.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 (382) 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/banner/banner.js +1 -2
  5. package/es/components/banner/banner.styles.js +1 -1
  6. package/es/components/basic_table/basic_table.js +39 -9
  7. package/es/components/basic_table/basic_table.styles.js +19 -1
  8. package/es/components/basic_table/in_memory_table.js +21 -4
  9. package/es/components/basic_table/index.js +2 -1
  10. package/es/components/basic_table/pagination_bar.js +19 -4
  11. package/es/components/basic_table/pagination_bar.styles.js +21 -0
  12. package/es/components/basic_table/panel.styles.js +14 -0
  13. package/es/components/basic_table/use_panel_props.js +28 -0
  14. package/es/components/button/button_display/_button_display_content.js +1 -1
  15. package/es/components/button/button_empty/button_empty.js +1 -1
  16. package/es/components/button/button_icon/button_icon.js +1 -1
  17. package/es/components/call_out/call_out.js +1 -1
  18. package/es/components/card/card.js +1 -1
  19. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  20. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  21. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  22. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  23. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  24. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  25. package/es/components/comment_list/comment.js +2 -2
  26. package/es/components/comment_list/comment_event.js +1 -1
  27. package/es/components/comment_list/comment_list.js +2 -2
  28. package/es/components/comment_list/comment_timeline.js +1 -1
  29. package/es/components/context_menu/context_menu_item.js +1 -1
  30. package/es/components/datagrid/body/cell/data_grid_cell.js +12 -12
  31. package/es/components/datagrid/body/data_grid_body.js +7 -7
  32. package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
  33. package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  34. package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  35. package/es/components/datagrid/controls/column_sorting.js +7 -7
  36. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  37. package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  38. package/es/components/datagrid/utils/in_memory.js +6 -6
  39. package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
  40. package/es/components/date_picker/date_picker.js +2 -2
  41. package/es/components/date_picker/date_picker_range.js +1 -1
  42. package/es/components/empty_prompt/empty_prompt.js +1 -1
  43. package/es/components/flyout/flyout.component.js +10 -6
  44. package/es/components/flyout/flyout_menu.js +114 -21
  45. package/es/components/flyout/flyout_menu.styles.js +2 -1
  46. package/es/components/flyout/manager/actions.js +20 -0
  47. package/es/components/flyout/manager/flyout_child.js +24 -2
  48. package/es/components/flyout/manager/flyout_managed.js +66 -20
  49. package/es/components/flyout/manager/hooks.js +1 -1
  50. package/es/components/flyout/manager/index.js +2 -2
  51. package/es/components/flyout/manager/reducer.js +32 -8
  52. package/es/components/flyout/manager/selectors.js +8 -2
  53. package/es/components/flyout/manager/store.js +35 -2
  54. package/es/components/flyout/use_flyout_menu.js +2 -2
  55. package/es/components/form/field_number/field_number.js +2 -2
  56. package/es/components/form/field_text/field_text.js +2 -2
  57. package/es/components/form/form_control_button/form_control_button.js +1 -1
  58. package/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  59. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  60. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  61. package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
  62. package/es/components/form/text_area/text_area.js +2 -2
  63. package/es/components/header/header_links/header_link.js +1 -1
  64. package/es/components/header/header_links/header_links.js +1 -1
  65. package/es/components/header/header_logo/header_logo.js +1 -1
  66. package/es/components/header/header_section/header_section_item_button.js +1 -1
  67. package/es/components/icon/assets/logo_vector_db.js +42 -0
  68. package/es/components/icon/icon.js +1 -1
  69. package/es/components/icon/icon.styles.js +3 -2
  70. package/es/components/icon/icon_map.js +3 -0
  71. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  72. package/es/components/list_group/list_group.js +2 -2
  73. package/es/components/list_group/list_group_item.js +2 -2
  74. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  75. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  76. package/es/components/loading/loading_logo.js +1 -1
  77. package/es/components/markdown_editor/markdown_editor.js +1 -1
  78. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  79. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  80. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  81. package/es/components/notification_icon/assets/info_fill.js +34 -0
  82. package/es/components/notification_icon/assets/warning_static.js +40 -0
  83. package/es/components/notification_icon/notification_icon.js +87 -0
  84. package/es/components/notification_icon/notification_icon.styles.js +22 -0
  85. package/es/components/page/page_header/page_header_content.js +1 -1
  86. package/es/components/pagination/pagination_button.js +1 -1
  87. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  88. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  89. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  90. package/es/components/table/mobile/table_sort_mobile.js +64 -103
  91. package/es/components/table/table_header_cell.js +1 -1
  92. package/es/components/timeline/timeline_item_icon.js +1 -1
  93. package/es/components/toast/global_toast_list.js +133 -7
  94. package/es/components/toast/global_toast_list.styles.js +31 -7
  95. package/es/components/toast/toast.js +243 -48
  96. package/es/components/toast/toast.styles.js +35 -47
  97. package/es/components/toast/toast_action.js +34 -0
  98. package/es/components/toast/types.js +9 -0
  99. package/es/components/tool_tip/icon_tip.js +1 -1
  100. package/es/components/tool_tip/tool_tip.js +3 -3
  101. package/eui.d.ts +1217 -973
  102. package/i18ntokens.json +1582 -1546
  103. package/lib/components/avatar/avatar.js +1 -1
  104. package/lib/components/badge/badge.js +1 -1
  105. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  106. package/lib/components/banner/banner.js +1 -2
  107. package/lib/components/banner/banner.styles.js +1 -1
  108. package/lib/components/basic_table/basic_table.js +38 -8
  109. package/lib/components/basic_table/basic_table.styles.js +19 -1
  110. package/lib/components/basic_table/in_memory_table.js +21 -4
  111. package/lib/components/basic_table/index.js +8 -1
  112. package/lib/components/basic_table/pagination_bar.js +19 -4
  113. package/lib/components/basic_table/pagination_bar.styles.js +26 -0
  114. package/lib/components/basic_table/panel.styles.js +20 -0
  115. package/lib/components/basic_table/use_panel_props.js +33 -0
  116. package/lib/components/button/button_display/_button_display_content.js +1 -1
  117. package/lib/components/button/button_empty/button_empty.js +1 -1
  118. package/lib/components/button/button_icon/button_icon.js +1 -1
  119. package/lib/components/call_out/call_out.js +1 -1
  120. package/lib/components/card/card.js +1 -1
  121. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  122. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  123. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  124. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  125. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  126. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  127. package/lib/components/comment_list/comment.js +2 -2
  128. package/lib/components/comment_list/comment_event.js +1 -1
  129. package/lib/components/comment_list/comment_list.js +2 -2
  130. package/lib/components/comment_list/comment_timeline.js +1 -1
  131. package/lib/components/context_menu/context_menu_item.js +1 -1
  132. package/lib/components/datagrid/body/cell/data_grid_cell.js +12 -12
  133. package/lib/components/datagrid/body/data_grid_body.js +7 -7
  134. package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
  135. package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  136. package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  137. package/lib/components/datagrid/controls/column_sorting.js +7 -7
  138. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  139. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  140. package/lib/components/datagrid/utils/in_memory.js +6 -6
  141. package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
  142. package/lib/components/date_picker/date_picker.js +2 -2
  143. package/lib/components/date_picker/date_picker_range.js +1 -1
  144. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  145. package/lib/components/flyout/flyout.component.js +10 -6
  146. package/lib/components/flyout/flyout_menu.js +112 -21
  147. package/lib/components/flyout/flyout_menu.styles.js +2 -1
  148. package/lib/components/flyout/manager/actions.js +21 -1
  149. package/lib/components/flyout/manager/flyout_child.js +24 -2
  150. package/lib/components/flyout/manager/flyout_managed.js +41 -17
  151. package/lib/components/flyout/manager/hooks.js +6 -0
  152. package/lib/components/flyout/manager/index.js +12 -0
  153. package/lib/components/flyout/manager/reducer.js +31 -7
  154. package/lib/components/flyout/manager/selectors.js +9 -3
  155. package/lib/components/flyout/manager/store.js +34 -1
  156. package/lib/components/flyout/use_flyout_menu.js +2 -2
  157. package/lib/components/form/field_number/field_number.js +2 -2
  158. package/lib/components/form/field_text/field_text.js +2 -2
  159. package/lib/components/form/form_control_button/form_control_button.js +1 -1
  160. package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  161. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  162. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  163. package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
  164. package/lib/components/form/text_area/text_area.js +2 -2
  165. package/lib/components/header/header_links/header_link.js +1 -1
  166. package/lib/components/header/header_links/header_links.js +1 -1
  167. package/lib/components/header/header_logo/header_logo.js +1 -1
  168. package/lib/components/header/header_section/header_section_item_button.js +1 -1
  169. package/lib/components/icon/assets/logo_vector_db.js +49 -0
  170. package/lib/components/icon/icon.js +1 -1
  171. package/lib/components/icon/icon.styles.js +3 -2
  172. package/lib/components/icon/icon_map.js +5 -0
  173. package/lib/components/icon/svgs/logo_vector_db.svg +5 -0
  174. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  175. package/lib/components/list_group/list_group.js +2 -2
  176. package/lib/components/list_group/list_group_item.js +2 -2
  177. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  178. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  179. package/lib/components/loading/loading_logo.js +1 -1
  180. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  181. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  182. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  183. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  184. package/lib/components/notification_icon/assets/info_fill.js +41 -0
  185. package/lib/components/notification_icon/assets/warning_static.js +47 -0
  186. package/lib/components/notification_icon/notification_icon.js +93 -0
  187. package/lib/components/notification_icon/notification_icon.styles.js +28 -0
  188. package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  189. package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  190. package/lib/components/page/page_header/page_header_content.js +1 -1
  191. package/lib/components/pagination/pagination_button.js +1 -1
  192. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  193. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  194. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  195. package/lib/components/table/mobile/table_sort_mobile.js +71 -108
  196. package/lib/components/table/table_header_cell.js +1 -1
  197. package/lib/components/timeline/timeline_item_icon.js +1 -1
  198. package/lib/components/toast/global_toast_list.js +133 -7
  199. package/lib/components/toast/global_toast_list.styles.js +31 -8
  200. package/lib/components/toast/toast.js +245 -48
  201. package/lib/components/toast/toast.styles.js +32 -45
  202. package/lib/components/toast/toast_action.js +40 -0
  203. package/lib/components/toast/types.js +15 -0
  204. package/lib/components/tool_tip/icon_tip.js +1 -1
  205. package/lib/components/tool_tip/tool_tip.js +2 -2
  206. package/optimize/es/components/banner/banner.js +1 -2
  207. package/optimize/es/components/banner/banner.styles.js +1 -1
  208. package/optimize/es/components/basic_table/basic_table.js +18 -5
  209. package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
  210. package/optimize/es/components/basic_table/index.js +2 -1
  211. package/optimize/es/components/basic_table/pagination_bar.js +19 -4
  212. package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
  213. package/optimize/es/components/basic_table/panel.styles.js +14 -0
  214. package/optimize/es/components/basic_table/use_panel_props.js +28 -0
  215. package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
  216. package/optimize/es/components/flyout/flyout.component.js +10 -6
  217. package/optimize/es/components/flyout/flyout_menu.js +89 -18
  218. package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
  219. package/optimize/es/components/flyout/manager/actions.js +20 -0
  220. package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
  221. package/optimize/es/components/flyout/manager/hooks.js +1 -1
  222. package/optimize/es/components/flyout/manager/index.js +2 -2
  223. package/optimize/es/components/flyout/manager/reducer.js +32 -8
  224. package/optimize/es/components/flyout/manager/selectors.js +8 -2
  225. package/optimize/es/components/flyout/manager/store.js +35 -2
  226. package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
  227. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
  228. package/optimize/es/components/icon/assets/logo_vector_db.js +41 -0
  229. package/optimize/es/components/icon/icon.styles.js +3 -2
  230. package/optimize/es/components/icon/icon_map.js +3 -0
  231. package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
  232. package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
  233. package/optimize/es/components/notification_icon/notification_icon.js +77 -0
  234. package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
  235. package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
  236. package/optimize/es/components/toast/global_toast_list.js +31 -6
  237. package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
  238. package/optimize/es/components/toast/toast.js +143 -47
  239. package/optimize/es/components/toast/toast.styles.js +35 -47
  240. package/optimize/es/components/toast/toast_action.js +33 -0
  241. package/optimize/es/components/toast/types.js +9 -0
  242. package/optimize/es/components/tool_tip/tool_tip.js +3 -3
  243. package/optimize/lib/components/banner/banner.js +1 -2
  244. package/optimize/lib/components/banner/banner.styles.js +1 -1
  245. package/optimize/lib/components/basic_table/basic_table.js +17 -4
  246. package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
  247. package/optimize/lib/components/basic_table/index.js +8 -1
  248. package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
  249. package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
  250. package/optimize/lib/components/basic_table/panel.styles.js +20 -0
  251. package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
  252. package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
  253. package/optimize/lib/components/flyout/flyout.component.js +10 -6
  254. package/optimize/lib/components/flyout/flyout_menu.js +88 -18
  255. package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
  256. package/optimize/lib/components/flyout/manager/actions.js +21 -1
  257. package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
  258. package/optimize/lib/components/flyout/manager/hooks.js +6 -0
  259. package/optimize/lib/components/flyout/manager/index.js +12 -0
  260. package/optimize/lib/components/flyout/manager/reducer.js +31 -7
  261. package/optimize/lib/components/flyout/manager/selectors.js +9 -3
  262. package/optimize/lib/components/flyout/manager/store.js +34 -1
  263. package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
  264. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
  265. package/optimize/lib/components/icon/assets/logo_vector_db.js +49 -0
  266. package/optimize/lib/components/icon/icon.styles.js +3 -2
  267. package/optimize/lib/components/icon/icon_map.js +5 -0
  268. package/optimize/lib/components/icon/svgs/logo_vector_db.svg +5 -0
  269. package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
  270. package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
  271. package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
  272. package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
  273. package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  274. package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  275. package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
  276. package/optimize/lib/components/toast/global_toast_list.js +31 -6
  277. package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
  278. package/optimize/lib/components/toast/toast.js +146 -47
  279. package/optimize/lib/components/toast/toast.styles.js +33 -45
  280. package/optimize/lib/components/toast/toast_action.js +39 -0
  281. package/optimize/lib/components/toast/types.js +15 -0
  282. package/optimize/lib/components/tool_tip/tool_tip.js +2 -2
  283. package/package.json +7 -5
  284. package/test-env/components/avatar/avatar.js +1 -1
  285. package/test-env/components/badge/badge.js +1 -1
  286. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  287. package/test-env/components/banner/banner.js +1 -2
  288. package/test-env/components/banner/banner.styles.js +1 -1
  289. package/test-env/components/basic_table/basic_table.js +38 -8
  290. package/test-env/components/basic_table/basic_table.styles.js +19 -1
  291. package/test-env/components/basic_table/in_memory_table.js +21 -4
  292. package/test-env/components/basic_table/index.js +8 -1
  293. package/test-env/components/basic_table/pagination_bar.js +19 -4
  294. package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
  295. package/test-env/components/basic_table/panel.styles.js +20 -0
  296. package/test-env/components/basic_table/use_panel_props.js +33 -0
  297. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  298. package/test-env/components/button/button_empty/button_empty.js +1 -1
  299. package/test-env/components/button/button_icon/button_icon.js +1 -1
  300. package/test-env/components/call_out/call_out.js +1 -1
  301. package/test-env/components/card/card.js +1 -1
  302. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  303. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +1 -1
  304. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +1 -1
  305. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +2 -2
  306. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +2 -2
  307. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +4 -4
  308. package/test-env/components/comment_list/comment.js +2 -2
  309. package/test-env/components/comment_list/comment_event.js +1 -1
  310. package/test-env/components/comment_list/comment_list.js +2 -2
  311. package/test-env/components/comment_list/comment_timeline.js +1 -1
  312. package/test-env/components/context_menu/context_menu_item.js +1 -1
  313. package/test-env/components/datagrid/body/cell/data_grid_cell.js +12 -12
  314. package/test-env/components/datagrid/body/data_grid_body.js +7 -7
  315. package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
  316. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
  317. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  318. package/test-env/components/datagrid/controls/column_sorting.js +7 -7
  319. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  320. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  321. package/test-env/components/datagrid/utils/in_memory.js +6 -6
  322. package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
  323. package/test-env/components/date_picker/date_picker.js +2 -2
  324. package/test-env/components/date_picker/date_picker_range.js +1 -1
  325. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  326. package/test-env/components/flyout/flyout.component.js +10 -6
  327. package/test-env/components/flyout/flyout_menu.js +113 -21
  328. package/test-env/components/flyout/flyout_menu.styles.js +2 -1
  329. package/test-env/components/flyout/manager/actions.js +21 -1
  330. package/test-env/components/flyout/manager/flyout_child.js +24 -2
  331. package/test-env/components/flyout/manager/flyout_managed.js +41 -17
  332. package/test-env/components/flyout/manager/hooks.js +6 -0
  333. package/test-env/components/flyout/manager/index.js +12 -0
  334. package/test-env/components/flyout/manager/reducer.js +31 -7
  335. package/test-env/components/flyout/manager/selectors.js +9 -3
  336. package/test-env/components/flyout/manager/store.js +34 -1
  337. package/test-env/components/flyout/use_flyout_menu.js +2 -2
  338. package/test-env/components/form/field_number/field_number.js +2 -2
  339. package/test-env/components/form/field_text/field_text.js +2 -2
  340. package/test-env/components/form/form_control_button/form_control_button.js +1 -1
  341. package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  342. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  343. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  344. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
  345. package/test-env/components/form/text_area/text_area.js +2 -2
  346. package/test-env/components/header/header_links/header_link.js +1 -1
  347. package/test-env/components/header/header_links/header_links.js +1 -1
  348. package/test-env/components/header/header_logo/header_logo.js +1 -1
  349. package/test-env/components/header/header_section/header_section_item_button.js +1 -1
  350. package/test-env/components/icon/assets/logo_vector_db.js +49 -0
  351. package/test-env/components/icon/icon.styles.js +3 -2
  352. package/test-env/components/icon/icon_map.js +5 -0
  353. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  354. package/test-env/components/list_group/list_group.js +2 -2
  355. package/test-env/components/list_group/list_group_item.js +2 -2
  356. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  357. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  358. package/test-env/components/loading/loading_logo.js +1 -1
  359. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  360. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  361. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  362. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  363. package/test-env/components/notification_icon/assets/info_fill.js +41 -0
  364. package/test-env/components/notification_icon/assets/warning_static.js +47 -0
  365. package/test-env/components/notification_icon/notification_icon.js +46 -0
  366. package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
  367. package/test-env/components/page/page_header/page_header_content.js +1 -1
  368. package/test-env/components/pagination/pagination_button.js +1 -1
  369. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  370. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  371. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  372. package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
  373. package/test-env/components/table/table_header_cell.js +1 -1
  374. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  375. package/test-env/components/toast/global_toast_list.js +133 -7
  376. package/test-env/components/toast/global_toast_list.styles.js +30 -7
  377. package/test-env/components/toast/toast.js +243 -48
  378. package/test-env/components/toast/toast.styles.js +33 -45
  379. package/test-env/components/toast/toast_action.js +39 -0
  380. package/test-env/components/toast/types.js +15 -0
  381. package/test-env/components/tool_tip/icon_tip.js +1 -1
  382. package/test-env/components/tool_tip/tool_tip.js +2 -2
@@ -7,13 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.EuiTableSortMobile = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
12
  var _react = _interopRequireWildcard(require("react"));
18
13
  var _classnames = _interopRequireDefault(require("classnames"));
19
14
  var _button_empty = require("../../button/button_empty");
@@ -23,87 +18,70 @@ var _i18n = require("../../i18n");
23
18
  var _table_sort_mobile_item = require("./table_sort_mobile_item");
24
19
  var _react2 = require("@emotion/react");
25
20
  var _excluded = ["className", "anchorPosition", "items"];
26
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
27
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
28
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
29
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*
21
+ /*
30
22
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
31
23
  * or more contributor license agreements. Licensed under the Elastic License
32
24
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
33
25
  * in compliance with, at your election, the Elastic License 2.0 or the Server
34
26
  * Side Public License, v 1.
35
27
  */
36
- var EuiTableSortMobile = exports.EuiTableSortMobile = /*#__PURE__*/function (_Component) {
37
- function EuiTableSortMobile() {
38
- var _this;
39
- (0, _classCallCheck2.default)(this, EuiTableSortMobile);
40
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
41
- args[_key] = arguments[_key];
42
- }
43
- _this = _callSuper(this, EuiTableSortMobile, [].concat(args));
44
- (0, _defineProperty2.default)(_this, "state", {
45
- isPopoverOpen: false
46
- });
47
- (0, _defineProperty2.default)(_this, "onButtonClick", function () {
48
- _this.setState({
49
- isPopoverOpen: !_this.state.isPopoverOpen
50
- });
51
- });
52
- (0, _defineProperty2.default)(_this, "closePopover", function () {
53
- _this.setState({
54
- isPopoverOpen: false
55
- });
56
- });
57
- // Aligns the button to the right even when it's the only element present
58
- (0, _defineProperty2.default)(_this, "euiTableSortMobileStyles", {
59
- marginInlineStart: 'auto',
60
- label: 'euiTableSortMobile'
28
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
29
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
30
+ // Aligns the button to the right even when it's the only element present
31
+ var euiTableSortMobileStyles = {
32
+ marginInlineStart: 'auto',
33
+ label: 'euiTableSortMobile'
34
+ };
35
+ var EuiTableSortMobile = exports.EuiTableSortMobile = function EuiTableSortMobile(_ref) {
36
+ var className = _ref.className,
37
+ anchorPosition = _ref.anchorPosition,
38
+ items = _ref.items,
39
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
40
+ var _useState = (0, _react.useState)(false),
41
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
42
+ isPopoverOpen = _useState2[0],
43
+ setIsPopoverOpen = _useState2[1];
44
+ var classes = (0, _classnames.default)('euiTableSortMobile', className);
45
+ var onButtonClick = function onButtonClick() {
46
+ setIsPopoverOpen(function (isOpen) {
47
+ return !isOpen;
61
48
  });
62
- return _this;
63
- }
64
- (0, _inherits2.default)(EuiTableSortMobile, _Component);
65
- return (0, _createClass2.default)(EuiTableSortMobile, [{
66
- key: "render",
67
- value: function render() {
68
- var _this$props = this.props,
69
- className = _this$props.className,
70
- anchorPosition = _this$props.anchorPosition,
71
- items = _this$props.items,
72
- rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
73
- var classes = (0, _classnames.default)('euiTableSortMobile', className);
74
- var mobileSortButton = (0, _react2.jsx)(_button_empty.EuiButtonEmpty, {
75
- iconType: "chevronSingleDown",
76
- iconSide: "right",
77
- onClick: this.onButtonClick.bind(this),
78
- flush: "right",
79
- size: "xs"
80
- }, (0, _react2.jsx)(_i18n.EuiI18n, {
81
- token: "euiTableSortMobile.sorting",
82
- default: "Sorting"
83
- }));
84
- var mobileSortPopover = (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
85
- button: mobileSortButton,
86
- isOpen: this.state.isPopoverOpen,
87
- closePopover: this.closePopover,
88
- anchorPosition: anchorPosition || 'downRight',
89
- panelPaddingSize: "none"
90
- }, rest), (0, _react2.jsx)(_context_menu.EuiContextMenuPanel, {
91
- style: {
92
- minWidth: 200
93
- },
94
- items: items && items.length ? items.map(function (item) {
95
- return (0, _react2.jsx)(_table_sort_mobile_item.EuiTableSortMobileItem, {
96
- key: item.key,
97
- onSort: item.onSort,
98
- isSorted: item.isSorted,
99
- isSortAscending: item.isSortAscending
100
- }, item.name);
101
- }) : undefined
102
- }));
103
- return (0, _react2.jsx)("div", {
104
- className: classes,
105
- css: this.euiTableSortMobileStyles
106
- }, mobileSortPopover);
107
- }
108
- }]);
109
- }(_react.Component);
49
+ };
50
+ var closePopover = function closePopover() {
51
+ setIsPopoverOpen(false);
52
+ };
53
+ var mobileSortButton = (0, _react2.jsx)(_button_empty.EuiButtonEmpty, {
54
+ iconType: "chevronSingleDown",
55
+ iconSide: "right",
56
+ onClick: onButtonClick,
57
+ flush: "right",
58
+ size: "xs"
59
+ }, (0, _react2.jsx)(_i18n.EuiI18n, {
60
+ token: "euiTableSortMobile.sorting",
61
+ default: "Sorting"
62
+ }));
63
+ var mobileSortPopover = (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
64
+ button: mobileSortButton,
65
+ isOpen: isPopoverOpen,
66
+ closePopover: closePopover,
67
+ anchorPosition: anchorPosition || 'downRight',
68
+ panelPaddingSize: "none"
69
+ }, rest), (0, _react2.jsx)(_context_menu.EuiContextMenuPanel, {
70
+ style: {
71
+ minWidth: 200
72
+ },
73
+ items: items !== null && items !== void 0 && items.length ? items.map(function (item) {
74
+ return (0, _react2.jsx)(_table_sort_mobile_item.EuiTableSortMobileItem, {
75
+ key: item.key,
76
+ onSort: item.onSort,
77
+ isSorted: item.isSorted,
78
+ isSortAscending: item.isSortAscending
79
+ }, item.name);
80
+ }) : undefined
81
+ }));
82
+ return (0, _react2.jsx)("div", {
83
+ className: classes,
84
+ css: euiTableSortMobileStyles
85
+ }, mobileSortPopover);
86
+ };
87
+ EuiTableSortMobile.displayName = 'EuiTableSortMobile';
@@ -21,8 +21,9 @@ var _toast = require("./toast");
21
21
  var _global_toast_list = require("./global_toast_list.styles");
22
22
  var _button = require("../button");
23
23
  var _i18n = require("../i18n");
24
+ var _badge = require("../badge");
24
25
  var _react2 = require("@emotion/react");
25
- var _excluded = ["className", "toasts", "dismissToast", "toastLifeTimeMs", "onClearAllToasts", "side", "showClearAllButtonAt"],
26
+ var _excluded = ["className", "toasts", "dismissToast", "toastLifeTimeMs", "onClearAllToasts", "side", "showClearAllButtonAt", "showNotificationBadge"],
26
27
  _excluded2 = ["text", "toastLifeTimeMs"];
27
28
  /*
28
29
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -53,6 +54,8 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
53
54
  side = _ref$side === void 0 ? 'right' : _ref$side,
54
55
  _ref$showClearAllButt = _ref.showClearAllButtonAt,
55
56
  showClearAllButtonAt = _ref$showClearAllButt === void 0 ? CLEAR_ALL_TOASTS_THRESHOLD_DEFAULT : _ref$showClearAllButt,
57
+ _ref$showNotification = _ref.showNotificationBadge,
58
+ showNotificationBadge = _ref$showNotification === void 0 ? false : _ref$showNotification,
56
59
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
57
60
  var _useState = (0, _react.useState)({}),
58
61
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -227,8 +230,9 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
227
230
  var renderedToasts = (0, _react.useMemo)(function () {
228
231
  return toasts.map(function (toast) {
229
232
  var text = toast.text,
230
- toastLifeTimeMs = toast.toastLifeTimeMs,
233
+ perToastLifeTimeMs = toast.toastLifeTimeMs,
231
234
  rest = (0, _objectWithoutProperties2.default)(toast, _excluded2);
235
+ var effectiveLifeTimeMs = perToastLifeTimeMs !== null && perToastLifeTimeMs !== void 0 ? perToastLifeTimeMs : toastLifeTimeMs;
232
236
  var onClose = function onClose() {
233
237
  return dismissToast(toast);
234
238
  };
@@ -239,9 +243,12 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
239
243
  onClose: onClose,
240
244
  onFocus: onMouseEnter,
241
245
  onBlur: onMouseLeave
242
- }, rest), text));
246
+ }, rest, {
247
+ animationMs: effectiveLifeTimeMs,
248
+ text: text
249
+ })));
243
250
  });
244
- }, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave]);
251
+ }, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave, toastLifeTimeMs]);
245
252
  var clearAllButton = (0, _react.useMemo)(function () {
246
253
  if (toasts.length && showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
247
254
  return (0, _react2.jsx)(_i18n.EuiI18n, {
@@ -255,7 +262,8 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
255
262
  return (0, _react2.jsx)(_global_toast_list_item.EuiGlobalToastListItem, {
256
263
  isDismissed: false
257
264
  }, (0, _react2.jsx)(_button.EuiButton, {
258
- fill: true,
265
+ fullWidth: true,
266
+ size: "s",
259
267
  color: "text",
260
268
  onClick: function onClick() {
261
269
  toasts.forEach(function (toast) {
@@ -271,11 +279,28 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
271
279
  }
272
280
  }, [showClearAllButtonAt, onClearAllToasts, toasts, dismissToastProp, styles]);
273
281
  var classes = (0, _classnames.default)('euiGlobalToastList', className);
282
+ var hasContent = renderedToasts.length > 0 || clearAllButton != null;
283
+ var notificationBadge = (0, _react.useMemo)(function () {
284
+ var _toastIdToDismissedMa, _toasts$;
285
+ var toastWasDismissed = (_toastIdToDismissedMa = toastIdToDismissedMap[(_toasts$ = toasts[0]) === null || _toasts$ === void 0 ? void 0 : _toasts$.id]) !== null && _toastIdToDismissedMa !== void 0 ? _toastIdToDismissedMa : false;
286
+ var isListEmpty = toasts.every(function (t) {
287
+ return toastIdToDismissedMap[t.id];
288
+ });
289
+ return showNotificationBadge && toasts.length > 0 && (0, _react2.jsx)(_badge.EuiNotificationBadge, {
290
+ className: "euiGlobalToastList__countBadge",
291
+ css: [styles.notificationBadge.notificationBadge, toastWasDismissed && styles.notificationBadge.hasFadeOut, isListEmpty && styles.notificationBadge.hasFadeOut, ";label:notificationBadge;"],
292
+ size: "m",
293
+ color: "subdued",
294
+ "data-test-subj": "euiGlobalToastListNotificationBadge"
295
+ }, toasts.length);
296
+ }, [showNotificationBadge, toasts, toastIdToDismissedMap, styles]);
274
297
  return (0, _react2.jsx)("div", (0, _extends2.default)({
275
298
  "aria-live": "polite",
276
299
  role: "log",
277
300
  ref: listElement,
278
301
  css: cssStyles,
279
302
  className: classes
280
- }, rest), renderedToasts, clearAllButton);
303
+ }, rest), hasContent && (0, _react2.jsx)("div", {
304
+ css: styles.content
305
+ }, notificationBadge, renderedToasts, clearAllButton));
281
306
  };
@@ -8,33 +8,56 @@ exports.euiGlobalToastListStyles = exports.euiGlobalToastListItemStyles = void 0
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _global_styling = require("../../global_styling");
11
- var _templateObject;
12
- /*
11
+ var _templateObject, _templateObject2;
12
+ 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)."; } /*
13
13
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
14
  * or more contributor license agreements. Licensed under the Elastic License
15
15
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
16
  * in compliance with, at your election, the Elastic License 2.0 or the Server
17
17
  * Side Public License, v 1.
18
18
  */
19
+ var _ref = process.env.NODE_ENV === "production" ? {
20
+ name: "ox3d1t-hasFadeOut",
21
+ styles: "opacity:0;label:hasFadeOut;"
22
+ } : {
23
+ name: "ox3d1t-hasFadeOut",
24
+ styles: "opacity:0;label:hasFadeOut;",
25
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
26
+ };
27
+ var _ref2 = process.env.NODE_ENV === "production" ? {
28
+ name: "19mjubd-content",
29
+ styles: "position:relative;label:content;"
30
+ } : {
31
+ name: "19mjubd-content",
32
+ styles: "position:relative;label:content;",
33
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
34
+ };
19
35
  var euiGlobalToastListStyles = exports.euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
20
36
  var euiTheme = euiThemeContext.euiTheme;
21
- var euiToastWidth = euiTheme.base * 25;
37
+ var euiToastWidth = euiTheme.base * 27.5; // 440px -> results in 360px toast width
38
+
39
+ var showNotificationBadge = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n from { opacity: 0; }\n to { opacity: 1; }\n "])));
22
40
  return {
23
41
  /**
24
42
  * 1. Allow list to expand as items are added, but cap it at the screen height.
25
43
  * 2. Allow some padding for shadow
26
44
  */
27
45
  // Base
28
- euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth, "px")), (0, _global_styling.logicalCSS)('max-height', '100vh'), (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
46
+ euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth, "px")), (0, _global_styling.logicalCSS)('max-height', '100vh'), (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:hover .euiToastDecor::before,&:focus-within .euiToastDecor::before{animation-play-state:paused;}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
47
+ content: _ref2,
48
+ notificationBadge: {
49
+ notificationBadge: /*#__PURE__*/(0, _react.css)("position:absolute;inset-block-start:-", euiTheme.size.s, ";inset-inline-start:-", euiTheme.size.s, ";z-index:", Number(euiTheme.levels.content) + 1, ";", _global_styling.euiCanAnimate, "{animation:", euiTheme.animation.normal, " ", showNotificationBadge, " ", euiTheme.animation.resistance, ";transition:opacity ", euiTheme.animation.fast, ";};label:notificationBadge;"),
50
+ hasFadeOut: _ref
51
+ },
29
52
  // Variants
30
53
  right: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('right', 0), ";", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('padding-left', "".concat(euiTheme.base * 4, "px")), ";}};label:right;"),
31
54
  left: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('padding-right', "".concat(euiTheme.base * 4, "px")), ";}};label:left;"),
32
55
  euiGlobalToastListDismissButton: /*#__PURE__*/(0, _react.css)("position:sticky;", (0, _global_styling.logicalCSS)('bottom', '0%'), ";;label:euiGlobalToastListDismissButton;")
33
56
  };
34
57
  };
35
- var euiGlobalToastListItemStyles = exports.euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref) {
36
- var euiTheme = _ref.euiTheme;
37
- var euiShowToast = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n from {\n transform: translateY(", ") scale(.9);\n opacity: 0;\n }\n\n to {\n transform: translateY(0) scale(1);\n opacity: 1;\n }\n"])), euiTheme.size.l);
58
+ var euiGlobalToastListItemStyles = exports.euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref3) {
59
+ var euiTheme = _ref3.euiTheme;
60
+ var euiShowToast = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n from {\n transform: translateY(", ") scale(.9);\n opacity: 0;\n }\n\n to {\n transform: translateY(0) scale(1);\n opacity: 1;\n }\n"])), euiTheme.size.l);
38
61
  return {
39
62
  // Base
40
63
  euiGlobalToastListItem: /*#__PURE__*/(0, _react.css)("flex-shrink:0;", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.base), " animation:", euiTheme.animation.normal, " ", euiShowToast, " ", euiTheme.animation.resistance, ";opacity:1;&:first-child{", (0, _global_styling.logicalCSS)('margin-top', 'auto'), ";}&:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', 0), ";};label:euiGlobalToastListItem;"),
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
- exports.EuiToast = exports.COLORS = void 0;
8
+ exports.EuiToast = exports.COLOR_TO_NOTIFICATION_ICON_MAP = void 0;
8
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
- var _react = _interopRequireDefault(require("react"));
12
+ var _react = _interopRequireWildcard(require("react"));
11
13
  var _classnames = _interopRequireDefault(require("classnames"));
14
+ var _euiThemeCommon = require("@elastic/eui-theme-common");
12
15
  var _services = require("../../services");
13
16
  var _accessibility = require("../accessibility");
14
17
  var _button = require("../button");
@@ -16,8 +19,12 @@ var _i18n = require("../i18n");
16
19
  var _icon = require("../icon");
17
20
  var _text = require("../text");
18
21
  var _toast = require("./toast.styles");
22
+ var _notification_icon = require("../notification_icon/notification_icon");
23
+ var _notification_icon2 = require("../notification_icon/notification_icon.styles");
24
+ var _toast_action = require("./toast_action");
25
+ var _title = require("../title");
19
26
  var _react2 = require("@emotion/react");
20
- var _excluded = ["title", "color", "iconType", "onClose", "children", "className"];
27
+ var _excluded = ["title", "text", "color", "iconType", "children", "className", "actionProps", "style", "onClose", "animationMs"];
21
28
  /*
22
29
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
23
30
  * or more contributor license agreements. Licensed under the Elastic License
@@ -25,58 +32,150 @@ var _excluded = ["title", "color", "iconType", "onClose", "children", "className
25
32
  * in compliance with, at your election, the Elastic License 2.0 or the Server
26
33
  * Side Public License, v 1.
27
34
  */
28
- var COLORS = exports.COLORS = ['primary', 'success', 'warning', 'danger'];
35
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
36
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
37
+ 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; }
38
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
39
+ var COLOR_TO_NOTIFICATION_ICON_MAP = exports.COLOR_TO_NOTIFICATION_ICON_MAP = {
40
+ primary: 'info',
41
+ success: 'success',
42
+ warning: 'warning',
43
+ danger: 'error'
44
+ };
29
45
  var EuiToast = exports.EuiToast = function EuiToast(_ref) {
30
46
  var title = _ref.title,
31
- color = _ref.color,
47
+ text = _ref.text,
48
+ _ref$color = _ref.color,
49
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
32
50
  iconType = _ref.iconType,
33
- onClose = _ref.onClose,
34
51
  children = _ref.children,
35
52
  className = _ref.className,
53
+ actionProps = _ref.actionProps,
54
+ style = _ref.style,
55
+ onClose = _ref.onClose,
56
+ animationMs = _ref.animationMs,
36
57
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
37
- var baseStyles = (0, _services.useEuiMemoizedStyles)(_toast.euiToastStyles);
38
- var baseCss = [baseStyles.euiToast, color && baseStyles.colors[color]];
58
+ var _useEuiTheme = (0, _services.useEuiTheme)(),
59
+ euiTheme = _useEuiTheme.euiTheme;
60
+ var styles = (0, _services.useEuiMemoizedStyles)(_toast.euiToastStyles);
61
+ var iconStyles = (0, _services.useEuiMemoizedStyles)(_notification_icon2.euiNotificationIconStyles);
39
62
  var headerStyles = (0, _services.useEuiMemoizedStyles)(_toast.euiToastHeaderStyles);
40
- var headerCss = [headerStyles.euiToastHeader, children && headerStyles.withBody];
41
- var classes = (0, _classnames.default)('euiToast', className);
63
+ var cssStyles = [styles.euiToast];
64
+ var decorCssStyles = [styles.decor, animationMs && styles.hasAnimation];
65
+ var classes = (0, _classnames.default)('euiToast', className, (0, _defineProperty2.default)({}, "euiToast--".concat(color), color));
66
+ var highlightColorToken = (0, _euiThemeCommon.getTokenName)('borderStrong', color);
67
+ var typeColor = euiTheme.colors[highlightColorToken];
68
+ var backgroundLightToken = (0, _euiThemeCommon.getTokenName)('backgroundLight', color);
69
+ var backgroundLightColor = euiTheme.colors[backgroundLightToken];
70
+ var cssVariables = (0, _react.useMemo)(function () {
71
+ return _objectSpread({
72
+ '--euiToastTypeColor': typeColor,
73
+ '--euiToastTypeBackgroundColor': backgroundLightColor
74
+ }, animationMs && {
75
+ '--euiToastAnimationMs': "".concat(animationMs, "ms")
76
+ });
77
+ }, [typeColor, backgroundLightColor, animationMs]);
78
+ var dismissButton = (0, _react.useMemo)(function () {
79
+ if (!onClose) return;
80
+ return (0, _react2.jsx)(_i18n.EuiI18n, {
81
+ token: "euiToast.dismissToast",
82
+ default: "Dismiss toast"
83
+ }, function (dismissToast) {
84
+ return (0, _react2.jsx)(_button.EuiButtonIcon, {
85
+ css: styles.dismissButton,
86
+ iconType: "cross",
87
+ color: "text",
88
+ size: "xs",
89
+ "aria-label": dismissToast,
90
+ onClick: onClose,
91
+ "data-test-subj": "toastCloseButton"
92
+ });
93
+ });
94
+ }, [onClose, styles]);
95
+ var header = (0, _react.useMemo)(function () {
96
+ if (!title) return;
97
+ var headerCssStyles = [headerStyles.euiToastHeader, onClose && headerStyles.hasDismissButton];
98
+ return (0, _react2.jsx)(_title.EuiTitle, {
99
+ size: "xs",
100
+ css: headerCssStyles,
101
+ "data-test-subj": "euiToastHeader__title"
102
+ }, (0, _react2.jsx)("p", null, title));
103
+ }, [title, headerStyles, onClose]);
104
+ var icon = (0, _react.useMemo)(function () {
105
+ if (!iconType) {
106
+ var _COLOR_TO_NOTIFICATIO;
107
+ var defaultIconType = (_COLOR_TO_NOTIFICATIO = COLOR_TO_NOTIFICATION_ICON_MAP[color]) !== null && _COLOR_TO_NOTIFICATIO !== void 0 ? _COLOR_TO_NOTIFICATIO : 'info';
108
+ return (0, _react2.jsx)(_notification_icon.EuiNotificationIcon, {
109
+ css: styles.icon,
110
+ type: defaultIconType,
111
+ size: "l"
112
+ });
113
+ }
114
+ return (0, _react2.jsx)(_icon.EuiIcon, {
115
+ css: [styles.icon, iconStyles.size.l, ";label:icon;"],
116
+ type: iconType,
117
+ size: "l",
118
+ "aria-hidden": "true",
119
+ color: typeColor
120
+ });
121
+ }, [iconType, color, typeColor, styles, iconStyles]);
122
+ var optionalChildren = (0, _react.useMemo)(function () {
123
+ if (!text && !children) return null;
124
+ return (0, _react2.jsx)("div", {
125
+ css: styles.text,
126
+ "data-test-subj": "euiToastBody"
127
+ }, text && (0, _react2.jsx)(_text.EuiText, {
128
+ size: "s",
129
+ color: "default",
130
+ className: "euiToast__text",
131
+ "data-test-subj": "euiToastText"
132
+ }, text), children && (0, _react2.jsx)(_text.EuiText, {
133
+ className: "euiToast__additionalContent",
134
+ size: "s",
135
+ color: "default",
136
+ "data-test-subj": "euiToastAdditionalContent"
137
+ }, children));
138
+ }, [text, children, styles]);
139
+ var actionControls = (0, _react.useMemo)(function () {
140
+ var actionPrimaryProps = _objectSpread(_objectSpread({}, actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary), {}, {
141
+ color: color
142
+ });
143
+ var actionSecondaryProps = _objectSpread(_objectSpread({}, actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary), {}, {
144
+ color: color
145
+ });
146
+ var hasActionPrimary = Boolean(actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary);
147
+ var hasActionSecondary = Boolean(actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary);
148
+ if (!hasActionPrimary && !hasActionSecondary) return null;
149
+ var actionPrimary = hasActionPrimary && (0, _react2.jsx)(_toast_action.EuiToastAction, (0, _extends2.default)({
150
+ actionType: "primary"
151
+ }, actionPrimaryProps));
152
+ var actionSecondary = hasActionSecondary && (0, _react2.jsx)(_toast_action.EuiToastAction, (0, _extends2.default)({
153
+ actionType: "secondary"
154
+ }, actionSecondaryProps));
155
+ return (0, _react2.jsx)("div", {
156
+ css: styles.actions
157
+ }, actionPrimary, actionSecondary);
158
+ }, [actionProps, color, styles]);
42
159
  return (0, _react2.jsx)("div", (0, _extends2.default)({
43
- css: baseCss,
44
- className: classes
45
- }, rest), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, (0, _react2.jsx)(_i18n.EuiI18n, {
160
+ css: cssStyles,
161
+ className: classes,
162
+ style: _objectSpread(_objectSpread({}, cssVariables), style)
163
+ }, rest), (0, _react2.jsx)("div", {
164
+ className: "euiToastDecor",
165
+ css: decorCssStyles,
166
+ role: "presentation"
167
+ }), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", null, (0, _react2.jsx)(_i18n.EuiI18n, {
46
168
  token: "euiToast.newNotification",
47
169
  default: "A new notification appears"
48
- }))), (0, _react2.jsx)(_i18n.EuiI18n, {
49
- token: "euiToast.notification",
50
- default: "Notification"
51
- }, function (notification) {
52
- return (0, _react2.jsx)("div", {
53
- css: headerCss,
54
- "aria-label": notification,
55
- "data-test-subj": "euiToastHeader"
56
- }, iconType && (0, _react2.jsx)(_icon.EuiIcon, {
57
- css: headerStyles.euiToastHeader__icon,
58
- type: iconType,
59
- size: "m",
60
- "aria-hidden": "true"
61
- }), (0, _react2.jsx)("span", {
62
- css: headerStyles.euiToastHeader__title,
63
- "data-test-subj": "euiToastHeader__title"
64
- }, title));
65
- }), onClose && (0, _react2.jsx)(_i18n.EuiI18n, {
66
- token: "euiToast.dismissToast",
67
- default: "Dismiss toast"
68
- }, function (dismissToast) {
69
- return (0, _react2.jsx)(_button.EuiButtonIcon, {
70
- css: baseStyles.euiToast__closeButton,
71
- iconType: "cross",
72
- color: "text",
73
- size: "xs",
74
- "aria-label": dismissToast,
75
- onClick: onClose,
76
- "data-test-subj": "toastCloseButton"
77
- });
78
- }), children && (0, _react2.jsx)(_text.EuiText, {
79
- size: "s",
80
- "data-test-subj": "euiToastBody"
81
- }, children));
170
+ }))), (0, _react2.jsx)("div", {
171
+ css: styles.wrapper
172
+ }, (0, _react2.jsx)("div", {
173
+ css: styles.body
174
+ }, icon, (0, _react2.jsx)("div", {
175
+ css: styles.content
176
+ },
177
+ // Note: the DOM position of the dismiss button matters to screen reader users.
178
+ // We generally want them to have some context of _what_ they're dismissing,
179
+ // instead of navigating to the dismiss button first before the content
180
+ header && optionalChildren ? (0, _react2.jsx)(_react.default.Fragment, null, header, dismissButton, optionalChildren) : (0, _react2.jsx)(_react.default.Fragment, null, header || optionalChildren, dismissButton))), actionControls));
82
181
  };