@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
@@ -1,6 +1,13 @@
1
- var _excluded = ["children", "buttonContent", "className", "id", "element", "buttonClassName", "buttonContentClassName", "extraAction", "paddingSize", "initialIsOpen", "arrowDisplay", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "buttonProps", "buttonElement", "arrowProps", "theme"];
1
+ var _excluded = ["children", "buttonContent", "className", "id", "element", "buttonClassName", "buttonContentClassName", "extraAction", "paddingSize", "borders", "initialIsOpen", "arrowDisplay", "forceState", "isLoading", "isLoadingMessage", "isDisabled", "buttonProps", "buttonElement", "arrowProps", "theme"],
2
+ _excluded2 = ["paddingSize", "className", "css"];
2
3
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4
11
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
5
12
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
6
13
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -34,7 +41,7 @@ import { EuiText } from '../text';
34
41
  import { EuiI18n } from '../i18n';
35
42
  import { htmlIdGenerator, withEuiTheme } from '../../services';
36
43
  import { EuiButtonIcon } from '../button';
37
- import { euiAccordionButtonStyles, euiAccordionChildrenStyles, euiAccordionChildWrapperStyles, euiAccordionIconButtonStyles, euiAccordionOptionalActionStyles, euiAccordionSpinnerStyles, euiAccordionTriggerWrapperStyles } from './accordion.styles';
44
+ import { euiAccordionStyles, euiAccordionButtonStyles, euiAccordionChildrenStyles, euiAccordionChildWrapperStyles, euiAccordionIconButtonStyles, euiAccordionOptionalActionStyles, euiAccordionSpinnerStyles, euiAccordionTriggerWrapperStyles } from './accordion.styles';
38
45
  import { logicalCSS } from '../../global_styling';
39
46
  import { jsx as ___EmotionJSX } from "@emotion/react";
40
47
  export var PADDING_SIZES = ['none', 'xs', 's', 'm', 'l', 'xl'];
@@ -163,18 +170,24 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
163
170
  buttonContentClassName = _this$props3.buttonContentClassName,
164
171
  extraAction = _this$props3.extraAction,
165
172
  paddingSize = _this$props3.paddingSize,
173
+ borders = _this$props3.borders,
166
174
  initialIsOpen = _this$props3.initialIsOpen,
167
175
  arrowDisplay = _this$props3.arrowDisplay,
168
176
  forceState = _this$props3.forceState,
169
177
  isLoading = _this$props3.isLoading,
170
178
  isLoadingMessage = _this$props3.isLoadingMessage,
171
179
  isDisabled = _this$props3.isDisabled,
172
- buttonProps = _this$props3.buttonProps,
180
+ _buttonProps = _this$props3.buttonProps,
173
181
  _this$props3$buttonEl = _this$props3.buttonElement,
174
182
  _ButtonElement = _this$props3$buttonEl === void 0 ? 'button' : _this$props3$buttonEl,
175
183
  arrowProps = _this$props3.arrowProps,
176
184
  theme = _this$props3.theme,
177
185
  rest = _objectWithoutProperties(_this$props3, _excluded);
186
+ var _ref = _buttonProps || {},
187
+ buttonPaddingSize = _ref.paddingSize,
188
+ buttonPropsClassName = _ref.className,
189
+ buttonPropsCss = _ref.css,
190
+ buttonProps = _objectWithoutProperties(_ref, _excluded2);
178
191
 
179
192
  // Force button element to be a legend if the element is a fieldset
180
193
  var ButtonElement = Element === 'fieldset' ? 'legend' : _ButtonElement;
@@ -185,10 +198,12 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
185
198
  var classes = classNames('euiAccordion', {
186
199
  'euiAccordion-isOpen': this.isOpen
187
200
  }, className);
201
+ var styles = euiAccordionStyles(theme);
202
+ var cssStyles = [styles.euiAccordion, borders !== 'none' && styles.borders.borders, borders !== 'none' && styles.borders[borders]];
188
203
  var childrenClasses = classNames('euiAccordion__children', {
189
204
  'euiAccordion__children-isLoading': isLoading
190
205
  });
