@elastic/eui 64.0.1 → 64.0.2

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 (117) hide show
  1. package/dist/eui_charts_theme.js +330 -330
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +4 -1
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +4 -1
  6. package/dist/eui_theme_light.min.css +1 -1
  7. package/es/components/button/button_display/_button_display.js +6 -1
  8. package/es/components/button/button_empty/button_empty.js +10 -1
  9. package/es/components/card/card.js +10 -1
  10. package/es/components/card/card_select.js +10 -1
  11. package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  12. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  13. package/es/components/description_list/description_list_title.js +1 -1
  14. package/es/components/expression/expression.js +12 -2
  15. package/es/components/header/header_links/header_link.js +10 -1
  16. package/es/components/image/image.js +6 -1
  17. package/es/components/notification/notification_event.js +10 -1
  18. package/es/components/page/page_content/page_content.js +1 -2
  19. package/es/components/page/page_content/page_content_body.js +1 -2
  20. package/es/components/page/page_content/page_content_header.js +1 -2
  21. package/es/components/page/page_content/page_content_header_section.js +1 -2
  22. package/es/components/page/page_section/page_section.js +15 -3
  23. package/es/components/page/page_side_bar/page_side_bar.js +1 -2
  24. package/es/components/page/page_sidebar/page_sidebar.js +5 -1
  25. package/es/components/page/page_template.js +3 -1
  26. package/es/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  27. package/es/components/page_template/page_template.js +18 -2
  28. package/es/components/pagination/pagination_button.js +10 -1
  29. package/es/components/progress/progress.js +6 -1
  30. package/es/components/provider/cache/cache_provider.js +3 -9
  31. package/es/components/provider/provider.js +25 -2
  32. package/es/components/resizable_container/resizable_panel.js +6 -1
  33. package/es/components/side_nav/side_nav.js +5 -0
  34. package/es/services/theme/hooks.js +11 -16
  35. package/eui.d.ts +26 -24
  36. package/i18ntokens.json +4 -4
  37. package/lib/components/button/button_display/_button_display.js +6 -1
  38. package/lib/components/button/button_empty/button_empty.js +10 -1
  39. package/lib/components/card/card.js +10 -1
  40. package/lib/components/card/card_select.js +10 -1
  41. package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  42. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  43. package/lib/components/description_list/description_list_title.js +1 -1
  44. package/lib/components/expression/expression.js +12 -2
  45. package/lib/components/header/header_links/header_link.js +10 -1
  46. package/lib/components/image/image.js +6 -1
  47. package/lib/components/notification/notification_event.js +10 -1
  48. package/lib/components/page/page_content/page_content.js +1 -2
  49. package/lib/components/page/page_content/page_content_body.js +1 -2
  50. package/lib/components/page/page_content/page_content_header.js +1 -2
  51. package/lib/components/page/page_content/page_content_header_section.js +1 -2
  52. package/lib/components/page/page_section/page_section.js +15 -3
  53. package/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  54. package/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  55. package/lib/components/page/page_template.js +3 -1
  56. package/lib/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  57. package/lib/components/page_template/page_template.js +18 -2
  58. package/lib/components/progress/progress.js +6 -1
  59. package/lib/components/provider/cache/cache_provider.js +3 -11
  60. package/lib/components/provider/provider.js +31 -6
  61. package/lib/components/resizable_container/resizable_panel.js +6 -1
  62. package/lib/components/side_nav/side_nav.js +5 -0
  63. package/lib/services/theme/hooks.js +10 -15
  64. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +0 -1
  65. package/optimize/es/components/description_list/description_list_title.js +1 -1
  66. package/optimize/es/components/page/page_content/page_content.js +1 -2
  67. package/optimize/es/components/page/page_content/page_content_body.js +1 -2
  68. package/optimize/es/components/page/page_content/page_content_header.js +1 -2
  69. package/optimize/es/components/page/page_content/page_content_header_section.js +1 -2
  70. package/optimize/es/components/page/page_section/page_section.js +4 -2
  71. package/optimize/es/components/page/page_side_bar/page_side_bar.js +1 -2
  72. package/optimize/es/components/page/page_sidebar/page_sidebar.js +5 -1
  73. package/optimize/es/components/page/page_template.js +3 -1
  74. package/optimize/es/components/provider/cache/cache_provider.js +3 -9
  75. package/optimize/es/components/provider/provider.js +25 -2
  76. package/optimize/es/services/theme/hooks.js +11 -16
  77. package/optimize/lib/components/description_list/description_list_title.js +1 -1
  78. package/optimize/lib/components/page/page_content/page_content.js +1 -2
  79. package/optimize/lib/components/page/page_content/page_content_body.js +1 -2
  80. package/optimize/lib/components/page/page_content/page_content_header.js +1 -2
  81. package/optimize/lib/components/page/page_content/page_content_header_section.js +1 -2
  82. package/optimize/lib/components/page/page_section/page_section.js +4 -2
  83. package/optimize/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  84. package/optimize/lib/components/page/page_sidebar/page_sidebar.js +5 -1
  85. package/optimize/lib/components/page/page_template.js +3 -1
  86. package/optimize/lib/components/provider/cache/cache_provider.js +3 -11
  87. package/optimize/lib/components/provider/provider.js +31 -6
  88. package/optimize/lib/services/theme/hooks.js +10 -15
  89. package/package.json +1 -1
  90. package/src/components/datagrid/_data_grid_data_row.scss +7 -0
  91. package/test-env/components/button/button_display/_button_display.js +6 -1
  92. package/test-env/components/button/button_empty/button_empty.js +10 -1
  93. package/test-env/components/card/card.js +10 -1
  94. package/test-env/components/card/card_select.js +10 -1
  95. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  96. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  97. package/test-env/components/description_list/description_list_title.js +1 -1
  98. package/test-env/components/expression/expression.js +12 -2
  99. package/test-env/components/header/header_links/header_link.js +10 -1
  100. package/test-env/components/image/image.js +6 -1
  101. package/test-env/components/notification/notification_event.js +10 -1
  102. package/test-env/components/page/page_content/page_content.js +1 -2
  103. package/test-env/components/page/page_content/page_content_body.js +1 -2
  104. package/test-env/components/page/page_content/page_content_header.js +1 -2
  105. package/test-env/components/page/page_content/page_content_header_section.js +1 -2
  106. package/test-env/components/page/page_section/page_section.js +15 -3
  107. package/test-env/components/page/page_side_bar/page_side_bar.js +1 -2
  108. package/test-env/components/page/page_sidebar/page_sidebar.js +5 -1
  109. package/test-env/components/page/page_template.js +3 -1
  110. package/test-env/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  111. package/test-env/components/page_template/page_template.js +18 -2
  112. package/test-env/components/progress/progress.js +6 -1
  113. package/test-env/components/provider/cache/cache_provider.js +3 -11
  114. package/test-env/components/provider/provider.js +31 -6
  115. package/test-env/components/resizable_container/resizable_panel.js +6 -1
  116. package/test-env/components/side_nav/side_nav.js +5 -0
  117. package/test-env/services/theme/hooks.js +10 -15
