@elastic/eui 93.3.0 → 93.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 (361) 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 -327
  11. package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
  12. package/es/components/breadcrumbs/breadcrumbs.js +4 -4
  13. package/es/components/breadcrumbs/types.js +1 -0
  14. package/es/components/button/button_group/button_group.js +16 -2
  15. package/es/components/button/button_group/button_group.styles.js +1 -1
  16. package/es/components/button/button_group/button_group_button.js +59 -5
  17. package/es/components/button/button_group/button_group_button.styles.js +39 -3
  18. package/es/components/datagrid/body/cell/data_grid_cell.js +97 -58
  19. package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  20. package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
  21. package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  22. package/es/components/datagrid/body/cell/index.js +1 -1
  23. package/es/components/datagrid/body/data_grid_body.js +13 -0
  24. package/es/components/datagrid/body/data_grid_body_custom.js +52 -36
  25. package/es/components/datagrid/body/data_grid_body_virtualized.js +84 -56
  26. package/es/components/datagrid/body/data_grid_row_manager.js +6 -4
  27. package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  28. package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
  29. package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
  30. package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
  31. package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
  32. package/es/components/datagrid/controls/column_selector.js +126 -123
  33. package/es/components/datagrid/controls/column_sorting.js +605 -103
  34. package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
  35. package/es/components/datagrid/controls/display_selector.js +109 -107
  36. package/es/components/datagrid/data_grid.a11y.js +13 -12
  37. package/es/components/datagrid/data_grid.js +45 -22
  38. package/es/components/datagrid/utils/col_widths.js +12 -8
  39. package/es/components/datagrid/utils/focus.js +10 -8
  40. package/es/components/datagrid/utils/grid_height_width.js +31 -30
  41. package/es/components/datagrid/utils/ref.js +1 -1
  42. package/es/components/datagrid/utils/row_heights.js +2 -2
  43. package/es/components/datagrid/utils/sorting.js +29 -27
  44. package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  45. package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
  46. package/es/components/flex/flex_grid.js +22 -8
  47. package/es/components/flex/flex_grid.styles.js +13 -6
  48. package/es/components/flex/flex_group.js +10 -11
  49. package/es/components/flex/flex_item.js +9 -11
  50. package/es/components/flex/flex_item.styles.js +107 -122
  51. package/es/components/flyout/flyout.js +16 -18
  52. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  53. package/es/components/header/header_links/header_links.js +10 -2
  54. package/es/components/icon/icon.js +3 -3
  55. package/es/components/modal/confirm_modal.js +2 -1
  56. package/es/components/modal/modal.js +12 -3
  57. package/es/components/observer/resize_observer/resize_observer.js +15 -24
  58. package/es/components/panel/panel.js +2 -3
  59. package/es/components/resizable_container/resizable_button.js +2 -3
  60. package/es/components/resizable_container/resizable_collapse_button.js +2 -3
  61. package/es/components/resizable_container/resizable_container.js +1 -2
  62. package/es/components/resizable_container/resizable_container.styles.js +11 -14
  63. package/es/components/resizable_container/resizable_panel.js +6 -8
  64. package/es/components/resizable_container/resizable_panel.styles.js +18 -29
  65. package/es/components/selectable/selectable_list/selectable_list.js +26 -6
  66. package/es/components/spacer/spacer.js +2 -3
  67. package/es/components/toast/global_toast_list.js +70 -73
  68. package/es/components/toast/toast.js +27 -42
  69. package/es/components/toast/toast.styles.js +2 -17
  70. package/es/components/tool_tip/icon_tip.js +4 -3
  71. package/es/global_styling/mixins/_color.js +60 -32
  72. package/es/global_styling/mixins/_padding.js +60 -16
  73. package/es/services/color/eui_palettes.js +21 -13
  74. package/es/services/color/index.js +1 -1
  75. package/es/services/hooks/index.js +1 -0
  76. package/es/services/hooks/useDeepEqual.js +23 -0
  77. package/es/services/index.js +1 -1
  78. package/es/services/theme/style_memoization.js +1 -3
  79. package/eui.d.ts +2558 -2470
  80. package/i18ntokens.json +297 -279
  81. package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
  82. package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  83. package/lib/components/breadcrumbs/breadcrumb.js +11 -331
  84. package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
  85. package/lib/components/breadcrumbs/breadcrumbs.js +3 -3
  86. package/lib/components/breadcrumbs/types.js +5 -0
  87. package/lib/components/button/button_group/button_group.js +16 -2
  88. package/lib/components/button/button_group/button_group.styles.js +1 -1
  89. package/lib/components/button/button_group/button_group_button.js +59 -5
  90. package/lib/components/button/button_group/button_group_button.styles.js +45 -11
  91. package/lib/components/datagrid/body/cell/data_grid_cell.js +95 -57
  92. package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  93. package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  94. package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  95. package/lib/components/datagrid/body/cell/index.js +2 -2
  96. package/lib/components/datagrid/body/data_grid_body.js +13 -0
  97. package/lib/components/datagrid/body/data_grid_body_custom.js +51 -35
  98. package/lib/components/datagrid/body/data_grid_body_virtualized.js +83 -55
  99. package/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
  100. package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  101. package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  102. package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
  103. package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
  104. package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
  105. package/lib/components/datagrid/controls/column_selector.js +126 -123
  106. package/lib/components/datagrid/controls/column_sorting.js +615 -110
  107. package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
  108. package/lib/components/datagrid/controls/display_selector.js +109 -107
  109. package/lib/components/datagrid/data_grid.a11y.js +13 -12
  110. package/lib/components/datagrid/data_grid.js +43 -20
  111. package/lib/components/datagrid/utils/col_widths.js +12 -8
  112. package/lib/components/datagrid/utils/focus.js +10 -8
  113. package/lib/components/datagrid/utils/grid_height_width.js +29 -28
  114. package/lib/components/datagrid/utils/ref.js +1 -1
  115. package/lib/components/datagrid/utils/row_heights.js +1 -1
  116. package/lib/components/datagrid/utils/sorting.js +31 -29
  117. package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  118. package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
  119. package/lib/components/flex/flex_grid.js +23 -7
  120. package/lib/components/flex/flex_grid.styles.js +13 -6
  121. package/lib/components/flex/flex_group.js +10 -10
  122. package/lib/components/flex/flex_item.js +13 -13
  123. package/lib/components/flex/flex_item.styles.js +107 -122
  124. package/lib/components/flyout/flyout.js +16 -18
  125. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  126. package/lib/components/header/header_links/header_links.js +10 -2
  127. package/lib/components/icon/icon.js +3 -3
  128. package/lib/components/modal/confirm_modal.js +2 -1
  129. package/lib/components/modal/modal.js +12 -3
  130. package/lib/components/observer/resize_observer/resize_observer.js +15 -24
  131. package/lib/components/panel/panel.js +1 -2
  132. package/lib/components/resizable_container/resizable_button.js +1 -2
  133. package/lib/components/resizable_container/resizable_collapse_button.js +1 -2
  134. package/lib/components/resizable_container/resizable_container.js +1 -2
  135. package/lib/components/resizable_container/resizable_container.styles.js +11 -14
  136. package/lib/components/resizable_container/resizable_panel.js +3 -5
  137. package/lib/components/resizable_container/resizable_panel.styles.js +17 -28
  138. package/lib/components/selectable/selectable_list/selectable_list.js +26 -6
  139. package/lib/components/spacer/spacer.js +1 -2
  140. package/lib/components/toast/global_toast_list.js +68 -71
  141. package/lib/components/toast/toast.js +25 -40
  142. package/lib/components/toast/toast.styles.js +11 -25
  143. package/lib/components/tool_tip/icon_tip.js +4 -3
  144. package/lib/global_styling/mixins/_color.js +65 -40
  145. package/lib/global_styling/mixins/_padding.js +66 -25
  146. package/lib/services/color/eui_palettes.js +24 -14
  147. package/lib/services/color/index.js +14 -0
  148. package/lib/services/hooks/index.js +11 -0
  149. package/lib/services/hooks/useDeepEqual.js +30 -0
  150. package/lib/services/index.js +15 -1
  151. package/lib/services/theme/style_memoization.js +1 -3
  152. package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
  153. package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
  154. package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -110
  155. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
  156. package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
  157. package/optimize/es/components/breadcrumbs/types.js +1 -0
  158. package/optimize/es/components/button/button_group/button_group.js +2 -2
  159. package/optimize/es/components/button/button_group/button_group.styles.js +1 -1
  160. package/optimize/es/components/button/button_group/button_group_button.js +36 -4
  161. package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
  162. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +80 -55
  163. package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  164. package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
  165. package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  166. package/optimize/es/components/datagrid/body/cell/index.js +1 -1
  167. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +39 -36
  168. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +69 -49
  169. package/optimize/es/components/datagrid/body/data_grid_row_manager.js +6 -4
  170. package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  171. package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
  172. package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
  173. package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
  174. package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
  175. package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
  176. package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
  177. package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
  178. package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
  179. package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
  180. package/optimize/es/components/datagrid/data_grid.js +45 -22
  181. package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
  182. package/optimize/es/components/datagrid/utils/focus.js +10 -8
  183. package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
  184. package/optimize/es/components/datagrid/utils/ref.js +1 -1
  185. package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
  186. package/optimize/es/components/datagrid/utils/sorting.js +29 -27
  187. package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
  188. package/optimize/es/components/flex/flex_grid.js +19 -8
  189. package/optimize/es/components/flex/flex_grid.styles.js +13 -6
  190. package/optimize/es/components/flex/flex_group.js +9 -10
  191. package/optimize/es/components/flex/flex_item.js +9 -11
  192. package/optimize/es/components/flex/flex_item.styles.js +107 -122
  193. package/optimize/es/components/flyout/flyout.js +16 -18
  194. package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  195. package/optimize/es/components/header/header_links/header_links.js +3 -2
  196. package/optimize/es/components/icon/icon.js +3 -3
  197. package/optimize/es/components/modal/confirm_modal.js +2 -1
  198. package/optimize/es/components/modal/modal.js +6 -2
  199. package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
  200. package/optimize/es/components/panel/panel.js +2 -3
  201. package/optimize/es/components/resizable_container/resizable_button.js +2 -3
  202. package/optimize/es/components/resizable_container/resizable_collapse_button.js +2 -3
  203. package/optimize/es/components/resizable_container/resizable_container.js +1 -2
  204. package/optimize/es/components/resizable_container/resizable_container.styles.js +11 -14
  205. package/optimize/es/components/resizable_container/resizable_panel.js +6 -8
  206. package/optimize/es/components/resizable_container/resizable_panel.styles.js +18 -26
  207. package/optimize/es/components/selectable/selectable_list/selectable_list.js +26 -6
  208. package/optimize/es/components/spacer/spacer.js +2 -3
  209. package/optimize/es/components/toast/global_toast_list.js +70 -73
  210. package/optimize/es/components/toast/toast.js +27 -42
  211. package/optimize/es/components/toast/toast.styles.js +2 -17
  212. package/optimize/es/components/tool_tip/icon_tip.js +4 -3
  213. package/optimize/es/global_styling/mixins/_color.js +57 -32
  214. package/optimize/es/global_styling/mixins/_padding.js +52 -16
  215. package/optimize/es/services/color/eui_palettes.js +21 -13
  216. package/optimize/es/services/color/index.js +1 -1
  217. package/optimize/es/services/hooks/index.js +1 -0
  218. package/optimize/es/services/hooks/useDeepEqual.js +23 -0
  219. package/optimize/es/services/index.js +1 -1
  220. package/optimize/es/services/theme/style_memoization.js +1 -3
  221. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
  222. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  223. package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -113
  224. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
  225. package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
  226. package/optimize/lib/components/breadcrumbs/types.js +5 -0
  227. package/optimize/lib/components/button/button_group/button_group.js +2 -2
  228. package/optimize/lib/components/button/button_group/button_group.styles.js +1 -1
  229. package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
  230. package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
  231. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +78 -54
  232. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  233. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  234. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  235. package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
  236. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +38 -35
  237. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +70 -50
  238. package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
  239. package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  240. package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  241. package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
  242. package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
  243. package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
  244. package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
  245. package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
  246. package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
  247. package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
  248. package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
  249. package/optimize/lib/components/datagrid/data_grid.js +43 -20
  250. package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
  251. package/optimize/lib/components/datagrid/utils/focus.js +10 -8
  252. package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
  253. package/optimize/lib/components/datagrid/utils/ref.js +1 -1
  254. package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
  255. package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
  256. package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
  257. package/optimize/lib/components/flex/flex_grid.js +21 -7
  258. package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
  259. package/optimize/lib/components/flex/flex_group.js +9 -9
  260. package/optimize/lib/components/flex/flex_item.js +13 -13
  261. package/optimize/lib/components/flex/flex_item.styles.js +107 -122
  262. package/optimize/lib/components/flyout/flyout.js +16 -18
  263. package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  264. package/optimize/lib/components/header/header_links/header_links.js +3 -2
  265. package/optimize/lib/components/icon/icon.js +3 -3
  266. package/optimize/lib/components/modal/confirm_modal.js +2 -1
  267. package/optimize/lib/components/modal/modal.js +6 -2
  268. package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
  269. package/optimize/lib/components/panel/panel.js +1 -2
  270. package/optimize/lib/components/resizable_container/resizable_button.js +1 -2
  271. package/optimize/lib/components/resizable_container/resizable_collapse_button.js +1 -2
  272. package/optimize/lib/components/resizable_container/resizable_container.js +1 -2
  273. package/optimize/lib/components/resizable_container/resizable_container.styles.js +11 -14
  274. package/optimize/lib/components/resizable_container/resizable_panel.js +3 -5
  275. package/optimize/lib/components/resizable_container/resizable_panel.styles.js +17 -26
  276. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +26 -6
  277. package/optimize/lib/components/spacer/spacer.js +1 -2
  278. package/optimize/lib/components/toast/global_toast_list.js +68 -71
  279. package/optimize/lib/components/toast/toast.js +25 -40
  280. package/optimize/lib/components/toast/toast.styles.js +11 -25
  281. package/optimize/lib/components/tool_tip/icon_tip.js +4 -3
  282. package/optimize/lib/global_styling/mixins/_color.js +63 -40
  283. package/optimize/lib/global_styling/mixins/_padding.js +59 -25
  284. package/optimize/lib/services/color/eui_palettes.js +24 -14
  285. package/optimize/lib/services/color/index.js +14 -0
  286. package/optimize/lib/services/hooks/index.js +11 -0
  287. package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
  288. package/optimize/lib/services/index.js +15 -1
  289. package/optimize/lib/services/theme/style_memoization.js +1 -3
  290. package/package.json +8 -11
  291. package/src/components/form/text_area/_text_area.scss +5 -0
  292. package/src/components/selectable/selectable_list/_selectable_list.scss +2 -0
  293. package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
  294. package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
  295. package/test-env/components/breadcrumbs/breadcrumb.js +11 -326
  296. package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
  297. package/test-env/components/breadcrumbs/breadcrumbs.js +3 -3
  298. package/test-env/components/breadcrumbs/types.js +5 -0
  299. package/test-env/components/button/button_group/button_group.js +16 -2
  300. package/test-env/components/button/button_group/button_group.styles.js +1 -1
  301. package/test-env/components/button/button_group/button_group_button.js +56 -5
  302. package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
  303. package/test-env/components/datagrid/body/cell/data_grid_cell.js +95 -57
  304. package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
  305. package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
  306. package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
  307. package/test-env/components/datagrid/body/cell/index.js +2 -2
  308. package/test-env/components/datagrid/body/data_grid_body.js +13 -0
  309. package/test-env/components/datagrid/body/data_grid_body_custom.js +51 -35
  310. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +83 -55
  311. package/test-env/components/datagrid/body/data_grid_row_manager.js +5 -3
  312. package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
  313. package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
  314. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
  315. package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
  316. package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
  317. package/test-env/components/datagrid/controls/column_selector.js +126 -123
  318. package/test-env/components/datagrid/controls/column_sorting.js +607 -106
  319. package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
  320. package/test-env/components/datagrid/controls/display_selector.js +109 -107
  321. package/test-env/components/datagrid/data_grid.a11y.js +13 -12
  322. package/test-env/components/datagrid/data_grid.js +43 -20
  323. package/test-env/components/datagrid/utils/col_widths.js +9 -5
  324. package/test-env/components/datagrid/utils/focus.js +10 -8
  325. package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
  326. package/test-env/components/datagrid/utils/ref.js +1 -1
  327. package/test-env/components/datagrid/utils/row_heights.js +1 -1
  328. package/test-env/components/datagrid/utils/sorting.js +31 -29
  329. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
  330. package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
  331. package/test-env/components/flex/flex_grid.js +21 -7
  332. package/test-env/components/flex/flex_grid.styles.js +13 -6
  333. package/test-env/components/flex/flex_group.js +10 -10
  334. package/test-env/components/flex/flex_item.js +13 -13
  335. package/test-env/components/flex/flex_item.styles.js +107 -122
  336. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
  337. package/test-env/components/header/header_links/header_links.js +10 -2
  338. package/test-env/components/modal/confirm_modal.js +2 -1
  339. package/test-env/components/modal/modal.js +12 -3
  340. package/test-env/components/panel/panel.js +1 -2
  341. package/test-env/components/resizable_container/resizable_button.js +1 -2
  342. package/test-env/components/resizable_container/resizable_collapse_button.js +1 -2
  343. package/test-env/components/resizable_container/resizable_container.js +1 -2
  344. package/test-env/components/resizable_container/resizable_container.styles.js +11 -14
  345. package/test-env/components/resizable_container/resizable_panel.js +3 -5
  346. package/test-env/components/resizable_container/resizable_panel.styles.js +17 -26
  347. package/test-env/components/selectable/selectable_list/selectable_list.js +26 -6
  348. package/test-env/components/spacer/spacer.js +1 -2
  349. package/test-env/components/toast/global_toast_list.js +68 -71
  350. package/test-env/components/toast/toast.js +25 -40
  351. package/test-env/components/toast/toast.styles.js +11 -25
  352. package/test-env/components/tool_tip/icon_tip.js +4 -3
  353. package/test-env/global_styling/mixins/_color.js +63 -40
  354. package/test-env/global_styling/mixins/_padding.js +59 -25
  355. package/test-env/services/color/eui_palettes.js +24 -14
  356. package/test-env/services/color/index.js +14 -0
  357. package/test-env/services/hooks/index.js +11 -0
  358. package/test-env/services/hooks/useDeepEqual.js +30 -0
  359. package/test-env/services/index.js +15 -1
  360. package/test-env/services/theme/style_memoization.js +1 -3
  361. package/src/themes/charts/theme.scss +0 -5
