@elastic/eui 123.2.0 → 123.3.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 (229) hide show
  1. package/dist/eui-icons.json +92 -91
  2. package/dist/svgs/add_to_chat.svg +3 -5
  3. package/dist/svgs/product_alert_zero.svg +5 -0
  4. package/es/components/avatar/avatar.js +1 -1
  5. package/es/components/badge/badge.js +1 -1
  6. package/es/components/badge/beta_badge/beta_badge.js +1 -1
  7. package/es/components/banner/banner.js +40 -3
  8. package/es/components/basic_table/basic_table.js +4 -4
  9. package/es/components/basic_table/in_memory_table.js +4 -4
  10. package/es/components/button/button_display/_button_display_content.js +1 -1
  11. package/es/components/button/button_empty/button_empty.js +1 -1
  12. package/es/components/button/button_icon/button_icon.js +1 -1
  13. package/es/components/call_out/call_out.js +40 -7
  14. package/es/components/card/card.js +1 -1
  15. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  16. package/es/components/comment_list/comment.js +2 -2
  17. package/es/components/comment_list/comment_event.js +1 -1
  18. package/es/components/comment_list/comment_list.js +2 -2
  19. package/es/components/comment_list/comment_timeline.js +1 -1
  20. package/es/components/context_menu/context_menu_item.js +1 -1
  21. package/es/components/datagrid/body/cell/data_grid_cell.js +24 -24
  22. package/es/components/datagrid/body/data_grid_body.js +13 -13
  23. package/es/components/datagrid/body/data_grid_body_custom.js +13 -13
  24. package/es/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  25. package/es/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  26. package/es/components/datagrid/controls/column_sorting.js +13 -13
  27. package/es/components/datagrid/controls/column_sorting_draggable.js +1 -1
  28. package/es/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  29. package/es/components/datagrid/utils/in_memory.js +12 -12
  30. package/es/components/date_picker/date_picker.js +2 -2
  31. package/es/components/date_picker/date_picker_range.js +1 -1
  32. package/es/components/empty_prompt/empty_prompt.js +1 -1
  33. package/es/components/flyout/flyout_menu/flyout_menu.js +2 -2
  34. package/es/components/form/field_number/field_number.js +2 -2
  35. package/es/components/form/field_text/field_text.js +2 -2
  36. package/es/components/form/form_control_button/form_control_button.js +1 -1
  37. package/es/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  38. package/es/components/form/form_control_layout/form_control_layout.js +2 -2
  39. package/es/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  40. package/es/components/form/text_area/text_area.js +2 -2
  41. package/es/components/header/header_links/header_link.js +1 -1
  42. package/es/components/header/header_links/header_links.js +1 -1
  43. package/es/components/header/header_section/header_section_item_button.js +1 -1
  44. package/es/components/icon/assets/add_to_chat.js +2 -10
  45. package/es/components/icon/assets/product_alert_zero.js +33 -0
  46. package/es/components/icon/icon.js +1 -1
  47. package/es/components/icon/icon_map.js +5 -0
  48. package/es/components/icon/svgs/add_to_chat.svg +3 -5
  49. package/es/components/icon/svgs/product_alert_zero.svg +5 -0
  50. package/es/components/key_pad_menu/key_pad_menu_item.js +1 -1
  51. package/es/components/list_group/list_group.js +2 -2
  52. package/es/components/list_group/list_group_item.js +2 -2
  53. package/es/components/list_group/list_group_item_extra_action.js +1 -1
  54. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  55. package/es/components/loading/loading_logo.js +1 -1
  56. package/es/components/markdown_editor/markdown_editor.js +1 -1
  57. package/es/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  58. package/es/components/markdown_editor/markdown_editor_footer.js +1 -1
  59. package/es/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  60. package/es/components/page/page_header/page_header_content.js +1 -1
  61. package/es/components/pagination/pagination_button.js +1 -1
  62. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  63. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  64. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  65. package/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +5 -1
  66. package/es/components/table/table_header_cell.js +1 -1
  67. package/es/components/timeline/timeline_item_icon.js +1 -1
  68. package/es/components/toast/global_toast_list.js +2 -2
  69. package/es/components/toast/toast.js +2 -2
  70. package/es/components/token/token.styles.js +10 -4
  71. package/es/components/tool_tip/icon_tip.js +1 -1
  72. package/es/services/theme/provider.js +86 -101
  73. package/eui.d.ts +23 -11
  74. package/lib/components/avatar/avatar.js +1 -1
  75. package/lib/components/badge/badge.js +1 -1
  76. package/lib/components/badge/beta_badge/beta_badge.js +1 -1
  77. package/lib/components/banner/banner.js +39 -2
  78. package/lib/components/basic_table/basic_table.js +4 -4
  79. package/lib/components/basic_table/in_memory_table.js +4 -4
  80. package/lib/components/button/button_display/_button_display_content.js +1 -1
  81. package/lib/components/button/button_empty/button_empty.js +1 -1
  82. package/lib/components/button/button_icon/button_icon.js +1 -1
  83. package/lib/components/call_out/call_out.js +39 -6
  84. package/lib/components/card/card.js +1 -1
  85. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  86. package/lib/components/comment_list/comment.js +2 -2
  87. package/lib/components/comment_list/comment_event.js +1 -1
  88. package/lib/components/comment_list/comment_list.js +2 -2
  89. package/lib/components/comment_list/comment_timeline.js +1 -1
  90. package/lib/components/context_menu/context_menu_item.js +1 -1
  91. package/lib/components/datagrid/body/cell/data_grid_cell.js +24 -24
  92. package/lib/components/datagrid/body/data_grid_body.js +13 -13
  93. package/lib/components/datagrid/body/data_grid_body_custom.js +13 -13
  94. package/lib/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  95. package/lib/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  96. package/lib/components/datagrid/controls/column_sorting.js +13 -13
  97. package/lib/components/datagrid/controls/column_sorting_draggable.js +1 -1
  98. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  99. package/lib/components/datagrid/utils/in_memory.js +12 -12
  100. package/lib/components/date_picker/date_picker.js +2 -2
  101. package/lib/components/date_picker/date_picker_range.js +1 -1
  102. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  103. package/lib/components/flyout/flyout_menu/flyout_menu.js +2 -2
  104. package/lib/components/form/field_number/field_number.js +2 -2
  105. package/lib/components/form/field_text/field_text.js +2 -2
  106. package/lib/components/form/form_control_button/form_control_button.js +1 -1
  107. package/lib/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  108. package/lib/components/form/form_control_layout/form_control_layout.js +2 -2
  109. package/lib/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  110. package/lib/components/form/text_area/text_area.js +2 -2
  111. package/lib/components/header/header_links/header_link.js +1 -1
  112. package/lib/components/header/header_links/header_links.js +1 -1
  113. package/lib/components/header/header_section/header_section_item_button.js +1 -1
  114. package/lib/components/icon/assets/add_to_chat.js +2 -10
  115. package/lib/components/icon/assets/product_alert_zero.js +40 -0
  116. package/lib/components/icon/icon.js +1 -1
  117. package/lib/components/icon/icon_map.js +7 -0
  118. package/lib/components/icon/svgs/add_to_chat.svg +3 -5
  119. package/lib/components/icon/svgs/product_alert_zero.svg +5 -0
  120. package/lib/components/key_pad_menu/key_pad_menu_item.js +1 -1
  121. package/lib/components/list_group/list_group.js +2 -2
  122. package/lib/components/list_group/list_group_item.js +2 -2
  123. package/lib/components/list_group/list_group_item_extra_action.js +1 -1
  124. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  125. package/lib/components/loading/loading_logo.js +1 -1
  126. package/lib/components/markdown_editor/markdown_editor.js +1 -1
  127. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  128. package/lib/components/markdown_editor/markdown_editor_footer.js +1 -1
  129. package/lib/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  130. package/lib/components/page/page_header/page_header_content.js +1 -1
  131. package/lib/components/pagination/pagination_button.js +1 -1
  132. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  133. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  134. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  135. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +5 -1
  136. package/lib/components/table/table_header_cell.js +1 -1
  137. package/lib/components/timeline/timeline_item_icon.js +1 -1
  138. package/lib/components/toast/global_toast_list.js +2 -2
  139. package/lib/components/toast/toast.js +2 -2
  140. package/lib/components/token/token.styles.js +10 -4
  141. package/lib/components/tool_tip/icon_tip.js +1 -1
  142. package/lib/services/theme/provider.js +85 -102
  143. package/optimize/es/components/banner/banner.js +35 -3
  144. package/optimize/es/components/call_out/call_out.js +33 -5
  145. package/optimize/es/components/icon/assets/add_to_chat.js +2 -10
  146. package/optimize/es/components/icon/assets/product_alert_zero.js +32 -0
  147. package/optimize/es/components/icon/icon_map.js +5 -0
  148. package/optimize/es/components/icon/svgs/add_to_chat.svg +3 -5
  149. package/optimize/es/components/icon/svgs/product_alert_zero.svg +5 -0
  150. package/optimize/es/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +5 -1
  151. package/optimize/es/components/token/token.styles.js +10 -4
  152. package/optimize/es/services/theme/provider.js +82 -97
  153. package/optimize/lib/components/banner/banner.js +34 -2
  154. package/optimize/lib/components/call_out/call_out.js +32 -4
  155. package/optimize/lib/components/icon/assets/add_to_chat.js +2 -10
  156. package/optimize/lib/components/icon/assets/product_alert_zero.js +40 -0
  157. package/optimize/lib/components/icon/icon_map.js +7 -0
  158. package/optimize/lib/components/icon/svgs/add_to_chat.svg +3 -5
  159. package/optimize/lib/components/icon/svgs/product_alert_zero.svg +5 -0
  160. package/optimize/lib/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +5 -1
  161. package/optimize/lib/components/token/token.styles.js +10 -4
  162. package/optimize/lib/services/theme/provider.js +80 -97
  163. package/package.json +6 -6
  164. package/test-env/components/avatar/avatar.js +1 -1
  165. package/test-env/components/badge/badge.js +1 -1
  166. package/test-env/components/badge/beta_badge/beta_badge.js +1 -1
  167. package/test-env/components/banner/banner.js +34 -2
  168. package/test-env/components/basic_table/basic_table.js +4 -4
  169. package/test-env/components/basic_table/in_memory_table.js +4 -4
  170. package/test-env/components/button/button_display/_button_display_content.js +1 -1
  171. package/test-env/components/button/button_empty/button_empty.js +1 -1
  172. package/test-env/components/button/button_icon/button_icon.js +1 -1
  173. package/test-env/components/call_out/call_out.js +34 -6
  174. package/test-env/components/card/card.js +1 -1
  175. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +1 -1
  176. package/test-env/components/comment_list/comment.js +2 -2
  177. package/test-env/components/comment_list/comment_event.js +1 -1
  178. package/test-env/components/comment_list/comment_list.js +2 -2
  179. package/test-env/components/comment_list/comment_timeline.js +1 -1
  180. package/test-env/components/context_menu/context_menu_item.js +1 -1
  181. package/test-env/components/datagrid/body/cell/data_grid_cell.js +24 -24
  182. package/test-env/components/datagrid/body/data_grid_body.js +13 -13
  183. package/test-env/components/datagrid/body/data_grid_body_custom.js +13 -13
  184. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +13 -13
  185. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +12 -12
  186. package/test-env/components/datagrid/controls/column_sorting.js +13 -13
  187. package/test-env/components/datagrid/controls/column_sorting_draggable.js +1 -1
  188. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +1 -1
  189. package/test-env/components/datagrid/utils/in_memory.js +12 -12
  190. package/test-env/components/date_picker/date_picker.js +2 -2
  191. package/test-env/components/date_picker/date_picker_range.js +1 -1
  192. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  193. package/test-env/components/flyout/flyout_menu/flyout_menu.js +2 -2
  194. package/test-env/components/form/field_number/field_number.js +2 -2
  195. package/test-env/components/form/field_text/field_text.js +2 -2
  196. package/test-env/components/form/form_control_button/form_control_button.js +1 -1
  197. package/test-env/components/form/form_control_layout/append_prepend/form_append_prepend.js +2 -2
  198. package/test-env/components/form/form_control_layout/form_control_layout.js +2 -2
  199. package/test-env/components/form/form_control_layout/form_control_layout_custom_icon.js +1 -1
  200. package/test-env/components/form/text_area/text_area.js +2 -2
  201. package/test-env/components/header/header_links/header_link.js +1 -1
  202. package/test-env/components/header/header_links/header_links.js +1 -1
  203. package/test-env/components/header/header_section/header_section_item_button.js +1 -1
  204. package/test-env/components/icon/assets/add_to_chat.js +2 -10
  205. package/test-env/components/icon/assets/product_alert_zero.js +40 -0
  206. package/test-env/components/icon/icon_map.js +7 -0
  207. package/test-env/components/key_pad_menu/key_pad_menu_item.js +1 -1
  208. package/test-env/components/list_group/list_group.js +2 -2
  209. package/test-env/components/list_group/list_group_item.js +2 -2
  210. package/test-env/components/list_group/list_group_item_extra_action.js +1 -1
  211. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +4 -4
  212. package/test-env/components/loading/loading_logo.js +1 -1
  213. package/test-env/components/markdown_editor/markdown_editor.js +1 -1
  214. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +1 -1
  215. package/test-env/components/markdown_editor/markdown_editor_footer.js +1 -1
  216. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +1 -1
  217. package/test-env/components/page/page_header/page_header_content.js +1 -1
  218. package/test-env/components/pagination/pagination_button.js +1 -1
  219. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  220. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  221. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +1 -1
  222. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.styles.js +5 -1
  223. package/test-env/components/table/table_header_cell.js +1 -1
  224. package/test-env/components/timeline/timeline_item_icon.js +1 -1
  225. package/test-env/components/toast/global_toast_list.js +2 -2
  226. package/test-env/components/toast/toast.js +2 -2
  227. package/test-env/components/token/token.styles.js +10 -4
  228. package/test-env/components/tool_tip/icon_tip.js +1 -1
  229. package/test-env/services/theme/provider.js +80 -97
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
6
6
  import { css as _css } from "@emotion/react";
