@elastic/eui 74.1.0 → 75.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 (27) hide show
  1. package/es/components/collapsible_nav/collapsible_nav.js +10 -11
  2. package/es/components/flyout/flyout.js +88 -24
  3. package/es/components/header/header.js +3 -1
  4. package/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
  5. package/es/components/selectable/selectable_list/selectable_list.js +19 -5
  6. package/eui.d.ts +15 -12
  7. package/i18ntokens.json +50 -2
  8. package/lib/components/collapsible_nav/collapsible_nav.js +10 -11
  9. package/lib/components/flyout/flyout.js +85 -22
  10. package/lib/components/header/header.js +3 -1
  11. package/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
  12. package/lib/components/selectable/selectable_list/selectable_list.js +19 -5
  13. package/optimize/es/components/collapsible_nav/collapsible_nav.js +1 -4
  14. package/optimize/es/components/flyout/flyout.js +81 -24
  15. package/optimize/es/components/header/header.js +3 -1
  16. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
  17. package/optimize/es/components/selectable/selectable_list/selectable_list.js +19 -5
  18. package/optimize/lib/components/collapsible_nav/collapsible_nav.js +1 -4
  19. package/optimize/lib/components/flyout/flyout.js +80 -22
  20. package/optimize/lib/components/header/header.js +3 -1
  21. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
  22. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +16 -5
  23. package/package.json +2 -2
  24. package/test-env/components/collapsible_nav/collapsible_nav.js +10 -11
  25. package/test-env/components/header/header.js +3 -1
  26. package/test-env/components/search_bar/filters/field_value_selection_filter.js +6 -10
  27. package/test-env/components/selectable/selectable_list/selectable_list.js +16 -5
@@ -1,4 +1,4 @@
1
- var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "role", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
1
+ var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || 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
 
@@ -57,8 +57,6 @@ export var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
57
57
  size = _ref$size === void 0 ? 320 : _ref$size,
58
58
  _ref$side = _ref.side,
59
59
  side = _ref$side === void 0 ? 'left' : _ref$side,
60
- _ref$role = _ref.role,
61
- role = _ref$role === void 0 ? null : _ref$role,
62
60
  _ref$ownFocus = _ref.ownFocus,
63
61
  ownFocus = _ref$ownFocus === void 0 ? true : _ref$ownFocus,
64
62
  _ref$outsideClickClos = _ref.outsideClickCloses,
@@ -108,7 +106,6 @@ export var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
108
106
  as: as,
109
107
  size: size,
110
108
  side: side,
111
- role: role,
112
109
  ownFocus: ownFocus,
113
110
  outsideClickCloses: outsideClickCloses,
114
111
  closeButtonPosition: closeButtonPosition,
@@ -216,13 +213,6 @@ EuiCollapsibleNav.propTypes = {
216
213
  */
217
214
  side: PropTypes.any,
218
215
 
219
- /**
220
- * Defaults to `dialog` which is best for most cases of the flyout.
221
- * Otherwise pass in your own, aria-role, or `null` to remove it and use the semantic `as` element instead
222
- * @default dialog
223
- */
224
- role: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.string.isRequired]),
225
-
226
216
  /**
227
217
  * Named breakpoint (`xs` through `xl`) for customizing the minimum window width to enable docking
228
218
  */
@@ -236,6 +226,15 @@ EuiCollapsibleNav.propTypes = {
236
226
  */
237
227
  focusTrapProps: PropTypes.any,
238
228
 
229
+ /**
230
+ * By default, EuiFlyout will consider any fixed `EuiHeader`s that sit alongside or above the EuiFlyout
231
+ * as part of the flyout's focus trap. This prevents focus fighting with interactive elements
232
+ * within fixed headers.
233
+ *
234
+ * Set this to `false` if you need to disable this behavior for a specific reason.
235
+ */
236
+ includeFixedHeadersInFocusTrap: PropTypes.bool,
237
+
239
238
  /**
240
239
  * ReactNode to render as this component's content
241
240
  */
@@ -1,4 +1,12 @@
1
- var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonAriaLabel", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "role", "pushMinBreakpoint", "focusTrapProps"];
1
+ var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap"];
2
+
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+
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."); }
6
+
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
+
9
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
2
10
 
3
11
  function _extends() { _extends = Object.assign || 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
12
 
@@ -31,9 +39,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
31
39
  * in compliance with, at your election, the Elastic License 2.0 or the Server
32
40
  * Side Public License, v 1.
33
41
  */
34
- import React, { useEffect, useRef, useState, forwardRef, Fragment } from 'react';
42
+ import React, { useEffect, useRef, useState, forwardRef } from 'react';
35
43
  import classnames from 'classnames';
36
- import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme } from '../../services';
44
+ import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme, useGeneratedHtmlId } from '../../services';
37
45
  import { logicalStyle } from '../../global_styling';
