@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
@@ -1,4 +1,5 @@
1
- var _excluded = ["isHorizontal", "className", "id", "registration", "disabled", "onFocus", "onBlur"];
1
+ var _excluded = ["isHorizontal", "alignIndicator", "className"],
2
+ _excluded2 = ["registration", "id", "disabled", "onFocus"];
2
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); }
3
4
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
5
  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,22 +17,77 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
17
  * Side Public License, v 1.
17
18
  */
18
19
 
19
- import React, { useCallback, useMemo, useRef } from 'react';
20
+ import React, { useCallback, useMemo, useRef, forwardRef } from 'react';
20
21
  import PropTypes from "prop-types";
21
22
  import classNames from 'classnames';
22
23
  import { EuiI18n } from '../i18n';
23
- import { useGeneratedHtmlId } from '../../services';
24
+ import { useEuiTheme, useGeneratedHtmlId } from '../../services';
24
25
  import { useEuiResizableContainerContext } from './context';
26
+ import { euiResizableButtonStyles } from './resizable_button.styles';
25
27
  import { jsx as ___EmotionJSX } from "@emotion/react";
26
- export var EuiResizableButton = function EuiResizableButton(_ref) {
28
+ /**
29
+ * A generic button for indicating/facilitating resizable content,
30
+ * usable outside of the EuiResizableContainer context
31
+ */
32
+ export var EuiResizableButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
27
33
  var isHorizontal = _ref.isHorizontal,
34
+ _ref$alignIndicator = _ref.alignIndicator,
35
+ alignIndicator = _ref$alignIndicator === void 0 ? 'center' : _ref$alignIndicator,
28
36
  className = _ref.className,
29
- id = _ref.id,
30
- registration = _ref.registration,
31
- disabled = _ref.disabled,
32
- onFocus = _ref.onFocus,
33
- onBlur = _ref.onBlur,
34
37
  rest = _objectWithoutProperties(_ref, _excluded);
38
+ var classes = classNames('euiResizableButton', className);
39
+ var euiTheme = useEuiTheme();
40
+ var styles = euiResizableButtonStyles(euiTheme);
41
+ var cssStyles = [styles.euiResizableButton, isHorizontal ? styles.horizontal : styles.vertical, styles.alignIndicator[alignIndicator]];
42
+ return ___EmotionJSX(EuiI18n, {
43
+ tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
44
+ defaults: ['Press the left or right arrow keys to adjust panels size', 'Press the up or down arrow keys to adjust panels size']
45
+ }, function (_ref2) {
46
+ var _ref3 = _slicedToArray(_ref2, 2),
47
+ horizontalResizerAriaLabel = _ref3[0],
48
+ verticalResizerAriaLabel = _ref3[1];
49
+ return ___EmotionJSX("button", _extends({
50
+ ref: ref,
51
+ "aria-label": isHorizontal ? horizontalResizerAriaLabel : verticalResizerAriaLabel,
52
+ className: classes,
53
+ css: cssStyles,
54
+ "data-test-subj": "euiResizableButton",
55
+ type: "button"
56
+ }, rest));
57
+ });
58
+ });
59
+ EuiResizableButton.propTypes = {
60
+ className: PropTypes.string,
61
+ "aria-label": PropTypes.string,
62
+ "data-test-subj": PropTypes.string,
63
+ css: PropTypes.any,
64
+ /**
65
+ * Defaults to displaying a resizer for vertical (y-axis) resizing.
66
+ * Set to `true` to display a resizer for horizontal (x-axis) resizing.
67
+ */
68
+ isHorizontal: PropTypes.bool,
69
+ /**
70
+ * Specify the alignment of the initial resize indicator. Defaults to `center`,
71
+ * but consider using `start` for extremely tall content that scrolls off-screen
72
+ */
73
+ alignIndicator: PropTypes.oneOf(["center", "start", "end"]),
74
+ /**
75
+ * When disabled, the resizer button will be completely hidden
76
+ */
77
+ disabled: PropTypes.bool
78
+ };
79
+ EuiResizableButton.displayName = 'EuiResizableButton';
80
+
81
+ /**
82
+ * Resizer button specific to controlled EuiResizableContainer usage
83
+ */
84
+
85
+ export var EuiResizableButtonControlled = function EuiResizableButtonControlled(_ref4) {
86
+ var registration = _ref4.registration,
87
+ id = _ref4.id,
88
+ disabled = _ref4.disabled,
89
+ _onFocus = _ref4.onFocus,
90
+ rest = _objectWithoutProperties(_ref4, _excluded2);
35
91
  var resizerId = useGeneratedHtmlId({
36
92
  prefix: 'resizable-button',
37
93
  conditionalId: id
@@ -43,13 +99,9 @@ export var EuiResizableButton = function EuiResizableButton(_ref) {
43
99
  } : _useEuiResizableConta2,
44
100
  resizers = _useEuiResizableConta3.resizers;
45
101
  var isDisabled = useMemo(function () {
46
- return disabled || resizers[resizerId] && resizers[resizerId].isDisabled;
102
+ var _resizers$resizerId;
103
+ return disabled || ((_resizers$resizerId = resizers[resizerId]) === null || _resizers$resizerId === void 0 ? void 0 : _resizers$resizerId.isDisabled);
47
104
  }, [resizers, resizerId, disabled]);
48
- var classes = classNames('euiResizableButton', {
49
- 'euiResizableButton--vertical': !isHorizontal,
50
- 'euiResizableButton--horizontal': isHorizontal,
51
- 'euiResizableButton--disabled': isDisabled
52
- }, className);
53
105
  var previousRef = useRef();
54
106
  var onRef = useCallback(function (ref) {
55
107
  if (!registration) return;
@@ -68,41 +120,20 @@ export var EuiResizableButton = function EuiResizableButton(_ref) {
68
120
  }
69
121
  }
70
122
  }, [registration, resizerId, disabled]);
71
- var setFocus = function setFocus(e) {
72
- return e.currentTarget.focus();
73
- };
74
- var handleFocus = function handleFocus() {
75
- onFocus && onFocus(resizerId);
76
- };
77
- return ___EmotionJSX(EuiI18n, {
78
- tokens: ['euiResizableButton.horizontalResizerAriaLabel', 'euiResizableButton.verticalResizerAriaLabel'],
79
- defaults: ['Press left or right to adjust panels size', 'Press up or down to adjust panels size']
80
- }, function (_ref2) {
81
- var _ref3 = _slicedToArray(_ref2, 2),
82
- horizontalResizerAriaLabel = _ref3[0],
83
- verticalResizerAriaLabel = _ref3[1];
84
- return ___EmotionJSX("button", _extends({
85
- id: resizerId,
86
- ref: onRef,
87
- "aria-label": isHorizontal ? horizontalResizerAriaLabel : verticalResizerAriaLabel,
88
- className: classes,
89
- "data-test-subj": "euiResizableButton",
90
- type: "button",
91
- onClick: setFocus,
92
- onFocus: handleFocus,
93
- onBlur: onBlur,
94
- disabled: isDisabled
95
- }, rest));
96
- });
97
- };
98
- EuiResizableButton.propTypes = {
99
- className: PropTypes.string,
100
- "aria-label": PropTypes.string,
101
- "data-test-subj": PropTypes.string,
102
- css: PropTypes.any
123
+ return ___EmotionJSX(EuiResizableButton, _extends({
124
+ id: resizerId,
125
+ ref: onRef,
126
+ disabled: isDisabled,
127
+ onClick: function onClick(e) {
128
+ return e.currentTarget.focus();
129
+ },
130
+ onFocus: function onFocus() {
131
+ return _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(resizerId);
132
+ }
133
+ }, rest));
103
134
  };
104
- export function euiResizableButtonWithControls(controls) {
135
+ export var euiResizableButtonWithControls = function euiResizableButtonWithControls(controls) {
105
136
  return function (props) {
106
- return ___EmotionJSX(EuiResizableButton, _extends({}, controls, props));
137
+ return ___EmotionJSX(EuiResizableButtonControlled, _extends({}, controls, props));
107
138
  };
108
- }
139
+ };
@@ -0,0 +1,66 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+
10
+ import { css } from '@emotion/react';
11
+ import { transparentize } from '../../services';
12
+ import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../global_styling';
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "1fvu7sv-end",
15
+ styles: "align-items:flex-end;label:end;"
16
+ } : {
17
+ name: "1fvu7sv-end",
18
+ styles: "align-items:flex-end;label:end;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+ var _ref2 = process.env.NODE_ENV === "production" ? {
22
+ name: "h0ntv8-start",
23
+ styles: "align-items:flex-start;label:start;"
24
+ } : {
25
+ name: "h0ntv8-start",
26
+ styles: "align-items:flex-start;label:start;",
27
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
+ };
29
+ var _ref3 = process.env.NODE_ENV === "production" ? {
30
+ name: "8391db-center",
31
+ styles: "align-items:center;label:center;"
32
+ } : {
33
+ name: "8391db-center",
34
+ styles: "align-items:center;label:center;",
35
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
36
+ };
37
+ export var euiResizableButtonStyles = function euiResizableButtonStyles(euiThemeContext) {
38
+ var euiTheme = euiThemeContext.euiTheme;
39
+ var buttonSize = euiTheme.size.base;
40
+ var grabHandleWidth = euiTheme.size.m;
41
+ var grabHandleHeight = euiTheme.border.width.thin;
42
+ var transitionSpeed = euiTheme.animation.fast;
43
+ var transition = "".concat(transitionSpeed, " ease");
44
+ return {
45
+ // Mimics the "grab" icon with CSS psuedo-elements.
46
+ // 1. The "grab" icon transforms into a thicker straight line on :hover and :focus
47
+ // 2. Start/end aligned handles should have a slight margin offset that disappears on hover/focus
48
+ // 3. CSS hack to smooth out/anti-alias the 1px wide handles at various zoom levels
49
+ euiResizableButton: /*#__PURE__*/css("z-index:1;flex-shrink:0;display:flex;justify-content:center;gap:", mathWithUnits(grabHandleHeight, function (x) {
50
+ return x * 2;
51
+ }), ";&:disabled{display:none;}&:hover,&:focus{gap:0;justify-content:center;}", euiCanAnimate, "{transition:gap ", transition, ",justify-content ", transition, ";}&::before,&::after{content:'';display:block;background-color:", euiTheme.colors.darkestShade, ";transform:translateZ(0);", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ",margin ", transition, ",background-color ", transition, ";}}&:hover{&::before,&::after{background-color:", euiTheme.colors.mediumShade, ";", euiCanAnimate, "{transition-delay:", transitionSpeed, ";}}}&:focus,&:active{background-color:", transparentize(euiTheme.colors.primary, 0.1), ";&::before,&::after{background-color:", euiTheme.colors.primary, ";", euiCanAnimate, "{transition:width ", transition, ",height ", transition, ";transition-delay:", mathWithUnits(transitionSpeed, function (x) {
52
+ return x / 2;
53
+ }), ";}}};label:euiResizableButton;"),
54
+ horizontal: /*#__PURE__*/css("cursor:col-resize;", logicalCSS('height', '100%'), " ", logicalCSS('width', buttonSize), " margin-inline:", mathWithUnits(buttonSize, function (x) {
55
+ return x / -2;
56
+ }), ";&::before,&::after{", logicalCSS('width', grabHandleHeight), " ", logicalCSS('height', grabHandleWidth), " margin-block:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('height', '100%'), " margin-block:0;transform:none;}};label:horizontal;"),
57
+ vertical: /*#__PURE__*/css("flex-direction:column;cursor:row-resize;", logicalCSS('width', '100%'), " ", logicalCSS('height', buttonSize), " margin-block:", mathWithUnits(buttonSize, function (x) {
58
+ return x / -2;
59
+ }), ";&::before,&::after{", logicalCSS('height', grabHandleHeight), " ", logicalCSS('width', grabHandleWidth), " margin-inline:", euiTheme.size.base, ";}&:hover,&:focus,&:active{&::before,&::after{", logicalCSS('width', '100%'), " margin-inline:0;transform:none;}};label:vertical;"),
60
+ alignIndicator: {
61
+ center: _ref3,
62
+ start: _ref2,
63
+ end: _ref
64
+ }
65
+ };
66
+ };
@@ -1,5 +1,11 @@
1
1
  var _excluded = ["className", "externalPosition", "internalPosition", "direction", "isVisible", "isCollapsed"];
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
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
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
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
3
9
  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
