@elastic/eui 113.3.0 → 114.0.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 (107) hide show
  1. package/es/components/button/split_button/split_button.js +13 -0
  2. package/es/components/button/split_button/split_button_actions.js +15 -0
  3. package/es/components/collapsible_nav/collapsible_nav.js +5 -0
  4. package/es/components/color_picker/color_picker.js +31 -8
  5. package/es/components/datagrid/utils/scrolling.js +39 -10
  6. package/es/components/flyout/_flyout_overlay.js +34 -4
  7. package/es/components/flyout/flyout.component.js +13 -9
  8. package/es/components/flyout/flyout.js +9 -1
  9. package/es/components/flyout/flyout.styles.js +2 -2
  10. package/es/components/flyout/flyout_menu.js +2 -1
  11. package/es/components/flyout/flyout_resizable.js +5 -0
  12. package/es/components/flyout/manager/actions.js +5 -2
  13. package/es/components/flyout/manager/flyout_child.js +1 -0
  14. package/es/components/flyout/manager/flyout_managed.js +5 -3
  15. package/es/components/flyout/manager/reducer.js +116 -57
  16. package/es/components/flyout/manager/store.js +13 -6
  17. package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  18. package/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
  19. package/es/components/overlay_mask/overlay_mask.js +10 -3
  20. package/es/components/tree_view/tree_view_item.styles.js +1 -1
  21. package/es/services/hooks/index.js +8 -8
  22. package/es/services/hooks/useIsPointerDown.js +6 -15
  23. package/es/services/index.js +1 -1
  24. package/eui.d.ts +83 -51
  25. package/i18ntokens.json +661 -643
  26. package/lib/components/button/split_button/split_button.js +13 -0
  27. package/lib/components/button/split_button/split_button_actions.js +15 -0
  28. package/lib/components/collapsible_nav/collapsible_nav.js +5 -0
  29. package/lib/components/color_picker/color_picker.js +30 -7
  30. package/lib/components/datagrid/utils/scrolling.js +37 -8
  31. package/lib/components/flyout/_flyout_overlay.js +33 -3
  32. package/lib/components/flyout/flyout.component.js +13 -9
  33. package/lib/components/flyout/flyout.js +9 -1
  34. package/lib/components/flyout/flyout.styles.js +2 -2
  35. package/lib/components/flyout/flyout_menu.js +2 -1
  36. package/lib/components/flyout/flyout_resizable.js +5 -0
  37. package/lib/components/flyout/manager/actions.js +5 -2
  38. package/lib/components/flyout/manager/flyout_child.js +1 -0
  39. package/lib/components/flyout/manager/flyout_managed.js +5 -3
  40. package/lib/components/flyout/manager/reducer.js +116 -57
  41. package/lib/components/flyout/manager/store.js +13 -6
  42. package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  43. package/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  44. package/lib/components/overlay_mask/overlay_mask.js +10 -3
  45. package/lib/components/tree_view/tree_view_item.styles.js +1 -1
  46. package/lib/services/hooks/index.js +60 -91
  47. package/lib/services/hooks/useIsPointerDown.js +7 -14
  48. package/lib/services/index.js +70 -11
  49. package/optimize/es/components/color_picker/color_picker.js +31 -8
  50. package/optimize/es/components/datagrid/utils/scrolling.js +39 -10
  51. package/optimize/es/components/flyout/_flyout_overlay.js +34 -4
  52. package/optimize/es/components/flyout/flyout.component.js +13 -9
  53. package/optimize/es/components/flyout/flyout.js +4 -1
  54. package/optimize/es/components/flyout/flyout.styles.js +2 -2
  55. package/optimize/es/components/flyout/flyout_menu.js +2 -1
  56. package/optimize/es/components/flyout/manager/actions.js +5 -2
  57. package/optimize/es/components/flyout/manager/flyout_managed.js +4 -3
  58. package/optimize/es/components/flyout/manager/reducer.js +116 -57
  59. package/optimize/es/components/flyout/manager/store.js +13 -6
  60. package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  61. package/optimize/es/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +172 -0
  62. package/optimize/es/components/overlay_mask/overlay_mask.js +4 -2
  63. package/optimize/es/components/tree_view/tree_view_item.styles.js +1 -1
  64. package/optimize/es/services/hooks/index.js +8 -8
  65. package/optimize/es/services/hooks/useIsPointerDown.js +6 -10
  66. package/optimize/es/services/index.js +1 -1
  67. package/optimize/lib/components/color_picker/color_picker.js +30 -7
  68. package/optimize/lib/components/datagrid/utils/scrolling.js +37 -8
  69. package/optimize/lib/components/flyout/_flyout_overlay.js +33 -3
  70. package/optimize/lib/components/flyout/flyout.component.js +13 -9
  71. package/optimize/lib/components/flyout/flyout.js +4 -1
  72. package/optimize/lib/components/flyout/flyout.styles.js +2 -2
  73. package/optimize/lib/components/flyout/flyout_menu.js +2 -1
  74. package/optimize/lib/components/flyout/manager/actions.js +5 -2
  75. package/optimize/lib/components/flyout/manager/flyout_managed.js +4 -3
  76. package/optimize/lib/components/flyout/manager/reducer.js +116 -57
  77. package/optimize/lib/components/flyout/manager/store.js +13 -6
  78. package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  79. package/optimize/lib/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  80. package/optimize/lib/components/overlay_mask/overlay_mask.js +4 -2
  81. package/optimize/lib/components/tree_view/tree_view_item.styles.js +1 -1
  82. package/optimize/lib/services/hooks/index.js +60 -91
  83. package/optimize/lib/services/hooks/useIsPointerDown.js +5 -10
  84. package/optimize/lib/services/index.js +70 -11
  85. package/package.json +4 -4
  86. package/test-env/components/button/split_button/split_button.js +13 -0
  87. package/test-env/components/button/split_button/split_button_actions.js +15 -0
  88. package/test-env/components/collapsible_nav/collapsible_nav.js +5 -0
  89. package/test-env/components/color_picker/color_picker.js +30 -7
  90. package/test-env/components/datagrid/utils/scrolling.js +37 -8
  91. package/test-env/components/flyout/_flyout_overlay.js +33 -3
  92. package/test-env/components/flyout/flyout.component.js +13 -9
  93. package/test-env/components/flyout/flyout.styles.js +2 -2
  94. package/test-env/components/flyout/flyout_menu.js +2 -1
  95. package/test-env/components/flyout/flyout_resizable.js +5 -0
  96. package/test-env/components/flyout/manager/actions.js +5 -2
  97. package/test-env/components/flyout/manager/flyout_child.js +1 -0
  98. package/test-env/components/flyout/manager/flyout_managed.js +5 -3
  99. package/test-env/components/flyout/manager/reducer.js +116 -57
  100. package/test-env/components/flyout/manager/store.js +13 -6
  101. package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -1
  102. package/test-env/components/markdown_editor/plugins/remark/remark_intraword_underscore.js +179 -0
  103. package/test-env/components/overlay_mask/overlay_mask.js +10 -3
  104. package/test-env/components/tree_view/tree_view_item.styles.js +1 -1
  105. package/test-env/services/hooks/index.js +60 -91
  106. package/test-env/services/hooks/useIsPointerDown.js +5 -10
  107. package/test-env/services/index.js +70 -11
