@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.
Files changed (180) hide show
  1. package/README.md +7 -0
  2. package/dist/eui_charts_theme.js +330 -330
  3. package/dist/eui_charts_theme.js.map +1 -1
  4. package/dist/eui_theme_dark.css +0 -445
  5. package/dist/eui_theme_dark.json +7 -44
  6. package/dist/eui_theme_dark.json.d.ts +7 -44
  7. package/dist/eui_theme_dark.min.css +1 -1
  8. package/dist/eui_theme_light.css +0 -445
  9. package/dist/eui_theme_light.json +7 -44
  10. package/dist/eui_theme_light.json.d.ts +7 -44
  11. package/dist/eui_theme_light.min.css +1 -1
  12. package/es/components/accessibility/screen_reader_live/screen_reader_live.js +30 -7
  13. package/es/components/accessibility/screen_reader_only/screen_reader_only.js +14 -19
  14. package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
  15. package/es/components/accessibility/skip_link/skip_link.js +20 -4
  16. package/es/components/avatar/avatar.js +2 -2
  17. package/es/components/badge/badge.js +1 -1
  18. package/es/components/button/button_icon/button_icon.js +1 -1
  19. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  20. package/es/components/datagrid/body/data_grid_body.js +6 -6
  21. package/es/components/datagrid/body/data_grid_cell.js +12 -12
  22. package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  23. package/es/components/datagrid/body/header/data_grid_header_row.js +6 -6
  24. package/es/components/datagrid/data_grid.js +6 -6
  25. package/es/components/datagrid/utils/in_memory.js +6 -6
  26. package/es/components/date_picker/date_picker.js +1 -1
  27. package/es/components/empty_prompt/empty_prompt.js +1 -1
  28. package/es/components/form/field_text/field_text.js +1 -1
  29. package/es/components/form/form_control_layout/form_control_layout.js +1 -1
  30. package/es/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  31. package/es/components/health/health.js +1 -1
  32. package/es/components/icon/icon.js +43 -495
  33. package/es/components/icon/icon.styles.js +75 -0
  34. package/es/components/icon/icon_map.js +455 -0
  35. package/es/components/icon/named_colors.js +2 -13
  36. package/es/components/list_group/list_group.js +1 -1
  37. package/es/components/list_group/list_group_item.js +1 -1
  38. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  39. package/es/components/notification/notification_event.js +2 -2
  40. package/es/components/notification/notification_event_meta.js +1 -1
  41. package/es/components/notification/notification_event_read_button.js +1 -1
  42. package/es/components/panel/panel.js +2 -1
  43. package/es/components/progress/progress.js +34 -87
  44. package/es/components/progress/progress.styles.js +155 -0
  45. package/es/components/selectable/selectable_list/selectable_list.js +3 -1
  46. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  47. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -2
  48. package/es/components/text/text.js +2 -0
  49. package/es/components/tool_tip/icon_tip.js +1 -1
  50. package/es/global_styling/utility/utility.js +3 -1
  51. package/es/services/theme/hooks.js +2 -0
  52. package/eui.d.ts +393 -453
  53. package/i18ntokens.json +2 -2
  54. package/lib/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
  55. package/lib/components/accessibility/screen_reader_only/screen_reader_only.js +22 -19
  56. package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  57. package/lib/components/accessibility/skip_link/skip_link.js +21 -4
  58. package/lib/components/avatar/avatar.js +2 -2
  59. package/lib/components/badge/badge.js +1 -1
  60. package/lib/components/button/button_icon/button_icon.js +1 -1
  61. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  62. package/lib/components/datagrid/body/data_grid_body.js +6 -6
  63. package/lib/components/datagrid/body/data_grid_cell.js +12 -12
  64. package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  65. package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -6
  66. package/lib/components/datagrid/data_grid.js +6 -6
  67. package/lib/components/datagrid/utils/focus.js +1 -0
  68. package/lib/components/datagrid/utils/in_memory.js +6 -6
  69. package/lib/components/date_picker/date_picker.js +1 -1
  70. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  71. package/lib/components/form/field_text/field_text.js +1 -1
  72. package/lib/components/form/form_control_layout/form_control_layout.js +1 -1
  73. package/lib/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  74. package/lib/components/health/health.js +1 -1
  75. package/lib/components/icon/icon.js +54 -499
  76. package/lib/components/icon/icon.styles.js +79 -0
  77. package/lib/components/icon/icon_map.js +463 -0
  78. package/lib/components/icon/named_colors.js +4 -15
  79. package/lib/components/list_group/list_group.js +1 -1
  80. package/lib/components/list_group/list_group_item.js +1 -1
  81. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  82. package/lib/components/notification/notification_event.js +2 -2
  83. package/lib/components/notification/notification_event_meta.js +1 -1
  84. package/lib/components/notification/notification_event_read_button.js +1 -1
  85. package/lib/components/panel/panel.js +2 -1
  86. package/lib/components/progress/progress.js +36 -88
  87. package/lib/components/progress/progress.styles.js +166 -0
  88. package/lib/components/selectable/selectable_list/selectable_list.js +3 -1
  89. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  90. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
  91. package/lib/components/text/text.js +2 -0
  92. package/lib/components/tool_tip/icon_tip.js +1 -1
  93. package/lib/global_styling/utility/utility.js +5 -1
  94. package/lib/services/theme/hooks.js +2 -0
  95. package/optimize/es/components/accessibility/screen_reader_live/screen_reader_live.js +21 -6
  96. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.js +11 -17
  97. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
  98. package/optimize/es/components/accessibility/skip_link/skip_link.js +20 -4
  99. package/optimize/es/components/datagrid/utils/focus.js +1 -0
  100. package/optimize/es/components/icon/icon.js +40 -492
  101. package/optimize/es/components/icon/icon.styles.js +75 -0
  102. package/optimize/es/components/icon/icon_map.js +455 -0
  103. package/optimize/es/components/icon/named_colors.js +2 -13
  104. package/optimize/es/components/panel/panel.js +2 -1
  105. package/optimize/es/components/progress/progress.js +31 -84
  106. package/optimize/es/components/progress/progress.styles.js +155 -0
  107. package/optimize/es/components/selectable/selectable_list/selectable_list.js +2 -0
  108. package/optimize/es/components/text/text.js +2 -0
  109. package/optimize/es/global_styling/utility/utility.js +3 -1
  110. package/optimize/es/services/theme/hooks.js +2 -0
  111. package/optimize/lib/components/accessibility/screen_reader_live/screen_reader_live.js +20 -5
  112. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.js +18 -16
  113. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  114. package/optimize/lib/components/accessibility/skip_link/skip_link.js +21 -4
  115. package/optimize/lib/components/datagrid/utils/focus.js +1 -0
  116. package/optimize/lib/components/icon/icon.js +49 -494
  117. package/optimize/lib/components/icon/icon.styles.js +81 -0
  118. package/optimize/lib/components/icon/icon_map.js +463 -0
  119. package/optimize/lib/components/icon/named_colors.js +4 -15
  120. package/optimize/lib/components/panel/panel.js +2 -1
  121. package/optimize/lib/components/progress/progress.js +33 -85
  122. package/optimize/lib/components/progress/progress.styles.js +168 -0
  123. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +2 -0
  124. package/optimize/lib/components/text/text.js +2 -0
  125. package/optimize/lib/global_styling/utility/utility.js +5 -1
  126. package/optimize/lib/services/theme/hooks.js +2 -0
  127. package/package.json +2 -2
  128. package/src/components/form/form_control_layout/_form_control_layout.scss +2 -4
  129. package/src/components/index.scss +0 -3
  130. package/src/global_styling/variables/_form.scss +9 -0
  131. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  132. package/test-env/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
  133. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.js +21 -18
  134. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  135. package/test-env/components/accessibility/skip_link/skip_link.js +21 -4
  136. package/test-env/components/avatar/avatar.js +2 -2
  137. package/test-env/components/badge/badge.js +1 -1
  138. package/test-env/components/button/button_icon/button_icon.js +1 -1
  139. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  140. package/test-env/components/datagrid/body/data_grid_body.js +6 -6
  141. package/test-env/components/datagrid/body/data_grid_cell.js +12 -12
  142. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  143. package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -6
  144. package/test-env/components/datagrid/data_grid.js +6 -6
  145. package/test-env/components/datagrid/utils/focus.js +1 -0
  146. package/test-env/components/datagrid/utils/in_memory.js +6 -6
  147. package/test-env/components/date_picker/date_picker.js +1 -1
  148. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  149. package/test-env/components/form/field_text/field_text.js +1 -1
  150. package/test-env/components/form/form_control_layout/form_control_layout.js +1 -1
  151. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  152. package/test-env/components/health/health.js +1 -1
  153. package/test-env/components/icon/icon.styles.js +81 -0
  154. package/test-env/components/icon/icon_map.js +463 -0
  155. package/test-env/components/icon/named_colors.js +4 -15
  156. package/test-env/components/list_group/list_group.js +1 -1
  157. package/test-env/components/list_group/list_group_item.js +1 -1
  158. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  159. package/test-env/components/notification/notification_event.js +2 -2
  160. package/test-env/components/notification/notification_event_meta.js +1 -1
  161. package/test-env/components/notification/notification_event_read_button.js +1 -1
  162. package/test-env/components/panel/panel.js +2 -1
  163. package/test-env/components/progress/progress.js +36 -88
  164. package/test-env/components/progress/progress.styles.js +168 -0
  165. package/test-env/components/selectable/selectable_list/selectable_list.js +3 -1
  166. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  167. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
  168. package/test-env/components/text/text.js +2 -0
  169. package/test-env/components/tool_tip/icon_tip.js +1 -1
  170. package/test-env/global_styling/utility/utility.js +5 -1
  171. package/test-env/services/theme/hooks.js +2 -0
  172. package/src/components/accessibility/_index.scss +0 -1
  173. package/src/components/accessibility/screen_reader_only/_screen_reader_only.scss +0 -5
  174. package/src/components/icon/_icon.scss +0 -87
  175. package/src/components/icon/_index.scss +0 -2
  176. package/src/components/icon/_variables.scss +0 -22
  177. package/src/components/progress/_index.scss +0 -2
  178. package/src/components/progress/_progress.scss +0 -166
  179. package/src/components/progress/_variables.scss +0 -21
  180. package/src/themes/amsterdam/overrides/_progress.scss +0 -3