38
46
  import { EuiFocusTrap } from '../focus_trap';
39
47
  import { EuiOverlayMask } from '../overlay_mask';
@@ -41,6 +49,7 @@ import { EuiButtonIcon } from '../button';
41
49
  import { EuiI18n } from '../i18n';
42
50
  import { useResizeObserver } from '../observer/resize_observer';
43
51
  import { EuiPortal } from '../portal';
52
+ import { EuiScreenReaderOnly } from '../accessibility';
44
53
  import { euiFlyoutStyles, euiFlyoutCloseButtonStyles } from './flyout.styles';
45
54
  import { jsx as ___EmotionJSX } from "@emotion/react";
46
55
  export var TYPES = ['push', 'overlay'];
@@ -64,7 +73,6 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
64
73
  _ref$hideCloseButton = _ref.hideCloseButton,
65
74
  hideCloseButton = _ref$hideCloseButton === void 0 ? false : _ref$hideCloseButton,
66
75
  closeButtonProps = _ref.closeButtonProps,
67
- closeButtonAriaLabel = _ref.closeButtonAriaLabel,
68
76
  _ref$closeButtonPosit = _ref.closeButtonPosition,
69
77
  closeButtonPosition = _ref$closeButtonPosit === void 0 ? 'inside' : _ref$closeButtonPosit,
70
78
  onClose = _ref.onClose,
@@ -83,11 +91,12 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
83
91
  _ref$type = _ref.type,
84
92
  type = _ref$type === void 0 ? 'overlay' : _ref$type,
85
93
  outsideClickCloses = _ref.outsideClickCloses,
86
- _ref$role = _ref.role,
87
- role = _ref$role === void 0 ? 'dialog' : _ref$role,
88
94
  _ref$pushMinBreakpoin = _ref.pushMinBreakpoint,
89
95
  pushMinBreakpoint = _ref$pushMinBreakpoin === void 0 ? 'l' : _ref$pushMinBreakpoin,
90
- focusTrapProps = _ref.focusTrapProps,
96
+ _ref$focusTrapProps = _ref.focusTrapProps,
97
+ _focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
98
+ _ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
99
+ includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
91
100
  rest = _objectWithoutProperties(_ref, _excluded);
92
101
 
93
102
  var Element = as || defaultElement;
@@ -180,7 +189,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
180
189
  display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
181
190
  iconType: "cross",
182
191
  color: "text",
183
- "aria-label": closeButtonAriaLabel || closeAriaLabel,
192
+ "aria-label": closeAriaLabel,
184
193
  "data-test-subj": "euiFlyoutCloseButton"
185
194
  }, closeButtonProps, {
186
195
  className: closeButtonClasses,
@@ -193,24 +202,61 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
193
202
  }));
194
203
  });
195
204
  }
205
+ /*
206
+ * If not disabled, automatically add fixed EuiHeaders as shards
207
+ * to EuiFlyout focus traps, to prevent focus fighting
208
+ */
196
209
 
197
- var hasOverlayMask = ownFocus && !isPushed;
198
210
 