7
7
  var _excluded = ["cloneElement", "className"];
8
8
  var _templateObject;
@@ -28,7 +28,25 @@ import { EuiThemeMemoizedStylesProvider } from './style_memoization';
28
28
  import { useHighContrastModifications } from './high_contrast_overrides';
29
29
  import { buildTheme, getColorMode, getComputed, mergeDeep } from './utils';
30
30
  import { EUI_VIS_COLOR_STORE } from '../color';
31
+
32
+ /**
33
+ * Caches `value` during render, only swapping in a new one once `isSame`
34
+ * reports that it actually differs from the cached one.
35
+ *
36
+ * This keeps derived objects referentially stable (so that the - comparatively
37
+ * expensive - theme computation isn't rerun on every render) without deferring
38
+ * them to a `useEffect`/`setState` pair. Effect-synchronised state costs an
39
+ * extra commit, in which consumers would see e.g. an updated `colorMode`
40
+ * alongside a theme that is still computed from the previous one.
41
+ */
31
42
  import { jsx as ___EmotionJSX } from "@emotion/react";
43
+ var useStableValue = function useStableValue(value, isSame) {
44
+ var ref = useRef(value);
45
+ if (ref.current !== value && !isSame(ref.current, value)) {
46
+ ref.current = value;
47
+ }
48
+ return ref.current;
49
+ };
32
50
  export var EuiThemeProvider = function EuiThemeProvider(_ref) {
33
51
  var _system = _ref.theme,
34
52
  _colorMode = _ref.colorMode,
@@ -57,118 +75,85 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
57
75
  var EuiConditionalBreakpointProvider = useMemo(function () {
58
76
  return isGlobalTheme || _modifications !== null && _modifications !== void 0 && _modifications.breakpoint ? CurrentEuiBreakpointProvider : Fragment;
59
77
  }, [isGlobalTheme, _modifications]);
60
- var _useState = useState(_system || parentSystem),
61
- _useState2 = _slicedToArray(_useState, 2),
62
- system = _useState2[0],
63
- setSystem = _useState2[1];
64
- var prevSystemKey = useRef(system.key);
65
- var _useState3 = useState(mergeDeep(parentModifications, _modifications)),
66
- _useState4 = _slicedToArray(_useState3, 2),
67
- modifications = _useState4[0],
68
- setModifications = _useState4[1];
69
- var prevModifications = useRef(modifications);
70
- var _useState5 = useState(getColorMode(_colorMode, parentColorMode, isForced)),
71
- _useState6 = _slicedToArray(_useState5, 2),
72
- colorMode = _useState6[0],
73
- setColorMode = _useState6[1];
74
- var prevColorMode = useRef(colorMode);
78
+
79
+ // Every value below is derived from props/parent context during render, so
80
+ // that all context values this provider exposes - most notably `colorMode`
81
+ // and the computed `theme` - always change within the same commit
82
+ var system = useStableValue(_system || parentSystem, function (previous, next) {
83
+ return previous.key === next.key;
84
+ });
85
+ var mergedModifications = useMemo(function () {
86
+ return mergeDeep(parentModifications, _modifications);
87
+ }, [parentModifications, _modifications]);
88
+ var modifications = useStableValue(mergedModifications, isEqual);
89
+ var colorMode = useMemo(function () {
90
+ return getColorMode(_colorMode, parentColorMode, isForced);
91
+ }, [_colorMode, parentColorMode, isForced]);
75
92
  var highContrastMode = useMemo(function () {
76
93
  if (isForced) return 'forced'; // System forced high contrast mode will always supercede application settings
77
94
  if (_highContrastMode === true) return 'preferred'; // Convert the boolean prop to our internal enum
78
95
  if (_highContrastMode === false) return false; // Allow `false` prop to override user/system preference
79
96
  return parentHighContrastMode; // Fall back to the parent/system setting
80
97
  }, [_highContrastMode, parentHighContrastMode, isForced]);
81
- var prevHighContrastMode = useRef(highContrastMode);
82
98
  var modificationsWithHighContrast = useHighContrastModifications({
83
99
  highContrastMode: highContrastMode,
84
100
  colorMode: colorMode,
85
101
  system: system,
86
102
  modifications: modifications
87
103
  });
88
- var isParentTheme = useRef(isGlobalTheme ? prevSystemKey.current === DEFAULTS.system.key && colorMode === DEFAULTS.colorMode && highContrastMode === DEFAULTS.highContrastMode && !_modifications : prevSystemKey.current === parentSystem.key && colorMode === parentColorMode && highContrastMode === parentHighContrastMode && isEqual(parentModifications, modifications));
89
- var updateVisColorStore = useCallback(function (theme, isGlobalTheme) {
90
- if (isGlobalTheme) {
91
- EUI_VIS_COLOR_STORE.setVisColors(theme.colors.vis);
104
+
105
+ // If this provider resolves to the exact same theme as its parent, the
106
+ // already computed parent theme can be reused instead of recomputing it
107
+ var isParentTheme = useMemo(function () {
108
+ return isGlobalTheme ? system.key === DEFAULTS.system.key && colorMode === DEFAULTS.colorMode && highContrastMode === DEFAULTS.highContrastMode && !_modifications : system.key === parentSystem.key && colorMode === parentColorMode && highContrastMode === parentHighContrastMode && isEqual(parentModifications, modifications);
109
+ }, [isGlobalTheme, system, colorMode, highContrastMode, _modifications, parentSystem, parentColorMode, parentHighContrastMode, parentModifications, modifications]);
110
+
111
+ // Depending on `parentTheme` itself would recompute this provider's theme every
112
+ // time the parent's did, even where the parent's theme is not an input to it -
113
+ // `parentModifications` already reaches `getComputed` through `modifications`
114
+ var reusableParentTheme = isParentTheme && Object.keys(parentTheme).length ? parentTheme : null;
115
+ var theme = useMemo(function () {
116
+ if (reusableParentTheme) {
117
+ return _objectSpread({}, reusableParentTheme); // Intentionally create a new object to break referential equality
92
118
  }
93
- }, []);
94
- var getInitialTheme = function getInitialTheme() {
95
- var theme = getComputed(system, buildTheme(modificationsWithHighContrast, "_".concat(system.key)), colorMode, highContrastMode);
96
- setTimeout(function () {
97
- updateVisColorStore(theme, isGlobalTheme);
119
+
120
+ /* Enables recomputation of component colors when flags are overridden on the provider
121
+ by adding the respective key to modifications to trigger a recomputation. */
122
+ // NOTE: Keeping this as placeholder for potential future usage during Borealis changes
123
+ // TODO: remove once visual refresh is completed and flags are obsolete
124
+ var flagsToRecompute = [];
125
+ var keys = {};
126
+ var forceRecomputeComponents = flagsToRecompute.some(function (item) {
127
+ var _modifications$flags, _modifications$compon;
128
+ if (!item) return false;
129
+ if (Object.keys((_modifications$flags = modifications.flags) !== null && _modifications$flags !== void 0 ? _modifications$flags : {}).includes(item.flag) && !Object.keys((_modifications$compon = modifications.components) !== null && _modifications$compon !== void 0 ? _modifications$compon : {}).includes(item.componentKey)) {
130
+ keys[item.componentKey] = {
131
+ LIGHT: {},
132
+ DARK: {}
133
+ };
134
+ return true;
135
+ }
136
+ return false;
98
137
  });
99
- return theme;
100
- };
101
- var _useState7 = useState(isParentTheme.current && Object.keys(parentTheme).length ? _objectSpread({}, parentTheme) // Intentionally create a new object to break referential equality
102
- : getInitialTheme()),
103
- _useState8 = _slicedToArray(_useState7, 2),
104
- theme = _useState8[0],
105
- setTheme = _useState8[1];
106
- useEffect(function () {
107
- var newSystem = _system || parentSystem;
108
- if (prevSystemKey.current !== newSystem.key) {
109
- setSystem(newSystem);
110
- prevSystemKey.current = newSystem.key;
111
- isParentTheme.current = false;
112
- }
113
- }, [_system, parentSystem, theme, updateVisColorStore]);
114
- useEffect(function () {
115
- updateVisColorStore(theme, isGlobalTheme);
116
- }, [theme, colorMode, isGlobalTheme, updateVisColorStore]);
117
- useEffect(function () {
118
- var newModifications = mergeDeep(parentModifications, _modifications);
119
- if (!isEqual(prevModifications.current, newModifications)) {
120
- setModifications(newModifications);
121
- prevModifications.current = newModifications;
122
- isParentTheme.current = false;
123
- }
124
- }, [_modifications, parentModifications]);
125
- useEffect(function () {
126
- var newColorMode = getColorMode(_colorMode, parentColorMode, isForced);
127
- if (!isEqual(newColorMode, prevColorMode.current)) {
128
- setColorMode(newColorMode);
129
- prevColorMode.current = newColorMode;
130
- isParentTheme.current = false;
131
- }
132
- }, [_colorMode, parentColorMode, isForced]);
133
- useEffect(function () {
134
- if (prevHighContrastMode.current !== highContrastMode) {
135
- isParentTheme.current = false;
136
- }
137
- }, [highContrastMode]);
138
- useEffect(function () {
139
- if (!isParentTheme.current) {
140
- /* Enables recomputation of component colors when flags are overridden on the provider
141
- by adding the respective key to modifications to trigger a recomputation. */
142
- // NOTE: Keeping this as placeholder for potential future usage during Borealis changes
143
- // TODO: remove once visual refresh is completed and flags are obsolete
144
- var flagsToRecompute = [];
145
- var keys = {};
146
- var forceRecomputeComponents = flagsToRecompute.some(function (item) {
147
- var _modifications$flags, _modifications$compon;
148
- if (!item) return false;
149
- if (Object.keys((_modifications$flags = modifications.flags) !== null && _modifications$flags !== void 0 ? _modifications$flags : {}).includes(item.flag) && !Object.keys((_modifications$compon = modifications.components) !== null && _modifications$compon !== void 0 ? _modifications$compon : {}).includes(item.componentKey)) {
150
- keys[item.componentKey] = {
151
- LIGHT: {},
152
- DARK: {}
153
- };
154
- return true;
155
- }
156
- return false;
157
- });
158
- var componentModifications = forceRecomputeComponents ? {
159
- components: keys
160
- } : {};
138
+ var componentModifications = forceRecomputeComponents ? {
139
+ components: keys
140
+ } : {};
141
+
142
+ // force recomputing of color & component tokens based on flag changes
143
+ var enhancedModifications = _objectSpread(_objectSpread({}, modificationsWithHighContrast), componentModifications);
144
+ return getComputed(system, buildTheme(enhancedModifications, "_".concat(system.key)), colorMode, highContrastMode);
145
+ }, [reusableParentTheme, system, colorMode, highContrastMode, modifications, modificationsWithHighContrast]);
161
146
 
162
- // force recomputing of color & component tokens based on flag changes
163
- var enhancedModifications = _objectSpread(_objectSpread({}, modificationsWithHighContrast), componentModifications);
164
- var rebuiltTheme = getComputed(system, buildTheme(enhancedModifications, "_".concat(system.key)), colorMode, highContrastMode);
165
- setTheme(rebuiltTheme);
147
+ // Genuine side effect - the vis color store is consumed outside of React
148
+ useEffect(function () {
149
+ if (isGlobalTheme) {
150
+ EUI_VIS_COLOR_STORE.setVisColors(theme.colors.vis);
166
151
  }
167
- }, [colorMode, highContrastMode, system, modificationsWithHighContrast, modifications]);
168
- var _useState9 = useState(),
169
- _useState10 = _slicedToArray(_useState9, 2),
170
- themeCSSVariables = _useState10[0],
171
- _setThemeCSSVariables = _useState10[1];
152
+ }, [theme, isGlobalTheme]);
153
+ var _useState = useState(),
154
+ _useState2 = _slicedToArray(_useState, 2),
155
+ themeCSSVariables = _useState2[0],
156
+ _setThemeCSSVariables = _useState2[1];
172
157
  var setThemeCSSVariables = useCallback(function (variables) {
173
158
  return _setThemeCSSVariables(function (previous) {
174
159
  var merged = _objectSpread(_objectSpread({}, previous), variables);
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.EuiBanner = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
12
  var _react = _interopRequireWildcard(require("react"));
12
13
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -61,6 +62,29 @@ var EuiBanner = exports.EuiBanner = /*#__PURE__*/(0, _react.forwardRef)(function
61
62
  var primaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary;
62
63
  var secondaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary;
63
64
  var hasActions = Boolean(primaryActionProps) || Boolean(secondaryActionProps);
65
+ var titleRef = (0, _react.useRef)(null);
66
+ var contentRef = (0, _react.useRef)(null);
67
+ var _useState = (0, _react.useState)(''),
68
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
69
+ announcement = _useState2[0],
70
+ setAnnouncement = _useState2[1];
71
+ (0, _react.useEffect)(function () {
72
+ var content = contentRef.current;
73
+ if (!announceOnMount || !content) {
74
+ setAnnouncement('');
75
+ return;
76
+ }
77
+
78
+ // `EuiText` does not forward refs. The text slot is the first direct
79
+ // `.euiText` child, since `children` render after it.
80
+ var textNode = text ? Array.from(content.children).find(function (node) {
81
+ return node.classList.contains('euiText');
82
+ }) : undefined;
83
+ var childrenText = Array.from(content.childNodes).filter(function (node) {
84
+ return node !== titleRef.current && node !== textNode;
85
+ }).map(readText).filter(Boolean).join(' ');
86
+ setAnnouncement([readText(titleRef.current), readText(textNode), childrenText].filter(Boolean).join(",\xA0"));
87
+ }, [announceOnMount, title, text, children]);
64
88
  var componentClass = 'euiBanner';
65
89
  var classes = (0, _classnames.default)(componentClass, className);
66
90
  var backgroundColorStyles = (0, _global_styling.useEuiBackgroundColorCSS)()[color];
@@ -84,11 +108,13 @@ var EuiBanner = exports.EuiBanner = /*#__PURE__*/(0, _react.forwardRef)(function
84
108
  className: "".concat(componentClass, "__body"),
85
109
  css: styles.body
86
110
  }, (0, _react2.jsx)("div", {
111
+ ref: contentRef,
87
112
  className: "".concat(componentClass, "__content"),
88
113
  css: styles.content
89
114
  }, (0, _react2.jsx)(_title.EuiTitle, {
90
115
  size: headingSize
91
116
  }, (0, _react2.jsx)(Heading, {
117
+ ref: titleRef,
92
118
  css: styles.title,
93
119
  "data-test-subj": "".concat(dataTestSubj, "-title")
94
120
  }, title)), onDismiss ? (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
@@ -118,6 +144,12 @@ var EuiBanner = exports.EuiBanner = /*#__PURE__*/(0, _react.forwardRef)(function
118
144
  }, secondaryActionProps, {
119
145
  color: "primary",
120
146
  size: "s"
121
- })) : null) : null)), announceOnMount && (0, _react2.jsx)(_accessibility.EuiLiveAnnouncer, null, title && title, title && text && ",\xA0", text && text, (title || text) && children && ",\xA0", children && children));
147
+ })) : null) : null)), announcement ? (0, _react2.jsx)(_accessibility.EuiLiveAnnouncer, null, announcement) : null);
122
148
  });
