@elastic/eui 93.2.0 → 93.4.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 (418) hide show
  1. package/dist/eui_charts_theme.d.ts +9 -0
  2. package/dist/eui_charts_theme.js +56 -14
  3. package/dist/eui_charts_theme.js.map +1 -1
  4. package/dist/eui_theme_dark.css +3 -0
  5. package/dist/eui_theme_dark.min.css +1 -1
  6. package/dist/eui_theme_light.css +3 -0
  7. package/dist/eui_theme_light.min.css +1 -1
  8. package/es/components/breadcrumbs/_breadcrumb_content.js +362 -0
  9. package/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
  10. package/es/components/breadcrumbs/breadcrumb.js +10 -324
  11. package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
  12. package/es/components/breadcrumbs/breadcrumbs.js +8 -6
  13. package/es/components/breadcrumbs/types.js +1 -0
  14. package/es/components/button/button_display/_button_display.js +2 -3
  15. package/es/components/button/button_empty/button_empty.js +2 -3
  16. package/es/components/button/button_group/button_group.js +19 -7
  17. package/es/components/button/button_group/button_group.styles.js +11 -14
  18. package/es/components/button/button_group/button_group_button.js +59 -5
  19. package/es/components/button/button_group/button_group_button.styles.js +39 -3
  20. package/es/components/button/button_icon/button_icon.js +4 -5
  21. package/es/components/button/button_icon/button_icon.styles.js +11 -3
  22. package/es/components/datagrid/body/cell/data_grid_cell.js +102 -59
  23. package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  24. package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
  25. package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
  26. package/es/components/datagrid/body/cell/index.js +1 -1
  27. package/es/components/datagrid/body/data_grid_body.js +14 -0
  28. package/es/components/datagrid/body/data_grid_body_custom.js +54 -35
  29. package/es/components/datagrid/body/data_grid_body_virtualized.js +87 -56
  30. package/es/components/datagrid/body/data_grid_row_manager.js +7 -5
  31. package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  32. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
  33. package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
  34. package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
  35. package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
  36. package/es/components/datagrid/controls/column_selector.js +126 -123
  37. package/es/components/datagrid/controls/column_sorting.js +605 -103
  38. package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
  39. package/es/components/datagrid/controls/display_selector.js +109 -107
  40. package/es/components/datagrid/data_grid.a11y.js +13 -12
  41. package/es/components/datagrid/data_grid.js +47 -22
  42. package/es/components/datagrid/utils/col_widths.js +12 -8
  43. package/es/components/datagrid/utils/focus.js +10 -8
  44. package/es/components/datagrid/utils/grid_height_width.js +31 -30
  45. package/es/components/datagrid/utils/ref.js +1 -1
  46. package/es/components/datagrid/utils/row_heights.js +2 -2
  47. package/es/components/datagrid/utils/sorting.js +29 -27
  48. package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  49. package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
  50. package/es/components/facet/facet_button.styles.js +1 -2
  51. package/es/components/flex/flex_grid.js +22 -8
  52. package/es/components/flex/flex_grid.styles.js +13 -6
  53. package/es/components/flex/flex_group.js +10 -11
  54. package/es/components/flex/flex_item.js +9 -11
  55. package/es/components/flex/flex_item.styles.js +107 -122
  56. package/es/components/flyout/flyout.js +16 -18
  57. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
  58. package/es/components/icon/icon.js +13 -16
  59. package/es/components/icon/icon.styles.js +6 -9
  60. package/es/components/link/external_link_icon.js +11 -8
  61. package/es/components/link/link.js +2 -3
  62. package/es/components/link/link.styles.js +4 -10
  63. package/es/components/modal/confirm_modal.js +2 -1
  64. package/es/components/modal/modal.js +12 -3
  65. package/es/components/observer/resize_observer/resize_observer.js +15 -24
  66. package/es/components/page/page_header/page_header_content.js +4 -2
  67. package/es/components/progress/progress.styles.js +2 -2
  68. package/es/components/skeleton/skeleton_circle.js +2 -3
  69. package/es/components/skeleton/skeleton_rectangle.js +2 -3
  70. package/es/components/skeleton/skeleton_text.js +16 -12
  71. package/es/components/skeleton/skeleton_title.js +2 -3
  72. package/es/components/spacer/spacer.js +2 -3
  73. package/es/components/text/text.js +2 -3
  74. package/es/components/text/text_align.js +1 -2
  75. package/es/components/text/text_align.styles.js +5 -7
  76. package/es/components/text/text_color.js +2 -3
  77. package/es/components/title/title.js +2 -3
  78. package/es/components/title/title.styles.js +0 -7
  79. package/es/components/toast/global_toast_list.js +70 -73
  80. package/es/components/toast/toast.js +27 -42
  81. package/es/components/toast/toast.styles.js +2 -17
  82. package/es/global_styling/mixins/_typography.js +17 -6
  83. package/es/services/color/eui_palettes.js +21 -13
  84. package/es/services/color/index.js +1 -1
  85. package/es/services/hooks/index.js +1 -0
  86. package/es/services/hooks/useDeepEqual.js +23 -0
  87. package/es/services/index.js +1 -1
  88. package/es/services/theme/index.js +1 -1
  89. package/es/services/theme/style_memoization.js +47 -14
  90. package/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
  91. package/eui.d.ts +2862 -2748
  92. package/i18ntokens.json +267 -267
  93. package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
  94. package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  95. package/lib/components/breadcrumbs/breadcrumb.js +11 -328
  96. package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
  97. package/lib/components/breadcrumbs/breadcrumbs.js +7 -5
  98. package/lib/components/breadcrumbs/types.js +5 -0
  99. package/lib/components/button/button_display/_button_display.js +1 -2
  100. package/lib/components/button/button_empty/button_empty.js +1 -2
  101. package/lib/components/button/button_group/button_group.js +18 -6
  102. package/lib/components/button/button_group/button_group.styles.js +11 -14
  103. package/lib/components/button/button_group/button_group_button.js +59 -5
  104. package/lib/components/button/button_group/button_group_button.styles.js +45 -11
  105. package/lib/components/button/button_icon/button_icon.js +3 -4
  106. package/lib/components/button/button_icon/button_icon.styles.js +10 -2
  107. package/lib/components/datagrid/body/cell/data_grid_cell.js +100 -58
  108. package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  109. package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  110. package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
  111. package/lib/components/datagrid/body/cell/index.js +2 -2
  112. package/lib/components/datagrid/body/data_grid_body.js +14 -0
  113. package/lib/components/datagrid/body/data_grid_body_custom.js +53 -34
  114. package/lib/components/datagrid/body/data_grid_body_virtualized.js +86 -55
  115. package/lib/components/datagrid/body/data_grid_row_manager.js +6 -4
  116. package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  117. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  118. package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
  119. package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
  120. package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
  121. package/lib/components/datagrid/controls/column_selector.js +126 -123
  122. package/lib/components/datagrid/controls/column_sorting.js +615 -110
  123. package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
  124. package/lib/components/datagrid/controls/display_selector.js +109 -107
  125. package/lib/components/datagrid/data_grid.a11y.js +13 -12
  126. package/lib/components/datagrid/data_grid.js +45 -20
  127. package/lib/components/datagrid/utils/col_widths.js +12 -8
  128. package/lib/components/datagrid/utils/focus.js +10 -8
  129. package/lib/components/datagrid/utils/grid_height_width.js +29 -28
  130. package/lib/components/datagrid/utils/ref.js +1 -1
  131. package/lib/components/datagrid/utils/row_heights.js +1 -1
  132. package/lib/components/datagrid/utils/sorting.js +31 -29
  133. package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  134. package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
  135. package/lib/components/facet/facet_button.styles.js +1 -2
  136. package/lib/components/flex/flex_grid.js +23 -7
  137. package/lib/components/flex/flex_grid.styles.js +13 -6
  138. package/lib/components/flex/flex_group.js +10 -10
  139. package/lib/components/flex/flex_item.js +13 -13
  140. package/lib/components/flex/flex_item.styles.js +107 -122
  141. package/lib/components/flyout/flyout.js +16 -18
  142. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
  143. package/lib/components/icon/icon.js +12 -15
  144. package/lib/components/icon/icon.styles.js +5 -8
  145. package/lib/components/link/external_link_icon.js +10 -7
  146. package/lib/components/link/link.js +1 -2
  147. package/lib/components/link/link.styles.js +6 -14
  148. package/lib/components/modal/confirm_modal.js +2 -1
  149. package/lib/components/modal/modal.js +12 -3
  150. package/lib/components/observer/resize_observer/resize_observer.js +15 -24
  151. package/lib/components/page/page_header/page_header_content.js +4 -2
  152. package/lib/components/progress/progress.styles.js +1 -1
  153. package/lib/components/skeleton/skeleton_circle.js +1 -2
  154. package/lib/components/skeleton/skeleton_rectangle.js +1 -2
  155. package/lib/components/skeleton/skeleton_text.js +18 -11
  156. package/lib/components/skeleton/skeleton_title.js +1 -2
  157. package/lib/components/spacer/spacer.js +1 -2
  158. package/lib/components/text/text.js +1 -2
  159. package/lib/components/text/text_align.js +1 -2
  160. package/lib/components/text/text_align.styles.js +5 -7
  161. package/lib/components/text/text_color.js +1 -2
  162. package/lib/components/title/title.js +1 -2
  163. package/lib/components/title/title.styles.js +2 -10
  164. package/lib/components/toast/global_toast_list.js +68 -71
  165. package/lib/components/toast/toast.js +25 -40
  166. package/lib/components/toast/toast.styles.js +11 -25
  167. package/lib/global_styling/mixins/_typography.js +27 -19
  168. package/lib/services/color/eui_palettes.js +24 -14
  169. package/lib/services/color/index.js +14 -0
  170. package/lib/services/hooks/index.js +11 -0
  171. package/lib/services/hooks/useDeepEqual.js +30 -0
  172. package/lib/services/index.js +15 -1
  173. package/lib/services/theme/index.js +6 -0
  174. package/lib/services/theme/style_memoization.js +49 -16
  175. package/lib/themes/amsterdam/global_styling/mixins/button.js +49 -25
  176. package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
  177. package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
  178. package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -109
  179. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
  180. package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
  181. package/optimize/es/components/breadcrumbs/types.js +1 -0
  182. package/optimize/es/components/button/button_display/_button_display.js +2 -3
  183. package/optimize/es/components/button/button_empty/button_empty.js +2 -3
  184. package/optimize/es/components/button/button_group/button_group.js +5 -7
  185. package/optimize/es/components/button/button_group/button_group.styles.js +11 -14
  186. package/optimize/es/components/button/button_group/button_group_button.js +36 -4
  187. package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
  188. package/optimize/es/components/button/button_icon/button_icon.js +4 -5
  189. package/optimize/es/components/button/button_icon/button_icon.styles.js +8 -3
  190. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +83 -56
  191. package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  192. package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
  193. package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
  194. package/optimize/es/components/datagrid/body/cell/index.js +1 -1
  195. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +40 -35
  196. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +71 -49
  197. package/optimize/es/components/datagrid/body/data_grid_row_manager.js +7 -5
  198. package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  199. package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
  200. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
  201. package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
  202. package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
  203. package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
  204. package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
  205. package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
  206. package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
  207. package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
  208. package/optimize/es/components/datagrid/data_grid.js +47 -22
  209. package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
  210. package/optimize/es/components/datagrid/utils/focus.js +10 -8
  211. package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
  212. package/optimize/es/components/datagrid/utils/ref.js +1 -1
  213. package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
  214. package/optimize/es/components/datagrid/utils/sorting.js +29 -27
  215. package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
  216. package/optimize/es/components/facet/facet_button.styles.js +1 -2
  217. package/optimize/es/components/flex/flex_grid.js +19 -8
  218. package/optimize/es/components/flex/flex_grid.styles.js +13 -6
  219. package/optimize/es/components/flex/flex_group.js +9 -10
  220. package/optimize/es/components/flex/flex_item.js +9 -11
  221. package/optimize/es/components/flex/flex_item.styles.js +107 -122
  222. package/optimize/es/components/flyout/flyout.js +16 -18
  223. package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  224. package/optimize/es/components/icon/icon.js +13 -16
  225. package/optimize/es/components/icon/icon.styles.js +6 -9
  226. package/optimize/es/components/link/external_link_icon.js +11 -8
  227. package/optimize/es/components/link/link.js +2 -3
  228. package/optimize/es/components/link/link.styles.js +4 -10
  229. package/optimize/es/components/modal/confirm_modal.js +2 -1
  230. package/optimize/es/components/modal/modal.js +6 -2
  231. package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
  232. package/optimize/es/components/progress/progress.styles.js +2 -2
  233. package/optimize/es/components/skeleton/skeleton_circle.js +2 -3
  234. package/optimize/es/components/skeleton/skeleton_rectangle.js +2 -3
  235. package/optimize/es/components/skeleton/skeleton_text.js +16 -12
  236. package/optimize/es/components/skeleton/skeleton_title.js +2 -3
  237. package/optimize/es/components/spacer/spacer.js +2 -3
  238. package/optimize/es/components/text/text.js +2 -3
  239. package/optimize/es/components/text/text_align.js +1 -2
  240. package/optimize/es/components/text/text_align.styles.js +5 -7
  241. package/optimize/es/components/text/text_color.js +2 -3
  242. package/optimize/es/components/title/title.js +2 -3
  243. package/optimize/es/components/title/title.styles.js +0 -7
  244. package/optimize/es/components/toast/global_toast_list.js +70 -73
  245. package/optimize/es/components/toast/toast.js +27 -42
  246. package/optimize/es/components/toast/toast.styles.js +2 -17
  247. package/optimize/es/global_styling/mixins/_typography.js +14 -6
  248. package/optimize/es/services/color/eui_palettes.js +21 -13
  249. package/optimize/es/services/color/index.js +1 -1
  250. package/optimize/es/services/hooks/index.js +1 -0
  251. package/optimize/es/services/hooks/useDeepEqual.js +23 -0
  252. package/optimize/es/services/index.js +1 -1
  253. package/optimize/es/services/theme/index.js +1 -1
  254. package/optimize/es/services/theme/style_memoization.js +47 -14
  255. package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
  256. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
  257. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  258. package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -112
  259. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
  260. package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
  261. package/optimize/lib/components/breadcrumbs/types.js +5 -0
  262. package/optimize/lib/components/button/button_display/_button_display.js +1 -2
  263. package/optimize/lib/components/button/button_empty/button_empty.js +1 -2
  264. package/optimize/lib/components/button/button_group/button_group.js +4 -6
  265. package/optimize/lib/components/button/button_group/button_group.styles.js +11 -14
  266. package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
  267. package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
  268. package/optimize/lib/components/button/button_icon/button_icon.js +3 -4
  269. package/optimize/lib/components/button/button_icon/button_icon.styles.js +8 -2
  270. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +81 -55
  271. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  272. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  273. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
  274. package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
  275. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +39 -34
  276. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +72 -50
  277. package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +6 -4
  278. package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  279. package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  280. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
  281. package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
  282. package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
  283. package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
  284. package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
  285. package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
  286. package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
  287. package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
  288. package/optimize/lib/components/datagrid/data_grid.js +45 -20
  289. package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
  290. package/optimize/lib/components/datagrid/utils/focus.js +10 -8
  291. package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
  292. package/optimize/lib/components/datagrid/utils/ref.js +1 -1
  293. package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
  294. package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
  295. package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
  296. package/optimize/lib/components/facet/facet_button.styles.js +1 -2
  297. package/optimize/lib/components/flex/flex_grid.js +21 -7
  298. package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
  299. package/optimize/lib/components/flex/flex_group.js +9 -9
  300. package/optimize/lib/components/flex/flex_item.js +13 -13
  301. package/optimize/lib/components/flex/flex_item.styles.js +107 -122
  302. package/optimize/lib/components/flyout/flyout.js +16 -18
  303. package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  304. package/optimize/lib/components/icon/icon.js +12 -15
  305. package/optimize/lib/components/icon/icon.styles.js +5 -8
  306. package/optimize/lib/components/link/external_link_icon.js +10 -7
  307. package/optimize/lib/components/link/link.js +1 -2
  308. package/optimize/lib/components/link/link.styles.js +6 -14
  309. package/optimize/lib/components/modal/confirm_modal.js +2 -1
  310. package/optimize/lib/components/modal/modal.js +6 -2
  311. package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
  312. package/optimize/lib/components/progress/progress.styles.js +1 -1
  313. package/optimize/lib/components/skeleton/skeleton_circle.js +1 -2
  314. package/optimize/lib/components/skeleton/skeleton_rectangle.js +1 -2
  315. package/optimize/lib/components/skeleton/skeleton_text.js +18 -11
  316. package/optimize/lib/components/skeleton/skeleton_title.js +1 -2
  317. package/optimize/lib/components/spacer/spacer.js +1 -2
  318. package/optimize/lib/components/text/text.js +1 -2
  319. package/optimize/lib/components/text/text_align.js +1 -2
  320. package/optimize/lib/components/text/text_align.styles.js +5 -7
  321. package/optimize/lib/components/text/text_color.js +1 -2
  322. package/optimize/lib/components/title/title.js +1 -2
  323. package/optimize/lib/components/title/title.styles.js +2 -10
  324. package/optimize/lib/components/toast/global_toast_list.js +68 -71
  325. package/optimize/lib/components/toast/toast.js +25 -40
  326. package/optimize/lib/components/toast/toast.styles.js +11 -25
  327. package/optimize/lib/global_styling/mixins/_typography.js +25 -19
  328. package/optimize/lib/services/color/eui_palettes.js +24 -14
  329. package/optimize/lib/services/color/index.js +14 -0
  330. package/optimize/lib/services/hooks/index.js +11 -0
  331. package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
  332. package/optimize/lib/services/index.js +15 -1
  333. package/optimize/lib/services/theme/index.js +6 -0
  334. package/optimize/lib/services/theme/style_memoization.js +49 -16
  335. package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +49 -26
  336. package/package.json +3 -3
  337. package/src/components/datagrid/_data_grid_data_row.scss +4 -0
  338. package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
  339. package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  340. package/test-env/components/breadcrumbs/breadcrumb.js +11 -323
  341. package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
  342. package/test-env/components/breadcrumbs/breadcrumbs.js +7 -5
  343. package/test-env/components/breadcrumbs/types.js +5 -0
  344. package/test-env/components/button/button_display/_button_display.js +1 -2
  345. package/test-env/components/button/button_empty/button_empty.js +1 -2
  346. package/test-env/components/button/button_group/button_group.js +18 -6
  347. package/test-env/components/button/button_group/button_group.styles.js +11 -14
  348. package/test-env/components/button/button_group/button_group_button.js +56 -5
  349. package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
  350. package/test-env/components/button/button_icon/button_icon.js +3 -4
  351. package/test-env/components/button/button_icon/button_icon.styles.js +8 -2
  352. package/test-env/components/datagrid/body/cell/data_grid_cell.js +100 -58
  353. package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  354. package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  355. package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +34 -31
  356. package/test-env/components/datagrid/body/cell/index.js +2 -2
  357. package/test-env/components/datagrid/body/data_grid_body.js +14 -0
  358. package/test-env/components/datagrid/body/data_grid_body_custom.js +53 -34
  359. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +86 -55
  360. package/test-env/components/datagrid/body/data_grid_row_manager.js +6 -4
  361. package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  362. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  363. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
  364. package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
  365. package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
  366. package/test-env/components/datagrid/controls/column_selector.js +126 -123
  367. package/test-env/components/datagrid/controls/column_sorting.js +607 -106
  368. package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
  369. package/test-env/components/datagrid/controls/display_selector.js +109 -107
  370. package/test-env/components/datagrid/data_grid.a11y.js +13 -12
  371. package/test-env/components/datagrid/data_grid.js +45 -20
  372. package/test-env/components/datagrid/utils/col_widths.js +9 -5
  373. package/test-env/components/datagrid/utils/focus.js +10 -8
  374. package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
  375. package/test-env/components/datagrid/utils/ref.js +1 -1
  376. package/test-env/components/datagrid/utils/row_heights.js +1 -1
  377. package/test-env/components/datagrid/utils/sorting.js +31 -29
  378. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  379. package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
  380. package/test-env/components/facet/facet_button.styles.js +1 -2
  381. package/test-env/components/flex/flex_grid.js +21 -7
  382. package/test-env/components/flex/flex_grid.styles.js +13 -6
  383. package/test-env/components/flex/flex_group.js +10 -10
  384. package/test-env/components/flex/flex_item.js +13 -13
  385. package/test-env/components/flex/flex_item.styles.js +107 -122
  386. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +7 -7
  387. package/test-env/components/icon/icon.styles.js +5 -8
  388. package/test-env/components/link/external_link_icon.js +10 -7
  389. package/test-env/components/link/link.js +1 -2
  390. package/test-env/components/link/link.styles.js +6 -14
  391. package/test-env/components/modal/confirm_modal.js +2 -1
  392. package/test-env/components/modal/modal.js +12 -3
  393. package/test-env/components/page/page_header/page_header_content.js +4 -2
  394. package/test-env/components/progress/progress.styles.js +1 -1
  395. package/test-env/components/skeleton/skeleton_circle.js +1 -2
  396. package/test-env/components/skeleton/skeleton_rectangle.js +1 -2
  397. package/test-env/components/skeleton/skeleton_text.js +18 -11
  398. package/test-env/components/skeleton/skeleton_title.js +1 -2
  399. package/test-env/components/spacer/spacer.js +1 -2
  400. package/test-env/components/text/text.js +1 -2
  401. package/test-env/components/text/text_align.js +1 -2
  402. package/test-env/components/text/text_align.styles.js +5 -7
  403. package/test-env/components/text/text_color.js +1 -2
  404. package/test-env/components/title/title.js +1 -2
  405. package/test-env/components/title/title.styles.js +2 -10
  406. package/test-env/components/toast/global_toast_list.js +68 -71
  407. package/test-env/components/toast/toast.js +25 -40
  408. package/test-env/components/toast/toast.styles.js +11 -25
  409. package/test-env/global_styling/mixins/_typography.js +25 -19
  410. package/test-env/services/color/eui_palettes.js +24 -14
  411. package/test-env/services/color/index.js +14 -0
  412. package/test-env/services/hooks/index.js +11 -0
  413. package/test-env/services/hooks/useDeepEqual.js +30 -0
  414. package/test-env/services/index.js +15 -1
  415. package/test-env/services/theme/index.js +6 -0
  416. package/test-env/services/theme/style_memoization.js +49 -16
  417. package/test-env/themes/amsterdam/global_styling/mixins/button.js +49 -26
  418. package/src/themes/charts/theme.scss +0 -5