199
- var onClickOutside = function onClickOutside(event) {
200
- // Do not close the flyout for any external click
201
- if (outsideClickCloses === false) return undefined;
211
+ var flyoutToggle = useRef(document.activeElement);
202
212
 
203
- if (hasOverlayMask) {
204
- // The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
205
- if (event.target === maskRef.current) return onClose(event);
213
+ var _useState3 = useState([]),
214
+ _useState4 = _slicedToArray(_useState3, 2),
215
+ fixedHeaders = _useState4[0],
216
+ setFixedHeaders = _useState4[1];
217
+
218
+ useEffect(function () {
219
+ if (includeFixedHeadersInFocusTrap) {
220
+ var fixedHeaderEls = document.querySelectorAll('.euiHeader[data-fixed-header]');
221
+ setFixedHeaders(Array.from(fixedHeaderEls)); // Flyouts that are toggled from fixed headers do not have working
222
+ // focus trap autoFocus, so we need to focus the flyout wrapper ourselves
223
+
224
+ fixedHeaderEls.forEach(function (header) {
225
+ if (header.contains(flyoutToggle.current)) {
226
+ resizeRef === null || resizeRef === void 0 ? void 0 : resizeRef.focus();
227
+ }
228
+ });
206
229
  } else {
207
- // No overlay mask is present, so any outside clicks should close the flyout
208
- if (outsideClickCloses === true) return onClose(event);
209
- } // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
230
+ // Clear existing headers if necessary, e.g. switching to `false`
231
+ setFixedHeaders(function (headers) {
232
+ return headers.length ? [] : headers;
233
+ });
234
+ }
235
+ }, [includeFixedHeadersInFocusTrap, resizeRef]);
210
236
 
237
+ var focusTrapProps = _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
238
+ shards: [].concat(_toConsumableArray(fixedHeaders), _toConsumableArray(_focusTrapProps.shards || []))
239
+ });
240
+ /*
241
+ * Provide meaningful screen reader instructions/details
242
+ */
211
243
 
212
- return undefined;
213
- };
244
+
245
+ var hasOverlayMask = ownFocus && !isPushed;
246
+ var descriptionId = useGeneratedHtmlId();
247
+
248
+ var screenReaderDescription = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
249
+ id: descriptionId
250
+ }, hasOverlayMask ? ___EmotionJSX(EuiI18n, {
251
+ token: "euiFlyout.screenReaderModalDialog",
252
+ default: "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close."
253
+ }) : ___EmotionJSX(EuiI18n, {
254
+ token: "euiFlyout.screenReaderNonModalDialog",
255
+ default: "You are in a non-modal dialog. To close the dialog, press Escape."
256
+ }), ' ', fixedHeaders.length > 0 && ___EmotionJSX(EuiI18n, {
257
+ token: "euiFlyout.screenReaderFixedHeaders",
258
+ default: "You can still continue tabbing through the page headers in addition to the dialog."
259
+ })));
214
260
  /*
215
261
  * Trap focus even when `ownFocus={false}`, otherwise closing
216
262
  * the flyout won't return focus to the originating button.
@@ -225,6 +271,22 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
225
271
  */
226
272
 
227
273
 
274
+ var onClickOutside = function onClickOutside(event) {
275
+ // Do not close the flyout for any external click
276
+ if (outsideClickCloses === false) return undefined;
277
+
278
+ if (hasOverlayMask) {
279
+ // The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
280
+ if (event.target === maskRef.current) return onClose(event);
281
+ } else {
282
+ // No overlay mask is present, so any outside clicks should close the flyout
283
+ if (outsideClickCloses === true) return onClose(event);
284
+ } // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
285
+
286
+
287
+ return undefined;
288
+ };
289
+
228
290
  var flyout = ___EmotionJSX(EuiFocusTrap, _extends({
229
291
  disabled: isPushed,
230
292
  clickOutsideDisables: !ownFocus,
@@ -232,12 +294,14 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
232
294
  }, focusTrapProps), ___EmotionJSX(Element, _extends({
233
295
  css: cssStyles
234
296
  }, rest, {
235
- role: role,
297
+ role: "dialog",
236
298
  className: classes,
237
- tabIndex: -1,
299
+ tabIndex: 0,
300
+ "data-autofocus": true,
301
+ "aria-describedby": !isPushed ? descriptionId : undefined,
238
302
  style: newStyle,
239
303
  ref: setRef
240
- }), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
304
+ }), !isPushed && screenReaderDescription, closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
241
305
 
242
306
 