@@ -21,10 +21,12 @@ var _i18n = require("../i18n");
21
21
 
22
22
  var _inner_text = require("../inner_text");
23
23
 
24
- var _common = require("../common");
25
-
26
24
  var _predicate = require("../../services/predicate");
27
25
 
26
+ var _services = require("../../services");
27
+
28
+ var _progress = require("./progress.styles");
29
+
28
30
  var _react2 = require("@emotion/react");
29
31
 
30
32
  var _excluded = ["className", "color", "size", "position", "max", "valueText", "label", "value", "labelProps"];
@@ -33,63 +35,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
33
35
 
34
36
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
37
 
36
- var sizeToClassNameMap = {
37
- xs: 'euiProgress--xs',
38
- s: 'euiProgress--s',
39
- m: 'euiProgress--m',
40
- l: 'euiProgress--l'
41
- };
42
- var SIZES = (0, _common.keysOf)(sizeToClassNameMap);
38
+ var SIZES = ['xs', 's', 'm', 'l'];
43
39
  exports.SIZES = SIZES;
44
- var colorToClassNameMap = {
45
- primary: 'euiProgress--primary',
46
- success: 'euiProgress--success',
47
- warning: 'euiProgress--warning',
48
- danger: 'euiProgress--danger',
49
- subdued: 'euiProgress--subdued',
50
- accent: 'euiProgress--accent',
51
- vis0: 'euiProgress--vis0',
52
- vis1: 'euiProgress--vis1',
53
- vis2: 'euiProgress--vis2',
54
- vis3: 'euiProgress--vis3',
55
- vis4: 'euiProgress--vis4',
56
- vis5: 'euiProgress--vis5',
57
- vis6: 'euiProgress--vis6',
58
- vis7: 'euiProgress--vis7',
59
- vis8: 'euiProgress--vis8',
60
- vis9: 'euiProgress--vis9'
61
- };
62
- var COLORS = (0, _common.keysOf)(colorToClassNameMap);
40
+ var COLORS = ['primary', 'success', 'warning', 'danger', 'subdued', 'accent', 'vis0', 'vis1', 'vis2', 'vis3', 'vis4', 'vis5', 'vis6', 'vis7', 'vis8', 'vis9'];
63
41
  exports.COLORS = COLORS;
