@elastic/eui 87.1.0 → 88.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/eui_charts_theme.js.map +1 -1
  2. package/dist/eui_theme_dark.css +0 -388
  3. package/dist/eui_theme_dark.min.css +1 -1
  4. package/dist/eui_theme_light.css +0 -388
  5. package/dist/eui_theme_light.min.css +1 -1
  6. package/es/components/color_picker/color_palette_display/color_palette_display.js +3 -6
  7. package/es/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
  8. package/es/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
  9. package/es/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
  10. package/es/components/color_picker/color_stops/color_stops.js +11 -0
  11. package/es/components/control_bar/control_bar.js +11 -0
  12. package/es/components/datagrid/controls/keyboard_shortcuts.js +0 -1
  13. package/es/components/description_list/description_list.js +28 -12
  14. package/es/components/description_list/description_list.styles.js +19 -6
  15. package/es/components/description_list/description_list_context.js +1 -1
  16. package/es/components/description_list/description_list_description.js +3 -9
  17. package/es/components/description_list/description_list_description.styles.js +3 -9
  18. package/es/components/description_list/description_list_title.js +7 -4
  19. package/es/components/description_list/description_list_title.styles.js +3 -6
  20. package/es/components/description_list/description_list_types.js +4 -2
  21. package/es/components/key_pad_menu/key_pad_menu_item.js +37 -34
  22. package/es/components/key_pad_menu/key_pad_menu_item.styles.js +41 -0
  23. package/es/components/notification/notification_event.js +10 -0
  24. package/es/components/page_template/page_template.js +2 -1
  25. package/es/components/resizable_container/index.js +2 -1
  26. package/es/components/resizable_container/resizable_button.js +81 -50
  27. package/es/components/resizable_container/resizable_button.styles.js +66 -0
  28. package/es/components/resizable_container/resizable_collapse_button.js +24 -14
  29. package/es/components/resizable_container/resizable_collapse_button.styles.js +85 -0
  30. package/es/components/steps/step.styles.js +5 -5
  31. package/es/components/suggest/suggest.js +16 -0
  32. package/es/components/suggest/suggest_item.js +12 -0
  33. package/es/services/accessibility/html_id_generator.js +19 -3
  34. package/es/services/color_picker/color_picker.js +4 -0
  35. package/es/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  36. package/eui.d.ts +2277 -2090
  37. package/i18ntokens.json +154 -154
  38. package/lib/components/color_picker/color_palette_display/color_palette_display.js +3 -6
  39. package/lib/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
  40. package/lib/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
  41. package/lib/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
  42. package/lib/components/color_picker/color_stops/color_stops.js +10 -1
  43. package/lib/components/control_bar/control_bar.js +10 -1
  44. package/lib/components/datagrid/controls/keyboard_shortcuts.js +0 -1
  45. package/lib/components/description_list/description_list.js +31 -12
  46. package/lib/components/description_list/description_list.styles.js +24 -13
  47. package/lib/components/description_list/description_list_context.js +1 -1
  48. package/lib/components/description_list/description_list_description.js +2 -8
  49. package/lib/components/description_list/description_list_description.styles.js +2 -8
  50. package/lib/components/description_list/description_list_title.js +7 -4
  51. package/lib/components/description_list/description_list_title.styles.js +2 -5
  52. package/lib/components/description_list/description_list_types.js +8 -4
  53. package/lib/components/key_pad_menu/key_pad_menu_item.js +40 -34
  54. package/lib/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
  55. package/lib/components/notification/notification_event.js +9 -0
  56. package/lib/components/page_template/page_template.js +2 -1
  57. package/lib/components/resizable_container/index.js +8 -1
  58. package/lib/components/resizable_container/resizable_button.js +83 -51
  59. package/lib/components/resizable_container/resizable_button.styles.js +71 -0
  60. package/lib/components/resizable_container/resizable_collapse_button.js +24 -14
  61. package/lib/components/resizable_container/resizable_collapse_button.styles.js +90 -0
  62. package/lib/components/steps/step.styles.js +5 -5
  63. package/lib/components/suggest/suggest.js +16 -0
  64. package/lib/components/suggest/suggest_item.js +11 -0
  65. package/lib/services/accessibility/html_id_generator.js +21 -2
  66. package/lib/services/color_picker/color_picker.js +4 -0
  67. package/lib/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  68. package/optimize/es/components/color_picker/color_stops/color_stops.js +11 -0
  69. package/optimize/es/components/control_bar/control_bar.js +11 -0
  70. package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +0 -1
  71. package/optimize/es/components/description_list/description_list.js +20 -10
  72. package/optimize/es/components/description_list/description_list.styles.js +19 -6
  73. package/optimize/es/components/description_list/description_list_context.js +1 -1
  74. package/optimize/es/components/description_list/description_list_description.js +3 -9
  75. package/optimize/es/components/description_list/description_list_description.styles.js +3 -9
  76. package/optimize/es/components/description_list/description_list_title.js +7 -4
  77. package/optimize/es/components/description_list/description_list_title.styles.js +3 -6
  78. package/optimize/es/components/description_list/description_list_types.js +4 -2
  79. package/optimize/es/components/key_pad_menu/key_pad_menu_item.js +37 -34
  80. package/optimize/es/components/key_pad_menu/key_pad_menu_item.styles.js +41 -0
  81. package/optimize/es/components/notification/notification_event.js +10 -0
  82. package/optimize/es/components/page_template/page_template.js +2 -1
  83. package/optimize/es/components/resizable_container/index.js +2 -1
  84. package/optimize/es/components/resizable_container/resizable_button.js +61 -44
  85. package/optimize/es/components/resizable_container/resizable_button.styles.js +66 -0
  86. package/optimize/es/components/resizable_container/resizable_collapse_button.js +19 -11
  87. package/optimize/es/components/resizable_container/resizable_collapse_button.styles.js +85 -0
  88. package/optimize/es/components/steps/step.styles.js +5 -5
  89. package/optimize/es/components/suggest/suggest.js +16 -0
  90. package/optimize/es/components/suggest/suggest_item.js +12 -0
  91. package/optimize/es/services/accessibility/html_id_generator.js +19 -3
  92. package/optimize/es/services/color_picker/color_picker.js +4 -0
  93. package/optimize/es/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  94. package/optimize/lib/components/color_picker/color_stops/color_stops.js +10 -1
  95. package/optimize/lib/components/control_bar/control_bar.js +10 -1
  96. package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +0 -1
  97. package/optimize/lib/components/description_list/description_list.js +23 -10
  98. package/optimize/lib/components/description_list/description_list.styles.js +24 -13
  99. package/optimize/lib/components/description_list/description_list_context.js +1 -1
  100. package/optimize/lib/components/description_list/description_list_description.js +2 -8
  101. package/optimize/lib/components/description_list/description_list_description.styles.js +2 -8
  102. package/optimize/lib/components/description_list/description_list_title.js +7 -4
  103. package/optimize/lib/components/description_list/description_list_title.styles.js +2 -5
  104. package/optimize/lib/components/description_list/description_list_types.js +8 -4
  105. package/optimize/lib/components/key_pad_menu/key_pad_menu_item.js +40 -34
  106. package/optimize/lib/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
  107. package/optimize/lib/components/notification/notification_event.js +9 -0
  108. package/optimize/lib/components/page_template/page_template.js +2 -1
  109. package/optimize/lib/components/resizable_container/index.js +8 -1
  110. package/optimize/lib/components/resizable_container/resizable_button.js +63 -45
  111. package/optimize/lib/components/resizable_container/resizable_button.styles.js +71 -0
  112. package/optimize/lib/components/resizable_container/resizable_collapse_button.js +19 -11
  113. package/optimize/lib/components/resizable_container/resizable_collapse_button.styles.js +90 -0
  114. package/optimize/lib/components/steps/step.styles.js +5 -5
  115. package/optimize/lib/components/suggest/suggest.js +16 -0
  116. package/optimize/lib/components/suggest/suggest_item.js +11 -0
  117. package/optimize/lib/services/accessibility/html_id_generator.js +21 -2
  118. package/optimize/lib/services/color_picker/color_picker.js +4 -0
  119. package/optimize/lib/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  120. package/package.json +18 -18
  121. package/src/components/index.scss +0 -2
  122. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  123. package/test-env/components/color_picker/color_palette_display/color_palette_display.js +3 -6
  124. package/test-env/components/color_picker/color_palette_display/color_palette_display_fixed.js +2 -5
  125. package/test-env/components/color_picker/color_palette_display/color_palette_display_gradient.js +2 -5
  126. package/test-env/components/color_picker/color_palette_picker/color_palette_picker.js +3 -3
  127. package/test-env/components/color_picker/color_stops/color_stops.js +10 -1
  128. package/test-env/components/control_bar/control_bar.js +10 -1
  129. package/test-env/components/datagrid/controls/keyboard_shortcuts.js +0 -1
  130. package/test-env/components/description_list/description_list.js +31 -12
  131. package/test-env/components/description_list/description_list.styles.js +24 -13
  132. package/test-env/components/description_list/description_list_context.js +1 -1
  133. package/test-env/components/description_list/description_list_description.js +2 -8
  134. package/test-env/components/description_list/description_list_description.styles.js +2 -8
  135. package/test-env/components/description_list/description_list_title.js +7 -4
  136. package/test-env/components/description_list/description_list_title.styles.js +2 -5
  137. package/test-env/components/description_list/description_list_types.js +8 -4
  138. package/test-env/components/key_pad_menu/key_pad_menu_item.js +40 -34
  139. package/test-env/components/key_pad_menu/key_pad_menu_item.styles.js +49 -0
  140. package/test-env/components/notification/notification_event.js +9 -0
  141. package/test-env/components/page_template/page_template.js +2 -1
  142. package/test-env/components/resizable_container/index.js +8 -1
  143. package/test-env/components/resizable_container/resizable_button.js +83 -51
  144. package/test-env/components/resizable_container/resizable_button.styles.js +71 -0
  145. package/test-env/components/resizable_container/resizable_collapse_button.js +19 -14
  146. package/test-env/components/resizable_container/resizable_collapse_button.styles.js +90 -0
  147. package/test-env/components/steps/step.styles.js +5 -5
  148. package/test-env/components/suggest/suggest.js +16 -0
  149. package/test-env/components/suggest/suggest_item.js +11 -0
  150. package/test-env/services/color_picker/color_picker.js +4 -0
  151. package/test-env/themes/amsterdam/global_styling/mixins/shadow.js +0 -1
  152. package/src/components/key_pad_menu/_index.scss +0 -5
  153. package/src/components/key_pad_menu/_key_pad_menu_item.scss +0 -123
  154. package/src/components/key_pad_menu/_variables.scss +0 -2
  155. package/src/components/resizable_container/_index.scss +0 -3
  156. package/src/components/resizable_container/_resizable_button.scss +0 -129
  157. package/src/components/resizable_container/_resizable_collapse_button.scss +0 -145
  158. package/src/components/resizable_container/_variables.scss +0 -2
  159. package/src/themes/amsterdam/overrides/_key_pad_menu.scss +0 -46
