@elastic/eui 70.1.0 → 70.2.1
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 +11 -1
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +11 -1
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/screen_reader_only/screen_reader_only.js +1 -1
- package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/es/components/accordion/accordion.a11y.js +35 -0
- package/es/components/card/card.js +13 -31
- package/es/components/card/card.styles.js +15 -3
- package/es/components/card/card_select/card_select.styles.js +4 -4
- package/es/components/card/checkable_card/checkable_card.js +3 -2
- package/es/components/context_menu/context_menu_panel.a11y.js +34 -0
- package/es/components/datagrid/controls/data_grid_toolbar.js +6 -2
- package/es/components/datagrid/controls/index.js +1 -0
- package/es/components/datagrid/controls/keyboard_shortcuts.js +191 -0
- package/es/components/datagrid/data_grid.js +12 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +22 -4
- package/es/components/page/page_section/page_section.js +3 -4
- package/es/components/selectable/selectable.a11y.js +118 -0
- package/es/components/selectable/selectable.js +9 -6
- package/es/components/tabs/tab.js +9 -4
- package/es/components/tabs/tab.styles.js +29 -16
- package/es/components/tabs/tabbed_content/tabbed_content.js +1 -1
- package/es/components/tabs/tabs.js +3 -3
- package/es/components/tabs/tabs.styles.js +2 -4
- package/es/services/string/to_initials.js +1 -1
- package/eui.d.ts +208 -164
- package/i18ntokens.json +438 -6
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.js +1 -1
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/lib/components/accordion/accordion.a11y.js +44 -0
- package/lib/components/card/card.js +14 -33
- package/lib/components/card/card.styles.js +15 -3
- package/lib/components/card/card_select/card_select.styles.js +4 -4
- package/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/lib/components/context_menu/context_menu_panel.a11y.js +42 -0
- package/lib/components/datagrid/controls/data_grid_toolbar.js +7 -2
- package/lib/components/datagrid/controls/index.js +8 -0
- package/lib/components/datagrid/controls/keyboard_shortcuts.js +208 -0
- package/lib/components/datagrid/data_grid.js +11 -1
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +22 -4
- package/lib/components/page/page_section/page_section.js +3 -4
- package/lib/components/selectable/selectable.a11y.js +122 -0
- package/lib/components/selectable/selectable.js +9 -6
- package/lib/components/tabs/tab.js +9 -4
- package/lib/components/tabs/tab.styles.js +29 -16
- package/lib/components/tabs/tabbed_content/tabbed_content.js +1 -1
- package/lib/components/tabs/tabs.js +3 -3
- package/lib/components/tabs/tabs.styles.js +1 -3
- package/lib/services/string/to_initials.js +1 -1
- package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/optimize/es/components/accordion/accordion.a11y.js +35 -0
- package/optimize/es/components/card/card.js +12 -30
- package/optimize/es/components/card/card.styles.js +15 -3
- package/optimize/es/components/card/card_select/card_select.styles.js +4 -4
- package/optimize/es/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/es/components/context_menu/context_menu_panel.a11y.js +34 -0
- package/optimize/es/components/datagrid/controls/data_grid_toolbar.js +6 -2
- package/optimize/es/components/datagrid/controls/index.js +1 -0
- package/optimize/es/components/datagrid/controls/keyboard_shortcuts.js +181 -0
- package/optimize/es/components/datagrid/data_grid.js +6 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +12 -4
- package/optimize/es/components/page/page_section/page_section.js +3 -4
- package/optimize/es/components/selectable/selectable.a11y.js +107 -0
- package/optimize/es/components/selectable/selectable.js +9 -6
- package/optimize/es/components/tabs/tab.js +9 -4
- package/optimize/es/components/tabs/tab.styles.js +29 -16
- package/optimize/es/components/tabs/tabs.js +3 -3
- package/optimize/es/components/tabs/tabs.styles.js +2 -4
- package/optimize/es/services/string/to_initials.js +1 -1
- package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/optimize/lib/components/accordion/accordion.a11y.js +44 -0
- package/optimize/lib/components/card/card.js +13 -32
- package/optimize/lib/components/card/card.styles.js +15 -3
- package/optimize/lib/components/card/card_select/card_select.styles.js +4 -4
- package/optimize/lib/components/card/checkable_card/checkable_card.js +3 -2
- package/optimize/lib/components/context_menu/context_menu_panel.a11y.js +42 -0
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar.js +7 -2
- package/optimize/lib/components/datagrid/controls/index.js +8 -0
- package/optimize/lib/components/datagrid/controls/keyboard_shortcuts.js +207 -0
- package/optimize/lib/components/datagrid/data_grid.js +5 -1
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +12 -4
- package/optimize/lib/components/page/page_section/page_section.js +3 -4
- package/optimize/lib/components/selectable/selectable.a11y.js +122 -0
- package/optimize/lib/components/selectable/selectable.js +9 -6
- package/optimize/lib/components/tabs/tab.js +9 -4
- package/optimize/lib/components/tabs/tab.styles.js +29 -16
- package/optimize/lib/components/tabs/tabs.js +3 -3
- package/optimize/lib/components/tabs/tabs.styles.js +1 -3
- package/optimize/lib/services/string/to_initials.js +1 -1
- package/package.json +3 -2
- package/src/components/datagrid/_index.scss +1 -0
- package/src/components/datagrid/controls/_data_grid_keyboard_shortcuts.scss +17 -0
- package/src/components/modal/_modal.scss +3 -1
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.js +1 -1
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +1 -1
- package/test-env/components/accordion/accordion.a11y.js +44 -0
- package/test-env/components/card/card.js +14 -33
- package/test-env/components/card/card.styles.js +15 -3
- package/test-env/components/card/card_select/card_select.styles.js +4 -4
- package/test-env/components/card/checkable_card/checkable_card.js +3 -2
- package/test-env/components/context_menu/context_menu_panel.a11y.js +42 -0
- package/test-env/components/datagrid/controls/data_grid_toolbar.js +7 -2
- package/test-env/components/datagrid/controls/index.js +8 -0
- package/test-env/components/datagrid/controls/keyboard_shortcuts.js +207 -0
- package/test-env/components/datagrid/data_grid.js +11 -1
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +22 -4
- package/test-env/components/page/page_section/page_section.js +3 -4
- package/test-env/components/selectable/selectable.a11y.js +122 -0
- package/test-env/components/selectable/selectable.js +9 -6
- package/test-env/components/tabs/tab.js +9 -4
- package/test-env/components/tabs/tab.styles.js +29 -16
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +1 -1
- package/test-env/components/tabs/tabs.js +3 -3
- package/test-env/components/tabs/tabs.styles.js +1 -3
- package/test-env/services/string/to_initials.js +1 -1
|
@@ -45,8 +45,8 @@ var EuiTabs = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
45
45
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
46
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
47
47
|
var classes = (0, _classnames.default)('euiTabs', className);
|
|
48
|
-
var
|
|
49
|
-
var
|
|
48
|
+
var styles = (0, _tabs.euiTabsStyles)(euiTheme);
|
|
49
|
+
var cssStyles = [styles.euiTabs, styles[size], bottomBorder && styles.bottomBorder];
|
|
50
50
|
|
|
51
51
|
var tabItems = _react.default.Children.map(children, function (child) {
|
|
52
52
|
if ( /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
@@ -61,7 +61,7 @@ var EuiTabs = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
61
61
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
62
62
|
ref: ref,
|
|
63
63
|
className: classes,
|
|
64
|
-
css:
|
|
64
|
+
css: cssStyles
|
|
65
65
|
}, children && {
|
|
66
66
|
role: 'tablist'
|
|
67
67
|
}, rest), tabItems);
|
|
@@ -20,9 +20,7 @@ var euiTabsStyles = function euiTabsStyles(euiThemeContext) {
|
|
|
20
20
|
var euiTheme = euiThemeContext.euiTheme;
|
|
21
21
|
return {
|
|
22
22
|
euiTabs: /*#__PURE__*/(0, _react.css)("display:flex;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";", (0, _global_styling.logicalCSSWithFallback)('overflow-x', 'auto'), ";", (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'hidden'), ";position:relative;flex-shrink:0;;label:euiTabs;"),
|
|
23
|
-
bottomBorder: /*#__PURE__*/(0, _react.css)("box-shadow:inset 0 ",
|
|
24
|
-
return x * -1;
|
|
25
|
-
}), " 0 ", euiTheme.border.color, ";;label:bottomBorder;"),
|
|
23
|
+
bottomBorder: /*#__PURE__*/(0, _react.css)("box-shadow:inset 0 -", euiTheme.border.width.thin, " 0 ", euiTheme.border.color, ";;label:bottomBorder;"),
|
|
26
24
|
// sizes
|
|
27
25
|
s: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.m, ";;label:s;"),
|
|
28
26
|
m: /*#__PURE__*/(0, _react.css)("gap:", euiTheme.size.base, ";;label:m;"),
|
|
@@ -32,7 +32,7 @@ exports.MAX_INITIALS = MAX_INITIALS;
|
|
|
32
32
|
|
|
33
33
|
function toInitials(name, initialsLength, initials) {
|
|
34
34
|
// Calculate the number of initials to show, maxing out at MAX_INITIALS
|
|
35
|
-
var calculatedInitialsLength = initials ? initials.split('
|
|
35
|
+
var calculatedInitialsLength = initials ? initials.split('').length : name.split(' ').length;
|
|
36
36
|
calculatedInitialsLength = calculatedInitialsLength > MAX_INITIALS ? MAX_INITIALS : calculatedInitialsLength; // Check if initialsLength was passed and set to calculated, unless greater than MAX_INITIALS
|
|
37
37
|
|
|
38
38
|
if (initialsLength) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elastic/eui",
|
|
3
3
|
"description": "Elastic UI Component Library",
|
|
4
|
-
"version": "70.1
|
|
4
|
+
"version": "70.2.1",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "lib",
|
|
7
7
|
"module": "es",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"test-staged": "yarn lint && node scripts/test-staged.js",
|
|
35
35
|
"test-cypress": "node ./scripts/cypress",
|
|
36
36
|
"test-cypress-dev": "node ./scripts/cypress --dev",
|
|
37
|
+
"test-cypress-a11y": "node ./scripts/cypress --a11y",
|
|
37
38
|
"combine-test-coverage": "sh ./scripts/combine-coverage.sh",
|
|
38
39
|
"start-test-server": "BABEL_MODULES=false NODE_ENV=puppeteer NODE_OPTIONS=--max-old-space-size=4096 webpack-dev-server --config src-docs/webpack.config.js --port 9999",
|
|
39
40
|
"yo-component": "yo ./generator-eui/app/component.js",
|
|
@@ -115,7 +116,7 @@
|
|
|
115
116
|
"@cypress/code-coverage": "^3.10.0",
|
|
116
117
|
"@cypress/react": "^5.10.3",
|
|
117
118
|
"@cypress/webpack-dev-server": "^1.7.0",
|
|
118
|
-
"@elastic/charts": "^50.0
|
|
119
|
+
"@elastic/charts": "^50.1.0",
|
|
119
120
|
"@elastic/datemath": "^5.0.3",
|
|
120
121
|
"@elastic/eslint-config-kibana": "^0.15.0",
|
|
121
122
|
"@emotion/babel-preset-css-prop": "^11.10.0",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.euiDataGrid__keyboardShortcuts {
|
|
2
|
+
display: block;
|
|
3
|
+
max-inline-size: $euiSizeXXL * 10;
|
|
4
|
+
max-block-size: 80vh;
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
overflow-block: auto;
|
|
7
|
+
|
|
8
|
+
.euiDescriptionList {
|
|
9
|
+
.euiDescriptionList__title {
|
|
10
|
+
width: 25%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.euiDescriptionList__description {
|
|
14
|
+
width: 75%;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
display: flex;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
max-height: 75vh; // We overflow the modal body based off this
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
// TODO: Consider restoring this once https://bugs.chromium.org/p/chromium/issues/detail?id=1229700 is resolved
|
|
10
|
+
// overflow: hidden; Ensure long, non-breaking text doesn't expand beyond the modal bounds
|
|
9
11
|
|
|
10
12
|
position: relative;
|
|
11
13
|
background-color: $euiColorEmptyShade;
|
|
@@ -44,7 +44,7 @@ EuiScreenReaderOnly.propTypes = {
|
|
|
44
44
|
children: _propTypes.default.element.isRequired,
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* For keyboard navigation, force content to display visually upon focus.
|
|
47
|
+
* For keyboard navigation, force content to display visually upon focus/focus-within.
|
|
48
48
|
*/
|
|
49
49
|
showOnFocus: _propTypes.default.bool,
|
|
50
50
|
className: _propTypes.default.string
|
|
@@ -33,7 +33,7 @@ exports.euiScreenReaderOnly = euiScreenReaderOnly;
|
|
|
33
33
|
|
|
34
34
|
var euiScreenReaderOnlyStyles = function euiScreenReaderOnlyStyles(showOnFocus) {
|
|
35
35
|
return {
|
|
36
|
-
euiScreenReaderOnly: showOnFocus ? /*#__PURE__*/(0, _react.css)("&:not(:focus):not(:active){", euiScreenReaderOnly(), ";};label:euiScreenReaderOnly;") : /*#__PURE__*/(0, _react.css)(euiScreenReaderOnly(), ";label:euiScreenReaderOnly;")
|
|
36
|
+
euiScreenReaderOnly: showOnFocus ? /*#__PURE__*/(0, _react.css)("&:not(:focus):not(:active):not(:focus-within){", euiScreenReaderOnly(), ";};label:euiScreenReaderOnly;") : /*#__PURE__*/(0, _react.css)(euiScreenReaderOnly(), ";label:euiScreenReaderOnly;")
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _index = require("./index");
|
|
8
|
+
|
|
9
|
+
var _panel = require("../../components/panel");
|
|
10
|
+
|
|
11
|
+
var _services = require("../../services");
|
|
12
|
+
|
|
13
|
+
var _react2 = require("@emotion/react");
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
17
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
18
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
19
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
20
|
+
* Side Public License, v 1.
|
|
21
|
+
*/
|
|
22
|
+
/// <reference types="../../../cypress/support"/>
|
|
23
|
+
var baseProps = {
|
|
24
|
+
buttonContent: 'Click me to toggle',
|
|
25
|
+
id: (0, _services.htmlIdGenerator)()(),
|
|
26
|
+
initialIsOpen: false
|
|
27
|
+
};
|
|
28
|
+
var noArrow = {
|
|
29
|
+
arrowDisplay: 'none'
|
|
30
|
+
};
|
|
31
|
+
var noArrowProps = Object.assign(baseProps, noArrow);
|
|
32
|
+
describe('EuiAccordion', function () {
|
|
33
|
+
describe('Automated accessibility check', function () {
|
|
34
|
+
it('has zero violations when expanded', function () {
|
|
35
|
+
cy.mount((0, _react2.jsx)(_index.EuiAccordion, noArrowProps, (0, _react2.jsx)(_panel.EuiPanel, {
|
|
36
|
+
color: "subdued"
|
|
37
|
+
}, "Any content inside of ", (0, _react2.jsx)("strong", null, "EuiAccordion"), " will appear here. We will include ", (0, _react2.jsx)("a", {
|
|
38
|
+
href: "#"
|
|
39
|
+
}, "a link"), " to confirm focus.")));
|
|
40
|
+
cy.get('button.euiAccordion__button').click();
|
|
41
|
+
cy.checkAxe();
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.EuiCard = exports.ALIGNMENTS = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -21,10 +21,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
21
21
|
|
|
22
22
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
23
23
|
|
|
24
|
-
var _common = require("../common");
|
|
25
|
-
|
|
26
24
|
var _services = require("../../services");
|
|
27
25
|
|
|
26
|
+
var _clone_element = require("../../services/theme/clone_element");
|
|
27
|
+
|
|
28
28
|
var _text = require("../text");
|
|
29
29
|
|
|
30
30
|
var _title = require("../title");
|
|
@@ -56,23 +56,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
56
56
|
|
|
57
57
|
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; }
|
|
58
58
|
|
|
59
|
-
var
|
|
60
|
-
left: 'euiCard--leftAligned',
|
|
61
|
-
center: 'euiCard--centerAligned',
|
|
62
|
-
right: 'euiCard--rightAligned'
|
|
63
|
-
};
|
|
64
|
-
var ALIGNMENTS = (0, _common.keysOf)(textAlignToClassNameMap);
|
|
59
|
+
var ALIGNMENTS = ['left', 'center', 'right'];
|
|
65
60
|
exports.ALIGNMENTS = ALIGNMENTS;
|
|
66
|
-
var layoutToClassNameMap = {
|
|
67
|
-
vertical: '',
|
|
68
|
-
horizontal: 'euiCard--horizontal'
|
|
69
|
-
};
|
|
70
|
-
var LAYOUT_ALIGNMENTS = (0, _common.keysOf)(layoutToClassNameMap);
|
|
71
|
-
/**
|
|
72
|
-
* Certain props are only allowed when the layout is vertical
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
exports.LAYOUT_ALIGNMENTS = LAYOUT_ALIGNMENTS;
|
|
76
61
|
|
|
77
62
|
var EuiCard = function EuiCard(_ref) {
|
|
78
63
|
var className = _ref.className,
|
|
@@ -107,8 +92,9 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
107
92
|
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
108
93
|
var styles = (0, _card.euiCardStyles)(euiThemeContext, paddingSize);
|
|
109
94
|
var cardStyles = [styles.card.euiCard, // Text alignment should always be left when horizontal
|
|
110
|
-
styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign],
|
|
95
|
+
styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign], isDisabled && styles.card.disabled];
|
|
111
96
|
var contentStyles = [styles.content.euiCard__content, styles.content.layout[layout]];
|
|
97
|
+
var mainStyles = [styles.main.euiCard__main, styles.main.layout[layout]];
|
|
112
98
|
var textStyles = (0, _card.euiCardTextStyles)(euiThemeContext);
|
|
113
99
|
var textCSS = [textStyles.euiCard__text, // Text alignment should always be left when horizontal
|
|
114
100
|
textStyles.aligned[layout === 'horizontal' ? 'left' : textAlign], isClickable && textStyles.interactive, isDisabled && textStyles.disabled];
|
|
@@ -132,15 +118,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
132
118
|
}
|
|
133
119
|
}
|
|
134
120
|
|
|
135
|
-
var
|
|
136
|
-
var classes = (0, _classnames.default)('euiCard', textAlignToClassNameMap[textAlign], layoutToClassNameMap[layout], {
|
|
137
|
-
'euiCard--isClickable': isClickable,
|
|
138
|
-
'euiCard--hasBetaBadge': betaBadgeProps === null || betaBadgeProps === void 0 ? void 0 : betaBadgeProps.label,
|
|
139
|
-
'euiCard--hasIcon': icon,
|
|
140
|
-
'euiCard--isSelectable': selectable,
|
|
141
|
-
'euiCard-isSelected': selectable === null || selectable === void 0 ? void 0 : selectable.isSelected,
|
|
142
|
-
'euiCard-isDisabled': isDisabled
|
|
143
|
-
}, selectableColorClass, className);
|
|
121
|
+
var classes = (0, _classnames.default)('euiCard', className);
|
|
144
122
|
var ariaId = (0, _accessibility.useGeneratedHtmlId)();
|
|
145
123
|
var ariaDesc = description ? "".concat(ariaId, "Description") : '';
|
|
146
124
|
/**
|
|
@@ -168,7 +146,7 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
168
146
|
|
|
169
147
|
if (icon) {
|
|
170
148
|
var iconStyles = [styles.icon.euiCard__icon, styles.icon.layout[layout], imageNode && styles.icon.withImage];
|
|
171
|
-
iconNode =
|
|
149
|
+
iconNode = (0, _clone_element.cloneElementWithCss)(icon, {
|
|
172
150
|
className: (0, _classnames.default)(icon.props.className, 'euiCard__icon'),
|
|
173
151
|
css: iconStyles
|
|
174
152
|
});
|
|
@@ -322,14 +300,17 @@ var EuiCard = function EuiCard(_ref) {
|
|
|
322
300
|
hasShadow: isDisabled || display ? false : true,
|
|
323
301
|
hasBorder: display ? false : undefined,
|
|
324
302
|
paddingSize: paddingSize
|
|
325
|
-
}, rest),
|
|
303
|
+
}, rest), (0, _react2.jsx)("div", {
|
|
304
|
+
className: "euiCard__main",
|
|
305
|
+
css: mainStyles
|
|
306
|
+
}, optionalCardTop, (0, _react2.jsx)("div", {
|
|
326
307
|
className: "euiCard__content",
|
|
327
308
|
css: contentStyles
|
|
328
309
|
}, (0, _react2.jsx)(_title.EuiTitle, {
|
|
329
310
|
id: "".concat(ariaId, "Title"),
|
|
330
311
|
className: "euiCard__title",
|
|
331
312
|
size: titleSize
|
|
332
|
-
}, (0, _react2.jsx)(TitleElement, null, theTitle)), optionalDescription, optionalChildren), optionalBetaBadge, optionalFooter, optionalSelectButton);
|
|
313
|
+
}, (0, _react2.jsx)(TitleElement, null, theTitle)), optionalDescription, optionalChildren), optionalBetaBadge, optionalFooter), optionalSelectButton);
|
|
333
314
|
};
|
|
334
315
|
|
|
335
316
|
exports.EuiCard = EuiCard;
|
|
@@ -343,7 +324,7 @@ EuiCard.propTypes = {
|
|
|
343
324
|
/**
|
|
344
325
|
* Changes alignment of the title and description
|
|
345
326
|
*/
|
|
346
|
-
textAlign: _propTypes.default.
|
|
327
|
+
textAlign: _propTypes.default.any,
|
|
347
328
|
|
|
348
329
|
/**
|
|
349
330
|
* Accepts any combination of elements
|
|
@@ -57,6 +57,15 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
|
57
57
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
+
var _ref6 = process.env.NODE_ENV === "production" ? {
|
|
61
|
+
name: "z24364-euiCard__main",
|
|
62
|
+
styles: "display:flex;label:euiCard__main;"
|
|
63
|
+
} : {
|
|
64
|
+
name: "z24364-euiCard__main",
|
|
65
|
+
styles: "display:flex;label:euiCard__main;",
|
|
66
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
67
|
+
};
|
|
68
|
+
|
|
60
69
|
var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize) {
|
|
61
70
|
var euiTheme = euiThemeContext.euiTheme;
|
|
62
71
|
var paddingAmount = (0, _global_styling.euiPaddingSize)(euiThemeContext, paddingSize);
|
|
@@ -64,17 +73,20 @@ var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize) {
|
|
|
64
73
|
var halfSpacing = (0, _global_styling.euiPaddingSize)(euiThemeContext, halfPaddingKey);
|
|
65
74
|
return {
|
|
66
75
|
card: {
|
|
67
|
-
euiCard: /*#__PURE__*/(0, _react.css)("display:flex;&:has([class*='euiCard__text'][class*='-interactive']:focus:focus-visible){outline:", euiTheme.focus.width, " solid currentColor;};label:euiCard;"),
|
|
76
|
+
euiCard: /*#__PURE__*/(0, _react.css)("display:flex;align-items:flex-start;justify-content:space-between;flex-direction:column;&:has([class*='euiCard__text'][class*='-interactive']:focus:focus-visible){outline:", euiTheme.focus.width, " solid currentColor;};label:euiCard;"),
|
|
68
77
|
aligned: {
|
|
69
78
|
center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), ";align-items:center;;label:center;"),
|
|
70
79
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";align-items:flex-start;;label:left;"),
|
|
71
80
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";align-items:flex-end;;label:right;")
|
|
72
81
|
},
|
|
82
|
+
disabled: /*#__PURE__*/(0, _react.css)("cursor:not-allowed;background-color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled'), ";color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
83
|
+
},
|
|
84
|
+
main: {
|
|
85
|
+
euiCard__main: _ref6,
|
|
73
86
|
layout: {
|
|
74
87
|
vertical: _ref5,
|
|
75
88
|
horizontal: _ref4
|
|
76
|
-
}
|
|
77
|
-
disabled: /*#__PURE__*/(0, _react.css)("cursor:not-allowed;background-color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled'), ";color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
89
|
+
}
|
|
78
90
|
},
|
|
79
91
|
content: {
|
|
80
92
|
euiCard__content: _ref3,
|
|
@@ -10,11 +10,11 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
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)."; }
|
|
11
11
|
|
|
12
12
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
-
name: "
|
|
14
|
-
styles: "transform:none!important;label:euiCardSelect;"
|
|
13
|
+
name: "aogl4-euiCardSelect",
|
|
14
|
+
styles: "transform:none!important;align-self:flex-end;label:euiCardSelect;"
|
|
15
15
|
} : {
|
|
16
|
-
name: "
|
|
17
|
-
styles: "transform:none!important;label:euiCardSelect;",
|
|
16
|
+
name: "aogl4-euiCardSelect",
|
|
17
|
+
styles: "transform:none!important;align-self:flex-end;label:euiCardSelect;",
|
|
18
18
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -29,7 +29,7 @@ var _checkable_card = require("./checkable_card.styles");
|
|
|
29
29
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
|
-
var _excluded = ["children", "className", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
32
|
+
var _excluded = ["children", "className", "css", "checkableType", "label", "checked", "disabled", "hasShadow", "hasBorder"];
|
|
33
33
|
|
|
34
34
|
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); }
|
|
35
35
|
|
|
@@ -38,6 +38,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
38
38
|
var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
39
39
|
var children = _ref.children,
|
|
40
40
|
className = _ref.className,
|
|
41
|
+
css = _ref.css,
|
|
41
42
|
_ref$checkableType = _ref.checkableType,
|
|
42
43
|
checkableType = _ref$checkableType === void 0 ? 'radio' : _ref$checkableType,
|
|
43
44
|
label = _ref.label,
|
|
@@ -49,7 +50,7 @@ var EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
|
49
50
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
50
51
|
var euiThemeContext = (0, _services.useEuiTheme)();
|
|
51
52
|
var styles = (0, _checkable_card.euiCheckableCardStyles)(euiThemeContext);
|
|
52
|
-
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked];
|
|
53
|
+
var baseStyles = [styles.euiCheckableCard, checked && !disabled && styles.isChecked, css];
|
|
53
54
|
var labelStyles = [styles.label.euiCheckableCard__label, disabled && styles.label.isDisabled];
|
|
54
55
|
var childStyles = [styles.euiCheckableCard__children];
|
|
55
56
|
var id = rest.id;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
|
|
7
|
+
var _context_menu_item = require("./context_menu_item");
|
|
8
|
+
|
|
9
|
+
var _context_menu_panel = require("./context_menu_panel");
|
|
10
|
+
|
|
11
|
+
var _react2 = require("@emotion/react");
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
15
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
16
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
17
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
18
|
+
* Side Public License, v 1.
|
|
19
|
+
*/
|
|
20
|
+
/// <reference types="../../../cypress/support"/>
|
|
21
|
+
var items = [(0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
|
|
22
|
+
key: "A",
|
|
23
|
+
"data-test-subj": "itemA"
|
|
24
|
+
}, "Option A"), (0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
|
|
25
|
+
key: "B",
|
|
26
|
+
"data-test-subj": "itemB"
|
|
27
|
+
}, "Option B"), (0, _react2.jsx)(_context_menu_item.EuiContextMenuItem, {
|
|
28
|
+
key: "C",
|
|
29
|
+
"data-test-subj": "itemC"
|
|
30
|
+
}, "Option C")];
|
|
31
|
+
describe('EuiContextMenuPanel', function () {
|
|
32
|
+
describe('Automated accessibility check', function () {
|
|
33
|
+
it('has zero violations', function () {
|
|
34
|
+
var showNextPanelHandler = cy.stub();
|
|
35
|
+
cy.mount((0, _react2.jsx)(_context_menu_panel.EuiContextMenuPanel, {
|
|
36
|
+
items: items,
|
|
37
|
+
showNextPanel: showNextPanelHandler
|
|
38
|
+
}));
|
|
39
|
+
cy.checkAxe();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -12,6 +12,8 @@ exports.renderAdditionalControls = renderAdditionalControls;
|
|
|
12
12
|
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
|
|
15
|
+
var _accessibility = require("../../accessibility");
|
|
16
|
+
|
|
15
17
|
var _utils = require("../../../utils");
|
|
16
18
|
|
|
17
19
|
var _react2 = require("@emotion/react");
|
|
@@ -33,6 +35,7 @@ var EuiDataGridToolbar = function EuiDataGridToolbar(_ref) {
|
|
|
33
35
|
toolbarVisibility = _ref.toolbarVisibility,
|
|
34
36
|
isFullScreen = _ref.isFullScreen,
|
|
35
37
|
fullScreenSelector = _ref.fullScreenSelector,
|
|
38
|
+
keyboardShortcuts = _ref.keyboardShortcuts,
|
|
36
39
|
displaySelector = _ref.displaySelector,
|
|
37
40
|
columnSelector = _ref.columnSelector,
|
|
38
41
|
columnSorting = _ref.columnSorting;
|
|
@@ -40,12 +43,14 @@ var EuiDataGridToolbar = function EuiDataGridToolbar(_ref) {
|
|
|
40
43
|
var hasRoomForGridControls = _utils.IS_JEST_ENVIRONMENT ? true : gridWidth > minSizeForControls || isFullScreen;
|
|
41
44
|
return (0, _react2.jsx)("div", {
|
|
42
45
|
className: "euiDataGrid__controls",
|
|
43
|
-
"data-test-
|
|
46
|
+
"data-test-subj": "dataGridControls"
|
|
44
47
|
}, hasRoomForGridControls && (0, _react2.jsx)("div", {
|
|
45
48
|
className: "euiDataGrid__leftControls"
|
|
46
49
|
}, renderAdditionalControls(toolbarVisibility, 'left.prepend'), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showColumnSelector') ? columnSelector : null, checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showSortSelector') ? columnSorting : null, renderAdditionalControls(toolbarVisibility, 'left.append')), (0, _react2.jsx)("div", {
|
|
47
50
|
className: "euiDataGrid__rightControls"
|
|
48
|
-
}, renderAdditionalControls(toolbarVisibility, 'right'), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, '
|
|
51
|
+
}, renderAdditionalControls(toolbarVisibility, 'right'), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showKeyboardShortcuts') ? keyboardShortcuts : (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, {
|
|
52
|
+
showOnFocus: true
|
|
53
|
+
}, (0, _react2.jsx)("span", null, keyboardShortcuts)), checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showDisplaySelector') ? displaySelector : null, checkOrDefaultToolBarDisplayOptions(toolbarVisibility, 'showFullScreenSelector') ? fullScreenSelector : null));
|
|
49
54
|
};
|
|
50
55
|
/**
|
|
51
56
|
* Toolbar utilities
|
|
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "useDataGridFullScreenSelector", {
|
|
|
45
45
|
return _fullscreen_selector.useDataGridFullScreenSelector;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "useDataGridKeyboardShortcuts", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _keyboard_shortcuts.useDataGridKeyboardShortcuts;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
48
54
|
|
|
49
55
|
var _column_selector = require("./column_selector");
|
|
50
56
|
|
|
@@ -52,6 +58,8 @@ var _column_sorting = require("./column_sorting");
|
|
|
52
58
|
|
|
53
59
|
var _display_selector = require("./display_selector");
|
|
54
60
|
|
|
61
|
+
var _keyboard_shortcuts = require("./keyboard_shortcuts");
|
|
62
|
+
|
|
55
63
|
var _fullscreen_selector = require("./fullscreen_selector");
|
|
56
64
|
|
|
57
65
|
var _data_grid_toolbar = require("./data_grid_toolbar");
|