@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
@@ -14,13 +14,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
14
14
  * in compliance with, at your election, the Elastic License 2.0 or the Server
15
15
  * Side Public License, v 1.
16
16
  */
17
- import React, { useRef, useCallback } from 'react';
17
+ import React from 'react';
18
18
  import classnames from 'classnames';
19
- import { keys } from '../../services';
19
+ import { keys, useEuiTheme } from '../../services';
20
20
  import { EuiButtonIcon } from '../button';
21
21
  import { EuiFocusTrap } from '../focus_trap';
22
22
  import { EuiOverlayMask } from '../overlay_mask';
23
23
  import { EuiI18n } from '../i18n';
24
+ import { euiModalStyles } from './modal.styles';
24
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
25
26
  export var EuiModal = function EuiModal(_ref) {
26
27
  var className = _ref.className,
@@ -32,19 +33,6 @@ export var EuiModal = function EuiModal(_ref) {
32
33
  style = _ref.style,
33
34
  rest = _objectWithoutProperties(_ref, _excluded);
34
35
 
35
- // TODO: Remove this onFocus scroll workaround after react-focus-on supports focusOptions
36
- // @see https://github.com/elastic/eui/issues/6304
37
- var bodyScrollTop = useRef(typeof window === 'undefined' ? undefined : window.scrollY // Account for SSR
38
- );
39
- var onFocus = useCallback(function () {
40
- if (bodyScrollTop.current != null) {
41
- window.scrollTo({
42
- top: bodyScrollTop.current
43
- });
44
- bodyScrollTop.current = undefined; // Unset after first auto focus
45
- }
46
- }, []);
47
-
48
36
  var onKeyDown = function onKeyDown(event) {
49
37
  if (event.key === keys.ESCAPE) {
50
38
  event.preventDefault();
@@ -53,28 +41,29 @@ export var EuiModal = function EuiModal(_ref) {
53
41
  }
54
42
  };
55
43
 
56
- var newStyle;
57
- var widthClassName;
44
+ var newStyle = style;
58
45
 
59
- if (maxWidth === true) {
60
- widthClassName = 'euiModal--maxWidth-default';
61
- } else if (maxWidth !== false) {
62
- var value = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
63
- newStyle = _objectSpread(_objectSpread({}, style), {}, {
64
- maxWidth: value
46
+ if (typeof maxWidth !== 'boolean') {
47
+ newStyle = _objectSpread(_objectSpread({}, newStyle), {}, {
48
+ maxInlineSize: maxWidth
65
49
  });
66
50
  }
67
51
 
68
- var classes = classnames('euiModal', widthClassName, className);
52
+ var classes = classnames('euiModal', className);
53
+ var euiTheme = useEuiTheme();
54
+ var styles = euiModalStyles(euiTheme);
55
+ var cssStyles = [styles.euiModal, maxWidth === true && styles.defaultMaxWidth];
56
+ var cssCloseIconStyles = [styles.euiModal__closeIcon];
69
57
  return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, {
70
58
  initialFocus: initialFocus,
71
- scrollLock: true
59
+ scrollLock: true,
60
+ preventScrollOnFocus: true
72
61
  }, ___EmotionJSX("div", _extends({
62
+ css: cssStyles,
73
63
  className: classes,
74
64
  onKeyDown: onKeyDown,
75
65
  tabIndex: 0,
76
- onFocus: onFocus,
77
- style: newStyle || style
66
+ style: newStyle
78
67
  }, rest), ___EmotionJSX(EuiI18n, {
79
68
  token: "euiModal.closeModal",
80
69
  default: "Closes this modal window"
@@ -82,6 +71,7 @@ export var EuiModal = function EuiModal(_ref) {
82
71
  return ___EmotionJSX(EuiButtonIcon, {
83
72
  iconType: "cross",
84
73
  onClick: onClose,
74
+ css: cssCloseIconStyles,
85
75
  className: "euiModal__closeIcon",
86
76
  color: "text",
87
77
  "aria-label": closeModal
@@ -0,0 +1,23 @@
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 { euiShadowXLarge } from '../../themes/amsterdam/global_styling/mixins';
10
+ import { euiCanAnimate, euiBreakpoint, euiAnimSlideInUp } from '../../global_styling';
11
+ import { euiFormVariables } from '../form/form.styles';
12
+ export var euiModalStyles = function euiModalStyles(euiThemeContext) {
13
+ var euiTheme = euiThemeContext.euiTheme;
14
+ return {
15
+ euiModal: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), " display:flex;flex-direction:column;max-block-size:75vh;position:relative;background-color:", euiTheme.colors.emptyShade, ";border-radius:", euiTheme.border.radius.medium, ";z-index:", euiTheme.levels.modal, ";min-inline-size:", euiFormVariables(euiThemeContext).maxWidth, ";max-inline-size:calc(100vw - ", euiTheme.size.base, ");", euiCanAnimate, "{animation:", euiAnimSlideInUp(euiTheme.size.xxl), " ", euiTheme.animation.slow, " ", euiTheme.animation.bounce, ";}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{position:fixed;inset:0;border-radius:0;inline-size:100vw!important;min-inline-size:0!important;max-inline-size:none!important;max-block-size:100vh!important;}&:focus{outline:none;};label:euiModal;"),
16
+ // Variants
17
+ defaultMaxWidth: /*#__PURE__*/css("max-inline-size:min(\n ", euiTheme.breakpoint.m, "px,\n calc(100vw - ", euiTheme.size.base, ")\n );;label:defaultMaxWidth;"),
18
+ confirmation: /*#__PURE__*/css("min-inline-size:", euiFormVariables(euiThemeContext).maxWidth, ";", euiBreakpoint(euiThemeContext, ['xs', 's']), "{", euiShadowXLarge(euiThemeContext, {
19
+ reverse: true
20
+ }), " inset-block-start:auto;};label:confirmation;"),
21
+ euiModal__closeIcon: /*#__PURE__*/css("position:absolute;inset-inline-end:", euiTheme.size.xs, ";inset-block-start:", euiTheme.size.xs, ";z-index:3;;label:euiModal__closeIcon;")
22
+ };
23
+ };
@@ -11,6 +11,8 @@ var _excluded = ["className", "children"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classnames from 'classnames';
14
+ import { useEuiTheme } from '../../services';
15
+ import { euiModalBodyStyles } from './modal_body.styles';
14
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
17
  export var EuiModalBody = function EuiModalBody(_ref) {
16
18
  var className = _ref.className,
@@ -18,9 +20,15 @@ export var EuiModalBody = function EuiModalBody(_ref) {
18
20
  rest = _objectWithoutProperties(_ref, _excluded);
19
21
 
20
22
  var classes = classnames('euiModalBody', className);
23
+ var euiTheme = useEuiTheme();
24
+ var styles = euiModalBodyStyles(euiTheme);
25
+ var cssStyles = [styles.euiModalBody];
26
+ var cssOverflowStyles = [styles.euiModalBody__overflow];
21
27
  return ___EmotionJSX("div", _extends({
28
+ css: cssStyles,
22
29
  className: classes
23
30
  }, rest), ___EmotionJSX("div", {
31
+ css: cssOverflowStyles,
24
32
  className: "euiModalBody__overflow"
25
33
  }, children));
26
34
  };
@@ -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
+ };
@@ -11,6 +11,8 @@ var _excluded = ["className", "children"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classnames from 'classnames';
14
+ import { useEuiTheme } from '../../services';
15
+ import { euiModalFooterStyles } from './modal_footer.styles';
14
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
17
  export var EuiModalFooter = function EuiModalFooter(_ref) {
16
18
  var className = _ref.className,
@@ -18,7 +20,11 @@ export var EuiModalFooter = function EuiModalFooter(_ref) {
18
20
  rest = _objectWithoutProperties(_ref, _excluded);
19
21
 
20
22
  var classes = classnames('euiModalFooter', className);
23
+ var euiTheme = useEuiTheme();
24
+ var styles = euiModalFooterStyles(euiTheme);
25
+ var cssStyles = [styles.euiModalFooter];
21
26
  return ___EmotionJSX("div", _extends({
27
+ css: cssStyles,
22
28
  className: classes
23
29
  }, rest), children);
24
30
  };
@@ -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
+ };
@@ -11,6 +11,8 @@ var _excluded = ["className", "children"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classnames from 'classnames';
14
+ import { useEuiTheme } from '../../services';
15
+ import { euiModalHeaderStyles } from './modal_header.styles';
14
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
17
  export var EuiModalHeader = function EuiModalHeader(_ref) {
16
18
  var className = _ref.className,
@@ -18,7 +20,11 @@ export var EuiModalHeader = function EuiModalHeader(_ref) {
18
20
  rest = _objectWithoutProperties(_ref, _excluded);
19
21
 
20
22
  var classes = classnames('euiModalHeader', className);
23
+ var euiTheme = useEuiTheme();
24
+ var styles = euiModalHeaderStyles(euiTheme);
25
+ var cssStyles = [styles.euiModalHeader];
21
26
  return ___EmotionJSX("div", _extends({
27
+ css: cssStyles,
22
28
  className: classes
23
29
  }, rest), children);
24
30
  };
@@ -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
+ };
@@ -11,6 +11,7 @@ var _excluded = ["className", "children"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classnames from 'classnames';
14
+ import { EuiTitle } from '../title';
14
15
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
16
  export var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
16
17
  var className = _ref.className,
@@ -18,7 +19,8 @@ export var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
18
19
  rest = _objectWithoutProperties(_ref, _excluded);
19
20
 
20
21
  var classes = classnames('euiModalHeader__title', className);
21
- return ___EmotionJSX("div", _extends({
22
+ return ___EmotionJSX(EuiTitle, _extends({
23
+ size: "m",
22
24
  className: classes
23
25
  }, rest), /*#__PURE__*/React.isValidElement(children) ? children : ___EmotionJSX("h1", null, children));
24
26
  };
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["children", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "mainProps", "className", "minHeight", "responsive"];
5
+ var _excluded = ["children", "responsive", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "component", "mainProps", "className", "minHeight"];
6
6
 
7
7
  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; }
8
8
 
@@ -38,6 +38,8 @@ export var TemplateContext = /*#__PURE__*/createContext({
38
38
  */
39
39
  export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
40
40
  var children = _ref.children,
41
+ _ref$responsive = _ref.responsive,
42
+ responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
41
43
  _ref$restrictWidth = _ref.restrictWidth,
42
44
  restrictWidth = _ref$restrictWidth === void 0 ? true : _ref$restrictWidth,
43
45
  _ref$paddingSize = _ref.paddingSize,
@@ -48,12 +50,11 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
48
50
  _offset = _ref.offset,
49
51
  panelled = _ref.panelled,
50
52
  contentBorder = _ref.contentBorder,
53
+ component = _ref.component,
51
54
  mainProps = _ref.mainProps,
52
55
  className = _ref.className,
53
56
  _ref$minHeight = _ref.minHeight,
54
57
  minHeight = _ref$minHeight === void 0 ? '460px' : _ref$minHeight,
55
- _ref$responsive = _ref.responsive,
56
- responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
57
58
  rest = _objectWithoutProperties(_ref, _excluded);
58
59
 
59
60
  var _useEuiTheme = useEuiTheme(),
@@ -161,6 +162,7 @@ export var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
161
162
  style: pageStyle,
162
163
  className: classes
163
164
  }), sidebar, ___EmotionJSX(EuiPageInner, _extends({}, mainProps, {
165
+ component: component,
164
166
  id: pageInnerId,
165
167
  border: innerBordered(),
166
168
  panelled: innerPanelled(),
@@ -0,0 +1,73 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ /// <reference types="../../../cypress/support"/>
11
+ import React, { useState } from 'react';
12
+ import { EuiPopover } from './popover';
13
+ import { EuiButtonEmpty } from '../button';
14
+ import { EuiText } from '../text';
15
+ import { jsx as ___EmotionJSX } from "@emotion/react";
16
+
17
+ var Popover = function Popover() {
18
+ var _useState = useState(false),
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ isPopoverOpen = _useState2[0],
21
+ setIsPopoverOpen = _useState2[1];
22
+
23
+ var onButtonClick = function onButtonClick() {
24
+ return setIsPopoverOpen(function (isPopoverOpen) {
25
+ return !isPopoverOpen;
26
+ });
27
+ };
28
+
29
+ var closePopover = function closePopover() {
30
+ return setIsPopoverOpen(false);
31
+ };
32
+
33
+ var button = ___EmotionJSX(EuiButtonEmpty, {
34
+ iconType: "documentation",
35
+ iconSide: "right",
36
+ onClick: onButtonClick
37
+ }, "How it works");
38
+
39
+ var popoverProps = {
40
+ button: button,
41
+ isOpen: isPopoverOpen,
42
+ closePopover: closePopover
43
+ };
44
+ return ___EmotionJSX(EuiPopover, popoverProps, ___EmotionJSX(EuiText, {
45
+ style: {
46
+ width: 300
47
+ }
48
+ }, ___EmotionJSX("p", null, "Popover content that\u2019s wider than the default width")));
49
+ };
50
+
51
+ beforeEach(function () {
52
+ cy.mount(___EmotionJSX(Popover, null));
53
+ cy.get('div.euiPopover__panel').should('not.exist');
54
+ });
55
+ describe('EuiPopover', function () {
56
+ describe('Automated accessibility check', function () {
57
+ it('has zero violations on render', function () {
58
+ cy.checkAxe();
59
+ });
60
+ it('has zero violations when popover is opened', function () {
61
+ cy.get('button.euiButtonEmpty').click();
62
+ cy.get('div.euiPopover__panel').should('exist');
63
+ cy.checkAxe();
64
+ });
65
+ it('has zero violations when popover is closed', function () {
66
+ cy.get('button.euiButtonEmpty').click();
67
+ cy.get('div.euiPopover__panel').should('exist');
68
+ cy.get('button.euiButtonEmpty').click();
69
+ cy.get('div.euiPopover__panel').should('not.exist');
70
+ cy.checkAxe();
71
+ });
72
+ });
73
+ });
@@ -3500,7 +3500,8 @@ var printValue = function printValue(value, options) {
3500
3500
  return value.toString();
3501
3501
  }
3502
3502
 
3503
- if (value.length === 0 || value.match(/\s/) || value.toLowerCase() === 'or') {
3503
+ if (value.length === 0 || value.match(/[^\w\-_*:()"/\\]/) || // Escape spaces and special characters not used as syntax identifiers
3504
+ value.toLowerCase() === 'or') {
3504
3505
  return "\"".concat(escapePhraseValue(value), "\"");
3505
3506
  }
3506
3507
 
@@ -0,0 +1,97 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+
3
+ 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; }
4
+
5
+ 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; }
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,6 +1,6 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
 
3
- var _templateObject;
3
+ var _templateObject, _templateObject2;
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -10,4 +10,7 @@ var _templateObject;
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
+ };
@@ -78,15 +78,16 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
78
78
 
79
79
  setHasValidId(false); // If no valid element via ID is available, use the fallback query selectors
80
80
 
81
- var fallbackEl = document.querySelector(fallbackDestination);
81
+ if (fallbackDestination) {
82
+ var fallbackEl = document.querySelector(fallbackDestination);
82
83
 
83
- if (fallbackEl) {
84
- setDestinationEl(fallbackEl);
84
+ if (fallbackEl) {
85
+ setDestinationEl(fallbackEl);
86
+ }
85
87
  }
86
88
  }, [destinationId, fallbackDestination]);
87
89
  var onClick = (0, _react.useCallback)(function (e) {
88
- if (overrideLinkBehavior || !hasValidId) {
89
- if (!destinationEl) return;
90
+ if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
90
91
  e.preventDefault(); // Scroll to the top of the destination content only if it's ~mostly out of view
91
92
 
92
93
  var destinationY = destinationEl.getBoundingClientRect().top;
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.SIZES = exports.EuiBetaBadge = exports.COLORS = void 0;
8
+ exports.SIZES = exports.EuiBetaBadge = exports.COLORS = exports.ALIGNMENTS = void 0;
9
9
 
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
@@ -27,11 +27,13 @@ var _beta_badge = require("./beta_badge.styles");
27
27
 
28
28
  var _react2 = require("@emotion/react");
29
29
 
30
- var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size"];
30
+ var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size", "alignment"];
31
31
  var COLORS = ['accent', 'subdued', 'hollow'];
32
32
  exports.COLORS = COLORS;
33
33
  var SIZES = ['s', 'm'];
34
34
  exports.SIZES = SIZES;
35
+ var ALIGNMENTS = ['baseline', 'middle'];
36
+ exports.ALIGNMENTS = ALIGNMENTS;
35
37
 
36
38
  var EuiBetaBadge = function EuiBetaBadge(_ref) {
37
39
  var className = _ref.className,
@@ -51,13 +53,15 @@ var EuiBetaBadge = function EuiBetaBadge(_ref) {
51
53
  target = _ref.target,
52
54
  _ref$size = _ref.size,
53
55
  size = _ref$size === void 0 ? 'm' : _ref$size,
56
+ _ref$alignment = _ref.alignment,
57
+ alignment = _ref$alignment === void 0 ? 'baseline' : _ref$alignment,
54
58
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
55
59
  var euiTheme = (0, _services.useEuiTheme)();
56
60
  var singleLetter = !!(typeof label === 'string' && label.length === 1);
57
61
  var isCircular = iconType || singleLetter;
58
62
  var classes = (0, _classnames.default)('euiBetaBadge', className);
59
63
  var styles = (0, _beta_badge.euiBetaBadgeStyles)(euiTheme);
60
- var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
64
+ var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], styles[alignment], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
61
65
  var icon;
62
66
 
63
67
  if (iconType) {