@elastic/eui 87.0.0 → 87.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/eui_theme_dark.css +0 -234
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -234
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accordion/accordion.js +82 -35
  6. package/es/components/auto_sizer/index.js +1 -1
  7. package/es/components/breadcrumbs/breadcrumb.js +2 -3
  8. package/es/components/breadcrumbs/breadcrumbs.js +2 -3
  9. package/es/components/code/code_block_virtualized.js +25 -17
  10. package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
  11. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
  12. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
  13. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
  14. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
  15. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
  16. package/es/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
  17. package/es/components/control_bar/control_bar.js +2 -3
  18. package/es/components/date_picker/date_picker_range.js +5 -2
  19. package/es/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  20. package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  21. package/es/components/empty_prompt/empty_prompt.js +0 -1
  22. package/es/components/flyout/flyout.js +9 -7
  23. package/es/components/flyout/flyout_body.js +15 -3
  24. package/es/components/form/range/dual_range.js +33 -6
  25. package/es/components/form/range/range.js +31 -6
  26. package/es/components/form/super_select/super_select.js +1 -1
  27. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +2 -3
  28. package/es/components/header/header_links/header_links.js +2 -3
  29. package/es/components/page/page_header/page_header_content.js +2 -3
  30. package/es/components/page/page_sidebar/page_sidebar.js +2 -2
  31. package/es/components/page_template/page_template.js +14 -5
  32. package/es/components/popover/input_popover.js +24 -9
  33. package/es/components/popover/popover.js +4 -6
  34. package/es/components/resizable_container/index.js +2 -1
  35. package/es/components/resizable_container/resizable_button.js +81 -50
  36. package/es/components/resizable_container/resizable_button.styles.js +66 -0
  37. package/es/components/resizable_container/resizable_collapse_button.js +24 -14
  38. package/es/components/resizable_container/resizable_collapse_button.styles.js +85 -0
  39. package/es/components/selectable/selectable_list/selectable_list.js +97 -79
  40. package/es/components/steps/step.styles.js +5 -5
  41. package/es/components/tool_tip/icon_tip.js +1 -1
  42. package/es/components/tool_tip/tool_tip.js +4 -14
  43. package/es/components/tool_tip/tool_tip_anchor.js +5 -14
  44. package/es/components/tour/tour_step.js +2 -3
  45. package/es/services/accessibility/html_id_generator.js +19 -3
  46. package/es/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  47. package/eui.d.ts +198 -56
  48. package/i18ntokens.json +64 -46
  49. package/lib/components/accordion/accordion.js +82 -35
  50. package/lib/components/auto_sizer/index.js +11 -7
  51. package/lib/components/breadcrumbs/breadcrumb.js +2 -3
  52. package/lib/components/code/code_block_virtualized.js +25 -17
  53. package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
  54. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
  55. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
  56. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
  57. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
  58. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
  59. package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
  60. package/lib/components/date_picker/date_picker_range.js +5 -2
  61. package/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  62. package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  63. package/lib/components/empty_prompt/empty_prompt.js +0 -1
  64. package/lib/components/flyout/flyout.js +9 -7
  65. package/lib/components/flyout/flyout_body.js +15 -3
  66. package/lib/components/form/range/dual_range.js +33 -6
  67. package/lib/components/form/range/range.js +14 -6
  68. package/lib/components/form/super_select/super_select.js +1 -1
  69. package/lib/components/page/page_sidebar/page_sidebar.js +1 -1
  70. package/lib/components/page_template/page_template.js +14 -5
  71. package/lib/components/popover/input_popover.js +23 -8
  72. package/lib/components/popover/popover.js +4 -6
  73. package/lib/components/resizable_container/index.js +8 -1
  74. package/lib/components/resizable_container/resizable_button.js +83 -51
  75. package/lib/components/resizable_container/resizable_button.styles.js +71 -0
  76. package/lib/components/resizable_container/resizable_collapse_button.js +24 -14
  77. package/lib/components/resizable_container/resizable_collapse_button.styles.js +90 -0
  78. package/lib/components/selectable/selectable_list/selectable_list.js +97 -79
  79. package/lib/components/steps/step.styles.js +5 -5
  80. package/lib/components/tool_tip/icon_tip.js +1 -1
  81. package/lib/components/tool_tip/tool_tip.js +4 -14
  82. package/lib/components/tool_tip/tool_tip_anchor.js +5 -13
  83. package/lib/services/accessibility/html_id_generator.js +21 -2
  84. package/lib/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  85. package/optimize/es/components/accordion/accordion.js +82 -35
  86. package/optimize/es/components/auto_sizer/index.js +1 -1
  87. package/optimize/es/components/code/code_block_virtualized.js +25 -17
  88. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -1
  89. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -1
  90. package/optimize/es/components/date_picker/date_picker_range.js +5 -2
  91. package/optimize/es/components/flyout/flyout.js +9 -7
  92. package/optimize/es/components/flyout/flyout_body.js +4 -2
  93. package/optimize/es/components/form/range/dual_range.js +7 -4
  94. package/optimize/es/components/form/range/range.js +5 -4
  95. package/optimize/es/components/page/page_sidebar/page_sidebar.js +2 -2
  96. package/optimize/es/components/page_template/page_template.js +14 -5
  97. package/optimize/es/components/popover/input_popover.js +13 -8
  98. package/optimize/es/components/popover/popover.js +2 -3
  99. package/optimize/es/components/resizable_container/index.js +2 -1
  100. package/optimize/es/components/resizable_container/resizable_button.js +61 -44
  101. package/optimize/es/components/resizable_container/resizable_button.styles.js +66 -0
  102. package/optimize/es/components/resizable_container/resizable_collapse_button.js +19 -11
  103. package/optimize/es/components/resizable_container/resizable_collapse_button.styles.js +85 -0
  104. package/optimize/es/components/selectable/selectable_list/selectable_list.js +97 -79
  105. package/optimize/es/components/steps/step.styles.js +5 -5
  106. package/optimize/es/components/tool_tip/tool_tip.js +3 -13
  107. package/optimize/es/components/tool_tip/tool_tip_anchor.js +4 -8
  108. package/optimize/es/services/accessibility/html_id_generator.js +19 -3
  109. package/optimize/es/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  110. package/optimize/lib/components/accordion/accordion.js +82 -35
  111. package/optimize/lib/components/auto_sizer/index.js +11 -7
  112. package/optimize/lib/components/code/code_block_virtualized.js +25 -17
  113. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +5 -1
  114. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +2 -1
  115. package/optimize/lib/components/date_picker/date_picker_range.js +5 -2
  116. package/optimize/lib/components/flyout/flyout.js +9 -7
  117. package/optimize/lib/components/flyout/flyout_body.js +4 -2
  118. package/optimize/lib/components/form/range/dual_range.js +7 -4
  119. package/optimize/lib/components/form/range/range.js +5 -4
  120. package/optimize/lib/components/page/page_sidebar/page_sidebar.js +1 -1
  121. package/optimize/lib/components/page_template/page_template.js +14 -5
  122. package/optimize/lib/components/popover/input_popover.js +12 -7
  123. package/optimize/lib/components/popover/popover.js +2 -3
  124. package/optimize/lib/components/resizable_container/index.js +8 -1
  125. package/optimize/lib/components/resizable_container/resizable_button.js +63 -45
  126. package/optimize/lib/components/resizable_container/resizable_button.styles.js +71 -0
  127. package/optimize/lib/components/resizable_container/resizable_collapse_button.js +19 -11
  128. package/optimize/lib/components/resizable_container/resizable_collapse_button.styles.js +90 -0
  129. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +97 -79
  130. package/optimize/lib/components/steps/step.styles.js +5 -5
  131. package/optimize/lib/components/tool_tip/tool_tip.js +3 -13
  132. package/optimize/lib/components/tool_tip/tool_tip_anchor.js +4 -8
  133. package/optimize/lib/services/accessibility/html_id_generator.js +21 -2
  134. package/optimize/lib/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  135. package/package.json +19 -21
  136. package/src/components/index.scss +0 -1
  137. package/test-env/components/accordion/accordion.js +82 -35
  138. package/test-env/components/auto_sizer/index.js +11 -7
  139. package/test-env/components/breadcrumbs/breadcrumb.js +2 -3
  140. package/test-env/components/code/code_block_virtualized.js +25 -17
  141. package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +14 -1
  142. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +8 -7
  143. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +6 -6
  144. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +7 -7
  145. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +6 -6
  146. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +9 -9
  147. package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +1 -1
  148. package/test-env/components/date_picker/date_picker_range.js +5 -2
  149. package/test-env/components/date_picker/super_date_picker/super_date_picker.js +2 -2
  150. package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
  151. package/test-env/components/empty_prompt/empty_prompt.js +0 -1
  152. package/test-env/components/flyout/flyout_body.js +15 -3
  153. package/test-env/components/form/range/dual_range.js +33 -6
  154. package/test-env/components/form/range/range.js +14 -6
  155. package/test-env/components/form/super_select/super_select.js +1 -1
  156. package/test-env/components/page/page_sidebar/page_sidebar.js +1 -1
  157. package/test-env/components/page_template/page_template.js +14 -5
  158. package/test-env/components/popover/input_popover.js +23 -8
  159. package/test-env/components/popover/popover.js +4 -6
  160. package/test-env/components/resizable_container/index.js +8 -1
  161. package/test-env/components/resizable_container/resizable_button.js +83 -51
  162. package/test-env/components/resizable_container/resizable_button.styles.js +71 -0
  163. package/test-env/components/resizable_container/resizable_collapse_button.js +19 -14
  164. package/test-env/components/resizable_container/resizable_collapse_button.styles.js +90 -0
  165. package/test-env/components/selectable/selectable_list/selectable_list.js +97 -79
  166. package/test-env/components/steps/step.styles.js +5 -5
  167. package/test-env/components/tool_tip/icon_tip.js +1 -1
  168. package/test-env/components/tool_tip/tool_tip.js +4 -14
  169. package/test-env/components/tool_tip/tool_tip_anchor.js +5 -11
  170. package/test-env/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  171. package/src/components/resizable_container/_index.scss +0 -3
  172. package/src/components/resizable_container/_resizable_button.scss +0 -129
  173. package/src/components/resizable_container/_resizable_collapse_button.scss +0 -145
  174. package/src/components/resizable_container/_variables.scss +0 -2
