@elastic/eui 88.1.0 → 88.2.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 (111) hide show
  1. package/dist/eui_charts_theme.js.map +1 -1
  2. package/dist/eui_theme_dark.css +9 -36
  3. package/dist/eui_theme_dark.min.css +1 -1
  4. package/dist/eui_theme_light.css +9 -36
  5. package/dist/eui_theme_light.min.css +1 -1
  6. package/es/components/accordion/accordion.js +34 -9
  7. package/es/components/accordion/accordion.styles.js +29 -9
  8. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
  9. package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +2 -25
  10. package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
  11. package/es/components/flyout/flyout.styles.js +1 -1
  12. package/es/components/header/header.js +120 -25
  13. package/es/components/header/header.styles.js +1 -1
  14. package/es/components/index.js +1 -0
  15. package/es/components/overlay_mask/overlay_mask.styles.js +1 -1
  16. package/es/components/page/page_sidebar/page_sidebar.js +2 -4
  17. package/es/components/page_template/page_template.js +4 -31
  18. package/es/components/text_truncate/index.js +10 -0
  19. package/es/components/text_truncate/text_truncate.js +232 -0
  20. package/es/components/text_truncate/text_truncate.styles.js +49 -0
  21. package/es/components/text_truncate/utils.js +348 -0
  22. package/es/services/theme/context.js +3 -1
  23. package/es/services/theme/hooks.js +19 -1
  24. package/es/services/theme/index.js +1 -1
  25. package/es/services/theme/provider.js +37 -8
  26. package/eui.d.ts +246 -17
  27. package/i18ntokens.json +8 -8
  28. package/lib/components/accordion/accordion.js +33 -8
  29. package/lib/components/accordion/accordion.styles.js +31 -10
  30. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
  31. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +2 -25
  32. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
  33. package/lib/components/flyout/flyout.styles.js +1 -1
  34. package/lib/components/header/header.js +120 -23
  35. package/lib/components/header/header.styles.js +1 -1
  36. package/lib/components/index.js +11 -0
  37. package/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
  38. package/lib/components/page/page_sidebar/page_sidebar.js +2 -4
  39. package/lib/components/page_template/page_template.js +2 -29
  40. package/lib/components/text_truncate/index.js +25 -0
  41. package/lib/components/text_truncate/text_truncate.js +242 -0
  42. package/lib/components/text_truncate/text_truncate.styles.js +54 -0
  43. package/lib/components/text_truncate/utils.js +352 -0
  44. package/lib/services/theme/context.js +3 -1
  45. package/lib/services/theme/hooks.js +21 -2
  46. package/lib/services/theme/index.js +6 -0
  47. package/lib/services/theme/provider.js +62 -35
  48. package/optimize/es/components/accordion/accordion.js +19 -7
  49. package/optimize/es/components/accordion/accordion.styles.js +29 -9
  50. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +2 -25
  51. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
  52. package/optimize/es/components/flyout/flyout.styles.js +1 -1
  53. package/optimize/es/components/header/header.js +75 -25
  54. package/optimize/es/components/header/header.styles.js +1 -1
  55. package/optimize/es/components/index.js +1 -0
  56. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +1 -1
  57. package/optimize/es/components/page/page_sidebar/page_sidebar.js +2 -4
  58. package/optimize/es/components/page_template/page_template.js +4 -26
  59. package/optimize/es/components/text_truncate/index.js +10 -0
  60. package/optimize/es/components/text_truncate/text_truncate.js +148 -0
  61. package/optimize/es/components/text_truncate/text_truncate.styles.js +49 -0
  62. package/optimize/es/components/text_truncate/utils.js +337 -0
  63. package/optimize/es/services/theme/context.js +3 -1
  64. package/optimize/es/services/theme/hooks.js +19 -1
  65. package/optimize/es/services/theme/index.js +1 -1
  66. package/optimize/es/services/theme/provider.js +37 -8
  67. package/optimize/lib/components/accordion/accordion.js +18 -6
  68. package/optimize/lib/components/accordion/accordion.styles.js +31 -10
  69. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +2 -25
  70. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
  71. package/optimize/lib/components/flyout/flyout.styles.js +1 -1
  72. package/optimize/lib/components/header/header.js +77 -24
  73. package/optimize/lib/components/header/header.styles.js +1 -1
  74. package/optimize/lib/components/index.js +11 -0
  75. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +1 -1
  76. package/optimize/lib/components/page/page_sidebar/page_sidebar.js +2 -4
  77. package/optimize/lib/components/page_template/page_template.js +2 -24
  78. package/optimize/lib/components/text_truncate/index.js +25 -0
  79. package/optimize/lib/components/text_truncate/text_truncate.js +158 -0
  80. package/optimize/lib/components/text_truncate/text_truncate.styles.js +54 -0
  81. package/optimize/lib/components/text_truncate/utils.js +342 -0
  82. package/optimize/lib/services/theme/context.js +3 -1
  83. package/optimize/lib/services/theme/hooks.js +21 -2
  84. package/optimize/lib/services/theme/index.js +6 -0
  85. package/optimize/lib/services/theme/provider.js +62 -35
  86. package/package.json +1 -1
  87. package/src/components/datagrid/_data_grid.scss +13 -2
  88. package/src/components/index.scss +0 -1
  89. package/src/global_styling/mixins/_header.scss +2 -0
  90. package/test-env/components/accordion/accordion.js +28 -8
  91. package/test-env/components/accordion/accordion.styles.js +31 -10
  92. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +10 -2
  93. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +2 -25
  94. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +10 -1
  95. package/test-env/components/flyout/flyout.styles.js +1 -1
  96. package/test-env/components/header/header.js +113 -23
  97. package/test-env/components/header/header.styles.js +1 -1
  98. package/test-env/components/index.js +11 -0
  99. package/test-env/components/overlay_mask/overlay_mask.styles.js +1 -1
  100. package/test-env/components/page/page_sidebar/page_sidebar.js +2 -4
  101. package/test-env/components/page_template/page_template.js +2 -24
  102. package/test-env/components/text_truncate/index.js +25 -0
  103. package/test-env/components/text_truncate/text_truncate.js +236 -0
  104. package/test-env/components/text_truncate/text_truncate.styles.js +54 -0
  105. package/test-env/components/text_truncate/utils.js +342 -0
  106. package/test-env/services/theme/context.js +3 -1
  107. package/test-env/services/theme/hooks.js +21 -2
  108. package/test-env/services/theme/index.js +6 -0
  109. package/test-env/services/theme/provider.js +62 -35
  110. package/src/components/accordion/_accordion_form.scss +0 -40
  111. package/src/components/accordion/_index.scss +0 -1