10
  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; }
5
11
  /*
@@ -13,11 +19,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
13
19
  import React from 'react';
14
20
  import PropTypes from "prop-types";
15
21
  import classNames from 'classnames';
22
+ import { useEuiTheme } from '../../services';
16
23
  import { EuiButtonIcon } from '../button';
24
+ import { euiScreenReaderOnlyStyles } from '../accessibility/screen_reader_only/screen_reader_only.styles';
25
+ import { euiResizableCollapseButtonStyles } from './resizable_collapse_button.styles';
17
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
18
27
  export var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
19
28
  var className = _ref.className,
20
- externalPosition = _ref.externalPosition,
29
+ _ref$externalPosition = _ref.externalPosition,
30
+ externalPosition = _ref$externalPosition === void 0 ? 'before' : _ref$externalPosition,
21
31
  _ref$internalPosition = _ref.internalPosition,
22
32
  internalPosition = _ref$internalPosition === void 0 ? 'middle' : _ref$internalPosition,
23
33
  _ref$direction = _ref.direction,
@@ -26,14 +36,15 @@ export var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref
26
36
  isCollapsed = _ref.isCollapsed,
27
37
  rest = _objectWithoutProperties(_ref, _excluded);
28
38
  var isHorizontal = direction === 'horizontal';
29
- var classes = classNames('euiResizableToggleButton', "euiResizableToggleButton--".concat(direction), "euiResizableToggleButton--".concat(externalPosition), "euiResizableToggleButton--".concat(internalPosition), {
30
- 'euiResizableToggleButton-isVisible': isVisible,
31
- 'euiResizableToggleButton-isCollapsed': isCollapsed
32
- }, className);
33
-
34
- // Default to simiple grab icon in case there is no externalPosition specified
35
- var COLLAPSED_ICON = isHorizontal ? 'grab' : 'grabHorizontal';
36
- var NOT_COLLAPSED_ICON = isHorizontal ? 'grab' : 'grabHorizontal';
39
+ var showOnFocus = !isCollapsed && !isVisible;
40
+ var screenReaderOnlyStyles = euiScreenReaderOnlyStyles(showOnFocus).euiScreenReaderOnly;
41
+ var euiTheme = useEuiTheme();
42
+ var styles = euiResizableCollapseButtonStyles(euiTheme);
43
+ var collapsedStyles = [styles.collapsed.collapsed, styles.collapsed[direction], styles.collapsed["".concat(direction, "Positions")][internalPosition]];
44
+ var collapsibleStyles = [styles.collapsible.collapsible, styles.collapsible[direction][externalPosition], styles.collapsible[direction][internalPosition]];
45
+ var cssStyles = [styles.euiResizableCollapseButton, showOnFocus && screenReaderOnlyStyles].concat(_toConsumableArray(isCollapsed ? collapsedStyles : collapsibleStyles));
46
+ var COLLAPSED_ICON = '';
47
+ var NOT_COLLAPSED_ICON = '';
37
48
  switch (externalPosition) {
38
49
  case 'before':
39
50
  COLLAPSED_ICON = isHorizontal ? 'menuLeft' : 'menuUp';
@@ -44,11 +55,13 @@ export var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref
44
55
  NOT_COLLAPSED_ICON = isHorizontal ? 'menuLeft' : 'menuUp';
45
56
  break;
46
57
  }
58
+ var classes = classNames('euiResizableCollapseButton', className);
47
59
  return ___EmotionJSX(EuiButtonIcon, _extends({
48
60
  display: isCollapsed ? 'empty' : 'base',
49
- color: "text"
50
- }, rest, {
61
+ color: "text",
51
62
  className: classes,
63
+ css: cssStyles
64
+ }, rest, {
52
65
  iconType: isCollapsed ? COLLAPSED_ICON : NOT_COLLAPSED_ICON
53
66
  }));
54
67
  };
@@ -67,9 +80,6 @@ EuiResizableCollapseButton.propTypes = {
67
80
  * Same direction derived from EuiResizableContainer
68
81
  */