@@ -77,10 +77,9 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
77
77
  var isScrollingAnimationFrame = (0, _react.useRef)(0);
78
78
  var startScrollingAnimationFrame = (0, _react.useRef)(0);
79
79
  var listElement = (0, _react.useRef)(null);
80
- var euiTheme = (0, _services.useEuiTheme)();
81
- var styles = (0, _global_toast_list.euiGlobalToastListStyles)(euiTheme);
80
+ var styles = (0, _services.useEuiMemoizedStyles)(_global_toast_list.euiGlobalToastListStyles);
82
81
  var cssStyles = [styles.euiGlobalToastList, styles[side]];
83
- var startScrollingToBottom = function startScrollingToBottom() {
82
+ var startScrollingToBottom = (0, _react.useCallback)(function () {
84
83
  isScrollingToBottom.current = true;
85
84
  var scrollToBottom = function scrollToBottom() {
86
85
  // Although we cancel the requestAnimationFrame in componentWillUnmount,
@@ -103,8 +102,8 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
103
102
  }
104
103
  };
105
104
  startScrollingAnimationFrame.current = window.requestAnimationFrame(scrollToBottom);
106
- };
107
- var onMouseEnter = function onMouseEnter() {
105
+ }, []);
106
+ var onMouseEnter = (0, _react.useCallback)(function () {
108
107
  // Stop scrolling to bottom if we're in mid-scroll, because the user wants to interact with
109
108
  // the list.
110
109
  isScrollingToBottom.current = false;
@@ -117,8 +116,8 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
117
116
  timer.pause();
118
117
  }
119
118
  }