@@ -300,12 +300,14 @@ EuiPageHeaderContent.propTypes = {
300
300
  */
301
301
  "aria-current": PropTypes.any,
302
302
  /**
303
- * Creates a breadcrumb that toggles a popover dialog
303
+ * Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
304
+ * or a render function that will pass callback allowing you to close the
305
+ * breadcrumb popover from within your popover content.
304
306
  *
305
307
  * If passed, both `href` and `onClick` will be ignored - the breadcrumb's
306
308
  * click behavior should only trigger a popover.
307
309
  */
308
- popoverContent: PropTypes.node,
310
+ popoverContent: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]),
309
311
  /**
310
312
  * Allows customizing the popover if necessary. Accepts any props that
311
313
  * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
@@ -10,7 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
10
10
  */
11
11
 
12
12
  import { css, keyframes } from '@emotion/react';
13
- import { logicalCSS, logicalTextAlignCSS, euiCantAnimate, euiFontSize, euiTextTruncate } from '../../global_styling';
13
+ import { logicalCSS, logicalTextAlignCSS, euiCanAnimate, euiCantAnimate, euiFontSize, euiTextTruncate } from '../../global_styling';
14
14
  import { euiPaletteColorBlind, makeHighContrastColor } from '../../services';
15
15
  import { euiText } from '../text/text.styles';
