@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,98 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+
5
+ var _tabbed_content = require("./tabbed_content");
6
+
7
+ var _spacer = require("../spacer");
8
+
9
+ var _text = require("../text");
10
+
11
+ var _react2 = require("@emotion/react");
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ 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; }
16
+
17
+ 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; }
18
+
19
+ 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; }
20
+
21
+ var tabs = [{
22
+ id: 'cobalt--id',
23
+ name: 'Cobalt',
24
+ content: (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_spacer.EuiSpacer, null), (0, _react2.jsx)(_text.EuiText, null, (0, _react2.jsx)("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.")))
25
+ }, {
26
+ id: 'dextrose--id',
27
+ name: 'Dextrose',
28
+ content: (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_spacer.EuiSpacer, null), (0, _react2.jsx)(_text.EuiText, null, (0, _react2.jsx)("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.")))
29
+ }, {
30
+ id: 'hydrogen--id',
31
+ name: 'Hydrogen',
32
+ content: (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_spacer.EuiSpacer, null), (0, _react2.jsx)(_text.EuiText, null, (0, _react2.jsx)("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")))
33
+ }, {
34
+ id: 'monosodium_glutammate--id',
35
+ name: 'Monosodium Glutamate',
36
+ content: (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_spacer.EuiSpacer, null), (0, _react2.jsx)(_text.EuiText, null, (0, _react2.jsx)("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.")))
37
+ }];
38
+ var defaultTabProps = {
39
+ tabs: tabs,
40
+ initialSelectedTab: tabs[0],
41
+ autoFocus: 'selected',
42
+ onTabClick: function onTabClick() {}
43
+ };
44
+ describe('EuiTabs', function () {
45
+ describe('Automated accessibility check', function () {
46
+ it('has zero violations with default props', function () {
47
+ cy.mount((0, _react2.jsx)(_tabbed_content.EuiTabbedContent, defaultTabProps));
48
+ cy.get('div.euiTabs').should('exist');
49
+ cy.checkAxe();
50
+ });
51
+ it('has zero violations with second tab open on render', function () {
52
+ var secondSelectedTab = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
53
+ initialSelectedTab: tabs[1]
54
+ });
55
+
56
+ cy.mount((0, _react2.jsx)(_tabbed_content.EuiTabbedContent, secondSelectedTab));
57
+ cy.get('div.euiTabs').should('exist');
58
+ cy.checkAxe();
59
+ });
60
+ it('has zero violations with third tab open on render', function () {
61
+ var thirdSelectedTab = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
62
+ initialSelectedTab: tabs[2]
63
+ });
64
+
65
+ cy.mount((0, _react2.jsx)(_tabbed_content.EuiTabbedContent, thirdSelectedTab));
66
+ cy.get('div.euiTabs').should('exist');
67
+ cy.checkAxe();
68
+ });
69
+ it('has zero violations with last tab open on render', function () {
70
+ var lastSelectedTab = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
71
+ initialSelectedTab: tabs[3]
72
+ });
73
+
74
+ cy.mount((0, _react2.jsx)(_tabbed_content.EuiTabbedContent, lastSelectedTab));
75
+ cy.get('div.euiTabs').should('exist');
76
+ cy.checkAxe();
77
+ });
78
+ it('has zero violations with all tabs disabled except first', function () {
79
+ var disabledTabs = tabs.map(function (tab, i) {
80
+ if (i === 0) {
81
+ return tab;
82
+ }
83
+
84
+ return _objectSpread(_objectSpread({}, tab), {}, {
85
+ disabled: true
86
+ });
87
+ });
88
+
89
+ var disabledTabProps = _objectSpread(_objectSpread({}, defaultTabProps), {}, {
90
+ tabs: disabledTabs
91
+ });
92
+
93
+ cy.mount((0, _react2.jsx)(_tabbed_content.EuiTabbedContent, disabledTabProps));
94
+ cy.get('div.euiTabs').should('exist');
95
+ cy.checkAxe();
96
+ });
97
+ });
98
+ });
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+
3
+ var _react = _interopRequireDefault(require("react"));
4
+
5
+ var _tree_view = require("./tree_view");
6
+
7
+ var _react2 = require("@emotion/react");
8
+
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+
11
+ /*
12
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
13
+ * or more contributor license agreements. Licensed under the Elastic License
14
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
15
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
16
+ * Side Public License, v 1.
17
+ */
18
+ /// <reference types="../../../cypress/support"/>
19
+ var TreeView = function TreeView() {
20
+ var items = [{
21
+ label: 'Item One',
22
+ id: 'item_one',
23
+ isExpanded: true,
24
+ children: [{
25
+ label: 'Item A',
26
+ id: 'item_a'
27
+ }, {
28
+ label: 'Item B',
29
+ id: 'item_b',
30
+ children: [{
31
+ label: 'A Cloud',
32
+ id: 'item_cloud'
33
+ }, {
34
+ label: "I'm a Bug",
35
+ id: 'item_bug',
36
+ className: 'classForBug'
37
+ }]
38
+ }, {
39
+ label: 'Item C',
40
+ id: 'item_c',
41
+ children: [{
42
+ label: 'Another Cloud',
43
+ id: 'item_cloud2'
44
+ }, {
45
+ label: 'Another Bug',
46
+ id: 'item_bug2'
47
+ }]
48
+ }]
49
+ }, {
50
+ label: 'Item Two',
51
+ id: 'item_two'
52
+ }];
53
+ var defaultTreeViewProps = {
54
+ items: items,
55
+ 'aria-label': 'Sample folder tree'
56
+ };
57
+ return (0, _react2.jsx)("div", {
58
+ style: {
59
+ width: '20rem'
60
+ }
61
+ }, (0, _react2.jsx)(_tree_view.EuiTreeView, defaultTreeViewProps));
62
+ };
63
+
64
+ describe('EuiTreeView', function () {
65
+ describe('Automated accessibility check', function () {
66
+ it('has zero violations on first render', function () {
67
+ cy.mount((0, _react2.jsx)(TreeView, null));
68
+ cy.get('div.euiTreeView__wrapper').should('exist');
69
+ cy.checkAxe();
70
+ });
71
+ it('has zero violations with a nested child expanded', function () {
72
+ cy.mount((0, _react2.jsx)(TreeView, null));
73
+ cy.get('div.euiTreeView__wrapper').should('exist');
74
+ cy.get('button#item_b').realClick();
75
+ cy.get('button#item_b').should('have.attr', 'aria-expanded', 'true');
76
+ cy.get('li.euiTreeView__node').contains('A Cloud').should('exist');
77
+ cy.checkAxe();
78
+ });
79
+ });
80
+ });
@@ -3,13 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiAnimFadeIn = void 0;
6
+ exports.euiAnimSlideInUp = exports.euiAnimFadeIn = void 0;
7
7
 