64
-
65
- function isNamedColor(name) {
66
- return colorToClassNameMap.hasOwnProperty(name);
67
- }
68
-
69
- var dataColorToClassNameMap = {
70
- primary: 'euiProgress__data--primary',
71
- success: 'euiProgress__data--success',
72
- warning: 'euiProgress__data--warning',
73
- danger: 'euiProgress__data--danger',
74
- subdued: 'euiProgress__data--subdued',
75
- accent: 'euiProgress__data--accent',
76
- vis0: 'euiProgress__data--vis0',
77
- vis1: 'euiProgress__data--vis1',
78
- vis2: 'euiProgress__data--vis2',
79
- vis3: 'euiProgress__data--vis3',
80
- vis4: 'euiProgress__data--vis4',
81
- vis5: 'euiProgress__data--vis5',
82
- vis6: 'euiProgress__data--vis6',
83
- vis7: 'euiProgress__data--vis7',
84
- vis8: 'euiProgress__data--vis8',
85
- vis9: 'euiProgress__data--vis9'
86
- };
87
- var positionsToClassNameMap = {
88
- fixed: 'euiProgress--fixed',
89
- absolute: 'euiProgress--absolute',
90
- static: ''
91
- };
92
- var POSITIONS = (0, _common.keysOf)(positionsToClassNameMap);
42
+ var POSITIONS = ['fixed', 'absolute', 'static'];
93
43
  exports.POSITIONS = POSITIONS;
94
44
 