69
82
  direction: PropTypes.oneOf(["vertical", "horizontal"]),
70
- /**
71
- *
72
- */
73
83
  isVisible: PropTypes.bool,
74
84
  isCollapsed: PropTypes.bool
75
85
  };
@@ -0,0 +1,85 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+ /*
3
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
+ * or more contributor license agreements. Licensed under the Elastic License
5
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
6
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
7
+ * Side Public License, v 1.
8
+ */
9
+
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS, mathWithUnits } from '../../global_styling';
12
+ import { euiShadowXSmall, euiSlightShadowHover } from '../../themes/amsterdam';
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "fuwsll-euiResizableCollapseButton",
15
+ styles: "z-index:2;position:absolute;&:focus{animation:none;};label:euiResizableCollapseButton;"
16
+ } : {
17
+ name: "fuwsll-euiResizableCollapseButton",
18
+ styles: "z-index:2;position:absolute;&:focus{animation:none;};label:euiResizableCollapseButton;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+ export var euiResizableCollapseButtonStyles = function euiResizableCollapseButtonStyles(euiThemeContext) {
22
+ var euiTheme = euiThemeContext.euiTheme;
23
+ var buttonSize = euiTheme.size.l;
24
+ var centeringOffset = mathWithUnits(buttonSize, function (x) {
25
+ return x / -2;
26
+ }); // Use negative margins instead of transforms to avoid having to override EuiButtonIcon's CSS
27
+ var buttonOffset = euiTheme.size.base;
28
+ return {
29
+ euiResizableCollapseButton: _ref,
30
+ collapsible: {
31
+ collapsible: /*#__PURE__*/css("background:", euiTheme.colors.emptyShade, ";", euiShadowXSmall(euiThemeContext), " &:focus{", euiSlightShadowHover(euiThemeContext), ";};label:collapsible;"),
32
+ horizontal: {
33
+ after: /*#__PURE__*/css(logicalCSS('right', 0), " ", logicalCSS('margin-right', centeringOffset), ";;label:after;"),
34
+ before: /*#__PURE__*/css(logicalCSS('left', 0), " ", logicalCSS('margin-left', centeringOffset), ";;label:before;"),
35
+ middle: /*#__PURE__*/css(logicalCSS('top', '50%'), " ", logicalCSS('margin-top', centeringOffset), ";;label:middle;"),
36
+ top: /*#__PURE__*/css(logicalCSS('top', 0), " ", logicalCSS('margin-top', buttonOffset), ";;label:top;"),
37
+ bottom: /*#__PURE__*/css(logicalCSS('bottom', 0), " ", logicalCSS('margin-bottom', buttonOffset), ";;label:bottom;"),
38
+ // `left/right` aren't valid positions for the horizontal direction,
39
+ // so we're using getters to fall back to the `middle` CSS
40
+ get left() {
41
+ return this.middle;
42
+ },
43
+ get right() {
44
+ return this.middle;
45
+ }
46
+ },
47
+ vertical: {
48
+ after: /*#__PURE__*/css(logicalCSS('top', '100%'), " ", logicalCSS('margin-top', centeringOffset), ";;label:after;"),
49
+ before: /*#__PURE__*/css(logicalCSS('bottom', '100%'), " ", logicalCSS('margin-bottom', centeringOffset), ";;label:before;"),
50
+ middle: /*#__PURE__*/css(logicalCSS('left', '50%'), " ", logicalCSS('margin-left', centeringOffset), ";;label:middle;"),
51
+ left: /*#__PURE__*/css(logicalCSS('left', 0), " ", logicalCSS('margin-left', buttonOffset), ";;label:left;"),
52
+ right: /*#__PURE__*/css(logicalCSS('right', 0), " ", logicalCSS('margin-right', buttonOffset), ";;label:right;"),
53
+ // `top/bottom` aren't valid positions for the horizontal direction,
54
+ // so we're using getters to fall back to the `middle` CSS
55
+ get top() {
56
+ return this.middle;
57
+ },
58
+ get bottom() {
59
+ return this.middle;
60
+ }
61
+ }
62
+ },
63
+ collapsed: {
64
+ // When collapsed, the button itself is the full collapsed area
65
+ // and we use flex to align the icon within
66
+ collapsed: /*#__PURE__*/css("border-radius:0;", logicalCSS('top', 0), ";;label:collapsed;"),
67
+ horizontal: /*#__PURE__*/css(logicalCSS('height', '100%'), ";;label:horizontal;"),
68
+ vertical: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:vertical;"),
69
+ horizontalPositions: {
70
+ top: /*#__PURE__*/css(logicalCSS('padding-top', buttonOffset), " align-items:flex-start;;label:top;"),
71
+ bottom: /*#__PURE__*/css(logicalCSS('padding-bottom', buttonOffset), " align-items:flex-end;;label:bottom;"),
72
+ middle: /*#__PURE__*/css(";label:middle;"),
73
+ left: /*#__PURE__*/css(";label:left;"),
74
+ right: /*#__PURE__*/css(";label:right;")
75
+ },
76
+ verticalPositions: {
77
+ left: /*#__PURE__*/css(logicalCSS('padding-left', buttonOffset), " justify-content:flex-start;;label:left;"),
78
+ right: /*#__PURE__*/css(logicalCSS('padding-right', buttonOffset), " justify-content:flex-end;;label:right;"),
79
+ middle: /*#__PURE__*/css(";label:middle;"),
80
+ top: /*#__PURE__*/css(";label:top;"),
81
+ bottom: /*#__PURE__*/css(";label:bottom;")
82
+ }
83
+ }
84
+ };
85
+ };
@@ -171,17 +171,67 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
171
171
  search: searchValue