@@ -127,7 +127,6 @@ EuiEmptyPrompt.propTypes = {
127
127
  "aria-label": PropTypes.string,
128
128
  "data-test-subj": PropTypes.string,
129
129
  css: PropTypes.any,
130
- element: PropTypes.oneOf(["div"]),
131
130
  /**
132
131
  * Adds a medium shadow to the panel;
133
132
  * Only works when `color="plain"`
@@ -1,5 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap"];
2
+ var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap", "aria-describedby"];
3
3
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
4
  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."); }
5
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
@@ -82,6 +82,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
82
82
  _focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
83
83
  _ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
84
84
  includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
85
+ _ariaDescribedBy = _ref['aria-describedby'],
85
86
  rest = _objectWithoutProperties(_ref, _excluded);
86
87
  var Element = as || defaultElement;
87
88
  var maskRef = useRef(null);
@@ -215,6 +216,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
215
216
  */
216
217
  var hasOverlayMask = ownFocus && !isPushed;
217
218
  var descriptionId = useGeneratedHtmlId();
219
+ var ariaDescribedBy = classnames(descriptionId, _ariaDescribedBy);
218
220
  var screenReaderDescription = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
219
221
  id: descriptionId
220
222
  }, hasOverlayMask ? ___EmotionJSX(EuiI18n, {
@@ -259,15 +261,15 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
259
261
  clickOutsideDisables: !ownFocus,
260
262
  onClickOutside: onClickOutside
261
263
  }, focusTrapProps), ___EmotionJSX(Element, _extends({
262
- css: cssStyles
263
- }, rest, {
264
- role: "dialog",
265
264
  className: classes,
266
- tabIndex: 0,
267
- "data-autofocus": true,
268
- "aria-describedby": !isPushed ? descriptionId : undefined,
265
+ css: cssStyles,
269
266
  style: newStyle,
270
267
  ref: setRef
268
+ }, rest, {
269
+ role: !isPushed ? 'dialog' : rest.role,
270
+ tabIndex: !isPushed ? 0 : rest.tabIndex,
271
+ "aria-describedby": !isPushed ? ariaDescribedBy : _ariaDescribedBy,
272
+ "data-autofocus": !isPushed || undefined
271
273
  }), !isPushed && screenReaderDescription, closeButton, children));