120
- };
121
- var onMouseLeave = function onMouseLeave() {
119
+ }, []);
120
+ var onMouseLeave = (0, _react.useCallback)(function () {
122
121
  isUserInteracting.current = false;
123
122
  for (var _toastId2 in toastIdToTimerMap.current) {
124
123
  if (toastIdToTimerMap.current.hasOwnProperty(_toastId2)) {
@@ -126,8 +125,8 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
126
125
  timer.resume();
127
126
  }
128
127
  }
129
- };
130
- var onScroll = function onScroll() {
128
+ }, []);
129
+ var onScroll = (0, _react.useCallback)(function () {
131
130
  // Given that this method also gets invoked by the synthetic scroll that happens when a new toast gets added,
132
131
  // we want to evaluate if the scroll bottom has been reached only when the user is interacting with the toast,
133
132
  // this way we always retain the scroll position the user has set despite adding in new toasts.
@@ -135,7 +134,7 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
135
134
  if (listElement.current && isUserInteracting.current) {
136
135
  isScrolledToBottom.current = listElement.current.scrollHeight - listElement.current.scrollTop === listElement.current.clientHeight;
137
136
  }
138
- };
137
+ }, []);
139
138
  var dismissToast = (0, _react.useCallback)(function (toast) {
140
139
  // Remove the toast after it's done fading out.
141
140
  dismissTimeoutIds.current.push(window.setTimeout(function () {
@@ -158,34 +157,29 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
158
157
  }
159
158
  });
160
159
  }, [scheduleToastForDismissal, toasts]);
