@elastic/eui 60.0.0 → 60.1.2
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/README.md +7 -0
- package/dist/eui_charts_theme.js +330 -330
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +0 -445
- package/dist/eui_theme_dark.json +7 -44
- package/dist/eui_theme_dark.json.d.ts +7 -44
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -445
- package/dist/eui_theme_light.json +7 -44
- package/dist/eui_theme_light.json.d.ts +7 -44
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/screen_reader_live/screen_reader_live.js +30 -7
- package/es/components/accessibility/screen_reader_only/screen_reader_only.js +14 -19
- package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
- package/es/components/accessibility/skip_link/skip_link.js +20 -4
- package/es/components/avatar/avatar.js +2 -2
- package/es/components/badge/badge.js +1 -1
- package/es/components/button/button_icon/button_icon.js +1 -1
- package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/es/components/datagrid/body/data_grid_body.js +6 -6
- package/es/components/datagrid/body/data_grid_cell.js +12 -12
- package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/es/components/datagrid/body/header/data_grid_header_row.js +6 -6
- package/es/components/datagrid/data_grid.js +6 -6
- package/es/components/datagrid/utils/in_memory.js +6 -6
- package/es/components/date_picker/date_picker.js +1 -1
- package/es/components/empty_prompt/empty_prompt.js +1 -1
- package/es/components/form/field_text/field_text.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout.js +1 -1
- package/es/components/form/form_control_layout/form_control_layout_icons.js +1 -1
- package/es/components/health/health.js +1 -1
- package/es/components/icon/icon.js +43 -495
- package/es/components/icon/icon.styles.js +75 -0
- package/es/components/icon/icon_map.js +455 -0
- package/es/components/icon/named_colors.js +2 -13
- package/es/components/list_group/list_group.js +1 -1
- package/es/components/list_group/list_group_item.js +1 -1
- package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
- package/es/components/notification/notification_event.js +2 -2
- package/es/components/notification/notification_event_meta.js +1 -1
- package/es/components/notification/notification_event_read_button.js +1 -1
- package/es/components/panel/panel.js +2 -1
- package/es/components/progress/progress.js +34 -87
- package/es/components/progress/progress.styles.js +155 -0
- package/es/components/selectable/selectable_list/selectable_list.js +3 -1
- package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -2
- package/es/components/text/text.js +2 -0
- package/es/components/tool_tip/icon_tip.js +1 -1
- package/es/global_styling/utility/utility.js +3 -1
- package/es/services/theme/hooks.js +2 -0
- package/eui.d.ts +393 -453
- package/i18ntokens.json +2 -2
- package/lib/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.js +22 -19
- package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
- package/lib/components/accessibility/skip_link/skip_link.js +21 -4
- package/lib/components/avatar/avatar.js +2 -2
- package/lib/components/badge/badge.js +1 -1
- package/lib/components/button/button_icon/button_icon.js +1 -1
- package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/lib/components/datagrid/body/data_grid_body.js +6 -6
- package/lib/components/datagrid/body/data_grid_cell.js +12 -12
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -6
- package/lib/components/datagrid/data_grid.js +6 -6
- package/lib/components/datagrid/utils/focus.js +1 -0
- package/lib/components/datagrid/utils/in_memory.js +6 -6
- package/lib/components/date_picker/date_picker.js +1 -1
- package/lib/components/empty_prompt/empty_prompt.js +1 -1
- package/lib/components/form/field_text/field_text.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout.js +1 -1
- package/lib/components/form/form_control_layout/form_control_layout_icons.js +1 -1
- package/lib/components/health/health.js +1 -1
- package/lib/components/icon/icon.js +54 -499
- package/lib/components/icon/icon.styles.js +79 -0
- package/lib/components/icon/icon_map.js +463 -0
- package/lib/components/icon/named_colors.js +4 -15
- package/lib/components/list_group/list_group.js +1 -1
- package/lib/components/list_group/list_group_item.js +1 -1
- package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
- package/lib/components/notification/notification_event.js +2 -2
- package/lib/components/notification/notification_event_meta.js +1 -1
- package/lib/components/notification/notification_event_read_button.js +1 -1
- package/lib/components/panel/panel.js +2 -1
- package/lib/components/progress/progress.js +36 -88
- package/lib/components/progress/progress.styles.js +166 -0
- package/lib/components/selectable/selectable_list/selectable_list.js +3 -1
- package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
- package/lib/components/text/text.js +2 -0
- package/lib/components/tool_tip/icon_tip.js +1 -1
- package/lib/global_styling/utility/utility.js +5 -1
- package/lib/services/theme/hooks.js +2 -0
- package/optimize/es/components/accessibility/screen_reader_live/screen_reader_live.js +21 -6
- package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.js +11 -17
- package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
- package/optimize/es/components/accessibility/skip_link/skip_link.js +20 -4
- package/optimize/es/components/datagrid/utils/focus.js +1 -0
- package/optimize/es/components/icon/icon.js +40 -492
- package/optimize/es/components/icon/icon.styles.js +75 -0
- package/optimize/es/components/icon/icon_map.js +455 -0
- package/optimize/es/components/icon/named_colors.js +2 -13
- package/optimize/es/components/panel/panel.js +2 -1
- package/optimize/es/components/progress/progress.js +31 -84
- package/optimize/es/components/progress/progress.styles.js +155 -0
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +2 -0
- package/optimize/es/components/text/text.js +2 -0
- package/optimize/es/global_styling/utility/utility.js +3 -1
- package/optimize/es/services/theme/hooks.js +2 -0
- package/optimize/lib/components/accessibility/screen_reader_live/screen_reader_live.js +20 -5
- package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.js +18 -16
- package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
- package/optimize/lib/components/accessibility/skip_link/skip_link.js +21 -4
- package/optimize/lib/components/datagrid/utils/focus.js +1 -0
- package/optimize/lib/components/icon/icon.js +49 -494
- package/optimize/lib/components/icon/icon.styles.js +81 -0
- package/optimize/lib/components/icon/icon_map.js +463 -0
- package/optimize/lib/components/icon/named_colors.js +4 -15
- package/optimize/lib/components/panel/panel.js +2 -1
- package/optimize/lib/components/progress/progress.js +33 -85
- package/optimize/lib/components/progress/progress.styles.js +168 -0
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +2 -0
- package/optimize/lib/components/text/text.js +2 -0
- package/optimize/lib/global_styling/utility/utility.js +5 -1
- package/optimize/lib/services/theme/hooks.js +2 -0
- package/package.json +2 -2
- package/src/components/form/form_control_layout/_form_control_layout.scss +2 -4
- package/src/components/index.scss +0 -3
- package/src/global_styling/variables/_form.scss +9 -0
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.js +21 -18
- package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
- package/test-env/components/accessibility/skip_link/skip_link.js +21 -4
- package/test-env/components/avatar/avatar.js +2 -2
- package/test-env/components/badge/badge.js +1 -1
- package/test-env/components/button/button_icon/button_icon.js +1 -1
- package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
- package/test-env/components/datagrid/body/data_grid_body.js +6 -6
- package/test-env/components/datagrid/body/data_grid_cell.js +12 -12
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -6
- package/test-env/components/datagrid/data_grid.js +6 -6
- package/test-env/components/datagrid/utils/focus.js +1 -0
- package/test-env/components/datagrid/utils/in_memory.js +6 -6
- package/test-env/components/date_picker/date_picker.js +1 -1
- package/test-env/components/empty_prompt/empty_prompt.js +1 -1
- package/test-env/components/form/field_text/field_text.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout.js +1 -1
- package/test-env/components/form/form_control_layout/form_control_layout_icons.js +1 -1
- package/test-env/components/health/health.js +1 -1
- package/test-env/components/icon/icon.styles.js +81 -0
- package/test-env/components/icon/icon_map.js +463 -0
- package/test-env/components/icon/named_colors.js +4 -15
- package/test-env/components/list_group/list_group.js +1 -1
- package/test-env/components/list_group/list_group_item.js +1 -1
- package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
- package/test-env/components/notification/notification_event.js +2 -2
- package/test-env/components/notification/notification_event_meta.js +1 -1
- package/test-env/components/notification/notification_event_read_button.js +1 -1
- package/test-env/components/panel/panel.js +2 -1
- package/test-env/components/progress/progress.js +36 -88
- package/test-env/components/progress/progress.styles.js +168 -0
- package/test-env/components/selectable/selectable_list/selectable_list.js +3 -1
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
- package/test-env/components/text/text.js +2 -0
- package/test-env/components/tool_tip/icon_tip.js +1 -1
- package/test-env/global_styling/utility/utility.js +5 -1
- package/test-env/services/theme/hooks.js +2 -0
- package/src/components/accessibility/_index.scss +0 -1
- package/src/components/accessibility/screen_reader_only/_screen_reader_only.scss +0 -5
- package/src/components/icon/_icon.scss +0 -87
- package/src/components/icon/_index.scss +0 -2
- package/src/components/icon/_variables.scss +0 -22
- package/src/components/progress/_index.scss +0 -2
- package/src/components/progress/_progress.scss +0 -166
- package/src/components/progress/_variables.scss +0 -21
- package/src/themes/amsterdam/overrides/_progress.scss +0 -3
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
4
|
+
|
|
5
|
+
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)."; }
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
13
|
+
*/
|
|
14
|
+
import { css, keyframes } from '@emotion/react';
|
|
15
|
+
import { logicalCSS, logicalTextAlignCSS, euiCantAnimate, euiFontSize, euiTextTruncate } from '../../global_styling';
|
|
16
|
+
import { euiPaletteColorBlind, makeHighContrastColor } from '../../services';
|
|
17
|
+
import { euiText } from '../text/text.styles';
|
|
18
|
+
/**
|
|
19
|
+
* DRY utilities for native/determinate progress components vs non-native indeterminate
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
var crossBrowserProgressValue = function crossBrowserProgressValue(cssProperties) {
|
|
23
|
+
return "\n &::-webkit-progress-value {\n ".concat(cssProperties, "\n }\n &::-moz-progress-bar {\n ").concat(cssProperties, "\n }\n");
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var indeterminateProgressValue = function indeterminateProgressValue(cssProperties) {
|
|
27
|
+
return "\n &:before {\n ".concat(cssProperties, "\n }\n");
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Color utilities
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var visColors = euiPaletteColorBlind();
|
|
35
|
+
|
|
36
|
+
var nativeVsIndeterminateColor = function nativeVsIndeterminateColor(color, isNative) {
|
|
37
|
+
var selectors = isNative ? crossBrowserProgressValue : indeterminateProgressValue;
|
|
38
|
+
return selectors("background-color: ".concat(color, ";"));
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* DRY utils for non-static positions
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var nonStaticPositioning = function nonStaticPositioning(isNative) {
|
|
46
|
+
return "\n top: 0;\n left: 0;\n right: 0;\n background-color: transparent;\n ".concat(isNative ? "\n &::-webkit-progress-bar {\n background-color: transparent;\n }" : '', "\n");
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Animations
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
var euiIndeterminateAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scaleX(1) translateX(-100%);\n }\n 100% {\n transform: scaleX(1) translateX(100%);\n }\n"])));
|
|
54
|
+
/**
|
|
55
|
+
* Emotion styles
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
59
|
+
name: "187h6sp-static",
|
|
60
|
+
styles: "position:relative;label:static;"
|
|
61
|
+
} : {
|
|
62
|
+
name: "187h6sp-static",
|
|
63
|
+
styles: "position:relative;label:static;",
|
|
64
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
|
|
68
|
+
var euiTheme = _ref3.euiTheme;
|
|
69
|
+
return {
|
|
70
|
+
euiProgress: /*#__PURE__*/css("overflow:hidden;background-color:", euiTheme.colors.lightShade, ";;label:euiProgress;"),
|
|
71
|
+
// https://css-tricks.com/html5-progress-element/
|
|
72
|
+
// Good resource if you need to work in here. There's some gotchas with
|
|
73
|
+
// dealing with cross-browser progress bars.
|
|
74
|
+
native: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", crossBrowserProgressValue("transition: width ".concat(euiTheme.animation.normal, " linear;")), ";;label:native;"),
|
|
75
|
+
// An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
|
|
76
|
+
// we apply this style to a <div> instead of a <progress> element.
|
|
77
|
+
// See https://css-tricks.com/html5-progress-element/ for more info.
|
|
78
|
+
indeterminate: /*#__PURE__*/css("&:before{position:absolute;content:'';", logicalCSS('width', '100%'), " top:0;bottom:0;left:0;transform:scaleX(0) translateX(0%);animation:", euiIndeterminateAnimation, " 1s ", euiTheme.animation.resistance, " infinite;", euiCantAnimate, "{animation-duration:2s;animation-timing-function:linear;}};label:indeterminate;"),
|
|
79
|
+
// Sizes
|
|
80
|
+
xs: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.xxs), ";;label:xs;"),
|
|
81
|
+
s: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.xs), ";;label:s;"),
|
|
82
|
+
m: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.s), ";;label:m;"),
|
|
83
|
+
l: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.m), ";;label:l;"),
|
|
84
|
+
// Positioning
|
|
85
|
+
fixed: /*#__PURE__*/css("position:fixed;z-index:", Number(euiTheme.levels.header) + 1, ";", nonStaticPositioning(isNative), ";;label:fixed;"),
|
|
86
|
+
absolute: /*#__PURE__*/css("position:absolute;", nonStaticPositioning(isNative), ";;label:absolute;"),
|
|
87
|
+
static: _ref2,
|
|
88
|
+
// Colors
|
|
89
|
+
primary: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.primary, isNative), ";;label:primary;"),
|
|
90
|
+
success: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.success, isNative), ";;label:success;"),
|
|
91
|
+
warning: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.warning, isNative), ";;label:warning;"),
|
|
92
|
+
danger: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.danger, isNative), ";;label:danger;"),
|
|
93
|
+
subdued: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.subduedText, isNative), ";;label:subdued;"),
|
|
94
|
+
accent: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.accent, isNative), ";;label:accent;"),
|
|
95
|
+
vis0: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[0], isNative), ";;label:vis0;"),
|
|
96
|
+
vis1: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[1], isNative), ";;label:vis1;"),
|
|
97
|
+
vis2: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[2], isNative), ";;label:vis2;"),
|
|
98
|
+
vis3: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[3], isNative), ";;label:vis3;"),
|
|
99
|
+
vis4: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[4], isNative), ";;label:vis4;"),
|
|
100
|
+
vis5: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[5], isNative), ";;label:vis5;"),
|
|
101
|
+
vis6: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[6], isNative), ";;label:vis6;"),
|
|
102
|
+
vis7: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[7], isNative), ";;label:vis7;"),
|
|
103
|
+
vis8: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[8], isNative), ";;label:vis8;"),
|
|
104
|
+
vis9: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[9], isNative), ";;label:vis9;"),
|
|
105
|
+
customColor: /*#__PURE__*/css(nativeVsIndeterminateColor('currentColor', isNative), ";;label:customColor;")
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Data styles
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
export var euiProgressDataStyles = function euiProgressDataStyles(euiThemeContext) {
|
|
113
|
+
return {
|
|
114
|
+
euiProgress__data: /*#__PURE__*/css("display:flex;justify-content:space-between;gap:", euiThemeContext.euiTheme.size.xs, ";", euiText(euiThemeContext.euiTheme), " ", euiFontSize(euiThemeContext, 'xs'), ";;label:euiProgress__data;"),
|
|
115
|
+
// Sizes
|
|
116
|
+
l: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";;label:l;")
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
export var euiProgressLabelStyles = {
|
|
120
|
+
euiProgress__label: /*#__PURE__*/css("flex-grow:1;", euiTextTruncate(), ";;label:euiProgress__label;")
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
124
|
+
name: "15ioh86-customColor",
|
|
125
|
+
styles: "color:currentColor;label:customColor;"
|
|
126
|
+
} : {
|
|
127
|
+
name: "15ioh86-customColor",
|
|
128
|
+
styles: "color:currentColor;label:customColor;",
|
|
129
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export var euiProgressValueTextStyles = function euiProgressValueTextStyles(_ref4) {
|
|
133
|
+
var euiTheme = _ref4.euiTheme;
|
|
134
|
+
return {
|
|
135
|
+
euiProgress__valueText: /*#__PURE__*/css("flex-grow:1;flex-shrink:0;font-feature-settings:'tnum' 1;", logicalTextAlignCSS('right'), " ", euiTextTruncate(), ";;label:euiProgress__valueText;"),
|
|
136
|
+
// Colors
|
|
137
|
+
primary: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:primary;"),
|
|
138
|
+
success: /*#__PURE__*/css("color:", euiTheme.colors.successText, ";;label:success;"),
|
|
139
|
+
warning: /*#__PURE__*/css("color:", euiTheme.colors.warningText, ";;label:warning;"),
|
|
140
|
+
danger: /*#__PURE__*/css("color:", euiTheme.colors.dangerText, ";;label:danger;"),
|
|
141
|
+
subdued: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
|
|
142
|
+
accent: /*#__PURE__*/css("color:", euiTheme.colors.accentText, ";;label:accent;"),
|
|
143
|
+
vis0: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[0])(euiTheme), ";;label:vis0;"),
|
|
144
|
+
vis1: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[1])(euiTheme), ";;label:vis1;"),
|
|
145
|
+
vis2: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[2])(euiTheme), ";;label:vis2;"),
|
|
146
|
+
vis3: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[3])(euiTheme), ";;label:vis3;"),
|
|
147
|
+
vis4: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[4])(euiTheme), ";;label:vis4;"),
|
|
148
|
+
vis5: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[5])(euiTheme), ";;label:vis5;"),
|
|
149
|
+
vis6: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[6])(euiTheme), ";;label:vis6;"),
|
|
150
|
+
vis7: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[7])(euiTheme), ";;label:vis7;"),
|
|
151
|
+
vis8: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[8])(euiTheme), ";;label:vis8;"),
|
|
152
|
+
vis9: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[9])(euiTheme), ";;label:vis9;"),
|
|
153
|
+
customColor: _ref
|
|
154
|
+
};
|
|
155
|
+
};
|
|
@@ -154,6 +154,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
154
154
|
setActiveOptionIndex(index);
|
|
155
155
|
},
|
|
156
156
|
onClick: function onClick(event) {
|
|
157
|
+
event.persist(); // NOTE: This is needed for React v16 backwards compatibility
|
|
158
|
+
|
|
157
159
|
_this.onAddOrRemoveOption(option, event);
|
|
158
160
|
},
|
|
159
161
|
ref: ref ? ref.bind(null, index) : undefined,
|
|
@@ -41,6 +41,7 @@ export var EuiText = function EuiText(_ref) {
|
|
|
41
41
|
if (color) {
|
|
42
42
|
text = ___EmotionJSX(EuiTextColor, {
|
|
43
43
|
color: color,
|
|
44
|
+
className: classes,
|
|
44
45
|
cloneElement: true
|
|
45
46
|
}, text);
|
|
46
47
|
}
|
|
@@ -48,6 +49,7 @@ export var EuiText = function EuiText(_ref) {
|
|
|
48
49
|
if (textAlign) {
|
|
49
50
|
text = ___EmotionJSX(EuiTextAlign, {
|
|
50
51
|
textAlign: textAlign,
|
|
52
|
+
className: classes,
|
|
51
53
|
cloneElement: true
|
|
52
54
|
}, text);
|
|
53
55
|
}
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { Global, css } from '@emotion/react';
|
|
10
|
+
import { euiScreenReaderOnly } from '../../components/accessibility/screen_reader_only/screen_reader_only.styles';
|
|
10
11
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
+
var globalStyles = /*#__PURE__*/css(".euiScreenReaderOnly{", euiScreenReaderOnly(), ";};label:globalStyles;");
|
|
11
13
|
export var EuiUtilityClasses = function EuiUtilityClasses() {
|
|
12
14
|
return ___EmotionJSX(Global, {
|
|
13
|
-
styles:
|
|
15
|
+
styles: globalStyles
|
|
14
16
|
});
|
|
15
17
|
};
|
|
@@ -20,6 +20,8 @@ export var useEuiTheme = function useEuiTheme() {
|
|
|
20
20
|
modifications: modifications
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
+
// Provide the component props interface as the generic to allow the docs props table to populate.
|
|
24
|
+
// e.g., `const EuiComponent = withEuiTheme<EuiComponentProps>(_EuiComponent)`
|
|
23
25
|
export var withEuiTheme = function withEuiTheme(Component) {
|
|
24
26
|
var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
|
|
25
27
|
|
|
@@ -35,18 +35,26 @@ var EuiScreenReaderLive = function EuiScreenReaderLive(_ref) {
|
|
|
35
35
|
_ref$role = _ref.role,
|
|
36
36
|
role = _ref$role === void 0 ? 'status' : _ref$role,
|
|
37
37
|
_ref$ariaLive = _ref['aria-live'],
|
|
38
|
-
ariaLive = _ref$ariaLive === void 0 ? 'polite' : _ref$ariaLive
|
|
38
|
+
ariaLive = _ref$ariaLive === void 0 ? 'polite' : _ref$ariaLive,
|
|
39
|
+
_ref$focusRegionOnTex = _ref.focusRegionOnTextChange,
|
|
40
|
+
focusRegionOnTextChange = _ref$focusRegionOnTex === void 0 ? false : _ref$focusRegionOnTex;
|
|
39
41
|
|
|
40
42
|
var _useState = (0, _react.useState)(false),
|
|
41
43
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
44
|
toggle = _useState2[0],
|
|
43
45
|
setToggle = _useState2[1];
|
|
44
46
|
|
|
47
|
+
var focusRef = (0, _react.useRef)(null);
|
|
45
48
|
(0, _react.useEffect)(function () {
|
|
46
49
|
setToggle(function (toggle) {
|
|
47
50
|
return !toggle;
|
|
48
51
|
});
|
|
49
52
|
}, [children]);
|
|
53
|
+
(0, _react.useEffect)(function () {
|
|
54
|
+
if (focusRef.current !== null && focusRegionOnTextChange) {
|
|
55
|
+
focusRef.current.focus();
|
|
56
|
+
}
|
|
57
|
+
}, [toggle, focusRegionOnTextChange]);
|
|
50
58
|
return (
|
|
51
59
|
/**
|
|
52
60
|
* Intentionally uses two persistent live regions with oscillating content updates.
|
|
@@ -58,14 +66,21 @@ var EuiScreenReaderLive = function EuiScreenReaderLive(_ref) {
|
|
|
58
66
|
* See also https://github.com/AlmeroSteyn/react-aria-live and https://github.com/dequelabs/ngA11y
|
|
59
67
|
* for more examples of the double region approach.
|
|
60
68
|
*/
|
|
61
|
-
(0, _react2.jsx)(_screen_reader_only.EuiScreenReaderOnly, null, (0, _react2.jsx)("div",
|
|
69
|
+
(0, _react2.jsx)(_screen_reader_only.EuiScreenReaderOnly, null, (0, _react2.jsx)("div", {
|
|
70
|
+
ref: focusRef,
|
|
71
|
+
tabIndex: focusRegionOnTextChange ? -1 : undefined
|
|
72
|
+
}, (0, _react2.jsx)("div", {
|
|
62
73
|
role: role,
|
|
63
|
-
"aria-atomic": "true"
|
|
64
|
-
|
|
74
|
+
"aria-atomic": "true" // Setting `aria-hidden` and setting `aria-live` to "off" prevents
|
|
75
|
+
// double announcements from VO when `focusRegionOnTextChange` is true
|
|
76
|
+
,
|
|
77
|
+
"aria-hidden": toggle ? undefined : 'true',
|
|
78
|
+
"aria-live": focusRegionOnTextChange ? 'off' : ariaLive
|
|
65
79
|
}, isActive && toggle ? children : ''), (0, _react2.jsx)("div", {
|
|
66
80
|
role: role,
|
|
67
81
|
"aria-atomic": "true",
|
|
68
|
-
"aria-
|
|
82
|
+
"aria-hidden": !toggle ? undefined : 'true',
|
|
83
|
+
"aria-live": focusRegionOnTextChange ? 'off' : ariaLive
|
|
69
84
|
}, isActive && !toggle ? children : '')))
|
|
70
85
|
);
|
|
71
86
|
};
|
|
@@ -7,29 +7,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.EuiScreenReaderOnly = void 0;
|
|
9
9
|
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _react = require("react");
|
|
13
|
-
|
|
14
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
11
|
|
|
16
|
-
|
|
12
|
+
var _clone_element = require("../../../services/theme/clone_element");
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
var _screen_reader_only = require("./screen_reader_only.styles");
|
|
19
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
|
+
*/
|
|
20
23
|
var EuiScreenReaderOnly = function EuiScreenReaderOnly(_ref) {
|
|
21
24
|
var children = _ref.children,
|
|
25
|
+
className = _ref.className,
|
|
22
26
|
showOnFocus = _ref.showOnFocus;
|
|
23
|
-
var classes = (0, _classnames.default)(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return /*#__PURE__*/(0, _react.cloneElement)(children, props);
|
|
27
|
+
var classes = (0, _classnames.default)(className, children.props.className);
|
|
28
|
+
var styles = (0, _screen_reader_only.euiScreenReaderOnlyStyles)(showOnFocus);
|
|
29
|
+
var cssStyles = [styles.euiScreenReaderOnly];
|
|
30
|
+
var props = {
|
|
31
|
+
className: classes.length ? classes : undefined,
|
|
32
|
+
css: cssStyles
|
|
33
|
+
};
|
|
34
|
+
return (0, _clone_element.cloneElementWithCss)(children, props);
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
exports.EuiScreenReaderOnly = EuiScreenReaderOnly;
|
package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.euiScreenReaderOnly = void 0;
|
|
6
|
+
exports.euiScreenReaderOnlyStyles = exports.euiScreenReaderOnly = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
7
9
|
|
|
8
10
|
/*
|
|
9
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -20,5 +22,17 @@ exports.euiScreenReaderOnly = void 0;
|
|
|
20
22
|
var euiScreenReaderOnly = function euiScreenReaderOnly() {
|
|
21
23
|
return "\n // Take the element out of the layout\n position: absolute;\n // Keep it vertically inline\n top: auto;\n // Chrome requires a left value, and Selenium (used by Kibana's FTR) requires an off-screen position for its .getVisibleText() to not register SR-only text\n left: -10000px;\n // The element must have a size (for some screen readers)\n width: 1px;\n height: 1px;\n // But reduce the visible size to nothing\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n // And ensure no overflows occur\n overflow: hidden;\n // Chrome requires the negative margin to not cause overflows of parent containers\n margin: -1px;\n";
|
|
22
24
|
};
|
|
25
|
+
/*
|
|
26
|
+
* Styles
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
exports.euiScreenReaderOnly = euiScreenReaderOnly;
|
|
31
|
+
|
|
32
|
+
var euiScreenReaderOnlyStyles = function euiScreenReaderOnlyStyles(showOnFocus) {
|
|
33
|
+
return {
|
|
34
|
+
euiScreenReaderOnly: showOnFocus ? /*#__PURE__*/(0, _react.css)("&:not(:focus):not(:active){", euiScreenReaderOnly(), ";};label:euiScreenReaderOnly;") : /*#__PURE__*/(0, _react.css)(euiScreenReaderOnly(), ";label:euiScreenReaderOnly;")
|
|
35
|
+
};
|
|
36
|
+
};
|
|
23
37
|
|
|
24
|
-
exports.
|
|
38
|
+
exports.euiScreenReaderOnlyStyles = euiScreenReaderOnlyStyles;
|
|
@@ -17,6 +17,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
17
17
|
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
|
|
20
|
+
var _tabbable = require("tabbable");
|
|
21
|
+
|
|
20
22
|
var _services = require("../../../services");
|
|
21
23
|
|
|
22
24
|
var _button = require("../../button/button");
|
|
@@ -63,13 +65,28 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
63
65
|
onClick: function onClick(e) {
|
|
64
66
|
e.preventDefault();
|
|
65
67
|
var destinationEl = document.getElementById(destinationId);
|
|
66
|
-
if (!destinationEl) return;
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
if (!destinationEl) return; // Scroll to the top of the destination content only if it's ~mostly out of view
|
|
69
|
+
|
|
70
|
+
var destinationY = destinationEl.getBoundingClientRect().top;
|
|
71
|
+
var halfOfViewportHeight = window.innerHeight / 2;
|
|
72
|
+
|
|
73
|
+
if (destinationY >= halfOfViewportHeight || window.scrollY >= destinationY + halfOfViewportHeight) {
|
|
74
|
+
destinationEl.scrollIntoView();
|
|
75
|
+
} // Ensure the destination content is focusable
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if (!(0, _tabbable.isTabbable)(destinationEl)) {
|
|
79
|
+
destinationEl.tabIndex = -1;
|
|
80
|
+
destinationEl.addEventListener('blur', function () {
|
|
81
|
+
return destinationEl.removeAttribute('tabindex');
|
|
82
|
+
}, {
|
|
83
|
+
once: true
|
|
84
|
+
});
|
|
85
|
+
}
|
|
69
86
|
|
|
70
87
|
destinationEl.focus({
|
|
71
88
|
preventScroll: true
|
|
72
|
-
}); // Scrolling is already handled above, and focus
|
|
89
|
+
}); // Scrolling is already handled above, and focus autoscroll behaves oddly on Chrome around fixed headers
|
|
73
90
|
}
|
|
74
91
|
});
|
|
75
92
|
}
|