@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
@@ -6,11 +6,15 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.EuiResizableCollapseButton = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
11
  var _react = _interopRequireDefault(require("react"));
11
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
12
13
  var _classnames = _interopRequireDefault(require("classnames"));
14
+ var _services = require("../../services");
13
15
  var _button = require("../button");
16
+ var _screen_reader_only = require("../accessibility/screen_reader_only/screen_reader_only.styles");
17
+ var _resizable_collapse_button = require("./resizable_collapse_button.styles");
14
18
  var _react2 = require("@emotion/react");
15
19
  var _excluded = ["className", "externalPosition", "internalPosition", "direction", "isVisible", "isCollapsed"];
16
20
  /*
@@ -22,7 +26,8 @@ var _excluded = ["className", "externalPosition", "internalPosition", "direction
22
26
  */
23
27
  var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
24
28
  var className = _ref.className,
25
- externalPosition = _ref.externalPosition,
29
+ _ref$externalPosition = _ref.externalPosition,
30
+ externalPosition = _ref$externalPosition === void 0 ? 'before' : _ref$externalPosition,
26
31
  _ref$internalPosition = _ref.internalPosition,
27
32
  internalPosition = _ref$internalPosition === void 0 ? 'middle' : _ref$internalPosition,
28
33
  _ref$direction = _ref.direction,
@@ -31,14 +36,15 @@ var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
31
36
  isCollapsed = _ref.isCollapsed,
32
37
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
33
38
  var isHorizontal = direction === 'horizontal';
34
- var classes = (0, _classnames.default)('euiResizableToggleButton', "euiResizableToggleButton--".concat(direction), "euiResizableToggleButton--".concat(externalPosition), "euiResizableToggleButton--".concat(internalPosition), {
35
- 'euiResizableToggleButton-isVisible': isVisible,
36
- 'euiResizableToggleButton-isCollapsed': isCollapsed
37
- }, className);
38
-
39
- // Default to simiple grab icon in case there is no externalPosition specified
40
- var COLLAPSED_ICON = isHorizontal ? 'grab' : 'grabHorizontal';
41
- var NOT_COLLAPSED_ICON = isHorizontal ? 'grab' : 'grabHorizontal';
39
+ var showOnFocus = !isCollapsed && !isVisible;
40
+ var screenReaderOnlyStyles = (0, _screen_reader_only.euiScreenReaderOnlyStyles)(showOnFocus).euiScreenReaderOnly;
41
+ var euiTheme = (0, _services.useEuiTheme)();
42
+ var styles = (0, _resizable_collapse_button.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((0, _toConsumableArray2.default)(isCollapsed ? collapsedStyles : collapsibleStyles));
46
+ var COLLAPSED_ICON = '';
47
+ var NOT_COLLAPSED_ICON = '';
42
48
  switch (externalPosition) {
43
49
  case 'before':
44
50
  COLLAPSED_ICON = isHorizontal ? 'menuLeft' : 'menuUp';
@@ -49,11 +55,13 @@ var EuiResizableCollapseButton = function EuiResizableCollapseButton(_ref) {
49
55
  NOT_COLLAPSED_ICON = isHorizontal ? 'menuLeft' : 'menuUp';
50
56
  break;
51
57
  }
58
+ var classes = (0, _classnames.default)('euiResizableCollapseButton', className);
52
59
  return (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
53
60
  display: isCollapsed ? 'empty' : 'base',
54
- color: "text"
55
- }, rest, {
61
+ color: "text",
56
62
  className: classes,
63
+ css: cssStyles
64
+ }, rest, {
57
65
  iconType: isCollapsed ? COLLAPSED_ICON : NOT_COLLAPSED_ICON
58
66
  }));
59
67
  };