@@ -106,6 +106,19 @@ _EuiSplitButton.propTypes = {
106
106
  "aria-label": _propTypes.default.string,
107
107
  "data-test-subj": _propTypes.default.string,
108
108
  css: _propTypes.default.any,
109
+ /**
110
+ * Controls the disabled behavior via the native `disabled` attribute.
111
+ */
112
+ isDisabled: _propTypes.default.bool,
113
+ /**
114
+ * NOTE: Beta feature, may be changed or removed in the future
115
+ *
116
+ * Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
117
+ * This results in a semantically disabled button without the default browser handling of the disabled state.
118
+ *
119
+ * Use e.g. when a disabled button should have a tooltip.
120
+ */
121
+ hasAriaDisabled: _propTypes.default.bool,
109
122
  size: _propTypes.default.any,
110
123
  color: _propTypes.default.any,
111
124
  fill: _propTypes.default.bool,
@@ -69,6 +69,19 @@ var EuiSplitButtonActionPrimary = exports.EuiSplitButtonActionPrimary = function
69
69
  return tooltipProps ? (0, _react2.jsx)(_tool_tip.EuiToolTip, tooltipProps, button) : button;
70
70
  };
71
71
  EuiSplitButtonActionPrimary.propTypes = {
72
+ /**
73
+ * Controls the disabled behavior via the native `disabled` attribute.
74
+ */
75
+ isDisabled: _propTypes.default.bool,
76
+ /**
77
+ * NOTE: Beta feature, may be changed or removed in the future
78
+ *
79
+ * Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
80
+ * This results in a semantically disabled button without the default browser handling of the disabled state.
81
+ *
82
+ * Use e.g. when a disabled button should have a tooltip.
83
+ */
84
+ hasAriaDisabled: _propTypes.default.bool,
72
85
  /**
73
86
  * Enables rendering an `EuiToolTip` with the passed props.
74
87
  */
@@ -111,6 +124,8 @@ var EuiSplitButtonActionSecondary = exports.EuiSplitButtonActionSecondary = func
111
124
  })) : action;
112
125
  };