8
8
  var _react = require("@emotion/react");
9
9
 
10
- var _templateObject;
10
+ var _templateObject, _templateObject2;
11
11
 
12
12
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
13
13
 
14
14
  var euiAnimFadeIn = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n"])));
15
- exports.euiAnimFadeIn = euiAnimFadeIn;
15
+ exports.euiAnimFadeIn = euiAnimFadeIn;
16
+
17
+ var euiAnimSlideInUp = function euiAnimSlideInUp(size) {
18
+ return (0, _react.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);
19
+ };
20
+
21
+ exports.euiAnimSlideInUp = euiAnimSlideInUp;
@@ -58,15 +58,16 @@ export var EuiSkipLink = function EuiSkipLink(_ref) {
58
58
 
59
59
  setHasValidId(false); // If no valid element via ID is available, use the fallback query selectors
60
60
 
61
- var fallbackEl = document.querySelector(fallbackDestination);
61
+ if (fallbackDestination) {
62
+ var fallbackEl = document.querySelector(fallbackDestination);
62
63
 
63
- if (fallbackEl) {
64
- setDestinationEl(fallbackEl);
64
+ if (fallbackEl) {
65
+ setDestinationEl(fallbackEl);
66
+ }
65
67
  }
66
68
  }, [destinationId, fallbackDestination]);
