@elastic/eui 98.0.0 → 98.1.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 (170) hide show
  1. package/es/components/badge/beta_badge/beta_badge.js +2 -2
  2. package/es/components/badge/beta_badge/beta_badge.styles.js +1 -0
  3. package/es/components/card/card.js +1 -1
  4. package/es/components/card/card.styles.js +3 -3
  5. package/es/components/code/code_block.js +9 -1
  6. package/es/components/code/code_block_copy.js +5 -4
  7. package/es/components/drag_and_drop/draggable.js +2 -3
  8. package/es/components/drag_and_drop/droppable.js +2 -3
  9. package/es/components/error_boundary/error_boundary.js +2 -3
  10. package/es/components/form/range/range_draggable.js +3 -3
  11. package/es/components/health/health.js +3 -4
  12. package/es/components/inline_edit/inline_edit_form.js +5 -6
  13. package/es/components/inline_edit/inline_edit_text.js +2 -3
  14. package/es/components/inline_edit/inline_edit_title.js +2 -3
  15. package/es/components/key_pad_menu/key_pad_menu.js +2 -3
  16. package/es/components/key_pad_menu/key_pad_menu_item.js +3 -6
  17. package/es/components/mark/mark.js +2 -3
  18. package/es/components/overlay_mask/overlay_mask.js +2 -3
  19. package/es/components/popover/popover.js +3 -1
  20. package/es/components/search_bar/filters/field_value_selection_filter.js +18 -9
  21. package/es/components/search_bar/search_bar.a11y.js +0 -1
  22. package/es/components/selectable/selectable_list/selectable_list.js +10 -1
  23. package/es/components/side_nav/side_nav_item.js +3 -4
  24. package/es/components/tabs/tab.js +2 -0
  25. package/es/components/tabs/tabs.js +18 -2
  26. package/es/components/text_diff/text_diff.js +2 -3
  27. package/es/components/toast/global_toast_list_item.js +3 -6
  28. package/es/components/tour/_tour_footer.js +2 -3
  29. package/es/components/tour/_tour_header.js +2 -3
  30. package/es/components/tour/tour_step.js +4 -5
  31. package/es/components/tree_view/tree_view_item.js +2 -3
  32. package/es/global_styling/mixins/_helpers.js +1 -7
  33. package/eui.d.ts +16 -22
  34. package/i18ntokens.json +66 -48
  35. package/lib/components/badge/beta_badge/beta_badge.js +2 -2
  36. package/lib/components/badge/beta_badge/beta_badge.styles.js +1 -0
  37. package/lib/components/card/card.js +1 -1
  38. package/lib/components/card/card.styles.js +2 -2
  39. package/lib/components/code/code_block.js +9 -1
  40. package/lib/components/code/code_block_copy.js +5 -4
  41. package/lib/components/drag_and_drop/draggable.js +1 -2
  42. package/lib/components/drag_and_drop/droppable.js +1 -2
  43. package/lib/components/error_boundary/error_boundary.js +2 -3
  44. package/lib/components/form/range/range_draggable.js +2 -2
  45. package/lib/components/health/health.js +2 -3
  46. package/lib/components/inline_edit/inline_edit_form.js +4 -5
  47. package/lib/components/inline_edit/inline_edit_text.js +2 -3
  48. package/lib/components/inline_edit/inline_edit_title.js +2 -3
  49. package/lib/components/key_pad_menu/key_pad_menu.js +2 -3
  50. package/lib/components/key_pad_menu/key_pad_menu_item.js +2 -5
  51. package/lib/components/mark/mark.js +2 -3
  52. package/lib/components/overlay_mask/overlay_mask.js +1 -2
  53. package/lib/components/popover/popover.js +3 -1
  54. package/lib/components/search_bar/filters/field_value_selection_filter.js +18 -9
  55. package/lib/components/search_bar/search_bar.a11y.js +0 -1
  56. package/lib/components/selectable/selectable_list/selectable_list.js +10 -1
  57. package/lib/components/side_nav/side_nav_item.js +2 -3
  58. package/lib/components/tabs/tab.js +2 -0
  59. package/lib/components/tabs/tabs.js +17 -1
  60. package/lib/components/text_diff/text_diff.js +1 -2
  61. package/lib/components/toast/global_toast_list_item.js +2 -5
  62. package/lib/components/tour/_tour_footer.js +1 -2
  63. package/lib/components/tour/_tour_header.js +1 -2
  64. package/lib/components/tour/tour_step.js +4 -5
  65. package/lib/components/tree_view/tree_view_item.js +1 -2
  66. package/lib/global_styling/mixins/_helpers.js +2 -8
  67. package/optimize/es/components/badge/beta_badge/beta_badge.js +1 -1
  68. package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +1 -0
  69. package/optimize/es/components/card/card.styles.js +3 -3
  70. package/optimize/es/components/code/code_block.js +3 -1
  71. package/optimize/es/components/code/code_block_copy.js +5 -4
  72. package/optimize/es/components/drag_and_drop/draggable.js +2 -3
  73. package/optimize/es/components/drag_and_drop/droppable.js +2 -3
  74. package/optimize/es/components/error_boundary/error_boundary.js +2 -3
  75. package/optimize/es/components/form/range/range_draggable.js +3 -3
  76. package/optimize/es/components/health/health.js +3 -4
  77. package/optimize/es/components/inline_edit/inline_edit_form.js +5 -6
  78. package/optimize/es/components/inline_edit/inline_edit_text.js +2 -3
  79. package/optimize/es/components/inline_edit/inline_edit_title.js +2 -3
  80. package/optimize/es/components/key_pad_menu/key_pad_menu.js +2 -3
  81. package/optimize/es/components/key_pad_menu/key_pad_menu_item.js +3 -6
  82. package/optimize/es/components/mark/mark.js +2 -3
  83. package/optimize/es/components/overlay_mask/overlay_mask.js +2 -3
  84. package/optimize/es/components/popover/popover.js +3 -1
  85. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +18 -9
  86. package/optimize/es/components/search_bar/search_bar.a11y.js +0 -1
  87. package/optimize/es/components/selectable/selectable_list/selectable_list.js +10 -1
  88. package/optimize/es/components/side_nav/side_nav_item.js +3 -4
  89. package/optimize/es/components/tabs/tab.js +2 -0
  90. package/optimize/es/components/tabs/tabs.js +18 -2
  91. package/optimize/es/components/text_diff/text_diff.js +2 -3
  92. package/optimize/es/components/toast/global_toast_list_item.js +3 -6
  93. package/optimize/es/components/tour/_tour_footer.js +2 -3
  94. package/optimize/es/components/tour/_tour_header.js +2 -3
  95. package/optimize/es/components/tour/tour_step.js +4 -5
  96. package/optimize/es/components/tree_view/tree_view_item.js +2 -3
  97. package/optimize/es/global_styling/mixins/_helpers.js +1 -7
  98. package/optimize/lib/components/badge/beta_badge/beta_badge.js +1 -1
  99. package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +1 -0
  100. package/optimize/lib/components/card/card.styles.js +2 -2
  101. package/optimize/lib/components/code/code_block.js +3 -1
  102. package/optimize/lib/components/code/code_block_copy.js +5 -4
  103. package/optimize/lib/components/drag_and_drop/draggable.js +1 -2
  104. package/optimize/lib/components/drag_and_drop/droppable.js +1 -2
  105. package/optimize/lib/components/error_boundary/error_boundary.js +2 -3
  106. package/optimize/lib/components/form/range/range_draggable.js +2 -2
  107. package/optimize/lib/components/health/health.js +2 -3
  108. package/optimize/lib/components/inline_edit/inline_edit_form.js +4 -5
  109. package/optimize/lib/components/inline_edit/inline_edit_text.js +2 -3
  110. package/optimize/lib/components/inline_edit/inline_edit_title.js +2 -3
  111. package/optimize/lib/components/key_pad_menu/key_pad_menu.js +2 -3
  112. package/optimize/lib/components/key_pad_menu/key_pad_menu_item.js +2 -5
  113. package/optimize/lib/components/mark/mark.js +2 -3
  114. package/optimize/lib/components/overlay_mask/overlay_mask.js +1 -2
  115. package/optimize/lib/components/popover/popover.js +3 -1
  116. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +18 -9
  117. package/optimize/lib/components/search_bar/search_bar.a11y.js +0 -1
  118. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +10 -1
  119. package/optimize/lib/components/side_nav/side_nav_item.js +2 -3
  120. package/optimize/lib/components/tabs/tab.js +2 -0
  121. package/optimize/lib/components/tabs/tabs.js +17 -1
  122. package/optimize/lib/components/text_diff/text_diff.js +1 -2
  123. package/optimize/lib/components/toast/global_toast_list_item.js +2 -5
  124. package/optimize/lib/components/tour/_tour_footer.js +1 -2
  125. package/optimize/lib/components/tour/_tour_header.js +1 -2
  126. package/optimize/lib/components/tour/tour_step.js +4 -5
  127. package/optimize/lib/components/tree_view/tree_view_item.js +1 -2
  128. package/optimize/lib/global_styling/mixins/_helpers.js +2 -8
  129. package/package.json +13 -12
  130. package/src/global_styling/index.scss +0 -6
  131. package/src/global_styling/mixins/_helpers.scss +0 -9
  132. package/src/global_styling/mixins/_shadow.scss +0 -8
  133. package/src/global_styling/variables/_size.scss +0 -2
  134. package/src/themes/amsterdam/global_styling/index.scss +0 -3
  135. package/test-env/components/badge/beta_badge/beta_badge.js +2 -2
  136. package/test-env/components/badge/beta_badge/beta_badge.styles.js +1 -0
  137. package/test-env/components/card/card.js +1 -1
  138. package/test-env/components/card/card.styles.js +2 -2
  139. package/test-env/components/code/code_block_copy.js +5 -4
  140. package/test-env/components/drag_and_drop/draggable.js +1 -2
  141. package/test-env/components/drag_and_drop/droppable.js +1 -2
  142. package/test-env/components/error_boundary/error_boundary.js +2 -3
  143. package/test-env/components/form/range/range_draggable.js +2 -2
  144. package/test-env/components/health/health.js +2 -3
  145. package/test-env/components/inline_edit/inline_edit_form.js +4 -5
  146. package/test-env/components/inline_edit/inline_edit_text.js +2 -3
  147. package/test-env/components/inline_edit/inline_edit_title.js +2 -3
  148. package/test-env/components/key_pad_menu/key_pad_menu.js +2 -3
  149. package/test-env/components/key_pad_menu/key_pad_menu_item.js +2 -5
  150. package/test-env/components/mark/mark.js +2 -3
  151. package/test-env/components/overlay_mask/overlay_mask.js +1 -2
  152. package/test-env/components/popover/popover.js +3 -1
  153. package/test-env/components/search_bar/filters/field_value_selection_filter.js +18 -9
  154. package/test-env/components/search_bar/search_bar.a11y.js +0 -1
  155. package/test-env/components/selectable/selectable_list/selectable_list.js +10 -1
  156. package/test-env/components/side_nav/side_nav_item.js +2 -3
  157. package/test-env/components/tabs/tab.js +2 -0
  158. package/test-env/components/tabs/tabs.js +17 -1
  159. package/test-env/components/text_diff/text_diff.js +1 -2
  160. package/test-env/components/toast/global_toast_list_item.js +2 -5
  161. package/test-env/components/tour/_tour_footer.js +1 -2
  162. package/test-env/components/tour/_tour_header.js +1 -2
  163. package/test-env/components/tour/tour_step.js +4 -5
  164. package/test-env/components/tree_view/tree_view_item.js +1 -2
  165. package/test-env/global_styling/mixins/_helpers.js +2 -8
  166. package/src/global_styling/react_date_picker/_date_picker.scss +0 -772
  167. package/src/global_styling/react_date_picker/_index.scss +0 -2
  168. package/src/global_styling/react_date_picker/_variables.scss +0 -1
  169. package/src/global_styling/utility/_animations.scss +0 -55
  170. package/src/global_styling/utility/_index.scss +0 -1