161
- var addListeners = function addListeners() {
162
- if (listElement.current) {
163
- listElement.current.addEventListener('scroll', onScroll);
164
- listElement.current.addEventListener('mouseenter', onMouseEnter);
165
- listElement.current.addEventListener('mouseleave', onMouseLeave);
166
- }
167
- };
168
- var removeListeners = function removeListeners() {
169
- if (listElement.current) {
170
- listElement.current.removeEventListener('scroll', onScroll);
171
- listElement.current.removeEventListener('mouseenter', onMouseEnter);
172
- listElement.current.removeEventListener('mouseleave', onMouseLeave);
173
- }
174
- };
175
160
 
176
161
  // componentDidMount
177
162
  (0, _react.useEffect)(function () {
178
- addListeners();
163
+ var listenerEl = listElement.current;
164
+ if (listenerEl) {
165
+ listenerEl.addEventListener('scroll', onScroll);
166
+ listenerEl.addEventListener('mouseenter', onMouseEnter);
167
+ listenerEl.addEventListener('mouseleave', onMouseLeave);
168
+ }
179
169
 
180
170
  // componentWillUnmount
181
171
  return function () {
172
+ if (listenerEl) {
173
+ listenerEl.removeEventListener('scroll', onScroll);
174
+ listenerEl.removeEventListener('mouseenter', onMouseEnter);
175
+ listenerEl.removeEventListener('mouseleave', onMouseLeave);
176
+ }
182
177
  if (isScrollingAnimationFrame.current !== 0) {
183
178
  window.cancelAnimationFrame(isScrollingAnimationFrame.current);
184
179
  }
185
180
  if (startScrollingAnimationFrame.current !== 0) {
186
181
  window.cancelAnimationFrame(startScrollingAnimationFrame.current);
187
182
  }
188
- removeListeners();
189
183
  dismissTimeoutIds.current.forEach(clearTimeout); // eslint-disable-line react-hooks/exhaustive-deps
190
184
  for (var _toastId3 in toastIdToTimerMap.current) {
191
185
  if (toastIdToTimerMap.current.hasOwnProperty(_toastId3)) {
@@ -194,7 +188,7 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
194
188
  }
195
189
  }
196
190
  };
197
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
191
+ }, [onMouseEnter, onMouseLeave, onScroll]);
198
192
 