95
45
  var EuiProgress = function EuiProgress(_ref) {
@@ -108,30 +58,23 @@ var EuiProgress = function EuiProgress(_ref) {
108
58
  labelProps = _ref.labelProps,
109
59
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
110
60
  var determinate = !(0, _predicate.isNil)(max);
111
- var colorClass = null;
112
- var dataColorClass = null;
113
- var optionalCustomStyles = null;
114
-
115
- if (color) {
116
- if (isNamedColor(color)) {
117
- colorClass = colorToClassNameMap[color];
118
- dataColorClass = dataColorToClassNameMap[color];
119
- } else {
120
- optionalCustomStyles = {
121
- color: color
122
- };
123
- colorClass = 'euiProgress--customColor';
124
- }
125
- }
126
-
127
- var classes = (0, _classnames.default)('euiProgress', {
128
- 'euiProgress--indeterminate': !determinate,
129
- 'euiProgress--native': determinate
130
- }, sizeToClassNameMap[size], colorClass, positionsToClassNameMap[position], className);
131
- var dataClasses = (0, _classnames.default)('euiProgress__data', {
132
- 'euiProgress__data--l': size === 'l'
133
- }, dataColorClass);
134
- var labelClasses = (0, _classnames.default)('euiProgress__label', labelProps && labelProps.className);
61
+ var isNamedColor = COLORS.includes(color);
62
+ var euiTheme = (0, _services.useEuiTheme)();
63
+ var customColorStyles = !isNamedColor ? {
64
+ color: color
65
+ } : {};
66
+ var customTextColorStyles = !isNamedColor ? {
67
+ color: (0, _services.makeHighContrastColor)(color)(euiTheme.euiTheme)
68
+ } : {};
69
+ var styles = (0, _progress.euiProgressStyles)(euiTheme, determinate);
70
+ var cssStyles = [styles.euiProgress, determinate && styles.native, !determinate && styles.indeterminate, styles[size], styles[position], isNamedColor ? styles[color] : styles.customColor];
71
+ var dataStyles = (0, _progress.euiProgressDataStyles)(euiTheme);
72
+ var dataCssStyles = [dataStyles.euiProgress__data, size === 'l' && dataStyles[size]];
73
+ var labelCssStyles = [_progress.euiProgressLabelStyles.euiProgress__label];
74
+ var valueTextStyles = (0, _progress.euiProgressValueTextStyles)(euiTheme);
75
+ var valueTextCssStyles = [valueTextStyles.euiProgress__valueText, isNamedColor ? valueTextStyles[color] : styles.customColor];
76
+ var classes = (0, _classnames.default)('euiProgress', className);
77
+ var labelClasses = (0, _classnames.default)('euiProgress__label', labelProps === null || labelProps === void 0 ? void 0 : labelProps.className);
135
78
  var valueRender;
136
79
 
137
80
  if (valueText === true) {
@@ -152,31 +95,36 @@ var EuiProgress = function EuiProgress(_ref) {
152
95
 
153
96
  if (determinate) {
154
97
  return (0, _react2.jsx)(_react.Fragment, null, label || valueText ? (0, _react2.jsx)("div", {
155
- className: dataClasses
98
+ css: dataCssStyles,
99
+ className: "euiProgress__data"
156
100
  }, label && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
157
101
  return (0, _react2.jsx)("span", (0, _extends2.default)({
158
102
  title: innerText,
159
103
  ref: ref
160
104
  }, labelProps, {
105
+ css: labelCssStyles,
161
106
  className: labelClasses
162
107
  }), label);
163
108
  }), valueRender && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
164
109
  return (0, _react2.jsx)("span", {
165
110
  title: innerText,
166
111
  ref: ref,
167
- style: optionalCustomStyles,
112
+ style: customTextColorStyles,
113
+ css: valueTextCssStyles,
168
114
  className: "euiProgress__valueText"
169
115
  }, valueRender);
170
116
  })) : undefined, (0, _react2.jsx)("progress", (0, _extends2.default)({
117
+ css: cssStyles,
171
118
  className: classes,
172
- style: optionalCustomStyles,
119
+ style: customColorStyles,
173
120
  max: max,
174
121
  value: value,
175
122
  "aria-hidden": label && valueText ? true : false
176
123
  }, rest)));
177
124
  } else {
178
125
  return (0, _react2.jsx)("div", (0, _extends2.default)({
179
- style: optionalCustomStyles,
126
+ css: cssStyles,
127
+ style: customColorStyles,
180
128
  className: classes
181
129
  }, rest));
182
130
  }
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.euiProgressValueTextStyles = exports.euiProgressStyles = exports.euiProgressLabelStyles = exports.euiProgressDataStyles = void 0;
9
+
10
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _react = require("@emotion/react");
13
+
14
+ var _global_styling = require("../../global_styling");
15
+
16
+ var _services = require("../../services");
17
+
18
+ var _text = require("../text/text.styles");
19
+
20
+ var _templateObject;
21
+
22
+ 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)."; }
23
+
24
+ /**
25
+ * DRY utilities for native/determinate progress components vs non-native indeterminate
26
+ */
27
+ var crossBrowserProgressValue = function crossBrowserProgressValue(cssProperties) {
28
+ return "\n &::-webkit-progress-value {\n ".concat(cssProperties, "\n }\n &::-moz-progress-bar {\n ").concat(cssProperties, "\n }\n");
29
+ };
30
+
31
+ var indeterminateProgressValue = function indeterminateProgressValue(cssProperties) {
32
+ return "\n &:before {\n ".concat(cssProperties, "\n }\n");
33
+ };
34
+ /**
35
+ * Color utilities
36
+ */
37
+
38
+
39
+ var visColors = (0, _services.euiPaletteColorBlind)();
40
+
41
+ var nativeVsIndeterminateColor = function nativeVsIndeterminateColor(color, isNative) {
42
+ var selectors = isNative ? crossBrowserProgressValue : indeterminateProgressValue;
43
+ return selectors("background-color: ".concat(color, ";"));
44
+ };
45
+ /**
46
+ * DRY utils for non-static positions
47
+ */
48
+
49
+
50
+ var nonStaticPositioning = function nonStaticPositioning(isNative) {
51
+ 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");
52
+ };
53
+ /**
54
+ * Animations
55
+ */
56
+
57
+
58
+ var euiIndeterminateAnimation = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n transform: scaleX(1) translateX(-100%);\n }\n 100% {\n transform: scaleX(1) translateX(100%);\n }\n"])));
59
+ /**
60
+ * Emotion styles
61
+ */
62
+
63
+ var _ref2 = process.env.NODE_ENV === "production" ? {
64
+ name: "187h6sp-static",
65
+ styles: "position:relative;label:static;"
66
+ } : {
67
+ name: "187h6sp-static",
68
+ styles: "position:relative;label:static;",
69
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
70
+ };
71
+
72
+ var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
73
+ var euiTheme = _ref3.euiTheme;
74
+ return {
75
+ euiProgress: /*#__PURE__*/(0, _react.css)("overflow:hidden;background-color:", euiTheme.colors.lightShade, ";;label:euiProgress;"),
76
+ // https://css-tricks.com/html5-progress-element/
77
+ // Good resource if you need to work in here. There's some gotchas with
78
+ // dealing with cross-browser progress bars.
79
+ native: /*#__PURE__*/(0, _react.css)("display:block;", (0, _global_styling.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;"),
80
+ // An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
81
+ // we apply this style to a <div> instead of a <progress> element.
82
+ // See https://css-tricks.com/html5-progress-element/ for more info.
83
+ indeterminate: /*#__PURE__*/(0, _react.css)("&:before{position:absolute;content:'';", (0, _global_styling.logicalCSS)('width', '100%'), " top:0;bottom:0;left:0;transform:scaleX(0) translateX(0%);animation:", euiIndeterminateAnimation, " 1s ", euiTheme.animation.resistance, " infinite;", _global_styling.euiCantAnimate, "{animation-duration:2s;animation-timing-function:linear;}};label:indeterminate;"),
84
+ // Sizes
85
+ xs: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', euiTheme.size.xxs), ";;label:xs;"),
86
+ s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', euiTheme.size.xs), ";;label:s;"),
87
+ m: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', euiTheme.size.s), ";;label:m;"),
88
+ l: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', euiTheme.size.m), ";;label:l;"),
89
+ // Positioning
90
+ fixed: /*#__PURE__*/(0, _react.css)("position:fixed;z-index:", Number(euiTheme.levels.header) + 1, ";", nonStaticPositioning(isNative), ";;label:fixed;"),
91
+ absolute: /*#__PURE__*/(0, _react.css)("position:absolute;", nonStaticPositioning(isNative), ";;label:absolute;"),
92
+ static: _ref2,
93
+ // Colors
94
+ primary: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(euiTheme.colors.primary, isNative), ";;label:primary;"),
95
+ success: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(euiTheme.colors.success, isNative), ";;label:success;"),
96
+ warning: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(euiTheme.colors.warning, isNative), ";;label:warning;"),
97
+ danger: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(euiTheme.colors.danger, isNative), ";;label:danger;"),
98
+ subdued: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(euiTheme.colors.subduedText, isNative), ";;label:subdued;"),
99
+ accent: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(euiTheme.colors.accent, isNative), ";;label:accent;"),
100
+ vis0: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[0], isNative), ";;label:vis0;"),
101
+ vis1: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[1], isNative), ";;label:vis1;"),
102
+ vis2: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[2], isNative), ";;label:vis2;"),
103
+ vis3: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[3], isNative), ";;label:vis3;"),
104
+ vis4: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[4], isNative), ";;label:vis4;"),
105
+ vis5: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[5], isNative), ";;label:vis5;"),
106
+ vis6: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[6], isNative), ";;label:vis6;"),
107
+ vis7: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[7], isNative), ";;label:vis7;"),
108
+ vis8: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[8], isNative), ";;label:vis8;"),
109
+ vis9: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor(visColors[9], isNative), ";;label:vis9;"),
110
+ customColor: /*#__PURE__*/(0, _react.css)(nativeVsIndeterminateColor('currentColor', isNative), ";;label:customColor;")
111
+ };
112
+ };
113
+ /**
114
+ * Data styles
115
+ */
116
+
117
+
118
+ exports.euiProgressStyles = euiProgressStyles;
119
+
120
+ var euiProgressDataStyles = function euiProgressDataStyles(euiThemeContext) {
121
+ return {
122
+ euiProgress__data: /*#__PURE__*/(0, _react.css)("display:flex;justify-content:space-between;gap:", euiThemeContext.euiTheme.size.xs, ";", (0, _text.euiText)(euiThemeContext.euiTheme), " ", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";;label:euiProgress__data;"),
123
+ // Sizes
124
+ l: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";;label:l;")
125
+ };
126
+ };
127
+
128
+ exports.euiProgressDataStyles = euiProgressDataStyles;
129
+ var euiProgressLabelStyles = {
130
+ euiProgress__label: /*#__PURE__*/(0, _react.css)("flex-grow:1;", (0, _global_styling.euiTextTruncate)(), ";;label:euiProgress__label;")
131
+ };
132
+ exports.euiProgressLabelStyles = euiProgressLabelStyles;
133
+
134
+ var _ref = process.env.NODE_ENV === "production" ? {
135
+ name: "15ioh86-customColor",
136
+ styles: "color:currentColor;label:customColor;"
137
+ } : {
138
+ name: "15ioh86-customColor",
139
+ styles: "color:currentColor;label:customColor;",
140
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
141
+ };
142
+
143
+ var euiProgressValueTextStyles = function euiProgressValueTextStyles(_ref4) {
144
+ var euiTheme = _ref4.euiTheme;
145
+ return {
146
+ euiProgress__valueText: /*#__PURE__*/(0, _react.css)("flex-grow:1;flex-shrink:0;font-feature-settings:'tnum' 1;", (0, _global_styling.logicalTextAlignCSS)('right'), " ", (0, _global_styling.euiTextTruncate)(), ";;label:euiProgress__valueText;"),
147
+ // Colors
148
+ primary: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.primaryText, ";;label:primary;"),
149
+ success: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.successText, ";;label:success;"),
150
+ warning: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.warningText, ";;label:warning;"),
151
+ danger: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.dangerText, ";;label:danger;"),
152
+ subdued: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
153
+ accent: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.accentText, ";;label:accent;"),
154
+ vis0: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[0])(euiTheme), ";;label:vis0;"),
155
+ vis1: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[1])(euiTheme), ";;label:vis1;"),
156
+ vis2: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[2])(euiTheme), ";;label:vis2;"),
157
+ vis3: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[3])(euiTheme), ";;label:vis3;"),
158
+ vis4: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[4])(euiTheme), ";;label:vis4;"),
159
+ vis5: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[5])(euiTheme), ";;label:vis5;"),
160
+ vis6: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[6])(euiTheme), ";;label:vis6;"),
161
+ vis7: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[7])(euiTheme), ";;label:vis7;"),
162
+ vis8: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[8])(euiTheme), ";;label:vis8;"),
163
+ vis9: /*#__PURE__*/(0, _react.css)("color:", (0, _services.makeHighContrastColor)(visColors[9])(euiTheme), ";;label:vis9;"),
164
+ customColor: _ref
165
+ };
166
+ };
167
+
168
+ exports.euiProgressValueTextStyles = euiProgressValueTextStyles;
@@ -170,6 +170,8 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
170
170
  setActiveOptionIndex(index);
