@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
|
@@ -18,64 +18,13 @@ import PropTypes from "prop-types";
|
|
|
18
18
|
import classNames from 'classnames';
|
|
19
19
|
import { EuiI18n } from '../i18n';
|
|
20
20
|
import { EuiInnerText } from '../inner_text';
|
|
21
|
-
import { keysOf } from '../common';
|
|
22
21
|
import { isNil } from '../../services/predicate';
|
|
22
|
+
import { useEuiTheme, makeHighContrastColor } from '../../services';
|
|
23
|
+
import { euiProgressStyles, euiProgressDataStyles, euiProgressLabelStyles, euiProgressValueTextStyles } from './progress.styles';
|
|
23
24
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
m: 'euiProgress--m',
|
|
28
|
-
l: 'euiProgress--l'
|
|
29
|
-
};
|
|
30
|
-
export var SIZES = keysOf(sizeToClassNameMap);
|
|
31
|
-
var colorToClassNameMap = {
|
|
32
|
-
primary: 'euiProgress--primary',
|
|
33
|
-
success: 'euiProgress--success',
|
|
34
|
-
warning: 'euiProgress--warning',
|
|
35
|
-
danger: 'euiProgress--danger',
|
|
36
|
-
subdued: 'euiProgress--subdued',
|
|
37
|
-
accent: 'euiProgress--accent',
|
|
38
|
-
vis0: 'euiProgress--vis0',
|
|
39
|
-
vis1: 'euiProgress--vis1',
|
|
40
|
-
vis2: 'euiProgress--vis2',
|
|
41
|
-
vis3: 'euiProgress--vis3',
|
|
42
|
-
vis4: 'euiProgress--vis4',
|
|
43
|
-
vis5: 'euiProgress--vis5',
|
|
44
|
-
vis6: 'euiProgress--vis6',
|
|
45
|
-
vis7: 'euiProgress--vis7',
|
|
46
|
-
vis8: 'euiProgress--vis8',
|
|
47
|
-
vis9: 'euiProgress--vis9'
|
|
48
|
-
};
|
|
49
|
-
export var COLORS = keysOf(colorToClassNameMap);
|
|
50
|
-
|
|
51
|
-
function isNamedColor(name) {
|
|
52
|
-
return colorToClassNameMap.hasOwnProperty(name);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
var dataColorToClassNameMap = {
|
|
56
|
-
primary: 'euiProgress__data--primary',
|
|
57
|
-
success: 'euiProgress__data--success',
|
|
58
|
-
warning: 'euiProgress__data--warning',
|
|
59
|
-
danger: 'euiProgress__data--danger',
|
|
60
|
-
subdued: 'euiProgress__data--subdued',
|
|
61
|
-
accent: 'euiProgress__data--accent',
|
|
62
|
-
vis0: 'euiProgress__data--vis0',
|
|
63
|
-
vis1: 'euiProgress__data--vis1',
|
|
64
|
-
vis2: 'euiProgress__data--vis2',
|
|
65
|
-
vis3: 'euiProgress__data--vis3',
|
|
66
|
-
vis4: 'euiProgress__data--vis4',
|
|
67
|
-
vis5: 'euiProgress__data--vis5',
|
|
68
|
-
vis6: 'euiProgress__data--vis6',
|
|
69
|
-
vis7: 'euiProgress__data--vis7',
|
|
70
|
-
vis8: 'euiProgress__data--vis8',
|
|
71
|
-
vis9: 'euiProgress__data--vis9'
|
|
72
|
-
};
|
|
73
|
-
var positionsToClassNameMap = {
|
|
74
|
-
fixed: 'euiProgress--fixed',
|
|
75
|
-
absolute: 'euiProgress--absolute',
|
|
76
|
-
static: ''
|
|
77
|
-
};
|
|
78
|
-
export var POSITIONS = keysOf(positionsToClassNameMap);
|
|
25
|
+
export var SIZES = ['xs', 's', 'm', 'l'];
|
|
26
|
+
export var COLORS = ['primary', 'success', 'warning', 'danger', 'subdued', 'accent', 'vis0', 'vis1', 'vis2', 'vis3', 'vis4', 'vis5', 'vis6', 'vis7', 'vis8', 'vis9'];
|
|
27
|
+
export var POSITIONS = ['fixed', 'absolute', 'static'];
|
|
79
28
|
export var EuiProgress = function EuiProgress(_ref) {
|
|
80
29
|
var className = _ref.className,
|
|
81
30
|
_ref$color = _ref.color,
|
|
@@ -93,30 +42,23 @@ export var EuiProgress = function EuiProgress(_ref) {
|
|
|
93
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
94
43
|
|
|
95
44
|
var determinate = !isNil(max);
|
|
96
|
-
var
|
|
97
|
-
var
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
'euiProgress--indeterminate': !determinate,
|
|
114
|
-
'euiProgress--native': determinate
|
|
115
|
-
}, sizeToClassNameMap[size], colorClass, positionsToClassNameMap[position], className);
|
|
116
|
-
var dataClasses = classNames('euiProgress__data', {
|
|
117
|
-
'euiProgress__data--l': size === 'l'
|
|
118
|
-
}, dataColorClass);
|
|
119
|
-
var labelClasses = classNames('euiProgress__label', labelProps && labelProps.className);
|
|
45
|
+
var isNamedColor = COLORS.includes(color);
|
|
46
|
+
var euiTheme = useEuiTheme();
|
|
47
|
+
var customColorStyles = !isNamedColor ? {
|
|
48
|
+
color: color
|
|
49
|
+
} : {};
|
|
50
|
+
var customTextColorStyles = !isNamedColor ? {
|
|
51
|
+
color: makeHighContrastColor(color)(euiTheme.euiTheme)
|
|
52
|
+
} : {};
|
|
53
|
+
var styles = euiProgressStyles(euiTheme, determinate);
|
|
54
|
+
var cssStyles = [styles.euiProgress, determinate && styles.native, !determinate && styles.indeterminate, styles[size], styles[position], isNamedColor ? styles[color] : styles.customColor];
|
|
55
|
+
var dataStyles = euiProgressDataStyles(euiTheme);
|
|
56
|
+
var dataCssStyles = [dataStyles.euiProgress__data, size === 'l' && dataStyles[size]];
|
|
57
|
+
var labelCssStyles = [euiProgressLabelStyles.euiProgress__label];
|
|
58
|
+
var valueTextStyles = euiProgressValueTextStyles(euiTheme);
|
|
59
|
+
var valueTextCssStyles = [valueTextStyles.euiProgress__valueText, isNamedColor ? valueTextStyles[color] : styles.customColor];
|
|
60
|
+
var classes = classNames('euiProgress', className);
|
|
61
|
+
var labelClasses = classNames('euiProgress__label', labelProps === null || labelProps === void 0 ? void 0 : labelProps.className);
|
|
120
62
|
var valueRender;
|
|
121
63
|
|
|
122
64
|
if (valueText === true) {
|
|
@@ -137,31 +79,36 @@ export var EuiProgress = function EuiProgress(_ref) {
|
|
|
137
79
|
|
|
138
80
|
if (determinate) {
|
|
139
81
|
return ___EmotionJSX(Fragment, null, label || valueText ? ___EmotionJSX("div", {
|
|
140
|
-
|
|
82
|
+
css: dataCssStyles,
|
|
83
|
+
className: "euiProgress__data"
|
|
141
84
|
}, label && ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
|
|
142
85
|
return ___EmotionJSX("span", _extends({
|
|
143
86
|
title: innerText,
|
|
144
87
|
ref: ref
|
|
145
88
|
}, labelProps, {
|
|
89
|
+
css: labelCssStyles,
|
|
146
90
|
className: labelClasses
|
|
147
91
|
}), label);
|
|
148
92
|
}), valueRender && ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
|
|
149
93
|
return ___EmotionJSX("span", {
|
|
150
94
|
title: innerText,
|
|
151
95
|
ref: ref,
|
|
152
|
-
style:
|
|
96
|
+
style: customTextColorStyles,
|
|
97
|
+
css: valueTextCssStyles,
|
|
153
98
|
className: "euiProgress__valueText"
|
|
154
99
|
}, valueRender);
|
|
155
100
|
})) : undefined, ___EmotionJSX("progress", _extends({
|
|
101
|
+
css: cssStyles,
|
|
156
102
|
className: classes,
|
|
157
|
-
style:
|
|
103
|
+
style: customColorStyles,
|
|
158
104
|
max: max,
|
|
159
105
|
value: value,
|
|
160
106
|
"aria-hidden": label && valueText ? true : false
|
|
161
107
|
}, rest)));
|
|
162
108
|
} else {
|
|
163
109
|
return ___EmotionJSX("div", _extends({
|
|
164
|
-
|
|
110
|
+
css: cssStyles,
|
|
111
|
+
style: customColorStyles,
|
|
165
112
|
className: classes
|
|
166
113
|
}, rest));
|
|
167
114
|
}
|
|
@@ -170,7 +117,7 @@ EuiProgress.propTypes = {
|
|
|
170
117
|
className: PropTypes.string,
|
|
171
118
|
"aria-label": PropTypes.string,
|
|
172
119
|
"data-test-subj": PropTypes.string,
|
|
173
|
-
size: PropTypes.
|
|
120
|
+
size: PropTypes.any,
|
|
174
121
|
|
|
175
122
|
/**
|
|
176
123
|
* One of EUI's color palette, vis colors or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
|
|
@@ -179,8 +126,8 @@ EuiProgress.propTypes = {
|
|
|
179
126
|
/**
|
|
180
127
|
* One of EUI's color palette, vis colors or a valid CSS color value https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
|
|
181
128
|
*/
|
|
182
|
-
color: PropTypes.oneOfType([PropTypes.
|
|
183
|
-
position: PropTypes.
|
|
129
|
+
color: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.any.isRequired]),
|
|
130
|
+
position: PropTypes.any,
|
|
184
131
|
max: PropTypes.number,
|
|
185
132
|
|
|
186
133
|
/*
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
|
|
3
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
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
|
+
};
|
|
@@ -172,6 +172,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
172
172
|
setActiveOptionIndex(index);
|
|
173
173
|
},
|
|
174
174
|
onClick: function onClick(event) {
|
|
175
|
+
event.persist(); // NOTE: This is needed for React v16 backwards compatibility
|
|
176
|
+
|
|
175
177
|
_this.onAddOrRemoveOption(option, event);
|
|
176
178
|
},
|
|
177
179
|
ref: ref ? ref.bind(null, index) : undefined,
|
|
@@ -440,7 +442,7 @@ EuiSelectableList.propTypes = {
|
|
|
440
442
|
/**
|
|
441
443
|
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
442
444
|
*/
|
|
443
|
-
color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.
|
|
445
|
+
color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.any.isRequired]),
|
|
444
446
|
|
|
445
447
|
/**
|
|
446
448
|
* Will override any color passed through the `color` prop.
|
|
@@ -276,7 +276,7 @@ EuiSelectableListItem.propTypes = {
|
|
|
276
276
|
/**
|
|
277
277
|
* Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
|
|
278
278
|
*/
|
|
279
|
-
color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.
|
|
279
|
+
color: PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.any.isRequired]),
|
|
280
280
|
|
|
281
281
|
/**
|
|
282
282
|
* Will override any color passed through the `color` prop.
|
|
@@ -339,12 +339,12 @@ EuiSelectableTemplateSitewide.propTypes = {
|
|
|
339
339
|
/**
|
|
340
340
|
* Manually change icon size
|
|
341
341
|
*/
|
|
342
|
-
iconSize: PropTypes.
|
|
342
|
+
iconSize: PropTypes.any,
|
|
343
343
|
|
|
344
344
|
/**
|
|
345
345
|
* Manually change icon color
|
|
346
346
|
*/
|
|
347
|
-
iconColor: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.
|
|
347
|
+
iconColor: PropTypes.oneOfType([PropTypes.oneOfType([PropTypes.string.isRequired, PropTypes.any.isRequired]).isRequired, PropTypes.oneOf([null])]),
|
|
348
348
|
|
|
349
349
|
/**
|
|
350
350
|
* Full name of avatar for title attribute and calculating initial if not provided
|
|
@@ -46,6 +46,7 @@ export var EuiText = function EuiText(_ref) {
|
|
|
46
46
|
if (color) {
|
|
47
47
|
text = ___EmotionJSX(EuiTextColor, {
|
|
48
48
|
color: color,
|
|
49
|
+
className: classes,
|
|
49
50
|
cloneElement: true
|
|
50
51
|
}, text);
|
|
51
52
|
}
|
|
@@ -53,6 +54,7 @@ export var EuiText = function EuiText(_ref) {
|
|
|
53
54
|
if (textAlign) {
|
|
54
55
|
text = ___EmotionJSX(EuiTextAlign, {
|
|
55
56
|
textAlign: textAlign,
|
|
57
|
+
className: classes,
|
|
56
58
|
cloneElement: true
|
|
57
59
|
}, text);
|
|
58
60
|
}
|
|
@@ -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
|
|