@@ -73,9 +81,6 @@ EuiResizableCollapseButton.propTypes = {
73
81
  * Same direction derived from EuiResizableContainer
74
82
  */
75
83
  direction: _propTypes.default.oneOf(["vertical", "horizontal"]),
76
- /**
77
- *
78
- */
79
84
  isVisible: _propTypes.default.bool,
80
85
  isCollapsed: _propTypes.default.bool
81
86
  };
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiResizableCollapseButtonStyles = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _global_styling = require("../../global_styling");
9
+ var _amsterdam = require("../../themes/amsterdam");
10
+ 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)."; } /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+ var _ref = process.env.NODE_ENV === "production" ? {
18
+ name: "fuwsll-euiResizableCollapseButton",
19
+ styles: "z-index:2;position:absolute;&:focus{animation:none;};label:euiResizableCollapseButton;"
20
+ } : {
21
+ name: "fuwsll-euiResizableCollapseButton",
22
+ styles: "z-index:2;position:absolute;&:focus{animation:none;};label:euiResizableCollapseButton;",
23
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
24
+ };
25
+ var euiResizableCollapseButtonStyles = function euiResizableCollapseButtonStyles(euiThemeContext) {
26
+ var euiTheme = euiThemeContext.euiTheme;
27
+ var buttonSize = euiTheme.size.l;
28
+ var centeringOffset = (0, _global_styling.mathWithUnits)(buttonSize, function (x) {
29
+ return x / -2;
30
+ }); // Use negative margins instead of transforms to avoid having to override EuiButtonIcon's CSS
31
+ var buttonOffset = euiTheme.size.base;
32
+ return {
33
+ euiResizableCollapseButton: _ref,
34
+ collapsible: {
35
+ collapsible: /*#__PURE__*/(0, _react.css)("background:", euiTheme.colors.emptyShade, ";", (0, _amsterdam.euiShadowXSmall)(euiThemeContext), " &:focus{", (0, _amsterdam.euiSlightShadowHover)(euiThemeContext), ";};label:collapsible;"),
36
+ horizontal: {
37
+ after: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('margin-right', centeringOffset), ";;label:after;"),
38
+ before: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('margin-left', centeringOffset), ";;label:before;"),
39
+ middle: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', '50%'), " ", (0, _global_styling.logicalCSS)('margin-top', centeringOffset), ";;label:middle;"),
40
+ top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('margin-top', buttonOffset), ";;label:top;"),
41
+ bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('margin-bottom', buttonOffset), ";;label:bottom;"),
42
+ // `left/right` aren't valid positions for the horizontal direction,
43
+ // so we're using getters to fall back to the `middle` CSS
44
+ get left() {
45
+ return this.middle;
46
+ },
47
+ get right() {
48
+ return this.middle;
49
+ }
50
+ },
51
+ vertical: {
52
+ after: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', '100%'), " ", (0, _global_styling.logicalCSS)('margin-top', centeringOffset), ";;label:after;"),
53
+ before: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('bottom', '100%'), " ", (0, _global_styling.logicalCSS)('margin-bottom', centeringOffset), ";;label:before;"),
54
+ middle: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', '50%'), " ", (0, _global_styling.logicalCSS)('margin-left', centeringOffset), ";;label:middle;"),
55
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('margin-left', buttonOffset), ";;label:left;"),
56
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.logicalCSS)('margin-right', buttonOffset), ";;label:right;"),
57
+ // `top/bottom` aren't valid positions for the horizontal direction,
58
+ // so we're using getters to fall back to the `middle` CSS
59
+ get top() {
60
+ return this.middle;
61
+ },
62
+ get bottom() {
63
+ return this.middle;
64
+ }
65
+ }
66
+ },
67
+ collapsed: {
68
+ // When collapsed, the button itself is the full collapsed area
69
+ // and we use flex to align the icon within
70
+ collapsed: /*#__PURE__*/(0, _react.css)("border-radius:0;", (0, _global_styling.logicalCSS)('top', 0), ";;label:collapsed;"),
71
+ horizontal: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', '100%'), ";;label:horizontal;"),
72
+ vertical: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), ";;label:vertical;"),
73
+ horizontalPositions: {
74
+ top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-top', buttonOffset), " align-items:flex-start;;label:top;"),
75
+ bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-bottom', buttonOffset), " align-items:flex-end;;label:bottom;"),
76
+ middle: /*#__PURE__*/(0, _react.css)(";label:middle;"),
77
+ left: /*#__PURE__*/(0, _react.css)(";label:left;"),
78
+ right: /*#__PURE__*/(0, _react.css)(";label:right;")
79
+ },
80
+ verticalPositions: {
81
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', buttonOffset), " justify-content:flex-start;;label:left;"),
82
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-right', buttonOffset), " justify-content:flex-end;;label:right;"),
83
+ middle: /*#__PURE__*/(0, _react.css)(";label:middle;"),
84
+ top: /*#__PURE__*/(0, _react.css)(";label:top;"),
85
+ bottom: /*#__PURE__*/(0, _react.css)(";label:bottom;")
86
+ }
87
+ }
88
+ };
89
+ };
90
+ exports.euiResizableCollapseButtonStyles = euiResizableCollapseButtonStyles;
@@ -171,17 +171,67 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
171
171
  search: searchValue
172
172
  }, label));
173
173
  }, _reactWindow.areEqual));