171
171
  },
172
172
  onClick: function onClick(event) {
173
+ event.persist(); // NOTE: This is needed for React v16 backwards compatibility
174
+
173
175
  _this.onAddOrRemoveOption(option, event);
174
176
  },
175
177
  ref: ref ? ref.bind(null, index) : undefined,
@@ -51,6 +51,7 @@ var EuiText = function EuiText(_ref) {
51
51
  if (color) {
52
52
  text = (0, _react2.jsx)(_text_color.EuiTextColor, {
53
53
  color: color,
54
+ className: classes,
54
55
  cloneElement: true
55
56
  }, text);
56
57
  }
@@ -58,6 +59,7 @@ var EuiText = function EuiText(_ref) {
58
59
  if (textAlign) {
59
60
  text = (0, _react2.jsx)(_text_align.EuiTextAlign, {
60
61
  textAlign: textAlign,
62
+ className: classes,
61
63
  cloneElement: true
62
64
  }, text);
63
65
  }
@@ -11,6 +11,8 @@ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _react2 = require("@emotion/react");
13
13
 
14
+ var _screen_reader_only = require("../../components/accessibility/screen_reader_only/screen_reader_only.styles");
15
+
14
16
  /*
15
17
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
18
  * or more contributor license agreements. Licensed under the Elastic License
@@ -18,9 +20,11 @@ var _react2 = require("@emotion/react");
18
20
  * in compliance with, at your election, the Elastic License 2.0 or the Server
19
21
  * Side Public License, v 1.
20
22
  */
23
+ var globalStyles = /*#__PURE__*/(0, _react2.css)(".euiScreenReaderOnly{", (0, _screen_reader_only.euiScreenReaderOnly)(), ";};label:globalStyles;");
24
+
21
25
  var EuiUtilityClasses = function EuiUtilityClasses() {
22
26
  return (0, _react2.jsx)(_react2.Global, {
23
- styles: /*#__PURE__*/(0, _react2.css)(";label:EuiUtilityClasses;")
27
+ styles: globalStyles
24
28
  });
25
29
  };
26
30
 
@@ -41,6 +41,8 @@ var useEuiTheme = function useEuiTheme() {
41
41
 
42
42
  exports.useEuiTheme = useEuiTheme;
43
43
 
44
+ // Provide the component props interface as the generic to allow the docs props table to populate.
45
+ // e.g., `const EuiComponent = withEuiTheme<EuiComponentProps>(_EuiComponent)`
44
46
  var withEuiTheme = function withEuiTheme(Component) {
45
47
  var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
46
48
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "60.0.0",
4
+ "version": "60.1.2",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -115,7 +115,7 @@
115
115
  "@cypress/code-coverage": "^3.9.12",
116
116
  "@cypress/react": "^5.10.3",
117
117
  "@cypress/webpack-dev-server": "^1.7.0",
118
- "@elastic/charts": "^46.10.2",
118
+ "@elastic/charts": "^46.11.0",
119
119
  "@elastic/datemath": "^5.0.3",
120
120
  "@elastic/eslint-config-kibana": "^0.15.0",
121
121
  "@emotion/babel-preset-css-prop": "^11.2.0",
@@ -1,10 +1,8 @@
1
- @import '../../icon/variables';
2
-
3
1
  .euiFormControlLayout {
4
2
  // Let the height expand as needed
5
3
  @include euiFormControlSize($includeAlternates: true);
6
4
 
7
- $iconSize: map-get($euiIconSizes, 'medium');
5
+ $iconSize: map-get($euiFormControlIconSizes, 'medium');
8
6
  $iconPadding: $euiFormControlPadding;
9
7
  $marginBetweenIcons: $euiFormControlPadding / 2;
10
8
 
@@ -16,7 +14,7 @@
16
14
  padding-right: $iconPadding + ($iconSize + $marginBetweenIcons) * $i;
17
15
 
18
16
  &[class*='compressed'] {
19
- $iconSizeCompressed: map-get($euiIconSizes, 'small');
17
+ $iconSizeCompressed: map-get($euiFormControlIconSizes, 'small');
20
18
  $iconPaddingCompressed: $euiFormControlCompressedPadding;
21
19
 
22
20
  padding-right: $iconPaddingCompressed + ($iconSizeCompressed + $marginBetweenIcons) * $i;
@@ -1,6 +1,5 @@
1
1
  // Components
2
2
 
3
- @import 'accessibility/index';
4
3
  @import 'accordion/index';
5
4
  @import 'badge/index';
6
5
  @import 'basic_table/index';
@@ -26,7 +25,6 @@
26
25
  @import 'flyout/index';
27
26
  @import 'form/index';
28
27
  @import 'header/index';
29
- @import 'icon/index';
30
28
  @import 'image/index';
31
29
  @import 'key_pad_menu/index';
32
30
  @import 'list_group/index';
@@ -39,7 +37,6 @@
39
37
  @import 'page/index'; // Page needs to come after Panel for cascade specificity
40
38
  @import 'popover/index';
41
39
  @import 'portal/index';
42
- @import 'progress/index';
43
40
  @import 'tree_view/index';
44
41
  @import 'resizable_container/index';
45
42
  @import 'side_nav/index';
@@ -41,6 +41,15 @@ $euiFormInputGroupLabelBackground: tintOrShade($euiColorLightShade, 50%, 15%) !d
41
41
  $euiFormInputGroupBorder: 1px solid shadeOrTint($euiFormInputGroupLabelBackground, 2%, 4%) !default;
42
42
  $euiSwitchOffColor: lightOrDarkTheme(transparentize($euiColorMediumShade, .8), transparentize($euiColorMediumShade, .3)) !default;
43
43
 
44
+ // Icons sizes
45
+ $euiFormControlIconSizes: (
46
+ small: $euiSizeM,
47
+ medium: $euiSize,
48
+ large: $euiSizeL,
49
+ xLarge: $euiSizeXL,
50
+ xxLarge: $euiSizeXXL
51
+ );
52
+
44
53
  // Control Layout
45
54
  $euiFormControlLayoutGroupInputHeight: $euiFormControlHeight - 2px !default;
46
55
  $euiFormControlLayoutGroupInputCompressedHeight: $euiFormControlCompressedHeight - 2px !default;
@@ -26,7 +26,6 @@
26
26
  @import 'notification_badge';
27
27
  @import 'overlay_mask';
28
28
  @import 'popover';
29
- @import 'progress';
30
29
  @import 'range';
31
30
  @import 'range_draggable';
32
31
  @import 'range_highlight';
@@ -37,18 +37,26 @@ var EuiScreenReaderLive = function EuiScreenReaderLive(_ref) {
37
37
  _ref$role = _ref.role,
38
38
  role = _ref$role === void 0 ? 'status' : _ref$role,
39
39
  _ref$ariaLive = _ref['aria-live'],
40
- ariaLive = _ref$ariaLive === void 0 ? 'polite' : _ref$ariaLive;
40
+ ariaLive = _ref$ariaLive === void 0 ? 'polite' : _ref$ariaLive,
41
+ _ref$focusRegionOnTex = _ref.focusRegionOnTextChange,
42
+ focusRegionOnTextChange = _ref$focusRegionOnTex === void 0 ? false : _ref$focusRegionOnTex;
41
43
 
42
44
  var _useState = (0, _react.useState)(false),
43
45
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
44
46
  toggle = _useState2[0],
45
47
  setToggle = _useState2[1];
46
48
 
49
+ var focusRef = (0, _react.useRef)(null);
47
50
  (0, _react.useEffect)(function () {
48
51
  setToggle(function (toggle) {
49
52
  return !toggle;
50
53
  });
51
54
  }, [children]);
55
+ (0, _react.useEffect)(function () {
56
+ if (focusRef.current !== null && focusRegionOnTextChange) {
57
+ focusRef.current.focus();
58
+ }
59
+ }, [toggle, focusRegionOnTextChange]);
52
60
  return (
53
61
  /**
54
62
  * Intentionally uses two persistent live regions with oscillating content updates.
@@ -60,14 +68,21 @@ var EuiScreenReaderLive = function EuiScreenReaderLive(_ref) {
60
68
  * See also https://github.com/AlmeroSteyn/react-aria-live and https://github.com/dequelabs/ngA11y
61
69
  * for more examples of the double region approach.
62
70
  */
63
- (0, _react2.jsx)(_screen_reader_only.EuiScreenReaderOnly, null, (0, _react2.jsx)("div", null, (0, _react2.jsx)("div", {
71
+ (0, _react2.jsx)(_screen_reader_only.EuiScreenReaderOnly, null, (0, _react2.jsx)("div", {
72
+ ref: focusRef,
73
+ tabIndex: focusRegionOnTextChange ? -1 : undefined
74
+ }, (0, _react2.jsx)("div", {
64
75
  role: role,
65
- "aria-atomic": "true",
66
- "aria-live": ariaLive
76
+ "aria-atomic": "true" // Setting `aria-hidden` and setting `aria-live` to "off" prevents
77
+ // double announcements from VO when `focusRegionOnTextChange` is true
78
+ ,
79
+ "aria-hidden": toggle ? undefined : 'true',
80
+ "aria-live": focusRegionOnTextChange ? 'off' : ariaLive
67
81
  }, isActive && toggle ? children : ''), (0, _react2.jsx)("div", {
68
82
  role: role,
69
83
  "aria-atomic": "true",
70
- "aria-live": ariaLive
84
+ "aria-hidden": !toggle ? undefined : 'true',
85
+ "aria-live": focusRegionOnTextChange ? 'off' : ariaLive
71
86
  }, isActive && !toggle ? children : '')))
72
87
  );
73
88
  };
@@ -94,5 +109,13 @@ EuiScreenReaderLive.propTypes = {
94
109
  /**
95
110
  * `aria-live` attribute for both live regions
96
111
  */
97
- "aria-live": _propTypes.default.any
112
+ "aria-live": _propTypes.default.any,
113
+
114
+ /**
115
+ * On `children`/text change, the region will auto-focus itself, causing screen readers
116
+ * to automatically read out the text content. This prop should primarily be used for
117
+ * navigation or page changes, where programmatically resetting focus location back to
118
+ * a certain part of the page is desired.
119
+ */
120
+ focusRegionOnTextChange: _propTypes.default.bool
98
121
  };
@@ -7,31 +7,33 @@ 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");
10
+ var _classnames = _interopRequireDefault(require("classnames"));
13
11
 
14
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
15
13
 
16
- var _classnames = _interopRequireDefault(require("classnames"));
17
-
18
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
14
+ var _clone_element = require("../../../services/theme/clone_element");
19
15
 
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
+ var _screen_reader_only = require("./screen_reader_only.styles");
21
17
 
18
+ /*
19
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
20
+ * or more contributor license agreements. Licensed under the Elastic License
21
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
22
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
23
+ * Side Public License, v 1.
24
+ */
22
25
  var EuiScreenReaderOnly = function EuiScreenReaderOnly(_ref) {
23
26
  var children = _ref.children,
27
+ className = _ref.className,
24
28
  showOnFocus = _ref.showOnFocus;
25
- var classes = (0, _classnames.default)({
26
- euiScreenReaderOnly: !showOnFocus,
27
- 'euiScreenReaderOnly--showOnFocus': showOnFocus
28
- }, children.props.className);
29
-
30
- var props = _objectSpread(_objectSpread({}, children.props), {}, {
31
- className: classes
32
- });
33
-
34
- return /*#__PURE__*/(0, _react.cloneElement)(children, props);
29
+ var classes = (0, _classnames.default)(className, children.props.className);
30
+ var styles = (0, _screen_reader_only.euiScreenReaderOnlyStyles)(showOnFocus);
31
+ var cssStyles = [styles.euiScreenReaderOnly];
32
+ var props = {
33
+ className: classes.length ? classes : undefined,
34
+ css: cssStyles
35
+ };
36
+ return (0, _clone_element.cloneElementWithCss)(children, props);
35
37
  };
36
38
 
37
39
  exports.EuiScreenReaderOnly = EuiScreenReaderOnly;
@@ -44,5 +46,6 @@ EuiScreenReaderOnly.propTypes = {
44
46
  /**
45
47
  * For keyboard navigation, force content to display visually upon focus.
46
48
  */
47
- showOnFocus: _propTypes.default.bool
49
+ showOnFocus: _propTypes.default.bool,
50
+ className: _propTypes.default.string
48
51
  };
@@ -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.euiScreenReaderOnly = euiScreenReaderOnly;
38
+ exports.euiScreenReaderOnlyStyles = euiScreenReaderOnlyStyles;