@@ -10,14 +10,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
10
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
- var _react = _interopRequireWildcard(require("react"));
13
+ var _react = require("@emotion/react");
14
+ var _react2 = _interopRequireWildcard(require("react"));
14
15
  var _classnames = _interopRequireDefault(require("classnames"));
15
- var _css = require("@emotion/css");
16
+ var _css2 = require("@emotion/css");
16
17
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
18
+ var _emotion = require("../emotion");
17
19
  var _context = require("./context");
18
- var _emotion = require("./emotion");
20
+ var _emotion2 = require("./emotion");
19
21
  var _utils = require("./utils");
20
- var _react2 = require("@emotion/react");
21
22
  var _excluded = ["cloneElement", "className"];
22
23
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -35,35 +36,37 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
35
36
  _modifications = _ref.modify,
36
37
  children = _ref.children,
37
38
  wrapperProps = _ref.wrapperProps;
38
- var _useContext = (0, _react.useContext)(_context.EuiNestedThemeContext),
39
+ var _useContext = (0, _react2.useContext)(_context.EuiNestedThemeContext),
39
40
  isGlobalTheme = _useContext.isGlobalTheme,
40
- bodyColor = _useContext.bodyColor;
41
- var parentSystem = (0, _react.useContext)(_context.EuiSystemContext);
42
- var parentModifications = (0, _react.useContext)(_context.EuiModificationsContext);
43
- var parentColorMode = (0, _react.useContext)(_context.EuiColorModeContext);
44
- var parentTheme = (0, _react.useContext)(_context.EuiThemeContext);
45
- var _useState = (0, _react.useState)(_system || parentSystem),
41
+ bodyColor = _useContext.bodyColor,
42
+ globalCSSVariables = _useContext.globalCSSVariables,
43
+ setGlobalCSSVariables = _useContext.setGlobalCSSVariables;
44
+ var parentSystem = (0, _react2.useContext)(_context.EuiSystemContext);
45
+ var parentModifications = (0, _react2.useContext)(_context.EuiModificationsContext);
46
+ var parentColorMode = (0, _react2.useContext)(_context.EuiColorModeContext);
47
+ var parentTheme = (0, _react2.useContext)(_context.EuiThemeContext);
48
+ var _useState = (0, _react2.useState)(_system || parentSystem),
46
49
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
47
50
  system = _useState2[0],
48
51
  setSystem = _useState2[1];
49
- var prevSystemKey = (0, _react.useRef)(system.key);
50
- var _useState3 = (0, _react.useState)((0, _utils.mergeDeep)(parentModifications, _modifications)),
52
+ var prevSystemKey = (0, _react2.useRef)(system.key);
53
+ var _useState3 = (0, _react2.useState)((0, _utils.mergeDeep)(parentModifications, _modifications)),
51
54
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
52
55
  modifications = _useState4[0],
53
56
  setModifications = _useState4[1];
54
- var prevModifications = (0, _react.useRef)(modifications);
55
- var _useState5 = (0, _react.useState)((0, _utils.getColorMode)(_colorMode, parentColorMode)),
57
+ var prevModifications = (0, _react2.useRef)(modifications);
58
+ var _useState5 = (0, _react2.useState)((0, _utils.getColorMode)(_colorMode, parentColorMode)),
56
59
  _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
57
60
  colorMode = _useState6[0],
58
61
  setColorMode = _useState6[1];