199
193
  // componentDidUpdate
200
194
  (0, _react.useEffect)(function () {
@@ -209,7 +203,7 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
209
203
  }
210
204
  }
211
205
  prevToasts.current = toasts;
212
- }, [toasts, scheduleAllToastsForDismissal]);
206
+ }, [toasts, scheduleAllToastsForDismissal, startScrollingToBottom]);
213
207
 
214
208
  // Toast dismissal side effect
215
209
  // Ensure the callback has correct state by not enclosing it in `setTimeout`
@@ -230,49 +224,52 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
230
224
  });
231
225
  }
232
226
  }, [toastToDismiss, dismissToastProp]);
233
- var renderedToasts = toasts.map(function (toast) {
234
- var text = toast.text,
235
- toastLifeTimeMs = toast.toastLifeTimeMs,
236
- rest = (0, _objectWithoutProperties2.default)(toast, _excluded2);
237
- var onClose = function onClose() {
238
- return dismissToast(toast);
239
- };
240
- return (0, _react2.jsx)(_global_toast_list_item.EuiGlobalToastListItem, {
241
- key: toast.id,
242
- isDismissed: toastIdToDismissedMap[toast.id]
243
- }, (0, _react2.jsx)(_toast.EuiToast, (0, _extends2.default)({
244
- onClose: onClose,
245
- onFocus: onMouseEnter,
246
- onBlur: onMouseLeave
247
- }, rest), text));
248
- });
249
- if (showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
250
- var dismissAllToasts = function dismissAllToasts() {
251
- toasts.forEach(function (toast) {
252
- return dismissToastProp(toast);
253
- });
254
- onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
255
- };
256
- renderedToasts.push((0, _react2.jsx)(_i18n.EuiI18n, {
257
- key: "euiClearAllToasts",
258
- tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
259
- defaults: ['Clear all toast notifications', 'Clear all']
260
- }, function (_ref2) {
261
- var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
262
- clearAllToastsButtonAriaLabel = _ref3[0],
263
- clearAllToastsButtonDisplayText = _ref3[1];
227
+ var renderedToasts = (0, _react.useMemo)(function () {
228
+ return toasts.map(function (toast) {
229
+ var text = toast.text,
230
+ toastLifeTimeMs = toast.toastLifeTimeMs,
231
+ rest = (0, _objectWithoutProperties2.default)(toast, _excluded2);
232
+ var onClose = function onClose() {
233
+ return dismissToast(toast);
234
+ };
264
235
  return (0, _react2.jsx)(_global_toast_list_item.EuiGlobalToastListItem, {
265
- isDismissed: false
266
- }, (0, _react2.jsx)(_button.EuiButton, {
267
- fill: true,
268
- color: "text",
269
- onClick: dismissAllToasts,
270
- css: [styles.euiGlobalToastListDismissButton, ";label:EuiGlobalToastList;"],
271
- "aria-label": clearAllToastsButtonAriaLabel,
272
- "data-test-subj": "euiClearAllToastsButton"
273
- }, clearAllToastsButtonDisplayText));
274
- }));
275
- }
236
+ key: toast.id,
237
+ isDismissed: toastIdToDismissedMap[toast.id]
238
+ }, (0, _react2.jsx)(_toast.EuiToast, (0, _extends2.default)({
239
+ onClose: onClose,
240
+ onFocus: onMouseEnter,
241
+ onBlur: onMouseLeave
242
+ }, rest), text));
243
+ });
244
+ }, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave]);
245
+ var clearAllButton = (0, _react.useMemo)(function () {
246
+ if (toasts.length && showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
247
+ return (0, _react2.jsx)(_i18n.EuiI18n, {
248
+ key: "euiClearAllToasts",
249
+ tokens: ['euiGlobalToastList.clearAllToastsButtonAriaLabel', 'euiGlobalToastList.clearAllToastsButtonDisplayText'],
250
+ defaults: ['Clear all toast notifications', 'Clear all']
251
+ }, function (_ref2) {
252
+ var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
253
+ clearAllToastsButtonAriaLabel = _ref3[0],
254
+ clearAllToastsButtonDisplayText = _ref3[1];
255
+ return (0, _react2.jsx)(_global_toast_list_item.EuiGlobalToastListItem, {
256
+ isDismissed: false
257
+ }, (0, _react2.jsx)(_button.EuiButton, {
258
+ fill: true,
259
+ color: "text",
260
+ onClick: function onClick() {
261
+ toasts.forEach(function (toast) {
262
+ return dismissToastProp(toast);
263
+ });
264
+ onClearAllToasts === null || onClearAllToasts === void 0 ? void 0 : onClearAllToasts();
265
+ },
266
+ css: styles.euiGlobalToastListDismissButton,
267
+ "aria-label": clearAllToastsButtonAriaLabel,
268
+ "data-test-subj": "euiClearAllToastsButton"
269
+ }, clearAllToastsButtonDisplayText));
270
+ });
271
+ }
272
+ }, [showClearAllButtonAt, onClearAllToasts, toasts, dismissToastProp, styles]);
276
273
  var classes = (0, _classnames.default)('euiGlobalToastList', className);
