@elastic/eui 70.2.4 → 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.
- package/dist/eui_theme_dark.css +0 -198
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -198
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/skip_link/skip_link.js +6 -5
- package/es/components/badge/beta_badge/beta_badge.js +11 -3
- package/es/components/badge/beta_badge/beta_badge.styles.js +25 -4
- package/es/components/card/card.js +6 -1
- package/es/components/card/card.styles.js +4 -4
- package/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +109 -0
- package/es/components/flyout/flyout.a11y.js +92 -0
- package/es/components/image/image_fullscreen_wrapper.styles.js +3 -11
- package/es/components/modal/confirm_modal.js +11 -0
- package/es/components/modal/modal.a11y.js +70 -0
- package/es/components/modal/modal.js +17 -27
- package/es/components/modal/modal.styles.js +23 -0
- package/es/components/modal/modal_body.js +8 -0
- package/es/components/modal/modal_body.styles.js +16 -0
- package/es/components/modal/modal_footer.js +6 -0
- package/es/components/modal/modal_footer.styles.js +15 -0
- package/es/components/modal/modal_header.js +6 -0
- package/es/components/modal/modal_header.styles.js +14 -0
- package/es/components/modal/modal_header_title.js +3 -1
- package/es/components/page_template/outer/page_outer.js +1 -1
- package/es/components/page_template/page_template.js +28 -6
- package/es/components/popover/popover.a11y.js +83 -0
- package/es/components/search_bar/query/default_syntax.js +2 -1
- package/es/components/tabs/tabs.a11y.js +97 -0
- package/es/components/tree_view/tree_view.a11y.js +74 -0
- package/es/global_styling/utility/animations.js +5 -2
- package/eui.d.ts +58 -7
- package/i18ntokens.json +2 -2
- package/lib/components/accessibility/skip_link/skip_link.js +6 -5
- package/lib/components/badge/beta_badge/beta_badge.js +13 -4
- package/lib/components/badge/beta_badge/beta_badge.styles.js +25 -4
- package/lib/components/card/card.js +6 -1
- package/lib/components/card/card.styles.js +4 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
- package/lib/components/flyout/flyout.a11y.js +94 -0
- package/lib/components/image/image_fullscreen_wrapper.styles.js +9 -10
- package/lib/components/modal/confirm_modal.js +13 -0
- package/lib/components/modal/modal.a11y.js +73 -0
- package/lib/components/modal/modal.js +17 -32
- package/lib/components/modal/modal.styles.js +36 -0
- package/lib/components/modal/modal_body.js +10 -0
- package/lib/components/modal/modal_body.styles.js +27 -0
- package/lib/components/modal/modal_footer.js +8 -0
- package/lib/components/modal/modal_footer.styles.js +26 -0
- package/lib/components/modal/modal_header.js +8 -0
- package/lib/components/modal/modal_header.styles.js +24 -0
- package/lib/components/modal/modal_header_title.js +4 -1
- package/lib/components/page_template/outer/page_outer.js +1 -1
- package/lib/components/page_template/page_template.js +32 -10
- package/lib/components/popover/popover.a11y.js +86 -0
- package/lib/components/search_bar/query/default_syntax.js +2 -1
- package/lib/components/tabs/tabs.a11y.js +98 -0
- package/lib/components/tree_view/tree_view.a11y.js +80 -0
- package/lib/global_styling/utility/animations.js +9 -3
- package/optimize/es/components/accessibility/skip_link/skip_link.js +6 -5
- package/optimize/es/components/badge/beta_badge/beta_badge.js +5 -2
- package/optimize/es/components/badge/beta_badge/beta_badge.styles.js +25 -4
- package/optimize/es/components/card/card.styles.js +4 -4
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.a11y.js +98 -0
- package/optimize/es/components/flyout/flyout.a11y.js +77 -0
- package/optimize/es/components/image/image_fullscreen_wrapper.styles.js +3 -11
- package/optimize/es/components/modal/confirm_modal.js +6 -0
- package/optimize/es/components/modal/modal.a11y.js +60 -0
- package/optimize/es/components/modal/modal.js +17 -27
- package/optimize/es/components/modal/modal.styles.js +23 -0
- package/optimize/es/components/modal/modal_body.js +8 -0
- package/optimize/es/components/modal/modal_body.styles.js +16 -0
- package/optimize/es/components/modal/modal_footer.js +6 -0
- package/optimize/es/components/modal/modal_footer.styles.js +15 -0
- package/optimize/es/components/modal/modal_header.js +6 -0
- package/optimize/es/components/modal/modal_header.styles.js +14 -0
- package/optimize/es/components/modal/modal_header_title.js +3 -1
- package/optimize/es/components/page_template/page_template.js +5 -3
- package/optimize/es/components/popover/popover.a11y.js +73 -0
- package/optimize/es/components/search_bar/query/default_syntax.js +2 -1
- package/optimize/es/components/tabs/tabs.a11y.js +97 -0
- package/optimize/es/components/tree_view/tree_view.a11y.js +74 -0
- package/optimize/es/global_styling/utility/animations.js +5 -2
- package/optimize/lib/components/accessibility/skip_link/skip_link.js +6 -5
- package/optimize/lib/components/badge/beta_badge/beta_badge.js +7 -3
- package/optimize/lib/components/badge/beta_badge/beta_badge.styles.js +25 -4
- package/optimize/lib/components/card/card.styles.js +4 -4
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
- package/optimize/lib/components/flyout/flyout.a11y.js +84 -0
- package/optimize/lib/components/image/image_fullscreen_wrapper.styles.js +9 -12
- package/optimize/lib/components/modal/confirm_modal.js +8 -0
- package/optimize/lib/components/modal/modal.a11y.js +73 -0
- package/optimize/lib/components/modal/modal.js +17 -31
- package/optimize/lib/components/modal/modal.styles.js +36 -0
- package/optimize/lib/components/modal/modal_body.js +10 -0
- package/optimize/lib/components/modal/modal_body.styles.js +27 -0
- package/optimize/lib/components/modal/modal_footer.js +8 -0
- package/optimize/lib/components/modal/modal_footer.styles.js +26 -0
- package/optimize/lib/components/modal/modal_header.js +8 -0
- package/optimize/lib/components/modal/modal_header.styles.js +24 -0
- package/optimize/lib/components/modal/modal_header_title.js +4 -1
- package/optimize/lib/components/page_template/page_template.js +5 -3
- package/optimize/lib/components/popover/popover.a11y.js +86 -0
- package/optimize/lib/components/search_bar/query/default_syntax.js +2 -1
- package/optimize/lib/components/tabs/tabs.a11y.js +98 -0
- package/optimize/lib/components/tree_view/tree_view.a11y.js +80 -0
- package/optimize/lib/global_styling/utility/animations.js +9 -3
- package/package.json +5 -4
- package/src/components/index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/accessibility/skip_link/skip_link.js +6 -5
- package/test-env/components/badge/beta_badge/beta_badge.js +13 -4
- package/test-env/components/badge/beta_badge/beta_badge.styles.js +25 -4
- package/test-env/components/card/card.js +6 -1
- package/test-env/components/card/card.styles.js +4 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.a11y.js +111 -0
- package/test-env/components/flyout/flyout.a11y.js +84 -0
- package/test-env/components/image/image_fullscreen_wrapper.styles.js +9 -12
- package/test-env/components/modal/confirm_modal.js +13 -0
- package/test-env/components/modal/modal.a11y.js +73 -0
- package/test-env/components/modal/modal.js +17 -31
- package/test-env/components/modal/modal.styles.js +36 -0
- package/test-env/components/modal/modal_body.js +10 -0
- package/test-env/components/modal/modal_body.styles.js +27 -0
- package/test-env/components/modal/modal_footer.js +8 -0
- package/test-env/components/modal/modal_footer.styles.js +26 -0
- package/test-env/components/modal/modal_header.js +8 -0
- package/test-env/components/modal/modal_header.styles.js +24 -0
- package/test-env/components/modal/modal_header_title.js +4 -1
- package/test-env/components/page_template/outer/page_outer.js +1 -1
- package/test-env/components/page_template/page_template.js +32 -10
- package/test-env/components/popover/popover.a11y.js +86 -0
- package/test-env/components/search_bar/query/default_syntax.js +2 -1
- package/test-env/components/tabs/tabs.a11y.js +98 -0
- package/test-env/components/tree_view/tree_view.a11y.js +80 -0
- package/test-env/global_styling/utility/animations.js +9 -3
- package/src/components/modal/_index.scss +0 -1
- package/src/components/modal/_modal.scss +0 -156
- package/src/themes/amsterdam/overrides/_modal.scss +0 -3
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
6
|
+
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
|
|
9
|
+
var _tabbed_content = require("./tabbed_content");
|
|
10
|
+
|
|
11
|
+
var _spacer = require("../spacer");
|
|
12
|
+
|
|
13
|
+
var _text = require("../text");
|
|
14
|
+
|
|
15
|
+
var _react2 = require("@emotion/react");
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
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 _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _tree_view = require("./tree_view");
|
|
8
|
+
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
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
|
+
});
|
|
@@ -5,13 +5,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.euiAnimFadeIn = void 0;
|
|
8
|
+
exports.euiAnimSlideInUp = exports.euiAnimFadeIn = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
12
|
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
|
-
var _templateObject;
|
|
14
|
+
var _templateObject, _templateObject2;
|
|
15
15
|
|
|
16
16
|
var euiAnimFadeIn = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n"])));
|
|
17
|
-
exports.euiAnimFadeIn = euiAnimFadeIn;
|
|
17
|
+
exports.euiAnimFadeIn = euiAnimFadeIn;
|
|
18
|
+
|
|
19
|
+
var euiAnimSlideInUp = function euiAnimSlideInUp(size) {
|
|
20
|
+
return (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateY(", ");\n }\n\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])), size);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
exports.euiAnimSlideInUp = euiAnimSlideInUp;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/eui",
|
|
3
3
|
"description": "Elastic UI Component Library",
|
|
4
|
-
"version": "70.
|
|
4
|
+
"version": "70.3.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "lib",
|
|
7
7
|
"module": "es",
|
|
8
8
|
"types": "eui.d.ts",
|
|
9
|
-
"docker_image": "node:16.
|
|
9
|
+
"docker_image": "node:16.18.1",
|
|
10
10
|
"sideEffects": [
|
|
11
11
|
"*.css",
|
|
12
12
|
"*.scss"
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"start": "cross-env BABEL_MODULES=false webpack serve --config=src-docs/webpack.config.js",
|
|
16
16
|
"test-docker": "node ./scripts/test-docker.js",
|
|
17
|
+
"test-a11y-docker": "node ./scripts/test-a11y-docker.js",
|
|
17
18
|
"sync-docs": "node ./scripts/docs-sync.js",
|
|
18
19
|
"build-docs": "cross-env BABEL_MODULES=false cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 webpack --config=src-docs/webpack.config.js",
|
|
19
20
|
"build": "yarn extract-i18n-strings && node ./scripts/compile-clean.js && node ./scripts/compile-eui.js && yarn compile-scss",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"react-beautiful-dnd": "^13.1.0",
|
|
81
82
|
"react-dropzone": "^11.5.3",
|
|
82
83
|
"react-element-to-jsx-string": "^14.3.4",
|
|
83
|
-
"react-focus-on": "^3.
|
|
84
|
+
"react-focus-on": "^3.7.0",
|
|
84
85
|
"react-input-autosize": "^3.0.0",
|
|
85
86
|
"react-is": "^17.0.2",
|
|
86
87
|
"react-virtualized-auto-sizer": "^1.0.6",
|
|
@@ -173,7 +174,7 @@
|
|
|
173
174
|
"css-loader": "^6.7.1",
|
|
174
175
|
"cssnano": "^4.1.10",
|
|
175
176
|
"cypress": "^10.6.0",
|
|
176
|
-
"cypress-axe": "^0.
|
|
177
|
+
"cypress-axe": "^1.0.0",
|
|
177
178
|
"cypress-plugin-tab": "^1.0.5",
|
|
178
179
|
"cypress-real-events": "^1.7.0",
|
|
179
180
|
"dedent": "^0.7.0",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
@import 'header/index';
|
|
18
18
|
@import 'key_pad_menu/index';
|
|
19
19
|
@import 'markdown_editor/index';
|
|
20
|
-
@import 'modal/index';
|
|
21
20
|
@import 'notification/index';
|
|
22
21
|
@import 'panel/index';
|
|
23
22
|
@import 'page/index'; // Page needs to come after Panel for cascade specificity
|
|
@@ -80,15 +80,16 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
80
80
|
|
|
81
81
|
setHasValidId(false); // If no valid element via ID is available, use the fallback query selectors
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
if (fallbackDestination) {
|
|
84
|
+
var fallbackEl = document.querySelector(fallbackDestination);
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
if (fallbackEl) {
|
|
87
|
+
setDestinationEl(fallbackEl);
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
}, [destinationId, fallbackDestination]);
|
|
89
91
|
var onClick = (0, _react.useCallback)(function (e) {
|
|
90
|
-
if (overrideLinkBehavior || !hasValidId) {
|
|
91
|
-
if (!destinationEl) return;
|
|
92
|
+
if ((overrideLinkBehavior || !hasValidId) && destinationEl) {
|
|
92
93
|
e.preventDefault(); // Scroll to the top of the destination content only if it's ~mostly out of view
|
|
93
94
|
|
|
94
95
|
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
|
|
|
@@ -29,11 +29,13 @@ var _beta_badge = require("./beta_badge.styles");
|
|
|
29
29
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size"];
|
|
32
|
+
var _excluded = ["className", "label", "color", "tooltipContent", "tooltipPosition", "anchorProps", "title", "iconType", "onClick", "onClickAriaLabel", "href", "rel", "target", "size", "alignment"];
|
|
33
33
|
var COLORS = ['accent', 'subdued', 'hollow'];
|
|
34
34
|
exports.COLORS = COLORS;
|
|
35
35
|
var SIZES = ['s', 'm'];
|
|
36
36
|
exports.SIZES = SIZES;
|
|
37
|
+
var ALIGNMENTS = ['baseline', 'middle'];
|
|
38
|
+
exports.ALIGNMENTS = ALIGNMENTS;
|
|
37
39
|
|
|
38
40
|
var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
39
41
|
var className = _ref.className,
|
|
@@ -53,13 +55,15 @@ var EuiBetaBadge = function EuiBetaBadge(_ref) {
|
|
|
53
55
|
target = _ref.target,
|
|
54
56
|
_ref$size = _ref.size,
|
|
55
57
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
58
|
+
_ref$alignment = _ref.alignment,
|
|
59
|
+
alignment = _ref$alignment === void 0 ? 'baseline' : _ref$alignment,
|
|
56
60
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
57
61
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
58
62
|
var singleLetter = !!(typeof label === 'string' && label.length === 1);
|
|
59
63
|
var isCircular = iconType || singleLetter;
|
|
60
64
|
var classes = (0, _classnames.default)('euiBetaBadge', className);
|
|
61
65
|
var styles = (0, _beta_badge.euiBetaBadgeStyles)(euiTheme);
|
|
62
|
-
var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
|
|
66
|
+
var cssStyles = [styles.euiBetaBadge, styles[color], styles[size], styles[alignment], isCircular ? styles.badgeSizes.circle[size] : styles.badgeSizes.default[size]];
|
|
63
67
|
var icon;
|
|
64
68
|
|
|
65
69
|
if (iconType) {
|
|
@@ -204,5 +208,10 @@ EuiBetaBadge.propTypes = {
|
|
|
204
208
|
* Accepts accent, subdued and hollow.
|
|
205
209
|
*/
|
|
206
210
|
color: _propTypes.default.any,
|
|
207
|
-
size: _propTypes.default.any
|
|
211
|
+
size: _propTypes.default.any,
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Sets the `vertical-align` CSS property
|
|
215
|
+
*/
|
|
216
|
+
alignment: _propTypes.default.any
|
|
208
217
|
};
|
|
@@ -18,6 +18,24 @@ var _services = require("../../../services");
|
|
|
18
18
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
19
19
|
|
|
20
20
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
21
|
+
name: "l1nme7-middle",
|
|
22
|
+
styles: "vertical-align:middle;label:middle;"
|
|
23
|
+
} : {
|
|
24
|
+
name: "l1nme7-middle",
|
|
25
|
+
styles: "vertical-align:middle;label:middle;",
|
|
26
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
30
|
+
name: "19hexhy-baseline",
|
|
31
|
+
styles: "vertical-align:baseline;label:baseline;"
|
|
32
|
+
} : {
|
|
33
|
+
name: "19hexhy-baseline",
|
|
34
|
+
styles: "vertical-align:baseline;label:baseline;",
|
|
35
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
21
39
|
name: "pzpqqg-euiBetaBadge__icon",
|
|
22
40
|
styles: "position:relative;transform:translate(0, -1px);label:euiBetaBadge__icon;"
|
|
23
41
|
} : {
|
|
@@ -30,7 +48,7 @@ var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
|
|
|
30
48
|
var euiTheme = euiThemeContext.euiTheme,
|
|
31
49
|
colorMode = euiThemeContext.colorMode;
|
|
32
50
|
return {
|
|
33
|
-
euiBetaBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;
|
|
51
|
+
euiBetaBadge: /*#__PURE__*/(0, _react.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;", (0, _global_styling.euiTextTruncate)(), " &:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset', {
|
|
34
52
|
color: colorMode === 'DARK' ? euiTheme.colors.ghost : euiTheme.colors.ink
|
|
35
53
|
}), ";};label:euiBetaBadge;"),
|
|
36
54
|
// Colors
|
|
@@ -56,15 +74,18 @@ var euiBetaBadgeStyles = function euiBetaBadgeStyles(euiThemeContext) {
|
|
|
56
74
|
})), "\n ")
|
|
57
75
|
}
|
|
58
76
|
},
|
|
59
|
-
euiBetaBadge__icon:
|
|
77
|
+
euiBetaBadge__icon: _ref3,
|
|
78
|
+
// Alignments
|
|
79
|
+
baseline: _ref2,
|
|
80
|
+
middle: _ref
|
|
60
81
|
};
|
|
61
82
|
}; // Util for detecting text color based on badge bg color
|
|
62
83
|
|
|
63
84
|
|
|
64
85
|
exports.euiBetaBadgeStyles = euiBetaBadgeStyles;
|
|
65
86
|
|
|
66
|
-
var getBadgeColors = function getBadgeColors(backgroundColor,
|
|
67
|
-
var euiTheme =
|
|
87
|
+
var getBadgeColors = function getBadgeColors(backgroundColor, _ref4) {
|
|
88
|
+
var euiTheme = _ref4.euiTheme;
|
|
68
89
|
var textColor = _services.isColorDark.apply(void 0, (0, _toConsumableArray2.default)((0, _services.hexToRgb)(backgroundColor))) ? euiTheme.colors.ghost : euiTheme.colors.ink;
|
|
69
90
|
return "\n background-color: ".concat(backgroundColor, ";\n color: ").concat(textColor, ";\n ");
|
|
70
91
|
};
|
|
@@ -443,7 +443,12 @@ EuiCard.propTypes = {
|
|
|
443
443
|
* Accepts accent, subdued and hollow.
|
|
444
444
|
*/
|
|
445
445
|
color: _propTypes.default.any,
|
|
446
|
-
size: _propTypes.default.any
|
|
446
|
+
size: _propTypes.default.any,
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Sets the `vertical-align` CSS property
|
|
450
|
+
*/
|
|
451
|
+
alignment: _propTypes.default.any
|
|
447
452
|
}),
|
|
448
453
|
|
|
449
454
|
/**
|
|
@@ -58,11 +58,11 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
var _ref6 = process.env.NODE_ENV === "production" ? {
|
|
61
|
-
name: "
|
|
62
|
-
styles: "display:flex;label:euiCard__main;"
|
|
61
|
+
name: "31kq8f-euiCard__main",
|
|
62
|
+
styles: "display:flex;inline-size:100%;label:euiCard__main;"
|
|
63
63
|
} : {
|
|
64
|
-
name: "
|
|
65
|
-
styles: "display:flex;label:euiCard__main;",
|
|
64
|
+
name: "31kq8f-euiCard__main",
|
|
65
|
+
styles: "display:flex;inline-size:100%;label:euiCard__main;",
|
|
66
66
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
+
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
|
|
13
|
+
var _super_date_picker = require("./super_date_picker");
|
|
14
|
+
|
|
15
|
+
var _react2 = require("@emotion/react");
|
|
16
|
+
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
24
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
25
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
26
|
+
* Side Public License, v 1.
|
|
27
|
+
*/
|
|
28
|
+
/// <reference types="../../../../cypress/support"/>
|
|
29
|
+
var SuperDatePicker = function SuperDatePicker() {
|
|
30
|
+
var _useState = (0, _react.useState)(false),
|
|
31
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
32
|
+
isLoading = _useState2[0],
|
|
33
|
+
setIsLoading = _useState2[1];
|
|
34
|
+
|
|
35
|
+
var _useState3 = (0, _react.useState)(true),
|
|
36
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 1),
|
|
37
|
+
showUpdateButton = _useState4[0];
|
|
38
|
+
|
|
39
|
+
var _useState5 = (0, _react.useState)('now-30m'),
|
|
40
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
41
|
+
start = _useState6[0],
|
|
42
|
+
setStart = _useState6[1];
|
|
43
|
+
|
|
44
|
+
var _useState7 = (0, _react.useState)('now'),
|
|
45
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
46
|
+
end = _useState8[0],
|
|
47
|
+
setEnd = _useState8[1];
|
|
48
|
+
|
|
49
|
+
var _useState9 = (0, _react.useState)(true),
|
|
50
|
+
_useState10 = (0, _slicedToArray2.default)(_useState9, 1),
|
|
51
|
+
showFill = _useState10[0];
|
|
52
|
+
|
|
53
|
+
var onTimeChange = function onTimeChange(_ref) {
|
|
54
|
+
var start = _ref.start,
|
|
55
|
+
end = _ref.end;
|
|
56
|
+
setStart(start);
|
|
57
|
+
setEnd(end);
|
|
58
|
+
setIsLoading(true);
|
|
59
|
+
startLoading();
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var startLoading = function startLoading() {
|
|
63
|
+
setTimeout(stopLoading, 1000);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
var stopLoading = function stopLoading() {
|
|
67
|
+
setIsLoading(false);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var datepickerProps = {
|
|
71
|
+
isLoading: isLoading,
|
|
72
|
+
start: start,
|
|
73
|
+
end: end,
|
|
74
|
+
onTimeChange: onTimeChange,
|
|
75
|
+
showUpdateButton: showUpdateButton
|
|
76
|
+
};
|
|
77
|
+
return (0, _react2.jsx)(_super_date_picker.EuiSuperDatePicker, (0, _extends2.default)({}, datepickerProps, {
|
|
78
|
+
updateButtonProps: {
|
|
79
|
+
fill: showFill
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
beforeEach(function () {
|
|
85
|
+
cy.mount((0, _react2.jsx)(SuperDatePicker, null));
|
|
86
|
+
cy.get('div.euiSuperDatePicker__flexWrapper').should('exist');
|
|
87
|
+
});
|
|
88
|
+
describe('EuiSuperDatePicker', function () {
|
|
89
|
+
describe('Automated accessibility check', function () {
|
|
90
|
+
it('has zero violations on render', function () {
|
|
91
|
+
cy.checkAxe();
|
|
92
|
+
});
|
|
93
|
+
it('has zero violations when quick select menu is open', function () {
|
|
94
|
+
cy.get('button.euiFormControlLayout__prepend').click();
|
|
95
|
+
cy.get('div.euiPanel').contains('Quick select').should('exist');
|
|
96
|
+
cy.checkAxe();
|
|
97
|
+
});
|
|
98
|
+
it('has zero violations when start / end date menus are open', function () {
|
|
99
|
+
cy.get('button.euiSuperDatePicker__prettyFormat').click();
|
|
100
|
+
cy.get('div.euiDatePopoverContent').should('exist');
|
|
101
|
+
cy.checkAxe();
|
|
102
|
+
cy.get('button.euiDatePopoverButton--start').click();
|
|
103
|
+
cy.get('button.euiDatePopoverButton--end').click();
|
|
104
|
+
cy.get('div.euiDatePopoverContent').should('exist');
|
|
105
|
+
cy.checkAxe();
|
|
106
|
+
cy.get('button.euiDatePopoverButton--end').click();
|
|
107
|
+
cy.get('div.euiDatePopoverContent').should('not.exist');
|
|
108
|
+
cy.checkAxe();
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
|
+
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
|
|
11
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
|
+
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
|
|
15
|
+
var _flyout = require("./flyout");
|
|
16
|
+
|
|
17
|
+
var _button = require("../button");
|
|
18
|
+
|
|
19
|
+
var _react2 = require("@emotion/react");
|
|
20
|
+
|
|
21
|
+
var _excluded = ["children"];
|
|
22
|
+
|
|
23
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
|
+
|
|
25
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
+
|
|
27
|
+
var childrenDefault = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("button", {
|
|
28
|
+
"data-test-subj": "itemA"
|
|
29
|
+
}, "Item A"), (0, _react2.jsx)("button", {
|
|
30
|
+
"data-test-subj": "itemB"
|
|
31
|
+
}, "Item B"), (0, _react2.jsx)("button", {
|
|
32
|
+
"data-test-subj": "itemC"
|
|
33
|
+
}, "Item C"), (0, _react2.jsx)("input", {
|
|
34
|
+
"data-test-subj": "itemD"
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
var Flyout = function Flyout(_ref) {
|
|
38
|
+
var _ref$children = _ref.children,
|
|
39
|
+
children = _ref$children === void 0 ? childrenDefault : _ref$children,
|
|
40
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
41
|
+
|
|
42
|
+
var _useState = (0, _react.useState)(false),
|
|
43
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
44
|
+
isOpen = _useState2[0],
|
|
45
|
+
setIsOpen = _useState2[1];
|
|
46
|
+
|
|
47
|
+
var onButtonClick = function onButtonClick() {
|
|
48
|
+
return setIsOpen(!isOpen);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var button = (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
52
|
+
onClick: onButtonClick
|
|
53
|
+
}, "Toggle flyout");
|
|
54
|
+
return (0, _react2.jsx)("div", null, button, isOpen ? (0, _react2.jsx)(_flyout.EuiFlyout, (0, _extends2.default)({
|
|
55
|
+
"data-test-subj": "flyoutSpec",
|
|
56
|
+
onClose: function onClose() {
|
|
57
|
+
return setIsOpen(false);
|
|
58
|
+
}
|
|
59
|
+
}, rest), children) : null);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
beforeEach(function () {
|
|
63
|
+
cy.mount((0, _react2.jsx)(Flyout, null));
|
|
64
|
+
cy.get('div.euiFlyout').should('not.exist');
|
|
65
|
+
});
|
|
66
|
+
describe('EuiFlyout', function () {
|
|
67
|
+
describe('Automated accessibility check', function () {
|
|
68
|
+
it('has zero violations on render', function () {
|
|
69
|
+
cy.checkAxe();
|
|
70
|
+
});
|
|
71
|
+
it('has zero violations when flyout is opened', function () {
|
|
72
|
+
cy.get('button.euiButtonEmpty').click();
|
|
73
|
+
cy.get('div.euiFlyout').should('exist');
|
|
74
|
+
cy.checkAxe();
|
|
75
|
+
});
|
|
76
|
+
it('has zero violations when flyout is closed', function () {
|
|
77
|
+
cy.get('button.euiButtonEmpty').click();
|
|
78
|
+
cy.get('div.euiFlyout').should('exist');
|
|
79
|
+
cy.get('button.euiFlyout__closeButton').click();
|
|
80
|
+
cy.get('div.euiFlyout').should('not.exist');
|
|
81
|
+
cy.checkAxe();
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|