172
172
  }, label));
173
173
  }, areEqual));
174
+ _defineProperty(_assertThisInitialized(_this), "renderVirtualizedList", function (heightIsFull, optionArray) {
175
+ if (!_this.props.isVirtualized) return null;
176
+ var _this$props3 = _this.props,
177
+ windowProps = _this$props3.windowProps,
178
+ forcedHeight = _this$props3.height,
179
+ rowHeight = _this$props3.rowHeight;
180
+ var virtualizationProps = _objectSpread({
181
+ className: 'euiSelectableList__list',
182
+ ref: _this.setListRef,
183
+ outerRef: _this.removeScrollableTabStop,
184
+ innerRef: _this.setListBoxRef,
185
+ innerElementType: 'ul',
186
+ itemCount: optionArray.length,
187
+ itemData: optionArray,
188
+ itemSize: rowHeight,
189
+ 'data-skip-axe': 'scrollable-region-focusable'
190
+ }, windowProps);
191
+
192
+ // Calculated height is only used if height is not full
193
+ var calculatedHeight = !heightIsFull ? forcedHeight || 0 : 0;
194
+
195
+ // If calculatedHeight is still falsy, then calculate it
196
+ if (!heightIsFull && !calculatedHeight) {
197
+ var maxVisibleOptions = 7;
198
+ var numVisibleOptions = optionArray.length;
199
+ var numVisibleMoreThanMax = optionArray.length > maxVisibleOptions;
200
+ if (numVisibleMoreThanMax) {
201
+ // Show only half of the last one to indicate there's more to scroll to
202
+ calculatedHeight = (maxVisibleOptions - 0.5) * rowHeight;
203
+ } else {
204
+ calculatedHeight = numVisibleOptions * rowHeight;
205
+ }
206
+ }
207
+ return heightIsFull ? ___EmotionJSX(EuiAutoSizer, null, function (_ref2) {
208
+ var width = _ref2.width,
209
+ height = _ref2.height;
210
+ return ___EmotionJSX(FixedSizeList, _extends({
211
+ width: width,
212
+ height: height
213
+ }, virtualizationProps), _this.ListRow);
214
+ }) : ___EmotionJSX(EuiAutoSizer, {
215
+ disableHeight: true
216
+ }, function (_ref3) {
217
+ var width = _ref3.width;
218
+ return ___EmotionJSX(FixedSizeList, _extends({
219
+ width: width,
220
+ height: calculatedHeight
221
+ }, virtualizationProps), _this.ListRow);
222
+ });
223
+ });
174
224
  _defineProperty(_assertThisInitialized(_this), "onAddOrRemoveOption", function (option, event) {
175
225
  if (option.disabled) {
176
226
  return;
177
227
  }
178
- var _this$props3 = _this.props,
179
- allowExclusions = _this$props3.allowExclusions,
180
- options = _this$props3.options,
181
- _this$props3$visibleO = _this$props3.visibleOptions,
182
- visibleOptions = _this$props3$visibleO === void 0 ? options : _this$props3$visibleO;
183
- _this.props.setActiveOptionIndex(visibleOptions.findIndex(function (_ref2) {
184
- var label = _ref2.label;
228
+ var _this$props4 = _this.props,
229
+ allowExclusions = _this$props4.allowExclusions,
230
+ options = _this$props4.options,
231
+ _this$props4$visibleO = _this$props4.visibleOptions,
232
+ visibleOptions = _this$props4$visibleO === void 0 ? options : _this$props4$visibleO;
233
+ _this.props.setActiveOptionIndex(visibleOptions.findIndex(function (_ref4) {
234
+ var label = _ref4.label;
185
235
  return label === option.label;
186
236
  }), function () {
187
237
  if (option.checked === 'on' && allowExclusions) {
@@ -194,10 +244,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
194
244
  });
195
245
  });
196
246
  _defineProperty(_assertThisInitialized(_this), "onAddOption", function (addedOption, event) {
197
- var _this$props4 = _this.props,
198
- onOptionClick = _this$props4.onOptionClick,
199
- options = _this$props4.options,
200
- singleSelection = _this$props4.singleSelection;
247
+ var _this$props5 = _this.props,
248
+ onOptionClick = _this$props5.onOptionClick,
249
+ options = _this$props5.options,
250
+ singleSelection = _this$props5.singleSelection;
201
251
  var changedOption = _objectSpread({}, addedOption);
202
252
  var updatedOptions = options.map(function (option) {
203
253
  // if singleSelection is enabled, uncheck any selected option(s)
@@ -216,10 +266,10 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
216
266
  onOptionClick(updatedOptions, event, changedOption);
217
267
  });
218
268
  _defineProperty(_assertThisInitialized(_this), "onRemoveOption", function (removedOption, event) {
219
- var _this$props5 = _this.props,
220
- onOptionClick = _this$props5.onOptionClick,
221
- singleSelection = _this$props5.singleSelection,
222
- options = _this$props5.options;
269
+ var _this$props6 = _this.props,
270
+ onOptionClick = _this$props6.onOptionClick,
271
+ singleSelection = _this$props6.singleSelection,
272
+ options = _this$props6.options;
223
273
  var changedOption = _objectSpread({}, removedOption);
224
274
  var updatedOptions = options.map(function (option) {
225
275
  var updatedOption = _objectSpread({}, option);
@@ -232,9 +282,9 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
232
282
  onOptionClick(updatedOptions, event, changedOption);
233
283
  });
234
284
  _defineProperty(_assertThisInitialized(_this), "onExcludeOption", function (excludedOption, event) {
235
- var _this$props6 = _this.props,
236
- onOptionClick = _this$props6.onOptionClick,
237
- options = _this$props6.options;
285
+ var _this$props7 = _this.props,
286
+ onOptionClick = _this$props7.onOptionClick,
287
+ options = _this$props7.options;
238
288
  var changedOption = _objectSpread({}, excludedOption);
239
289
  var updatedOptions = options.map(function (option) {
240
290
  var updatedOption = _objectSpread({}, option);
@@ -263,76 +313,44 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
263
313
  key: "render",
264
314
  value: function render() {
265
315
  var _this2 = this;
266
- var _this$props7 = this.props,
267
- className = _this$props7.className,
268
- options = _this$props7.options,
269
- searchValue = _this$props7.searchValue,
270
- onOptionClick = _this$props7.onOptionClick,
271
- renderOption = _this$props7.renderOption,
272
- forcedHeight = _this$props7.height,
273
- windowProps = _this$props7.windowProps,
274
- rowHeight = _this$props7.rowHeight,
275
- activeOptionIndex = _this$props7.activeOptionIndex,
276
- makeOptionId = _this$props7.makeOptionId,
277
- showIcons = _this$props7.showIcons,
278
- singleSelection = _this$props7.singleSelection,
279
- visibleOptions = _this$props7.visibleOptions,
280
- allowExclusions = _this$props7.allowExclusions,
281
- bordered = _this$props7.bordered,
282
- paddingSize = _this$props7.paddingSize,
283
- searchable = _this$props7.searchable,
284
- onFocusBadge = _this$props7.onFocusBadge,
285
- listId = _this$props7.listId,
286
- setActiveOptionIndex = _this$props7.setActiveOptionIndex,
287
- ariaLabel = _this$props7['aria-label'],
288
- ariaLabelledby = _this$props7['aria-labelledby'],
289
- ariaDescribedby = _this$props7['aria-describedby'],
290
- role = _this$props7.role,
291
- isVirtualized = _this$props7.isVirtualized,
292
- textWrap = _this$props7.textWrap,
293
- rest = _objectWithoutProperties(_this$props7, _excluded3);
316
+ var _this$props8 = this.props,
317
+ className = _this$props8.className,
318
+ options = _this$props8.options,
319
+ searchValue = _this$props8.searchValue,
320
+ onOptionClick = _this$props8.onOptionClick,
321
+ renderOption = _this$props8.renderOption,
322
+ forcedHeight = _this$props8.height,
323
+ windowProps = _this$props8.windowProps,
324
+ rowHeight = _this$props8.rowHeight,
325
+ activeOptionIndex = _this$props8.activeOptionIndex,
326
+ makeOptionId = _this$props8.makeOptionId,
327
+ showIcons = _this$props8.showIcons,
328
+ singleSelection = _this$props8.singleSelection,
329
+ visibleOptions = _this$props8.visibleOptions,
330
+ allowExclusions = _this$props8.allowExclusions,
331
+ bordered = _this$props8.bordered,
332
+ paddingSize = _this$props8.paddingSize,
333
+ searchable = _this$props8.searchable,
334
+ onFocusBadge = _this$props8.onFocusBadge,
335
+ listId = _this$props8.listId,
336
+ setActiveOptionIndex = _this$props8.setActiveOptionIndex,
337
+ ariaLabel = _this$props8['aria-label'],
338
+ ariaLabelledby = _this$props8['aria-labelledby'],
339
+ ariaDescribedby = _this$props8['aria-describedby'],
340
+ role = _this$props8.role,
341
+ isVirtualized = _this$props8.isVirtualized,
342
+ textWrap = _this$props8.textWrap,
343
+ rest = _objectWithoutProperties(_this$props8, _excluded3);
294
344
  var optionArray = visibleOptions || options;
295
345
  this.calculateAriaSetAttrs(optionArray);
296
346
  var heightIsFull = forcedHeight === 'full';
297
- var calculatedHeight = heightIsFull ? false : forcedHeight;
298
-
299
- // If calculatedHeight is still undefined, then calculate it
300
- if (calculatedHeight === undefined) {
301
- var maxVisibleOptions = 7;
302
- var numVisibleOptions = optionArray.length;
303
- var numVisibleMoreThanMax = optionArray.length > maxVisibleOptions;
304
- if (numVisibleMoreThanMax) {
305
- // Show only half of the last one to indicate there's more to scroll to
306
- calculatedHeight = (maxVisibleOptions - 0.5) * rowHeight;
307
- } else {
308
- calculatedHeight = numVisibleOptions * rowHeight;
309
- }
310
- }
311
347
  var classes = classNames('euiSelectableList', {
312
348
  'euiSelectableList-fullHeight': heightIsFull,
313
349
  'euiSelectableList-bordered': bordered
314
350
  }, className);
315
351
  return ___EmotionJSX("div", _extends({
316
352
  className: classes
317
- }, rest), isVirtualized ? ___EmotionJSX(EuiAutoSizer, {
318
- disableHeight: !heightIsFull
319
- }, function (_ref3) {
320
- var width = _ref3.width,
321
- height = _ref3.height;
322
- return ___EmotionJSX(FixedSizeList, _extends({
323
- ref: _this2.setListRef,
324
- outerRef: _this2.removeScrollableTabStop,
325
- className: "euiSelectableList__list",
326
- "data-skip-axe": "scrollable-region-focusable",
327
- width: width,
328
- height: calculatedHeight || height,
329
- itemCount: optionArray.length,
330
- itemData: optionArray,
331
- itemSize: rowHeight,
332
- innerElementType: "ul",
333
- innerRef: _this2.setListBoxRef
334
- }, windowProps), _this2.ListRow);
335
- }) : ___EmotionJSX("div", {
353
+ }, rest), isVirtualized ? this.renderVirtualizedList(heightIsFull, optionArray) : ___EmotionJSX("div", {
336
354
  className: "euiSelectableList__list",
337
355
  ref: this.removeScrollableTabStop
338
356
  }, ___EmotionJSX("ul", {
@@ -40,7 +40,7 @@ export var euiStepStyles = function euiStepStyles(euiThemeContext) {
40
40
  export var euiStepContentStyles = function euiStepContentStyles(euiThemeContext) {
41
41
  var euiTheme = euiThemeContext.euiTheme;
42
42
  var euiStep = euiStepVariables(euiTheme);
43
- var styles = {
43
+ return {
44
44
  euiStep__content: /*#__PURE__*/css(logicalCSS('margin-top', euiTheme.size.s), " ", logicalCSS('padding-top', euiTheme.size.base), " ", logicalCSS('padding-bottom', mathWithUnits([euiTheme.size.xl, euiTheme.size.s], function (x, y) {
45
45
  return x + y;
46
46
  })), " ", logicalCSS('padding-right', euiTheme.size.base), ";;label:euiStep__content;"),
@@ -50,16 +50,16 @@ export var euiStepContentStyles = function euiStepContentStyles(euiThemeContext)
50
50
  })), logicalCSS('margin-left', mathWithUnits(euiStep.numberSize, function (x) {
51
51
  return x / 2;
52
52
  })), ";;label:m;"),
53
- s: /*#__PURE__*/css(";label:s;"),
54
- // s is the same as m, so we'll programmatically duplicate it below
53
+ // `s` is the same as `m` - use a getter to duplicate its content
54
+ get s() {
55
+ return this.m;
56
+ },
55
57
  xs: /*#__PURE__*/css(logicalCSS('padding-left', mathWithUnits([euiStep.numberXSSize, euiStep.numberMargin], function (x, y) {
56
58
  return x / 2 + y;
57
59
  })), logicalCSS('margin-left', mathWithUnits(euiStep.numberXSSize, function (x) {
58
60
  return x / 2;
59
61
  })), ";;label:xs;")
60
62
  };
61
- styles.s = styles.m;
62
- return styles;
63
63
  };
64
64
  export var euiStepTitleStyles = function euiStepTitleStyles(euiThemeContext) {
65
65
  var euiTheme = euiThemeContext.euiTheme;