@@ -19,7 +19,7 @@ import { EuiToolTip } from '../../tool_tip';
19
19
  import { EuiIcon } from '../../icon';
20
20
  import { euiBetaBadgeStyles } from './beta_badge.styles';
21
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
22
- export var COLORS = ['accent', 'subdued', 'hollow'];
22
+ export var COLORS = ['accent', 'subdued', 'hollow', 'warning'];
23
23
  export var SIZES = ['s', 'm'];
24
24
  export var ALIGNMENTS = ['baseline', 'middle'];
25
25
 
@@ -172,7 +172,7 @@ EuiBetaBadge.propTypes = {
172
172
  */
173
173
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.string])]),
174
174
  /**
175
- * Accepts accent, subdued and hollow.
175
+ * Accepts accent, subdued, hollow and warning.
176
176
  */
177
177
  color: PropTypes.any,
178
178
  size: PropTypes.any,
@@ -46,6 +46,7 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
46
46
  accent: /*#__PURE__*/css(badgeColors.accentText, ";label:accent;"),
47
47
  subdued: /*#__PURE__*/css(badgeColors.subdued, ";label:subdued;"),
48
48
  hollow: /*#__PURE__*/css("color:", badgeColors.hollow.color, ";background-color:", badgeColors.hollow.backgroundColor, ";box-shadow:inset 0 0 0 ", euiTheme.border.width.thin, " ", badgeColors.hollow.borderColor, ";;label:hollow;"),