191
- var buttonClasses = classNames('euiAccordion__button', buttonClassName, buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.className);
206
+ var buttonClasses = classNames('euiAccordion__button', buttonClassName, buttonPropsClassName);
192
207
  var buttonContentClasses = classNames('euiAccordion__buttonContent', buttonContentClassName);
193
208
  var iconButtonClasses = classNames('euiAccordion__iconButton', {
194
209
  'euiAccordion__iconButton-isOpen': this.isOpen,
@@ -197,7 +212,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
197
212
 
198
213
  // Emotion styles
199
214
  var buttonStyles = euiAccordionButtonStyles(theme);
200
- var cssButtonStyles = [buttonStyles.euiAccordion__button, isDisabled && buttonStyles.disabled, buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.css];
215
+ var cssButtonStyles = [buttonStyles.euiAccordion__button, isDisabled && buttonStyles.disabled].concat(_toConsumableArray(buttonPaddingSize ? [buttonStyles[buttonPaddingSize], arrowDisplay === 'left' && buttonStyles.arrowLeft, arrowDisplay === 'right' && buttonStyles.arrowRight] : []), [buttonPropsCss]);
201
216
  var childrenStyles = euiAccordionChildrenStyles(theme);
202
217
  var cssChildrenStyles = [childrenStyles.euiAccordion__children, isLoading && childrenStyles.isLoading, paddingSize && paddingSize !== 'none' && childrenStyles[paddingSize]];
203
218
  var childWrapperStyles = euiAccordionChildWrapperStyles(theme);
@@ -211,7 +226,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
211
226
  var triggerWrapperStyles = euiAccordionTriggerWrapperStyles();
212
227
  var cssTriggerWrapperStyles = [triggerWrapperStyles.euiAccordion__triggerWrapper];
213
228
  var iconButton;
214
- var buttonId = (_buttonProps$id = buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.id) !== null && _buttonProps$id !== void 0 ? _buttonProps$id : this.generatedId;
229
+ var buttonId = (_buttonProps$id = buttonProps.id) !== null && _buttonProps$id !== void 0 ? _buttonProps$id : this.generatedId;
215
230
  if (_arrowDisplay !== 'none') {
216
231
  iconButton = ___EmotionJSX(EuiButtonIcon, _extends({
217
232
  color: "text"
@@ -263,7 +278,8 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
263
278
  className: buttonContentClasses
264
279
  }, buttonContent));
265
280
  return ___EmotionJSX(Element, _extends({
266
- className: classes
281
+ className: classes,
282
+ css: cssStyles
267
283
  }, rest), ___EmotionJSX("div", {
268
284
  className: "euiAccordion__triggerWrapper",
269
285
  css: cssTriggerWrapperStyles
@@ -294,6 +310,7 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
294
310
  }(Component);
295
311
  _defineProperty(EuiAccordionClass, "defaultProps", {
296
312
  initialIsOpen: false,
313
+ borders: 'none',
297
314
  paddingSize: 'none',
298
315
  arrowDisplay: 'left',
299
316
  isLoading: false,
@@ -318,13 +335,17 @@ EuiAccordionClass.propTypes = {
318
335
  */
319
336
  buttonClassName: PropTypes.string,
320
337
  /**
321
- * Apply more props to the triggering button
338
+ * Apply more props to the triggering button.
339
+ *
340
+ * Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
341
+ * Note: Padding will not be present on the side closest to the accordion arrow.
322
342
  */
323
343
  buttonProps: PropTypes.shape({
324
344
  className: PropTypes.string,
325
345
  "aria-label": PropTypes.string,
326
346
  "data-test-subj": PropTypes.string,
327
- css: PropTypes.any
347
+ css: PropTypes.any,
348
+ paddingSize: PropTypes.oneOf(["s", "m", "l"])
328
349
  }),
329
350
  /**
330
351
  * Class that will apply to the trigger content for the accordion.
@@ -363,6 +384,10 @@ EuiAccordionClass.propTypes = {
363
384
  * Placement of the arrow indicator, or 'none' to hide it.
364
385
  */
365
386
  arrowDisplay: PropTypes.oneOf(["left", "right", "none"]),
387
+ /**
388
+ * Optional border styling. Defaults to 'none'.
389
+ */
390
+ borders: PropTypes.oneOf(["horizontal", "all", "none"]),
366
391
  /**
367
392
  * Control the opening of accordion via prop
368
393
  */
@@ -9,13 +9,33 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
9
9
 
10
10
  import { css } from '@emotion/react';
11
11
  import { euiFontSize, logicals, logicalCSS, logicalTextAlignCSS } from '../../global_styling';
12
+ export var euiAccordionStyles = function euiAccordionStyles(_ref5) {
13
+ var euiTheme = _ref5.euiTheme;
14
+ return {
15
+ euiAccordion: /*#__PURE__*/css(";label:euiAccordion;"),
16
+ // Borders
17
+ borders: {
18
+ // Prevent border repeats
19
+ borders: /*#__PURE__*/css("&+[class*='euiAccordion-borders']{", logicalCSS('border-top', 'none'), ";};label:borders;"),
20
+ horizontal: /*#__PURE__*/css("border-block:", euiTheme.border.thin, ";;label:horizontal;"),
21
+ all: /*#__PURE__*/css("border:", euiTheme.border.thin, ";;label:all;")
22
+ }
23
+ };
24
+ };
12
25
  export var euiAccordionButtonStyles = function euiAccordionButtonStyles(euiThemeContext) {
13
26
  var euiTheme = euiThemeContext.euiTheme;
14
27
  return {
15
28
  euiAccordion__button: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), " align-items:center;display:flex;flex-grow:1;line-height:", euiTheme.size.l, ";", logicalTextAlignCSS('left'), " ", logicalCSS('width', '100%'), " &:hover,&:focus{cursor:pointer;text-decoration:underline;};label:euiAccordion__button;"),
16
29
  // Triggering button needs separate `disabled` key because the element that renders may not support `:disabled`;
17
30
  // Hover pseudo selector for specificity
18
- disabled: /*#__PURE__*/css("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;")
31
+ disabled: /*#__PURE__*/css("&,&:hover{cursor:not-allowed;color:", euiTheme.colors.disabledText, ";text-decoration:none;};label:disabled;"),
32
+ // Optional padding sizes
33
+ s: /*#__PURE__*/css("padding:", euiTheme.size.s, ";;label:s;"),
34
+ m: /*#__PURE__*/css("padding:", euiTheme.size.base, ";;label:m;"),
35
+ l: /*#__PURE__*/css("padding:", euiTheme.size.l, ";;label:l;"),
36
+ // Remove padding from the accordion button on the side that the arrow is on
37
+ arrowLeft: /*#__PURE__*/css(logicalCSS('padding-left', 0), ";;label:arrowLeft;"),
38
+ arrowRight: /*#__PURE__*/css(logicalCSS('padding-left', 0), ";;label:arrowRight;")
19
39
  };
20
40
  };
21
41
  var _ref4 = process.env.NODE_ENV === "production" ? {
@@ -26,8 +46,8 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
26
46
  styles: "align-items:center;display:flex;label:isLoading;",
27
47
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
48
  };
29
- export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref5) {
30
- var euiTheme = _ref5.euiTheme;
49
+ export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref6) {
50
+ var euiTheme = _ref6.euiTheme;
31
51
  return {
32
52
  euiAccordion__children: /*#__PURE__*/css(";label:euiAccordion__children;"),
33
53
  isLoading: _ref4,
@@ -38,8 +58,8 @@ export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref
38
58
  xl: /*#__PURE__*/css("padding:", euiTheme.size.xl, ";;label:xl;")
39
59
  };
40
60
  };
41
- export var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
42
- var euiTheme = _ref6.euiTheme;
61
+ export var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref7) {
62
+ var euiTheme = _ref7.euiTheme;
43
63
  return {
44
64
  euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
45
65
  isOpen: /*#__PURE__*/css(logicalCSS('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
@@ -53,8 +73,8 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
53
73
  styles: "transform:rotate(\n 90deg\n )!important;label:isOpen;",
54
74
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
55
75
  };
56
- export var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref7) {
57
- var euiTheme = _ref7.euiTheme;
76
+ export var euiAccordionIconButtonStyles = function euiAccordionIconButtonStyles(_ref8) {
77
+ var euiTheme = _ref8.euiTheme;
58
78
  return {
59
79
  euiAccordion__iconButton: /*#__PURE__*/css("flex-shrink:0;", logicalCSS('margin-right', euiTheme.size.xs), " transform:rotate(\n 0deg\n )!important;;label:euiAccordion__iconButton;"),
60
80
  isOpen: _ref3,
@@ -74,8 +94,8 @@ export var euiAccordionOptionalActionStyles = function euiAccordionOptionalActio
74
94
  euiAccordion__optionalAction: _ref2
75
95
  };
76
96
  };
77
- export var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref8) {
78
- var euiTheme = _ref8.euiTheme;
97
+ export var euiAccordionSpinnerStyles = function euiAccordionSpinnerStyles(_ref9) {
98
+ var euiTheme = _ref9.euiTheme;
79
99
  return {
80
100
  euiAccordion__spinner: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), ";;label:euiAccordion__spinner;")
81
101
  };
@@ -191,13 +191,17 @@ EuiCollapsibleNavGroup.propTypes = {
191
191
  */
192
192
  buttonClassName: PropTypes.string,
193
193
  /**
194
- * Apply more props to the triggering button
194
+ * Apply more props to the triggering button.
195
+ *
196
+ * Includes optional `paddingSize` prop which allows sizes of `s`, `m`, or `l`.
197
+ * Note: Padding will not be present on the side closest to the accordion arrow.
195
198
  */
196
199
  buttonProps: PropTypes.shape({
197
200
  className: PropTypes.string,
198
201
  "aria-label": PropTypes.string,
199
202
  "data-test-subj": PropTypes.string,
200
- css: PropTypes.any
203
+ css: PropTypes.any,
204
+ paddingSize: PropTypes.oneOf(["s", "m", "l"])
201
205
  }),
202
206
  /**
203
207
  * Class that will apply to the trigger content for the accordion.
@@ -236,6 +240,10 @@ EuiCollapsibleNavGroup.propTypes = {
236
240
  * Placement of the arrow indicator, or 'none' to hide it.
237
241
  */
238
242
  arrowDisplay: PropTypes.oneOf(["left", "right", "none"]),
243
+ /**
244
+ * Optional border styling. Defaults to 'none'.
245
+ */
246
+ borders: PropTypes.oneOf(["horizontal", "all", "none"]),
239
247
  /**
240
248
  * Control the opening of accordion via prop
241
249
  */
@@ -1,5 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["id", "children", "className", "style", "initialIsCollapsed", "onCollapseToggle", "width", "side", "focusTrapProps"];
2
+ var _excluded = ["id", "children", "className", "initialIsCollapsed", "onCollapseToggle", "width", "side", "focusTrapProps"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
5
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -30,7 +30,6 @@ import React, { useRef, useMemo, useState, useEffect, useCallback } from 'react'
30
30
  import PropTypes from "prop-types";
31
31
  import classNames from 'classnames';
32
32
  import { useEuiTheme, useGeneratedHtmlId, throttle } from '../../services';
33
- import { mathWithUnits, logicalStyle } from '../../global_styling';
34
33
  import { EuiFlyout } from '../flyout';
35
34
  import { useEuiI18n } from '../i18n';
36
35
  import { euiHeaderVariables } from '../header/header.styles';
@@ -42,7 +41,6 @@ export var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
42
41
  var id = _ref.id,
43
42
  children = _ref.children,
44
43
  className = _ref.className,
45
- style = _ref.style,
46
44
  _ref$initialIsCollaps = _ref.initialIsCollapsed,
47
45
  initialIsCollapsed = _ref$initialIsCollaps === void 0 ? false : _ref$initialIsCollaps,
48
46
  onCollapseToggle = _ref.onCollapseToggle,
@@ -113,24 +111,6 @@ export var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
113
111
  return _width;
114
112
  }, [_width, isOverlayFullWidth, isPush, isCollapsed, headerHeight]);
115
113
 
116
- /**
117
- * Header affordance
118
- */
119
- var _useState7 = useState(false),
120
- _useState8 = _slicedToArray(_useState7, 2),
121
- fixedHeadersCount = _useState8[0],
122
- setFixedHeadersCount = _useState8[1];
123
- useEffect(function () {
124
- setFixedHeadersCount(document.querySelectorAll('.euiHeader[data-fixed-header]').length);
125
- }, []);
126
- var stylesWithHeaderOffset = useMemo(function () {
127
- if (!fixedHeadersCount) return style;
128
- var headersOffset = mathWithUnits(headerHeight, function (x) {
129
- return x * fixedHeadersCount;
130
- });
131
- return _objectSpread(_objectSpread(_objectSpread({}, style), logicalStyle('top', headersOffset)), logicalStyle('height', "calc(100% - ".concat(headersOffset, ")")));
132
- }, [fixedHeadersCount, style, headerHeight]);
133
-
134
114
  /**
135
115
  * Prop setup
136
116
  */
@@ -148,16 +128,13 @@ export var EuiCollapsibleNavBeta = function EuiCollapsibleNavBeta(_ref) {
148
128
  var classes = classNames('euiCollapsibleNav', 'euiCollapsibleNavBeta', className);
149
129
  var styles = euiCollapsibleNavBetaStyles(euiTheme);
150
130
  var cssStyles = [styles.euiCollapsibleNavBeta, styles[side], isPush && styles.isPush, isPush && isCollapsed && styles.isPushCollapsed, isOverlayFullWidth && styles.isOverlayFullWidth];
151
-
152
- // Wait for any fixed headers to be queried before rendering (prevents position jumping)
153
- var flyout = fixedHeadersCount !== false && ___EmotionJSX(EuiFlyout, _extends({
131
+ var flyout = ___EmotionJSX(EuiFlyout, _extends({
154
132
  "aria-label": defaultAriaLabel
155
133
  }, rest, {
156
134
  // EuiCollapsibleNav is significantly less permissive than EuiFlyout
157
135
  id: flyoutID,
158
136
  css: cssStyles,
159
137
  className: classes,
160
- style: stylesWithHeaderOffset,
161
138
  size: width,
162
139
  side: side,
163
140
  focusTrapProps: focusTrapProps,
@@ -10,6 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
10
10
  import { css } from '@emotion/react';
11
11
  import { logicalCSS, euiYScroll } from '../../global_styling';
12
12
  import { euiShadowFlat } from '../../themes';
13
+ import { euiHeaderVariables } from '../header/header.styles';
13
14
  var _ref = process.env.NODE_ENV === "production" ? {
14
15
  name: "1adm1dw-isPushCollapsed",
15
16
  styles: "&,.euiFlyoutBody__overflow{scrollbar-width:none;&::-webkit-scrollbar{display:none;}};label:isPushCollapsed;"
@@ -20,8 +21,16 @@ var _ref = process.env.NODE_ENV === "production" ? {
20
21
  };
21
22
  export var euiCollapsibleNavBetaStyles = function euiCollapsibleNavBetaStyles(euiThemeContext) {
22
23
  var euiTheme = euiThemeContext.euiTheme;
24
+
25
+ // At least for serverless, EuiCollapsibleNav is only going to be used with 1
26
+ // fixed header. For those scenarios, we can prevent a minor layout jump on
27
+ // page load by setting the CSS var fallback to the height of a single header
28
+ var defaultHeaderHeight = euiHeaderVariables(euiThemeContext).height;
29
+ var fixedHeaderOffset = "var(--euiFixedHeadersOffset, ".concat(defaultHeaderHeight, ")");
23
30
  return {
24
- euiCollapsibleNavBeta: /*#__PURE__*/css(logicalCSS('padding-bottom', euiTheme.size.xs), euiYScroll(euiThemeContext), ".euiFlyoutBody{", logicalCSS('min-height', '50%'), ";}.euiFlyoutFooter{background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('border-top', euiTheme.border.thin), ";};label:euiCollapsibleNavBeta;"),
31
+ euiCollapsibleNavBeta: /*#__PURE__*/css(logicalCSS('top', fixedHeaderOffset), euiYScroll(euiThemeContext, {
32
+ height: 'inherit'
33
+ }), logicalCSS('padding-bottom', euiTheme.size.xs), ".euiFlyoutBody{", logicalCSS('min-height', '50%'), ";}.euiFlyoutFooter{background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('border-top', euiTheme.border.thin), ";};label:euiCollapsibleNavBeta;"),
25
34
  left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thin), ";;label:left;"),
26
35
  right: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thin), ";;label:right;"),
27
36
  isPush: /*#__PURE__*/css(euiShadowFlat(euiThemeContext), ";;label:isPush;"),
@@ -32,7 +32,7 @@ export var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiT
32
32
  export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
33
33
  var euiTheme = euiThemeContext.euiTheme;
34
34
  return {
35
- euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('bottom', 0), " ", logicalCSS('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", euiMaxBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('max-width', '90vw !important'), ";};label:euiFlyout;"),
35
+ euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('bottom', 0), " ", logicalCSS('top', 'var(--euiFixedHeadersOffset, 0)'), " ", logicalCSS('height', 'inherit'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", euiMaxBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('max-width', '90vw !important'), ";};label:euiFlyout;"),
36
36
  // Flyout sizes
37
37
  s: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
38
38
  m: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
@@ -1,4 +1,17 @@
1
- var _excluded = ["children", "className", "sections", "position", "theme"];
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["children", "className", "sections", "position", "theme"],
3
+ _excluded2 = ["children", "style"];
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
14
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2
15
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
16
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
17
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -10,13 +23,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
10
23
  * Side Public License, v 1.
11
24
  */
12
25
 
13
- import React, { useEffect } from 'react';
26
+ import React, { useEffect, useState, useMemo, useCallback } from 'react';
14
27
  import PropTypes from "prop-types";
15
28
  import classNames from 'classnames';
16
- import { useEuiTheme } from '../../services';
29
+ import { useEuiTheme, useEuiThemeCSSVariables } from '../../services';
30
+ import { mathWithUnits, logicalStyles } from '../../global_styling';
17
31
  import { EuiHeaderBreadcrumbs } from './header_breadcrumbs';
18
32
  import { EuiHeaderSectionItem, EuiHeaderSection } from './header_section';
19
- import { euiHeaderStyles } from './header.styles';
33
+ import { euiHeaderStyles, euiHeaderVariables } from './header.styles';
20
34
  import { jsx as ___EmotionJSX } from "@emotion/react";
21
35
  var createHeaderSection = function createHeaderSection(sections) {
22
36
  return sections.map(function (section, index) {
@@ -25,8 +39,6 @@ var createHeaderSection = function createHeaderSection(sections) {
25
39
  }, section);
26
40
  });
27
41
  };
28
- // Start a counter to manage the total number of fixed headers that need the body class
29
- var euiHeaderFixedCounter = 0;
30
42
  export var EuiHeader = function EuiHeader(_ref) {
31
43
  var children = _ref.children,
32
44
  className = _ref.className,
@@ -40,22 +52,6 @@ export var EuiHeader = function EuiHeader(_ref) {
40
52
  var euiTheme = useEuiTheme();
41
53
  var styles = euiHeaderStyles(euiTheme);
42
54
  var cssStyles = [styles.euiHeader, styles[position], styles[theme]];
43
- useEffect(function () {
44
- if (position === 'fixed') {
45
- // Increment fixed header counter for each fixed header
46
- euiHeaderFixedCounter++;
47
- document.body.classList.add('euiBody--headerIsFixed');
48
- document.body.dataset.fixedHeaders = String(euiHeaderFixedCounter);
49
- return function () {
50
- // Both decrement the fixed counter AND then check if there are none
51
- if (--euiHeaderFixedCounter === 0) {
52
- // If there are none, THEN remove class
53
- document.body.classList.remove('euiBody--headerIsFixed');
54
- delete document.body.dataset.fixedHeaders;
55
- }
56
- };
57
- }
58
- }, [position]);
59
55
  var contents;
60
56
  if (sections) {
61
57
  if (children) {
@@ -84,12 +80,22 @@ export var EuiHeader = function EuiHeader(_ref) {
84
80
  } else {
85
81
  contents = children;
86
82
  }
87
- return ___EmotionJSX("div", _extends({
83
+ return position === 'fixed' ? ___EmotionJSX(EuiFixedHeader, _extends({
84
+ css: cssStyles,
85
+ className: classes
86
+ }, rest), contents) : ___EmotionJSX("div", _extends({
88
87
  css: cssStyles,
89
- className: classes,
90
- "data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
88
+ className: classes
91
89
  }, rest), contents);
92
90
  };
91
+
92
+ /**
93
+ * Fixed headers - logic around dynamically calculating the total
94
+ * page offset and setting the `top` position of subsequent headers
95
+ */
96
+
97
+ // Start a counter to manage the total number of fixed headers
98
+ // Exported for unit testing only
93
99
  EuiHeader.propTypes = {
94
100
  className: PropTypes.string,
95
101
  "aria-label": PropTypes.string,
@@ -126,4 +132,93 @@ EuiHeader.propTypes = {
126
132
  * Or, force the header into pseudo `dark` theme for all themes.
127
133
  */
128
134
  theme: PropTypes.oneOf(["default", "dark"])
135
+ };
136
+ export var euiFixedHeadersCount = 0;
137
+
138
+ // Exported for unit testing only
139
+ export var EuiFixedHeader = function EuiFixedHeader(_ref2) {
140
+ var children = _ref2.children,
141
+ style = _ref2.style,
142
+ rest = _objectWithoutProperties(_ref2, _excluded2);
143
+ var _useEuiThemeCSSVariab = useEuiThemeCSSVariables(),
144
+ setGlobalCSSVariables = _useEuiThemeCSSVariab.setGlobalCSSVariables;
145
+ var euiTheme = useEuiTheme();
146
+ var headerHeight = euiHeaderVariables(euiTheme).height;
147
+ var getHeaderOffset = useCallback(function () {
148
+ return mathWithUnits(headerHeight, function (x) {
149
+ return x * euiFixedHeadersCount;
150
+ });
151
+ }, [headerHeight]);
152
+ var _useState = useState(),
153
+ _useState2 = _slicedToArray(_useState, 2),
154
+ topPosition = _useState2[0],
155
+ setTopPosition = _useState2[1];
156
+ useEffect(function () {
157
+ // Get the top position from the offset of previous header(s)
158
+ setTopPosition(getHeaderOffset());
159
+
160
+ // Increment fixed header counter for each fixed header
161
+ euiFixedHeadersCount++;
162
+ setGlobalCSSVariables({
163
+ '--euiFixedHeadersOffset': getHeaderOffset()
164
+ });
165
+ document.body.classList.add('euiBody--headerIsFixed'); // TODO: Consider deleting this legacy className
166
+
167
+ return function () {
168
+ euiFixedHeadersCount--;
169
+ setGlobalCSSVariables({
170
+ '--euiFixedHeadersOffset': getHeaderOffset()
171
+ });
172
+ if (euiFixedHeadersCount === 0) {
173
+ document.body.classList.remove('euiBody--headerIsFixed'); // TODO: Consider deleting this legacy className
174
+ }
175
+ };
176
+ }, [getHeaderOffset, setGlobalCSSVariables]);
177
+ var inlineStyles = useMemo(function () {
178
+ return logicalStyles(_objectSpread({
179
+ top: topPosition
180
+ }, style));
181
+ }, [topPosition, style]);
182
+ return ___EmotionJSX("div", _extends({
183
+ "data-fixed-header": true // Used by EuiFlyouts as a query selector
184
+ ,
185
+ style: inlineStyles
186
+ }, rest), children);
187
+ };
188
+ EuiFixedHeader.propTypes = {
189
+ className: PropTypes.string,
190
+ "aria-label": PropTypes.string,
191
+ "data-test-subj": PropTypes.string,
192
+ css: PropTypes.any,
193
+ /**
194
+ * An array of objects to wrap in a #EuiHeaderSection.
195
+ * Each section is spaced using `space-between`.
196
+ * See #EuiHeaderSectionsProp for object details.
197
+ * This prop disregards the prop `children` if both are passed.
198
+ */
199
+ sections: PropTypes.arrayOf(PropTypes.shape({
200
+ /**
201
+ * An arry of items that will be wrapped in a #EuiHeaderSectionItem
202
+ */
203
+ items: PropTypes.arrayOf(PropTypes.node.isRequired),
204
+ /**
205
+ * Breadcrumbs in the header cannot be wrapped in a #EuiHeaderSection in order for truncation to work.
206
+ * Simply pass the array of EuiBreadcrumb objects
207
+ */
208
+ breadcrumbs: PropTypes.arrayOf(PropTypes.any.isRequired),
209
+ /**
210
+ * Other props to pass to #EuiHeaderBreadcrumbs
211
+ */
212
+ breadcrumbProps: PropTypes.any
213
+ }).isRequired),
214
+ /**
215
+ * Helper that positions the header against the window body and
216
+ * adds the correct amount of top padding to the window when in `fixed` mode
217
+ */
218
+ position: PropTypes.oneOf(["static", "fixed"]),
219
+ /**
220
+ * The `default` will inherit its coloring from the light or dark theme.
221
+ * Or, force the header into pseudo `dark` theme for all themes.
222
+ */
223
+ theme: PropTypes.oneOf(["default", "dark"])
129
224
  };
@@ -32,7 +32,7 @@ export var euiHeaderStyles = function euiHeaderStyles(euiThemeContext) {
32
32
  euiHeader: /*#__PURE__*/css("display:flex;justify-content:space-between;", logicalCSS('height', height), " ", logicalCSS('padding-horizontal', padding), " ", euiShadowSmall(euiThemeContext), ";;label:euiHeader;"),
33
33
  // Position
34
34
  static: /*#__PURE__*/css("z-index:", Number(euiTheme.levels.header) - 1, ";position:relative;;label:static;"),
35
- fixed: /*#__PURE__*/css("z-index:", euiTheme.levels.header, ";position:fixed;", logicalCSS('top', 0), " ", logicalCSS('horizontal', 0), " &+[data-fixed-header]{", logicalCSS('top', height), ";};label:fixed;"),
35
+ fixed: /*#__PURE__*/css("z-index:", euiTheme.levels.header, ";position:fixed;", logicalCSS('top', 0), " ", logicalCSS('horizontal', 0), ";;label:fixed;"),
36
36
  // Theme
37
37
  default: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(borderColor)), ";;label:default;"),
38
38
  dark: /*#__PURE__*/css(euiHeaderDarkStyles(euiThemeContext, borderColor), ";label:dark;")
@@ -88,6 +88,7 @@ export * from './basic_table';
88
88
  export * from './tabs';
89
89
  export * from './text';
90
90
  export * from './text_diff';
91
+ export * from './text_truncate';
91
92
  export * from './timeline';
92
93
  export * from './title';
93
94
  export * from './toast';
@@ -14,6 +14,6 @@ export var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
14
14
  return {
15
15
  euiOverlayMask: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;", logicalCSS('padding-bottom', '10vh'), " animation:", euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", transparentize(euiTheme.colors.ink, 0.5), ";;label:euiOverlayMask;"),
16
16
  aboveHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.mask, ";;label:aboveHeader;"),
17
- belowHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', "".concat(euiTheme.base * 3, "px")), ";;label:belowHeader;")
17
+ belowHeader: /*#__PURE__*/css("z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', 'var(--euiFixedHeadersOffset, 0)'), ";;label:belowHeader;")
18
18
  };
19
19
  };
@@ -54,10 +54,8 @@ export var EuiPageSidebar = function EuiPageSidebar(_ref) {
54
54
  useLayoutEffect(function () {
55
55
  var updatedStyles = _objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth));
56
56
  if (sticky) {
57
- var _document$body$datase;
58
- var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
59
- var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
60
- updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)")));
57
+ var offset = _typeof(sticky) === 'object' ? "".concat(sticky === null || sticky === void 0 ? void 0 : sticky.offset, "px") : 'var(--euiFixedHeadersOffset, 0)';
58
+ updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, ")")));
61
59
  }
62
60
  setInlineStyles(updatedStyles);
63
61
  }, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);