@elastic/eui 59.1.0 → 60.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/README.md +7 -0
  2. package/dist/eui_theme_dark.css +0 -493
  3. package/dist/eui_theme_dark.json +7 -44
  4. package/dist/eui_theme_dark.json.d.ts +7 -44
  5. package/dist/eui_theme_dark.min.css +1 -1
  6. package/dist/eui_theme_light.css +0 -493
  7. package/dist/eui_theme_light.json +7 -44
  8. package/dist/eui_theme_light.json.d.ts +7 -44
  9. package/dist/eui_theme_light.min.css +1 -1
  10. package/es/components/accessibility/screen_reader_live/screen_reader_live.js +30 -7
  11. package/es/components/accessibility/screen_reader_only/screen_reader_only.js +14 -19
  12. package/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
  13. package/es/components/accessibility/skip_link/skip_link.js +20 -4
  14. package/es/components/avatar/avatar.js +2 -2
  15. package/es/components/badge/badge.js +1 -1
  16. package/es/components/button/button_icon/button_icon.js +1 -1
  17. package/es/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  18. package/es/components/combo_box/matching_options.js +3 -2
  19. package/es/components/datagrid/body/data_grid_body.js +6 -6
  20. package/es/components/datagrid/body/data_grid_cell.js +12 -12
  21. package/es/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  22. package/es/components/datagrid/body/header/data_grid_header_row.js +6 -6
  23. package/es/components/datagrid/data_grid.js +6 -6
  24. package/es/components/datagrid/utils/in_memory.js +6 -6
  25. package/es/components/date_picker/date_picker.js +1 -1
  26. package/es/components/empty_prompt/empty_prompt.js +1 -1
  27. package/es/components/form/field_text/field_text.js +1 -1
  28. package/es/components/form/form_control_layout/form_control_layout.js +1 -1
  29. package/es/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  30. package/es/components/health/health.js +1 -1
  31. package/es/components/icon/icon.js +43 -495
  32. package/es/components/icon/icon.styles.js +75 -0
  33. package/es/components/icon/icon_map.js +455 -0
  34. package/es/components/icon/named_colors.js +2 -13
  35. package/es/components/list_group/list_group.js +1 -1
  36. package/es/components/list_group/list_group_item.js +1 -1
  37. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  38. package/es/components/notification/notification_event.js +2 -2
  39. package/es/components/notification/notification_event_meta.js +1 -1
  40. package/es/components/notification/notification_event_read_button.js +1 -1
  41. package/es/components/progress/progress.js +34 -87
  42. package/es/components/progress/progress.styles.js +155 -0
  43. package/es/components/provider/cache/cache_provider.js +17 -0
  44. package/es/components/provider/cache/index.js +8 -0
  45. package/es/components/provider/provider.js +35 -5
  46. package/es/components/selectable/selectable.js +39 -22
  47. package/es/components/selectable/selectable_list/selectable_list.js +1 -1
  48. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  49. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +2 -2
  50. package/es/components/stat/stat.js +28 -35
  51. package/es/components/stat/stat.styles.js +38 -0
  52. package/es/components/timeline/timeline.js +15 -8
  53. package/es/components/timeline/timeline.styles.js +29 -0
  54. package/es/components/timeline/timeline_item.js +4 -16
  55. package/es/components/timeline/timeline_item.styles.js +18 -3
  56. package/es/components/timeline/timeline_item_icon.styles.js +14 -4
  57. package/es/components/tool_tip/icon_tip.js +1 -1
  58. package/es/global_styling/functions/logicals.js +2 -2
  59. package/es/global_styling/utility/utility.js +17 -0
  60. package/es/services/theme/hooks.js +4 -2
  61. package/es/services/theme/provider.js +1 -5
  62. package/es/test/emotion-prefix.js +29 -0
  63. package/es/test/index.d.ts +5 -0
  64. package/es/test/index.js +2 -1
  65. package/eui.d.ts +450 -454
  66. package/i18ntokens.json +18 -18
  67. package/lib/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
  68. package/lib/components/accessibility/screen_reader_only/screen_reader_only.js +22 -19
  69. package/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  70. package/lib/components/accessibility/skip_link/skip_link.js +21 -4
  71. package/lib/components/avatar/avatar.js +2 -2
  72. package/lib/components/badge/badge.js +1 -1
  73. package/lib/components/button/button_icon/button_icon.js +1 -1
  74. package/lib/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  75. package/lib/components/combo_box/matching_options.js +3 -2
  76. package/lib/components/datagrid/body/data_grid_body.js +6 -6
  77. package/lib/components/datagrid/body/data_grid_cell.js +12 -12
  78. package/lib/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  79. package/lib/components/datagrid/body/header/data_grid_header_row.js +6 -6
  80. package/lib/components/datagrid/data_grid.js +6 -6
  81. package/lib/components/datagrid/utils/in_memory.js +6 -6
  82. package/lib/components/date_picker/date_picker.js +1 -1
  83. package/lib/components/empty_prompt/empty_prompt.js +1 -1
  84. package/lib/components/form/field_text/field_text.js +1 -1
  85. package/lib/components/form/form_control_layout/form_control_layout.js +1 -1
  86. package/lib/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  87. package/lib/components/health/health.js +1 -1
  88. package/lib/components/icon/icon.js +54 -499
  89. package/lib/components/icon/icon.styles.js +79 -0
  90. package/lib/components/icon/icon_map.js +463 -0
  91. package/lib/components/icon/named_colors.js +4 -15
  92. package/lib/components/list_group/list_group.js +1 -1
  93. package/lib/components/list_group/list_group_item.js +1 -1
  94. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  95. package/lib/components/notification/notification_event.js +2 -2
  96. package/lib/components/notification/notification_event_meta.js +1 -1
  97. package/lib/components/notification/notification_event_read_button.js +1 -1
  98. package/lib/components/progress/progress.js +36 -88
  99. package/lib/components/progress/progress.styles.js +166 -0
  100. package/lib/components/provider/cache/cache_provider.js +29 -0
  101. package/lib/components/provider/cache/index.js +18 -0
  102. package/lib/components/provider/provider.js +36 -5
  103. package/lib/components/selectable/selectable.js +39 -22
  104. package/lib/components/selectable/selectable_list/selectable_list.js +1 -1
  105. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  106. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
  107. package/lib/components/stat/stat.js +30 -40
  108. package/lib/components/stat/stat.styles.js +45 -0
  109. package/lib/components/timeline/timeline.js +20 -9
  110. package/lib/components/timeline/timeline.styles.js +39 -0
  111. package/lib/components/timeline/timeline_item.js +4 -17
  112. package/lib/components/timeline/timeline_item.styles.js +17 -10
  113. package/lib/components/timeline/timeline_item_icon.styles.js +15 -4
  114. package/lib/components/tool_tip/icon_tip.js +1 -1
  115. package/lib/global_styling/functions/logicals.js +2 -2
  116. package/lib/global_styling/utility/utility.js +31 -0
  117. package/lib/services/theme/hooks.js +4 -2
  118. package/lib/services/theme/provider.js +3 -6
  119. package/lib/test/emotion-prefix.js +38 -0
  120. package/lib/test/index.d.ts +5 -0
  121. package/lib/test/index.js +23 -1
  122. package/optimize/es/components/accessibility/screen_reader_live/screen_reader_live.js +21 -6
  123. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.js +11 -17
  124. package/optimize/es/components/accessibility/screen_reader_only/screen_reader_only.styles.js +11 -1
  125. package/optimize/es/components/accessibility/skip_link/skip_link.js +20 -4
  126. package/optimize/es/components/combo_box/matching_options.js +3 -2
  127. package/optimize/es/components/icon/icon.js +40 -492
  128. package/optimize/es/components/icon/icon.styles.js +75 -0
  129. package/optimize/es/components/icon/icon_map.js +455 -0
  130. package/optimize/es/components/icon/named_colors.js +2 -13
  131. package/optimize/es/components/progress/progress.js +31 -84
  132. package/optimize/es/components/progress/progress.styles.js +155 -0
  133. package/optimize/es/components/provider/cache/cache_provider.js +17 -0
  134. package/optimize/es/components/provider/cache/index.js +8 -0
  135. package/optimize/es/components/provider/provider.js +35 -5
  136. package/optimize/es/components/selectable/selectable.js +33 -22
  137. package/optimize/es/components/stat/stat.js +25 -33
  138. package/optimize/es/components/stat/stat.styles.js +38 -0
  139. package/optimize/es/components/timeline/timeline.js +10 -1
  140. package/optimize/es/components/timeline/timeline.styles.js +29 -0
  141. package/optimize/es/components/timeline/timeline_item.js +4 -9
  142. package/optimize/es/components/timeline/timeline_item.styles.js +18 -3
  143. package/optimize/es/components/timeline/timeline_item_icon.styles.js +14 -4
  144. package/optimize/es/global_styling/functions/logicals.js +2 -2
  145. package/optimize/es/global_styling/utility/utility.js +17 -0
  146. package/optimize/es/services/theme/hooks.js +4 -2
  147. package/optimize/es/services/theme/provider.js +1 -5
  148. package/optimize/es/test/emotion-prefix.js +27 -0
  149. package/optimize/es/test/index.d.ts +5 -0
  150. package/optimize/es/test/index.js +2 -1
  151. package/optimize/lib/components/accessibility/screen_reader_live/screen_reader_live.js +20 -5
  152. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.js +18 -16
  153. package/optimize/lib/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  154. package/optimize/lib/components/accessibility/skip_link/skip_link.js +21 -4
  155. package/optimize/lib/components/combo_box/matching_options.js +3 -2
  156. package/optimize/lib/components/icon/icon.js +49 -494
  157. package/optimize/lib/components/icon/icon.styles.js +81 -0
  158. package/optimize/lib/components/icon/icon_map.js +463 -0
  159. package/optimize/lib/components/icon/named_colors.js +4 -15
  160. package/optimize/lib/components/progress/progress.js +33 -85
  161. package/optimize/lib/components/progress/progress.styles.js +168 -0
  162. package/optimize/lib/components/provider/cache/cache_provider.js +29 -0
  163. package/optimize/lib/components/provider/cache/index.js +18 -0
  164. package/optimize/lib/components/provider/provider.js +36 -5
  165. package/optimize/lib/components/selectable/selectable.js +33 -22
  166. package/optimize/lib/components/stat/stat.js +27 -37
  167. package/optimize/lib/components/stat/stat.styles.js +47 -0
  168. package/optimize/lib/components/timeline/timeline.js +14 -2
  169. package/optimize/lib/components/timeline/timeline.styles.js +39 -0
  170. package/optimize/lib/components/timeline/timeline_item.js +4 -10
  171. package/optimize/lib/components/timeline/timeline_item.styles.js +17 -10
  172. package/optimize/lib/components/timeline/timeline_item_icon.styles.js +15 -4
  173. package/optimize/lib/global_styling/functions/logicals.js +2 -2
  174. package/optimize/lib/global_styling/utility/utility.js +31 -0
  175. package/optimize/lib/services/theme/hooks.js +4 -2
  176. package/optimize/lib/services/theme/provider.js +3 -6
  177. package/optimize/lib/test/emotion-prefix.js +40 -0
  178. package/optimize/lib/test/index.d.ts +5 -0
  179. package/optimize/lib/test/index.js +23 -1
  180. package/package.json +2 -2
  181. package/src/components/form/form_control_layout/_form_control_layout.scss +2 -4
  182. package/src/components/index.scss +0 -4
  183. package/src/global_styling/variables/_form.scss +9 -0
  184. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  185. package/test-env/components/accessibility/screen_reader_live/screen_reader_live.js +29 -6
  186. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.js +21 -18
  187. package/test-env/components/accessibility/screen_reader_only/screen_reader_only.styles.js +16 -2
  188. package/test-env/components/accessibility/skip_link/skip_link.js +21 -4
  189. package/test-env/components/avatar/avatar.js +2 -2
  190. package/test-env/components/badge/badge.js +1 -1
  191. package/test-env/components/button/button_icon/button_icon.js +1 -1
  192. package/test-env/components/collapsible_nav/collapsible_nav_group/collapsible_nav_group.js +2 -2
  193. package/test-env/components/combo_box/matching_options.js +3 -2
  194. package/test-env/components/datagrid/body/data_grid_body.js +6 -6
  195. package/test-env/components/datagrid/body/data_grid_cell.js +12 -12
  196. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +6 -6
  197. package/test-env/components/datagrid/body/header/data_grid_header_row.js +6 -6
  198. package/test-env/components/datagrid/data_grid.js +6 -6
  199. package/test-env/components/datagrid/utils/in_memory.js +6 -6
  200. package/test-env/components/date_picker/date_picker.js +1 -1
  201. package/test-env/components/empty_prompt/empty_prompt.js +1 -1
  202. package/test-env/components/form/field_text/field_text.js +1 -1
  203. package/test-env/components/form/form_control_layout/form_control_layout.js +1 -1
  204. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +1 -1
  205. package/test-env/components/health/health.js +1 -1
  206. package/test-env/components/icon/icon.styles.js +81 -0
  207. package/test-env/components/icon/icon_map.js +463 -0
  208. package/test-env/components/icon/named_colors.js +4 -15
  209. package/test-env/components/list_group/list_group.js +1 -1
  210. package/test-env/components/list_group/list_group_item.js +1 -1
  211. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +2 -2
  212. package/test-env/components/notification/notification_event.js +2 -2
  213. package/test-env/components/notification/notification_event_meta.js +1 -1
  214. package/test-env/components/notification/notification_event_read_button.js +1 -1
  215. package/test-env/components/progress/progress.js +36 -88
  216. package/test-env/components/progress/progress.styles.js +168 -0
  217. package/test-env/components/provider/cache/cache_provider.js +29 -0
  218. package/test-env/components/provider/cache/index.js +18 -0
  219. package/test-env/components/provider/provider.js +36 -5
  220. package/test-env/components/selectable/selectable.js +39 -22
  221. package/test-env/components/selectable/selectable_list/selectable_list.js +1 -1
  222. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  223. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +3 -3
  224. package/test-env/components/stat/stat.js +29 -39
  225. package/test-env/components/stat/stat.styles.js +47 -0
  226. package/test-env/components/timeline/timeline.js +19 -9
  227. package/test-env/components/timeline/timeline.styles.js +39 -0
  228. package/test-env/components/timeline/timeline_item.js +4 -17
  229. package/test-env/components/timeline/timeline_item.styles.js +17 -10
  230. package/test-env/components/timeline/timeline_item_icon.styles.js +15 -4
  231. package/test-env/components/tool_tip/icon_tip.js +1 -1
  232. package/test-env/global_styling/functions/logicals.js +2 -2
  233. package/test-env/global_styling/utility/utility.js +31 -0
  234. package/test-env/services/theme/hooks.js +4 -2
  235. package/test-env/services/theme/provider.js +3 -6
  236. package/test-env/test/emotion-prefix.js +40 -0
  237. package/test-env/test/index.js +23 -1
  238. package/src/components/accessibility/_index.scss +0 -1
  239. package/src/components/accessibility/screen_reader_only/_screen_reader_only.scss +0 -5
  240. package/src/components/icon/_icon.scss +0 -87
  241. package/src/components/icon/_index.scss +0 -2
  242. package/src/components/icon/_variables.scss +0 -22
  243. package/src/components/progress/_index.scss +0 -2
  244. package/src/components/progress/_progress.scss +0 -166
  245. package/src/components/progress/_variables.scss +0 -21
  246. package/src/components/stat/_index.scss +0 -1
  247. package/src/components/stat/_stat.scss +0 -50
  248. package/src/themes/amsterdam/overrides/_progress.scss +0 -3
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.euiStatTitleStyles = exports.euiStatStyles = 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 _templateObject;
17
+
18
+ var euiStatStyles = function euiStatStyles() {
19
+ return {
20
+ euiStat: /*#__PURE__*/(0, _react.css)(";label:euiStat;"),
21
+ // Text align
22
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), " align-items:flex-start;;label:left;"),
23
+ center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), " align-items:center;;label:center;"),
24
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), " align-items:flex-end;;label:right;")
25
+ };
26
+ };
27
+
28
+ exports.euiStatStyles = euiStatStyles;
29
+
30
+ var euiStatTitleStyles = function euiStatTitleStyles(_ref) {
31
+ var euiTheme = _ref.euiTheme;
32
+ return {
33
+ euiStat__title: /*#__PURE__*/(0, _react.css)(";label:euiStat__title;"),
34
+ // Colors
35
+ default: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.fullShade, ";;label:default;"),
36
+ subdued: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
37
+ primary: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.primaryText, ";;label:primary;"),
38
+ success: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.successText, ";;label:success;"),
39
+ danger: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.dangerText, ";;label:danger;"),
40
+ accent: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.accentText, ";;label:accent;"),
41
+ // Loading
42
+ isLoading: /*#__PURE__*/(0, _react.css)(_global_styling.euiCanAnimate, "{animation:", euiStatPulse, " 1.5s infinite ease-in-out;};label:isLoading;")
43
+ };
44
+ };
45
+
46
+ exports.euiStatTitleStyles = euiStatTitleStyles;
47
+ var euiStatPulse = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% { opacity: 1; }\n 50% { opacity: .25; }\n 100% { opacity: 1; }\n"])));
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.EuiTimeline = void 0;
8
+ exports.GUTTER_SIZES = exports.EuiTimeline = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -15,22 +15,34 @@ var _react = _interopRequireDefault(require("react"));
15
15
 