@@ -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
+ };
@@ -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;
@@ -49,6 +49,22 @@ var statusMap = {
49
49
 
50
50
  // keys of _EuiSuggestItemPropsBase
51
51
  var suggestItemPropsKeys = ['label', 'type', 'description', 'labelDisplay', 'labelWidth', 'descriptionDisplay'];
52
+
53
+ /**
54
+ * @deprecated
55
+ */
56
+
57
+ /**
58
+ * @deprecated
59
+ */
60
+
61
+ /**
62
+ * @deprecated - EuiSuggest is scheduled for deprecation due to low internal usage and high
63
+ * overlap with other existing EUI components. We recommend using EuiSelectable instead,
64
+ * or copying this component into your own application for usage if necessary.
65
+ *
66
+ * The component will be permanently removed in October 2023.
67
+ */
52
68
  export var EuiSuggest = function EuiSuggest(_ref) {
53
69
  var onItemClick = _ref.onItemClick,
54
70
  onBlur = _ref.onBlur,
@@ -15,6 +15,10 @@ import PropTypes from "prop-types";
15
15
  import { keysOf } from '../common';
16
16
  import classNames from 'classnames';
17
17
  import { EuiIcon } from '../icon';
18
+
19
+ /**
20
+ * @deprecated
21
+ */
18
22
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
23
  var colorToClassNameMap = {
20
24
  tint0: 'euiSuggestItem__type--tint0',
@@ -30,6 +34,14 @@ var colorToClassNameMap = {
30
34
  tint10: 'euiSuggestItem__type--tint10'
31
35
  };
32
36
  export var COLORS = keysOf(colorToClassNameMap);
37
+
38
+ /**
39
+ * @deprecated - EuiSuggest is scheduled for deprecation due to low internal usage and high
40
+ * overlap with other existing EUI components. We recommend using EuiSelectable instead,
41
+ * or copying this component into your own application for usage if necessary.
42
+ *
43
+ * The component will be permanently removed in October 2023.
44
+ */
33
45
  export var EuiSuggestItem = function EuiSuggestItem(_ref) {
34
46
  var className = _ref.className,
35
47
  label = _ref.label,
@@ -6,8 +6,8 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
 
9
+ import React, { useMemo } from 'react';
9
10
  import { v1 as uuidv1 } from 'uuid';
10
- import { useMemo } from 'react';
11
11
 
12
12
  /**
13
13
  * This function returns a function to generate ids.
@@ -32,7 +32,8 @@ export function htmlIdGenerator() {
32
32
  * This prevents IDs from being re-randomized on every component update.
33
33
  */
34
34
 
35
- export var useGeneratedHtmlId = function useGeneratedHtmlId() {
35
+ // We can remove this deprecated hook once EUI no longer needs to support React 16-17
36
+ var useDeprecatedGeneratedHtmlId = function useDeprecatedGeneratedHtmlId() {
36
37
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
37
38
  prefix = _ref.prefix,
38
39
  suffix = _ref.suffix,
@@ -40,4 +41,19 @@ export var useGeneratedHtmlId = function useGeneratedHtmlId() {
40
41
  return useMemo(function () {
41
42
  return conditionalId || htmlIdGenerator(prefix)(suffix);
42
43
  }, [conditionalId, prefix, suffix]);
43
- };
44
+ };
45
+ var useNewGeneratedHtmlId = function useNewGeneratedHtmlId() {
46
+ var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
47
+ _ref2$prefix = _ref2.prefix,
48
+ prefix = _ref2$prefix === void 0 ? '' : _ref2$prefix,
49
+ _ref2$suffix = _ref2.suffix,
50
+ suffix = _ref2$suffix === void 0 ? '' : _ref2$suffix,
51
+ conditionalId = _ref2.conditionalId;
52
+ // Using the default export and dot notation here is intentional
53
+ // to prevent React <18 import errors.
54
+ var id = React.useId();
55
+ return useMemo(function () {
56
+ return conditionalId || "".concat(prefix).concat(id).concat(suffix);
57
+ }, [id, conditionalId, prefix, suffix]);
58
+ };
59
+ export var useGeneratedHtmlId = 'useId' in React ? useNewGeneratedHtmlId : useDeprecatedGeneratedHtmlId;
@@ -18,6 +18,10 @@ var generateRandomColor = function generateRandomColor() {
18
18
  "#".concat(Math.floor(Math.random() * 16777215).toString(16))
19
19
  );
20
20
  };
21
+
22
+ /**
23
+ * @deprecated
24
+ */
21
25
  export var useColorStopsState = function useColorStopsState() {
22
26
  var useRandomColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
23
27
  var initialColorStops = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [{
@@ -78,7 +78,6 @@ export var euiShadowXLarge = function euiShadowXLarge(_ref9) {
78
78
 
79
79
  /**
80
80
  * slightShadowHover
81
- * TODO: I think this is only used by panels/cards in the Amsterdam theme, move there
82
81
  */
83
82
  export var euiSlightShadowHover = function euiSlightShadowHover(_ref11) {
84
83
  var euiTheme = _ref11.euiTheme,