243
307
  var mergedMaskProps = _objectSpread(_objectSpread({}, maskProps), {}, {
@@ -253,7 +317,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
253
317
  flyout = ___EmotionJSX(EuiPortal, null, flyout);
254
318
  }
255
319
 
256
- return ___EmotionJSX(Fragment, null, ___EmotionJSX(EuiWindowEvent, {
320
+ return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiWindowEvent, {
257
321
  event: "keydown",
258
322
  handler: onKeyDown
259
323
  }), flyout);
@@ -92,7 +92,9 @@ export var EuiHeader = function EuiHeader(_ref) {
92
92
  }
93
93
 
94
94
  return ___EmotionJSX("div", _extends({
95
- className: classes
95
+ className: classes,
96
+ "data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
97
+
96
98
  }, rest), contents);
97
99
  };
98
100
  EuiHeader.propTypes = {
@@ -276,16 +276,16 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
276
276
  if (!multiSelect && autoClose) {
277
277
  this.closePopover();
278
278
 
279
- var _query = checked ? this.props.query.removeSimpleFieldClauses(field) : this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator);
279
+ var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
280
280
 
281
281
  this.props.onChange(_query);
282
282
  } else {
283
283
  if (multiSelect === 'or') {
284
- var _query2 = checked ? this.props.query.removeOrFieldValue(field, value) : this.props.query.addOrFieldValue(field, value, true, operator);
284
+ var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
285
285
 
286
286
  this.props.onChange(_query2);
287
287
  } else {
288
- var _query3 = checked ? this.props.query.removeSimpleFieldValue(field, value) : this.props.query.addSimpleFieldValue(field, value, true, operator);
288
+ var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
289
289
 
290
290
  this.props.onChange(_query3);
291
291
  }
@@ -395,13 +395,9 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
395
395
  listProps: {
396
396
  isVirtualized: isOverSearchThreshold || false
397
397
  },
398
- onChange: function onChange(options) {
399
- var diff = items.find(function (item, index) {
400
- return item.checked !== options[index].checked;
401
- });
402
-
403
- if (diff) {
404
- _this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
398
+ onChange: function onChange(options, event, changedOption) {
399
+ if (changedOption.data) {
400
+ _this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
405
401
  }
406
402
  }
407
403
  }, searchProps), function (list, search) {
@@ -117,6 +117,22 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
117
117
  }
118
118
  });
119
119
 
120
+ _defineProperty(_assertThisInitialized(_this), "ariaSetSize", 0);
121
+
122
+ _defineProperty(_assertThisInitialized(_this), "ariaPosInSetMap", {});
123
+
124
+ _defineProperty(_assertThisInitialized(_this), "calculateAriaSetAttrs", function (optionArray) {
125
+ _this.ariaPosInSetMap = {};
126
+ var latestAriaPosIndex = 0;
127
+ optionArray.forEach(function (option, index) {
128
+ if (!option.isGroupLabel) {
129
+ latestAriaPosIndex++;
130
+ _this.ariaPosInSetMap[index] = latestAriaPosIndex;
131
+ }
132
+ });
133
+ _this.ariaSetSize = latestAriaPosIndex;
134
+ });
135
+
120
136
  _defineProperty(_assertThisInitialized(_this), "ListRow", /*#__PURE__*/memo(function (_ref) {
121
137
  var data = _ref.data,
122
138
  index = _ref.index,
@@ -160,9 +176,6 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
160
176
  }, optionRest), prepend, label, append);
161
177
  }
162
178
 
163
- var labelCount = data.filter(function (option) {
164
- return option.isGroupLabel;
165
- }).length;
166
179
  var id = makeOptionId(index);