16
16
  var _classnames = _interopRequireDefault(require("classnames"));
17
17
 
18
+ var _services = require("../../services");
19
+
18
20
  var _timeline_item = require("./timeline_item");
19
21
 
22
+ var _timeline = require("./timeline.styles");
23
+
20
24
  var _react2 = require("@emotion/react");
21
25
 
22
- var _excluded = ["className", "items", "children"];
26
+ var _excluded = ["className", "items", "children", "gutterSize"];
27
+ var GUTTER_SIZES = ['m', 'l', 'xl'];
28
+ exports.GUTTER_SIZES = GUTTER_SIZES;
23
29
 
24
30
  var EuiTimeline = function EuiTimeline(_ref) {
25
31
  var className = _ref.className,
26
32
  _ref$items = _ref.items,
27
33
  items = _ref$items === void 0 ? [] : _ref$items,
28
34
  children = _ref.children,
35
+ _ref$gutterSize = _ref.gutterSize,
36
+ gutterSize = _ref$gutterSize === void 0 ? 'xl' : _ref$gutterSize,
29
37
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
30
38
  var classes = (0, _classnames.default)('euiTimeline', className);
39
+ var euiTheme = (0, _services.useEuiTheme)();
40
+ var styles = (0, _timeline.euiTimelineStyles)(euiTheme);
41
+ var cssStyles = [styles.euiTimeline, styles[gutterSize]];
31
42
  return (// eslint-disable-next-line jsx-a11y/no-redundant-roles
32
43
  (0, _react2.jsx)("ol", (0, _extends2.default)({
33
44
  className: classes,
45
+ css: cssStyles,
34
46
  role: "list"
35
47
  }, rest), items.map(function (item, index) {
36
48
  return (0, _react2.jsx)(_timeline_item.EuiTimelineItem, (0, _extends2.default)({
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiTimelineStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ /*
13
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
+ * or more contributor license agreements. Licensed under the Elastic License
15
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
17
+ * Side Public License, v 1.
18
+ */
19
+ var _gutterSizeAdjustment = function _gutterSizeAdjustment(gutterSize) {
20
+ return "\n gap: ".concat(gutterSize, ";\n\n // The vertical line height needs to be adjusted with the gutter size\n [class*='euiTimelineItem-']:not(:last-child) > [class*='euiTimelineItemIcon-']::before {\n ").concat((0, _global_styling.logicalCSS)('height', "calc(100% + ".concat(gutterSize, ")")), ";\n }\n ");
21
+ }; // The vertical line should only appear when the EuiTimelineItem's
22
+ // are wrapped in a EuiTimeline. That's why these styles live here.
23
+
24
+
25
+ var timelineVerticalLine = function timelineVerticalLine(euiTheme) {
26
+ return " \n [class*='euiTimelineItem-'] > [class*='euiTimelineItemIcon-']::before {\n content: '';\n position: absolute;\n ".concat((0, _global_styling.logicalCSS)('top', 0), ";\n ").concat((0, _global_styling.logicalCSS)('width', euiTheme.size.xxs), ";\n background-color: ").concat(euiTheme.colors.lightShade, ";\n }\n\n > [class*='euiTimelineItem-center']:first-child > [class*='euiTimelineItemIcon-']::before {\n ").concat((0, _global_styling.logicalCSS)('top', '50%'), ";\n }\n \n > [class*='euiTimelineItem-center']:last-child:not(:only-child) > [class*='euiTimelineItemIcon-']::before {\n ").concat((0, _global_styling.logicalCSS)('height', '50%'), ";\n }\n ");
27
+ };
28
+
29
+ var euiTimelineStyles = function euiTimelineStyles(_ref) {
30
+ var euiTheme = _ref.euiTheme;
31
+ return {
32
+ euiTimeline: /*#__PURE__*/(0, _react.css)("display:flex;flex-direction:column;", timelineVerticalLine(euiTheme), ";;label:euiTimeline;"),
33
+ m: /*#__PURE__*/(0, _react.css)(_gutterSizeAdjustment(euiTheme.size.base), ";label:m;"),
34
+ l: /*#__PURE__*/(0, _react.css)(_gutterSizeAdjustment(euiTheme.size.l), ";label:l;"),
35
+ xl: /*#__PURE__*/(0, _react.css)(_gutterSizeAdjustment(euiTheme.size.xl), ";label:xl;")
36
+ };
37
+ };
38
+
39
+ exports.euiTimelineStyles = euiTimelineStyles;
@@ -13,8 +13,6 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
13
13
 
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
 
16
- var _services = require("../../services");
17
-
18
16
  var _timeline_item_event = require("./timeline_item_event");
19
17
 
20
18
  var _timeline_item_icon = require("./timeline_item_icon");
@@ -23,7 +21,7 @@ var _timeline_item = require("./timeline_item.styles");
23
21
 
24
22
  var _react2 = require("@emotion/react");
25
23
 
26
- var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className", "component"];
24
+ var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className"];
27
25
  var VERTICAL_ALIGN = ['top', 'center'];
28
26
  exports.VERTICAL_ALIGN = VERTICAL_ALIGN;
29
27
 
@@ -34,14 +32,10 @@ var EuiTimelineItem = function EuiTimelineItem(_ref) {
34
32
  icon = _ref.icon,
35
33
  iconAriaLabel = _ref.iconAriaLabel,
36
34
  className = _ref.className,
37
- _ref$component = _ref.component,
38
- component = _ref$component === void 0 ? 'li' : _ref$component,
39
35
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
40
- var euiTheme = (0, _services.useEuiTheme)();
41
- var styles = (0, _timeline_item.euiTimelineItemStyles)(euiTheme);
42
- var cssStyles = [styles.euiTimelineItem];
43
- var Element = component;
44
- return (0, _react2.jsx)(Element, (0, _extends2.default)({
36
+ var styles = (0, _timeline_item.euiTimelineItemStyles)();
37
+ var cssStyles = [styles.euiTimelineItem, styles[verticalAlign]];
38
+ return (0, _react2.jsx)("li", (0, _extends2.default)({
45
39
  css: cssStyles
46
40
  }, rest), (0, _react2.jsx)(_timeline_item_icon.EuiTimelineItemIcon, {
47
41
  icon: icon,
@@ -7,17 +7,24 @@ exports.euiTimelineItemStyles = void 0;
7
7
 
8
8
  var _react = require("@emotion/react");
9
9
 
10
- /*
11
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
- * or more contributor license agreements. Licensed under the Elastic License
13
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
- * in compliance with, at your election, the Elastic License 2.0 or the Server
15
- * Side Public License, v 1.
16
- */
17
- var euiTimelineItemStyles = function euiTimelineItemStyles(_ref) {
18
- var euiTheme = _ref.euiTheme;
10
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
11
+
12
+ var _ref = process.env.NODE_ENV === "production" ? {
13
+ name: "5bggde-euiTimelineItem",
14
+ styles: "display:flex;position:relative;label:euiTimelineItem;"
15
+ } : {
16
+ name: "5bggde-euiTimelineItem",
17
+ styles: "display:flex;position:relative;label:euiTimelineItem;",
18
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
19
+ };
20
+
21
+ var euiTimelineItemStyles = function euiTimelineItemStyles() {
19
22
  return {
20
- euiTimelineItem: /*#__PURE__*/(0, _react.css)("display:flex;&:not(:last-of-type){padding-bottom:", euiTheme.size.xl, ";}&:first-of-type{>[class*='euiTimelineItemIcon-center']::before{top:50%;height:calc(50% + ", euiTheme.size.xl, ");}}&:last-of-type{>[class*='euiTimelineItemIcon']::before{display:none;}&:not(:only-child)>[class*='euiTimelineItemIcon-center']::before{top:0;height:50%;}};label:euiTimelineItem;")
23
+ euiTimelineItem: _ref,
24
+ // Vertical alignments
25
+ // These classes are being targeted in timeline.styles.ts
26
+ top: /*#__PURE__*/(0, _react.css)(";label:top;"),
27
+ center: /*#__PURE__*/(0, _react.css)(";label:center;")
21
28
  };
22
29
  };
23
30
 
@@ -7,6 +7,8 @@ exports.euiTimelineItemIconStyles = void 0;
7
7
 
8
8
  var _react = require("@emotion/react");
9
9
 
10
+ var _global_styling = require("../../global_styling");
11
+
10
12
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
11
13
 
12
14
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -27,11 +29,20 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
27
29
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
30
  };
29
31
 
30
- var euiTimelineItemIconStyles = function euiTimelineItemIconStyles(_ref3) {
31
- var euiTheme = _ref3.euiTheme;
32
+ var _ref3 = process.env.NODE_ENV === "production" ? {
33
+ name: "kuz8oa-euiTimelineItemIcon__content",
34
+ styles: "display:flex;justify-content:center;align-items:center;position:relative;label:euiTimelineItemIcon__content;"
35
+ } : {
36
+ name: "kuz8oa-euiTimelineItemIcon__content",
37
+ styles: "display:flex;justify-content:center;align-items:center;position:relative;label:euiTimelineItemIcon__content;",
38
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
39
+ };
40
+
41
+ var euiTimelineItemIconStyles = function euiTimelineItemIconStyles(_ref4) {
42
+ var euiTheme = _ref4.euiTheme;
32
43
  return {
33
- euiTimelineItemIcon: /*#__PURE__*/(0, _react.css)("display:flex;position:relative;flex-grow:0;margin-right:", euiTheme.size.base, ";&::before{content:'';position:absolute;top:0;left:calc(", euiTheme.size.xxl, " / 2);width:calc(", euiTheme.size.xs, " / 2);height:calc(100% + ", euiTheme.size.xl, ");background-color:", euiTheme.colors.lightShade, ";};label:euiTimelineItemIcon;"),
34
- euiTimelineItemIcon__content: /*#__PURE__*/(0, _react.css)("min-width:", euiTheme.size.xxl, ";display:flex;justify-content:center;align-items:center;position:relative;;label:euiTimelineItemIcon__content;"),
44
+ euiTimelineItemIcon: /*#__PURE__*/(0, _react.css)("display:flex;position:relative;flex-grow:0;justify-content:center;", (0, _global_styling.logicalCSS)('margin-right', euiTheme.size.base), ";;label:euiTimelineItemIcon;"),
45
+ euiTimelineItemIcon__content: _ref3,
35
46
  // Vertical alignments
36
47
  top: _ref2,
37
48
  center: _ref
@@ -50,9 +50,9 @@ var logicalPaddings = {
50
50
  };
51
51
  var logicalPosition = {
52
52
  top: 'inset-block-start',
53
- right: 'inset-inline-start',
53
+ right: 'inset-inline-end',
54
54
  bottom: 'inset-block-end',
55
- left: 'inset-inline-end',
55
+ left: 'inset-inline-start',
56
56
  horizontal: 'inset-block',
57
57
  vertical: 'inset-inline',
58
58
  inset: 'inset'
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.EuiUtilityClasses = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _react2 = require("@emotion/react");
13
+
14
+ var _screen_reader_only = require("../../components/accessibility/screen_reader_only/screen_reader_only.styles");
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
+ */
23
+ var globalStyles = /*#__PURE__*/(0, _react2.css)(".euiScreenReaderOnly{", (0, _screen_reader_only.euiScreenReaderOnly)(), ";};label:globalStyles;");
24
+
25
+ var EuiUtilityClasses = function EuiUtilityClasses() {
26
+ return (0, _react2.jsx)(_react2.Global, {
27
+ styles: globalStyles
28
+ });
29
+ };
30
+
31
+ exports.EuiUtilityClasses = EuiUtilityClasses;
@@ -41,8 +41,10 @@ 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
- var componentName = Component.displayName || Component.name || 'Component';
47
+ var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
46
48
 
47
49
  var Render = function Render(props, ref) {
48
50
  var _useEuiTheme = useEuiTheme(),
@@ -61,7 +63,7 @@ var withEuiTheme = function withEuiTheme(Component) {
61
63
  };
62
64
 
63
65
  var WithEuiTheme = /*#__PURE__*/(0, _react.forwardRef)(Render);
64
- WithEuiTheme.displayName = "WithEuiTheme(".concat(componentName, ")");
66
+ WithEuiTheme.displayName = componentName;
65
67
  return WithEuiTheme;
66
68
  };
67
69
 
@@ -13,14 +13,14 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
13
13
 
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
 
16
- var _react2 = require("@emotion/react");
17
-
18
16
  var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
19
17
 
20
18
  var _context = require("./context");
21
19
 
22
20
  var _utils = require("./utils");
23
21
 
22
+ var _react2 = require("@emotion/react");
23
+
24
24
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
25
 
26
26
  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; }
@@ -36,7 +36,6 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
36
36
  var _system = _ref.theme,
37
37
  _colorMode = _ref.colorMode,
38
38
  _modifications = _ref.modify,
39
- cache = _ref.cache,
40
39
  children = _ref.children;
41
40
  var parentSystem = (0, _react.useContext)(_context.EuiSystemContext);
42
41
  var parentModifications = (0, _react.useContext)(_context.EuiModificationsContext);
@@ -110,9 +109,7 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
110
109
  value: modifications
111
110
  }, (0, _react2.jsx)(_context.EuiThemeContext.Provider, {
112
111
  value: theme
113
- }, cache ? (0, _react2.jsx)(_react2.CacheProvider, {
114
- value: cache
115
- }, children) : children))));
112
+ }, children))));
116
113
  };
117
114
 
118
115
  exports.EuiThemeProvider = EuiThemeProvider;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.replaceEmotionPrefix = void 0;
11
+
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+
14
+ var _setPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/setPrototypeOf"));
15
+
16
+ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); _groups.set(_this, groups || _groups.get(re)); return (0, _setPrototypeOf2.default)(_this, BabelRegExp.prototype); } (0, _inherits2.default)(BabelRegExp, RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; if (_typeof(args[args.length - 1]) !== "object") { args = [].slice.call(args); args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }
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
+ */
25
+ var replaceEmotionPrefix = function replaceEmotionPrefix(selector) {
26
+ var _euiMatch$groups;
27
+
28
+ // Matches the Emotion className pattern + the EUI variant naming convention.
29
+ // Starts with `css-[hash]-`.
30
+ // Contains `eui[ComponentName] or `Eui[ComponentName]`.
31
+ // Capture the component name (from above) and all variant additions until the end of the string.
32
+ var euiMatch = selector.match( /*#__PURE__*/_wrapRegExp(/css\x2D[0-9A-Z_a-z]{6,}\x2D([Ee]ui[A-Z][\x2D0-9A-Z_a-z]*$)/, {
33
+ euiComponent: 1
34
+ })); // Use the captured group (`euiComponent`) if available and prepend with `emotion-`,
35
+ // otherwise use the full selector.
36
+
37
+ return euiMatch !== null && euiMatch !== void 0 && (_euiMatch$groups = euiMatch.groups) !== null && _euiMatch$groups !== void 0 && _euiMatch$groups.euiComponent ? "emotion-".concat(euiMatch.groups.euiComponent) : selector;
38
+ };
39
+
40
+ exports.replaceEmotionPrefix = replaceEmotionPrefix;
@@ -36,6 +36,10 @@ declare module '@elastic/eui/optimize/lib/test/react_warnings' {
36
36
  declare module '@elastic/eui/optimize/lib/test/sleep' {
37
37
  export function sleep(ms?: number): Promise<unknown>;
38
38
 
39
+ }
40
+ declare module '@elastic/eui/optimize/lib/test/emotion-prefix' {
41
+ export const replaceEmotionPrefix: (selector: string) => string;
42
+
39
43
  }
40
44
  declare module '@elastic/eui/optimize/lib/test' {
41
45
  export { requiredProps } from '@elastic/eui/optimize/lib/test/required_props';
@@ -43,5 +47,6 @@ declare module '@elastic/eui/optimize/lib/test' {
43
47
  export { findTestSubject } from '@elastic/eui/optimize/lib/test/find_test_subject';
44
48
  export { startThrowingReactWarnings, stopThrowingReactWarnings, } from '@elastic/eui/optimize/lib/test/react_warnings';
45
49
  export { sleep } from '@elastic/eui/optimize/lib/test/sleep';
50
+ export * from '@elastic/eui/optimize/lib/test/emotion-prefix';
46
51
 
47
52
  }
@@ -3,6 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ requiredProps: true,
8
+ takeMountedSnapshot: true,
9
+ findTestSubject: true,
10
+ startThrowingReactWarnings: true,
11
+ stopThrowingReactWarnings: true,
12
+ sleep: true
13
+ };
6
14
  Object.defineProperty(exports, "findTestSubject", {
7
15
  enumerable: true,
8
16
  get: function get() {
@@ -48,4 +56,18 @@ var _find_test_subject = require("./find_test_subject");
48
56
 
49
57
  var _react_warnings = require("./react_warnings");
50
58
 
51
- var _sleep = require("./sleep");
59
+ var _sleep = require("./sleep");
60
+
61
+ var _emotionPrefix = require("./emotion-prefix");
62
+
63
+ Object.keys(_emotionPrefix).forEach(function (key) {
64
+ if (key === "default" || key === "__esModule") return;
65
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
66
+ if (key in exports && exports[key] === _emotionPrefix[key]) return;
67
+ Object.defineProperty(exports, key, {
68
+ enumerable: true,
69
+ get: function get() {
70
+ return _emotionPrefix[key];
71
+ }
72
+ });
73
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elastic/eui",
3
3
  "description": "Elastic UI Component Library",
4
- "version": "59.1.0",
4
+ "version": "60.1.0",
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.9.0",
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,13 +37,11 @@
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';
46
43
  @import 'search_bar/index';
47
44
  @import 'selectable/index';
48
- @import 'stat/index';
49
45
  @import 'steps/index';
50
46
  @import 'suggest/index';
51
47
  @import 'table/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
  };