49
+ warning: /*#__PURE__*/css(badgeColors.warning, ";label:warning;"),
49
50
  // Font sizes
50
51
  m: /*#__PURE__*/css("font-size:", euiFontSizeFromScale('xs', euiTheme), ";line-height:", euiTheme.size.l, ";;label:m;"),
51
52
  s: /*#__PURE__*/css("font-size:0.625rem;line-height:", mathWithUnits(euiTheme.size.xs, function (x) {
@@ -381,7 +381,7 @@ EuiCard.propTypes = {
381
381
  */
382
382
  title: PropTypes.oneOfType([PropTypes.string, PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.string])]),
383
383
  /**
384
- * Accepts accent, subdued and hollow.
384
+ * Accepts accent, subdued, hollow and warning.
385
385
  */
386
386
  color: PropTypes.any,
387
387
  size: PropTypes.any,
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
8
  */
9
9
 
10
10
  import { css } from '@emotion/react';
11
- import { euiPaddingSize, euiSupportsHas, logicalCSS, logicals, logicalTextAlignCSS } from '../../global_styling';
11
+ import { euiPaddingSize, logicalCSS, logicals, logicalTextAlignCSS } from '../../global_styling';
12
12
  import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins';
13
13
  var paddingKey = 'm';
14
14
  var halfPaddingKey = 's';
@@ -124,7 +124,7 @@ export var euiCardTextStyles = function euiCardTextStyles(euiThemeContext) {
124
124
  var euiTheme = euiThemeContext.euiTheme;
125
125
  return {
126
126
  euiCard__text: _ref,
127
- interactive: /*#__PURE__*/css("outline-offset:", euiTheme.size.xxs, ";.euiCard:hover &,.euiCard:focus &,&:hover,&:focus{text-decoration:underline;}", euiSupportsHas, "{outline:none!important;};label:interactive;"),
127
+ interactive: /*#__PURE__*/css("outline-offset:", euiTheme.size.xxs, ";.euiCard:hover &,.euiCard:focus &,&:hover,&:focus{text-decoration:underline;};label:interactive;"),
128
128
  aligned: {
129
129
  center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;"),
130
130
  left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;"),
@@ -138,7 +138,7 @@ export var euiCardBetaBadgeStyles = function euiCardBetaBadgeStyles(euiThemeCont
138
138
  var padding = euiPaddingSize(euiThemeContext, paddingSize);
139
139
  return {
140
140
  hasBetaBadge: /*#__PURE__*/css("position:relative;overflow:visible;", logicalCSS('padding-top', "calc(".concat(padding, " + ").concat(euiTheme.size.s, ")")), ";;label:hasBetaBadge;"),
141
- euiCard__betaBadgeAnchor: /*#__PURE__*/css("line-height:0;position:absolute;", logicalCSS('top', '0'), " ", logicalCSS('left', '50%'), " transform:translateX(-50%) translateY(-50%);z-index:3;", logicalCSS('min-width', 'min(30%, 112px)'), " ", logicalCSS('max-width', "calc(100% - (".concat(padding, " * 2))")), ";;label:euiCard__betaBadgeAnchor;"),
141
+ euiCard__betaBadgeAnchor: /*#__PURE__*/css("line-height:0;position:absolute;", logicalCSS('top', '0'), " ", logicalCSS('left', '50%'), " transform:translateX(-50%) translateY(-50%);z-index:3;", logicalCSS('min-width', "min(30%, ".concat(euiTheme.base * 7, "px)")), " ", logicalCSS('max-width', "calc(100% - (".concat(padding, " * 2))")), ";;label:euiCard__betaBadgeAnchor;"),
142
142
  euiCard__betaBadge: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:euiCard__betaBadge;")
143
143
  };
144
144
  };
@@ -1,4 +1,4 @@
1
- var _excluded = ["language", "transparentBackground", "paddingSize", "fontSize", "isCopyable", "whiteSpace", "children", "className", "overflowHeight", "isVirtualized", "lineNumbers"];
1
+ var _excluded = ["language", "transparentBackground", "paddingSize", "fontSize", "isCopyable", "copyAriaLabel", "whiteSpace", "children", "className", "overflowHeight", "isVirtualized", "lineNumbers"];
2
2
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
3
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
4
4
  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."); }
@@ -57,6 +57,7 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
57
57
  fontSize = _ref$fontSize === void 0 ? 's' : _ref$fontSize,
58
58
  _ref$isCopyable = _ref.isCopyable,
59
59
  isCopyable = _ref$isCopyable === void 0 ? false : _ref$isCopyable,
60
+ copyAriaLabel = _ref.copyAriaLabel,
60
61
  _ref$whiteSpace = _ref.whiteSpace,
61
62
  whiteSpace = _ref$whiteSpace === void 0 ? 'pre-wrap' : _ref$whiteSpace,
62
63
  children = _ref.children,
@@ -97,6 +98,7 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
97
98
  return !!(_isVirtualized && Array.isArray(data));
98
99
  }, [_isVirtualized, data]);
99
100
  var _useCopy = useCopy({
101
+ copyAriaLabel: copyAriaLabel,
100
102
  isCopyable: isCopyable,
101
103
  isVirtualized: isVirtualized,
102
104
  children: children
@@ -200,6 +202,12 @@ EuiCodeBlock.propTypes = {
200
202
  * Displays an icon button to copy the code snippet to the clipboard.
201
203
  */
202
204
  isCopyable: PropTypes.bool,
205
+ /**
206
+ * Customizes the aria-label for the copy button.
207
+ *
208
+ * @default 'Copy'
209
+ */
210
+ copyAriaLabel: PropTypes.string,
203
211
  /**
204
212
  * Displays line numbers.
205
213
  * Optionally accepts a configuration object for setting the starting number,
@@ -24,7 +24,8 @@ import { NEW_LINE_REGEX_GLOBAL } from './utils';
24
24
  */
25
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
26
26
  export var useCopy = function useCopy(_ref) {
27
- var isCopyable = _ref.isCopyable,
27
+ var copyAriaLabel = _ref.copyAriaLabel,
28
+ isCopyable = _ref.isCopyable,
28
29
  isVirtualized = _ref.isVirtualized,
29
30
  children = _ref.children;
30
31
  var _useInnerText = useInnerText(''),
@@ -47,7 +48,7 @@ export var useCopy = function useCopy(_ref) {
47
48
  var textToCopy = isVirtualized ? "".concat(children) : innerText; // Virtualized code blocks do not have inner text
48
49
 
49
50
  var showCopyButton = isCopyable && textToCopy;
50
- var copyAriaLabel = useEuiI18n('euiCodeBlockCopy.copy', 'Copy');
51
+ var copyDefaultAriaLabel = useEuiI18n('euiCodeBlockCopy.copy', 'Copy');
51
52
  var copyButton = useMemo(function () {
52
53
  return showCopyButton ? ___EmotionJSX("div", {
53
54
  className: "euiCodeBlock__copyButton"
@@ -58,11 +59,11 @@ export var useCopy = function useCopy(_ref) {
58
59
  onClick: copy,
59
60
  iconType: "copyClipboard",
60
61
  color: "text",
61
- "aria-label": copyAriaLabel,
62
+ "aria-label": copyAriaLabel || copyDefaultAriaLabel,
62
63
  "data-test-subj": "euiCodeBlockCopy"
63
64
  });
64
65
  })) : null;
65
- }, [showCopyButton, textToCopy, copyAriaLabel]);
66
+ }, [copyAriaLabel, copyDefaultAriaLabel, showCopyButton, textToCopy]);
66
67
  return {
67
68
  innerTextRef: innerTextRef,
68
69
  copyButton: copyButton
@@ -20,7 +20,7 @@ import React, { useContext } from 'react';
20
20
  import PropTypes from "prop-types";
21
21
  import { Draggable } from '@hello-pangea/dnd';
22
22
  import classNames from 'classnames';
23
- import { useEuiTheme, cloneElementWithCss } from '../../services';
23
+ import { useEuiMemoizedStyles, cloneElementWithCss } from '../../services';
24
24
  import { EuiDroppableContext } from './droppable';
25
25
  import { euiDraggableStyles, euiDraggableItemStyles } from './draggable.styles';
26
26
  import { EuiPortal } from '../portal';
@@ -48,8 +48,7 @@ export var EuiDraggable = function EuiDraggable(_ref) {
48
48
  rest = _objectWithoutProperties(_ref, _excluded);
49
49
  var _useContext = useContext(EuiDroppableContext),
50
50
  cloneItems = _useContext.cloneItems;
51
- var euiTheme = useEuiTheme();
52
- var styles = euiDraggableStyles(euiTheme);
51
+ var styles = useEuiMemoizedStyles(euiDraggableStyles);
53
52
  var hasCustomDragHandle = customDragHandle !== false;
54
53
  return ___EmotionJSX(Draggable, _extends({
55
54
  draggableId: draggableId,
@@ -14,7 +14,7 @@ import React, { useContext } from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import { Droppable } from '@hello-pangea/dnd';
16
16
  import classNames from 'classnames';
17
- import { useEuiTheme } from '../../services';
17
+ import { useEuiMemoizedStyles } from '../../services';
18
18
  import { EuiPanel } from '../panel';
19
19
  import { EuiDragDropContextContext } from './drag_drop_context';
20
20
  import { euiDroppableStyles } from './droppable.styles';
@@ -47,8 +47,7 @@ export var EuiDroppable = function EuiDroppable(_ref) {
47
47
  var _useContext = useContext(EuiDragDropContextContext),
48
48
  isDraggingType = _useContext.isDraggingType;
49
49
  var dropIsDisabled = cloneDraggables ? true : isDropDisabled;
50
- var euiTheme = useEuiTheme();
51
- var styles = euiDroppableStyles(euiTheme);
50
+ var styles = useEuiMemoizedStyles(euiDroppableStyles);
52
51
  return ___EmotionJSX(Droppable, _extends({
53
52
  isDropDisabled: dropIsDisabled,
54
53
  droppableId: droppableId,
@@ -27,10 +27,10 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
27
27
  import React, { Component } from 'react';
28
28
  import PropTypes from "prop-types";
29
29
  import classNames from 'classnames';
30
+ import { useEuiMemoizedStyles } from '../../services';
30
31
  import { EuiTitle } from '../title';
31
32
  import { EuiCodeBlock } from '../code';
32
33
  import { EuiI18n } from '../i18n';
33
- import { useEuiTheme } from '../../services';
34
34
  import { euiErrorBoundaryStyles } from './error_boundary.styles';
35
35
  import { jsx as ___EmotionJSX } from "@emotion/react";
36
36
  export var EuiErrorBoundary = /*#__PURE__*/function (_Component) {
@@ -109,8 +109,7 @@ export var EuiErrorMessage = function EuiErrorMessage(_ref) {
109
109
  className = _ref.className,
110
110
  dataTestSubj = _ref['data-test-subj'],
111
111
  rest = _objectWithoutProperties(_ref, _excluded2);
112
- var euiTheme = useEuiTheme();
113
- var styles = euiErrorBoundaryStyles(euiTheme);
112
+ var styles = useEuiMemoizedStyles(euiErrorBoundaryStyles);
114
113
  return ___EmotionJSX("div", _extends({
115
114
  css: styles.euiErrorBoundary,
116
115
  className: classNames('euiErrorBoundary', className),
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
19
19
  import React, { useCallback, useMemo } from 'react';
20
20
  import PropTypes from "prop-types";
21
21
  import classNames from 'classnames';
22
- import { useMouseMove, useEuiTheme } from '../../../services';
22
+ import { useMouseMove, useEuiTheme, useEuiMemoizedStyles } from '../../../services';
23
23
  import { logicalStyles } from '../../../global_styling';
24
24
  import { euiRangeDraggableStyles, euiRangeDraggableInnerStyles } from './range_draggable.styles';
25
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -51,9 +51,9 @@ export var EuiRangeDraggable = function EuiRangeDraggable(_ref) {
51
51
  handleMouseDown = _useMouseMove2[0],
52
52
  handleInteraction = _useMouseMove2[1];
53
53
  var classes = classNames('euiRangeDraggable', className);
54
- var styles = euiRangeDraggableStyles(euiTheme);
54
+ var styles = useEuiMemoizedStyles(euiRangeDraggableStyles);
55
55
  var cssStyles = [styles.euiRangeDraggable, showTicks && styles.hasTicks, disabled && styles.disabled];
56
- var innerStyles = euiRangeDraggableInnerStyles(euiTheme);
56
+ var innerStyles = useEuiMemoizedStyles(euiRangeDraggableInnerStyles);
57
57
  var cssInnerStyles = [innerStyles.euiRangeDraggable__inner, disabled ? styles.disabled : innerStyles.enabled];
58
58
  var commonProps = {
59
59
  className: classes,
@@ -13,10 +13,10 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
13
13
  import React from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiTheme } from '../../services';
17
- import { euiHealthStyles } from './health.styles';
16
+ import { useEuiMemoizedStyles } from '../../services';
18
17
  import { EuiIcon } from '../icon';
19
18
  import { EuiFlexGroup, EuiFlexItem } from '../flex';
19
+ import { euiHealthStyles } from './health.styles';
20
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
21
21
  export var TEXT_SIZES = ['xs', 's', 'm', 'inherit'];
22
22
  export var EuiHealth = function EuiHealth(_ref) {
@@ -26,8 +26,7 @@ export var EuiHealth = function EuiHealth(_ref) {
26
26
  _ref$textSize = _ref.textSize,
27
27
  textSize = _ref$textSize === void 0 ? 's' : _ref$textSize,
28
28
  rest = _objectWithoutProperties(_ref, _excluded);
29
- var euiTheme = useEuiTheme();
30
- var styles = euiHealthStyles(euiTheme);
29
+ var styles = useEuiMemoizedStyles(euiHealthStyles);
31
30
  var cssStyles = [styles.euiHealth, styles[textSize]];
32
31
  var classes = classNames('euiHealth', className);
33
32
  return ___EmotionJSX("div", _extends({
@@ -28,7 +28,7 @@ import { euiFormVariables } from '../form/form.styles';
28
28
  import { EuiButtonIcon, EuiButtonEmpty } from '../button';
29
29
  import { EuiFlexGroup, EuiFlexItem } from '../flex';
30
30
  import { EuiSkeletonLoading, EuiSkeletonRectangle } from '../skeleton';
31
- import { useEuiTheme, useCombinedRefs, keys } from '../../services';
31
+ import { useEuiMemoizedStyles, useCombinedRefs, keys } from '../../services';
32
32
  import { EuiI18n, useEuiI18n } from '../i18n';
33
33
  import { useGeneratedHtmlId } from '../../services/accessibility';
34
34
  import { euiInlineEditReadModeStyles } from './inline_edit_form.styles';
@@ -71,10 +71,9 @@ export var EuiInlineEditForm = function EuiInlineEditForm(_ref) {
71
71
  isReadOnly = _ref.isReadOnly,
72
72
  rest = _objectWithoutProperties(_ref, _excluded);
73
73
  var classes = classNames('euiInlineEdit', className);
74
- var euiTheme = useEuiTheme();
75
- var _euiFormVariables = euiFormVariables(euiTheme),
76
- controlHeight = _euiFormVariables.controlHeight,
77
- controlCompressedHeight = _euiFormVariables.controlCompressedHeight;
74
+ var _useEuiMemoizedStyles = useEuiMemoizedStyles(euiFormVariables),
75
+ controlHeight = _useEuiMemoizedStyles.controlHeight,
76
+ controlCompressedHeight = _useEuiMemoizedStyles.controlCompressedHeight;
78
77
  var loadingSkeletonSize = sizes.compressed ? controlCompressedHeight : controlHeight;
79
78
  var defaultSaveButtonAriaLabel = useEuiI18n('euiInlineEditForm.saveButtonAriaLabel', 'Save edit');
80
79
  var defaultCancelButtonAriaLabel = useEuiI18n('euiInlineEditForm.cancelButtonAriaLabel', 'Cancel edit');
@@ -109,7 +108,7 @@ export var EuiInlineEditForm = function EuiInlineEditForm(_ref) {
109
108
  return isEditing ? editModeValue : readModeValue || placeholder;
110
109
  }
111
110
  }, [controlledValue, editModeValue, readModeValue, isEditing, placeholder]);
112
- var readModeStyles = euiInlineEditReadModeStyles(euiTheme);
111
+ var readModeStyles = useEuiMemoizedStyles(euiInlineEditReadModeStyles);
113
112
  var readModeCssStyles = [readModeStyles.euiInlineEditReadMode, isReadOnly && readModeStyles.isReadOnly, placeholder && !readModeValue && readModeStyles.hasPlaceholder];
114
113
  var activateEditMode = function activateEditMode() {
115
114
  setIsEditing(true);
@@ -19,9 +19,9 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
19
19
  import React, { useMemo } from 'react';
20
20
  import PropTypes from "prop-types";
21
21
  import classNames from 'classnames';
22
+ import { useEuiMemoizedStyles } from '../../services';
22
23
  import { EuiText } from '../text';
23
24
  import { EuiInlineEditForm, SMALL_SIZE_FORM, MEDIUM_SIZE_FORM } from './inline_edit_form';
24
- import { useEuiTheme } from '../../services';
25
25
  import { euiInlineEditTextStyles } from './inline_edit_text.styles';
26
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
27
27
  export var EuiInlineEditText = function EuiInlineEditText(_ref) {
@@ -32,8 +32,7 @@ export var EuiInlineEditText = function EuiInlineEditText(_ref) {
32
32
  isReadOnly = _ref.isReadOnly,
33
33
  rest = _objectWithoutProperties(_ref, _excluded);
34
34
  var classes = classNames('euiInlineEditText', className);
35
- var theme = useEuiTheme();
36
- var styles = euiInlineEditTextStyles(theme);
35
+ var styles = useEuiMemoizedStyles(euiInlineEditTextStyles);
37
36
  var cssStyles = [styles.euiInlineEditText, styles.fontSize[size]];
38
37
  var isSmallSize = ['xs', 's'].includes(size);
39
38
  var sizes = isSmallSize ? SMALL_SIZE_FORM : MEDIUM_SIZE_FORM;
@@ -19,9 +19,9 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
19
19
  import React, { useMemo } from 'react';
20
20
  import PropTypes from "prop-types";
21
21
  import classNames from 'classnames';
22
+ import { useEuiMemoizedStyles } from '../../services';
22
23
  import { EuiTitle } from '../title';
23
24
  import { EuiInlineEditForm, SMALL_SIZE_FORM, MEDIUM_SIZE_FORM } from './inline_edit_form';
24
- import { useEuiTheme } from '../../services';
25
25
  import { euiInlineEditTitleStyles } from './inline_edit_title.styles';
26
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
27
27
  export var HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span'];
@@ -34,8 +34,7 @@ export var EuiInlineEditTitle = function EuiInlineEditTitle(_ref) {
34
34
  isReadOnly = _ref.isReadOnly,
35
35
  rest = _objectWithoutProperties(_ref, _excluded);
36
36
  var classes = classNames('euiInlineEditTitle', className);
37
- var theme = useEuiTheme();
38
- var styles = euiInlineEditTitleStyles(theme);
37
+ var styles = useEuiMemoizedStyles(euiInlineEditTitleStyles);
39
38
  var cssStyles = [styles.euiInlineEditTitle, styles.fontSize[size]];
40
39
  var H = heading;
41
40
  var isSmallSize = ['xxxs', 'xxs', 'xs', 's'].includes(size);
@@ -14,8 +14,8 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
14
14
  import React from 'react';
15
15
  import PropTypes from "prop-types";
16
16
  import classNames from 'classnames';
17
+ import { useEuiMemoizedStyles } from '../../services';
17
18
  import { EuiFormLabel } from '../form/form_label/form_label';
18
- import { useEuiTheme } from '../../services';
19
19
  import { euiKeyPadMenuStyles } from './key_pad_menu.styles';
20
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
21
21
  export var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
@@ -26,8 +26,7 @@ export var EuiKeyPadMenu = function EuiKeyPadMenu(_ref) {
26
26
  rest = _objectWithoutProperties(_ref, _excluded);
27
27
  var hasCheckableConfig = _typeof(checkable) === 'object';
28
28
  var classes = classNames('euiKeyPadMenu', className);
29
- var theme = useEuiTheme();
30
- var styles = euiKeyPadMenuStyles(theme);
29
+ var styles = useEuiMemoizedStyles(euiKeyPadMenuStyles);
31
30
  var cssStyles = [styles.euiKeyPadMenu];
32
31
  var legendCssStyles = [styles.euiKeyPadMenu__legend, hasCheckableConfig && (checkable === null || checkable === void 0 || (_checkable$legendProp = checkable.legendProps) === null || _checkable$legendProp === void 0 ? void 0 : _checkable$legendProp.css)];
33
32
  var legend = hasCheckableConfig && checkable.legend ? ___EmotionJSX(EuiFormLabel, _extends({}, checkable.legendProps, {
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
13
13
  import React, { useMemo } from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiTheme, getSecureRelForTarget, useGeneratedHtmlId } from '../../services';
16
+ import { useEuiMemoizedStyles, getSecureRelForTarget, useGeneratedHtmlId } from '../../services';
17
17
  import { EuiBetaBadge } from '../badge/beta_badge';
18
18
  import { EuiRadio, EuiCheckbox } from '../form';
19
19
  import { validateHref } from '../../services/security/href_validator';
@@ -43,8 +43,7 @@ export var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
43
43
  rest = _objectWithoutProperties(_ref, _excluded);
44
44
  var isHrefValid = !href || validateHref(href);
45
45
  var isDisabled = disabled || _isDisabled || !isHrefValid;
46
- var euiTheme = useEuiTheme();
47
- var styles = euiKeyPadMenuItemStyles(euiTheme);
46
+ var styles = useEuiMemoizedStyles(euiKeyPadMenuItemStyles);
48
47
  var cssStyles = [styles.euiKeyPadMenuItem, !isDisabled ? styles.enabled : styles.disabled.disabled, isSelected && (!isDisabled ? styles.selected : styles.disabled.selected)];
49
48
  var classes = classNames('euiKeyPadMenuItem', className);
50
49
  var Element = href && !isDisabled ? 'a' : 'button';
@@ -52,9 +51,7 @@ export var EuiKeyPadMenuItem = function EuiKeyPadMenuItem(_ref) {
52
51
  var itemId = useGeneratedHtmlId({
53
52
  conditionalId: id
54
53
  });
55
- var childStyles = useMemo(function () {
56
- return euiKeyPadMenuItemChildStyles(euiTheme);
57
- }, [euiTheme]);
54
+ var childStyles = useEuiMemoizedStyles(euiKeyPadMenuItemChildStyles);
58
55
  var checkableElement = useMemo(function () {
59
56
  if (!checkable) return;
60
57
  var cssStyles = [childStyles.euiKeyPadMenuItem__checkableInput, !isSelected && isDisabled && childStyles.hideCheckableInput, !isSelected && !isDisabled && childStyles.showCheckableInputOnInteraction];
@@ -13,8 +13,8 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
13
13
  import React, { useMemo } from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
+ import { useEuiMemoizedStyles } from '../../services';
16
17
  import { useEuiI18n } from '../i18n';
17
- import { useEuiTheme } from '../../services';
18
18
  import { euiMarkStyles, euiMarkScreenReaderStyles } from './mark.styles';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
20
  export var EuiMark = function EuiMark(_ref) {
@@ -24,8 +24,7 @@ export var EuiMark = function EuiMark(_ref) {
24
24
  hasScreenReaderHelpText = _ref$hasScreenReaderH === void 0 ? true : _ref$hasScreenReaderH,
25
25
  rest = _objectWithoutProperties(_ref, _excluded);
26
26
  var classes = classNames('euiMark', className);
27
- var euiTheme = useEuiTheme();
28
- var styles = euiMarkStyles(euiTheme);
27
+ var styles = useEuiMemoizedStyles(euiMarkStyles);
29
28
  var highlightStart = useEuiI18n('euiMark.highlightStart', 'highlight start');
30
29
  var highlightEnd = useEuiI18n('euiMark.highlightEnd', 'highlight end');
31
30
  var screenReaderStyles = useMemo(function () {
@@ -24,7 +24,7 @@ import PropTypes from "prop-types";
24
24
  import { cx } from '@emotion/css';
25
25
  import { Global } from '@emotion/react';
26
26
  import { keysOf } from '../common';
27
- import { useCombinedRefs, useEuiTheme } from '../../services';
27
+ import { useCombinedRefs, useEuiMemoizedStyles } from '../../services';
28
28
  import { EuiPortal } from '../portal';
29
29
  import { euiOverlayMaskStyles } from './overlay_mask.styles';
30
30
  import { euiOverlayMaskBodyStyles } from './overlay_mask_body.styles';
@@ -41,8 +41,7 @@ export var EuiOverlayMask = function EuiOverlayMask(_ref) {
41
41
  overlayMaskNode = _useState2[0],
42
42
  setOverlayMaskNode = _useState2[1];
43
43
  var combinedMaskRef = useCombinedRefs([setOverlayMaskNode, maskRef]);
44
- var euiTheme = useEuiTheme();
45
- var styles = euiOverlayMaskStyles(euiTheme);
44
+ var styles = useEuiMemoizedStyles(euiOverlayMaskStyles);
46
45
  var cssStyles = cx([styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]]);
47
46
  useEffect(function () {
48
47
  if (!overlayMaskNode) return;
@@ -125,11 +125,13 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
125
125
  });
126
126
  _defineProperty(_this, "handleStrandedFocus", function () {
127
127
  _this.strandedFocusTimeout = window.setTimeout(function () {
128
+ var _this$panel;
128
129
  // If `returnFocus` failed and focus was stranded,
129
130
  // attempt to manually restore focus to the toggle button.
130
131
  // The stranded focus is either in most cases on body but
131
132
  // it will be on the panel instead on mount when isOpen=true
132
- if (document.activeElement === document.body || document.activeElement === _this.panel) {
133
+ if (document.activeElement === document.body || (_this$panel = _this.panel) !== null && _this$panel !== void 0 && _this$panel.contains(document.activeElement) // if focus is on OR within this.panel
134
+ ) {
133
135
  if (!_this.button) return;
134
136
  var focusableItems = focusable(_this.button);
135
137
  if (!focusableItems.length) return;
@@ -38,6 +38,7 @@ import { EuiPopover, EuiPopoverTitle } from '../../popover';
38
38
  import { EuiFilterButton } from '../../filter_group';
39
39
  import { euiFilterGroupStyles } from '../../filter_group/filter_group.styles';
40
40
  import { EuiSelectable } from '../../selectable';
41
+ import { EuiI18n } from '../../i18n';
41
42
  import { Query } from '../query';
42
43
  import { Operator } from '../query/ast';
43
44
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -288,14 +289,21 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
288
289
  }) : false;
289
290
  var activeItemsCount = this.state.activeItemsCount;
290
291
  var active = (activeTop || activeItem) && activeItemsCount > 0;
291
- var button = ___EmotionJSX(EuiFilterButton, {
292
- iconType: "arrowDown",
293
- iconSide: "right",
294
- onClick: this.onButtonClick.bind(this),
295
- hasActiveFilters: active,
296
- numActiveFilters: active ? activeItemsCount : undefined,
297
- grow: true
298
- }, config.name);
292
+ var button = ___EmotionJSX(EuiI18n, {
293
+ token: "euiFieldValueSelectionFilter.buttonLabelHint",
294
+ default: "Selection"
295
+ }, function (buttonLabelHint) {
296
+ var ariaLabel = "".concat(config.name, " ").concat(buttonLabelHint);
297
+ return ___EmotionJSX(EuiFilterButton, {
298
+ iconType: "arrowDown",
299
+ iconSide: "right",
300
+ hasActiveFilters: active,
301
+ numActiveFilters: active ? activeItemsCount : undefined,
302
+ grow: true,
303
+ "aria-label": ariaLabel,
304
+ onClick: _this3.onButtonClick.bind(_this3)
305
+ }, config.name);
306
+ });
299
307
  var items = options ? options.map(function (option) {
300
308
  var _option$view;
301
309
  var optionField = option.field || config.field;
@@ -353,7 +361,8 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
353
361
  errorMessage: _this3.state.error,
354
362
  noMatchesMessage: config.noOptionsMessage,
355
363
  listProps: {
356
- isVirtualized: isOverSearchThreshold || false
364
+ isVirtualized: isOverSearchThreshold || false,
365
+ autoFocus: true
357
366
  },
358
367
  onChange: function onChange(options, event, changedOption) {
359
368
  if (changedOption.data) {
@@ -202,7 +202,6 @@ describe('EuiSearchBar', function () {
202
202
  it('has zero violations after filtering by Tags', function () {
203
203
  cy.get('button.euiButtonEmpty').last().focus();
204
204
  cy.realPress('Enter');
205
- cy.realPress('Tab');
206
205
  cy.realPress('ArrowDown');
207
206
  cy.realPress('Enter');
208
207
  cy.realPress('Escape');
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["data"],
2
2
  _excluded2 = ["label", "isGroupLabel", "checked", "disabled", "prepend", "append", "ref", "key", "searchableLabel", "data", "truncationProps"],
3
- _excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isPreFiltered", "isVirtualized", "textWrap", "truncationProps"];
3
+ _excluded3 = ["className", "options", "searchValue", "onOptionClick", "renderOption", "height", "windowProps", "rowHeight", "activeOptionIndex", "makeOptionId", "showIcons", "singleSelection", "visibleOptions", "allowExclusions", "bordered", "paddingSize", "searchable", "onFocusBadge", "listId", "setActiveOptionIndex", "aria-label", "aria-labelledby", "aria-describedby", "role", "isPreFiltered", "isVirtualized", "textWrap", "truncationProps", "autoFocus"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -71,6 +71,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
71
71
  listId = _this$props.listId,
72
72
  searchable = _this$props.searchable,
73
73
  singleSelection = _this$props.singleSelection,
74
+ autoFocus = _this$props.autoFocus,
74
75
  ariaLabel = _this$props['aria-label'],
75
76
  ariaLabelledby = _this$props['aria-labelledby'],
76
77
  ariaDescribedby = _this$props['aria-describedby'];
@@ -91,6 +92,13 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
91
92
  if (typeof ariaDescribedby === 'string') {
92
93
  ref.setAttribute('aria-describedby', ariaDescribedby);
93
94
  }
95
+ if (autoFocus === true) {
96
+ // manually focus listbox once available
97
+ // use last stack execution to prevent potential focus order issues
98
+ setTimeout(function () {
99
+ return ref.focus();
100
+ });
101
+ }
94
102
  }
95
103
  });
96
104
  // This utility is necessary to exclude group labels from the aria set count
@@ -544,6 +552,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
544
552
  isVirtualized = _this$props11.isVirtualized,
545
553
  textWrap = _this$props11.textWrap,
546
554
  truncationProps = _this$props11.truncationProps,
555
+ autoFocus = _this$props11.autoFocus,
547
556
  rest = _objectWithoutProperties(_this$props11, _excluded3);
548
557
  var heightIsFull = forcedHeight === 'full';
549
558
  var classes = classNames('euiSelectableList', className);
@@ -19,7 +19,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
19
19
 
20
20
  import React, { useState, useEffect, useCallback } from 'react';
21
21
  import classNames from 'classnames';
22
- import { useEuiTheme, getSecureRelForTarget } from '../../services';
22
+ import { useEuiMemoizedStyles, getSecureRelForTarget } from '../../services';
23
23
  import { validateHref } from '../../services/security/href_validator';
24
24
  import { EuiInnerText } from '../inner_text';
25
25
  import { EuiIcon } from '../icon';
@@ -90,7 +90,6 @@ export var EuiSideNavItem = function EuiSideNavItem(_ref2) {
90
90
  buttonClassName = _ref2.buttonClassName,
91
91
  childrenOnly = _ref2.childrenOnly,
92
92
  rest = _objectWithoutProperties(_ref2, _excluded2);
93
- var euiTheme = useEuiTheme();
94
93
  var isHrefValid = !_href || validateHref(_href);
95
94
  var href = isHrefValid ? _href : '';
96
95
 
@@ -119,14 +118,14 @@ export var EuiSideNavItem = function EuiSideNavItem(_ref2) {
119
118
  'euiSideNavItem--emphasized': emphasize,
120
119
  'euiSideNavItem-hasChildItems': hasChildItems
121
120
  }, className);
122
- var styles = euiSideNavItemStyles(euiTheme);
121
+ var styles = useEuiMemoizedStyles(euiSideNavItemStyles);
123
122
  var cssStyles = [styles.euiSideNavItem, isRoot && styles.root, isTrunk && styles.trunk, isBranch && styles.branch, emphasize && styles.emphasized, css];
124
123
  var itemsStyles = hasChildItems && [styles.items.euiSideNavItem__items, isRoot && icon && styles.items.rootWithIcon, isTrunk && styles.items.trunk, isBranch && styles.items.branch];
125
124
  var buttonClasses = classNames('euiSideNavItemButton', {
126
125
  'euiSideNavItemButton-isOpen': depth > 0 && itemIsOpen && !isSelected,
127
126
  'euiSideNavItemButton-isSelected': isSelected
128
127
  }, buttonClassName);
129
- var buttonStyles = euiSideNavItemButtonStyles(euiTheme);
128
+ var buttonStyles = useEuiMemoizedStyles(euiSideNavItemButtonStyles);
130
129
  var buttonCssStyles = [buttonStyles.euiSideNavItemButton, isSelected && buttonStyles.selected, emphasize && buttonStyles.emphasized, isRoot && buttonStyles.root, isTrunk && buttonStyles.trunk, isBranch && buttonStyles.branch];
131
130
  var labelCssStyles = [buttonStyles.label.euiSideNavItemButton__label, isRoot && buttonStyles.label.root];
132
131
  return ___EmotionJSX("div", {
@@ -61,6 +61,7 @@ export var EuiTab = function EuiTab(_ref) {
61
61
  return ___EmotionJSX("a", _extends({
62
62
  role: "tab",
63
63
  "aria-selected": !!isSelected,
64
+ tabIndex: isSelected ? 0 : -1,
64
65
  className: classes,
65
66
  css: cssTabStyles,
66
67
  href: href,
@@ -74,6 +75,7 @@ export var EuiTab = function EuiTab(_ref) {
74
75
  return ___EmotionJSX("button", _extends({
75
76
  role: "tab",
76
77
  "aria-selected": !!isSelected,
78
+ tabIndex: isSelected ? 0 : -1,
77
79
  type: "button",
78
80
  className: classes,
79
81
  css: cssTabStyles,
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
13
13
  import React, { forwardRef } from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { useEuiMemoizedStyles } from '../../services';
16
+ import { keys, useEuiMemoizedStyles } from '../../services';
17
17
  import { euiTabsStyles } from './tabs.styles';
18
18
  import { EuiTabsContext } from './tabs_context';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -31,10 +31,26 @@ export var EuiTabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
31
31
  var classes = classNames('euiTabs', className);
32
32
  var styles = useEuiMemoizedStyles(euiTabsStyles);
33
33
  var cssStyles = [styles.euiTabs, styles[size], bottomBorder && styles.bottomBorder];
34
+ var handleKeyDown = function handleKeyDown(event) {
35
+ var tablist = event.currentTarget;
36
+ var tabs = tablist === null || tablist === void 0 ? void 0 : tablist.querySelectorAll('[role="tab"]:not(:disabled, [inert])');
37
+ if (!(tabs !== null && tabs !== void 0 && tabs.length)) return;
38
+ var currentIndex = Array.from(tabs).findIndex(function (tab) {
39
+ return tab.matches(':focus');
40
+ });
41
+ if (event.key === keys.ARROW_LEFT) {
42
+ var previousIndex = (currentIndex === 0 ? tabs.length : currentIndex) - 1;
43
+ tabs[previousIndex].focus();
44
+ } else if (event.key === keys.ARROW_RIGHT) {
45
+ var nextIndex = currentIndex === tabs.length - 1 ? 0 : currentIndex + 1;
46
+ tabs[nextIndex].focus();
47
+ }
48
+ };
34
49
  return ___EmotionJSX("div", _extends({
35
50
  ref: ref,
36
51
  className: classes,
37
- css: cssStyles
52
+ css: cssStyles,
53
+ onKeyDown: handleKeyDown
38
54
  }, children && {
39
55
  role: 'tablist'
40
56
  }, rest), ___EmotionJSX(EuiTabsContext.Provider, {