59
- var prevColorMode = (0, _react.useRef)(colorMode);
60
- var isParentTheme = (0, _react.useRef)(prevSystemKey.current === parentSystem.key && colorMode === parentColorMode && (0, _isEqual.default)(parentModifications, modifications));
61
- var _useState7 = (0, _react.useState)(isParentTheme.current && Object.keys(parentTheme).length ? _objectSpread({}, parentTheme) // Intentionally create a new object to break referential equality
62
+ var prevColorMode = (0, _react2.useRef)(colorMode);
63
+ var isParentTheme = (0, _react2.useRef)(prevSystemKey.current === parentSystem.key && colorMode === parentColorMode && (0, _isEqual.default)(parentModifications, modifications));
64
+ var _useState7 = (0, _react2.useState)(isParentTheme.current && Object.keys(parentTheme).length ? _objectSpread({}, parentTheme) // Intentionally create a new object to break referential equality
62
65
  : (0, _utils.getComputed)(system, (0, _utils.buildTheme)(modifications, "_".concat(system.key)), colorMode)),
63
66
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
64
67
  theme = _useState8[0],
65
68
  setTheme = _useState8[1];
66
- (0, _react.useEffect)(function () {
69
+ (0, _react2.useEffect)(function () {
67
70
  var newSystem = _system || parentSystem;
68
71
  if (prevSystemKey.current !== newSystem.key) {
69
72
  setSystem(newSystem);
@@ -71,7 +74,7 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
71
74
  isParentTheme.current = false;
72
75
  }
73
76
  }, [_system, parentSystem]);
74
- (0, _react.useEffect)(function () {
77
+ (0, _react2.useEffect)(function () {
75
78
  var newModifications = (0, _utils.mergeDeep)(parentModifications, _modifications);
76
79
  if (!(0, _isEqual.default)(prevModifications.current, newModifications)) {
77
80
  setModifications(newModifications);
@@ -79,7 +82,7 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
79
82
  isParentTheme.current = false;
80
83
  }
81
84
  }, [_modifications, parentModifications]);
82
- (0, _react.useEffect)(function () {
85
+ (0, _react2.useEffect)(function () {
83
86
  var newColorMode = (0, _utils.getColorMode)(_colorMode, parentColorMode);
84
87
  if (!(0, _isEqual.default)(newColorMode, prevColorMode.current)) {
85
88
  setColorMode(newColorMode);
@@ -87,21 +90,34 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
87
90
  isParentTheme.current = false;
88
91
  }
89
92
  }, [_colorMode, parentColorMode]);
90
- (0, _react.useEffect)(function () {
93
+ (0, _react2.useEffect)(function () {
91
94
  if (!isParentTheme.current) {
92
95
  setTheme((0, _utils.getComputed)(system, (0, _utils.buildTheme)(modifications, "_".concat(system.key)), colorMode));
93
96
  }
94
97
  }, [colorMode, system, modifications]);
95
- var nestedThemeContext = (0, _react.useMemo)(function () {
98
+ var _useState9 = (0, _react2.useState)(),
99
+ _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
100
+ themeCSSVariables = _useState10[0],
101
+ _setThemeCSSVariables = _useState10[1];
102
+ var setThemeCSSVariables = (0, _react2.useCallback)(function (variables) {
103
+ return _setThemeCSSVariables(function (previous) {
104
+ return _objectSpread(_objectSpread({}, previous), variables);
105
+ });
106
+ }, []);
107
+ var nestedThemeContext = (0, _react2.useMemo)(function () {
96
108
  return {
97
109
  isGlobalTheme: false,
98
110
  // The theme that determines the global body styles
99
111
  bodyColor: isGlobalTheme ? theme.colors.text : bodyColor,
100
112
  hasDifferentColorFromGlobalTheme: isGlobalTheme ? false : bodyColor !== theme.colors.text,
101
- colorClassName: /*#__PURE__*/(0, _css.css)("label:euiColorMode-", _colorMode, ";color:", theme.colors.text, ";;label:colorClassName;")
113
+ colorClassName: /*#__PURE__*/(0, _css2.css)("label:euiColorMode-", _colorMode, ";color:", theme.colors.text, ";;label:colorClassName;"),
114
+ setGlobalCSSVariables: isGlobalTheme ? setThemeCSSVariables : setGlobalCSSVariables,
115
+ globalCSSVariables: isGlobalTheme ? themeCSSVariables : globalCSSVariables,
116
+ setNearestThemeCSSVariables: setThemeCSSVariables,
117
+ themeCSSVariables: themeCSSVariables
102
118
  };
103
- }, [theme, isGlobalTheme, bodyColor, _colorMode]);
104
- var renderedChildren = (0, _react.useMemo)(function () {
119
+ }, [theme, isGlobalTheme, bodyColor, _colorMode, setGlobalCSSVariables, globalCSSVariables, setThemeCSSVariables, themeCSSVariables]);
120
+ var renderedChildren = (0, _react2.useMemo)(function () {
105
121
  if (isGlobalTheme) {
106
122
  return children; // No wrapper
107
123
  }
@@ -113,26 +129,37 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
113
129
  var props = _objectSpread(_objectSpread({}, rest), {}, {
114
130
  className: (0, _classnames.default)(className, nestedThemeContext.colorClassName)
115
131
  });
132
+ // Condition avoids rendering an empty Emotion selector if no
133
+ // theme-specific CSS variables have been set by child components
134
+ if (themeCSSVariables) {
135
+ props.css = _objectSpread({
136
+ label: 'euiCSSVariables'
137
+ }, themeCSSVariables);
138
+ }
116
139
  if (cloneElement) {
117
- return /*#__PURE__*/_react.default.cloneElement(children, _objectSpread(_objectSpread({}, props), {}, {
140
+ return (0, _emotion.cloneElementWithCss)(children, _objectSpread(_objectSpread({}, props), {}, {
118
141
  className: (0, _classnames.default)(children.props.className, props.className)
119
142
  }));
120
143
  } else {
121
- return (0, _react2.jsx)("span", (0, _extends2.default)({}, props, {
144
+ return (0, _react.jsx)("span", (0, _extends2.default)({}, props, {
122
145
  className: (0, _classnames.default)('euiThemeProvider', props.className)
123
146
  }), children);
124
147
  }
125
- }, [isGlobalTheme, nestedThemeContext, wrapperProps, children]);
126
- return (0, _react2.jsx)(_context.EuiColorModeContext.Provider, {
148
+ }, [isGlobalTheme, themeCSSVariables, nestedThemeContext, wrapperProps, children]);
149
+ return (0, _react.jsx)(_react2.default.Fragment, null, isGlobalTheme && themeCSSVariables && (0, _react.jsx)(_react.Global, {
150
+ styles: /*#__PURE__*/(0, _react.css)({
151
+ ':root': themeCSSVariables
152
+ }, ";label:EuiThemeProvider;")
153
+ }), (0, _react.jsx)(_context.EuiColorModeContext.Provider, {
127
154
  value: colorMode
128
- }, (0, _react2.jsx)(_context.EuiSystemContext.Provider, {
155
+ }, (0, _react.jsx)(_context.EuiSystemContext.Provider, {
129
156
  value: system
130
- }, (0, _react2.jsx)(_context.EuiModificationsContext.Provider, {
157
+ }, (0, _react.jsx)(_context.EuiModificationsContext.Provider, {
131
158
  value: modifications
132
- }, (0, _react2.jsx)(_context.EuiThemeContext.Provider, {
159
+ }, (0, _react.jsx)(_context.EuiThemeContext.Provider, {
133
160
  value: theme
134
- }, (0, _react2.jsx)(_context.EuiNestedThemeContext.Provider, {
161
+ }, (0, _react.jsx)(_context.EuiNestedThemeContext.Provider, {
135
162
  value: nestedThemeContext
136
- }, (0, _react2.jsx)(_emotion.EuiEmotionThemeProvider, null, renderedChildren))))));
163
+ }, (0, _react.jsx)(_emotion2.EuiEmotionThemeProvider, null, renderedChildren)))))));
137
164
  };
138
165
  exports.EuiThemeProvider = EuiThemeProvider;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "88.1.0",
4
+ "version": "88.2.0",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -49,12 +49,23 @@
49
49
  }
50
50
 
51
51
  // This is used to remove extra scrollbars on the body when fullscreen is enabled
52
+ // and tweak any components that account for fixed headers
52
53
  .euiDataGrid__restrictBody {
53
54
  height: 100vh;
54
55
  overflow: hidden;
55
56
 
56
- .euiHeader {
57
- z-index: $euiZHeaderBelowDataGrid;
57
+ .euiHeader[data-fixed-header] {
58
+ // !important needed to override header inline styles
59
+ z-index: $euiZHeaderBelowDataGrid !important; // stylelint-disable-line declaration-no-important
60
+ }
61
+
62
+ .euiOverlayMask[data-relative-to-header='below'] {
63
+ top: 0;
64
+ }
65
+
66
+ .euiFlyout {
67
+ top: 0;
68
+ height: 100%;
58
69
  }
59
70
  }
60
71
 
@@ -1,6 +1,5 @@
1
1
  // Components
2
2
 
3
- @import 'accordion/index';
4
3
  @import 'color_picker/index';
5
4
  @import 'combo_box/index';
6
5
  @import 'context_menu/index';
@@ -1,6 +1,8 @@
1
1
  @import '../variables/header';
2
2
 
3
3
  @mixin euiHeaderAffordForFixed($headerHeight: $euiHeaderHeightCompensation) {
4
+ @warn 'This mixin will shortly be deprecated. Use the CSS variable var(--euiFixedHeadersOffset) instead, which updates dynamically based on the number of fixed headers on the page.';
5
+
4
6
  // The `@at-root #{&}` allows for grouping alongside another specific body class.
5
7
  // When not applied inside of another selector, it simply renders with the single class
6
8
  @at-root #{&}.euiBody--headerIsFixed {
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.PADDING_SIZES = exports.EuiAccordionClass = exports.EuiAccordion = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
13
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -28,7 +29,8 @@ var _button = require("../button");
28
29
  var _accordion = require("./accordion.styles");
29
30
  var _global_styling = require("../../global_styling");
30
31
  var _react2 = require("@emotion/react");
31
- var _excluded = ["children", "buttonContent", "className", "id", "element", "buttonClassName", "buttonContentClassName", "extraAction", "paddingSize", "initialIsOpen", "arrowDisplay", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "buttonProps", "buttonElement", "arrowProps", "theme"];
32
+ var _excluded = ["children", "buttonContent", "className", "id", "element", "buttonClassName", "buttonContentClassName", "extraAction", "paddingSize", "borders", "initialIsOpen", "arrowDisplay", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "buttonProps", "buttonElement", "arrowProps", "theme"],
33
+ _excluded2 = ["paddingSize", "className", "css"];
32
34
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
35
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
34
36
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
@@ -166,18 +168,24 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
166
168
  buttonContentClassName = _this$props3.buttonContentClassName,
167
169
  extraAction = _this$props3.extraAction,
168
170
  paddingSize = _this$props3.paddingSize,
171
+ borders = _this$props3.borders,
169
172
  initialIsOpen = _this$props3.initialIsOpen,
170
173
  arrowDisplay = _this$props3.arrowDisplay,
171
174
  forceState = _this$props3.forceState,
172
175
  isLoading = _this$props3.isLoading,
173
176
  isLoadingMessage = _this$props3.isLoadingMessage,
174
177
  isDisabled = _this$props3.isDisabled,
175
- buttonProps = _this$props3.buttonProps,
178
+ _buttonProps = _this$props3.buttonProps,
176
179
  _this$props3$buttonEl = _this$props3.buttonElement,
177
180
  _ButtonElement = _this$props3$buttonEl === void 0 ? 'button' : _this$props3$buttonEl,
178
181
  arrowProps = _this$props3.arrowProps,
179
182
  theme = _this$props3.theme,
180
183
  rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
184
+ var _ref = _buttonProps || {},
185
+ buttonPaddingSize = _ref.paddingSize,
186
+ buttonPropsClassName = _ref.className,
187
+ buttonPropsCss = _ref.css,
188
+ buttonProps = (0, _objectWithoutProperties2.default)(_ref, _excluded2);
181
189
 
182
190
  // Force button element to be a legend if the element is a fieldset
183
191
  var ButtonElement = Element === 'fieldset' ? 'legend' : _ButtonElement;
@@ -188,10 +196,12 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
188
196
  var classes = (0, _classnames.default)('euiAccordion', {
189
197
  'euiAccordion-isOpen': this.isOpen
190
198
  }, className);
199
+ var styles = (0, _accordion.euiAccordionStyles)(theme);
200
+ var cssStyles = [styles.euiAccordion, borders !== 'none' && styles.borders.borders, borders !== 'none' && styles.borders[borders]];
191
201
  var childrenClasses = (0, _classnames.default)('euiAccordion__children', {
192
202
  'euiAccordion__children-isLoading': isLoading
193
203
  });
194
- var buttonClasses = (0, _classnames.default)('euiAccordion__button', buttonClassName, buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.className);
204
+ var buttonClasses = (0, _classnames.default)('euiAccordion__button', buttonClassName, buttonPropsClassName);
195
205
  var buttonContentClasses = (0, _classnames.default)('euiAccordion__buttonContent', buttonContentClassName);
196
206
  var iconButtonClasses = (0, _classnames.default)('euiAccordion__iconButton', {
197
207
  'euiAccordion__iconButton-isOpen': this.isOpen,
@@ -200,7 +210,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
200
210
 
201
211
  // Emotion styles
202
212
  var buttonStyles = (0, _accordion.euiAccordionButtonStyles)(theme);
203
- var cssButtonStyles = [buttonStyles.euiAccordion__button, isDisabled && buttonStyles.disabled, buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.css];
213
+ var cssButtonStyles = [buttonStyles.euiAccordion__button, isDisabled && buttonStyles.disabled].concat((0, _toConsumableArray2.default)(buttonPaddingSize ? [buttonStyles[buttonPaddingSize], arrowDisplay === 'left' && buttonStyles.arrowLeft, arrowDisplay === 'right' && buttonStyles.arrowRight] : []), [buttonPropsCss]);
204
214
  var childrenStyles = (0, _accordion.euiAccordionChildrenStyles)(theme);
205
215
  var cssChildrenStyles = [childrenStyles.euiAccordion__children, isLoading && childrenStyles.isLoading, paddingSize && paddingSize !== 'none' && childrenStyles[paddingSize]];
206
216
  var childWrapperStyles = (0, _accordion.euiAccordionChildWrapperStyles)(theme);
@@ -214,7 +224,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
214
224
  var triggerWrapperStyles = (0, _accordion.euiAccordionTriggerWrapperStyles)();
215
225
  var cssTriggerWrapperStyles = [triggerWrapperStyles.euiAccordion__triggerWrapper];
216
226
  var iconButton;
217
- var buttonId = (_buttonProps$id = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id) !== null && _buttonProps$id !== void 0 ? _buttonProps$id : this.generatedId;
227
+ var buttonId = (_buttonProps$id = buttonProps.id) !== null && _buttonProps$id !== void 0 ? _buttonProps$id : this.generatedId;
218
228
  if (_arrowDisplay !== 'none') {
219
229
  iconButton = (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
220
230
  color: "text"
@@ -266,7 +276,8 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
266
276
  className: buttonContentClasses
267
277
  }, buttonContent));
268
278
  return (0, _react2.jsx)(Element, (0, _extends2.default)({
269
- className: classes
279
+ className: classes,
280
+ css: cssStyles
270
281
  }, rest), (0, _react2.jsx)("div", {
271
282
  className: "euiAccordion__triggerWrapper",
272
283
  css: cssTriggerWrapperStyles
@@ -298,6 +309,7 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
298
309
  exports.EuiAccordionClass = EuiAccordionClass;
299
310
  (0, _defineProperty2.default)(EuiAccordionClass, "defaultProps", {
300
311
  initialIsOpen: false,
312
+ borders: 'none',
301
313
  paddingSize: 'none',
302
314
  arrowDisplay: 'left',
303
315
  isLoading: false,
@@ -322,13 +334,17 @@ EuiAccordionClass.propTypes = {
322
334
  */
323
335
  buttonClassName: _propTypes.default.string,
324
336
  /**
325
- * Apply more props to the triggering button
337
+ * Apply more props to the triggering button.
338
+ *
339
+ * Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
340
+ * Note: Padding will not be present on the side closest to the accordion arrow.
326
341
  */
327
342
  buttonProps: _propTypes.default.shape({
328
343
  className: _propTypes.default.string,
329
344
  "aria-label": _propTypes.default.string,
330
345
  "data-test-subj": _propTypes.default.string,
331
- css: _propTypes.default.any
346
+ css: _propTypes.default.any,
347
+ paddingSize: _propTypes.default.oneOf(["s", "m", "l"])
332
348
  }),
333
349
  /**
334
350
  * Class that will apply to the trigger content for the accordion.
@@ -367,6 +383,10 @@ EuiAccordionClass.propTypes = {
367
383
  * Placement of the arrow indicator, or 'none' to hide it.
368
384
  */
369
385
  arrowDisplay: _propTypes.default.oneOf(["left", "right", "none"]),
386
+ /**
387
+ * Optional border styling. Defaults to 'none'.
388
+ */
389
+ borders: _propTypes.default.oneOf(["horizontal", "all", "none"]),
370
390
  /**
371
391
  * Control the opening of accordion via prop
372
392
  */
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiAccordionTriggerWrapperStyles = exports.euiAccordionSpinnerStyles = exports.euiAccordionOptionalActionStyles = exports.euiAccordionIconButtonStyles = exports.euiAccordionChildrenStyles = exports.euiAccordionChildWrapperStyles = exports.euiAccordionButtonStyles = void 0;
6
+ exports.euiAccordionTriggerWrapperStyles = exports.euiAccordionStyles = exports.euiAccordionSpinnerStyles = exports.euiAccordionOptionalActionStyles = exports.euiAccordionIconButtonStyles = exports.euiAccordionChildrenStyles = exports.euiAccordionChildWrapperStyles = exports.euiAccordionButtonStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _global_styling = require("../../global_styling");
9
9
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
@@ -13,13 +13,34 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
13
13
  * in compliance with, at your election, the Elastic License 2.0 or the Server
14
14
  * Side Public License, v 1.
15
15
  */
16
+ var euiAccordionStyles = function euiAccordionStyles(_ref5) {
17
+ var euiTheme = _ref5.euiTheme;
18
+ return {
19
+ euiAccordion: /*#__PURE__*/(0, _react.css)(";label:euiAccordion;"),
20
+ // Borders
21
+ borders: {
22
+ // Prevent border repeats
23
+ borders: /*#__PURE__*/(0, _react.css)("&+[class*='euiAccordion-borders']{", (0, _global_styling.logicalCSS)('border-top', 'none'), ";};label:borders;"),
24
+ horizontal: /*#__PURE__*/(0, _react.css)("border-block:", euiTheme.border.thin, ";;label:horizontal;"),
25
+ all: /*#__PURE__*/(0, _react.css)("border:", euiTheme.border.thin, ";;label:all;")
26
+ }
27
+ };
28
+ };
29
+ exports.euiAccordionStyles = euiAccordionStyles;
16
30
  var euiAccordionButtonStyles = function euiAccordionButtonStyles(euiThemeContext) {
17
31
  var euiTheme = euiThemeContext.euiTheme;
18
32
  return {
19
33
  euiAccordion__button: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 's'), " align-items:center;display:flex;flex-grow:1;line-height:", euiTheme.size.l, ";", (0, _global_styling.logicalTextAlignCSS)('left'), " ", (0, _global_styling.logicalCSS)('width', '100%'), " &:hover,&:focus{cursor:pointer;text-decoration:underline;};label:euiAccordion__button;"),
20
34
  // Triggering button needs separate `disabled` key because the element that renders may not support `:disabled`;
21
35
  // Hover pseudo selector for specificity
22
- disabled: /*#__PURE__*/(0, _react.css)("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;")
36
+ disabled: /*#__PURE__*/(0, _react.css)("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;"),
37
+ // Optional padding sizes
38
+ s: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.s, ";;label:s;"),
39
+ m: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.base, ";;label:m;"),
40
+ l: /*#__PURE__*/(0, _react.css)("padding:", euiTheme.size.l, ";;label:l;"),
41
+ // Remove padding from the accordion button on the side that the arrow is on
42
+ arrowLeft: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', 0), ";;label:arrowLeft;"),
43
+ arrowRight: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', 0), ";;label:arrowRight;")
23
44
  };
24
45
  };
25
46
  exports.euiAccordionButtonStyles = euiAccordionButtonStyles;
@@ -31,8 +52,8 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
31
52
  styles: "align-items:center;display:flex;label:isLoading;",
32
53
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
54
  };
34
- var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref5) {
35
- var euiTheme = _ref5.euiTheme;
55
+ var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref6) {
56
+ var euiTheme = _ref6.euiTheme;
36
57
  return {
37
58
  euiAccordion__children: /*#__PURE__*/(0, _react.css)(";label:euiAccordion__children;"),
38
59
  isLoading: _ref4,
@@ -44,8 +65,8 @@ var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref5) {
44
65
  };
45
66
  };
46
67
  exports.euiAccordionChildrenStyles = euiAccordionChildrenStyles;
47
- var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
48
- var euiTheme = _ref6.euiTheme;
68
+ var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref7) {
69
+ var euiTheme = _ref7.euiTheme;
49
70
  return {
50
71
  euiAccordion__childWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 0), " opacity:0;overflow:hidden;transition:", _global_styling.logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
51
72
  isOpen: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
@@ -60,8 +81,8 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
60
81
  styles: "transform:rotate(\n 90deg\n )!important;label:isOpen;",
61
82
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
62
83
  };
63
- var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref7) {
64
- var euiTheme = _ref7.euiTheme;
84
+ var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref8) {
85
+ var euiTheme = _ref8.euiTheme;
65
86
  return {
66
87
  euiAccordion__iconButton: /*#__PURE__*/(0, _react.css)("flex-shrink:0;", (0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), " transform:rotate(\n 0deg\n )!important;;label:euiAccordion__iconButton;"),
67
88
  isOpen: _ref3,
@@ -83,8 +104,8 @@ var euiAccordionOptionalActionStyles = function euiAccordionOptionalActionStyles
83
104
  };
84
105
  };
85
106
  exports.euiAccordionOptionalActionStyles = euiAccordionOptionalActionStyles;
86
- var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref8) {
87
- var euiTheme = _ref8.euiTheme;
107
+ var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref9) {
108
+ var euiTheme = _ref9.euiTheme;
88
109
  return {
89
110
  euiAccordion__spinner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";;label:euiAccordion__spinner;")
90
111
  };
@@ -198,13 +198,17 @@ EuiCollapsibleNavGroup.propTypes = {
198
198
  */
199
199
  buttonClassName: _propTypes.default.string,
200
200
  /**
201
- * Apply more props to the triggering button
201
+ * Apply more props to the triggering button.
202
+ *
203
+ * Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
204
+ * Note: Padding will not be present on the side closest to the accordion arrow.
202
205
  */
203
206
  buttonProps: _propTypes.default.shape({
204
207
  className: _propTypes.default.string,
205
208
  "aria-label": _propTypes.default.string,
206
209
  "data-test-subj": _propTypes.default.string,
207
- css: _propTypes.default.any
210
+ css: _propTypes.default.any,
211
+ paddingSize: _propTypes.default.oneOf(["s", "m", "l"])
208
212
  }),
209
213
  /**
210
214
  * Class that will apply to the trigger content for the accordion.
@@ -243,6 +247,10 @@ EuiCollapsibleNavGroup.propTypes = {
243
247
  * Placement of the arrow indicator, or 'none' to hide it.
244
248
  */
245
249
  arrowDisplay: _propTypes.default.oneOf(["left", "right", "none"]),
250
+ /**
251
+ * Optional border styling. Defaults to 'none'.
252
+ */
253
+ borders: _propTypes.default.oneOf(["horizontal", "all", "none"]),
246
254
  /**
247
255
  * Control the opening of accordion via prop
248
256
  */
@@ -15,7 +15,6 @@ var _react = _interopRequireWildcard(require("react"));
15
15
  var _propTypes = _interopRequireDefault(require("prop-types"));
16
16
  var _classnames = _interopRequireDefault(require("classnames"));
17
17
  var _services = require("../../services");
18
- var _global_styling = require("../../global_styling");
19
18
  var _flyout = require("../flyout");
20
19
  var _i18n = require("../i18n");
21
20
  var _header = require("../header/header.styles");
@@ -23,7 +22,7 @@ var _context = require("./context");
23
22
  var _collapsible_nav_button = require("./collapsible_nav_button");
24
23
  var _collapsible_nav_beta = require("./collapsible_nav_beta.styles");
25
24
  var _react2 = require("@emotion/react");
26
- var _excluded = ["id", "children", "className", "style", "initialIsCollapsed", "onCollapseToggle", "width", "side", "focusTrapProps"];
25
+ var _excluded = ["id", "children", "className", "initialIsCollapsed", "onCollapseToggle", "width", "side", "focusTrapProps"];
27
26
  /*
28
27
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
29
28
  * or more contributor license agreements. Licensed under the Elastic License
@@ -39,7 +38,6 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
39
38
  var id = _ref.id,
40
39
  children = _ref.children,
41
40
  className = _ref.className,
42
- style = _ref.style,
43
41
  _ref$initialIsCollaps = _ref.initialIsCollapsed,
44
42
  initialIsCollapsed = _ref$initialIsCollaps === void 0 ? false : _ref$initialIsCollaps,
45
43
  onCollapseToggle = _ref.onCollapseToggle,
@@ -110,24 +108,6 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
110
108
  return _width;
111
109
  }, [_width, isOverlayFullWidth, isPush, isCollapsed, headerHeight]);
112
110
 
113
- /**
114
- * Header affordance
115
- */
116
- var _useState7 = (0, _react.useState)(false),
117
- _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
118
- fixedHeadersCount = _useState8[0],
119
- setFixedHeadersCount = _useState8[1];
120
- (0, _react.useEffect)(function () {
121
- setFixedHeadersCount(document.querySelectorAll('.euiHeader[data-fixed-header]').length);
122
- }, []);
123
- var stylesWithHeaderOffset = (0, _react.useMemo)(function () {
124
- if (!fixedHeadersCount) return style;
125
- var headersOffset = (0, _global_styling.mathWithUnits)(headerHeight, function (x) {
126
- return x * fixedHeadersCount;
127
- });
128
- return _objectSpread(_objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('top', headersOffset)), (0, _global_styling.logicalStyle)('height', "calc(100% - ".concat(headersOffset, ")")));
129
- }, [fixedHeadersCount, style, headerHeight]);
130
-
131
111
  /**
132
112
  * Prop setup
133
113
  */
@@ -145,16 +125,13 @@ var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
145
125
  var classes = (0, _classnames.default)('euiCollapsibleNav', 'euiCollapsibleNavBeta', className);
146
126
  var styles = (0, _collapsible_nav_beta.euiCollapsibleNavBetaStyles)(euiTheme);
147
127
  var cssStyles = [styles.euiCollapsibleNavBeta, styles[side], isPush && styles.isPush, isPush && isCollapsed && styles.isPushCollapsed, isOverlayFullWidth && styles.isOverlayFullWidth];
148
-
149
- // Wait for any fixed headers to be queried before rendering (prevents position jumping)
150
- var flyout = fixedHeadersCount !== false && (0, _react2.jsx)(_flyout.EuiFlyout, (0, _extends2.default)({
128
+ var flyout = (0, _react2.jsx)(_flyout.EuiFlyout, (0, _extends2.default)({
151
129
  "aria-label": defaultAriaLabel
152
130
  }, rest, {
153
131
  // EuiCollapsibleNav is significantly less permissive than EuiFlyout
154
132
  id: flyoutID,
155
133
  css: cssStyles,
156
134
  className: classes,
157
- style: stylesWithHeaderOffset,
158
135
  size: width,
159
136
  side: side,
160
137
  focusTrapProps: focusTrapProps,
@@ -7,6 +7,7 @@ exports.euiCollapsibleNavBetaStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _global_styling = require("../../global_styling");
9
9
  var _themes = require("../../themes");
10
+ var _header = require("../header/header.styles");
10
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)."; } /*
11
12
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
13
  * or more contributor license agreements. Licensed under the Elastic License
@@ -24,8 +25,16 @@ var _ref = process.env.NODE_ENV === "production" ? {
24
25
  };
25
26
  var euiCollapsibleNavBetaStyles = function euiCollapsibleNavBetaStyles(euiThemeContext) {
26
27
  var euiTheme = euiThemeContext.euiTheme;
28
+
29
+ // At least for serverless, EuiCollapsibleNav is only going to be used with 1
30
+ // fixed header. For those scenarios, we can prevent a minor layout jump on
31
+ // page load by setting the CSS var fallback to the height of a single header
32
+ var defaultHeaderHeight = (0, _header.euiHeaderVariables)(euiThemeContext).height;
33
+ var fixedHeaderOffset = "var(--euiFixedHeadersOffset, ".concat(defaultHeaderHeight, ")");
27
34
  return {
28
- euiCollapsibleNavBeta: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), (0, _global_styling.euiYScroll)(euiThemeContext), ".euiFlyoutBody{", (0, _global_styling.logicalCSS)('min-height', '50%'), ";}.euiFlyoutFooter{background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), ";};label:euiCollapsibleNavBeta;"),
35
+ euiCollapsibleNavBeta: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', fixedHeaderOffset), (0, _global_styling.euiYScroll)(euiThemeContext, {
36
+ height: 'inherit'
37
+ }), (0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), ".euiFlyoutBody{", (0, _global_styling.logicalCSS)('min-height', '50%'), ";}.euiFlyoutFooter{background-color:", euiTheme.colors.emptyShade, ";", (0, _global_styling.logicalCSS)('border-top', euiTheme.border.thin), ";};label:euiCollapsibleNavBeta;"),
29
38
  left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thin), ";;label:left;"),
30
39
  right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thin), ";;label:right;"),
31
40
  isPush: /*#__PURE__*/(0, _react.css)((0, _themes.euiShadowFlat)(euiThemeContext), ";;label:isPush;"),
@@ -41,7 +41,7 @@ exports.euiFlyoutCloseButtonStyles = euiFlyoutCloseButtonStyles;
41
41
  var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
42
42
  var euiTheme = euiThemeContext.euiTheme;
43
43
  return {
44
- euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
44
+ euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('top', 'var(--euiFixedHeadersOffset, 0)'), " ", (0, _global_styling.logicalCSS)('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
45
45
  // Flyout sizes
46
46
  s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
47
47
  m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),