@elastic/eui 70.2.3 → 70.3.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 (143) hide show
  1. package/dist/eui_theme_dark.css +0 -198
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -198
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/accessibility/skip_link/skip_link.js +6 -5
  6. package/es/components/badge/beta_badge/beta_badge.js +11 -3
  7. package/es/components/badge/beta_badge/beta_badge.styles.js +25 -4
  8. package/es/components/card/card.js +6 -1
  9. package/es/components/card/card.styles.js +4 -4
  10. package/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +109 -0
  11. package/es/components/flex/flex_group.styles.js +1 -1
  12. package/es/components/flyout/flyout.a11y.js +92 -0
  13. package/es/components/image/image_fullscreen_wrapper.styles.js +3 -11
  14. package/es/components/modal/confirm_modal.js +11 -0
  15. package/es/components/modal/modal.a11y.js +70 -0
  16. package/es/components/modal/modal.js +17 -27
  17. package/es/components/modal/modal.styles.js +23 -0
  18. package/es/components/modal/modal_body.js +8 -0
  19. package/es/components/modal/modal_body.styles.js +16 -0
  20. package/es/components/modal/modal_footer.js +6 -0
  21. package/es/components/modal/modal_footer.styles.js +15 -0
  22. package/es/components/modal/modal_header.js +6 -0
  23. package/es/components/modal/modal_header.styles.js +14 -0
  24. package/es/components/modal/modal_header_title.js +3 -1
  25. package/es/components/page_template/outer/page_outer.js +1 -1
  26. package/es/components/page_template/page_template.js +28 -6
  27. package/es/components/popover/popover.a11y.js +83 -0
  28. package/es/components/search_bar/query/default_syntax.js +2 -1
  29. package/es/components/tabs/tabs.a11y.js +97 -0
  30. package/es/components/tree_view/tree_view.a11y.js +74 -0
  31. package/es/global_styling/utility/animations.js +5 -2
  32. package/eui.d.ts +58 -7
  33. package/i18ntokens.json +2 -2
  34. package/lib/components/accessibility/skip_link/skip_link.js +6 -5
  35. package/lib/components/badge/beta_badge/beta_badge.js +13 -4
  36. package/lib/components/badge/beta_badge/beta_badge.styles.js +25 -4
  37. package/lib/components/card/card.js +6 -1
  38. package/lib/components/card/card.styles.js +4 -4
  39. package/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
  40. package/lib/components/flex/flex_group.styles.js +1 -1
  41. package/lib/components/flyout/flyout.a11y.js +94 -0
  42. package/lib/components/image/image_fullscreen_wrapper.styles.js +9 -10
  43. package/lib/components/modal/confirm_modal.js +13 -0
  44. package/lib/components/modal/modal.a11y.js +73 -0
  45. package/lib/components/modal/modal.js +17 -32
  46. package/lib/components/modal/modal.styles.js +36 -0
  47. package/lib/components/modal/modal_body.js +10 -0
  48. package/lib/components/modal/modal_body.styles.js +27 -0
  49. package/lib/components/modal/modal_footer.js +8 -0
  50. package/lib/components/modal/modal_footer.styles.js +26 -0
  51. package/lib/components/modal/modal_header.js +8 -0
  52. package/lib/components/modal/modal_header.styles.js +24 -0
  53. package/lib/components/modal/modal_header_title.js +4 -1
  54. package/lib/components/page_template/outer/page_outer.js +1 -1
  55. package/lib/components/page_template/page_template.js +32 -10
  56. package/lib/components/popover/popover.a11y.js +86 -0
  57. package/lib/components/search_bar/query/default_syntax.js +2 -1
  58. package/lib/components/tabs/tabs.a11y.js +98 -0
  59. package/lib/components/tree_view/tree_view.a11y.js +80 -0
  60. package/lib/global_styling/utility/animations.js +9 -3
  61. package/optimize/es/components/accessibility/skip_link/skip_link.js +6 -5
  62. package/optimize/es/components/badge/beta_badge/beta_badge.js +5 -2
  63. package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +25 -4
  64. package/optimize/es/components/card/card.styles.js +4 -4
  65. package/optimize/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +98 -0
  66. package/optimize/es/components/flex/flex_group.styles.js +1 -1
  67. package/optimize/es/components/flyout/flyout.a11y.js +77 -0
  68. package/optimize/es/components/image/image_fullscreen_wrapper.styles.js +3 -11
  69. package/optimize/es/components/modal/confirm_modal.js +6 -0
  70. package/optimize/es/components/modal/modal.a11y.js +60 -0
  71. package/optimize/es/components/modal/modal.js +17 -27
  72. package/optimize/es/components/modal/modal.styles.js +23 -0
  73. package/optimize/es/components/modal/modal_body.js +8 -0
  74. package/optimize/es/components/modal/modal_body.styles.js +16 -0
  75. package/optimize/es/components/modal/modal_footer.js +6 -0
  76. package/optimize/es/components/modal/modal_footer.styles.js +15 -0
  77. package/optimize/es/components/modal/modal_header.js +6 -0
  78. package/optimize/es/components/modal/modal_header.styles.js +14 -0
  79. package/optimize/es/components/modal/modal_header_title.js +3 -1
  80. package/optimize/es/components/page_template/page_template.js +5 -3
  81. package/optimize/es/components/popover/popover.a11y.js +73 -0
  82. package/optimize/es/components/search_bar/query/default_syntax.js +2 -1
  83. package/optimize/es/components/tabs/tabs.a11y.js +97 -0
  84. package/optimize/es/components/tree_view/tree_view.a11y.js +74 -0
  85. package/optimize/es/global_styling/utility/animations.js +5 -2
  86. package/optimize/lib/components/accessibility/skip_link/skip_link.js +6 -5
  87. package/optimize/lib/components/badge/beta_badge/beta_badge.js +7 -3
  88. package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +25 -4
  89. package/optimize/lib/components/card/card.styles.js +4 -4
  90. package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
  91. package/optimize/lib/components/flex/flex_group.styles.js +1 -1
  92. package/optimize/lib/components/flyout/flyout.a11y.js +84 -0
  93. package/optimize/lib/components/image/image_fullscreen_wrapper.styles.js +9 -12
  94. package/optimize/lib/components/modal/confirm_modal.js +8 -0
  95. package/optimize/lib/components/modal/modal.a11y.js +73 -0
  96. package/optimize/lib/components/modal/modal.js +17 -31
  97. package/optimize/lib/components/modal/modal.styles.js +36 -0
  98. package/optimize/lib/components/modal/modal_body.js +10 -0
  99. package/optimize/lib/components/modal/modal_body.styles.js +27 -0
  100. package/optimize/lib/components/modal/modal_footer.js +8 -0
  101. package/optimize/lib/components/modal/modal_footer.styles.js +26 -0
  102. package/optimize/lib/components/modal/modal_header.js +8 -0
  103. package/optimize/lib/components/modal/modal_header.styles.js +24 -0
  104. package/optimize/lib/components/modal/modal_header_title.js +4 -1
  105. package/optimize/lib/components/page_template/page_template.js +5 -3
  106. package/optimize/lib/components/popover/popover.a11y.js +86 -0
  107. package/optimize/lib/components/search_bar/query/default_syntax.js +2 -1
  108. package/optimize/lib/components/tabs/tabs.a11y.js +98 -0
  109. package/optimize/lib/components/tree_view/tree_view.a11y.js +80 -0
  110. package/optimize/lib/global_styling/utility/animations.js +9 -3
  111. package/package.json +5 -4
  112. package/src/components/index.scss +0 -1
  113. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  114. package/test-env/components/accessibility/skip_link/skip_link.js +6 -5
  115. package/test-env/components/badge/beta_badge/beta_badge.js +13 -4
  116. package/test-env/components/badge/beta_badge/beta_badge.styles.js +25 -4
  117. package/test-env/components/card/card.js +6 -1
  118. package/test-env/components/card/card.styles.js +4 -4
  119. package/test-env/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
  120. package/test-env/components/flex/flex_group.styles.js +1 -1
  121. package/test-env/components/flyout/flyout.a11y.js +84 -0
  122. package/test-env/components/image/image_fullscreen_wrapper.styles.js +9 -12
  123. package/test-env/components/modal/confirm_modal.js +13 -0
  124. package/test-env/components/modal/modal.a11y.js +73 -0
  125. package/test-env/components/modal/modal.js +17 -31
  126. package/test-env/components/modal/modal.styles.js +36 -0
  127. package/test-env/components/modal/modal_body.js +10 -0
  128. package/test-env/components/modal/modal_body.styles.js +27 -0
  129. package/test-env/components/modal/modal_footer.js +8 -0
  130. package/test-env/components/modal/modal_footer.styles.js +26 -0
  131. package/test-env/components/modal/modal_header.js +8 -0
  132. package/test-env/components/modal/modal_header.styles.js +24 -0
  133. package/test-env/components/modal/modal_header_title.js +4 -1
  134. package/test-env/components/page_template/outer/page_outer.js +1 -1
  135. package/test-env/components/page_template/page_template.js +32 -10
  136. package/test-env/components/popover/popover.a11y.js +86 -0
  137. package/test-env/components/search_bar/query/default_syntax.js +2 -1
  138. package/test-env/components/tabs/tabs.a11y.js +98 -0
  139. package/test-env/components/tree_view/tree_view.a11y.js +80 -0
  140. package/test-env/global_styling/utility/animations.js +9 -3
  141. package/src/components/modal/_index.scss +0 -1
  142. package/src/components/modal/_modal.scss +0 -156
  143. package/src/themes/amsterdam/overrides/_modal.scss +0 -3
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ import { euiYScrollWithShadows, euiBreakpoint } from '../../global_styling';
10
+ export var euiModalBodyStyles = function euiModalBodyStyles(euiThemeContext) {
11
+ var euiTheme = euiThemeContext.euiTheme;
12
+ return {
13
+ euiModalBody: /*#__PURE__*/css("flex-grow:1;overflow:hidden;display:flex;flex-direction:column;&:last-of-type .euiModalBody__overflow{padding-block-end:", euiTheme.size.l, ";};label:euiModalBody;"),
14
+ euiModalBody__overflow: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext), ";padding-inline:", euiTheme.size.l, ";padding-block:", euiTheme.size.s, ";", euiBreakpoint(euiThemeContext, ['xs', 's']), "{padding-block-end:", euiTheme.size.l, ";};label:euiModalBody__overflow;")
15
+ };
16
+ };
@@ -16,6 +16,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classnames from 'classnames';
19
+ import { useEuiTheme } from '../../services';
20
+ import { euiModalFooterStyles } from './modal_footer.styles';
19
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
22
  export var EuiModalFooter = function EuiModalFooter(_ref) {
21
23
  var className = _ref.className,
@@ -23,7 +25,11 @@ export var EuiModalFooter = function EuiModalFooter(_ref) {
23
25
  rest = _objectWithoutProperties(_ref, _excluded);
24
26
 
25
27
  var classes = classnames('euiModalFooter', className);
28
+ var euiTheme = useEuiTheme();
29
+ var styles = euiModalFooterStyles(euiTheme);
30
+ var cssStyles = [styles.euiModalFooter];
26
31
  return ___EmotionJSX("div", _extends({
32
+ css: cssStyles,
27
33
  className: classes
28
34
  }, rest), children);
29
35
  };
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ import { euiBreakpoint } from '../../global_styling';
10
+ export var euiModalFooterStyles = function euiModalFooterStyles(euiThemeContext) {
11
+ var euiTheme = euiThemeContext.euiTheme;
12
+ return {
13
+ euiModalFooter: /*#__PURE__*/css("display:flex;justify-content:flex-end;padding-block:", euiTheme.size.base, " ", euiTheme.size.l, ";padding-inline:", euiTheme.size.l, ";flex-grow:0;flex-shrink:0;gap:", euiTheme.size.base, ";", euiBreakpoint(euiThemeContext, ['xs', 's']), "{background:", euiTheme.colors.lightestShade, ";padding-block:", euiTheme.size.m, ";padding-inline:", euiTheme.size.l, ";justify-content:stretch;gap:", euiTheme.size.s, ";>*{flex:1;}};label:euiModalFooter;")
14
+ };
15
+ };
@@ -16,6 +16,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classnames from 'classnames';
19
+ import { useEuiTheme } from '../../services';
20
+ import { euiModalHeaderStyles } from './modal_header.styles';
19
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
22
  export var EuiModalHeader = function EuiModalHeader(_ref) {
21
23
  var className = _ref.className,
@@ -23,7 +25,11 @@ export var EuiModalHeader = function EuiModalHeader(_ref) {
23
25
  rest = _objectWithoutProperties(_ref, _excluded);
24
26
 
25
27
  var classes = classnames('euiModalHeader', className);
28
+ var euiTheme = useEuiTheme();
29
+ var styles = euiModalHeaderStyles(euiTheme);
30
+ var cssStyles = [styles.euiModalHeader];
26
31
  return ___EmotionJSX("div", _extends({
32
+ css: cssStyles,
27
33
  className: classes
28
34
  }, rest), children);
29
35
  };
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ export var euiModalHeaderStyles = function euiModalHeaderStyles(euiThemeContext) {
10
+ var euiTheme = euiThemeContext.euiTheme;
11
+ return {
12
+ euiModalHeader: /*#__PURE__*/css("display:flex;justify-content:space-between;align-items:center;padding-inline:", euiTheme.size.l, " ", euiTheme.size.xxl, ";padding-block:", euiTheme.size.l, " ", euiTheme.size.base, ";flex-grow:0;flex-shrink:0;&+.euiModalFooter{padding-block-start:", euiTheme.size.s, ";};label:euiModalHeader;")
13
+ };
14
+ };
@@ -16,6 +16,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classnames from 'classnames';
19
+ import { EuiTitle } from '../title';
19
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
21
  export var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
21
22
  var className = _ref.className,
@@ -23,7 +24,8 @@ export var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
23
24
  rest = _objectWithoutProperties(_ref, _excluded);
24
25
 
25
26
  var classes = classnames('euiModalHeader__title', className);
26
- return ___EmotionJSX("div", _extends({
27
+ return ___EmotionJSX(EuiTitle, _extends({
28
+ size: "m",
27
29
  className: classes
28
30
  }, rest), /*#__PURE__*/React.isValidElement(children) ? children : ___EmotionJSX("h1", null, children));
29
31
  };
@@ -50,7 +50,7 @@ _EuiPageOuter.propTypes = {
50
50
  direction: PropTypes.oneOf(["row", "column"]),
51
51
 
52
52
  /**
53
- * When direction is `row`, it will flip to `column` when within these breakpoints
53
+ * When direction is `row`, it will flip to `column` when within these breakpoints.
54
54
  */
55
55
  responsive: PropTypes.arrayOf(PropTypes.any.isRequired),
56
56
  className: PropTypes.string,
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "mainProps", "className", "minHeight", "responsive"];
1
+ var _excluded = ["children", "responsive", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "component", "mainProps", "className", "minHeight"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
 
@@ -55,6 +55,8 @@ export var TemplateContext = /*#__PURE__*/createContext({
55
55
  */
56
56
  export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
57
57
  var children = _ref.children,
58
+ _ref$responsive = _ref.responsive,
59
+ responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
58
60
  _ref$restrictWidth = _ref.restrictWidth,
59
61
  restrictWidth = _ref$restrictWidth === void 0 ? true : _ref$restrictWidth,
60
62
  _ref$paddingSize = _ref.paddingSize,
@@ -65,12 +67,11 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
65
67
  _offset = _ref.offset,
66
68
  panelled = _ref.panelled,
67
69
  contentBorder = _ref.contentBorder,
70
+ component = _ref.component,
68
71
  mainProps = _ref.mainProps,
69
72
  className = _ref.className,
70
73
  _ref$minHeight = _ref.minHeight,
71
74
  minHeight = _ref$minHeight === void 0 ? '460px' : _ref$minHeight,
72
- _ref$responsive = _ref.responsive,
73
- responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
74
75
  rest = _objectWithoutProperties(_ref, _excluded);
75
76
 
76
77
  var _useEuiTheme = useEuiTheme(),
@@ -178,6 +179,7 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
178
179
  style: pageStyle,
179
180
  className: classes
180
181
  }), sidebar, ___EmotionJSX(EuiPageInner, _extends({}, mainProps, {
182
+ component: component,
181
183
  id: pageInnerId,
182
184
  border: innerBordered(),
183
185
  panelled: innerPanelled(),
@@ -198,7 +200,11 @@ _EuiPageTemplate.propTypes = {
198
200
  direction: PropTypes.oneOf(["row", "column"]),
199
201
 
200
202
  /**
201
- * When direction is `row`, it will flip to `column` when within these breakpoints
203
+ * Decides at which point the main content wrapper will be 100vw.
204
+ */
205
+
206
+ /**
207
+ * When direction is `row`, it will flip to `column` when within these breakpoints.
202
208
  */
203
209
  responsive: PropTypes.arrayOf(PropTypes.any.isRequired),
204
210
  className: PropTypes.string,
@@ -206,6 +212,16 @@ _EuiPageTemplate.propTypes = {
206
212
  "data-test-subj": PropTypes.string,
207
213
  css: PropTypes.any,
208
214
 
215
+ /**
216
+ * Adds a white background and shadow to define the area.
217
+ */
218
+ panelled: PropTypes.bool,
219
+
220
+ /**
221
+ * Adjust the overall padding.
222
+ */
223
+ paddingSize: PropTypes.any,
224
+
209
225
  /**
210
226
  * Sets the max-width of the page,
211
227
  * set to `true` to use the default size of `1200px`,
@@ -225,7 +241,7 @@ _EuiPageTemplate.propTypes = {
225
241
  * Applies a top or left border to the inner contents
226
242
  * to add separation between content and sidebar when a sidebar exists.
227
243
  */
228
- contentBorder: PropTypes.bool,
244
+ contentBorder: PropTypes.any,
229
245
 
230
246
  /**
231
247
  * Minimum height in which to enforce scrolling
@@ -247,7 +263,13 @@ _EuiPageTemplate.propTypes = {
247
263
  "aria-label": PropTypes.string,
248
264
  "data-test-subj": PropTypes.string,
249
265
  css: PropTypes.any
250
- })
266
+ }),
267
+
268
+ /**
269
+ * Sets which HTML element to render for the `main` content wrapper
270
+ * @default main
271
+ */
272
+ component: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.elementType.isRequired])
251
273
  };
252
274
 
253
275
  var _EuiPageSection = function _EuiPageSection(props) {
@@ -0,0 +1,83 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ 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."); }
4
+
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
+
7
+ 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; }
8
+
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ /*
14
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
15
+ * or more contributor license agreements. Licensed under the Elastic License
16
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
17
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
18
+ * Side Public License, v 1.
19
+ */
20
+ /// <reference types="../../../cypress/support"/>
21
+ import React, { useState } from 'react';
22
+ import { EuiPopover } from './popover';
23
+ import { EuiButtonEmpty } from '../button';
24
+ import { EuiText } from '../text';
25
+ import { jsx as ___EmotionJSX } from "@emotion/react";
26
+
27
+ var Popover = function Popover() {
28
+ var _useState = useState(false),
29
+ _useState2 = _slicedToArray(_useState, 2),
30
+ isPopoverOpen = _useState2[0],
31
+ setIsPopoverOpen = _useState2[1];
32
+
33
+ var onButtonClick = function onButtonClick() {
34
+ return setIsPopoverOpen(function (isPopoverOpen) {
35
+ return !isPopoverOpen;
36
+ });
37
+ };
38
+
39
+ var closePopover = function closePopover() {
40
+ return setIsPopoverOpen(false);
41
+ };
42
+
43
+ var button = ___EmotionJSX(EuiButtonEmpty, {
44
+ iconType: "documentation",
45
+ iconSide: "right",
46
+ onClick: onButtonClick
47
+ }, "How it works");
48
+
49
+ var popoverProps = {
50
+ button: button,
51
+ isOpen: isPopoverOpen,
52
+ closePopover: closePopover
53
+ };
54
+ return ___EmotionJSX(EuiPopover, popoverProps, ___EmotionJSX(EuiText, {
55
+ style: {
56
+ width: 300
57
+ }
58
+ }, ___EmotionJSX("p", null, "Popover content that\u2019s wider than the default width")));
59
+ };
60
+
61
+ beforeEach(function () {
62
+ cy.mount(___EmotionJSX(Popover, null));
63
+ cy.get('div.euiPopover__panel').should('not.exist');
64
+ });
65
+ describe('EuiPopover', function () {
66
+ describe('Automated accessibility check', function () {
67
+ it('has zero violations on render', function () {
68
+ cy.checkAxe();
69
+ });
70
+ it('has zero violations when popover is opened', function () {
71
+ cy.get('button.euiButtonEmpty').click();
72
+ cy.get('div.euiPopover__panel').should('exist');
73
+ cy.checkAxe();
74
+ });
75
+ it('has zero violations when popover is closed', function () {
76
+ cy.get('button.euiButtonEmpty').click();
77
+ cy.get('div.euiPopover__panel').should('exist');
78
+ cy.get('button.euiButtonEmpty').click();
79
+ cy.get('div.euiPopover__panel').should('not.exist');
80
+ cy.checkAxe();
81
+ });
82
+ });
83
+ });
@@ -3511,7 +3511,8 @@ var printValue = function printValue(value, options) {
3511
3511
  return value.toString();
3512
3512
  }
3513
3513
 
3514
- if (value.length === 0 || value.match(/\s/) || value.toLowerCase() === 'or') {
3514
+ if (value.length === 0 || value.match(/[^\w\-_*:()"/\\]/) || // Escape spaces and special characters not used as syntax identifiers
3515
+ value.toLowerCase() === 'or') {
3515
3516
  return "\"".concat(escapePhraseValue(value), "\"");
3516
3517
  }
3517
3518
 
@@ -0,0 +1,97 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
4
+
5
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+
7
+ /*
8
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
+ * or more contributor license agreements. Licensed under the Elastic License
10
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
11
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
12
+ * Side Public License, v 1.
13
+ */
14
+ /// <reference types="../../../cypress/support"/>
15
+ import React from 'react';
16
+ import { EuiTabbedContent } from './tabbed_content';
17
+ import { EuiSpacer } from '../spacer';
18
+ import { EuiText } from '../text';
19
+ import { jsx as ___EmotionJSX } from "@emotion/react";
20
+ var tabs = [{
21
+ id: 'cobalt--id',
22
+ name: 'Cobalt',
23
+ content: ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiSpacer, null), ___EmotionJSX(EuiText, null, ___EmotionJSX("p", null, "Cobalt is a chemical element with symbol Co and atomic number 27. Like nickel, cobalt is found in the Earth\u2019s crust only in chemically combined form, save for small deposits found in alloys of natural meteoric iron. The free element, produced by reductive smelting, is a hard, lustrous, silver-gray metal.")))
24
+ }, {
25
+ id: 'dextrose--id',
26
+ name: 'Dextrose',
27
+ content: ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiSpacer, null), ___EmotionJSX(EuiText, null, ___EmotionJSX("p", null, "Intravenous sugar solution, also known as dextrose solution, is a mixture of dextrose (glucose) and water. It is used to treat low blood sugar or water loss without electrolyte loss.")))
28
+ }, {
29
+ id: 'hydrogen--id',
30
+ name: 'Hydrogen',
31
+ content: ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiSpacer, null), ___EmotionJSX(EuiText, null, ___EmotionJSX("p", null, "Hydrogen is a chemical element with symbol H and atomic number 1. With a standard atomic weight of 1.008, hydrogen is the lightest element on the periodic table")))
32
+ }, {
33
+ id: 'monosodium_glutammate--id',
34
+ name: 'Monosodium Glutamate',
35
+ content: ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiSpacer, null), ___EmotionJSX(EuiText, null, ___EmotionJSX("p", null, "Monosodium glutamate (MSG, also known as sodium glutamate) is the sodium salt of glutamic acid, one of the most abundant naturally occurring non-essential amino acids. Monosodium glutamate is found naturally in tomatoes, cheese and other foods.")))
36
+ }];
37
+ var defaultTabProps = {
38
+ tabs: tabs,
39
+ initialSelectedTab: tabs[0],
40
+ autoFocus: 'selected',
41
+ onTabClick: function onTabClick() {}
42
+ };
43
+ describe('EuiTabs', function () {
44
+ describe('Automated accessibility check', function () {
45
+ it('has zero violations with default props', function () {
46
+ cy.mount(___EmotionJSX(EuiTabbedContent, defaultTabProps));
47
+ cy.get('div.euiTabs').should('exist');
48
+ cy.checkAxe();
49
+ });
50
+ it('has zero violations with second tab open on render', function () {
51
+ var secondSelectedTab = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
52
+ initialSelectedTab: tabs[1]
53
+ });
54
+
55
+ cy.mount(___EmotionJSX(EuiTabbedContent, secondSelectedTab));
56
+ cy.get('div.euiTabs').should('exist');
57
+ cy.checkAxe();
58
+ });
59
+ it('has zero violations with third tab open on render', function () {
60
+ var thirdSelectedTab = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
61
+ initialSelectedTab: tabs[2]
62
+ });
63
+
64
+ cy.mount(___EmotionJSX(EuiTabbedContent, thirdSelectedTab));
65
+ cy.get('div.euiTabs').should('exist');
66
+ cy.checkAxe();
67
+ });
68
+ it('has zero violations with last tab open on render', function () {
69
+ var lastSelectedTab = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
70
+ initialSelectedTab: tabs[3]
71
+ });
72
+
73
+ cy.mount(___EmotionJSX(EuiTabbedContent, lastSelectedTab));
74
+ cy.get('div.euiTabs').should('exist');
75
+ cy.checkAxe();
76
+ });
77
+ it('has zero violations with all tabs disabled except first', function () {
78
+ var disabledTabs = tabs.map(function (tab, i) {
79
+ if (i === 0) {
80
+ return tab;
81
+ }
82
+
83
+ return _objectSpread(_objectSpread({}, tab), {}, {
84
+ disabled: true
85
+ });
86
+ });
87
+
88
+ var disabledTabProps = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
89
+ tabs: disabledTabs
90
+ });
91
+
92
+ cy.mount(___EmotionJSX(EuiTabbedContent, disabledTabProps));
93
+ cy.get('div.euiTabs').should('exist');
94
+ cy.checkAxe();
95
+ });
96
+ });
97
+ });
@@ -0,0 +1,74 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ /// <reference types="../../../cypress/support"/>
9
+ import React from 'react';
10
+ import { EuiTreeView } from './tree_view';
11
+ import { jsx as ___EmotionJSX } from "@emotion/react";
12
+
13
+ var TreeView = function TreeView() {
14
+ var items = [{
15
+ label: 'Item One',
16
+ id: 'item_one',
17
+ isExpanded: true,
18
+ children: [{
19
+ label: 'Item A',
20
+ id: 'item_a'
21
+ }, {
22
+ label: 'Item B',
23
+ id: 'item_b',
24
+ children: [{
25
+ label: 'A Cloud',
26
+ id: 'item_cloud'
27
+ }, {
28
+ label: "I'm a Bug",
29
+ id: 'item_bug',
30
+ className: 'classForBug'
31
+ }]
32
+ }, {
33
+ label: 'Item C',
34
+ id: 'item_c',
35
+ children: [{
36
+ label: 'Another Cloud',
37
+ id: 'item_cloud2'
38
+ }, {
39
+ label: 'Another Bug',
40
+ id: 'item_bug2'
41
+ }]
42
+ }]
43
+ }, {
44
+ label: 'Item Two',
45
+ id: 'item_two'
46
+ }];
47
+ var defaultTreeViewProps = {
48
+ items: items,
49
+ 'aria-label': 'Sample folder tree'
50
+ };
51
+ return ___EmotionJSX("div", {
52
+ style: {
53
+ width: '20rem'
54
+ }
55
+ }, ___EmotionJSX(EuiTreeView, defaultTreeViewProps));
56
+ };
57
+
58
+ describe('EuiTreeView', function () {
59
+ describe('Automated accessibility check', function () {
60
+ it('has zero violations on first render', function () {
61
+ cy.mount(___EmotionJSX(TreeView, null));
62
+ cy.get('div.euiTreeView__wrapper').should('exist');
63
+ cy.checkAxe();
64
+ });
65
+ it('has zero violations with a nested child expanded', function () {
66
+ cy.mount(___EmotionJSX(TreeView, null));
67
+ cy.get('div.euiTreeView__wrapper').should('exist');
68
+ cy.get('button#item_b').realClick();
69
+ cy.get('button#item_b').should('have.attr', 'aria-expanded', 'true');
70
+ cy.get('li.euiTreeView__node').contains('A Cloud').should('exist');
71
+ cy.checkAxe();
72
+ });
73
+ });
74
+ });
@@ -1,4 +1,4 @@
1
- var _templateObject;
1
+ var _templateObject, _templateObject2;
2
2
 
3
3
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
4
4
 
@@ -10,4 +10,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
10
10
  * Side Public License, v 1.
11
11
  */
12
12
  import { keyframes } from '@emotion/react';
13
- export var euiAnimFadeIn = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n"])));
13
+ export var euiAnimFadeIn = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n"])));
14
+ export var euiAnimSlideInUp = function euiAnimSlideInUp(size) {
15
+ return keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateY(", ");\n }\n\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])), size);
16
+ };