113
126
  EuiSplitButtonActionSecondary.propTypes = {
127
+ isDisabled: _propTypes.default.bool,
128
+ hasAriaDisabled: _propTypes.default.bool,
114
129
  /**
115
130
  * Enables rendering an `EuiToolTip` with the passed props.
116
131
  */
@@ -137,6 +137,11 @@ EuiCollapsibleNav.propTypes = {
137
137
  * @default undefined (auto-inherit when nested, otherwise 'never')
138
138
  */
139
139
  session: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
140
+ /**
141
+ * Optional Symbol to scope flyout history. Only flyouts that receive the same Symbol reference share Back button and history; omit to get a unique group per session.
142
+ * @default undefined (each session gets a unique key and does not share history)
143
+ */
144
+ historyKey: _propTypes.default.any,
140
145
  /**
141
146
  * Callback fired when the flyout becomes active/visible, which may happen programmatically from history navigation.
142
147
  */
@@ -101,9 +101,12 @@ var EuiColorPicker = exports.EuiColorPicker = function EuiColorPicker(_ref) {
101
101
  _ref$isClearable = _ref.isClearable,
102
102
  isClearable = _ref$isClearable === void 0 ? false : _ref$isClearable,
103
103
  placeholder = _ref.placeholder,
104
- dataTestSubj = _ref['data-test-subj'];
105
- var _useEuiI18n = (0, _i18n.useEuiI18n)(['euiColorPicker.popoverLabel', 'euiColorPicker.colorLabel', 'euiColorPicker.selectedColorLabel', 'euiColorPicker.colorErrorMessage', 'euiColorPicker.transparent', 'euiColorPicker.alphaLabel', 'euiColorPicker.openLabel', 'euiColorPicker.closeLabel'], ['Color selection dialog', 'Color value', 'Selected color', 'Invalid color value', 'Transparent', 'Alpha channel (opacity) value', 'Press the escape key to close the popover', 'Press the down key to open a popover containing color options']),
106
- _useEuiI18n2 = _slicedToArray(_useEuiI18n, 8),
104
+ dataTestSubj = _ref['data-test-subj'],
105
+ _ariaLabel = _ref['aria-label'],
106
+ ariaLabelledby = _ref['aria-labelledby'],
107
+ ariaDescribedby = _ref['aria-describedby'];
108
+ var _useEuiI18n = (0, _i18n.useEuiI18n)(['euiColorPicker.popoverLabel', 'euiColorPicker.colorLabel', 'euiColorPicker.selectedColorLabel', 'euiColorPicker.colorErrorMessage', 'euiColorPicker.transparent', 'euiColorPicker.alphaLabel', 'euiColorPicker.openLabel', 'euiColorPicker.closeLabel', 'euiColorPicker.ariaLabel'], ['Color selection dialog', 'Color value', 'Selected color', 'Invalid color value', 'Transparent', 'Alpha channel (opacity) value', 'Press the escape key to close the popover', 'Press the down key to open a popover containing color options', 'Select a color']),
109
+ _useEuiI18n2 = _slicedToArray(_useEuiI18n, 9),
107
110
  popoverLabel = _useEuiI18n2[0],
108
111
  colorLabel = _useEuiI18n2[1],
109
112
  selectedColorLabel = _useEuiI18n2[2],
@@ -111,7 +114,16 @@ var EuiColorPicker = exports.EuiColorPicker = function EuiColorPicker(_ref) {
111
114
  transparent = _useEuiI18n2[4],
112
115
  alphaLabel = _useEuiI18n2[5],
113
116
  openLabel = _useEuiI18n2[6],
114
- closeLabel = _useEuiI18n2[7];
117
+ closeLabel = _useEuiI18n2[7],
118
+ ariaLabel = _useEuiI18n2[8];
119
+ var openLabelId = (0, _services.useGeneratedHtmlId)({
120
+ prefix: 'colorPicker',
121
+ suffix: 'openLabel'
122
+ });
123
+ var closeLabelId = (0, _services.useGeneratedHtmlId)({
124
+ prefix: 'colorPicker',
125
+ suffix: 'closeLabel'
126
+ });
115
127
  var defaultSwatches = (0, _services.useEuiPaletteColorBlind)();
116
128
  var swatches = _swatches !== null && _swatches !== void 0 ? _swatches : defaultSwatches;
117
129
  var preferredFormat = (0, _react.useMemo)(function () {
@@ -440,10 +452,21 @@ var EuiColorPicker = exports.EuiColorPicker = function EuiColorPicker(_ref) {
440
452
  readOnly: readOnly,
441
453
  fullWidth: fullWidth,
442
454
  autoComplete: "off",
443
- "data-test-subj": testSubjAnchor,
444
- "aria-label": isColorSelectorShown ? openLabel : closeLabel,
455
+ "data-test-subj": testSubjAnchor
456
+ // if an id is provided it might be used in combination with `htmlFor` on a label,
457
+ // so we don't want to override it with a fallback `aria-label`
458
+ ,
459
+ "aria-label": _ariaLabel ? _ariaLabel : id || ariaLabelledby ? undefined : ariaLabel,
460
+ "aria-labelledby": ariaLabelledby,
461
+ "aria-describedby": (0, _classnames.default)(isColorSelectorShown ? openLabelId : closeLabelId, ariaDescribedby),
445
462
  controlOnly: true // Don't need two EuiFormControlwrappers
446
- }));
463
+ }), (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("span", null, (0, _react2.jsx)("span", {
464
+ id: openLabelId,
465
+ "aria-hidden": !isColorSelectorShown
466
+ }, openLabel), (0, _react2.jsx)("span", {
467
+ id: closeLabelId,
468
+ "aria-hidden": isColorSelectorShown
469
+ }, closeLabel))));
447
470
  }