272
274
 
273
275
  // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "className", "banner"];
1
+ var _excluded = ["children", "className", "banner", "scrollableTabIndex"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -20,6 +20,8 @@ export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
20
20
  var children = _ref.children,
21
21
  className = _ref.className,
22
22
  banner = _ref.banner,
23
+ _ref$scrollableTabInd = _ref.scrollableTabIndex,
24
+ scrollableTabIndex = _ref$scrollableTabInd === void 0 ? 0 : _ref$scrollableTabInd,
23
25
  rest = _objectWithoutProperties(_ref, _excluded);
24
26
  var classes = classNames('euiFlyoutBody', className);
25
27
  var euiTheme = useEuiTheme();
@@ -31,7 +33,7 @@ export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
31
33
  className: classes,
32
34
  css: cssStyles
33
35
  }, rest), ___EmotionJSX("div", {
34
- tabIndex: 0,
36
+ tabIndex: scrollableTabIndex,
35
37
  className: "euiFlyoutBody__overflow",
36
38
  css: overflowCssStyles
37
39
  }, banner && ___EmotionJSX("div", {
@@ -49,5 +51,15 @@ EuiFlyoutBody.propTypes = {
49
51
  /**
50
52
  * Use to display a banner at the top of the body. It is suggested to use `EuiCallOut` for it.
51
53
  */
52
- banner: PropTypes.node
54
+ banner: PropTypes.node,
55
+ /**
56
+ * [Scrollable regions (or their children) should be focusable](https://dequeuniversity.com/rules/axe/4.0/scrollable-region-focusable)
57
+ * to allow keyboard users to scroll the region via arrow keys.
58
+ *
59
+ * By default, EuiFlyoutBody's scroll overflow wrapper sets a `tabIndex` of `0`.
60
+ * If you know your flyout body content already contains focusable children
61
+ * that satisfy keyboard accessibility requirements, you can use this prop
62
+ * to override this default.
63
+ */
64
+ scrollableTabIndex: PropTypes.number
53
65
  };
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "css", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "showTicks", "tickInterval", "ticks", "levels", "onBlur", "onChange", "onFocus", "showRange", "value", "isInvalid", "append", "prepend", "minInputProps", "maxInputProps", "isDraggable", "theme"];
1
+ var _excluded = ["className", "css", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "showTicks", "tickInterval", "ticks", "levels", "onBlur", "onChange", "onFocus", "showRange", "value", "isInvalid", "append", "prepend", "minInputProps", "maxInputProps", "inputPopoverProps", "isDraggable", "theme"];
2
2
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
4
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -266,9 +266,11 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
266
266
  });