174
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_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 ? (0, _react2.jsx)(_auto_sizer.EuiAutoSizer, null, function (_ref2) {
208
+ var width = _ref2.width,
209
+ height = _ref2.height;
210
+ return (0, _react2.jsx)(_reactWindow.FixedSizeList, (0, _extends2.default)({
211
+ width: width,
212
+ height: height
213
+ }, virtualizationProps), _this.ListRow);
214
+ }) : (0, _react2.jsx)(_auto_sizer.EuiAutoSizer, {
215
+ disableHeight: true
216
+ }, function (_ref3) {
217
+ var width = _ref3.width;
218
+ return (0, _react2.jsx)(_reactWindow.FixedSizeList, (0, _extends2.default)({
219
+ width: width,
220
+ height: calculatedHeight
221
+ }, virtualizationProps), _this.ListRow);
222
+ });
223
+ });
174
224
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_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 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
194
244
  });
195
245
  });
196
246
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_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 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
216
266
  onOptionClick(updatedOptions, event, changedOption);
217
267
  });
218
268
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_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 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
232
282
  onOptionClick(updatedOptions, event, changedOption);
233
283
  });
234
284
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_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 @@ 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 = (0, _objectWithoutProperties2.default)(_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 = (0, _objectWithoutProperties2.default)(_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 = (0, _classnames.default)('euiSelectableList', {
312
348
  'euiSelectableList-fullHeight': heightIsFull,
313
349
  'euiSelectableList-bordered': bordered
314
350
  }, className);
315
351
  return (0, _react2.jsx)("div", (0, _extends2.default)({
316
352
  className: classes
317
- }, rest), isVirtualized ? (0, _react2.jsx)(_auto_sizer.EuiAutoSizer, {
318
- disableHeight: !heightIsFull
319
- }, function (_ref3) {
320
- var width = _ref3.width,
321
- height = _ref3.height;
322
- return (0, _react2.jsx)(_reactWindow.FixedSizeList, (0, _extends2.default)({
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
- }) : (0, _react2.jsx)("div", {
353
+ }, rest), isVirtualized ? this.renderVirtualizedList(heightIsFull, optionArray) : (0, _react2.jsx)("div", {
336
354
  className: "euiSelectableList__list",
337
355
  ref: this.removeScrollableTabStop
338
356
  }, (0, _react2.jsx)("ul", {
@@ -48,7 +48,7 @@ exports.euiStepStyles = euiStepStyles;
48
48
  var euiStepContentStyles = function euiStepContentStyles(euiThemeContext) {
49
49
  var euiTheme = euiThemeContext.euiTheme;
50
50
  var euiStep = euiStepVariables(euiTheme);
51
- var styles = {
51
+ return {
52
52
  euiStep__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), " ", (0, _global_styling.logicalCSS)('padding-top', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-bottom', (0, _global_styling.mathWithUnits)([euiTheme.size.xl, euiTheme.size.s], function (x, y) {
53
53
  return x + y;
54
54
  })), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";;label:euiStep__content;"),
@@ -58,16 +58,16 @@ var euiStepContentStyles = function euiStepContentStyles(euiThemeContext) {
58
58
  })), (0, _global_styling.logicalCSS)('margin-left', (0, _global_styling.mathWithUnits)(euiStep.numberSize, function (x) {
59
59
  return x / 2;
60
60
  })), ";;label:m;"),
61
- s: /*#__PURE__*/(0, _react.css)(";label:s;"),
62
- // s is the same as m, so we'll programmatically duplicate it below
61
+ // `s` is the same as `m` - use a getter to duplicate its content
62
+ get s() {
63
+ return this.m;
64
+ },
63
65
  xs: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', (0, _global_styling.mathWithUnits)([euiStep.numberXSSize, euiStep.numberMargin], function (x, y) {
64
66
  return x / 2 + y;
65
67
  })), (0, _global_styling.logicalCSS)('margin-left', (0, _global_styling.mathWithUnits)(euiStep.numberXSSize, function (x) {
66
68
  return x / 2;
67
69
  })), ";;label:xs;")
68
70
  };
69
- styles.s = styles.m;
70
- return styles;
71
71
  };
72
72
  exports.euiStepContentStyles = euiStepContentStyles;