448
471
  return display === 'inline' ? (0, _react2.jsx)("div", {
449
472
  css: styles.euiColorPicker,
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.useScrollCellIntoView = exports.useScrollBars = exports.useScroll = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _services = require("../../../services");
10
+ var _hooks = require("../../../services/hooks");
10
11
  var _global_styling = require("../../../global_styling");
11
12
  var _cell = require("../body/cell");
12
13
  var _focus = require("./focus");
@@ -35,20 +36,48 @@ var useScroll = exports.useScroll = function useScroll(args) {
35
36
  scrollCellIntoView = _useScrollCellIntoVie.scrollCellIntoView;
36
37
  var _useContext = (0, _react.useContext)(_focus.DataGridFocusContext),
37
38
  focusedCell = _useContext.focusedCell;
38
- var isPointerDown = (0, _services.useIsPointerDown)(args.outerGridRef);
39
+ var isPointerDownRef = (0, _hooks.useIsPointerDown)(args.outerGridRef);
40
+
41
+ /**
42
+ * Set when `focusedCell` changes while the pointer is held down (e.g. clicking a cell).
43
+ * Allows the `pointerup` listener below to scroll on release without
44
+ * causing snap-back when the user scrolls the grid without changing focus.
45
+ */
46
+ var pendingScrollRef = (0, _react.useRef)(false);
47
+ (0, _react.useEffect)(function () {
48
+ if (!focusedCell) return;
49
+ if (isPointerDownRef.current) {
50
+ // Pointer is down - defer scroll decision to the pointerup listener
51
+ pendingScrollRef.current = true;
52
+ return;
53
+ }
54
+ scrollCellIntoView({
55
+ rowIndex: focusedCell[1],
56
+ colIndex: focusedCell[0]
57
+ });
58
+ }, [focusedCell, scrollCellIntoView, isPointerDownRef]);
39
59
  (0, _react.useEffect)(function () {
40
- if (focusedCell) {
60
+ var handlePointerUp = function handlePointerUp() {
41
61
  var _window;
42
- // do not scroll if text is being selected
43
- if (isPointerDown || ((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') {
44
- return;
45
- }
62
+ if (!pendingScrollRef.current || !focusedCell) return;
63
+ pendingScrollRef.current = false;
64
+
65
+ // Skip if the interaction resulted in text being selected
66
+ if (((_window = window) === null || _window === void 0 || (_window = _window.getSelection()) === null || _window === void 0 ? void 0 : _window.type) === 'Range') return;
46
67
  scrollCellIntoView({
47
68
  rowIndex: focusedCell[1],
48
69
  colIndex: focusedCell[0]
49
70
  });
50
- }
51
- }, [focusedCell, isPointerDown, scrollCellIntoView]);
71
+ };
72
+ document.addEventListener('pointerup', handlePointerUp, {
73
+ capture: true
74
+ });
75
+ return function () {
76
+ return document.removeEventListener('pointerup', handlePointerUp, {
77
+ capture: true
78
+ });
79
+ };
80
+ }, [focusedCell, scrollCellIntoView]);
52
81
  var _useContext2 = (0, _react.useContext)(_cell.DataGridCellPopoverContext),
53
82
  popoverIsOpen = _useContext2.popoverIsOpen,
54
83
  cellLocation = _useContext2.cellLocation;
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.EuiFlyoutOverlay = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _css = require("@emotion/css");
10
+ var _services = require("../../services");
10
11
  var _overlay_mask = require("../overlay_mask");
11
12
  var _portal = require("../portal");
12
13
  var _react2 = require("@emotion/react");
@@ -23,8 +24,7 @@ var getEuiFlyoutOverlayStyles = function getEuiFlyoutOverlayStyles(zIndex) {
23
24
  /*
24
25
  This needs to have !important to override the default EuiOverlayMask
25
26
  z-index based on the headerZindexLocation prop. Using the style attribute
26
- doesn't work since EuiOverlayMask requires a string style prop that
27
- causes React errors in the test environment.
27
+ doesn't work since EuiOverlayMask requires the styles to be provided via className
28
28
  */
29
29
  return /*#__PURE__*/(0, _css.css)("z-index:", zIndex, "!important;;label:getEuiFlyoutOverlayStyles;");
30
30
  };
@@ -45,10 +45,39 @@ var EuiFlyoutOverlay = exports.EuiFlyoutOverlay = function EuiFlyoutOverlay(_ref
45
45
  hasOverlayMask = _ref.hasOverlayMask,
46
46
  maskZIndex = _ref.maskZIndex,
47
47
  _ref$headerZindexLoca = _ref.headerZindexLocation,
48
- headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'below' : _ref$headerZindexLoca;
48
+ headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'below' : _ref$headerZindexLoca,
49
+ containerRect = _ref.containerRect;
49
50
  var styles = (0, _react.useMemo)(function () {
50
51
  return getEuiFlyoutOverlayStyles(maskZIndex);
51
52
  }, [maskZIndex]);
53
+
54
+ // Internal ref so we can apply containerRect positioning directly on the DOM
55
+ // node, avoiding new Emotion CSS class generation on every scroll/resize.
56
+ var internalMaskRef = (0, _react.useRef)(null);
57
+ var combinedMaskRef = (0, _services.useCombinedRefs)([internalMaskRef, maskProps === null || maskProps === void 0 ? void 0 : maskProps.maskRef]);
58
+ (0, _react.useEffect)(function () {
59
+ var node = internalMaskRef.current;
60
+ if (!node) return;
61
+
62
+ // containerRect positioning must be applied via node.style.setProperty rather than
63
+ // through the style prop - EuiOverlayMask requires styles to be passed via className
64
+ if (containerRect) {
65
+ node.style.setProperty('inset-block-start', "".concat(containerRect.top, "px"));
66
+ node.style.setProperty('inset-inline-start', "".concat(containerRect.left, "px"));
67
+ node.style.setProperty('inline-size', "".concat(containerRect.width, "px"));
68
+ node.style.setProperty('block-size', "".concat(containerRect.height, "px"));
69
+ node.style.setProperty('inset-inline-end', 'auto');
70
+ node.style.setProperty('inset-block-end', 'auto');
71
+ } else {
72
+ node.style.removeProperty('inset-block-start');
73
+ node.style.removeProperty('inset-inline-start');
74
+ node.style.removeProperty('inline-size');
75
+ node.style.removeProperty('block-size');
76
+ node.style.removeProperty('inset-inline-end');
77
+ node.style.removeProperty('inset-block-end');
78
+ }
79
+ }, [containerRect, hasOverlayMask]); // toggling ownFocus while the flyout is already open should cause re-render
80
+
52
81
  var content = children;
53
82
  if (!isPushed || hasOverlayMask) {
54
83
  content = (0, _react2.jsx)(_portal.EuiPortal, null, content);
@@ -57,6 +86,7 @@ var EuiFlyoutOverlay = exports.EuiFlyoutOverlay = function EuiFlyoutOverlay(_ref
57
86
  return (0, _react2.jsx)(_react.default.Fragment, null, hasOverlayMask && (0, _react2.jsx)(_overlay_mask.EuiOverlayMask, _extends({
58
87
  headerZindexLocation: (_maskProps$headerZind = maskProps === null || maskProps === void 0 ? void 0 : maskProps.headerZindexLocation) !== null && _maskProps$headerZind !== void 0 ? _maskProps$headerZind : headerZindexLocation
59
88
  }, maskProps, {
89
+ maskRef: combinedMaskRef,
60
90
  className: classes
61
91
  })), content);
62
92
  };
@@ -27,7 +27,7 @@ var _use_flyout_z_index = require("./use_flyout_z_index");
27
27
  var _flyout_parent_context = require("./flyout_parent_context");
28
28
  var _use_flyout_menu = require("./use_flyout_menu");
29
29
  var _react2 = require("@emotion/react");
30
- var _excluded = ["className", "children", "as", "hideCloseButton", "flyoutMenuProps", "flyoutMenuDisplayMode", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "hasChildBackground", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "includeSelectorInFocusTrap", "aria-describedby", "aria-labelledby", "id", "resizable", "minWidth", "onResize", "onAnimationEnd", "container"];
30
+ var _excluded = ["className", "children", "as", "hideCloseButton", "flyoutMenuProps", "flyoutMenuDisplayMode", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "hasChildBackground", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "pushAnimation", "hasAnimation", "focusTrapProps", "includeFixedHeadersInFocusTrap", "includeSelectorInFocusTrap", "aria-describedby", "aria-labelledby", "id", "resizable", "minWidth", "onResize", "onAnimationEnd", "container"];
31
31
  /*
32
32
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
33
33
  * or more contributor license agreements. Licensed under the Elastic License
@@ -107,23 +107,25 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
107
107
  outsideClickCloses = _usePropsWithComponen.outsideClickCloses,
108
108
  _usePropsWithComponen12 = _usePropsWithComponen.pushMinBreakpoint,
109
109
  pushMinBreakpoint = _usePropsWithComponen12 === void 0 ? _const2.DEFAULT_PUSH_MIN_BREAKPOINT : _usePropsWithComponen12,
110
- _usePropsWithComponen13 = _usePropsWithComponen.pushAnimation,
111
- pushAnimation = _usePropsWithComponen13 === void 0 ? false : _usePropsWithComponen13,
110
+ _pushAnimation = _usePropsWithComponen.pushAnimation,
111
+ _hasAnimation = _usePropsWithComponen.hasAnimation,
112
112
  _focusTrapProps = _usePropsWithComponen.focusTrapProps,
113
- _usePropsWithComponen14 = _usePropsWithComponen.includeFixedHeadersInFocusTrap,
114
- includeFixedHeadersInFocusTrap = _usePropsWithComponen14 === void 0 ? true : _usePropsWithComponen14,
113
+ _usePropsWithComponen13 = _usePropsWithComponen.includeFixedHeadersInFocusTrap,
114
+ includeFixedHeadersInFocusTrap = _usePropsWithComponen13 === void 0 ? true : _usePropsWithComponen13,
115
115
  includeSelectorInFocusTrap = _usePropsWithComponen.includeSelectorInFocusTrap,
116
116
  _ariaDescribedBy = _usePropsWithComponen['aria-describedby'],
117
117
  _ariaLabelledBy = _usePropsWithComponen['aria-labelledby'],
118
118
  id = _usePropsWithComponen.id,
119
- _usePropsWithComponen15 = _usePropsWithComponen.resizable,
120
- resizable = _usePropsWithComponen15 === void 0 ? false : _usePropsWithComponen15,
119
+ _usePropsWithComponen14 = _usePropsWithComponen.resizable,
120
+ resizable = _usePropsWithComponen14 === void 0 ? false : _usePropsWithComponen14,
121
121
  minWidth = _usePropsWithComponen.minWidth,
122
122
  onResize = _usePropsWithComponen.onResize,
123
123
  onAnimationEnd = _usePropsWithComponen.onAnimationEnd,
124
124
  containerProp = _usePropsWithComponen.container,
125
125
  rest = _objectWithoutProperties(_usePropsWithComponen, _excluded);
126
126
  var container = resolveContainer(containerProp);
127
+ var hasAnimationDefault = type === 'overlay';
128
+ var hasAnimation = _hasAnimation !== null && _hasAnimation !== void 0 ? _hasAnimation : hasAnimationDefault;
127
129
  var _useEuiThemeCSSVariab = (0, _services.useEuiThemeCSSVariables)(),
128
130
  setGlobalCSSVariables = _useEuiThemeCSSVariab.setGlobalCSSVariables;
129
131
  var Element = as || defaultElement;
@@ -544,7 +546,7 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
544
546
  return _objectSpread(_objectSpread(_objectSpread({}, style), composedStyles), containerPositionStyles);
545
547
  }, [style, size, layoutMode, siblingFlyoutId, siblingFlyoutWidth, maxWidth, flyoutZIndex, containerRect, side, isChildFlyout]);
546
548
  var styles = (0, _services.useEuiMemoizedStyles)(_flyout.euiFlyoutStyles);
547
- var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], (0, _const2.isEuiFlyoutSizeNamed)(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], isPushed && !pushAnimation && styles.push.noAnimation, styles[side]];
549
+ var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], (0, _const2.isEuiFlyoutSizeNamed)(size) && styles[size], maxWidth === false && styles.noMaxWidth, isPushed ? styles.push.push : styles.overlay.overlay, isPushed ? styles.push[side] : styles.overlay[side], !hasAnimation && styles.noAnimation, styles[side]];
548
550
  var classes = (0, _classnames.default)('euiFlyout', isChildFlyout && hasChildBackground && 'euiFlyout--hasChildBackground', className);
549
551
  var flyoutToggle = (0, _react.useRef)(document.activeElement);
550
552
  var _useState5 = (0, _react.useState)([]),
@@ -680,8 +682,10 @@ var EuiFlyoutComponent = exports.EuiFlyoutComponent = /*#__PURE__*/(0, _react.fo
680
682
  isPushed: isPushed,
681
683
  maskZIndex: maskZIndex,
682
684
  headerZindexLocation: effectiveHeaderZindexLocation,
685
+ containerRect: containerRect,
683
686
  maskProps: _objectSpread(_objectSpread({}, maskProps), {}, {
684
- maskRef: maskCombinedRefs
687
+ maskRef: maskCombinedRefs,
688
+ hasAnimation: hasAnimation
685
689
  })
686
690
  }, (0, _react2.jsx)(_services.EuiWindowEvent, {
687
691
  event: "keydown",
@@ -45,7 +45,7 @@ var _flyout_parent_context = require("./flyout_parent_context");
45
45
  var _const = require("./manager/const");
46
46
  var _react2 = require("@emotion/react");
47
47
  var _const2 = require("./const");
48
- var _excluded = ["as", "onClose", "onActive", "session"];
48
+ var _excluded = ["as", "onClose", "onActive", "session", "historyKey"];
49
49
  /*
50
50
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
51
51
  * or more contributor license agreements. Licensed under the Elastic License
@@ -65,6 +65,7 @@ var EuiFlyout = exports.EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function
65
65
  onClose = _usePropsWithComponen.onClose,
66
66
  onActive = _usePropsWithComponen.onActive,
67
67
  session = _usePropsWithComponen.session,
68
+ historyKey = _usePropsWithComponen.historyKey,
68
69
  rest = _objectWithoutProperties(_usePropsWithComponen, _excluded);
69
70
  var hasActiveSession = (0, _manager.useHasActiveSession)();
70
71
  var isInsideParentFlyout = (0, _flyout_parent_context.useIsInsideParentFlyout)();
@@ -91,6 +92,7 @@ var EuiFlyout = exports.EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function
91
92
  return null;
92
93
  }
93
94
  return (0, _react2.jsx)(_manager.EuiFlyoutMain, _extends({}, rest, {
95
+ historyKey: historyKey,
94
96
  onClose: onClose,
95
97
  onActive: onActive,
96
98
  as: "div",
@@ -101,6 +103,7 @@ var EuiFlyout = exports.EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function
101
103
  // session=inherit: auto-join existing session as child
102
104
  if (hasActiveSession && effectiveSession === _const.SESSION_INHERIT) {
103
105
  return (0, _react2.jsx)(_manager.EuiFlyoutChild, _extends({}, rest, {
106
+ historyKey: historyKey,
104
107
  onClose: onClose,
105
108
  onActive: onActive,
106
109
  as: "div",
@@ -134,6 +137,11 @@ EuiFlyout.propTypes = {
134
137
  * @default undefined (auto-inherit when nested, otherwise 'never')
135
138
  */
136
139
  session: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
140
+ /**
141
+ * Optional Symbol to scope flyout history. Only flyouts that receive the same Symbol reference share Back button and history; omit to get a unique group per session.
142
+ * @default undefined (each session gets a unique key and does not share history)
143
+ */
144
+ historyKey: _propTypes.default.any,
137
145
  /**
138
146
  * Callback fired when the flyout becomes active/visible, which may happen programmatically from history navigation.
139
147
  */
@@ -76,9 +76,9 @@ var euiFlyoutStyles = exports.euiFlyoutStyles = function euiFlyoutStyles(euiThem
76
76
  push: {
77
77
  push: /*#__PURE__*/(0, _react.css)("clip-path:none;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
78
78
  right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thick), ";;label:right;"),
79
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thick), ";;label:left;"),
80
- noAnimation: _ref
79
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thick), ";;label:left;")
81
80
  },
81
+ noAnimation: _ref,
82
82
  // Padding
83
83
  paddingSizes: {
84
84
  none: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 'none'), ";;label:none;"),
@@ -19,7 +19,7 @@ var _flyout_menu = require("./flyout_menu.styles");
19
19
  var _flyout_menu_context = require("./flyout_menu_context");
20
20
  var _i18n = require("../i18n");
21
21
  var _react2 = require("@emotion/react");
22
- var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions"];
22
+ var _excluded = ["className", "title", "titleId", "hideTitle", "hideCloseButton", "historyItems", "showBackButton", "backButtonProps", "customActions", "iconType"];
23
23
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
24
24
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
25
25
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -116,6 +116,7 @@ var EuiFlyoutMenu = exports.EuiFlyoutMenu = function EuiFlyoutMenu(_ref2) {
116
116
  showBackButton = _ref2.showBackButton,
117
117
  backButtonProps = _ref2.backButtonProps,
118
118
  customActions = _ref2.customActions,
119
+ _iconType = _ref2.iconType,
119
120
  rest = _objectWithoutProperties(_ref2, _excluded);
120
121
  var _useContext = (0, _react.useContext)(_flyout_menu_context.EuiFlyoutMenuContext),
121
122
  onClose = _useContext.onClose;
@@ -44,6 +44,11 @@ EuiFlyoutResizable.propTypes = {
44
44
  * @default undefined (auto-inherit when nested, otherwise 'never')
45
45
  */
46
46
  session: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
47
+ /**
48
+ * Optional Symbol to scope flyout history. Only flyouts that receive the same Symbol reference share Back button and history; omit to get a unique group per session.
49
+ * @default undefined (each session gets a unique key and does not share history)
50
+ */
51
+ historyKey: _propTypes.default.any,
47
52
  /**
48
53
  * Callback fired when the flyout becomes active/visible, which may happen programmatically from history navigation.
49
54
  */
@@ -75,19 +75,22 @@ var ACTION_CLOSE_UNMANAGED_FLYOUT = exports.ACTION_CLOSE_UNMANAGED_FLYOUT = "".c
75
75
  * - `title` is used for the flyout menu.
76
76
  * - `level` determines whether the flyout is `main` or `child`.
77
77
  * - Optional `size` is the named EUI size (e.g. `s`, `m`, `l`).
78
+ * - Optional `historyKey` (Symbol) scopes history; only flyouts with the same reference share Back/history. Omit for a unique group per session.
78
79
  * - Optional `iconType` is shown next to the session title in the history menu.
79
80
  */
80
81
  var addFlyout = exports.addFlyout = function addFlyout(flyoutId, title) {
81
82
  var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _const.LEVEL_MAIN;
82
83
  var size = arguments.length > 3 ? arguments[3] : undefined;
83
- var iconType = arguments.length > 4 ? arguments[4] : undefined;
84
- var minWidth = arguments.length > 5 ? arguments[5] : undefined;
84
+ var historyKey = arguments.length > 4 ? arguments[4] : undefined;
85
+ var iconType = arguments.length > 5 ? arguments[5] : undefined;
86
+ var minWidth = arguments.length > 6 ? arguments[6] : undefined;
85
87
  return {
86
88
  type: ACTION_ADD,
87
89
  flyoutId: flyoutId,
88
90
  title: title,
89
91
  level: level,
90
92
  size: size,
93
+ historyKey: historyKey,
91
94
  iconType: iconType,
92
95
  minWidth: minWidth
93
96
  };
@@ -96,6 +96,7 @@ var EuiFlyoutChild = exports.EuiFlyoutChild = /*#__PURE__*/(0, _react.forwardRef
96
96
  }));
97
97
  });
98
98
  EuiFlyoutChild.propTypes = {
99
+ historyKey: _propTypes.default.any,
99
100
  flyoutMenuProps: _propTypes.default.shape({
100
101
  className: _propTypes.default.string,
101
102
  "aria-label": _propTypes.default.string,
@@ -22,7 +22,7 @@ var _selectors = require("./selectors");
22
22
  var _store = require("./store");
23
23
  var _validation = require("./validation");
24
24
  var _react2 = require("@emotion/react");
25
- var _excluded = ["id", "onClose", "onActive", "level", "size", "minWidth", "css", "flyoutMenuProps"];
25
+ var _excluded = ["id", "onClose", "onActive", "level", "size", "minWidth", "historyKey", "css", "flyoutMenuProps"];
26
26
  /*
27
27
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
28
28
  * or more contributor license agreements. Licensed under the Elastic License
@@ -75,6 +75,7 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
75
75
  level = _ref.level,
76
76
  sizeProp = _ref.size,
77
77
  minWidth = _ref.minWidth,
78
+ historyKey = _ref.historyKey,
78
79
  customCss = _ref.css,
79
80
  _flyoutMenuProps = _ref.flyoutMenuProps,
80
81
  props = _objectWithoutProperties(_ref, _excluded);
@@ -173,7 +174,7 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
173
174
  // Register with flyout manager context when open, remove when closed
174
175
  // Using useLayoutEffect to run synchronously before DOM updates
175
176
  (0, _react.useLayoutEffect)(function () {
176
- addFlyout(flyoutId, title, level, size, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, typeof minWidth === 'number' ? minWidth : undefined);
177
+ addFlyout(flyoutId, title, level, size, level === _const.LEVEL_MAIN ? historyKey : undefined, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, typeof minWidth === 'number' ? minWidth : undefined);
177
178
  return function () {
178
179
  var currentStoreState = (0, _store.getFlyoutManagerStore)().getState();
179
180
  var stillInStore = currentStoreState.flyouts.some(function (f) {
@@ -189,7 +190,7 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
189
190
  }
190
191
  wasRegisteredRef.current = false;
191
192
  };
192
- }, [flyoutId, title, level, size, minWidth, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, addFlyout, closeFlyout, closeAllFlyouts]);
193
+ }, [flyoutId, title, level, size, minWidth, historyKey, _flyoutMenuProps === null || _flyoutMenuProps === void 0 ? void 0 : _flyoutMenuProps.iconType, addFlyout, closeFlyout, closeAllFlyouts]);
193
194
 
194
195
  // Detect when flyout has been removed from manager state (e.g., via Back button)
195
196
  // and trigger onClose callback to notify the parent component
@@ -291,6 +292,7 @@ var EuiManagedFlyout = exports.EuiManagedFlyout = /*#__PURE__*/(0, _react.forwar
291
292
  });
292
293
  EuiManagedFlyout.propTypes = {
293
294
  level: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired]).isRequired,
295
+ historyKey: _propTypes.default.any,
294
296
  flyoutMenuProps: _propTypes.default.any,
295
297
  onActive: _propTypes.default.func
296
298
  };