@@ -7,6 +7,8 @@ exports.EuiProvider = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
+ var _cache = _interopRequireDefault(require("@emotion/cache"));
11
+
10
12
  var _global_styles = require("../../global_styling/reset/global_styles");
11
13
 
12
14
  var _utility = require("../../global_styling/utility/utility");
@@ -15,7 +17,7 @@ var _services = require("../../services");
15
17
 
16
18
  var _themes = require("../../themes");
17
19
 
18
- var _cache = require("./cache");
20
+ var _cache2 = require("./cache");
19
21
 
20
22
  var _react2 = require("@emotion/react");
21
23
 
@@ -32,8 +34,16 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
32
34
  return obj.hasOwnProperty('key');
33
35
  };
34
36
 
37
+ var fallbackCache = (0, _cache.default)({
38
+ key: 'css'
39
+ });
40
+ fallbackCache.compat = true;
41
+
35
42
  var EuiProvider = function EuiProvider(_ref) {
36
- var cache = _ref.cache,
43
+ var _defaultCache;
44
+
45
+ var _ref$cache = _ref.cache,
46
+ cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
37
47
  _ref$theme = _ref.theme,
38
48
  theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
39
49
  _ref$globalStyles = _ref.globalStyles,
@@ -49,24 +59,39 @@ var EuiProvider = function EuiProvider(_ref) {
49
59
 
50
60
  if (cache) {
51
61
  if (isEmotionCacheObject(cache)) {
62
+ cache.compat = true;
52
63
  defaultCache = cache;
53
64
  } else {
65
+ if (cache.default) {
66
+ cache.default.compat = true;
67
+ }
68
+
54
69
  defaultCache = cache.default;
70
+
71
+ if (cache.global) {
72
+ cache.global.compat = true;
73
+ }
74
+
55
75
  globalCache = cache.global;
76
+
77
+ if (cache.utility) {
78
+ cache.utility.compat = true;
79
+ }
80
+
56
81
  utilityCache = cache.utility;
57
82
  }
58
83
  }
59
84
 
60
- return (0, _react2.jsx)(_cache.EuiCacheProvider, {
61
- cache: defaultCache
85
+ return (0, _react2.jsx)(_cache2.EuiCacheProvider, {
86
+ cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
62
87
  }, (0, _react2.jsx)(_services.EuiThemeProvider, {
63
88
  theme: theme !== null && theme !== void 0 ? theme : undefined,
64
89
  colorMode: colorMode,
65
90
  modify: modify
66
- }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache.EuiCacheProvider, {
91
+ }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache2.EuiCacheProvider, {
67
92
  cache: globalCache,
68
93
  children: Globals && (0, _react2.jsx)(Globals, null)
69
- }), (0, _react2.jsx)(_cache.EuiCacheProvider, {
94
+ }), (0, _react2.jsx)(_cache2.EuiCacheProvider, {
70
95
  cache: utilityCache,
71
96
  children: Utilities && (0, _react2.jsx)(Utilities, null)
72
97
  })), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));
@@ -355,7 +355,12 @@ EuiResizablePanel.propTypes = {
355
355
  /**
356
356
  * Props to add to the wrapping `.euiResizablePanel` div
357
357
  */
358
- wrapperProps: _propTypes.default.any,
358
+ wrapperProps: _propTypes.default.shape({
359
+ className: _propTypes.default.string,
360
+ "aria-label": _propTypes.default.string,
361
+ "data-test-subj": _propTypes.default.string,
362
+ css: _propTypes.default.any
363
+ }),
359
364
 
360
365
  /**
361
366
  * Padding to add directly to the wrapping `.euiResizablePanel` div
@@ -272,6 +272,11 @@ EuiSideNav.propTypes = {
272
272
  * Adds a couple extra #EuiSideNavHeading props and extends the props of EuiTitle that wraps the `heading`
273
273
  */
274
274
  headingProps: _propTypes.default.shape({
275
+ className: _propTypes.default.string,
276
+ "aria-label": _propTypes.default.string,
277
+ "data-test-subj": _propTypes.default.string,
278
+ css: _propTypes.default.any,
279
+
275
280
  /**
276
281
  * The actual HTML heading element to wrap the `heading`.
277
282
  * Default is `h2`
@@ -23,11 +23,14 @@ var useEuiTheme = function useEuiTheme() {
23
23
  var theme = (0, _react.useContext)(_context.EuiThemeContext);
24
24
  var colorMode = (0, _react.useContext)(_context.EuiColorModeContext);
25
25
  var modifications = (0, _react.useContext)(_context.EuiModificationsContext);
26
- return {
27
- euiTheme: theme,
28
- colorMode: colorMode,
29
- modifications: modifications
30
- };
26
+ var assembledTheme = (0, _react.useMemo)(function () {
27
+ return {
28
+ euiTheme: theme,
29
+ colorMode: colorMode,
30
+ modifications: modifications
31
+ };
32
+ }, [theme, colorMode, modifications]);
33
+ return assembledTheme;
31
34
  };
32
35
 
33
36
  exports.useEuiTheme = useEuiTheme;
@@ -38,17 +41,9 @@ var withEuiTheme = function withEuiTheme(Component) {
38
41
  var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
39
42
 
40
43
  var Render = function Render(props, ref) {
41
- var _useEuiTheme = useEuiTheme(),
42
- euiTheme = _useEuiTheme.euiTheme,
43
- colorMode = _useEuiTheme.colorMode,
44
- modifications = _useEuiTheme.modifications;
45
-
44
+ var theme = useEuiTheme();
46
45
  return (0, _react2.jsx)(Component, _extends({
47
- theme: {
48
- euiTheme: euiTheme,
49
- colorMode: colorMode,
50
- modifications: modifications
51
- },
46
+ theme: theme,
52
47
  ref: ref
53
48
  }, props));
54
49
  };
@@ -11,7 +11,6 @@ var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value"
11
11
  */
12
12
  import React from 'react';
13
13
  import classNames from 'classnames';
14
- // eslint-disable-line import/named
15
14
  import { useEuiI18n } from '../../../i18n';
16
15
  import { EuiPopover } from '../../../popover';
17
16
  import { useFormatTimeString } from '../pretty_duration';
@@ -30,7 +30,7 @@ export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
30
30
 
31
31
  var theme = useEuiTheme();
32
32
  var styles = euiDescriptionListTitleStyles(theme);
33
- var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
33
+ var conditionalStyles = compressed && textStyle !== 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
34
34
 
35
35
  switch (type) {
36
36
  case 'inline':
@@ -21,8 +21,7 @@ var horizontalPositionToClassNameMap = {
21
21
  };
22
22
 
23
23
  /**
24
- * **DEPRECATED**
25
- * Use EuiPageSection instead
24
+ * @deprecated Use EuiPageSection instead
26
25
  */
27
26
  export var EuiPageContent_Deprecated = function EuiPageContent_Deprecated(_ref) {
28
27
  var verticalPosition = _ref.verticalPosition,
@@ -24,8 +24,7 @@ var paddingSizeToClassNameMap = {
24
24
  export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
25
25
 
26
26
  /**
27
- * **DEPRECATED**
28
- * Use EuiPageSection instead
27
+ * @deprecated Use EuiPageSection instead
29
28
  */
30
29
  export var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
31
30
  var children = _ref.children,
@@ -14,8 +14,7 @@ import classNames from 'classnames';
14
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
15
 
16
16
  /**
17
- * **DEPRECATED**
18
- * Use EuiPageHeader instead
17
+ * @deprecated Use EuiPageHeader instead
19
18
  */
20
19
  export var EuiPageContentHeader_Deprecated = function EuiPageContentHeader_Deprecated(_ref) {
21
20
  var children = _ref.children,
@@ -14,8 +14,7 @@ import classNames from 'classnames';
14
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
15
 
16
16
  /**
17
- * **DEPRECATED**
18
- * Use EuiPageHeader instead
17
+ * @deprecated Use EuiPageHeader instead
19
18
  */
20
19
  export var EuiPageContentHeaderSection_Deprecated = function EuiPageContentHeaderSection_Deprecated(_ref) {
21
20
  var children = _ref.children,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps"];
3
+ var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps", "component"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -29,6 +29,8 @@ export var EuiPageSection = function EuiPageSection(_ref) {
29
29
  _ref$grow = _ref.grow,
30
30
  grow = _ref$grow === void 0 ? false : _ref$grow,
31
31
  contentProps = _ref.contentProps,
32
+ _ref$component = _ref.component,
33
+ Component = _ref$component === void 0 ? 'section' : _ref$component,
32
34
  rest = _objectWithoutProperties(_ref, _excluded);
33
35
 
34
36
  // Set max-width as a style prop
@@ -41,7 +43,7 @@ export var EuiPageSection = function EuiPageSection(_ref) {
41
43
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
42
44
  var contentStyles = euiPageSectionContentStyles();
43
45
  var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
44
- return ___EmotionJSX("div", _extends({
46
+ return ___EmotionJSX(Component, _extends({
45
47
  css: cssStyles
46
48
  }, rest), ___EmotionJSX("div", _extends({
47
49
  css: cssContentStyles
@@ -22,8 +22,7 @@ var paddingSizeToClassNameMap = {
22
22
  export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
23
23
 
24
24
  /**
25
- * **DEPRECATED**
26
- * Use the new EuiPageSidebar instead
25
+ * @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
27
26
  */
28
27
  export var EuiPageSideBar_Deprecated = function EuiPageSideBar_Deprecated(_ref) {
29
28
  var children = _ref.children,
@@ -46,13 +46,17 @@ export var EuiPageSidebar = function EuiPageSidebar(_ref) {
46
46
  setInlineStyles = _useState2[1];
47
47
 
48
48
  useEffect(function () {
49
+ var updatedStyles = _objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth));
50
+
49
51
  if (sticky) {
50
52
  var _document$body$datase;
51
53
 
52
54
  var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
53
55
  var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
54
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth)), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)"))));
56
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)")));
55
57
  }
58
+
59
+ setInlineStyles(updatedStyles);
56
60
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
57
61
  return ___EmotionJSX("div", _extends({
58
62
  className: className,
@@ -32,7 +32,9 @@ export var TEMPLATES = ['default', 'centeredBody', 'centeredContent', 'empty'];
32
32
  /**
33
33
  * This component has been deprecated in favor of the new
34
34
  * namespaced version. You can still import this component
35
- * for a period of time by importing `as EuiPageTemplate`.
35
+ * until August 2023 by importing `as EuiPageTemplate`.
36
+ *
37
+ * @deprecated use EuiPageTemplate from page_template/page_template instead
36
38
  */
37
39
  export var EuiPageTemplate_Deprecated = function EuiPageTemplate_Deprecated(_ref) {
38
40
  var _pageBodyProps2;
@@ -6,18 +6,12 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import React from 'react';
9
- import createCache from '@emotion/cache';
10
9
  import { CacheProvider } from '@emotion/react';
11
10
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
- var defaultCache = createCache({
13
- key: 'css'
14
- });
15
- defaultCache.compat = true;
16
11
  export var EuiCacheProvider = function EuiCacheProvider(_ref) {
17
- var _ref$cache = _ref.cache,
18
- cache = _ref$cache === void 0 ? defaultCache : _ref$cache,
12
+ var cache = _ref.cache,
19
13
  children = _ref.children;
20
- return ___EmotionJSX(CacheProvider, {
14
+ return children && cache ? ___EmotionJSX(CacheProvider, {
21
15
  value: cache
22
- }, children);
16
+ }, children) : ___EmotionJSX(React.Fragment, null, children);
23
17
  };
@@ -6,6 +6,7 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import React from 'react';
9
+ import createCache from '@emotion/cache';
9
10
  import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
10
11
  import { EuiUtilityClasses } from '../../global_styling/utility/utility';
11
12
  import { EuiThemeProvider, CurrentEuiBreakpointProvider } from '../../services';
@@ -17,8 +18,15 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
17
18
  return obj.hasOwnProperty('key');
18
19
  };
19
20
 
21
+ var fallbackCache = createCache({
22
+ key: 'css'
23
+ });
24
+ fallbackCache.compat = true;
20
25
  export var EuiProvider = function EuiProvider(_ref) {
21
- var cache = _ref.cache,
26
+ var _defaultCache;
27
+
28
+ var _ref$cache = _ref.cache,
29
+ cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
22
30
  _ref$theme = _ref.theme,
23
31
  theme = _ref$theme === void 0 ? EuiThemeAmsterdam : _ref$theme,
24
32
  _ref$globalStyles = _ref.globalStyles,
@@ -34,16 +42,31 @@ export var EuiProvider = function EuiProvider(_ref) {
34
42
 
35
43
  if (cache) {
36
44
  if (isEmotionCacheObject(cache)) {
45
+ cache.compat = true;
37
46
  defaultCache = cache;
38
47
  } else {
48
+ if (cache.default) {
49
+ cache.default.compat = true;
50
+ }
51
+
39
52
  defaultCache = cache.default;
53
+
54
+ if (cache.global) {
55
+ cache.global.compat = true;
56
+ }
57
+
40
58
  globalCache = cache.global;
59
+
60
+ if (cache.utility) {
61
+ cache.utility.compat = true;
62
+ }
63
+
41
64
  utilityCache = cache.utility;
42
65
  }
43
66
  }
44
67
 
45
68
  return ___EmotionJSX(EuiCacheProvider, {
46
- cache: defaultCache
69
+ cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
47
70
  }, ___EmotionJSX(EuiThemeProvider, {
48
71
  theme: theme !== null && theme !== void 0 ? theme : undefined,
49
72
  colorMode: colorMode,
@@ -7,18 +7,21 @@ import _extends from "@babel/runtime/helpers/extends";
7
7
  * in compliance with, at your election, the Elastic License 2.0 or the Server
8
8
  * Side Public License, v 1.
9
9
  */
10
- import React, { forwardRef, useContext } from 'react';
10
+ import React, { forwardRef, useContext, useMemo } from 'react';
11
11
  import { EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
12
12
  import { jsx as ___EmotionJSX } from "@emotion/react";
13
13
  export var useEuiTheme = function useEuiTheme() {
14
14
  var theme = useContext(EuiThemeContext);
15
15
  var colorMode = useContext(EuiColorModeContext);
16
16
  var modifications = useContext(EuiModificationsContext);
17
- return {
18
- euiTheme: theme,
19
- colorMode: colorMode,
20
- modifications: modifications
21
- };
17
+ var assembledTheme = useMemo(function () {
18
+ return {
19
+ euiTheme: theme,
20
+ colorMode: colorMode,
21
+ modifications: modifications
22
+ };
23
+ }, [theme, colorMode, modifications]);
24
+ return assembledTheme;
22
25
  };
23
26
  // Provide the component props interface as the generic to allow the docs props table to populate.
24
27
  // e.g., `const EuiComponent = withEuiTheme<EuiComponentProps>(_EuiComponent)`
@@ -26,17 +29,9 @@ export var withEuiTheme = function withEuiTheme(Component) {
26
29
  var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
27
30
 
28
31
  var Render = function Render(props, ref) {
29
- var _useEuiTheme = useEuiTheme(),
30
- euiTheme = _useEuiTheme.euiTheme,
31
- colorMode = _useEuiTheme.colorMode,
32
- modifications = _useEuiTheme.modifications;
33
-
32
+ var theme = useEuiTheme();
34
33
  return ___EmotionJSX(Component, _extends({
35
- theme: {
36
- euiTheme: euiTheme,
37
- colorMode: colorMode,
38
- modifications: modifications
39
- },
34
+ theme: theme,
40
35
  ref: ref
41
36
  }, props));
42
37
  };
@@ -46,7 +46,7 @@ var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
46
46
 
47
47
  var theme = (0, _services.useEuiTheme)();
48
48
  var styles = (0, _description_list_title.euiDescriptionListTitleStyles)(theme);
49
- var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
49
+ var conditionalStyles = compressed && textStyle !== 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
50
50
 
51
51
  switch (type) {
52
52
  case 'inline':
@@ -28,8 +28,7 @@ var horizontalPositionToClassNameMap = {
28
28
  };
29
29
 
30
30
  /**
31
- * **DEPRECATED**
32
- * Use EuiPageSection instead
31
+ * @deprecated Use EuiPageSection instead
33
32
  */
34
33
  var EuiPageContent_Deprecated = function EuiPageContent_Deprecated(_ref) {
35
34
  var verticalPosition = _ref.verticalPosition,
@@ -34,8 +34,7 @@ var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
34
34
  exports.PADDING_SIZES = PADDING_SIZES;
35
35
 
36
36
  /**
37
- * **DEPRECATED**
38
- * Use EuiPageSection instead
37
+ * @deprecated Use EuiPageSection instead
39
38
  */
40
39
  var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
41
40
  var children = _ref.children,
@@ -20,8 +20,7 @@ var _react2 = require("@emotion/react");
20
20
  var _excluded = ["children", "className", "responsive"];
21
21
 
22
22
  /**
23
- * **DEPRECATED**
24
- * Use EuiPageHeader instead
23
+ * @deprecated Use EuiPageHeader instead
25
24
  */
26
25
  var EuiPageContentHeader_Deprecated = function EuiPageContentHeader_Deprecated(_ref) {
27
26
  var children = _ref.children,
@@ -20,8 +20,7 @@ var _react2 = require("@emotion/react");
20
20
  var _excluded = ["children", "className"];
21
21
 
22
22
  /**
23
- * **DEPRECATED**
24
- * Use EuiPageHeader instead
23
+ * @deprecated Use EuiPageHeader instead
25
24
  */
26
25
  var EuiPageContentHeaderSection_Deprecated = function EuiPageContentHeaderSection_Deprecated(_ref) {
27
26
  var children = _ref.children,
@@ -23,7 +23,7 @@ var _global_styling = require("../../../global_styling");
23
23
 
24
24
  var _react2 = require("@emotion/react");
25
25
 
26
- var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps"];
26
+ var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps", "component"];
27
27
 
28
28
  var EuiPageSection = function EuiPageSection(_ref) {
29
29
  var children = _ref.children,
@@ -39,6 +39,8 @@ var EuiPageSection = function EuiPageSection(_ref) {
39
39
  _ref$grow = _ref.grow,
40
40
  grow = _ref$grow === void 0 ? false : _ref$grow,
41
41
  contentProps = _ref.contentProps,
42
+ _ref$component = _ref.component,
43
+ Component = _ref$component === void 0 ? 'section' : _ref$component,
42
44
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
43
45
  // Set max-width as a style prop
44
46
  var widthStyles = (0, _restrict_width.setStyleForRestrictedPageWidth)(restrictWidth, contentProps === null || contentProps === void 0 ? void 0 : contentProps.style);
@@ -50,7 +52,7 @@ var EuiPageSection = function EuiPageSection(_ref) {
50
52
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
51
53
  var contentStyles = (0, _page_section.euiPageSectionContentStyles)();
52
54
  var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
53
- return (0, _react2.jsx)("div", (0, _extends2.default)({
55
+ return (0, _react2.jsx)(Component, (0, _extends2.default)({
54
56
  css: cssStyles
55
57
  }, rest), (0, _react2.jsx)("div", (0, _extends2.default)({
56
58
  css: cssContentStyles
@@ -30,8 +30,7 @@ var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
30
30
  exports.PADDING_SIZES = PADDING_SIZES;
31
31
 
32
32
  /**
33
- * **DEPRECATED**
34
- * Use the new EuiPageSidebar instead
33
+ * @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
35
34
  */
36
35
  var EuiPageSideBar_Deprecated = function EuiPageSideBar_Deprecated(_ref) {
37
36
  var children = _ref.children,
@@ -63,13 +63,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
63
63
  setInlineStyles = _useState2[1];
64
64
 
65
65
  (0, _react.useEffect)(function () {
66
+ var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
67
+
66
68
  if (sticky) {
67
69
  var _document$body$datase;
68
70
 
69
71
  var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
70
72
  var offset = (0, _typeof2.default)(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
71
- setInlineStyles(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth)), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)"))));
73
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
72
74
  }
75
+
76
+ setInlineStyles(updatedStyles);
73
77
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
74
78
  return (0, _react2.jsx)("div", (0, _extends2.default)({
75
79
  className: className,
@@ -49,7 +49,9 @@ exports.TEMPLATES = TEMPLATES;
49
49
  /**
50
50
  * This component has been deprecated in favor of the new
51
51
  * namespaced version. You can still import this component
52
- * for a period of time by importing `as EuiPageTemplate`.
52
+ * until August 2023 by importing `as EuiPageTemplate`.
53
+ *
54
+ * @deprecated use EuiPageTemplate from page_template/page_template instead
53
55
  */
54
56
  var EuiPageTemplate_Deprecated = function EuiPageTemplate_Deprecated(_ref) {
55
57
  var _pageBodyProps2;
@@ -9,8 +9,6 @@ exports.EuiCacheProvider = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
- var _cache = _interopRequireDefault(require("@emotion/cache"));
13
-
14
12
  var _react2 = require("@emotion/react");
15
13
 
16
14
  /*
@@ -20,18 +18,12 @@ var _react2 = require("@emotion/react");
20
18
  * in compliance with, at your election, the Elastic License 2.0 or the Server
21
19
  * Side Public License, v 1.
22
20
  */
23
- var defaultCache = (0, _cache.default)({
24
- key: 'css'
25
- });
26
- defaultCache.compat = true;
27
-
28
21
  var EuiCacheProvider = function EuiCacheProvider(_ref) {
29
- var _ref$cache = _ref.cache,
30
- cache = _ref$cache === void 0 ? defaultCache : _ref$cache,
22
+ var cache = _ref.cache,
31
23
  children = _ref.children;
32
- return (0, _react2.jsx)(_react2.CacheProvider, {
24
+ return children && cache ? (0, _react2.jsx)(_react2.CacheProvider, {
33
25
  value: cache
34
- }, children);
26
+ }, children) : (0, _react2.jsx)(_react.default.Fragment, null, children);
35
27
  };
36
28
 
37
29
  exports.EuiCacheProvider = EuiCacheProvider;
@@ -9,6 +9,8 @@ exports.EuiProvider = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
12
+ var _cache = _interopRequireDefault(require("@emotion/cache"));
13
+
12
14
  var _global_styles = require("../../global_styling/reset/global_styles");
13
15
 
14
16
  var _utility = require("../../global_styling/utility/utility");
@@ -17,7 +19,7 @@ var _services = require("../../services");
17
19
 
18
20
  var _themes = require("../../themes");
19
21
 
20
- var _cache = require("./cache");
22
+ var _cache2 = require("./cache");
21
23
 
22
24
  var _react2 = require("@emotion/react");
23
25
 
@@ -32,8 +34,16 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
32
34
  return obj.hasOwnProperty('key');
33
35
  };
34
36
 
37
+ var fallbackCache = (0, _cache.default)({
38
+ key: 'css'
39
+ });
40
+ fallbackCache.compat = true;
41
+
35
42
  var EuiProvider = function EuiProvider(_ref) {
36
- var cache = _ref.cache,
43
+ var _defaultCache;
44
+
45
+ var _ref$cache = _ref.cache,
46
+ cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
37
47
  _ref$theme = _ref.theme,
38
48
  theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
39
49
  _ref$globalStyles = _ref.globalStyles,
@@ -49,24 +59,39 @@ var EuiProvider = function EuiProvider(_ref) {
49
59
 
50
60
  if (cache) {
51
61
  if (isEmotionCacheObject(cache)) {
62
+ cache.compat = true;
52
63
  defaultCache = cache;
53
64
  } else {
65
+ if (cache.default) {
66
+ cache.default.compat = true;
67
+ }
68
+
54
69
  defaultCache = cache.default;
70
+
71
+ if (cache.global) {
72
+ cache.global.compat = true;
73
+ }
74
+
55
75
  globalCache = cache.global;
76
+
77
+ if (cache.utility) {
78
+ cache.utility.compat = true;
79
+ }
80
+
56
81
  utilityCache = cache.utility;
57
82
  }
58
83
  }
59
84
 
60
- return (0, _react2.jsx)(_cache.EuiCacheProvider, {
61
- cache: defaultCache
85
+ return (0, _react2.jsx)(_cache2.EuiCacheProvider, {
86
+ cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
62
87
  }, (0, _react2.jsx)(_services.EuiThemeProvider, {
63
88
  theme: theme !== null && theme !== void 0 ? theme : undefined,
64
89
  colorMode: colorMode,
65
90
  modify: modify
66
- }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache.EuiCacheProvider, {
91
+ }, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache2.EuiCacheProvider, {
67
92
  cache: globalCache,
68
93
  children: Globals && (0, _react2.jsx)(Globals, null)
69
- }), (0, _react2.jsx)(_cache.EuiCacheProvider, {
94
+ }), (0, _react2.jsx)(_cache2.EuiCacheProvider, {
70
95
  cache: utilityCache,
71
96
  children: Utilities && (0, _react2.jsx)(Utilities, null)
72
97
  })), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));