67
69
  var onClick = useCallback(function (e) {
68
- if (overrideLinkBehavior || !hasValidId) {
69
- if (!destinationEl) return;
70
+ if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
70
71
  e.preventDefault(); // Scroll to the top of the destination content only if it's ~mostly out of view
71
72
 
72
73
  var destinationY = destinationEl.getBoundingClientRect().top;
@@ -1,7 +1,7 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size"];
4
+ var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size", "alignment"];
5
5
 
6
6
  /*
7
7
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -19,6 +19,7 @@ import { euiBetaBadgeStyles } from './beta_badge.styles';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
20
  export var COLORS = ['accent', 'subdued', 'hollow'];
21
21
  export var SIZES = ['s', 'm'];
22
+ export var ALIGNMENTS = ['baseline', 'middle'];
22
23
  export var EuiBetaBadge = function EuiBetaBadge(_ref) {
23
24
  var className = _ref.className,
24
25
  label = _ref.label,
@@ -37,6 +38,8 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
37
38
  target = _ref.target,
38
39
  _ref$size = _ref.size,
39
40
  size = _ref$size === void 0 ? 'm' : _ref$size,
41
+ _ref$alignment = _ref.alignment,
42
+ alignment = _ref$alignment === void 0 ? 'baseline' : _ref$alignment,
40
43
  rest = _objectWithoutProperties(_ref, _excluded);
41
44
 
42
45
  var euiTheme = useEuiTheme();
@@ -44,7 +47,7 @@ export var EuiBetaBadge = function EuiBetaBadge(_ref) {
44
47
  var isCircular = iconType || singleLetter;
45
48
  var classes = classNames('euiBetaBadge', className);
46
49
  var styles = euiBetaBadgeStyles(euiTheme);
47
- var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
50
+ var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], styles[alignment], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
48
51
  var icon;
49
52
 
50
53
  if (iconType) {
@@ -14,6 +14,24 @@ import { logicalCSS, euiFocusRing, euiFontSizeFromScale, euiTextTruncate, mathWi
14
14
  import { tint, isColorDark, hexToRgb } from '../../../services';
15
15
 
16
16
  var _ref = process.env.NODE_ENV === "production" ? {
17
+ name: "l1nme7-middle",
18
+ styles: "vertical-align:middle;label:middle;"
19
+ } : {
20
+ name: "l1nme7-middle",
21
+ styles: "vertical-align:middle;label:middle;",
22
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
23
+ };
24
+
25
+ var _ref2 = process.env.NODE_ENV === "production" ? {
26
+ name: "19hexhy-baseline",
27
+ styles: "vertical-align:baseline;label:baseline;"
28
+ } : {
29
+ name: "19hexhy-baseline",
30
+ styles: "vertical-align:baseline;label:baseline;",
31
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
32
+ };
33
+
34
+ var _ref3 = process.env.NODE_ENV === "production" ? {
17
35
  name: "pzpqqg-euiBetaBadge__icon",
18
36
  styles: "position:relative;transform:translate(0, -1px);label:euiBetaBadge__icon;"
19
37
  } : {
@@ -26,7 +44,7 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
26
44
  var euiTheme = euiThemeContext.euiTheme,
27
45
  colorMode = euiThemeContext.colorMode;
28
46
  return {
29
- euiBetaBadge: /*#__PURE__*/css("display:inline-block;vertical-align:super;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.bold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", euiTextTruncate(), " &:focus{", euiFocusRing(euiThemeContext, 'outset', {
47
+ euiBetaBadge: /*#__PURE__*/css("display:inline-block;border-radius:", euiTheme.size.l, ";cursor:default;font-weight:", euiTheme.font.weight.bold, ";text-transform:uppercase;letter-spacing:0.05em;text-align:center;", euiTextTruncate(), " &:focus{", euiFocusRing(euiThemeContext, 'outset', {
30
48
  color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
31
49
  }), ";};label:euiBetaBadge;"),
32
50
  // Colors
@@ -52,12 +70,15 @@ export var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
52
70
  })), "\n ")
53
71
  }
54
72
  },