167
180
  return ___EmotionJSX(EuiSelectableListItem, _extends({
168
181
  key: id,
@@ -183,8 +196,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
183
196
  disabled: disabled,
184
197
  prepend: prepend,
185
198
  append: append,
186
- "aria-posinset": index + 1 - labelCount,
187
- "aria-setsize": data.length - labelCount,
199
+ "aria-posinset": _this.ariaPosInSetMap[index],
200
+ "aria-setsize": _this.ariaSetSize,
188
201
  onFocusBadge: onFocusBadge,
189
202
  allowExclusions: allowExclusions,
190
203
  showIcons: showIcons,
@@ -341,6 +354,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
341
354
  rest = _objectWithoutProperties(_this$props7, _excluded3);
342
355
 
343
356
  var optionArray = visibleOptions || options;
357
+ this.calculateAriaSetAttrs(optionArray);
344
358
  var heightIsFull = forcedHeight === 'full';
345
359
  var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
346
360
 
package/eui.d.ts CHANGED
@@ -9765,11 +9765,6 @@ declare module '@elastic/eui/src/components/flyout/flyout' {
9765
9765
  * @default false
9766
9766
  */
9767
9767
  hideCloseButton?: boolean;
9768
- /**
9769
- * Specify a custom aria-label for the close button of the flyout.
9770
- * @default "Close this dialog"
9771
- */
9772
- closeButtonAriaLabel?: string;
9773
9768
  /**
9774
9769
  * Extends EuiButtonIconProps onto the close button
9775
9770
  */
@@ -9802,12 +9797,6 @@ declare module '@elastic/eui/src/components/flyout/flyout' {
9802
9797
  * @default right
9803
9798
  */
9804
9799
  side?: _EuiFlyoutSide;
9805
- /**
9806
- * Defaults to `dialog` which is best for most cases of the flyout.
9807
- * Otherwise pass in your own, aria-role, or `null` to remove it and use the semantic `as` element instead
9808
- * @default dialog
9809
- */
9810
- role?: null | string;
9811
9800
  /**
9812
9801
  * Named breakpoint (`xs` through `xl`) for customizing the minimum window width to enable the `push` type
9813
9802
  * @default l
@@ -9820,6 +9809,14 @@ declare module '@elastic/eui/src/components/flyout/flyout' {
9820
9809
  * `closeOnMouseup` will delay the close callback, allowing time for external toggle buttons to handle close behavior.
9821
9810
  */
9822
9811
  focusTrapProps?: Pick<EuiFocusTrapProps, 'closeOnMouseup' | 'shards'>;
9812
+ /**
9813
+ * By default, EuiFlyout will consider any fixed `EuiHeader`s that sit alongside or above the EuiFlyout
9814
+ * as part of the flyout's focus trap. This prevents focus fighting with interactive elements
9815
+ * within fixed headers.
9816
+ *
9817
+ * Set this to `false` if you need to disable this behavior for a specific reason.
9818
+ */
9819
+ includeFixedHeadersInFocusTrap?: boolean;
9823
9820
  } const defaultElement = "div"; type Props<T extends ElementType> = CommonProps & {
9824
9821
  /**
9825
9822
  * Sets the HTML element for `EuiFlyout`
@@ -9901,7 +9898,7 @@ declare module '@elastic/eui/src/components/flyout' {
9901
9898
  declare module '@elastic/eui/src/components/collapsible_nav/collapsible_nav' {
9902
9899
  import { FunctionComponent, ReactElement, ReactNode } from 'react';
9903
9900
  import { EuiFlyoutProps } from '@elastic/eui/src/components/flyout';
9904
- export type EuiCollapsibleNavProps = Omit<EuiFlyoutProps, 'closeButtonAriaLabel' | 'type' | 'pushBreakpoint'> & {
9901
+ export type EuiCollapsibleNavProps = Omit<EuiFlyoutProps, 'type' | 'pushBreakpoint'> & {
9905
9902
  /**
9906
9903
  * ReactNode to render as this component's content
9907
9904
  */
@@ -18238,6 +18235,9 @@ declare module '@elastic/eui/src/components/selectable/selectable_list/selectabl
18238
18235
  setListBoxRef: (ref: HTMLUListElement | null) => void;
18239
18236
  componentDidUpdate(): void;
18240
18237
  constructor(props: EuiSelectableListProps<T>);
18238
+ ariaSetSize: number;
18239
+ ariaPosInSetMap: Record<number, number>;
18240
+ calculateAriaSetAttrs: (optionArray: Array<EuiSelectableOption<T>>) => void;
18241
18241
  ListRow: React.MemoExoticComponent<({ data, index, style }: ListChildComponentProps<T>) => JSX.Element>;
18242
18242
  render(): JSX.Element;
18243
18243
  onAddOrRemoveOption: (option: EuiSelectableOption<T>, event: EuiSelectableOnChangeEvent) => void;
@@ -26146,6 +26146,9 @@ declare module '@elastic/eui' {
26146
26146
  "euiFilterButton.filterBadgeActiveAriaLabel": any;
26147
26147
  "euiFilterButton.filterBadgeAvailableAriaLabel": any;
26148
26148
  "euiFlyout.closeAriaLabel": any;
26149
+ "euiFlyout.screenReaderModalDialog": any;
26150
+ "euiFlyout.screenReaderNonModalDialog": any;
26151
+ "euiFlyout.screenReaderFixedHeaders": any;
26149
26152
  "euiFieldPassword.showPassword": any;
26150
26153
  "euiFieldPassword.maskPassword": any;
26151
26154
  "euiFilePicker.promptText": any;
package/i18ntokens.json CHANGED
@@ -4085,16 +4085,64 @@
4085
4085
  "highlighting": "string",
4086
4086
  "loc": {
4087
4087
  "start": {
4088
- "line": 299,
4088
+ "line": 296,
4089
4089
  "column": 8
4090
4090
  },
4091
4091
  "end": {
4092
- "line": 299,
4092
+ "line": 296,
4093
4093
  "column": 78
4094
4094
  }
4095
4095
  },
4096
4096
  "filepath": "src/components/flyout/flyout.tsx"
4097
4097
  },
4098
+ {
4099
+ "token": "euiFlyout.screenReaderModalDialog",
4100
+ "defString": "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close.",
4101
+ "highlighting": "string",
4102
+ "loc": {
4103
+ "start": {
4104
+ "line": 359,
4105
+ "column": 12
4106
+ },
4107
+ "end": {
4108
+ "line": 362,
4109
+ "column": 14
4110
+ }
4111
+ },
4112
+ "filepath": "src/components/flyout/flyout.tsx"
4113
+ },
4114
+ {
4115
+ "token": "euiFlyout.screenReaderNonModalDialog",
4116
+ "defString": "You are in a non-modal dialog. To close the dialog, press Escape.",
4117
+ "highlighting": "string",
4118
+ "loc": {
4119
+ "start": {
4120
+ "line": 364,
4121
+ "column": 12
4122
+ },
4123
+ "end": {
4124
+ "line": 367,
4125
+ "column": 14
4126
+ }
4127
+ },
4128
+ "filepath": "src/components/flyout/flyout.tsx"
4129
+ },
4130
+ {
4131
+ "token": "euiFlyout.screenReaderFixedHeaders",
4132
+ "defString": "You can still continue tabbing through the page headers in addition to the dialog.",
4133
+ "highlighting": "string",
4134
+ "loc": {
4135
+ "start": {
4136
+ "line": 370,
4137
+ "column": 12
4138
+ },
4139
+ "end": {
4140
+ "line": 373,
4141
+ "column": 14
4142
+ }
4143
+ },
4144
+ "filepath": "src/components/flyout/flyout.tsx"
4145
+ },
4098
4146
  {
4099
4147
  "token": "euiFieldPassword.showPassword",
4100
4148
  "defString": "Show password as plain text. Note: this will visually expose your password on the screen.",
@@ -19,7 +19,7 @@ var _flyout = require("../flyout");
19
19
 
20
20
  var _react2 = require("@emotion/react");
21
21
 
22
- var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "role", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
22
+ var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
@@ -70,8 +70,6 @@ var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
70
70
  size = _ref$size === void 0 ? 320 : _ref$size,
71
71
  _ref$side = _ref.side,
72
72
  side = _ref$side === void 0 ? 'left' : _ref$side,
73
- _ref$role = _ref.role,
74
- role = _ref$role === void 0 ? null : _ref$role,
75
73
  _ref$ownFocus = _ref.ownFocus,
76
74
  ownFocus = _ref$ownFocus === void 0 ? true : _ref$ownFocus,
77
75
  _ref$outsideClickClos = _ref.outsideClickCloses,
@@ -120,7 +118,6 @@ var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
120
118
  as: as,
121
119
  size: size,
122
120
  side: side,
123
- role: role,
124
121
  ownFocus: ownFocus,
125
122
  outsideClickCloses: outsideClickCloses,
126
123
  closeButtonPosition: closeButtonPosition,
@@ -229,13 +226,6 @@ EuiCollapsibleNav.propTypes = {
229
226
  */
230
227
  side: _propTypes.default.any,
231
228
 
232
- /**
233
- * Defaults to `dialog` which is best for most cases of the flyout.
234
- * Otherwise pass in your own, aria-role, or `null` to remove it and use the semantic `as` element instead
235
- * @default dialog
236
- */
237
- role: _propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.string.isRequired]),
238
-
239
229
  /**
240
230
  * Named breakpoint (`xs` through `xl`) for customizing the minimum window width to enable docking
241
231
  */
@@ -249,6 +239,15 @@ EuiCollapsibleNav.propTypes = {
249
239
  */
250
240
  focusTrapProps: _propTypes.default.any,
251
241
 
242
+ /**
243
+ * By default, EuiFlyout will consider any fixed `EuiHeader`s that sit alongside or above the EuiFlyout
244
+ * as part of the flyout's focus trap. This prevents focus fighting with interactive elements
245
+ * within fixed headers.
246
+ *
247
+ * Set this to `false` if you need to disable this behavior for a specific reason.
248
+ */
249
+ includeFixedHeadersInFocusTrap: _propTypes.default.bool,
250
+
252
251
  /**
253
252
  * ReactNode to render as this component's content
254
253
  */