123
- EuiBanner.displayName = 'EuiBanner';
149
+ EuiBanner.displayName = 'EuiBanner';
150
+
151
+ // jsdom has no `innerText`, so tests read `textContent`
152
+ var readText = function readText(node) {
153
+ var _ref2, _innerText;
154
+ return (_ref2 = (_innerText = node === null || node === void 0 ? void 0 : node.innerText) !== null && _innerText !== void 0 ? _innerText : node === null || node === void 0 ? void 0 : node.textContent) === null || _ref2 === void 0 ? void 0 : _ref2.trim();
155
+ };
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.EuiCallOut = exports.COLOR_TO_NOTIFICATION_ICON_MAP = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
@@ -174,9 +175,35 @@ var EuiCallOut = exports.EuiCallOut = /*#__PURE__*/(0, _react.forwardRef)(functi
174
175
  "data-test-subj": dataTestSubj && "".concat(dataTestSubj, "__actions")
175
176
  }, actionPrimary, actionSecondary);
176
177
  }, [actionProps, color, styles, dataTestSubj]);
177
- var announcement = (0, _react.useMemo)(function () {
178
- if (!announceOnMount || !(title || text || children)) return null;
179
- return (0, _react2.jsx)(_live_announcer.EuiLiveAnnouncer, null, title, title && text && ",\xA0", text, (title || text) && children && ",\xA0", children);
178
+ var contentRef = (0, _react.useRef)(null);
179
+ var _useState = (0, _react.useState)(''),
180
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
181
+ announcement = _useState2[0],
182
+ setAnnouncement = _useState2[1];
183
+ (0, _react.useEffect)(function () {
184
+ var content = contentRef.current;
185
+ if (!announceOnMount || !content) {
186
+ setAnnouncement('');
187
+ return;
188
+ }
189
+
190
+ // Read the nodes already on screen. The live region gets that text,
191
+ // not a second copy of the React tree. Only direct slots are read, so a
192
+ // callout nested in `children` is not picked up as this one's slots.
193
+ // Not `:scope >`: jsdom resolves `:scope` by tag and class, which the
194
+ // nested callout's content shares.
195
+ var parts = Array.from(content.children).filter(function (_ref2) {
196
+ var classList = _ref2.classList;
197
+ return ['euiCallOutHeader__title', 'euiCallOut__text', 'euiCallOut__additionalContent'].some(function (className) {
198
+ return classList.contains(className);
199
+ });
200
+ })
201
+ // jsdom has no `innerText`, so tests read `textContent`
202
+ .map(function (node) {
203
+ var _ref3, _node$innerText;
204
+ return (_ref3 = (_node$innerText = node.innerText) !== null && _node$innerText !== void 0 ? _node$innerText : node.textContent) === null || _ref3 === void 0 ? void 0 : _ref3.trim();
205
+ }).filter(Boolean);
206
+ setAnnouncement(parts.join(",\xA0"));
180
207
  }, [announceOnMount, title, text, children]);
181
208
  return (0, _react2.jsx)(_panel.EuiPanel, (0, _extends2.default)({
182
209
  borderRadius: "none",
@@ -196,11 +223,12 @@ var EuiCallOut = exports.EuiCallOut = /*#__PURE__*/(0, _react.forwardRef)(functi
196
223
  }, (0, _react2.jsx)("div", {
197
224
  css: styles.body
198
225
  }, icon, (0, _react2.jsx)("div", {
226
+ ref: contentRef,
199
227
  css: styles.content
200
228
  },
201
229
  // Note: the DOM position of the dismiss button matters to screen reader users.
202
230
  // We generally want them to have some context of _what_ they're dismissing,
203
231
  // instead of navigating to the dismiss button first before the callout content
204
- header && optionalChildren ? (0, _react2.jsx)(_react.default.Fragment, null, header, dismissButton, optionalChildren) : (0, _react2.jsx)(_react.default.Fragment, null, header || optionalChildren, dismissButton))), actionControls, announcement));
232
+ header && optionalChildren ? (0, _react2.jsx)(_react.default.Fragment, null, header, dismissButton, optionalChildren) : (0, _react2.jsx)(_react.default.Fragment, null, header || optionalChildren, dismissButton))), actionControls, announcement ? (0, _react2.jsx)(_live_announcer.EuiLiveAnnouncer, null, announcement) : null));
205
233
  });