267
267
  });
268
268
  _defineProperty(_assertThisInitialized(_this), "onResize", function (width) {
269
+ var _this$props$inputPopo, _this$props$inputPopo2;
269
270
  _this.setState({
270
271
  rangeWidth: width
271
272
  });
273
+ (_this$props$inputPopo = _this.props.inputPopoverProps) === null || _this$props$inputPopo === void 0 ? void 0 : (_this$props$inputPopo2 = _this$props$inputPopo.onPanelResize) === null || _this$props$inputPopo2 === void 0 ? void 0 : _this$props$inputPopo2.call(_this$props$inputPopo, width);
272
274
  });
273
275
  _defineProperty(_assertThisInitialized(_this), "getNearestStep", function (value) {
274
276
  var min = _this.props.min;
@@ -385,6 +387,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
385
387
  prepend = _this$props.prepend,
386
388
  minInputProps = _this$props.minInputProps,
387
389
  maxInputProps = _this$props.maxInputProps,
390
+ inputPopoverProps = _this$props.inputPopoverProps,
388
391
  isDraggable = _this$props.isDraggable,
389
392
  theme = _this$props.theme,
390
393
  rest = _objectWithoutProperties(_this$props, _excluded);
@@ -625,8 +628,8 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
625
628
  className: showTicks || ticks ? 'euiRange__slimHorizontalSpacer' : 'euiRange__horizontalSpacer',
626
629
  css: showTicks || ticks ? rangeStyles.euiRange__slimHorizontalSpacer : rangeStyles.euiRange__horizontalSpacer
627
630
  }), maxInput));
628
- var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, {
629
- className: "euiRange__popover",
631
+ var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, _extends({}, inputPopoverProps, {
632
+ className: classNames('euiDualRange__popover', inputPopoverProps === null || inputPopoverProps === void 0 ? void 0 : inputPopoverProps.className),
630
633
  input: ___EmotionJSX(EuiFormControlLayoutDelimited, {
631
634
  startControl: minInput,
632
635
  endControl: maxInput,
@@ -645,7 +648,7 @@ export var EuiDualRangeClass = /*#__PURE__*/function (_Component) {
645
648
  disableFocusTrap: true,
646
649
  onPanelResize: this.onResize,
647
650
  popoverScreenReaderText: dualSliderScreenReaderInstructions
648
- }, theRange) : undefined;
651
+ }), theRange) : undefined;
649
652
  return thePopover || theRange;
650
653
  }
651
654
  }]);