55
- euiBetaBadge__icon: _ref
73
+ euiBetaBadge__icon: _ref3,
74
+ // Alignments
75
+ baseline: _ref2,
76
+ middle: _ref
56
77
  };
57
78
  }; // Util for detecting text color based on badge bg color
58
79
 
59
- export var getBadgeColors = function getBadgeColors(backgroundColor, _ref2) {
60
- var euiTheme = _ref2.euiTheme;
80
+ export var getBadgeColors = function getBadgeColors(backgroundColor, _ref4) {
81
+ var euiTheme = _ref4.euiTheme;
61
82
  var textColor = isColorDark.apply(void 0, _toConsumableArray(hexToRgb(backgroundColor))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
62
83
  return "\n background-color: ".concat(backgroundColor, ";\n color: ").concat(textColor, ";\n ");
63
84
  };
@@ -55,11 +55,11 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
55
55
  };
56
56
 
57
57
  var _ref6 = process.env.NODE_ENV === "production" ? {
58
- name: "z24364-euiCard__main",
59
- styles: "display:flex;label:euiCard__main;"
58
+ name: "31kq8f-euiCard__main",
59
+ styles: "display:flex;inline-size:100%;label:euiCard__main;"
60
60
  } : {
61
- name: "z24364-euiCard__main",
62
- styles: "display:flex;label:euiCard__main;",
61
+ name: "31kq8f-euiCard__main",
62
+ styles: "display:flex;inline-size:100%;label:euiCard__main;",
63
63
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
64
64
  };
65
65
 
@@ -0,0 +1,98 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+
4
+ /*
5
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
+ * or more contributor license agreements. Licensed under the Elastic License
7
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
8
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
9
+ * Side Public License, v 1.
10
+ */
11
+ /// <reference types="../../../../cypress/support"/>
12
+ import React, { useState } from 'react';
13
+ import { EuiSuperDatePicker } from './super_date_picker';
14
+ import { jsx as ___EmotionJSX } from "@emotion/react";
15
+
16
+ var SuperDatePicker = function SuperDatePicker() {
17
+ var _useState = useState(false),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ isLoading = _useState2[0],
20
+ setIsLoading = _useState2[1];
21
+
22
+ var _useState3 = useState(true),
23
+ _useState4 = _slicedToArray(_useState3, 1),
24
+ showUpdateButton = _useState4[0];
25
+
26
+ var _useState5 = useState('now-30m'),
27
+ _useState6 = _slicedToArray(_useState5, 2),
28
+ start = _useState6[0],
29
+ setStart = _useState6[1];
30
+
31
+ var _useState7 = useState('now'),
32
+ _useState8 = _slicedToArray(_useState7, 2),
33
+ end = _useState8[0],
34
+ setEnd = _useState8[1];
35
+
36
+ var _useState9 = useState(true),
37
+ _useState10 = _slicedToArray(_useState9, 1),
38
+ showFill = _useState10[0];
39
+
40
+ var onTimeChange = function onTimeChange(_ref) {
41
+ var start = _ref.start,
42
+ end = _ref.end;
43
+ setStart(start);
44
+ setEnd(end);
45
+ setIsLoading(true);
46
+ startLoading();
47
+ };
48
+
49
+ var startLoading = function startLoading() {
50
+ setTimeout(stopLoading, 1000);
51
+ };
52
+
53
+ var stopLoading = function stopLoading() {
54
+ setIsLoading(false);
55
+ };
56
+
57
+ var datepickerProps = {
58
+ isLoading: isLoading,
59
+ start: start,
60
+ end: end,
61
+ onTimeChange: onTimeChange,
62
+ showUpdateButton: showUpdateButton
63
+ };
64
+ return ___EmotionJSX(EuiSuperDatePicker, _extends({}, datepickerProps, {
65
+ updateButtonProps: {
66
+ fill: showFill
67
+ }
68
+ }));
69
+ };
70
+
71
+ beforeEach(function () {
72
+ cy.mount(___EmotionJSX(SuperDatePicker, null));
73
+ cy.get('div.euiSuperDatePicker__flexWrapper').should('exist');
74
+ });
75
+ describe('EuiSuperDatePicker', function () {
76
+ describe('Automated accessibility check', function () {
77
+ it('has zero violations on render', function () {
78
+ cy.checkAxe();
79
+ });
80
+ it('has zero violations when quick select menu is open', function () {
81
+ cy.get('button.euiFormControlLayout__prepend').click();
82
+ cy.get('div.euiPanel').contains('Quick select').should('exist');
83
+ cy.checkAxe();
84
+ });
85
+ it('has zero violations when start / end date menus are open', function () {
86
+ cy.get('button.euiSuperDatePicker__prettyFormat').click();
87
+ cy.get('div.euiDatePopoverContent').should('exist');
88
+ cy.checkAxe();
89
+ cy.get('button.euiDatePopoverButton--start').click();
90
+ cy.get('button.euiDatePopoverButton--end').click();
91
+ cy.get('div.euiDatePopoverContent').should('exist');
92
+ cy.checkAxe();
93
+ cy.get('button.euiDatePopoverButton--end').click();
94
+ cy.get('div.euiDatePopoverContent').should('not.exist');
95
+ cy.checkAxe();
96
+ });
97
+ });
98
+ });
@@ -167,7 +167,7 @@ export var euiFlexGroupStyles = function euiFlexGroupStyles(euiThemeContext) {
167
167
  var euiTheme = euiThemeContext.euiTheme;
168
168
  return {
169
169
  euiFlexGroup: _ref17,
170
- responsive: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;.euiFlexItem{", logicalCSS('width', '100%'), " flex-basis:100%;}};label:responsive;"),
170
+ responsive: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;&>.euiFlexItem{", logicalCSS('width', '100%'), " flex-basis:100%;}};label:responsive;"),
171
171
  wrap: _ref16,
172
172
  gutterSizes: {
173
173
  none: /*#__PURE__*/css(";label:none;"),
@@ -0,0 +1,77 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["children"];
5
+
6
+ /*
7
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
8
+ * or more contributor license agreements. Licensed under the Elastic License
9
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
10
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
11
+ * Side Public License, v 1.
12
+ */
13
+ /// <reference types="../../../cypress/support"/>
14
+ import React, { useState } from 'react';
15
+ import { EuiFlyout } from './flyout';
16
+ import { EuiButtonEmpty } from '../button';
17
+ import { jsx as ___EmotionJSX } from "@emotion/react";
18
+
19
+ var childrenDefault = ___EmotionJSX(React.Fragment, null, ___EmotionJSX("button", {
20
+ "data-test-subj": "itemA"
21
+ }, "Item A"), ___EmotionJSX("button", {
22
+ "data-test-subj": "itemB"
23
+ }, "Item B"), ___EmotionJSX("button", {
24
+ "data-test-subj": "itemC"
25
+ }, "Item C"), ___EmotionJSX("input", {
26
+ "data-test-subj": "itemD"
27
+ }));
28
+
29
+ var Flyout = function Flyout(_ref) {
30
+ var _ref$children = _ref.children,
31
+ children = _ref$children === void 0 ? childrenDefault : _ref$children,
32
+ rest = _objectWithoutProperties(_ref, _excluded);
33
+
34
+ var _useState = useState(false),
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ isOpen = _useState2[0],
37
+ setIsOpen = _useState2[1];
38
+
39
+ var onButtonClick = function onButtonClick() {
40
+ return setIsOpen(!isOpen);
41
+ };
42
+
43
+ var button = ___EmotionJSX(EuiButtonEmpty, {
44
+ onClick: onButtonClick
45
+ }, "Toggle flyout");
46
+
47
+ return ___EmotionJSX("div", null, button, isOpen ? ___EmotionJSX(EuiFlyout, _extends({
48
+ "data-test-subj": "flyoutSpec",
49
+ onClose: function onClose() {
50
+ return setIsOpen(false);
51
+ }
52
+ }, rest), children) : null);
53
+ };
54
+
55
+ beforeEach(function () {
56
+ cy.mount(___EmotionJSX(Flyout, null));
57
+ cy.get('div.euiFlyout').should('not.exist');
58
+ });
59
+ describe('EuiFlyout', function () {
60
+ describe('Automated accessibility check', function () {
61
+ it('has zero violations on render', function () {
62
+ cy.checkAxe();
63
+ });
64
+ it('has zero violations when flyout is opened', function () {
65
+ cy.get('button.euiButtonEmpty').click();
66
+ cy.get('div.euiFlyout').should('exist');
67
+ cy.checkAxe();
68
+ });
69
+ it('has zero violations when flyout is closed', function () {
70
+ cy.get('button.euiButtonEmpty').click();
71
+ cy.get('div.euiFlyout').should('exist');
72
+ cy.get('button.euiFlyout__closeButton').click();
73
+ cy.get('div.euiFlyout').should('not.exist');
74
+ cy.checkAxe();
75
+ });
76
+ });
77
+ });
@@ -1,7 +1,3 @@
1
- import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
-
3
- var _templateObject;
4
-
5
1
  /*
6
2
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
3
  * or more contributor license agreements. Licensed under the Elastic License
@@ -9,18 +5,14 @@ var _templateObject;
9
5
  * in compliance with, at your election, the Elastic License 2.0 or the Server
10
6
  * Side Public License, v 1.
11
7
  */
12
- import { css, keyframes } from '@emotion/react';
13
- import { logicalCSS, logicalTextAlignCSS, euiCanAnimate } from '../../global_styling';
8
+ import { css } from '@emotion/react';
9
+ import { logicalCSS, logicalTextAlignCSS, euiCanAnimate, euiAnimSlideInUp } from '../../global_styling';
14
10
  export var euiImageFullscreenWrapperStyles = function euiImageFullscreenWrapperStyles(euiThemeContext) {
15
11
  var euiTheme = euiThemeContext.euiTheme;
16
12
  return {
17
13
  // Base
18
- euiImageFullscreenWrapper: /*#__PURE__*/css(logicalCSS('max-height', '80vh'), ";", logicalCSS('max-width', '80vw'), ";", logicalTextAlignCSS('center'), ";line-height:0;", euiCanAnimate, "{animation:", euiImageFullScreen(euiTheme.size.xxxxl), " ", euiTheme.animation.extraSlow, " ", euiTheme.animation.bounce, ";}&:hover [class*='euiImageCaption']{text-decoration:underline;};label:euiImageFullscreenWrapper;"),
14
+ euiImageFullscreenWrapper: /*#__PURE__*/css(logicalCSS('max-height', '80vh'), ";", logicalCSS('max-width', '80vw'), ";", logicalTextAlignCSS('center'), ";line-height:0;", euiCanAnimate, "{animation:", euiAnimSlideInUp(euiTheme.size.xxxxl), " ", euiTheme.animation.extraSlow, " ", euiTheme.animation.bounce, ";}&:hover [class*='euiImageCaption']{text-decoration:underline;};label:euiImageFullscreenWrapper;"),
19
15
  // Sizes
20
16
  fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:fullWidth;")
21
17
  };
22
- };
23
-
24
- var euiImageFullScreen = function euiImageFullScreen(size) {
25
- return keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateY(", ");\n }\n\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])), size);
26
18
  };