206
234
  EuiCallOut.displayName = 'EuiCallOut';
@@ -34,17 +34,9 @@ var EuiIconAddToChat = function EuiIconAddToChat(_ref) {
34
34
  }, props), title ? (0, _react2.jsx)("title", {
35
35
  id: titleId
36
36
  }, title) : null, (0, _react2.jsx)("path", {
37
- fillRule: "evenodd",
38
- d: "M8 0a1.5 1.5 0 0 1 .5 2.912V4H11a3 3 0 0 1 3 3h1l.102.005A1 1 0 0 1 16 8v1h-1V8h-1v1h-1V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v7h6v1H3a1 1 0 0 1-1-1v-2H1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1a3 3 0 0 1 3-3h2.5V2.912A1.498 1.498 0 0 1 8 0ZM1 11h1V8H1v3ZM8 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z",
39
- clipRule: "evenodd"
37
+ d: "M14 13h2v1h-2v2h-1v-2h-2v-1h2v-2h1z"
40
38
  }), (0, _react2.jsx)("path", {
41
- d: "M10.447 11.523C9.826 12.767 8.59 13 8 13c-.59 0-1.826-.233-2.447-1.477l.894-.447C6.826 11.833 7.59 12 8 12c.41 0 1.174-.167 1.553-.924l.894.447Z"
42
- }), (0, _react2.jsx)("path", {
43
- fillRule: "evenodd",
44
- d: "M5.5 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm5-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z",
45
- clipRule: "evenodd"
46
- }), (0, _react2.jsx)("path", {
47
- d: "M14 13h2v1h-2v2h-1v-2h-2v-1h2v-2h1v2Z"
39
+ d: "M9.389 1c.4 0 .783.116 1.078.328.294.212.533.55.533.972V3h1a3 3 0 0 1 3 3v1h1v2h-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h5v1H4a3 3 0 0 1-3-3v-2H0V7h1V6a3 3 0 0 1 3-3h1v-.7c0-.423.239-.76.533-.972A1.85 1.85 0 0 1 6.611 1zM6 10H5V7h1zm5 0h-1V7h1zM6 3h4V2H6z"
48
40
  }));