@@ -765,13 +768,37 @@ EuiDualRangeClass.propTypes = {
765
768
  * @default false
766
769
  */
767
770
  fullWidth: PropTypes.bool,
771
+ /**
772
+ * Only impacts inputs rendered by the `showInput` prop
773
+ */
774
+ isInvalid: PropTypes.bool,
768
775
  /**
769
776
  * Only impacts inputs rendered when the `showInput` prop is set to `"inputWithPopover"`
770
777
  */
771
778
  isLoading: PropTypes.bool,
772
779
  /**
773
- * Only impacts inputs rendered by the `showInput` prop
780
+ * Only impacts input popovers rendered when the `showInput` prop is set to `"inputWithPopover"`
781
+ *
782
+ * Allows customizing the underlying [EuiInputPopover](/#/layout/popover#popover-attached-to-input-element),
783
+ * except for props controlled by the range component
774
784
  */
775
- isInvalid: PropTypes.bool
785
+ inputPopoverProps: PropTypes.shape({
786
+ className: PropTypes.string,
787
+ "aria-label": PropTypes.string,
788
+ "data-test-subj": PropTypes.string,
789
+ css: PropTypes.any,
790
+ /**
791
+ * Alignment of the popover relative to the input
792
+ */
793
+ anchorPosition: PropTypes.oneOf(["downLeft", "downRight", "downCenter"]),
794
+ inputRef: PropTypes.any,
795
+ onPanelResize: PropTypes.func,
796
+ /**
797
+ * By default, **EuiInputPopovers** inherit the same width as the passed input element.
798
+ * However, if the input width is too small, you can pass a minimum panel width
799
+ * (that should be based on the popover content).
800
+ */
801
+ panelMinWidth: PropTypes.number
802
+ })
776
803
  };
777
804
  export var EuiDualRange = withEuiTheme(EuiDualRangeClass);
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "showTicks", "tickInterval", "ticks", "levels", "showRange", "showValue", "valueAppend", "valuePrepend", "onBlur", "onChange", "onFocus", "value", "tabIndex", "isInvalid", "theme"];
1
+ var _excluded = ["className", "compressed", "disabled", "fullWidth", "isLoading", "readOnly", "id", "max", "min", "name", "step", "showLabels", "showInput", "inputPopoverProps", "showTicks", "tickInterval", "ticks", "levels", "showRange", "showValue", "valueAppend", "valuePrepend", "onBlur", "onChange", "onFocus", "value", "tabIndex", "isInvalid", "theme"];
2
2
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -121,6 +121,7 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
121
121
  step = _this$props.step,
122
122
  showLabels = _this$props.showLabels,
123
123
  showInput = _this$props.showInput,
124
+ inputPopoverProps = _this$props.inputPopoverProps,
124
125
  showTicks = _this$props.showTicks,
125
126
  tickInterval = _this$props.tickInterval,
126
127
  ticks = _this$props.ticks,
@@ -233,8 +234,8 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
233
234
  className: showTicks || ticks ? 'euiRange__slimHorizontalSpacer' : 'euiRange__horizontalSpacer',
234
235
  css: showTicks || ticks ? styles.euiRange__slimHorizontalSpacer : styles.euiRange__horizontalSpacer
235
236
  }), theInput));
236
- var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, {
237
- className: "euiRange__popover",
237
+ var thePopover = showInputOnly ? ___EmotionJSX(EuiInputPopover, _extends({}, inputPopoverProps, {
238
+ className: classNames('euiRange__popover', inputPopoverProps === null || inputPopoverProps === void 0 ? void 0 : inputPopoverProps.className),
238
239
  input: theInput // `showInputOnly` confirms existence
239
240
  ,
240
241
  fullWidth: fullWidth,
@@ -242,7 +243,7 @@ export var EuiRangeClass = /*#__PURE__*/function (_Component) {
242
243
  closePopover: this.closePopover,
243
244
  disableFocusTrap: true,
244
245
  popoverScreenReaderText: sliderScreenReaderInstructions
245
- }, theRange) : undefined;
246
+ }), theRange) : undefined;
246
247
  return thePopover ? thePopover : theRange;
247
248
  }
248
249
  }]);