@@ -17,6 +17,8 @@ import { EuiModalFooter } from './modal_footer';
17
17
  import { EuiModalHeader } from './modal_header';
18
18
  import { EuiModalHeaderTitle } from './modal_header_title';
19
19
  import { EuiModalBody } from './modal_body';
20
+ import { useEuiTheme } from '../../services';
21
+ import { euiModalStyles } from './modal.styles';
20
22
  import { EuiButton, EuiButtonEmpty } from '../button';
21
23
  import { EuiText } from '../text';
22
24
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -70,6 +72,9 @@ export var EuiConfirmModal = function EuiConfirmModal(_ref) {
70
72
  };
71
73
 
72
74
  var classes = classnames('euiModal--confirmation', className);
75
+ var euiTheme = useEuiTheme();
76
+ var styles = euiModalStyles(euiTheme);
77
+ var cssStyles = [styles.confirmation];
73
78
  var modalTitle;
74
79
 
75
80
  if (title) {
@@ -88,6 +93,7 @@ export var EuiConfirmModal = function EuiConfirmModal(_ref) {
88
93
 
89
94
  return ___EmotionJSX(EuiModal, _extends({
90
95
  className: classes,
96
+ css: cssStyles,
91
97
  onClose: onCancel
92
98
  }, rest), modalTitle, message && ___EmotionJSX(EuiModalBody, null, ___EmotionJSX(EuiText, {
93
99
  "data-test-subj": "confirmModalBodyText"
@@ -0,0 +1,60 @@
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 { EuiModal, EuiModalHeader, EuiModalHeaderTitle, EuiModalBody, EuiModalFooter } from './index';
13
+ import { EuiButton } from '../button';
14
+ import { jsx as ___EmotionJSX } from "@emotion/react";
15
+
16
+ var Modal = function Modal() {
17
+ var _useState = useState(false),
18
+ _useState2 = _slicedToArray(_useState, 2),
19
+ isModalVisible = _useState2[0],
20
+ setIsModalVisible = _useState2[1];
21
+
22
+ var closeModal = function closeModal() {
23
+ return setIsModalVisible(false);
24
+ };
25
+
26
+ var showModal = function showModal() {
27
+ return setIsModalVisible(true);
28
+ };
29
+
30
+ var modalProps = {
31
+ title: 'Do this thing',
32
+ onClose: closeModal,
33
+ children: React
34
+ };
35
+ return ___EmotionJSX("div", null, ___EmotionJSX(EuiButton, {
36
+ onClick: showModal
37
+ }, "Show confirm modal"), isModalVisible && ___EmotionJSX(EuiModal, modalProps, ___EmotionJSX(EuiModalHeader, null, ___EmotionJSX(EuiModalHeaderTitle, null, ___EmotionJSX("h1", null, "Title of modal"))), ___EmotionJSX(EuiModalBody, null, ___EmotionJSX("p", null, "This is a simple modal body")), ___EmotionJSX(EuiModalFooter, null, ___EmotionJSX(EuiButton, {
38
+ onClick: closeModal,
39
+ fill: true
40
+ }, "Close"))));
41
+ };
42
+
43
+ beforeEach(function () {
44
+ cy.mount(___EmotionJSX(Modal, null));
45
+ cy.get('div.euiModal').should('not.exist');
46
+ cy.get('button.euiButton').click();
47
+ cy.get('div.euiModal').should('exist');
48
+ });
49
+ describe('EuiModal', function () {
50
+ describe('Automated accessibility check', function () {
51
+ it('has zero violations when modal is open', function () {
52
+ cy.checkAxe();
53
+ });
54
+ it('has zero violations when modal is closed', function () {
55
+ cy.get('div.euiModalFooter button.euiButton').click();
56
+ cy.get('div.euiModal').should('not.exist');
57
+ cy.checkAxe();
58
+ });
59
+ });
60
+ });