49
41
  };
50
42
  var icon = exports.icon = EuiIconAddToChat;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.icon = void 0;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _react2 = require("@emotion/react");
13
+ var _excluded = ["title", "titleId"];
14
+ /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
21
+ // THIS IS A GENERATED FILE. DO NOT MODIFY MANUALLY. @see scripts/compile-icons.js
22
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
23
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
24
+ var EuiIconProductAlertZero = function EuiIconProductAlertZero(_ref) {
25
+ var title = _ref.title,
26
+ titleId = _ref.titleId,
27
+ props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
28
+ return (0, _react2.jsx)("svg", (0, _extends2.default)({
29
+ xmlns: "http://www.w3.org/2000/svg",
30
+ width: 16,
31
+ height: 16,
32
+ viewBox: "0 0 16 16",
33
+ "aria-labelledby": titleId
34
+ }, props), title ? (0, _react2.jsx)("title", {
35
+ id: titleId
36
+ }, title) : null, (0, _react2.jsx)("path", {
37
+ d: "M11.283 14.24A7 7 0 0 1 8 15.053l-.362-.01a7 7 0 0 1-2.976-.833l.642-.793A6 6 0 0 0 8 14.053c.989 0 1.921-.24 2.745-.661zM8 .016a1.486 1.486 0 0 1 .365 2.925v2.084A2.997 2.997 0 0 1 10.995 8l-.003.153a3 3 0 0 1-.231 1.002l1.826 1.055a1.485 1.485 0 1 1-.382.648l-1.82-1.05a2.99 2.99 0 0 1-2.386 1.19l-.154-.005a3 3 0 0 1-2.22-1.166L3.8 10.88a1.485 1.485 0 0 1-2.722 1.125 1.487 1.487 0 0 1 2.35-1.78l1.815-1.048a3 3 0 0 1-.238-1.025L5 8a3 3 0 0 1 2.612-2.974v-2.09A1.485 1.485 0 0 1 8 .016M2.787 11.019a.487.487 0 1 0-.844.487.487.487 0 0 0 .844-.487m11.09-.18a.487.487 0 1 0-.484.844.487.487 0 0 0 .485-.843M8 6.002a1.998 1.998 0 1 0 0 3.997A1.998 1.998 0 0 0 8 6m0-4.985a.487.487 0 1 0 0 .974.487.487 0 0 0 0-.973M4.802 2.878A6.04 6.04 0 0 0 1.955 7.99l-1 .023v-.005A7.04 7.04 0 0 1 4.28 2.023zm6.993-.806a7.04 7.04 0 0 1 3.249 5.925l-1 .006a6.04 6.04 0 0 0-2.835-5.117z"
38
+ }));
39
+ };
40
+ var icon = exports.icon = EuiIconProductAlertZero;
@@ -2697,6 +2697,13 @@ var typeToPathMap = exports.typeToPathMap = {
2697
2697
  }, {
2698
2698
  synonyms: ['agent', 'product', 'elastic agent', 'fleet', 'monitoring']
2699
2699
  }),