277
274
  return (0, _react2.jsx)("div", (0, _extends2.default)({
278
275
  "aria-live": "polite",
@@ -280,7 +277,7 @@ var EuiGlobalToastList = function EuiGlobalToastList(_ref) {
280
277
  ref: listElement,
281
278
  css: cssStyles,
282
279
  className: classes
283
- }, rest), renderedToasts);
280
+ }, rest), renderedToasts, clearAllButton);
284
281
  };
285
282
  exports.EuiGlobalToastList = EuiGlobalToastList;
286
283
  EuiGlobalToastList.propTypes = {
@@ -36,47 +36,11 @@ var EuiToast = function EuiToast(_ref) {
36
36
  children = _ref.children,
37
37
  className = _ref.className,
38
38
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
39
- var euiTheme = (0, _services.useEuiTheme)();
40
- var baseStyles = (0, _toast.euiToastStyles)(euiTheme);
39
+ var baseStyles = (0, _services.useEuiMemoizedStyles)(_toast.euiToastStyles);
41
40
  var baseCss = [baseStyles.euiToast, color && baseStyles[color]];
42
- var bodyStyles = (0, _toast.euiToastBodyStyles)();
43
- var headerStyles = (0, _toast.euiToastHeaderStyles)(euiTheme);
41
+ var headerStyles = (0, _services.useEuiMemoizedStyles)(_toast.euiToastHeaderStyles);
44
42
  var headerCss = [headerStyles.euiToastHeader, children && headerStyles.withBody];
45
43
  var classes = (0, _classnames.default)('euiToast', className);
46
- var headerIcon;
47
- if (iconType) {
48
- headerIcon = (0, _react2.jsx)(_icon.EuiIcon, {
49
- css: headerStyles.euiToastHeader__icon,
50
- type: iconType,
51
- size: "m",
52
- "aria-hidden": "true"
53
- });
54
- }
55
- var closeButton;
56
- if (onClose) {
57
- closeButton = (0, _react2.jsx)(_i18n.EuiI18n, {
58
- token: "euiToast.dismissToast",
59
- default: "Dismiss toast"
60
- }, function (dismissToast) {
61
- return (0, _react2.jsx)(_button.EuiButtonIcon, {
62
- css: baseStyles.euiToast__closeButton,
63
- iconType: "cross",
64
- color: "text",
65
- size: "xs",
66
- "aria-label": dismissToast,
67
- onClick: onClose,
68
- "data-test-subj": "toastCloseButton"
69
- });
70
- });
71
- }
72
- var optionalBody;
73
- if (children) {
74
- optionalBody = (0, _react2.jsx)(_text.EuiText, {
75
- css: bodyStyles.euiToastBody,
76
- size: "s",
77
- "data-test-subj": "euiToastBody"
78
- }, children);
79
- }
80
44
  return (0, _react2.jsx)("div", (0, _extends2.default)({
81
45
  css: baseCss,
82
46
  className: classes
@@ -91,11 +55,32 @@ var EuiToast = function EuiToast(_ref) {
91
55
  css: headerCss,
92
56
  "aria-label": notification,
93
57
  "data-test-subj": "euiToastHeader"
94
- }, headerIcon, (0, _react2.jsx)("span", {
58
+ }, iconType && (0, _react2.jsx)(_icon.EuiIcon, {
59
+ css: headerStyles.euiToastHeader__icon,
60
+ type: iconType,
61
+ size: "m",
62
+ "aria-hidden": "true"
63
+ }), (0, _react2.jsx)("span", {
95
64
  css: headerStyles.euiToastHeader__title,
96
65
  "data-test-subj": "euiToastHeader__title"
97
66
  }, title));
98
- }), closeButton, optionalBody);
67
+ }), onClose && (0, _react2.jsx)(_i18n.EuiI18n, {
68
+ token: "euiToast.dismissToast",
69
+ default: "Dismiss toast"
70
+ }, function (dismissToast) {
71
+ return (0, _react2.jsx)(_button.EuiButtonIcon, {
72
+ css: baseStyles.euiToast__closeButton,
73
+ iconType: "cross",
74
+ color: "text",
75
+ size: "xs",
76
+ "aria-label": dismissToast,
77
+ onClick: onClose,
78
+ "data-test-subj": "toastCloseButton"
79
+ });
80
+ }), children && (0, _react2.jsx)(_text.EuiText, {
81
+ size: "s",
82
+ "data-test-subj": "euiToastBody"
83
+ }, children));
99
84
  };
