@elastic/eui 71.1.0 → 72.1.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_charts_theme.js +13 -1
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +20 -176
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +20 -176
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +2 -2
- package/es/components/basic_table/in_memory_table.js +3 -6
- package/es/components/basic_table/table.a11y.js +128 -0
- package/es/components/color_picker/color_picker.styles.js +16 -0
- package/es/components/color_picker/color_stops/color_stop_thumb.js +19 -7
- package/es/components/color_picker/color_stops/color_stop_thumb.styles.js +59 -0
- package/es/components/color_picker/color_stops/color_stops.js +25 -15
- package/es/components/color_picker/color_stops/color_stops.styles.js +65 -0
- package/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +160 -173
- package/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/es/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/es/components/error_boundary/error_boundary.a11y.js +67 -0
- package/es/components/expression/expression.a11y.js +254 -0
- package/es/components/filter_group/filter_group.a11y.js +281 -0
- package/es/components/focus_trap/focus_trap.a11y.js +131 -0
- package/es/components/form/file_picker/file_picker.js +1 -0
- package/es/components/form/range/range_highlight.styles.js +1 -1
- package/es/components/form/range/range_levels.styles.js +1 -1
- package/es/components/form/range/range_track.js +5 -2
- package/es/components/header/header.a11y.js +374 -0
- package/es/components/icon/icon_ML.a11y.js +33 -0
- package/es/components/icon/icon_apps.a11y.js +33 -0
- package/es/components/icon/icon_editor.a11y.js +33 -0
- package/es/components/icon/icon_elastic.a11y.js +33 -0
- package/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/es/components/icon/icon_tokens.a11y.js +33 -0
- package/es/components/image/image.a11y.js +55 -0
- package/es/components/key_pad_menu/key_pad_menu.a11y.js +158 -0
- package/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/es/components/popover/popover.js +2 -2
- package/es/components/selectable/selectable.js +4 -3
- package/es/components/selectable/selectable_list/selectable_list.js +17 -5
- package/es/components/table/table_footer_cell.js +1 -1
- package/es/components/table/table_header_cell.js +1 -1
- package/es/components/table/table_row_cell.js +2 -2
- package/es/components/tabs/tab.js +7 -17
- package/es/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/es/components/tabs/tabs.js +7 -11
- package/es/components/tabs/tabs_context.js +13 -0
- package/es/services/color/manipulation.js +9 -0
- package/es/services/index.js +11 -11
- package/eui.d.ts +195 -138
- package/i18ntokens.json +46 -30
- package/lib/components/basic_table/basic_table.js +2 -2
- package/lib/components/basic_table/in_memory_table.js +3 -6
- package/lib/components/basic_table/table.a11y.js +139 -0
- package/lib/components/color_picker/color_picker.styles.js +26 -0
- package/lib/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/lib/components/color_picker/color_stops/color_stops.js +25 -14
- package/lib/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +155 -168
- package/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/lib/components/error_boundary/error_boundary.a11y.js +75 -0
- package/lib/components/expression/expression.a11y.js +262 -0
- package/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/lib/components/form/file_picker/file_picker.js +1 -0
- package/lib/components/form/range/range_highlight.styles.js +1 -1
- package/lib/components/form/range/range_levels.styles.js +1 -1
- package/lib/components/form/range/range_track.js +6 -2
- package/lib/components/header/header.a11y.js +385 -0
- package/lib/components/icon/icon_ML.a11y.js +40 -0
- package/lib/components/icon/icon_apps.a11y.js +40 -0
- package/lib/components/icon/icon_editor.a11y.js +40 -0
- package/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/lib/components/image/image.a11y.js +61 -0
- package/lib/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/lib/components/popover/popover.js +2 -2
- package/lib/components/selectable/selectable.js +4 -3
- package/lib/components/selectable/selectable_list/selectable_list.js +17 -5
- package/lib/components/table/table_footer_cell.js +1 -1
- package/lib/components/table/table_header_cell.js +1 -1
- package/lib/components/table/table_row_cell.js +2 -2
- package/lib/components/tabs/tab.js +14 -17
- package/lib/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/lib/components/tabs/tabs.js +8 -14
- package/lib/components/tabs/tabs_context.js +23 -0
- package/lib/services/color/manipulation.js +14 -2
- package/lib/services/index.js +65 -58
- package/optimize/es/components/basic_table/table.a11y.js +128 -0
- package/optimize/es/components/color_picker/color_picker.styles.js +16 -0
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.js +19 -7
- package/optimize/es/components/color_picker/color_stops/color_stop_thumb.styles.js +59 -0
- package/optimize/es/components/color_picker/color_stops/color_stops.js +25 -15
- package/optimize/es/components/color_picker/color_stops/color_stops.styles.js +65 -0
- package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +145 -169
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.js +2 -0
- package/optimize/es/components/error_boundary/error_boundary.a11y.js +67 -0
- package/optimize/es/components/expression/expression.a11y.js +243 -0
- package/optimize/es/components/filter_group/filter_group.a11y.js +271 -0
- package/optimize/es/components/focus_trap/focus_trap.a11y.js +120 -0
- package/optimize/es/components/form/file_picker/file_picker.js +1 -0
- package/optimize/es/components/form/range/range_highlight.styles.js +1 -1
- package/optimize/es/components/form/range/range_levels.styles.js +1 -1
- package/optimize/es/components/form/range/range_track.js +5 -2
- package/optimize/es/components/header/header.a11y.js +364 -0
- package/optimize/es/components/icon/icon_ML.a11y.js +33 -0
- package/optimize/es/components/icon/icon_apps.a11y.js +33 -0
- package/optimize/es/components/icon/icon_editor.a11y.js +33 -0
- package/optimize/es/components/icon/icon_elastic.a11y.js +33 -0
- package/optimize/es/components/icon/icon_glyphs.a11y.js +33 -0
- package/optimize/es/components/icon/icon_tokens.a11y.js +33 -0
- package/optimize/es/components/image/image.a11y.js +55 -0
- package/optimize/es/components/key_pad_menu/key_pad_menu.a11y.js +148 -0
- package/optimize/es/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +1 -1
- package/optimize/es/components/popover/popover.js +2 -2
- package/optimize/es/components/selectable/selectable.js +2 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/es/components/tabs/tab.js +7 -5
- package/optimize/es/components/tabs/tabs.js +7 -11
- package/optimize/es/components/tabs/tabs_context.js +13 -0
- package/optimize/es/services/color/manipulation.js +9 -0
- package/optimize/es/services/index.js +11 -11
- package/optimize/lib/components/basic_table/table.a11y.js +139 -0
- package/optimize/lib/components/color_picker/color_picker.styles.js +26 -0
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/optimize/lib/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/optimize/lib/components/color_picker/color_stops/color_stops.js +25 -14
- package/optimize/lib/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +146 -167
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.js +2 -0
- package/optimize/lib/components/error_boundary/error_boundary.a11y.js +75 -0
- package/optimize/lib/components/expression/expression.a11y.js +254 -0
- package/optimize/lib/components/filter_group/filter_group.a11y.js +287 -0
- package/optimize/lib/components/focus_trap/focus_trap.a11y.js +140 -0
- package/optimize/lib/components/form/file_picker/file_picker.js +1 -0
- package/optimize/lib/components/form/range/range_highlight.styles.js +1 -1
- package/optimize/lib/components/form/range/range_levels.styles.js +1 -1
- package/optimize/lib/components/form/range/range_track.js +6 -2
- package/optimize/lib/components/header/header.a11y.js +385 -0
- package/optimize/lib/components/icon/icon_ML.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_apps.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_editor.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_elastic.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_glyphs.a11y.js +40 -0
- package/optimize/lib/components/icon/icon_tokens.a11y.js +40 -0
- package/optimize/lib/components/image/image.a11y.js +61 -0
- package/optimize/lib/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/optimize/lib/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/optimize/lib/components/popover/popover.js +2 -2
- package/optimize/lib/components/selectable/selectable.js +2 -2
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +15 -4
- package/optimize/lib/components/tabs/tab.js +15 -5
- package/optimize/lib/components/tabs/tabs.js +8 -14
- package/optimize/lib/components/tabs/tabs_context.js +23 -0
- package/optimize/lib/services/color/manipulation.js +14 -2
- package/optimize/lib/services/index.js +65 -58
- package/package.json +4 -6
- package/src/components/color_picker/_index.scss +0 -1
- package/src/components/date_picker/super_date_picker/quick_select_popover/_quick_select_popover.scss +14 -0
- package/src/components/form/file_picker/_file_picker.scss +14 -14
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/basic_table/basic_table.js +2 -2
- package/test-env/components/basic_table/in_memory_table.js +3 -6
- package/test-env/components/basic_table/table.a11y.js +139 -0
- package/test-env/components/color_picker/color_picker.styles.js +26 -0
- package/test-env/components/color_picker/color_stops/color_stop_thumb.js +19 -6
- package/test-env/components/color_picker/color_stops/color_stop_thumb.styles.js +69 -0
- package/test-env/components/color_picker/color_stops/color_stops.js +25 -14
- package/test-env/components/color_picker/color_stops/color_stops.styles.js +73 -0
- package/test-env/components/date_picker/auto_refresh/refresh_interval.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/commonly_used_time_ranges.js +5 -2
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +3 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select_popover.js +153 -166
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/recently_used.js +5 -2
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +16 -0
- package/test-env/components/error_boundary/error_boundary.a11y.js +75 -0
- package/test-env/components/expression/expression.a11y.js +254 -0
- package/test-env/components/filter_group/filter_group.a11y.js +287 -0
- package/test-env/components/focus_trap/focus_trap.a11y.js +140 -0
- package/test-env/components/form/file_picker/file_picker.js +1 -0
- package/test-env/components/form/range/range_highlight.styles.js +1 -1
- package/test-env/components/form/range/range_levels.styles.js +1 -1
- package/test-env/components/form/range/range_track.js +6 -2
- package/test-env/components/header/header.a11y.js +385 -0
- package/test-env/components/icon/icon_ML.a11y.js +40 -0
- package/test-env/components/icon/icon_apps.a11y.js +40 -0
- package/test-env/components/icon/icon_editor.a11y.js +40 -0
- package/test-env/components/icon/icon_elastic.a11y.js +40 -0
- package/test-env/components/icon/icon_glyphs.a11y.js +40 -0
- package/test-env/components/icon/icon_tokens.a11y.js +40 -0
- package/test-env/components/image/image.a11y.js +61 -0
- package/test-env/components/key_pad_menu/key_pad_menu.a11y.js +163 -0
- package/test-env/components/markdown_editor/plugins/markdown_default_plugins/parsing_plugins.js +2 -2
- package/test-env/components/popover/popover.js +2 -2
- package/test-env/components/selectable/selectable.js +4 -3
- package/test-env/components/selectable/selectable_list/selectable_list.js +17 -5
- package/test-env/components/table/table_footer_cell.js +1 -1
- package/test-env/components/table/table_header_cell.js +1 -1
- package/test-env/components/table/table_row_cell.js +2 -2
- package/test-env/components/tabs/tab.js +15 -17
- package/test-env/components/tabs/tabbed_content/tabbed_content.js +0 -16
- package/test-env/components/tabs/tabs.js +8 -14
- package/test-env/components/tabs/tabs_context.js +23 -0
- package/test-env/services/color/manipulation.js +14 -2
- package/test-env/services/index.js +65 -58
- package/src/components/color_picker/color_stops/_color_stops.scss +0 -101
- package/src/components/color_picker/color_stops/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_color_stops.scss +0 -58
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["children", "disabled", "max", "min", "step", "showTicks", "tickInterval", "ticks", "levels", "onChange", "value", "compressed", "showRange"];
|
|
4
|
+
var _excluded = ["children", "disabled", "max", "min", "step", "showTicks", "tickInterval", "ticks", "levels", "onChange", "value", "compressed", "showRange", "className"];
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -11,6 +11,7 @@ var _excluded = ["children", "disabled", "max", "min", "step", "showTicks", "tic
|
|
|
11
11
|
* Side Public License, v 1.
|
|
12
12
|
*/
|
|
13
13
|
import React, { useState, useMemo, useEffect } from 'react';
|
|
14
|
+
import classNames from 'classnames';
|
|
14
15
|
import range from 'lodash/range';
|
|
15
16
|
import { useEuiTheme, isEvenlyDivisibleBy } from '../../../services';
|
|
16
17
|
import { EuiRangeLevels } from './range_levels';
|
|
@@ -31,6 +32,7 @@ export var EuiRangeTrack = function EuiRangeTrack(_ref) {
|
|
|
31
32
|
value = _ref.value,
|
|
32
33
|
compressed = _ref.compressed,
|
|
33
34
|
showRange = _ref.showRange,
|
|
35
|
+
className = _ref.className,
|
|
34
36
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
37
|
|
|
36
38
|
useEffect(function () {
|
|
@@ -90,8 +92,9 @@ export var EuiRangeTrack = function EuiRangeTrack(_ref) {
|
|
|
90
92
|
trackWidth = _useState2[0],
|
|
91
93
|
setTrackWidth = _useState2[1];
|
|
92
94
|
|
|
95
|
+
var classes = classNames('euiRangeTrack', className);
|
|
93
96
|
return ___EmotionJSX("div", _extends({
|
|
94
|
-
className:
|
|
97
|
+
className: classes,
|
|
95
98
|
css: cssStyles
|
|
96
99
|
}, rest, {
|
|
97
100
|
ref: function ref(node) {
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
/// <reference types="../../../cypress/support"/>
|
|
11
|
+
import React, { useState } from 'react';
|
|
12
|
+
import { EuiAvatar } from '../avatar';
|
|
13
|
+
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
14
|
+
import { EuiHeaderBreadcrumbs } from './header_breadcrumbs';
|
|
15
|
+
import { EuiHeader } from './header';
|
|
16
|
+
import { EuiHeaderLogo } from './header_logo';
|
|
17
|
+
import { EuiHeaderSectionItemButton, EuiHeaderSectionItem, EuiHeaderSection } from './header_section';
|
|
18
|
+
import { EuiIcon } from '../icon';
|
|
19
|
+
import { EuiKeyPadMenu, EuiKeyPadMenuItem } from '../key_pad_menu';
|
|
20
|
+
import { EuiLink } from '../link';
|
|
21
|
+
import { EuiPopover, EuiPopoverTitle } from '../popover';
|
|
22
|
+
import { EuiSelectable, EuiSelectableMessage, EuiSelectableTemplateSitewide } from '../selectable';
|
|
23
|
+
import { EuiSpacer } from '../spacer';
|
|
24
|
+
import { EuiText } from '../text';
|
|
25
|
+
import { useGeneratedHtmlId } from '../../services';
|
|
26
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
|
+
|
|
28
|
+
var Header = function Header() {
|
|
29
|
+
var renderLogo = function renderLogo() {
|
|
30
|
+
return ___EmotionJSX(EuiHeaderLogo, {
|
|
31
|
+
iconType: "logoElastic",
|
|
32
|
+
href: "#",
|
|
33
|
+
onClick: function onClick(e) {
|
|
34
|
+
return e.preventDefault();
|
|
35
|
+
},
|
|
36
|
+
"aria-label": "Go to home page"
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var renderBreadcrumbs = function renderBreadcrumbs() {
|
|
41
|
+
var breadcrumbs = [{
|
|
42
|
+
text: 'Management',
|
|
43
|
+
href: '#',
|
|
44
|
+
onClick: function onClick(e) {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
},
|
|
47
|
+
'data-test-subj': 'breadcrumbsAnimals',
|
|
48
|
+
className: 'customClass'
|
|
49
|
+
}, {
|
|
50
|
+
text: 'Truncation test is here for a really long item',
|
|
51
|
+
href: '#',
|
|
52
|
+
onClick: function onClick(e) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
text: 'Hidden',
|
|
57
|
+
'data-test-subj': 'cy-breadcrumb-hidden',
|
|
58
|
+
href: '#',
|
|
59
|
+
onClick: function onClick(e) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
text: 'Users',
|
|
64
|
+
href: '#',
|
|
65
|
+
onClick: function onClick(e) {
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
text: 'Create'
|
|
70
|
+
}];
|
|
71
|
+
return ___EmotionJSX(EuiHeaderBreadcrumbs, {
|
|
72
|
+
"aria-label": "Header breadcrumbs example",
|
|
73
|
+
breadcrumbs: breadcrumbs
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var search = ___EmotionJSX(EuiSelectableTemplateSitewide, {
|
|
78
|
+
options: [],
|
|
79
|
+
searchProps: {
|
|
80
|
+
compressed: true
|
|
81
|
+
},
|
|
82
|
+
popoverButton: ___EmotionJSX(EuiHeaderSectionItemButton, {
|
|
83
|
+
"aria-label": "Sitewide search"
|
|
84
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
85
|
+
type: "search",
|
|
86
|
+
size: "m"
|
|
87
|
+
})),
|
|
88
|
+
emptyMessage: ___EmotionJSX(EuiSelectableMessage, {
|
|
89
|
+
style: {
|
|
90
|
+
minHeight: 300
|
|
91
|
+
},
|
|
92
|
+
"data-test-subj": "cy-search-menu"
|
|
93
|
+
}, ___EmotionJSX("p", null, "Please see the component page for", ' ', ___EmotionJSX("strong", null, "EuiSelectableTemplateSitewide"), "on how to configure your sitewide search."))
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return ___EmotionJSX(EuiHeader, null, ___EmotionJSX(EuiHeaderSection, {
|
|
97
|
+
grow: false
|
|
98
|
+
}, ___EmotionJSX(EuiHeaderSectionItem, {
|
|
99
|
+
border: "right"
|
|
100
|
+
}, renderLogo()), ___EmotionJSX(EuiHeaderSectionItem, {
|
|
101
|
+
border: "right"
|
|
102
|
+
}, ___EmotionJSX(HeaderSpacesMenu, null))), renderBreadcrumbs(), ___EmotionJSX(EuiHeaderSection, {
|
|
103
|
+
side: "right"
|
|
104
|
+
}, ___EmotionJSX(EuiHeaderSectionItem, null, search), ___EmotionJSX(EuiHeaderSectionItem, null, ___EmotionJSX(HeaderUserMenu, null)), ___EmotionJSX(EuiHeaderSectionItem, null, ___EmotionJSX(HeaderAppMenu, null))));
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
var HeaderUserMenu = function HeaderUserMenu() {
|
|
108
|
+
var headerUserPopoverId = useGeneratedHtmlId({
|
|
109
|
+
prefix: 'headerUserPopover'
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
var _useState = useState(false),
|
|
113
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
114
|
+
isOpen = _useState2[0],
|
|
115
|
+
setIsOpen = _useState2[1];
|
|
116
|
+
|
|
117
|
+
var onMenuButtonClick = function onMenuButtonClick() {
|
|
118
|
+
setIsOpen(!isOpen);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
var closeMenu = function closeMenu() {
|
|
122
|
+
setIsOpen(false);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
var button = ___EmotionJSX(EuiHeaderSectionItemButton, {
|
|
126
|
+
"aria-controls": headerUserPopoverId,
|
|
127
|
+
"aria-expanded": isOpen,
|
|
128
|
+
"aria-haspopup": "true",
|
|
129
|
+
"aria-label": "Account menu",
|
|
130
|
+
onClick: onMenuButtonClick
|
|
131
|
+
}, ___EmotionJSX(EuiAvatar, {
|
|
132
|
+
name: "John Username",
|
|
133
|
+
size: "s"
|
|
134
|
+
}));
|
|
135
|
+
|
|
136
|
+
return ___EmotionJSX(EuiPopover, {
|
|
137
|
+
id: headerUserPopoverId,
|
|
138
|
+
button: button,
|
|
139
|
+
isOpen: isOpen,
|
|
140
|
+
anchorPosition: "downRight",
|
|
141
|
+
closePopover: closeMenu,
|
|
142
|
+
panelPaddingSize: "none",
|
|
143
|
+
"data-test-subj": "cy-account-menu"
|
|
144
|
+
}, ___EmotionJSX("div", {
|
|
145
|
+
style: {
|
|
146
|
+
width: 320
|
|
147
|
+
}
|
|
148
|
+
}, ___EmotionJSX(EuiFlexGroup, {
|
|
149
|
+
gutterSize: "m",
|
|
150
|
+
className: "euiHeaderProfile",
|
|
151
|
+
responsive: false
|
|
152
|
+
}, ___EmotionJSX(EuiFlexItem, {
|
|
153
|
+
grow: false
|
|
154
|
+
}, ___EmotionJSX(EuiAvatar, {
|
|
155
|
+
name: "John Username",
|
|
156
|
+
size: "xl"
|
|
157
|
+
})), ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiText, null, ___EmotionJSX("p", null, "John Username")), ___EmotionJSX(EuiSpacer, {
|
|
158
|
+
size: "m"
|
|
159
|
+
}), ___EmotionJSX(EuiFlexGroup, null, ___EmotionJSX(EuiFlexItem, null, ___EmotionJSX(EuiFlexGroup, {
|
|
160
|
+
justifyContent: "spaceBetween"
|
|
161
|
+
}, ___EmotionJSX(EuiFlexItem, {
|
|
162
|
+
grow: false
|
|
163
|
+
}, ___EmotionJSX(EuiLink, null, "Edit profile")), ___EmotionJSX(EuiFlexItem, {
|
|
164
|
+
grow: false
|
|
165
|
+
}, ___EmotionJSX(EuiLink, null, "Log out")))))))));
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
var HeaderSpacesMenu = function HeaderSpacesMenu() {
|
|
169
|
+
var headerSpacesPopoverId = useGeneratedHtmlId({
|
|
170
|
+
prefix: 'headerSpacesPopover'
|
|
171
|
+
});
|
|
172
|
+
var spacesValues = [{
|
|
173
|
+
label: 'Sales team',
|
|
174
|
+
prepend: ___EmotionJSX(EuiAvatar, {
|
|
175
|
+
type: "space",
|
|
176
|
+
name: "Sales Team",
|
|
177
|
+
size: "s"
|
|
178
|
+
}),
|
|
179
|
+
checked: 'on'
|
|
180
|
+
}, {
|
|
181
|
+
label: 'Engineering',
|
|
182
|
+
prepend: ___EmotionJSX(EuiAvatar, {
|
|
183
|
+
type: "space",
|
|
184
|
+
name: "Engineering",
|
|
185
|
+
size: "s"
|
|
186
|
+
})
|
|
187
|
+
}];
|
|
188
|
+
|
|
189
|
+
var _useState3 = useState(spacesValues),
|
|
190
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
191
|
+
spaces = _useState4[0],
|
|
192
|
+
setSpaces = _useState4[1];
|
|
193
|
+
|
|
194
|
+
var _useState5 = useState(spaces.filter(function (option) {
|
|
195
|
+
return option.checked;
|
|
196
|
+
})[0]),
|
|
197
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
198
|
+
selectedSpace = _useState6[0],
|
|
199
|
+
setSelectedSpace = _useState6[1];
|
|
200
|
+
|
|
201
|
+
var _useState7 = useState(false),
|
|
202
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
203
|
+
isOpen = _useState8[0],
|
|
204
|
+
setIsOpen = _useState8[1];
|
|
205
|
+
|
|
206
|
+
var isListExtended = function isListExtended() {
|
|
207
|
+
return spaces.length > 4 ? true : false;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
var onMenuButtonClick = function onMenuButtonClick() {
|
|
211
|
+
setIsOpen(!isOpen);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
var closePopover = function closePopover() {
|
|
215
|
+
setIsOpen(false);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
var onChange = function onChange(options) {
|
|
219
|
+
setSpaces(options);
|
|
220
|
+
setSelectedSpace(options.filter(function (option) {
|
|
221
|
+
return option.checked;
|
|
222
|
+
})[0]);
|
|
223
|
+
setIsOpen(false);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
var button = ___EmotionJSX(EuiHeaderSectionItemButton, {
|
|
227
|
+
"aria-controls": headerSpacesPopoverId,
|
|
228
|
+
"aria-expanded": isOpen,
|
|
229
|
+
"aria-haspopup": "true",
|
|
230
|
+
"aria-label": "Spaces menu",
|
|
231
|
+
onClick: onMenuButtonClick
|
|
232
|
+
}, selectedSpace.prepend);
|
|
233
|
+
|
|
234
|
+
return ___EmotionJSX(EuiPopover, {
|
|
235
|
+
id: headerSpacesPopoverId,
|
|
236
|
+
button: button,
|
|
237
|
+
isOpen: isOpen,
|
|
238
|
+
anchorPosition: "downLeft",
|
|
239
|
+
closePopover: closePopover,
|
|
240
|
+
panelPaddingSize: "none"
|
|
241
|
+
}, ___EmotionJSX(EuiSelectable, {
|
|
242
|
+
searchable: isListExtended(),
|
|
243
|
+
searchProps: {
|
|
244
|
+
placeholder: 'Find a space',
|
|
245
|
+
compressed: true
|
|
246
|
+
},
|
|
247
|
+
options: spaces,
|
|
248
|
+
singleSelection: "always",
|
|
249
|
+
style: {
|
|
250
|
+
width: 300
|
|
251
|
+
},
|
|
252
|
+
onChange: onChange,
|
|
253
|
+
listProps: {
|
|
254
|
+
rowHeight: 40,
|
|
255
|
+
showIcons: false
|
|
256
|
+
},
|
|
257
|
+
"data-test-subj": "cy-spaces-menu"
|
|
258
|
+
}, function (list, search) {
|
|
259
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiPopoverTitle, {
|
|
260
|
+
paddingSize: "s"
|
|
261
|
+
}, search || 'Your spaces'), list);
|
|
262
|
+
}));
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
var HeaderAppMenu = function HeaderAppMenu() {
|
|
266
|
+
var headerAppPopoverId = useGeneratedHtmlId({
|
|
267
|
+
prefix: 'headerAppPopover'
|
|
268
|
+
});
|
|
269
|
+
var headerAppKeyPadMenuId = useGeneratedHtmlId({
|
|
270
|
+
prefix: 'headerAppKeyPadMenu'
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
var _useState9 = useState(false),
|
|
274
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
275
|
+
isOpen = _useState10[0],
|
|
276
|
+
setIsOpen = _useState10[1];
|
|
277
|
+
|
|
278
|
+
var onMenuButtonClick = function onMenuButtonClick() {
|
|
279
|
+
setIsOpen(!isOpen);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
var closeMenu = function closeMenu() {
|
|
283
|
+
setIsOpen(false);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
var button = ___EmotionJSX(EuiHeaderSectionItemButton, {
|
|
287
|
+
"aria-controls": headerAppKeyPadMenuId,
|
|
288
|
+
"aria-expanded": isOpen,
|
|
289
|
+
"aria-haspopup": "true",
|
|
290
|
+
"aria-label": "Apps menu with 1 new app",
|
|
291
|
+
notification: "1",
|
|
292
|
+
onClick: onMenuButtonClick
|
|
293
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
294
|
+
type: "apps",
|
|
295
|
+
size: "m"
|
|
296
|
+
}));
|
|
297
|
+
|
|
298
|
+
return ___EmotionJSX(EuiPopover, {
|
|
299
|
+
id: headerAppPopoverId,
|
|
300
|
+
button: button,
|
|
301
|
+
isOpen: isOpen,
|
|
302
|
+
anchorPosition: "downRight",
|
|
303
|
+
closePopover: closeMenu
|
|
304
|
+
}, ___EmotionJSX(EuiKeyPadMenu, {
|
|
305
|
+
id: headerAppKeyPadMenuId,
|
|
306
|
+
style: {
|
|
307
|
+
width: 288
|
|
308
|
+
},
|
|
309
|
+
"data-test-subj": "cy-apps-menu"
|
|
310
|
+
}, ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
311
|
+
label: "Discover"
|
|
312
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
313
|
+
type: "discoverApp",
|
|
314
|
+
size: "l"
|
|
315
|
+
})), ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
316
|
+
label: "Dashboard"
|
|
317
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
318
|
+
type: "dashboardApp",
|
|
319
|
+
size: "l"
|
|
320
|
+
})), ___EmotionJSX(EuiKeyPadMenuItem, {
|
|
321
|
+
label: "Dev Tools"
|
|
322
|
+
}, ___EmotionJSX(EuiIcon, {
|
|
323
|
+
type: "devToolsApp",
|
|
324
|
+
size: "l"
|
|
325
|
+
}))));
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
beforeEach(function () {
|
|
329
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
330
|
+
|
|
331
|
+
cy.realMount(___EmotionJSX(Header, null));
|
|
332
|
+
});
|
|
333
|
+
describe('EuiHeader', function () {
|
|
334
|
+
describe('Automated accessibility check', function () {
|
|
335
|
+
it('has zero violations on first render', function () {
|
|
336
|
+
cy.checkAxe();
|
|
337
|
+
});
|
|
338
|
+
it('has zero violations when Spaces menu is expanded', function () {
|
|
339
|
+
cy.get('button[aria-label="Spaces menu"]').realClick();
|
|
340
|
+
cy.get('div[data-test-subj="cy-spaces-menu"]').should('exist');
|
|
341
|
+
cy.checkAxe();
|
|
342
|
+
});
|
|
343
|
+
it('has zero violations when Account menu is expanded', function () {
|
|
344
|
+
cy.get('button[aria-label="Account menu"]').realClick();
|
|
345
|
+
cy.get('div[data-test-subj="cy-account-menu"]').should('exist');
|
|
346
|
+
cy.checkAxe();
|
|
347
|
+
});
|
|
348
|
+
it('has zero violations when Sitewide search is expanded', function () {
|
|
349
|
+
cy.get('button[aria-label="Sitewide search"]').realClick();
|
|
350
|
+
cy.get('div[data-test-subj="cy-search-menu"]').should('exist');
|
|
351
|
+
cy.checkAxe();
|
|
352
|
+
});
|
|
353
|
+
it('has zero violations when Apps menu is expanded', function () {
|
|
354
|
+
cy.get('button[aria-label="Apps menu with 1 new app"]').realClick();
|
|
355
|
+
cy.get('ul[data-test-subj="cy-apps-menu"]').should('exist');
|
|
356
|
+
cy.checkAxe();
|
|
357
|
+
});
|
|
358
|
+
it('has zero violations when a hidden breadcrumb is expanded', function () {
|
|
359
|
+
cy.get('button[aria-label="See collapsed breadcrumbs"]').realClick();
|
|
360
|
+
cy.get('a[data-test-subj="cy-breadcrumb-hidden"]').should('exist');
|
|
361
|
+
cy.checkAxe();
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiIcon } from './icon';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
describe('EuiIcons', function () {
|
|
13
|
+
describe('Automated accessibility check for ML icons', function () {
|
|
14
|
+
var MLIcons = ['dataVisualizer', 'createAdvancedJob', 'classificationJob', 'createMultiMetricJob', 'outlierDetectionJob', 'createPopulationJob', 'regressionJob', 'createSingleMetricJob'];
|
|
15
|
+
|
|
16
|
+
var MLGrid = function MLGrid() {
|
|
17
|
+
return ___EmotionJSX("div", null, MLIcons.map(function (glyph) {
|
|
18
|
+
return ___EmotionJSX(EuiIcon, {
|
|
19
|
+
className: "eui-alignMiddle",
|
|
20
|
+
type: glyph
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('has zero violations on first render', function () {
|
|
26
|
+
cy.mount(___EmotionJSX(MLGrid, null));
|
|
27
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
28
|
+
timeout: 5000
|
|
29
|
+
}).should('have.length', 8);
|
|
30
|
+
cy.checkAxe();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiIcon } from './icon';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
describe('EuiIcons', function () {
|
|
13
|
+
describe('Automated accessibility check for app icons', function () {
|
|
14
|
+
var AppIcons = ['addDataApp', 'advancedSettingsApp', 'agentApp', 'apmApp', 'appSearchApp', 'auditbeatApp', 'canvasApp', 'casesApp', 'codeApp', 'consoleApp', 'crossClusterReplicationApp', 'dashboardApp', 'devToolsApp', 'discoverApp', 'emsApp', 'filebeatApp', 'fleetApp', 'gisApp', 'graphApp', 'grokApp', 'heartbeatApp', 'indexManagementApp', 'indexPatternApp', 'indexRollupApp', 'lensApp', 'logsApp', 'machineLearningApp', 'managementApp', 'metricbeatApp', 'metricsApp', 'monitoringApp', 'notebookApp', 'packetbeatApp', 'pipelineApp', 'recentlyViewedApp', 'reportingApp', 'savedObjectsApp', 'searchProfilerApp', 'securityAnalyticsApp', 'securityApp', 'spacesApp', 'sqlApp', 'timelionApp', 'upgradeAssistantApp', 'uptimeApp', 'usersRolesApp', 'visualizeApp', 'watchesApp', 'workplaceSearchApp'];
|
|
15
|
+
|
|
16
|
+
var AppGrid = function AppGrid() {
|
|
17
|
+
return ___EmotionJSX("div", null, AppIcons.map(function (glyph) {
|
|
18
|
+
return ___EmotionJSX(EuiIcon, {
|
|
19
|
+
className: "eui-alignMiddle",
|
|
20
|
+
type: glyph
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('has zero violations on first render', function () {
|
|
26
|
+
cy.mount(___EmotionJSX(AppGrid, null));
|
|
27
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
28
|
+
timeout: 5000
|
|
29
|
+
}).should('have.length', 49);
|
|
30
|
+
cy.checkAxe();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiIcon } from './icon';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
describe('EuiIcons', function () {
|
|
13
|
+
describe('Automated accessibility check for editor icons', function () {
|
|
14
|
+
var EditorIcons = ['editorAlignCenter', 'editorAlignLeft', 'editorAlignRight', 'editorBold', 'editorChecklist', 'editorCodeBlock', 'editorComment', 'editorDistributeHorizontal', 'editorDistributeVertical', 'editorHeading', 'editorItalic', 'editorItemAlignBottom', 'editorItemAlignCenter', 'editorItemAlignLeft', 'editorItemAlignMiddle', 'editorItemAlignRight', 'editorItemAlignTop', 'editorLink', 'editorOrderedList', 'editorPositionBottomLeft', 'editorPositionBottomRight', 'editorPositionTopLeft', 'editorPositionTopRight', 'editorRedo', 'editorStrike', 'editorTable', 'editorUnderline', 'editorUndo', 'editorUnorderedList'];
|
|
15
|
+
|
|
16
|
+
var EditorGrid = function EditorGrid() {
|
|
17
|
+
return ___EmotionJSX("div", null, EditorIcons.map(function (glyph) {
|
|
18
|
+
return ___EmotionJSX(EuiIcon, {
|
|
19
|
+
className: "eui-alignMiddle",
|
|
20
|
+
type: glyph
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('has zero violations on first render', function () {
|
|
26
|
+
cy.mount(___EmotionJSX(EditorGrid, null));
|
|
27
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
28
|
+
timeout: 5000
|
|
29
|
+
}).should('have.length', 29);
|
|
30
|
+
cy.checkAxe();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiIcon } from './icon';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
describe('EuiIcons', function () {
|
|
13
|
+
describe('Automated accessibility check for Elastic logos', function () {
|
|
14
|
+
var ElasticLogos = ['logoElastic', 'logoElasticStack', 'logoElasticsearch', 'logoAppSearch', 'logoBeats', 'logoBusinessAnalytics', 'logoCloud', 'logoCloudEnterprise', 'logoEnterpriseSearch', 'logoKibana', 'logoLogging', 'logoLogstash', 'logoMaps', 'logoMetrics', 'logoObservability', 'logoSecurity', 'logoSiteSearch', 'logoUptime', 'logoWorkplaceSearch'];
|
|
15
|
+
|
|
16
|
+
var ElasticGrid = function ElasticGrid() {
|
|
17
|
+
return ___EmotionJSX("div", null, ElasticLogos.map(function (glyph) {
|
|
18
|
+
return ___EmotionJSX(EuiIcon, {
|
|
19
|
+
className: "eui-alignMiddle",
|
|
20
|
+
type: glyph
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('has zero violations on first render', function () {
|
|
26
|
+
cy.mount(___EmotionJSX(ElasticGrid, null));
|
|
27
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
28
|
+
timeout: 5000
|
|
29
|
+
}).should('have.length', 19);
|
|
30
|
+
cy.checkAxe();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiIcon } from './icon';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
describe('EuiIcons', function () {
|
|
13
|
+
describe('Automated accessibility check for glyph icons', function () {
|
|
14
|
+
var GlyphIcons = ['accessibility', 'aggregate', 'alert', 'analyzeEvent', 'annotation', 'apmTrace', 'apps', 'arrowDown', 'arrowLeft', 'arrowRight', 'arrowUp', 'arrowStart', 'arrowEnd', 'article', 'asterisk', 'beaker', 'bell', 'bellSlash', 'beta', 'bolt', 'boxesHorizontal', 'boxesVertical', 'branch', 'branchUser', 'broom', 'brush', 'bug', 'bullseye', 'calendar', 'check', 'checkInCircleFilled', 'cheer', 'clock', 'cloudDrizzle', 'cloudStormy', 'cloudSunny', 'cluster', 'color', 'compute', 'console', 'container', 'continuityAbove', 'continuityAboveBelow', 'continuityBelow', 'continuityWithin', 'controlsHorizontal', 'controlsVertical', 'copy', 'copyClipboard', 'cross', 'crosshairs', 'crossInACircleFilled', 'currency', 'cut', 'database', 'desktop', 'discuss', 'document', 'documents', 'documentEdit', 'documentation', 'dot', 'dotInCircle', 'doubleArrowLeft', 'doubleArrowRight', 'download', 'email', 'empty', 'eql', 'eraser', 'exit', 'expand', 'expandMini', 'exportAction', 'eye', 'eyeClosed', 'faceHappy', 'faceNeutral', 'faceSad', 'filter', 'filterExclude', 'filterIgnore', 'filterInclude', 'filterInCircle', 'flag', 'fold', 'folderCheck', 'folderClosed', 'folderExclamation', 'folderOpen', 'frameNext', 'framePrevious', 'fullScreen', 'fullScreenExit', 'function', 'gear', 'glasses', 'globe', 'grab', 'grabHorizontal', 'grid', 'heart', 'heatmap', 'help', 'home', 'iInCircle', 'image', 'importAction', 'indexClose', 'indexEdit', 'indexFlush', 'indexMapping', 'indexOpen', 'indexRuntime', 'indexSettings', 'indexTemporary', 'infinity', 'inputOutput', 'inspect', 'invert', 'ip', 'keyboard', 'kqlField', 'kqlFunction', 'kqlOperand', 'kqlSelector', 'kqlValue', 'kubernetesNode', 'kubernetesPod', 'launch', 'layers', 'lettering', 'lineDashed', 'lineDotted', 'lineSolid', 'link', 'list', 'listAdd', 'lock', 'lockOpen', 'logstashFilter', 'logstashIf', 'logstashInput', 'logstashOutput', 'logstashQueue', 'magnifyWithExclamation', 'magnifyWithMinus', 'magnifyWithPlus', 'magnet', 'mapMarker', 'memory', 'merge', 'menu', 'menuDown', 'menuLeft', 'menuRight', 'menuUp', 'minimize', 'minus', 'minusInCircle', 'minusInCircleFilled', 'mobile', 'moon', 'namespace', 'nested', 'node', 'number', 'offline', 'online', 'package', 'pageSelect', 'pagesSelect', 'paperClip', 'partial', 'pause', 'payment', 'pencil', 'percent', 'pin', 'pinFilled', 'play', 'playFilled', 'plus', 'plusInCircle', 'plusInCircleFilled', 'popout', 'push', 'questionInCircle', 'quote', 'refresh', 'reporter', 'returnKey', 'save', 'scale', 'search', 'securitySignal', 'securitySignalDetected', 'securitySignalResolved', 'sessionViewer', 'shard', 'share', 'snowflake', 'sortable', 'sortAscending', 'sortDescending', 'sortDown', 'sortLeft', 'sortRight', 'sortUp', 'spaces', 'starEmpty', 'starEmptySpace', 'starFilled', 'starFilledSpace', 'starMinusEmpty', 'starMinusFilled', 'starPlusEmpty', 'starPlusFilled', 'stats', 'stop', 'stopFilled', 'stopSlash', 'storage', 'string', 'submodule', 'sun', 'symlink', 'tableOfContents', 'tableDensityExpanded', 'tableDensityCompact', 'tableDensityNormal', 'tag', 'tear', 'temperature', 'timeline', 'timeRefresh', 'timeslider', 'training', 'trash', 'unfold', 'unlink', 'user', 'userAvatar', 'users', 'vector', 'videoPlayer', 'visArea', 'visAreaStacked', 'visBarHorizontal', 'visBarHorizontalStacked', 'visBarVertical', 'visBarVerticalStacked', 'visGauge', 'visGoal', 'visLine', 'visMapCoordinate', 'visMapRegion', 'visMetric', 'visPie', 'visTable', 'visTagCloud', 'visText', 'visTimelion', 'visVega', 'visVisualBuilder', 'wordWrap', 'wordWrapDisabled', 'wrench'];
|
|
15
|
+
|
|
16
|
+
var GlyphGrid = function GlyphGrid() {
|
|
17
|
+
return ___EmotionJSX("div", null, GlyphIcons.map(function (glyph) {
|
|
18
|
+
return ___EmotionJSX(EuiIcon, {
|
|
19
|
+
className: "eui-alignMiddle",
|
|
20
|
+
type: glyph
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('has zero violations on first render', function () {
|
|
26
|
+
cy.mount(___EmotionJSX(GlyphGrid, null));
|
|
27
|
+
cy.get('svg[data-icon-type="wrench"]', {
|
|
28
|
+
timeout: 5000
|
|
29
|
+
}).should('exist');
|
|
30
|
+
cy.checkAxe();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiIcon } from './icon';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
describe('EuiIcons', function () {
|
|
13
|
+
describe('Automated accessibility check for token icons', function () {
|
|
14
|
+
var TokenIcons = ['tokenAlias', 'tokenAnnotation', 'tokenArray', 'tokenBinary', 'tokenBoolean', 'tokenClass', 'tokenCompletionSuggester', 'tokenConstant', 'tokenDate', 'tokenDenseVector', 'tokenElement', 'tokenEnum', 'tokenEnumMember', 'tokenEvent', 'tokenException', 'tokenField', 'tokenFile', 'tokenFlattened', 'tokenFunction', 'tokenGeo', 'tokenHistogram', 'tokenInterface', 'tokenIP', 'tokenJoin', 'tokenKey', 'tokenKeyword', 'tokenMethod', 'tokenMetricCounter', 'tokenMetricGauge', 'tokenModule', 'tokenNamespace', 'tokenNested', 'tokenNull', 'tokenNumber', 'tokenObject', 'tokenOperator', 'tokenPackage', 'tokenParameter', 'tokenPercolator', 'tokenProperty', 'tokenRange', 'tokenRankFeature', 'tokenRankFeatures', 'tokenRepo', 'tokenSearchType', 'tokenShape', 'tokenString', 'tokenStruct', 'tokenSymbol', 'tokenTag', 'tokenText', 'tokenTokenCount', 'tokenVariable'];
|
|
15
|
+
|
|
16
|
+
var TokenGrid = function TokenGrid() {
|
|
17
|
+
return ___EmotionJSX("div", null, TokenIcons.map(function (glyph) {
|
|
18
|
+
return ___EmotionJSX(EuiIcon, {
|
|
19
|
+
className: "eui-alignMiddle",
|
|
20
|
+
type: glyph
|
|
21
|
+
});
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('has zero violations on first render', function () {
|
|
26
|
+
cy.mount(___EmotionJSX(TokenGrid, null));
|
|
27
|
+
cy.get('div[data-cy-root]').find('svg', {
|
|
28
|
+
timeout: 5000
|
|
29
|
+
}).should('have.length', 53);
|
|
30
|
+
cy.checkAxe();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="../../../cypress/support"/>
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { EuiImage } from './image';
|
|
11
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
|
|
13
|
+
var Image = function Image() {
|
|
14
|
+
return ___EmotionJSX(EuiImage, {
|
|
15
|
+
size: "m",
|
|
16
|
+
hasShadow: true,
|
|
17
|
+
allowFullScreen: true,
|
|
18
|
+
caption: "Albert Einstein, theoretical physicist",
|
|
19
|
+
alt: "" // Because this image is sufficiently described by its caption, there is no need to repeat it via alt text
|
|
20
|
+
,
|
|
21
|
+
src: "https://upload.wikimedia.org/wikipedia/commons/d/d3/Albert_Einstein_Head.jpg"
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
beforeEach(function () {
|
|
26
|
+
cy.viewport(1024, 768); // medium breakpoint
|
|
27
|
+
|
|
28
|
+
cy.realMount(___EmotionJSX(Image, null));
|
|
29
|
+
cy.get('figure[aria-label="Albert Einstein, theoretical physicist"]').should('exist');
|
|
30
|
+
});
|
|
31
|
+
describe('EuiImage', function () {
|
|
32
|
+
describe('Automated accessibility check', function () {
|
|
33
|
+
it('has zero violations on first render', function () {
|
|
34
|
+
cy.checkAxe();
|
|
35
|
+
});
|
|
36
|
+
it('has zero violations on fullscreen render', function () {
|
|
37
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').realClick();
|
|
38
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('exist');
|
|
39
|
+
cy.checkAxe();
|
|
40
|
+
cy.get('div[data-test-subj="fullScreenOverlayMask"]').realClick();
|
|
41
|
+
cy.checkAxe();
|
|
42
|
+
});
|
|
43
|
+
it('has zero violations on keyboard interaction', function () {
|
|
44
|
+
cy.realPress('Tab');
|
|
45
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').should('have.focus');
|
|
46
|
+
cy.realPress('Enter');
|
|
47
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('exist');
|
|
48
|
+
cy.get('button[data-test-subj="deactivateFullScreenButton"]').should('have.focus');
|
|
49
|
+
cy.checkAxe();
|
|
50
|
+
cy.realPress('Escape');
|
|
51
|
+
cy.get('button[data-test-subj="activateFullScreenButton"]').should('have.focus');
|
|
52
|
+
cy.checkAxe();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|