2700
+ productAlertZero: withMetadata(function () {
2701
+ return Promise.resolve().then(function () {
2702
+ return _interopRequireWildcard(require('./assets/product_alert_zero'));
2703
+ });
2704
+ }, {
2705
+ synonyms: ['alertzero', 'alert', 'zero', 'attack', 'security']
2706
+ }),
2700
2707
  productCanvas: withMetadata(function () {
2701
2708
  return Promise.resolve().then(function () {
2702
2709
  return _interopRequireWildcard(require('./assets/product_canvas'));
@@ -1,6 +1,4 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
- <path fill-rule="evenodd" d="M8 0a1.5 1.5 0 0 1 .5 2.912V4H11a3 3 0 0 1 3 3h1l.102.005A1 1 0 0 1 16 8v1h-1V8h-1v1h-1V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v7h6v1H3a1 1 0 0 1-1-1v-2H1a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h1a3 3 0 0 1 3-3h2.5V2.912A1.498 1.498 0 0 1 8 0ZM1 11h1V8H1v3ZM8 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z" clip-rule="evenodd"/>
3
- <path d="M10.447 11.523C9.826 12.767 8.59 13 8 13c-.59 0-1.826-.233-2.447-1.477l.894-.447C6.826 11.833 7.59 12 8 12c.41 0 1.174-.167 1.553-.924l.894.447Z"/>
4
- <path fill-rule="evenodd" d="M5.5 7a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Zm5-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm0 1a.5.5 0 1 0 0 1 .5.5 0 0 0 0-1Z" clip-rule="evenodd"/>
5
- <path d="M14 13h2v1h-2v2h-1v-2h-2v-1h2v-2h1v2Z"/>
6
- </svg>
2
+ <path d="M14 13h2v1h-2v2h-1v-2h-2v-1h2v-2h1z"/>
3
+ <path d="M9.389 1c.4 0 .783.116 1.078.328.294.212.533.55.533.972V3h1a3 3 0 0 1 3 3v1h1v2h-2V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h5v1H4a3 3 0 0 1-3-3v-2H0V7h1V6a3 3 0 0 1 3-3h1v-.7c0-.423.239-.76.533-.972A1.85 1.85 0 0 1 6.611 1zM6 10H5V7h1zm5 0h-1V7h1zM6 3h4V2H6z"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
2
+ <path d="M11.283 14.24A7 7 0 0 1 8 15.053l-.362-.01a7 7 0 0 1-2.976-.833l.642-.793A6 6 0 0 0 8 14.053c.989 0 1.921-.24 2.745-.661z"/>
3
+ <path d="M8 .016a1.486 1.486 0 0 1 .365 2.925v2.084A2.997 2.997 0 0 1 10.995 8l-.003.153a3 3 0 0 1-.231 1.002l1.826 1.055a1.485 1.485 0 1 1-.382.648l-1.82-1.05a2.99 2.99 0 0 1-2.386 1.19l-.154-.005a3 3 0 0 1-2.22-1.166L3.8 10.88a1.485 1.485 0 0 1-2.722 1.125 1.487 1.487 0 0 1 2.35-1.78l1.815-1.048a3 3 0 0 1-.238-1.025L5 8a3 3 0 0 1 2.612-2.974v-2.09A1.485 1.485 0 0 1 8 .016M2.787 11.019a.487.487 0 1 0-.844.487.487.487 0 0 0 .844-.487m11.09-.18a.487.487 0 1 0-.484.844.487.487 0 0 0 .485-.843M8 6.002a1.998 1.998 0 1 0 0 3.997A1.998 1.998 0 0 0 8 6m0-4.985a.487.487 0 1 0 0 .974.487.487 0 0 0 0-.973"/>
4
+ <path d="M4.802 2.878A6.04 6.04 0 0 0 1.955 7.99l-1 .023v-.005A7.04 7.04 0 0 1 4.28 2.023zm6.993-.806a7.04 7.04 0 0 1 3.249 5.925l-1 .006a6.04 6.04 0 0 0-2.835-5.117z"/>
5
+ </svg>
@@ -24,7 +24,11 @@ var _ref = process.env.NODE_ENV === "production" ? {
24
24
  };
25
25
  var euiSelectableTemplateSitewideStyles = exports.euiSelectableTemplateSitewideStyles = function euiSelectableTemplateSitewideStyles(euiThemeContext) {
26
26
  var euiTheme = euiThemeContext.euiTheme;
27
- var visColors = (0, _services.euiPaletteColorBlind)();
27
+
28
+ // Pass the theme's vis colors explicitly - see the note in token.styles.ts
29
+ var visColors = (0, _services.euiPaletteColorBlind)({
30
+ colors: euiTheme.colors.vis
31
+ });
28
32
  return {
29
33
  euiSelectableTemplateSitewide: _ref,
30
34
  euiSelectableTemplateSitewide__optionMetasList: /*#__PURE__*/(0, _react.css)("display:block;", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), " color:", euiTheme.colors.textSubdued, ";;label:euiSelectableTemplateSitewide__optionMetasList;"),
@@ -23,10 +23,16 @@ var getTokenColor = function getTokenColor(euiThemeContext, fill, color) {
23
23
  var euiTheme = euiThemeContext.euiTheme,
24
24
  colorMode = euiThemeContext.colorMode,
25
25
  highContrastMode = euiThemeContext.highContrastMode;
26
- // use inside function as they are not returning constants,
27
- // but internally depend on EUI_VIS_COLOR_STORE to update per theme
28
- var visColors = (0, _services.euiPaletteColorBlind)();
29
- var visColorsBehindText = (0, _services.euiPaletteColorBlindBehindText)();
26
+ // Pass the theme's vis colors explicitly rather than letting these fall back to
27
+ // EUI_VIS_COLOR_STORE - the store is only updated in an effect, so on the first
28
+ // render it can still hold the previous theme's palette. Memoized styles are not
29
+ // regenerated for a store update, so those colors would stay stale.
30
+ var visColors = (0, _services.euiPaletteColorBlind)({
31
+ colors: euiTheme.colors.vis
32
+ });
33
+ var visColorsBehindText = (0, _services.euiPaletteColorBlindBehindText)({
34
+ colors: euiTheme.colors.vis
35
+ });
30
36
  var isVizColor = typeof color === 'number';
31
37
  var iconColor = isVizColor ? visColors[color] : euiTheme.colors.darkShade;
32
38
  var isDarkMode = colorMode === 'DARK';