100
85
  exports.EuiToast = EuiToast;
101
86
  EuiToast.propTypes = {
@@ -3,23 +3,24 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiToastStyles = exports.euiToastHeaderStyles = exports.euiToastBodyStyles = void 0;
6
+ exports.euiToastStyles = exports.euiToastHeaderStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _global_styling = require("../../global_styling");
9
9
  var _amsterdam = require("../../themes/amsterdam");
10
10
  var _title = require("../title/title.styles");
11
- 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)."; } /*
12
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
13
- * or more contributor license agreements. Licensed under the Elastic License
14
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
15
- * in compliance with, at your election, the Elastic License 2.0 or the Server
16
- * Side Public License, v 1.
17
- */
11
+ /*
12
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
13
+ * or more contributor license agreements. Licensed under the Elastic License
14
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
15
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
16
+ * Side Public License, v 1.
17
+ */
18
+
18
19
  var euiToastStyles = function euiToastStyles(euiThemeContext) {
19
20
  var euiTheme = euiThemeContext.euiTheme;
20
21
  return {
21
22
  // Base
22
- euiToast: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";", (0, _amsterdam.euiShadowLarge)(euiThemeContext), " position:relative;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), " background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('width', '100%'), " &:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
23
+ euiToast: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";", (0, _amsterdam.euiShadowLarge)(euiThemeContext), " position:relative;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), " background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.euiTextBreakWord)(), "&:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
23
24
  // Elements
24
25
  euiToast__closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('top', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('right', euiTheme.size.base), ";;label:euiToast__closeButton;"),
25
26
  // Variants
@@ -42,19 +43,4 @@ var euiToastHeaderStyles = function euiToastHeaderStyles(euiThemeContext) {
42
43
  withBody: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.s), ";;label:withBody;")
43
44
  };
44
45
  };
45
- exports.euiToastHeaderStyles = euiToastHeaderStyles;
46
- var _ref = process.env.NODE_ENV === "production" ? {
47
- name: "1xv63y1-euiToastBody",
48
- styles: "word-wrap:break-word;label:euiToastBody;"
49
- } : {
50
- name: "1xv63y1-euiToastBody",
51
- styles: "word-wrap:break-word;label:euiToastBody;",
52
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
53
- };
54
- var euiToastBodyStyles = function euiToastBodyStyles() {
55
- return {
56
- // Base
57
- euiToastBody: _ref
58
- };
59
- };
60
- exports.euiToastBodyStyles = euiToastBodyStyles;
46
+ exports.euiToastHeaderStyles = euiToastHeaderStyles;
@@ -9,6 +9,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
+ var _i18n = require("../i18n");
12
13
  var _icon = require("../icon");
13
14
  var _tool_tip = require("./tool_tip");
14
15
  var _react2 = require("@emotion/react");
@@ -23,8 +24,7 @@ var _excluded = ["type", "aria-label", "color", "size", "iconProps", "position",
23
24
  var EuiIconTip = function EuiIconTip(_ref) {
24
25
  var _ref$type = _ref.type,
25
26
  type = _ref$type === void 0 ? 'questionInCircle' : _ref$type,
26
- _ref$ariaLabel = _ref['aria-label'],
27
- ariaLabel = _ref$ariaLabel === void 0 ? 'Info' : _ref$ariaLabel,
27
+ ariaLabel = _ref['aria-label'],
28
28
  color = _ref.color,
29
29
  size = _ref.size,
30
30
  iconProps = _ref.iconProps,
@@ -33,6 +33,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
33
33
  _ref$delay = _ref.delay,
34
34
  delay = _ref$delay === void 0 ? 'regular' : _ref$delay,
35
35
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
36
+ var defaultAriaLabel = (0, _i18n.useEuiI18n)('euiIconTip.defaultAriaLabel', 'Info');
36
37
  return (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
37
38
  position: position,
38
39
  delay: delay
@@ -41,7 +42,7 @@ var EuiIconTip = function EuiIconTip(_ref) {
41
42
  type: type,
42
43
  color: color,
43
44
  size: size,
44
- "aria-label": ariaLabel
45
+ "aria-label": ariaLabel || defaultAriaLabel
45
46
  }, iconProps)));
46
47
  };
47
48
  exports.EuiIconTip = EuiIconTip;
@@ -1,22 +1,26 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.useEuiBorderColorCSS = exports.useEuiBackgroundColorCSS = exports.useEuiBackgroundColor = exports.euiBorderColor = exports.euiBackgroundColor = exports.BACKGROUND_COLORS = void 0;
7
- var _react = require("react");
8
- var _react2 = require("@emotion/react");
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _react = require("@emotion/react");
9
10
  var _services = require("../../services");
10
- /*
11
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
- * or more contributor license agreements. Licensed under the Elastic License
13
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
- * in compliance with, at your election, the Elastic License 2.0 or the Server
15
- * Side Public License, v 1.
16
- */
17
-
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } /*
13
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
+ * or more contributor license agreements. Licensed under the Elastic License
15
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
17
+ * Side Public License, v 1.
18
+ */
18
19
  var BACKGROUND_COLORS = ['transparent', 'plain', 'subdued', 'accent', 'primary', 'success', 'warning', 'danger'];
19
20
  exports.BACKGROUND_COLORS = BACKGROUND_COLORS;