16
16
 
@@ -63,7 +63,7 @@ export var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
63
63
  // https://css-tricks.com/html5-progress-element/
64
64
  // Good resource if you need to work in here. There's some gotchas with
65
65
  // dealing with cross-browser progress bars.
66
- native: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", crossBrowserProgressValue('transition: width ${euiTheme.animation.normal} linear;'), ";;label:native;"),
66
+ native: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", euiCanAnimate, "{/* Note: FF/Mozilla doesn't actually support animating the native progress bar\n @see https://bugzilla.mozilla.org/show_bug.cgi?id=662351 */", crossBrowserProgressValue("transition: width ".concat(euiTheme.animation.normal, " linear")), ";};label:native;"),
67
67
  // An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
68
68
  // we apply this style to a <div> instead of a <progress> element.
69
69
  // See https://css-tricks.com/html5-progress-element/ for more info.
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
13
13
  import React from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiTheme } from '../../services';
16
+ import { useEuiMemoizedStyles } from '../../services';
17
17
  import { EuiSkeletonLoading } from './skeleton_loading';
18
18
  import { euiSkeletonCircleStyles } from './skeleton_circle.styles';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -31,8 +31,7 @@ export var EuiSkeletonCircle = function EuiSkeletonCircle(_ref) {
31
31
  ariaWrapperProps = _ref.ariaWrapperProps,
32
32
  children = _ref.children,
33
33
  rest = _objectWithoutProperties(_ref, _excluded);
34
- var euiTheme = useEuiTheme();
35
- var styles = euiSkeletonCircleStyles(euiTheme);
34
+ var styles = useEuiMemoizedStyles(euiSkeletonCircleStyles);
36
35
  var cssStyles = [styles.euiSkeletonCircle, styles[size]];
37
36
  return ___EmotionJSX(EuiSkeletonLoading, _extends({
38
37
  isLoading: isLoading,
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
19
19
  import React from 'react';
20
20
  import PropTypes from "prop-types";
21
21
  import classNames from 'classnames';
22
- import { useEuiTheme } from '../../services';
22
+ import { useEuiMemoizedStyles } from '../../services';
23
23
  import { logicalStyles } from '../../global_styling';
24
24
  import { EuiSkeletonLoading } from './skeleton_loading';
25
25
  import { euiSkeletonRectangleStyles } from './skeleton_rectangle.styles';
@@ -43,8 +43,7 @@ export var EuiSkeletonRectangle = function EuiSkeletonRectangle(_ref) {
43
43
  ariaWrapperProps = _ref.ariaWrapperProps,
44
44
  children = _ref.children,
45
45
  rest = _objectWithoutProperties(_ref, _excluded);
46
- var euiTheme = useEuiTheme();
47
- var styles = euiSkeletonRectangleStyles(euiTheme);
46
+ var styles = useEuiMemoizedStyles(euiSkeletonRectangleStyles);
48
47
  var cssStyles = [styles.euiSkeletonRectangle, styles[borderRadius]];
49
48
  return ___EmotionJSX(EuiSkeletonLoading, _extends({
50
49
  isLoading: isLoading,
@@ -10,10 +10,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
10
  * Side Public License, v 1.
11
11
  */
12
12
 
13
- import React from 'react';
13
+ import React, { useMemo } from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiTheme } from '../../services';
16
+ import { useEuiMemoizedStyles } from '../../services';
17
17
  import { EuiSkeletonLoading } from './skeleton_loading';
18
18
  import { euiSkeletonTextStyles } from './skeleton_text.styles';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -33,16 +33,20 @@ export var EuiSkeletonText = function EuiSkeletonText(_ref) {
33
33
  ariaWrapperProps = _ref.ariaWrapperProps,
34
34
  children = _ref.children,
35
35
  rest = _objectWithoutProperties(_ref, _excluded);
36
- var euiTheme = useEuiTheme();
37
- var styles = euiSkeletonTextStyles(euiTheme);
38
- var lineCssStyles = [styles.euiSkeletonText, styles[size]];
39
- var lineElements = [];
40
- for (var i = 0; i < lines; i++) {
41
- lineElements.push(___EmotionJSX("span", {
42
- key: i,
43
- css: lineCssStyles
44
- }));
45
- }
36
+ var styles = useEuiMemoizedStyles(euiSkeletonTextStyles);
37
+ var cssStyles = useMemo(function () {
38
+ return [styles.euiSkeletonText, styles[size]];
39
+ }, [styles, size]);
40
+ var lineElements = useMemo(function () {
41
+ var lineElements = [];
42
+ for (var i = 0; i < lines; i++) {
43
+ lineElements.push(___EmotionJSX("span", {
44
+ key: i,
45
+ css: cssStyles
46
+ }));
47
+ }
48
+ return lineElements;
49
+ }, [lines, cssStyles]);
46
50
  return ___EmotionJSX(EuiSkeletonLoading, _extends({
47
51
  isLoading: isLoading,
48
52
  loadingContent: ___EmotionJSX("span", _extends({
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
13
13
  import React from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiTheme } from '../../services';
16
+ import { useEuiMemoizedStyles } from '../../services';
17
17
  import { EuiSkeletonLoading } from './skeleton_loading';
18
18
  import { euiSkeletonTitleStyles } from './skeleton_title.styles';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -30,8 +30,7 @@ export var EuiSkeletonTitle = function EuiSkeletonTitle(_ref) {
30
30
  ariaWrapperProps = _ref.ariaWrapperProps,
31
31
  children = _ref.children,
32
32
  rest = _objectWithoutProperties(_ref, _excluded);
33
- var euiTheme = useEuiTheme();
34
- var styles = euiSkeletonTitleStyles(euiTheme);
33
+ var styles = useEuiMemoizedStyles(euiSkeletonTitleStyles);
35
34
  var cssStyles = [styles.euiSkeletonTitle, styles[size]];
36
35
  return ___EmotionJSX(EuiSkeletonLoading, _extends({
37
36
  isLoading: isLoading,
@@ -17,7 +17,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
17
17
  import React from 'react';
18
18
  import PropTypes from "prop-types";
19
19
  import classNames from 'classnames';
20
- import { useEuiTheme } from '../../services';
20
+ import { useEuiMemoizedStyles } from '../../services';
21
21
  import { euiSpacerStyles } from './spacer.styles';
22
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
23
23
  export var SIZES = ['xs', 's', 'm', 'l', 'xl', 'xxl'];
@@ -26,8 +26,7 @@ export var EuiSpacer = function EuiSpacer(_ref) {
26
26
  _ref$size = _ref.size,
27
27
  size = _ref$size === void 0 ? 'l' : _ref$size,
28
28
  rest = _objectWithoutProperties(_ref, _excluded);
29
- var euiTheme = useEuiTheme();
30
- var styles = euiSpacerStyles(euiTheme);
29
+ var styles = useEuiMemoizedStyles(euiSpacerStyles);
31
30
  var classes = classNames('euiSpacer', _defineProperty({}, "euiSpacer--".concat(size), size), className);
32
31
  var cssStyles = [styles.euiSpacer, styles[size]];
33
32
  return ___EmotionJSX("div", _extends({
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
13
13
  import React from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiTheme } from '../../services';
16
+ import { useEuiMemoizedStyles } from '../../services';
17
17
  import { euiTextStyles } from './text.styles';
18
18
  import { EuiTextColor } from './text_color';
19
19
  import { EuiTextAlign } from './text_align';
@@ -29,8 +29,7 @@ export var EuiText = function EuiText(_ref) {
29
29
  children = _ref.children,
30
30
  className = _ref.className,
31
31
  rest = _objectWithoutProperties(_ref, _excluded);
32
- var euiTheme = useEuiTheme();
33
- var styles = euiTextStyles(euiTheme);
32
+ var styles = useEuiMemoizedStyles(euiTextStyles);
34
33
  var cssStyles = [styles.euiText, !grow ? styles.constrainedWidth : undefined, styles[size]];
35
34
  var classes = classNames('euiText', className);
36
35
  var text = ___EmotionJSX("div", _extends({
@@ -18,7 +18,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
18
18
  import React, { isValidElement } from 'react';
19
19
  import PropTypes from "prop-types";
20
20
  import { cloneElementWithCss } from '../../services';
21
- import { euiTextAlignStyles } from './text_align.styles';
21
+ import { euiTextAlignStyles as styles } from './text_align.styles';
22
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
23
23
  export var ALIGNMENTS = ['left', 'right', 'center'];
24
24
  export var EuiTextAlign = function EuiTextAlign(_ref) {
@@ -28,7 +28,6 @@ export var EuiTextAlign = function EuiTextAlign(_ref) {
28
28
  _ref$cloneElement = _ref.cloneElement,
29
29
  cloneElement = _ref$cloneElement === void 0 ? false : _ref$cloneElement,
30
30
  rest = _objectWithoutProperties(_ref, _excluded);
31
- var styles = euiTextAlignStyles();
32
31
  var cssStyles = [styles.euiTextAlign, styles[textAlign]];
33
32
  var props = _objectSpread({
34
33
  css: cssStyles
@@ -8,11 +8,9 @@
8
8
 
9
9
  import { css } from '@emotion/react';
10
10
  import { logicalTextAlignCSS } from '../../global_styling';
11
- export var euiTextAlignStyles = function euiTextAlignStyles() {
12
- return {
13
- euiTextAlign: /*#__PURE__*/css(";label:euiTextAlign;"),
14
- left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;"),
15
- right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;"),
16
- center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;")
17
- };
11
+ export var euiTextAlignStyles = {
12
+ euiTextAlign: /*#__PURE__*/css(";label:euiTextAlign;"),
13
+ left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;"),
14
+ right: /*#__PURE__*/css(logicalTextAlignCSS('right'), ";;label:right;"),
15
+ center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;")
18
16
  };
@@ -17,7 +17,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
17
17
 
18
18
  import React, { isValidElement } from 'react';
19
19
  import PropTypes from "prop-types";
20
- import { useEuiTheme, cloneElementWithCss } from '../../services';
20
+ import { useEuiMemoizedStyles, cloneElementWithCss } from '../../services';
21
21
  import { euiTextColorStyles } from './text_color.styles';
22
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
23
23
  export var COLORS = ['default', 'subdued', 'success', 'accent', 'danger', 'warning', 'ghost', 'inherit'];
@@ -32,8 +32,7 @@ export var EuiTextColor = function EuiTextColor(_ref) {
32
32
  style = _ref.style,
33
33
  rest = _objectWithoutProperties(_ref, _excluded);
34
34
  var isNamedColor = COLORS.includes(color);
35
- var euiTheme = useEuiTheme();
36
- var styles = euiTextColorStyles(euiTheme);
35
+ var styles = useEuiMemoizedStyles(euiTextColorStyles);
37
36
  var cssStyles = [styles.euiTextColor, isNamedColor ? styles[color] : styles.customColor];
38
37
 
39
38
  // We're checking if is a custom color.
@@ -17,7 +17,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
17
17
 
18
18
  import classNames from 'classnames';
19
19
  import PropTypes from "prop-types";
20
- import { useEuiTheme, cloneElementWithCss } from '../../services';
20
+ import { useEuiMemoizedStyles, cloneElementWithCss } from '../../services';
21
21
  import { euiTitleStyles } from './title.styles';
22
22
  export var TITLE_SIZES = ['xxxs', 'xxs', 'xs', 's', 'm', 'l'];
23
23
  export var TEXT_TRANSFORM = ['uppercase'];
@@ -28,8 +28,7 @@ export var EuiTitle = function EuiTitle(_ref) {
28
28
  className = _ref.className,
29
29
  textTransform = _ref.textTransform,
30
30
  rest = _objectWithoutProperties(_ref, _excluded);
31
- var euiTheme = useEuiTheme();
32
- var styles = euiTitleStyles(euiTheme);
31
+ var styles = useEuiMemoizedStyles(euiTitleStyles);
33
32
  var cssStyles = [styles.euiTitle, textTransform ? styles[textTransform] : undefined, styles[size]];
34
33
  var classes = classNames('euiTitle', className, children.props.className);
35
34
  var props = _objectSpread({
@@ -14,7 +14,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
14
14
  */
15
15
 
16
16
  import { css } from '@emotion/react';
17
- import { useEuiTheme } from '../../services';
18
17
  import { euiTextBreakWord, euiFontSize, logicalCSS } from '../../global_styling';
19
18
 
20
19
  /**
@@ -39,12 +38,6 @@ export var euiTitle = function euiTitle(euiThemeContext) {
39
38
  });
40
39
  };
41
40
 
42
- // Hook version
43
- export var useEuiTitle = function useEuiTitle(scale, options) {
44
- var euiTheme = useEuiTheme();
45
- return euiTitle(euiTheme, scale, options);
46
- };
47
-
48
41
  /**
49
42
  * Styles
50
43
  */
@@ -23,11 +23,11 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
23
23
  * Side Public License, v 1.
24
24
  */
25
25
 
26
- import React, { useCallback, useEffect, useRef, useState } from 'react';
26
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
27
27
  import PropTypes from "prop-types";
28
28
  import classNames from 'classnames';
29
29
  import { keysOf } from '../common';
30
- import { useEuiTheme } from '../../services';
30
+ import { useEuiMemoizedStyles } from '../../services';
31
31
  import { Timer } from '../../services/time';
32
32
  import { EuiGlobalToastListItem } from './global_toast_list_item';
33
33
  import { EuiToast } from './toast';
@@ -74,10 +74,9 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
74
74
  var isScrollingAnimationFrame = useRef(0);
75
75
  var startScrollingAnimationFrame = useRef(0);
76
76
  var listElement = useRef(null);
77
- var euiTheme = useEuiTheme();
78
- var styles = euiGlobalToastListStyles(euiTheme);
77
+ var styles = useEuiMemoizedStyles(euiGlobalToastListStyles);
79
78
  var cssStyles = [styles.euiGlobalToastList, styles[side]];
80
- var startScrollingToBottom = function startScrollingToBottom() {
79
+ var startScrollingToBottom = useCallback(function () {
81
80
  isScrollingToBottom.current = true;
82
81
  var scrollToBottom = function scrollToBottom() {
83
82
  // Although we cancel the requestAnimationFrame in componentWillUnmount,
@@ -100,8 +99,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
100
99
  }
101
100
  };
102
101
  startScrollingAnimationFrame.current = window.requestAnimationFrame(scrollToBottom);
103
- };
104
- var onMouseEnter = function onMouseEnter() {
102
+ }, []);
103
+ var onMouseEnter = useCallback(function () {
105
104
  // Stop scrolling to bottom if we're in mid-scroll, because the user wants to interact with
106
105
  // the list.
107
106
  isScrollingToBottom.current = false;
@@ -114,8 +113,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
114
113
  timer.pause();
115
114
  }
116
115
  }
117
- };
118
- var onMouseLeave = function onMouseLeave() {
116
+ }, []);
117
+ var onMouseLeave = useCallback(function () {
119
118
  isUserInteracting.current = false;
120
119
  for (var _toastId2 in toastIdToTimerMap.current) {
121
120
  if (toastIdToTimerMap.current.hasOwnProperty(_toastId2)) {
@@ -123,8 +122,8 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
123
122
  timer.resume();
124
123
  }
125
124
  }
126
- };
127
- var onScroll = function onScroll() {
125
+ }, []);
126
+ var onScroll = useCallback(function () {
128
127
  // Given that this method also gets invoked by the synthetic scroll that happens when a new toast gets added,
129
128
  // we want to evaluate if the scroll bottom has been reached only when the user is interacting with the toast,
130
129
  // this way we always retain the scroll position the user has set despite adding in new toasts.
@@ -132,7 +131,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
132
131
  if (listElement.current && isUserInteracting.current) {
133
132
  isScrolledToBottom.current = listElement.current.scrollHeight - listElement.current.scrollTop === listElement.current.clientHeight;
134
133
  }
135
- };
134
+ }, []);
136
135
  var dismissToast = useCallback(function (toast) {
137
136
  // Remove the toast after it's done fading out.
138
137
  dismissTimeoutIds.current.push(window.setTimeout(function () {
@@ -155,34 +154,29 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
155
154
  }
156
155
  });
157
156
  }, [scheduleToastForDismissal, toasts]);
158
- var addListeners = function addListeners() {
159
- if (listElement.current) {
160
- listElement.current.addEventListener('scroll', onScroll);
161
- listElement.current.addEventListener('mouseenter', onMouseEnter);
162
- listElement.current.addEventListener('mouseleave', onMouseLeave);
163
- }
164
- };
165
- var removeListeners = function removeListeners() {
166
- if (listElement.current) {
167
- listElement.current.removeEventListener('scroll', onScroll);
168
- listElement.current.removeEventListener('mouseenter', onMouseEnter);
169
- listElement.current.removeEventListener('mouseleave', onMouseLeave);
170
- }
171
- };
172
157
 
173
158
  // componentDidMount
174
159
  useEffect(function () {
175
- addListeners();
160
+ var listenerEl = listElement.current;
161
+ if (listenerEl) {
162
+ listenerEl.addEventListener('scroll', onScroll);
163
+ listenerEl.addEventListener('mouseenter', onMouseEnter);
164
+ listenerEl.addEventListener('mouseleave', onMouseLeave);
165
+ }
176
166
 
177
167
  // componentWillUnmount
178
168
  return function () {
169
+ if (listenerEl) {
170
+ listenerEl.removeEventListener('scroll', onScroll);
171
+ listenerEl.removeEventListener('mouseenter', onMouseEnter);
172
+ listenerEl.removeEventListener('mouseleave', onMouseLeave);
173
+ }
179
174
  if (isScrollingAnimationFrame.current !== 0) {
180
175
  window.cancelAnimationFrame(isScrollingAnimationFrame.current);
181
176
  }
182
177
  if (startScrollingAnimationFrame.current !== 0) {
183
178
  window.cancelAnimationFrame(startScrollingAnimationFrame.current);
184
179
  }
185
- removeListeners();
186
180
  dismissTimeoutIds.current.forEach(clearTimeout); // eslint-disable-line react-hooks/exhaustive-deps
187
181
  for (var _toastId3 in toastIdToTimerMap.current) {
188
182
  if (toastIdToTimerMap.current.hasOwnProperty(_toastId3)) {
@@ -191,7 +185,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
191
185
  }
192
186
  }
193
187
  };
194
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
188
+ }, [onMouseEnter, onMouseLeave, onScroll]);
195
189
 
196
190
  // componentDidUpdate
197
191
  useEffect(function () {
@@ -206,7 +200,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
206
200
  }
207
201
  }
208
202
  prevToasts.current = toasts;
209
- }, [toasts, scheduleAllToastsForDismissal]);
203
+ }, [toasts, scheduleAllToastsForDismissal, startScrollingToBottom]);
210
204
 
211
205
  // Toast dismissal side effect
212
206
  // Ensure the callback has correct state by not enclosing it in `setTimeout`
@@ -227,49 +221,52 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
227
221
  });
228
222
  }
229
223
  }, [toastToDismiss, dismissToastProp]);
230
- var renderedToasts = toasts.map(function (toast) {
231
- var text = toast.text,
232
- toastLifeTimeMs = toast.toastLifeTimeMs,
233
- rest = _objectWithoutProperties(toast, _excluded2);
234
- var onClose = function onClose() {
235
- return dismissToast(toast);
236
- };
237
- return ___EmotionJSX(EuiGlobalToastListItem, {
238
- key: toast.id,
239
- isDismissed: toastIdToDismissedMap[toast.id]
240
- }, ___EmotionJSX(EuiToast, _extends({
241
- onClose: onClose,
242
- onFocus: onMouseEnter,
243
- onBlur: onMouseLeave
244
- }, rest), text));
245
- });
246
- if (showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
247
- var dismissAllToasts = function dismissAllToasts() {
248
- toasts.forEach(function (toast) {
249
- return dismissToastProp(toast);
250
- });
251
- onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
252
- };
253
- renderedToasts.push(___EmotionJSX(EuiI18n, {
254
- key: "euiClearAllToasts",
255
- tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
256
- defaults: ['Clear all toast notifications', 'Clear all']
257
- }, function (_ref2) {
258
- var _ref3 = _slicedToArray(_ref2, 2),
259
- clearAllToastsButtonAriaLabel = _ref3[0],
260
- clearAllToastsButtonDisplayText = _ref3[1];
224
+ var renderedToasts = useMemo(function () {
225
+ return toasts.map(function (toast) {
226
+ var text = toast.text,
227
+ toastLifeTimeMs = toast.toastLifeTimeMs,
228
+ rest = _objectWithoutProperties(toast, _excluded2);
229
+ var onClose = function onClose() {
230
+ return dismissToast(toast);
231
+ };
261
232
  return ___EmotionJSX(EuiGlobalToastListItem, {
262
- isDismissed: false
263
- }, ___EmotionJSX(EuiButton, {
264
- fill: true,
265
- color: "text",
266
- onClick: dismissAllToasts,
267
- css: [styles.euiGlobalToastListDismissButton, ";label:EuiGlobalToastList;"],
268
- "aria-label": clearAllToastsButtonAriaLabel,
269
- "data-test-subj": "euiClearAllToastsButton"
270
- }, clearAllToastsButtonDisplayText));
271
- }));
272
- }
233
+ key: toast.id,
234
+ isDismissed: toastIdToDismissedMap[toast.id]
235
+ }, ___EmotionJSX(EuiToast, _extends({
236
+ onClose: onClose,
237
+ onFocus: onMouseEnter,
238
+ onBlur: onMouseLeave
239
+ }, rest), text));
240
+ });
241
+ }, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave]);
242
+ var clearAllButton = useMemo(function () {
243
+ if (toasts.length && showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
244
+ return ___EmotionJSX(EuiI18n, {
245
+ key: "euiClearAllToasts",
246
+ tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
247
+ defaults: ['Clear all toast notifications', 'Clear all']
248
+ }, function (_ref2) {
249
+ var _ref3 = _slicedToArray(_ref2, 2),
250
+ clearAllToastsButtonAriaLabel = _ref3[0],
251
+ clearAllToastsButtonDisplayText = _ref3[1];
252
+ return ___EmotionJSX(EuiGlobalToastListItem, {
253
+ isDismissed: false
254
+ }, ___EmotionJSX(EuiButton, {
255
+ fill: true,
256
+ color: "text",
257
+ onClick: function onClick() {
258
+ toasts.forEach(function (toast) {
259
+ return dismissToastProp(toast);
260
+ });
261
+ onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
262
+ },
263
+ css: styles.euiGlobalToastListDismissButton,
264
+ "aria-label": clearAllToastsButtonAriaLabel,
265
+ "data-test-subj": "euiClearAllToastsButton"
266
+ }, clearAllToastsButtonDisplayText));
267
+ });
268
+ }
269
+ }, [showClearAllButtonAt, onClearAllToasts, toasts, dismissToastProp, styles]);
273
270
  var classes = classNames('euiGlobalToastList', className);
274
271
  return ___EmotionJSX("div", _extends({
275
272
  "aria-live": "polite",
@@ -277,7 +274,7 @@ export var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
277
274
  ref: listElement,
278
275
  css: cssStyles,
279
276
  className: classes
280
- }, rest), renderedToasts);
277
+ }, rest), renderedToasts, clearAllButton);
281
278
  };
282
279
  EuiGlobalToastList.propTypes = {
283
280
  toasts: PropTypes.arrayOf(PropTypes.shape({
@@ -13,13 +13,13 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
13
13
  import React from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiTheme } from '../../services';
16
+ import { useEuiMemoizedStyles } from '../../services';
17
17
  import { EuiScreenReaderOnly } from '../accessibility';
18
18
  import { EuiButtonIcon } from '../button';
19
19
  import { EuiI18n } from '../i18n';
20
20
  import { EuiIcon } from '../icon';
21
21
  import { EuiText } from '../text';
22
- import { euiToastStyles, euiToastBodyStyles, euiToastHeaderStyles } from './toast.styles';
22
+ import { euiToastStyles, euiToastHeaderStyles } from './toast.styles';
23
23
  import { jsx as ___EmotionJSX } from "@emotion/react";
24
24
  export var COLORS = ['primary', 'success', 'warning', 'danger'];
25
25
  export var EuiToast = function EuiToast(_ref) {
@@ -30,47 +30,11 @@ export var EuiToast = function EuiToast(_ref) {
30
30
  children = _ref.children,
31
31
  className = _ref.className,
32
32
  rest = _objectWithoutProperties(_ref, _excluded);
33
- var euiTheme = useEuiTheme();
34
- var baseStyles = euiToastStyles(euiTheme);
33
+ var baseStyles = useEuiMemoizedStyles(euiToastStyles);
35
34
  var baseCss = [baseStyles.euiToast, color && baseStyles[color]];
36
- var bodyStyles = euiToastBodyStyles();
37
- var headerStyles = euiToastHeaderStyles(euiTheme);
35
+ var headerStyles = useEuiMemoizedStyles(euiToastHeaderStyles);
38
36
  var headerCss = [headerStyles.euiToastHeader, children && headerStyles.withBody];
39
37
  var classes = classNames('euiToast', className);
40
- var headerIcon;
41
- if (iconType) {
42
- headerIcon = ___EmotionJSX(EuiIcon, {
43
- css: headerStyles.euiToastHeader__icon,
44
- type: iconType,
45
- size: "m",
46
- "aria-hidden": "true"
47
- });
48
- }
49
- var closeButton;
50
- if (onClose) {
51
- closeButton = ___EmotionJSX(EuiI18n, {
52
- token: "euiToast.dismissToast",
53
- default: "Dismiss toast"
54
- }, function (dismissToast) {
55
- return ___EmotionJSX(EuiButtonIcon, {
56
- css: baseStyles.euiToast__closeButton,
57
- iconType: "cross",
58
- color: "text",
59
- size: "xs",
60
- "aria-label": dismissToast,
61
- onClick: onClose,
62
- "data-test-subj": "toastCloseButton"
63
- });
64
- });
65
- }
66
- var optionalBody;
67
- if (children) {
68
- optionalBody = ___EmotionJSX(EuiText, {
69
- css: bodyStyles.euiToastBody,
70
- size: "s",
71
- "data-test-subj": "euiToastBody"
72
- }, children);
73
- }
74
38
  return ___EmotionJSX("div", _extends({
75
39
  css: baseCss,
76
40
  className: classes
@@ -85,11 +49,32 @@ export var EuiToast = function EuiToast(_ref) {
85
49
  css: headerCss,
86
50
  "aria-label": notification,
87
51
  "data-test-subj": "euiToastHeader"
88
- }, headerIcon, ___EmotionJSX("span", {
52
+ }, iconType && ___EmotionJSX(EuiIcon, {
53
+ css: headerStyles.euiToastHeader__icon,
54
+ type: iconType,
55
+ size: "m",
56
+ "aria-hidden": "true"
57
+ }), ___EmotionJSX("span", {
89
58
  css: headerStyles.euiToastHeader__title,
90
59
  "data-test-subj": "euiToastHeader__title"
91
60
  }, title));
92
- }), closeButton, optionalBody);
61
+ }), onClose && ___EmotionJSX(EuiI18n, {
62
+ token: "euiToast.dismissToast",
63
+ default: "Dismiss toast"
64
+ }, function (dismissToast) {
65
+ return ___EmotionJSX(EuiButtonIcon, {
66
+ css: baseStyles.euiToast__closeButton,
67
+ iconType: "cross",
68
+ color: "text",
69
+ size: "xs",
70
+ "aria-label": dismissToast,
71
+ onClick: onClose,
72
+ "data-test-subj": "toastCloseButton"
73
+ });
74
+ }), children && ___EmotionJSX(EuiText, {
75
+ size: "s",
76
+ "data-test-subj": "euiToastBody"
77
+ }, children));
93
78
  };
94
79
  EuiToast.propTypes = {
95
80
  title: PropTypes.node,