73
73
  var euiStepTitleStyles = function euiStepTitleStyles(euiThemeContext) {
@@ -70,7 +70,7 @@ EuiIconTip.propTypes = {
70
70
  /**
71
71
  * Common display alternatives for the anchor wrapper
72
72
  */
73
- display: _propTypes.default.oneOf(["inlineBlock", "block"]),
73
+ display: _propTypes.default.any,
74
74
  /**
75
75
  * An optional title for your tooltip.
76
76
  */
@@ -18,7 +18,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
18
18
  var _react = _interopRequireWildcard(require("react"));
19
19
  var _propTypes = _interopRequireDefault(require("prop-types"));
20
20
  var _classnames = _interopRequireDefault(require("classnames"));
21
- var _common = require("../common");
22
21
  var _services = require("../../services");
23
22
  var _react2 = require("../../services/react");
24
23
  var _resize_observer = require("../observer/resize_observer");
@@ -39,22 +38,13 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
39
38
  * in compliance with, at your election, the Elastic License 2.0 or the Server
40
39
  * Side Public License, v 1.
41
40
  */
42
- var positionsToClassNameMap = {
43
- top: 'euiToolTip--top',
44
- right: 'euiToolTip--right',
45
- bottom: 'euiToolTip--bottom',
46
- left: 'euiToolTip--left'
47
- };
48
- var POSITIONS = (0, _common.keysOf)(positionsToClassNameMap);
41
+ var POSITIONS = ['top', 'right', 'bottom', 'left'];
49
42
  exports.POSITIONS = POSITIONS;
43
+ var DISPLAYS = ['inlineBlock', 'block'];
50
44
  var delayToMsMap = {
51
45
  regular: 250,
52
46
  long: 250 * 5
53
47
  };
54
- var displayToClassNameMap = {
55
- inlineBlock: undefined,
56
- block: 'euiToolTipAnchor--displayBlock'
57
- };
58
48
  var DEFAULT_TOOLTIP_STYLES = {
59
49
  // position the tooltip content near the top-left
60
50
  // corner of the window so it can't create scrollbars
@@ -265,7 +255,7 @@ var EuiToolTip = /*#__PURE__*/function (_Component) {
265
255
  onFocus: this.onFocus,
266
256
  onMouseOver: this.showToolTip,
267
257
  onMouseOut: this.onMouseOut,
268
- id: this.state.id,
258
+ id: id,
269
259
  className: anchorClasses,
270
260
  display: display,
271
261
  isVisible: visible
@@ -328,7 +318,7 @@ EuiToolTip.propTypes = {
328
318
  /**
329
319
  * Common display alternatives for the anchor wrapper
330
320
  */
331
- display: _propTypes.default.oneOf(["inlineBlock", "block"]),
321
+ display: _propTypes.default.any,
332
322
  /**
333
323
  * Delay before showing tooltip. Good for repeatable items.
334
324
  */
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.EuiToolTipAnchor = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
11
  var _react = _interopRequireWildcard(require("react"));
13
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
@@ -24,8 +23,6 @@ var _excluded = ["onBlur", "onFocus", "onMouseOver", "onMouseOut", "id", "classN
24
23
  */
25
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
26
25
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
- 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; }
28
- 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) { (0, _defineProperty2.default)(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; }
29
26
  var EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
30
27
  var _onBlur = _ref.onBlur,
31
28
  _onFocus = _ref.onFocus,
@@ -49,7 +46,7 @@ var EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
49
46
  className: classes,
50
47
  onMouseOver: onMouseOver,
51
48
  onMouseOut: onMouseOut
52
- }), /*#__PURE__*/(0, _react.cloneElement)(children, _objectSpread({
49
+ }), /*#__PURE__*/(0, _react.cloneElement)(children, {
53
50
  onFocus: function onFocus(e) {
54
51
  _onFocus();
55
52
  children.props.onFocus && children.props.onFocus(e);
@@ -57,18 +54,15 @@ var EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
57
54
  onBlur: function onBlur(e) {
58
55
  _onBlur();
59
56
  children.props.onBlur && children.props.onBlur(e);
60
- }
61
- }, isVisible && {
62
- 'aria-describedby': id
63
- })))
57
+ },
58
+ 'aria-describedby': isVisible ? (0, _classnames.default)(id, children.props['aria-describedby']) : children.props['aria-describedby']
59
+ }))
64
60
  );
65
61
  });
66
62
  exports.EuiToolTipAnchor = EuiToolTipAnchor;
67
63
  EuiToolTipAnchor.propTypes = {
68
64
  onBlur: _propTypes.default.func.isRequired,
69
65
  onFocus: _propTypes.default.func.isRequired,
70
- children: _propTypes.default.element.isRequired,
71
- isVisible: _propTypes.default.bool.isRequired,
72
- display: _propTypes.default.oneOf(["block", "inlineBlock"]).isRequired
66
+ isVisible: _propTypes.default.bool.isRequired
73
67
  };
74
68
  EuiToolTipAnchor.displayName = 'EuiToolTipAnchor';
@@ -87,7 +87,6 @@ var euiShadowXLarge = function euiShadowXLarge(_ref9) {
87
87
 
88
88
  /**
89
89
  * slightShadowHover
90
- * TODO: I think this is only used by panels/cards in the Amsterdam theme, move there
91
90
  */
92
91
  exports.euiShadowXLarge = euiShadowXLarge;
93
92
  var euiSlightShadowHover = function euiSlightShadowHover(_ref11) {
@@ -1,3 +0,0 @@
1
- @import 'variables';
2
- @import 'resizable_button';
3
- @import 'resizable_collapse_button';