21
+ /**
22
+ * @returns A single background color with optional alpha transparency
23
+ */
20
24
  var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
21
25
  var euiTheme = _ref.euiTheme,
22
26
  colorMode = _ref.colorMode;
@@ -45,31 +49,52 @@ var euiBackgroundColor = function euiBackgroundColor(_ref, color) {
45
49
  }
46
50
  }
47
51
  };
52
+
53
+ /**
54
+ * @returns An object map of color keys to color values, categorized by
55
+ * opaque (default) vs transparency (hover/focus states) methods.
56
+ * e.g. {
57
+ * opaque: { danger: '#000', success: '#fff', ... },
58
+ * transparent: { danger: 'rgba(0,0,0,0.1)', success: 'rgba(255,255,255,0.1)', ... },
59
+ * }
60
+ */
48
61
  exports.euiBackgroundColor = euiBackgroundColor;
62
+ var _euiBackgroundColorMap = function _euiBackgroundColorMap(euiThemeContext) {
63
+ return {
64
+ opaque: BACKGROUND_COLORS.reduce(function (acc, color) {
65
+ return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, color, euiBackgroundColor(euiThemeContext, color)));
66
+ }, {}),
67
+ transparent: BACKGROUND_COLORS.reduce(function (acc, color) {
68
+ return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, color, euiBackgroundColor(euiThemeContext, color, {
69
+ method: 'transparent'
70
+ })));
71
+ }, {})
72
+ };
73
+ };
49
74
  var useEuiBackgroundColor = function useEuiBackgroundColor(color) {
50
75
  var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
51
76
  method = _ref3.method;
52
- var euiTheme = (0, _services.useEuiTheme)();
53
- return euiBackgroundColor(euiTheme, color, {
54
- method: method
55
- });
77
+ var backgroundColorMap = (0, _services.useEuiMemoizedStyles)(_euiBackgroundColorMap);
78
+ return backgroundColorMap[method || 'opaque'][color];
56
79
  };
80
+
81
+ /**
82
+ * @returns An object map of color keys to CSS,
83
+ * e.g. { danger: css``, success: css``, ... }
84
+ */
57
85
  exports.useEuiBackgroundColor = useEuiBackgroundColor;
86
+ var _euiBackgroundColors = function _euiBackgroundColors(euiThemeContext) {
87
+ return BACKGROUND_COLORS.reduce(function (acc, color) {
88
+ return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, color, /*#__PURE__*/(0, _react.css)("background-color:", euiBackgroundColor(euiThemeContext, color), ";label:", color, ";")));
89
+ }, {});
90
+ };
58
91
  var useEuiBackgroundColorCSS = function useEuiBackgroundColorCSS() {
59
- var euiThemeContext = (0, _services.useEuiTheme)();
60
- return (0, _react.useMemo)(function () {
61
- return {
62
- transparent: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
63
- plain: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'plain'), ";;label:plain;"),
64
- subdued: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
65
- accent: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'accent'), ";;label:accent;"),
66
- primary: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'primary'), ";;label:primary;"),
67
- success: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'success'), ";;label:success;"),
68
- warning: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'warning'), ";;label:warning;"),
69
- danger: /*#__PURE__*/(0, _react2.css)("background-color:", euiBackgroundColor(euiThemeContext, 'danger'), ";;label:danger;")
70
- };
71
- }, [euiThemeContext]);
92
+ return (0, _services.useEuiMemoizedStyles)(_euiBackgroundColors);
72
93
  };
94
+
95
+ /**
96
+ * Border colors
97
+ */
73
98
  exports.useEuiBackgroundColorCSS = useEuiBackgroundColorCSS;
74
99
  var euiBorderColor = function euiBorderColor(_ref4, color) {
75
100
  var euiTheme = _ref4.euiTheme,
@@ -85,20 +110,18 @@ var euiBorderColor = function euiBorderColor(_ref4, color) {
85
110
  return (0, _services.tintOrShade)(euiTheme.colors[color], 0.6, colorMode);
86
111
  }
87
112
  };
113
+
114
+ /**
115
+ * @returns An object map of color keys to CSS,
116
+ * e.g. { danger: css``, success: css``, ... }
117
+ */
88
118
  exports.euiBorderColor = euiBorderColor;
119
+ var _euiBorderColors = function _euiBorderColors(euiThemeContext) {
120
+ return BACKGROUND_COLORS.reduce(function (acc, color) {
121
+ return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, color, /*#__PURE__*/(0, _react.css)("border-color:", euiBorderColor(euiThemeContext, color), ";label:", color, ";")));
122
+ }, {});
123
+ };
89
124
  var useEuiBorderColorCSS = function useEuiBorderColorCSS() {
90
- var euiThemeContext = (0, _services.useEuiTheme)();
91
- return (0, _react.useMemo)(function () {
92
- return {
93
- transparent: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'transparent'), ";;label:transparent;"),
94
- plain: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'plain'), ";;label:plain;"),
95
- subdued: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'subdued'), ";;label:subdued;"),
96
- accent: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'accent'), ";;label:accent;"),
97
- primary: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'primary'), ";;label:primary;"),
98
- success: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'success'), ";;label:success;"),
99
- warning: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'warning'), ";;label:warning;"),
100
- danger: /*#__PURE__*/(0, _react2.css)("border-color:", euiBorderColor(euiThemeContext, 'danger'), ";;label:danger;")
101
- };
102
- }, [euiThemeContext]);
125
+ return (0, _services.useEuiMemoizedStyles)(_euiBorderColors);
103
126
  };
104
127
  exports.useEuiBorderColorCSS = useEuiBorderColorCSS;