@@ -361,13 +362,37 @@ EuiRangeClass.propTypes = {
361
362
  * @default false
362
363
  */
363
364
  fullWidth: PropTypes.bool,
365
+ /**
366
+ * Only impacts inputs rendered by the `showInput` prop
367
+ */
368
+ isInvalid: PropTypes.bool,
364
369
  /**
365
370
  * Only impacts inputs rendered when the `showInput` prop is set to `"inputWithPopover"`
366
371
  */
367
372
  isLoading: PropTypes.bool,
368
373
  /**
369
- * Only impacts inputs rendered by the `showInput` prop
374
+ * Only impacts input popovers rendered when the `showInput` prop is set to `"inputWithPopover"`
375
+ *
376
+ * Allows customizing the underlying [EuiInputPopover](/#/layout/popover#popover-attached-to-input-element),
377
+ * except for props controlled by the range component
370
378
  */
371
- isInvalid: PropTypes.bool
379
+ inputPopoverProps: PropTypes.shape({
380
+ className: PropTypes.string,
381
+ "aria-label": PropTypes.string,
382
+ "data-test-subj": PropTypes.string,
383
+ css: PropTypes.any,
384
+ /**
385
+ * Alignment of the popover relative to the input
386
+ */
387
+ anchorPosition: PropTypes.oneOf(["downLeft", "downRight", "downCenter"]),
388
+ inputRef: PropTypes.any,
389
+ onPanelResize: PropTypes.func,
390
+ /**
391
+ * By default, **EuiInputPopovers** inherit the same width as the passed input element.
392
+ * However, if the input width is too small, you can pass a minimum panel width
393
+ * (that should be based on the popover content).
394
+ */
395
+ panelMinWidth: PropTypes.number
396
+ })
372
397
  };
373
398
  export var EuiRange = withEuiTheme(EuiRangeClass);
