@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,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiModalStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _mixins = require("../../themes/amsterdam/global_styling/mixins");
|
|
11
|
+
|
|
12
|
+
var _global_styling = require("../../global_styling");
|
|
13
|
+
|
|
14
|
+
var _form = require("../form/form.styles");
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
+
* Side Public License, v 1.
|
|
22
|
+
*/
|
|
23
|
+
var euiModalStyles = function euiModalStyles(euiThemeContext) {
|
|
24
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
25
|
+
return {
|
|
26
|
+
euiModal: /*#__PURE__*/(0, _react.css)((0, _mixins.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:", (0, _form.euiFormVariables)(euiThemeContext).maxWidth, ";max-inline-size:calc(100vw - ", euiTheme.size.base, ");", _global_styling.euiCanAnimate, "{animation:", (0, _global_styling.euiAnimSlideInUp)(euiTheme.size.xxl), " ", euiTheme.animation.slow, " ", euiTheme.animation.bounce, ";}", (0, _global_styling.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;"),
|
|
27
|
+
// Variants
|
|
28
|
+
defaultMaxWidth: /*#__PURE__*/(0, _react.css)("max-inline-size:min(\n ", euiTheme.breakpoint.m, "px,\n calc(100vw - ", euiTheme.size.base, ")\n );;label:defaultMaxWidth;"),
|
|
29
|
+
confirmation: /*#__PURE__*/(0, _react.css)("min-inline-size:", (0, _form.euiFormVariables)(euiThemeContext).maxWidth, ";", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{", (0, _mixins.euiShadowXLarge)(euiThemeContext, {
|
|
30
|
+
reverse: true
|
|
31
|
+
}), " inset-block-start:auto;};label:confirmation;"),
|
|
32
|
+
euiModal__closeIcon: /*#__PURE__*/(0, _react.css)("position:absolute;inset-inline-end:", euiTheme.size.xs, ";inset-block-start:", euiTheme.size.xs, ";z-index:3;;label:euiModal__closeIcon;")
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.euiModalStyles = euiModalStyles;
|
|
@@ -11,6 +11,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _services = require("../../services");
|
|
15
|
+
|
|
16
|
+
var _modal_body = require("./modal_body.styles");
|
|
17
|
+
|
|
14
18
|
var _react2 = require("@emotion/react");
|
|
15
19
|
|
|
16
20
|
var _excluded = ["className", "children"];
|
|
@@ -29,9 +33,15 @@ var EuiModalBody = function EuiModalBody(_ref) {
|
|
|
29
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
34
|
|
|
31
35
|
var classes = (0, _classnames.default)('euiModalBody', className);
|
|
36
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
37
|
+
var styles = (0, _modal_body.euiModalBodyStyles)(euiTheme);
|
|
38
|
+
var cssStyles = [styles.euiModalBody];
|
|
39
|
+
var cssOverflowStyles = [styles.euiModalBody__overflow];
|
|
32
40
|
return (0, _react2.jsx)("div", _extends({
|
|
41
|
+
css: cssStyles,
|
|
33
42
|
className: classes
|
|
34
43
|
}, rest), (0, _react2.jsx)("div", {
|
|
44
|
+
css: cssOverflowStyles,
|
|
35
45
|
className: "euiModalBody__overflow"
|
|
36
46
|
}, children));
|
|
37
47
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiModalBodyStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiModalBodyStyles = function euiModalBodyStyles(euiThemeContext) {
|
|
20
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
21
|
+
return {
|
|
22
|
+
euiModalBody: /*#__PURE__*/(0, _react.css)("flex-grow:1;overflow:hidden;display:flex;flex-direction:column;&:last-of-type .euiModalBody__overflow{padding-block-end:", euiTheme.size.l, ";};label:euiModalBody;"),
|
|
23
|
+
euiModalBody__overflow: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiYScrollWithShadows)(euiThemeContext), ";padding-inline:", euiTheme.size.l, ";padding-block:", euiTheme.size.s, ";", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{padding-block-end:", euiTheme.size.l, ";};label:euiModalBody__overflow;")
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.euiModalBodyStyles = euiModalBodyStyles;
|
|
@@ -11,6 +11,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _services = require("../../services");
|
|
15
|
+
|
|
16
|
+
var _modal_footer = require("./modal_footer.styles");
|
|
17
|
+
|
|
14
18
|
var _react2 = require("@emotion/react");
|
|
15
19
|
|
|
16
20
|
var _excluded = ["className", "children"];
|
|
@@ -29,7 +33,11 @@ var EuiModalFooter = function EuiModalFooter(_ref) {
|
|
|
29
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
34
|
|
|
31
35
|
var classes = (0, _classnames.default)('euiModalFooter', className);
|
|
36
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
37
|
+
var styles = (0, _modal_footer.euiModalFooterStyles)(euiTheme);
|
|
38
|
+
var cssStyles = [styles.euiModalFooter];
|
|
32
39
|
return (0, _react2.jsx)("div", _extends({
|
|
40
|
+
css: cssStyles,
|
|
33
41
|
className: classes
|
|
34
42
|
}, rest), children);
|
|
35
43
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiModalFooterStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiModalFooterStyles = function euiModalFooterStyles(euiThemeContext) {
|
|
20
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
21
|
+
return {
|
|
22
|
+
euiModalFooter: /*#__PURE__*/(0, _react.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, ";", (0, _global_styling.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;")
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.euiModalFooterStyles = euiModalFooterStyles;
|
|
@@ -11,6 +11,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _services = require("../../services");
|
|
15
|
+
|
|
16
|
+
var _modal_header = require("./modal_header.styles");
|
|
17
|
+
|
|
14
18
|
var _react2 = require("@emotion/react");
|
|
15
19
|
|
|
16
20
|
var _excluded = ["className", "children"];
|
|
@@ -29,7 +33,11 @@ var EuiModalHeader = function EuiModalHeader(_ref) {
|
|
|
29
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
34
|
|
|
31
35
|
var classes = (0, _classnames.default)('euiModalHeader', className);
|
|
36
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
37
|
+
var styles = (0, _modal_header.euiModalHeaderStyles)(euiTheme);
|
|
38
|
+
var cssStyles = [styles.euiModalHeader];
|
|
32
39
|
return (0, _react2.jsx)("div", _extends({
|
|
40
|
+
css: cssStyles,
|
|
33
41
|
className: classes
|
|
34
42
|
}, rest), children);
|
|
35
43
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiModalHeaderStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
13
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
14
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
|
+
* Side Public License, v 1.
|
|
16
|
+
*/
|
|
17
|
+
var euiModalHeaderStyles = function euiModalHeaderStyles(euiThemeContext) {
|
|
18
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
19
|
+
return {
|
|
20
|
+
euiModalHeader: /*#__PURE__*/(0, _react.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;")
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.euiModalHeaderStyles = euiModalHeaderStyles;
|
|
@@ -11,6 +11,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
|
|
14
|
+
var _title = require("../title");
|
|
15
|
+
|
|
14
16
|
var _react2 = require("@emotion/react");
|
|
15
17
|
|
|
16
18
|
var _excluded = ["className", "children"];
|
|
@@ -29,7 +31,8 @@ var EuiModalHeaderTitle = function EuiModalHeaderTitle(_ref) {
|
|
|
29
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
30
32
|
|
|
31
33
|
var classes = (0, _classnames.default)('euiModalHeader__title', className);
|
|
32
|
-
return (0, _react2.jsx)(
|
|
34
|
+
return (0, _react2.jsx)(_title.EuiTitle, _extends({
|
|
35
|
+
size: "m",
|
|
33
36
|
className: classes
|
|
34
37
|
}, rest), /*#__PURE__*/_react.default.isValidElement(children) ? children : (0, _react2.jsx)("h1", null, children));
|
|
35
38
|
};
|
|
@@ -59,7 +59,7 @@ _EuiPageOuter.propTypes = {
|
|
|
59
59
|
direction: _propTypes.default.oneOf(["row", "column"]),
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
* When direction is `row`, it will flip to `column` when within these breakpoints
|
|
62
|
+
* When direction is `row`, it will flip to `column` when within these breakpoints.
|
|
63
63
|
*/
|
|
64
64
|
responsive: _propTypes.default.arrayOf(_propTypes.default.any.isRequired),
|
|
65
65
|
className: _propTypes.default.string,
|
|
@@ -29,7 +29,7 @@ var _global_styling = require("../../global_styling");
|
|
|
29
29
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["children", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "
|
|
32
|
+
var _excluded = ["children", "responsive", "restrictWidth", "paddingSize", "grow", "bottomBorder", "offset", "panelled", "contentBorder", "component", "mainProps", "className", "minHeight"];
|
|
33
33
|
|
|
34
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
35
|
|
|
@@ -75,6 +75,8 @@ exports.TemplateContext = TemplateContext;
|
|
|
75
75
|
*/
|
|
76
76
|
var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
77
77
|
var children = _ref.children,
|
|
78
|
+
_ref$responsive = _ref.responsive,
|
|
79
|
+
responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
|
|
78
80
|
_ref$restrictWidth = _ref.restrictWidth,
|
|
79
81
|
restrictWidth = _ref$restrictWidth === void 0 ? true : _ref$restrictWidth,
|
|
80
82
|
_ref$paddingSize = _ref.paddingSize,
|
|
@@ -85,12 +87,11 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
85
87
|
_offset = _ref.offset,
|
|
86
88
|
panelled = _ref.panelled,
|
|
87
89
|
contentBorder = _ref.contentBorder,
|
|
90
|
+
component = _ref.component,
|
|
88
91
|
mainProps = _ref.mainProps,
|
|
89
92
|
className = _ref.className,
|
|
90
93
|
_ref$minHeight = _ref.minHeight,
|
|
91
94
|
minHeight = _ref$minHeight === void 0 ? '460px' : _ref$minHeight,
|
|
92
|
-
_ref$responsive = _ref.responsive,
|
|
93
|
-
responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
|
|
94
95
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
95
96
|
|
|
96
97
|
var _useEuiTheme = (0, _services.useEuiTheme)(),
|
|
@@ -198,6 +199,7 @@ var _EuiPageTemplate = function _EuiPageTemplate(_ref) {
|
|
|
198
199
|
style: pageStyle,
|
|
199
200
|
className: classes
|
|
200
201
|
}), sidebar, (0, _react2.jsx)(_inner._EuiPageInner, _extends({}, mainProps, {
|
|
202
|
+
component: component,
|
|
201
203
|
id: pageInnerId,
|
|
202
204
|
border: innerBordered(),
|
|
203
205
|
panelled: innerPanelled(),
|
|
@@ -220,13 +222,27 @@ _EuiPageTemplate.propTypes = {
|
|
|
220
222
|
direction: _propTypes.default.oneOf(["row", "column"]),
|
|
221
223
|
|
|
222
224
|
/**
|
|
223
|
-
|
|
225
|
+
* Decides at which point the main content wrapper will be 100vw.
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* When direction is `row`, it will flip to `column` when within these breakpoints.
|
|
224
230
|
*/
|
|
225
231
|
responsive: _propTypes.default.arrayOf(_propTypes.default.any.isRequired),
|
|
226
|
-
className: _propTypes.default.string,
|
|
227
|
-
"aria-label": _propTypes.default.string,
|
|
228
|
-
"data-test-subj": _propTypes.default.string,
|
|
229
|
-
css: _propTypes.default.any,
|
|
232
|
+
className: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
233
|
+
"aria-label": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
234
|
+
"data-test-subj": _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.string]),
|
|
235
|
+
css: _propTypes.default.oneOfType([_propTypes.default.any, _propTypes.default.any]),
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Adds a white background and shadow to define the area.
|
|
239
|
+
*/
|
|
240
|
+
panelled: _propTypes.default.bool,
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Adjust the overall padding.
|
|
244
|
+
*/
|
|
245
|
+
paddingSize: _propTypes.default.any,
|
|
230
246
|
|
|
231
247
|
/**
|
|
232
248
|
* Sets the max-width of the page,
|
|
@@ -247,7 +263,7 @@ _EuiPageTemplate.propTypes = {
|
|
|
247
263
|
* Applies a top or left border to the inner contents
|
|
248
264
|
* to add separation between content and sidebar when a sidebar exists.
|
|
249
265
|
*/
|
|
250
|
-
contentBorder: _propTypes.default.
|
|
266
|
+
contentBorder: _propTypes.default.any,
|
|
251
267
|
|
|
252
268
|
/**
|
|
253
269
|
* Minimum height in which to enforce scrolling
|
|
@@ -269,7 +285,13 @@ _EuiPageTemplate.propTypes = {
|
|
|
269
285
|
"aria-label": _propTypes.default.string,
|
|
270
286
|
"data-test-subj": _propTypes.default.string,
|
|
271
287
|
css: _propTypes.default.any
|
|
272
|
-
})
|
|
288
|
+
}),
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Sets which HTML element to render for the `main` content wrapper
|
|
292
|
+
* @default main
|
|
293
|
+
*/
|
|
294
|
+
component: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.elementType.isRequired])
|
|
273
295
|
};
|
|
274
296
|
|
|
275
297
|
var _EuiPageSection = function _EuiPageSection(props) {
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
6
|
+
|
|
7
|
+
var _popover = require("./popover");
|
|
8
|
+
|
|
9
|
+
var _button = require("../button");
|
|
10
|
+
|
|
11
|
+
var _text = require("../text");
|
|
12
|
+
|
|
13
|
+
var _react2 = require("@emotion/react");
|
|
14
|
+
|
|
15
|
+
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); }
|
|
16
|
+
|
|
17
|
+
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; }
|
|
18
|
+
|
|
19
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20
|
+
|
|
21
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
+
|
|
23
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
+
|
|
25
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
26
|
+
|
|
27
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
28
|
+
|
|
29
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
|
+
|
|
31
|
+
var Popover = function Popover() {
|
|
32
|
+
var _useState = (0, _react.useState)(false),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
isPopoverOpen = _useState2[0],
|
|
35
|
+
setIsPopoverOpen = _useState2[1];
|
|
36
|
+
|
|
37
|
+
var onButtonClick = function onButtonClick() {
|
|
38
|
+
return setIsPopoverOpen(function (isPopoverOpen) {
|
|
39
|
+
return !isPopoverOpen;
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var closePopover = function closePopover() {
|
|
44
|
+
return setIsPopoverOpen(false);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
var button = (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
48
|
+
iconType: "documentation",
|
|
49
|
+
iconSide: "right",
|
|
50
|
+
onClick: onButtonClick
|
|
51
|
+
}, "How it works");
|
|
52
|
+
var popoverProps = {
|
|
53
|
+
button: button,
|
|
54
|
+
isOpen: isPopoverOpen,
|
|
55
|
+
closePopover: closePopover
|
|
56
|
+
};
|
|
57
|
+
return (0, _react2.jsx)(_popover.EuiPopover, popoverProps, (0, _react2.jsx)(_text.EuiText, {
|
|
58
|
+
style: {
|
|
59
|
+
width: 300
|
|
60
|
+
}
|
|
61
|
+
}, (0, _react2.jsx)("p", null, "Popover content that\u2019s wider than the default width")));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
beforeEach(function () {
|
|
65
|
+
cy.mount((0, _react2.jsx)(Popover, null));
|
|
66
|
+
cy.get('div.euiPopover__panel').should('not.exist');
|
|
67
|
+
});
|
|
68
|
+
describe('EuiPopover', function () {
|
|
69
|
+
describe('Automated accessibility check', function () {
|
|
70
|
+
it('has zero violations on render', function () {
|
|
71
|
+
cy.checkAxe();
|
|
72
|
+
});
|
|
73
|
+
it('has zero violations when popover is opened', function () {
|
|
74
|
+
cy.get('button.euiButtonEmpty').click();
|
|
75
|
+
cy.get('div.euiPopover__panel').should('exist');
|
|
76
|
+
cy.checkAxe();
|
|
77
|
+
});
|
|
78
|
+
it('has zero violations when popover is closed', function () {
|
|
79
|
+
cy.get('button.euiButtonEmpty').click();
|
|
80
|
+
cy.get('div.euiPopover__panel').should('exist');
|
|
81
|
+
cy.get('button.euiButtonEmpty').click();
|
|
82
|
+
cy.get('div.euiPopover__panel').should('not.exist');
|
|
83
|
+
cy.checkAxe();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -3514,7 +3514,8 @@ var printValue = function printValue(value, options) {
|
|
|
3514
3514
|
return value.toString();
|
|
3515
3515
|
}
|
|
3516
3516
|
|
|
3517
|
-
if (value.length === 0 || value.match(
|
|
3517
|
+
if (value.length === 0 || value.match(/[^\w\-_*:()"/\\]/) || // Escape spaces and special characters not used as syntax identifiers
|
|
3518
|
+
value.toLowerCase() === 'or') {
|
|
3518
3519
|
return "\"".concat(escapePhraseValue(value), "\"");
|
|
3519
3520
|
}
|
|
3520
3521
|
|
|
@@ -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
|
-
|
|
61
|
+
if (fallbackDestination) {
|
|
62
|
+
var fallbackEl = document.querySelector(fallbackDestination);
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
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;
|