@@ -352,7 +352,7 @@ EuiSuperSelect.propTypes = {
352
352
  */
353
353
  isOpen: PropTypes.bool,
354
354
  /**
355
- * Optional props to pass to the underlying [EuiPopover](/#/layout/popover).
355
+ * Optional props to pass to the underlying [EuiInputPopover](/#/layout/popover#popover-attached-to-input-element).
356
356
  * Allows fine-grained control of the popover dropdown menu, including
357
357
  * `repositionOnScroll` for EuiSuperSelects used within scrollable containers,
358
358
  * and customizing popover panel styling.
@@ -108,9 +108,8 @@ EuiHeaderBreadcrumbs.propTypes = {
108
108
  */
109
109
  anchorPosition: PropTypes.any,
110
110
  /**
111
- * Style and position alteration for arrow-less, left-aligned
112
- * attachment. Intended for use with inputs as anchors, e.g.
113
- * EuiInputPopover
111
+ * Style and position alteration for arrow-less attachment.
112
+ * Intended for use with inputs as anchors, e.g. EuiInputPopover
114
113
  */
115
114
  attachToAnchor: PropTypes.bool,
116
115
  buttonRef: PropTypes.any,
@@ -139,9 +139,8 @@ EuiHeaderLinks.propTypes = {
139
139
  */
140
140
  anchorPosition: PropTypes.any,
141
141
  /**
142
- * Style and position alteration for arrow-less, left-aligned
143
- * attachment. Intended for use with inputs as anchors, e.g.
144
- * EuiInputPopover
142
+ * Style and position alteration for arrow-less attachment.
143
+ * Intended for use with inputs as anchors, e.g. EuiInputPopover
145
144
  */
146
145
  attachToAnchor: PropTypes.bool,
147
146
  buttonRef: PropTypes.any,
@@ -320,9 +320,8 @@ EuiPageHeaderContent.propTypes = {
320
320
  */
321
321
  anchorPosition: PropTypes.any,
322
322
  /**
323
- * Style and position alteration for arrow-less, left-aligned
324
- * attachment. Intended for use with inputs as anchors, e.g.
325
- * EuiInputPopover
323
+ * Style and position alteration for arrow-less attachment.
324
+ * Intended for use with inputs as anchors, e.g. EuiInputPopover
326
325
  */
327
326
  attachToAnchor: PropTypes.bool,
328
327
  buttonRef: PropTypes.any,
@@ -22,7 +22,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
22
22
  * Side Public License, v 1.
23
23
  */
24
24
 
25
- import React, { useEffect, useState } from 'react';
25
+ import React, { useLayoutEffect, useState } from 'react';
26
26
  import PropTypes from "prop-types";
27
27
  import { logicalStyle, useEuiPaddingCSS } from '../../../global_styling';
28
28
  import { useEuiTheme, useIsWithinBreakpoints } from '../../../services';
@@ -51,7 +51,7 @@ export var EuiPageSidebar = function EuiPageSidebar(_ref) {
51
51
  _useState2 = _slicedToArray(_useState, 2),
52
52
  inlineStyles = _useState2[0],
53
53
  setInlineStyles = _useState2[1];
54
- useEffect(function () {
54
+ useLayoutEffect(function () {
55
55
  var updatedStyles = _objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth));
56
56
  if (sticky) {
57
57
  var _document$body$datase;
@@ -39,6 +39,14 @@ export var TemplateContext = /*#__PURE__*/createContext({
39
39
  emptyPrompt: {},
40
40
  bottomBar: {}
41
41
  });
42
+ var calculateOffset = function calculateOffset(base) {
43
+ var _document$body$datase;
44
+ if (typeof document === 'undefined') return 0; // SSR catch
45
+
46
+ var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
47
+ return base * 3 * euiHeaderFixedCounter;
48
+ };
49
+
42
50
  /**
43
51
  * Consumed via `EuiPageTemplate`,
44
52
  * it controls and propogates most of the shared props per direct child
@@ -65,7 +73,9 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
65
73
  rest = _objectWithoutProperties(_ref, _excluded);
66
74
  var _useEuiTheme = useEuiTheme(),
67
75
  euiTheme = _useEuiTheme.euiTheme;
68
- var _useState = useState(_offset),
76
+ var _useState = useState(function () {
77
+ return _offset !== null && _offset !== void 0 ? _offset : calculateOffset(euiTheme.base);
78
+ }),
69
79
  _useState2 = _slicedToArray(_useState, 2),
70
80
  offset = _useState2[0],
71
81
  setOffset = _useState2[1];
@@ -78,9 +88,7 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
78
88
  });
79
89
  useEffect(function () {
80
90
  if (_offset === undefined) {
81
- var _document$body$datase;
82
- var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
83
- setOffset(euiTheme.base * 3 * euiHeaderFixedCounter);
91
+ setOffset(calculateOffset(euiTheme.base));
84
92
  }
85
93
  }, [_offset, euiTheme.base]);
86
94
 
@@ -118,7 +126,8 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
118
126
  return {
119
127
  restrictWidth: restrictWidth,
120
128
  paddingSize: paddingSize,
121
- parent: "#".concat(pageInnerId)
129
+ // pageInnerId may contain colons that are parsed as pseudo-elements if not escaped
130
+ parent: "#".concat(CSS.escape(pageInnerId))
122
131
  };
123
132
  };
124
133
  var innerPanelled = function innerPanelled() {
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "className", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "onPanelResize", "inputRef", "panelRef"];
1
+ var _excluded = ["children", "className", "disableFocusTrap", "focusTrapProps", "input", "fullWidth", "panelMinWidth", "onPanelResize", "inputRef", "panelRef"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _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."); }
@@ -16,7 +16,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  * Side Public License, v 1.
17
17
  */
18
18
 
19
- import React, { useState, useEffect, useCallback } from 'react';
19
+ import React, { useState, useEffect, useCallback, useRef } from 'react';
20
20
  import PropTypes from "prop-types";
21
21
  import classnames from 'classnames';
22
22
  import { tabbable } from 'tabbable';
@@ -37,6 +37,8 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
37
37
  input = _ref.input,
38
38
  _ref$fullWidth = _ref.fullWidth,
39
39
  fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
40
+ _ref$panelMinWidth = _ref.panelMinWidth,
41
+ panelMinWidth = _ref$panelMinWidth === void 0 ? 0 : _ref$panelMinWidth,
40
42
  onPanelResize = _ref.onPanelResize,
41
43
  _inputRef = _ref.inputRef,
42
44
  _panelRef = _ref.panelRef,
@@ -54,22 +56,24 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
54
56
  _useState6 = _slicedToArray(_useState5, 2),
55
57
  panelEl = _useState6[0],
56
58
  setPanelEl = _useState6[1];
59
+ var popoverClassRef = useRef(null);
57
60
  var inputRef = useCombinedRefs([setInputEl, _inputRef]);
58
61
  var panelRef = useCombinedRefs([setPanelEl, _panelRef]);
59
62
  var setPanelWidth = useCallback(function (width) {
60
63
  if (panelEl && (!!inputElWidth || !!width)) {
61
64
  var newWidth = !!width ? width : inputElWidth;
62
- panelEl.style.width = "".concat(newWidth, "px");
63
- if (onPanelResize) {
64
- onPanelResize(newWidth);
65
- }
65
+ var widthToSet = newWidth && newWidth > panelMinWidth ? newWidth : panelMinWidth;
66
+ panelEl.style.width = "".concat(widthToSet, "px");
67
+ onPanelResize === null || onPanelResize === void 0 ? void 0 : onPanelResize(widthToSet);
66
68
  }
67
- }, [panelEl, inputElWidth, onPanelResize]);
69
+ }, [panelEl, inputElWidth, onPanelResize, panelMinWidth]);
68
70
  var onResize = useCallback(function () {
69
71
  if (inputEl) {
72
+ var _popoverClassRef$curr;
70
73
  var _width = inputEl.getBoundingClientRect().width;
71
74
  setInputElWidth(_width);
72
75
  setPanelWidth(_width);
76
+ (_popoverClassRef$curr = popoverClassRef.current) === null || _popoverClassRef$curr === void 0 ? void 0 : _popoverClassRef$curr.positionPopoverFluid();
73
77
  }
74
78
  }, [inputEl, setPanelWidth]);
75
79
  useEffect(function () {
@@ -104,7 +108,8 @@ export var EuiInputPopover = function EuiInputPopover(_ref) {
104
108
  }),
105
109
  buttonRef: inputRef,
106
110
  panelRef: panelRef,
107
- className: classes
111
+ className: classes,
112
+ ref: popoverClassRef
108
113
  }, props), ___EmotionJSX(EuiFocusTrap, _extends({
109
114
  clickOutsideDisables: true,
110
115
  disabled: disableFocusTrap
@@ -117,11 +122,21 @@ EuiInputPopover.propTypes = {
117
122
  "aria-label": PropTypes.string,
118
123
  "data-test-subj": PropTypes.string,
119
124
  css: PropTypes.any,
125
+ /**
126
+ * Alignment of the popover relative to the input
127
+ */
128
+ anchorPosition: PropTypes.oneOf(["downLeft", "downRight", "downCenter"]),
120
129
  disableFocusTrap: PropTypes.bool,
121
130
  fullWidth: PropTypes.bool,
122
131
  input: PropTypes.any.isRequired,
123
132
  inputRef: PropTypes.any,
124
- onPanelResize: PropTypes.func
133
+ onPanelResize: PropTypes.func,
134
+ /**
135
+ * By default, **EuiInputPopovers** inherit the same width as the passed input element.
136
+ * However, if the input width is too small, you can pass a minimum panel width
137
+ * (that should be based on the popover content).
138
+ */
139
+ panelMinWidth: PropTypes.number
125
140
  };
126
141
  EuiInputPopover.defaultProps = {
127
142
  anchorPosition: 'downLeft',
@@ -221,8 +221,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
221
221
  top = _findPopoverPosition.top,
222
222
  left = _findPopoverPosition.left,
223
223
  foundPosition = _findPopoverPosition.position,
224
- arrow = _findPopoverPosition.arrow,
225
- anchorBoundingBox = _findPopoverPosition.anchorBoundingBox;
224
+ arrow = _findPopoverPosition.arrow;
226
225
 
227
226
  // the popover's z-index must inherit from the button
228
227
  // this keeps a button's popover under a flyout that would cover the button
@@ -231,7 +230,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
231
230
  var zIndex = zIndexProp == null ? getElementZIndex(_this.button, _this.panel) + 2000 : zIndexProp;
232
231
  var popoverStyles = _objectSpread(_objectSpread({}, _this.props.panelStyle), {}, {
233
232
  top: top,
234
- left: _this.props.attachToAnchor && anchorBoundingBox ? anchorBoundingBox.left : left,
233
+ left: left,
235
234
  zIndex: zIndex
236
235
  });
237
236
  var willRenderArrow = !_this.props.attachToAnchor && _this.props.hasArrow;
@@ -552,9 +551,8 @@ EuiPopover.propTypes = {
552
551
  */
553
552
  anchorPosition: PropTypes.any,
554
553
  /**
555
- * Style and position alteration for arrow-less, left-aligned
556
- * attachment. Intended for use with inputs as anchors, e.g.
557
- * EuiInputPopover
554
+ * Style and position alteration for arrow-less attachment.
555
+ * Intended for use with inputs as anchors, e.g. EuiInputPopover
558
556
  */
559
557
  attachToAnchor: PropTypes.bool,
560
558
  /**
@@ -6,4 +6,5 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
- export { EuiResizableContainer } from './resizable_container';
9
+ export { EuiResizableContainer } from './resizable_container';
10
+ export { EuiResizableButton } from './resizable_button';