@elastic/eui 59.1.0-rc1 → 60.0.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 (236) hide show
  1. package/dist/eui_charts_theme.js +330 -330
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +0 -48
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -48
  6. package/dist/eui_theme_light.min.css +1 -1
  7. package/es/components/accessibility/skip_link/skip_link.js +42 -7
  8. package/es/components/accessibility/skip_link/skip_link.styles.js +1 -1
  9. package/es/components/avatar/avatar.js +7 -9
  10. package/es/components/bottom_bar/bottom_bar.js +9 -8
  11. package/es/components/breadcrumbs/breadcrumbs.js +1 -2
  12. package/es/components/call_out/call_out.js +8 -9
  13. package/es/components/combo_box/matching_options.js +3 -2
  14. package/es/components/expression/expression.js +10 -11
  15. package/es/components/facet/facet_button.js +8 -9
  16. package/es/components/facet/facet_group.js +7 -8
  17. package/es/components/health/health.js +6 -7
  18. package/es/components/horizontal_rule/horizontal_rule.js +6 -7
  19. package/es/components/link/link.js +7 -8
  20. package/es/components/loading/loading_chart.js +6 -7
  21. package/es/components/loading/loading_content.js +6 -7
  22. package/es/components/loading/loading_logo.js +6 -7
  23. package/es/components/loading/loading_spinner.js +6 -7
  24. package/es/components/mark/mark.js +8 -9
  25. package/es/components/markdown_editor/markdown_format.js +6 -7
  26. package/es/components/panel/panel.js +7 -8
  27. package/es/components/provider/cache/index.js +0 -1
  28. package/es/components/provider/index.js +1 -1
  29. package/es/components/provider/provider.js +3 -7
  30. package/es/components/selectable/selectable.js +39 -22
  31. package/es/components/spacer/spacer.js +6 -7
  32. package/es/components/stat/stat.js +28 -35
  33. package/es/components/stat/stat.styles.js +38 -0
  34. package/es/components/text/text.js +6 -7
  35. package/es/components/text/text_color.js +6 -7
  36. package/es/components/timeline/timeline.js +15 -8
  37. package/es/components/timeline/timeline.styles.js +29 -0
  38. package/es/components/timeline/timeline_item.js +7 -20
  39. package/es/components/timeline/timeline_item.styles.js +18 -3
  40. package/es/components/timeline/timeline_item_icon.js +6 -7
  41. package/es/components/timeline/timeline_item_icon.styles.js +14 -4
  42. package/es/components/title/title.js +6 -7
  43. package/es/global_styling/functions/logicals.js +2 -2
  44. package/es/global_styling/utility/utility.js +1 -13
  45. package/es/test/emotion-prefix.js +29 -0
  46. package/es/test/index.d.ts +5 -0
  47. package/es/test/index.js +2 -1
  48. package/es/{components/provider/system → themes/amsterdam}/index.js +2 -1
  49. package/es/themes/index.js +2 -1
  50. package/eui.d.ts +507 -941
  51. package/i18ntokens.json +28 -28
  52. package/lib/components/accessibility/skip_link/skip_link.js +45 -11
  53. package/lib/components/accessibility/skip_link/skip_link.styles.js +1 -1
  54. package/lib/components/avatar/avatar.js +8 -12
  55. package/lib/components/bottom_bar/bottom_bar.js +6 -9
  56. package/lib/components/breadcrumbs/breadcrumbs.js +1 -2
  57. package/lib/components/call_out/call_out.js +10 -14
  58. package/lib/components/combo_box/matching_options.js +3 -2
  59. package/lib/components/expression/expression.js +12 -14
  60. package/lib/components/facet/facet_button.js +10 -12
  61. package/lib/components/facet/facet_group.js +9 -11
  62. package/lib/components/health/health.js +8 -10
  63. package/lib/components/horizontal_rule/horizontal_rule.js +8 -10
  64. package/lib/components/link/link.js +7 -13
  65. package/lib/components/loading/loading_chart.js +8 -10
  66. package/lib/components/loading/loading_content.js +8 -10
  67. package/lib/components/loading/loading_logo.js +8 -10
  68. package/lib/components/loading/loading_spinner.js +8 -10
  69. package/lib/components/mark/mark.js +10 -12
  70. package/lib/components/markdown_editor/markdown_format.js +8 -10
  71. package/lib/components/panel/panel.js +9 -11
  72. package/lib/components/provider/cache/index.js +0 -13
  73. package/lib/components/provider/index.js +7 -12
  74. package/lib/components/provider/provider.js +2 -6
  75. package/lib/components/selectable/selectable.js +39 -22
  76. package/lib/components/spacer/spacer.js +8 -10
  77. package/lib/components/stat/stat.js +30 -40
  78. package/lib/components/stat/stat.styles.js +45 -0
  79. package/lib/components/text/text.js +8 -10
  80. package/lib/components/text/text_color.js +8 -10
  81. package/lib/components/timeline/timeline.js +20 -9
  82. package/lib/components/timeline/timeline.styles.js +39 -0
  83. package/lib/components/timeline/timeline_item.js +9 -24
  84. package/lib/components/timeline/timeline_item.styles.js +17 -10
  85. package/lib/components/timeline/timeline_item_icon.js +8 -10
  86. package/lib/components/timeline/timeline_item_icon.styles.js +15 -4
  87. package/lib/components/title/title.js +9 -11
  88. package/lib/global_styling/functions/logicals.js +2 -2
  89. package/lib/global_styling/utility/utility.js +8 -12
  90. package/lib/test/emotion-prefix.js +38 -0
  91. package/lib/test/index.d.ts +5 -0
  92. package/lib/test/index.js +23 -1
  93. package/lib/{components/provider/system → themes/amsterdam}/index.js +4 -4
  94. package/lib/themes/index.js +21 -1
  95. package/optimize/es/components/accessibility/skip_link/skip_link.js +27 -6
  96. package/optimize/es/components/accessibility/skip_link/skip_link.styles.js +1 -1
  97. package/optimize/es/components/avatar/avatar.js +5 -7
  98. package/optimize/es/components/bottom_bar/bottom_bar.js +9 -8
  99. package/optimize/es/components/breadcrumbs/breadcrumbs.js +1 -2
  100. package/optimize/es/components/call_out/call_out.js +7 -8
  101. package/optimize/es/components/combo_box/matching_options.js +3 -2
  102. package/optimize/es/components/expression/expression.js +9 -10
  103. package/optimize/es/components/facet/facet_button.js +7 -8
  104. package/optimize/es/components/facet/facet_group.js +6 -7
  105. package/optimize/es/components/health/health.js +5 -6
  106. package/optimize/es/components/horizontal_rule/horizontal_rule.js +5 -6
  107. package/optimize/es/components/link/link.js +6 -7
  108. package/optimize/es/components/loading/loading_chart.js +5 -6
  109. package/optimize/es/components/loading/loading_content.js +5 -6
  110. package/optimize/es/components/loading/loading_logo.js +5 -6
  111. package/optimize/es/components/loading/loading_spinner.js +5 -6
  112. package/optimize/es/components/mark/mark.js +7 -8
  113. package/optimize/es/components/markdown_editor/markdown_format.js +5 -6
  114. package/optimize/es/components/panel/panel.js +6 -7
  115. package/optimize/es/components/provider/cache/index.js +0 -1
  116. package/optimize/es/components/provider/index.js +1 -1
  117. package/optimize/es/components/provider/provider.js +3 -7
  118. package/optimize/es/components/selectable/selectable.js +33 -22
  119. package/optimize/es/components/spacer/spacer.js +5 -6
  120. package/optimize/es/components/stat/stat.js +25 -33
  121. package/optimize/es/components/stat/stat.styles.js +38 -0
  122. package/optimize/es/components/text/text.js +5 -6
  123. package/optimize/es/components/text/text_color.js +5 -6
  124. package/optimize/es/components/timeline/timeline.js +10 -1
  125. package/optimize/es/components/timeline/timeline.styles.js +29 -0
  126. package/optimize/es/components/timeline/timeline_item.js +6 -12
  127. package/optimize/es/components/timeline/timeline_item.styles.js +18 -3
  128. package/optimize/es/components/timeline/timeline_item_icon.js +5 -6
  129. package/optimize/es/components/timeline/timeline_item_icon.styles.js +14 -4
  130. package/optimize/es/components/title/title.js +5 -6
  131. package/optimize/es/global_styling/functions/logicals.js +2 -2
  132. package/optimize/es/global_styling/utility/utility.js +1 -13
  133. package/optimize/es/test/emotion-prefix.js +27 -0
  134. package/optimize/es/test/index.d.ts +5 -0
  135. package/optimize/es/test/index.js +2 -1
  136. package/optimize/es/{components/provider/system → themes/amsterdam}/index.js +2 -1
  137. package/optimize/es/themes/index.js +2 -1
  138. package/optimize/lib/components/accessibility/skip_link/skip_link.js +30 -8
  139. package/optimize/lib/components/accessibility/skip_link/skip_link.styles.js +1 -1
  140. package/optimize/lib/components/avatar/avatar.js +5 -9
  141. package/optimize/lib/components/bottom_bar/bottom_bar.js +6 -9
  142. package/optimize/lib/components/breadcrumbs/breadcrumbs.js +1 -2
  143. package/optimize/lib/components/call_out/call_out.js +9 -13
  144. package/optimize/lib/components/combo_box/matching_options.js +3 -2
  145. package/optimize/lib/components/expression/expression.js +9 -11
  146. package/optimize/lib/components/facet/facet_button.js +7 -9
  147. package/optimize/lib/components/facet/facet_group.js +6 -8
  148. package/optimize/lib/components/health/health.js +5 -7
  149. package/optimize/lib/components/horizontal_rule/horizontal_rule.js +5 -7
  150. package/optimize/lib/components/link/link.js +6 -12
  151. package/optimize/lib/components/loading/loading_chart.js +5 -7
  152. package/optimize/lib/components/loading/loading_content.js +5 -7
  153. package/optimize/lib/components/loading/loading_logo.js +5 -7
  154. package/optimize/lib/components/loading/loading_spinner.js +5 -7
  155. package/optimize/lib/components/mark/mark.js +7 -9
  156. package/optimize/lib/components/markdown_editor/markdown_format.js +5 -7
  157. package/optimize/lib/components/panel/panel.js +6 -8
  158. package/optimize/lib/components/provider/cache/index.js +0 -13
  159. package/optimize/lib/components/provider/index.js +7 -12
  160. package/optimize/lib/components/provider/provider.js +2 -6
  161. package/optimize/lib/components/selectable/selectable.js +33 -22
  162. package/optimize/lib/components/spacer/spacer.js +5 -7
  163. package/optimize/lib/components/stat/stat.js +27 -37
  164. package/optimize/lib/components/stat/stat.styles.js +47 -0
  165. package/optimize/lib/components/text/text.js +5 -7
  166. package/optimize/lib/components/text/text_color.js +5 -7
  167. package/optimize/lib/components/timeline/timeline.js +14 -2
  168. package/optimize/lib/components/timeline/timeline.styles.js +39 -0
  169. package/optimize/lib/components/timeline/timeline_item.js +6 -14
  170. package/optimize/lib/components/timeline/timeline_item.styles.js +17 -10
  171. package/optimize/lib/components/timeline/timeline_item_icon.js +5 -7
  172. package/optimize/lib/components/timeline/timeline_item_icon.styles.js +15 -4
  173. package/optimize/lib/components/title/title.js +6 -8
  174. package/optimize/lib/global_styling/functions/logicals.js +2 -2
  175. package/optimize/lib/global_styling/utility/utility.js +8 -12
  176. package/optimize/lib/test/emotion-prefix.js +40 -0
  177. package/optimize/lib/test/index.d.ts +5 -0
  178. package/optimize/lib/test/index.js +23 -1
  179. package/{test-env/components/provider/system → optimize/lib/themes/amsterdam}/index.js +4 -4
  180. package/optimize/lib/themes/index.js +21 -1
  181. package/package.json +2 -2
  182. package/src/components/index.scss +0 -1
  183. package/test-env/components/accessibility/skip_link/skip_link.js +46 -11
  184. package/test-env/components/accessibility/skip_link/skip_link.styles.js +1 -1
  185. package/test-env/components/avatar/avatar.js +8 -12
  186. package/test-env/components/bottom_bar/bottom_bar.js +6 -9
  187. package/test-env/components/breadcrumbs/breadcrumbs.js +1 -2
  188. package/test-env/components/call_out/call_out.js +10 -14
  189. package/test-env/components/combo_box/matching_options.js +3 -2
  190. package/test-env/components/expression/expression.js +12 -14
  191. package/test-env/components/facet/facet_button.js +10 -12
  192. package/test-env/components/facet/facet_group.js +9 -11
  193. package/test-env/components/health/health.js +8 -10
  194. package/test-env/components/horizontal_rule/horizontal_rule.js +8 -10
  195. package/test-env/components/link/link.js +7 -13
  196. package/test-env/components/loading/loading_chart.js +8 -10
  197. package/test-env/components/loading/loading_content.js +8 -10
  198. package/test-env/components/loading/loading_logo.js +8 -10
  199. package/test-env/components/loading/loading_spinner.js +8 -10
  200. package/test-env/components/mark/mark.js +10 -12
  201. package/test-env/components/markdown_editor/markdown_format.js +8 -10
  202. package/test-env/components/panel/panel.js +9 -11
  203. package/test-env/components/provider/cache/index.js +0 -13
  204. package/test-env/components/provider/index.js +7 -12
  205. package/test-env/components/provider/provider.js +2 -6
  206. package/test-env/components/selectable/selectable.js +39 -22
  207. package/test-env/components/spacer/spacer.js +8 -10
  208. package/test-env/components/stat/stat.js +29 -39
  209. package/test-env/components/stat/stat.styles.js +47 -0
  210. package/test-env/components/text/text.js +8 -10
  211. package/test-env/components/text/text_color.js +8 -10
  212. package/test-env/components/timeline/timeline.js +19 -9
  213. package/test-env/components/timeline/timeline.styles.js +39 -0
  214. package/test-env/components/timeline/timeline_item.js +9 -24
  215. package/test-env/components/timeline/timeline_item.styles.js +17 -10
  216. package/test-env/components/timeline/timeline_item_icon.js +8 -10
  217. package/test-env/components/timeline/timeline_item_icon.styles.js +15 -4
  218. package/test-env/components/title/title.js +9 -11
  219. package/test-env/global_styling/functions/logicals.js +2 -2
  220. package/test-env/global_styling/utility/utility.js +8 -12
  221. package/test-env/test/emotion-prefix.js +40 -0
  222. package/test-env/test/index.js +23 -1
  223. package/{optimize/lib/components/provider/system → test-env/themes/amsterdam}/index.js +4 -4
  224. package/test-env/themes/index.js +21 -1
  225. package/es/components/provider/cache/cache_context.js +0 -12
  226. package/es/components/provider/system/system.js +0 -33
  227. package/lib/components/provider/cache/cache_context.js +0 -24
  228. package/lib/components/provider/system/system.js +0 -45
  229. package/optimize/es/components/provider/cache/cache_context.js +0 -12
  230. package/optimize/es/components/provider/system/system.js +0 -33
  231. package/optimize/lib/components/provider/cache/cache_context.js +0 -24
  232. package/optimize/lib/components/provider/system/system.js +0 -54
  233. package/src/components/stat/_index.scss +0 -1
  234. package/src/components/stat/_stat.scss +0 -50
  235. package/test-env/components/provider/cache/cache_context.js +0 -24
  236. package/test-env/components/provider/system/system.js +0 -54
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports._EuiText = exports.TEXT_SIZES = exports.EuiText = void 0;
6
+ exports.TEXT_SIZES = exports.EuiText = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _system = require("../provider/system");
14
+ var _services = require("../../services");
15
15
 
16
16
  var _text = require("./text.styles");
17
17
 
@@ -21,7 +21,7 @@ var _text_align = require("./text_align");
21
21
 
22
22
  var _react2 = require("@emotion/react");
23
23
 
24
- var _excluded = ["size", "color", "grow", "textAlign", "children", "className", "euiTheme"];
24
+ var _excluded = ["size", "color", "grow", "textAlign", "children", "className"];
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
27
 
@@ -34,7 +34,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
34
34
  var TEXT_SIZES = ['xs', 's', 'm', 'relative'];
35
35
  exports.TEXT_SIZES = TEXT_SIZES;
36
36
 
37
- var _EuiText = function _EuiText(_ref) {
37
+ var EuiText = function EuiText(_ref) {
38
38
  var _ref$size = _ref.size,
39
39
  size = _ref$size === void 0 ? 'm' : _ref$size,
40
40
  color = _ref.color,
@@ -43,9 +43,9 @@ var _EuiText = function _EuiText(_ref) {
43
43
  textAlign = _ref.textAlign,
44
44
  children = _ref.children,
45
45
  className = _ref.className,
46
- euiTheme = _ref.euiTheme,
47
46
  rest = _objectWithoutProperties(_ref, _excluded);
48
47
 
48
+ var euiTheme = (0, _services.useEuiTheme)();
49
49
  var styles = (0, _text.euiTextStyles)(euiTheme);
50
50
  var cssStyles = [styles.euiText, !grow ? styles.constrainedWidth : undefined, styles[size]];
51
51
  var classes = (0, _classnames.default)('euiText', className);
@@ -71,8 +71,8 @@ var _EuiText = function _EuiText(_ref) {
71
71
  return text;
72
72
  };
73
73
 
74
- exports._EuiText = _EuiText;
75
- _EuiText.propTypes = {
74
+ exports.EuiText = EuiText;
75
+ EuiText.propTypes = {
76
76
  className: _propTypes.default.string,
77
77
  "aria-label": _propTypes.default.string,
78
78
  "data-test-subj": _propTypes.default.string,
@@ -88,6 +88,4 @@ _EuiText.propTypes = {
88
88
  */
89
89
  color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.any.isRequired]),
90
90
  grow: _propTypes.default.bool
91
- };
92
- var EuiText = (0, _system.withEuiSystem)(_EuiText);
93
- exports.EuiText = EuiText;
91
+ };
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports._EuiTextColor = exports.EuiTextColor = exports.COLORS = void 0;
8
+ exports.EuiTextColor = exports.COLORS = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -13,13 +13,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
 
14
14
  var _clone_element = require("../../services/theme/clone_element");
15
15
 
16
- var _system = require("../provider/system");
16
+ var _services = require("../../services");
17
17
 
18
18
  var _text_color = require("./text_color.styles");
19
19
 
20
20
  var _react2 = require("@emotion/react");
21
21
 
22
- var _excluded = ["children", "color", "component", "cloneElement", "style", "euiTheme"];
22
+ var _excluded = ["children", "color", "component", "cloneElement", "style"];
23
23
 
24
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
25
 
@@ -40,7 +40,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
40
40
  var COLORS = ['default', 'subdued', 'success', 'accent', 'danger', 'warning', 'ghost', 'inherit'];
41
41
  exports.COLORS = COLORS;
42
42
 
43
- var _EuiTextColor = function _EuiTextColor(_ref) {
43
+ var EuiTextColor = function EuiTextColor(_ref) {
44
44
  var children = _ref.children,
45
45
  _ref$color = _ref.color,
46
46
  color = _ref$color === void 0 ? 'default' : _ref$color,
@@ -49,10 +49,10 @@ var _EuiTextColor = function _EuiTextColor(_ref) {
49
49
  _ref$cloneElement = _ref.cloneElement,
50
50
  cloneElement = _ref$cloneElement === void 0 ? false : _ref$cloneElement,
51
51
  style = _ref.style,
52
- euiTheme = _ref.euiTheme,
53
52
  rest = _objectWithoutProperties(_ref, _excluded);
54
53
 
55
54
  var isNamedColor = COLORS.includes(color);
55
+ var euiTheme = (0, _services.useEuiTheme)();
56
56
  var styles = (0, _text_color.euiTextColorStyles)(euiTheme);
57
57
  var cssStyles = [styles.euiTextColor, isNamedColor ? styles[color] : styles.customColor]; // We're checking if is a custom color.
58
58
  // If it is a custom color we set the `color` of the `.euiTextColor` div to that custom color.
@@ -79,8 +79,8 @@ var _EuiTextColor = function _EuiTextColor(_ref) {
79
79
  }
80
80
  };
81
81
 
82
- exports._EuiTextColor = _EuiTextColor;
83
- _EuiTextColor.propTypes = {
82
+ exports.EuiTextColor = EuiTextColor;
83
+ EuiTextColor.propTypes = {
84
84
  className: _propTypes.default.string,
85
85
  "aria-label": _propTypes.default.string,
86
86
  "data-test-subj": _propTypes.default.string,
@@ -100,6 +100,4 @@ _EuiTextColor.propTypes = {
100
100
  * Can only be used when wrapping a *single* child element/tag, and not raw text.
101
101
  */
102
102
  cloneElement: _propTypes.default.bool
103
- };
104
- var EuiTextColor = (0, _system.withEuiSystem)(_EuiTextColor);
105
- exports.EuiTextColor = EuiTextColor;
103
+ };
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EuiTimeline = void 0;
6
+ exports.GUTTER_SIZES = exports.EuiTimeline = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -11,11 +11,15 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
+ var _services = require("../../services");
15
+
14
16
  var _timeline_item = require("./timeline_item");
15
17
 
18
+ var _timeline = require("./timeline.styles");
19
+
16
20
  var _react2 = require("@emotion/react");
17
21
 
18
- var _excluded = ["className", "items", "children"];
22
+ var _excluded = ["className", "items", "children", "gutterSize"];
19
23
 
20
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
25
 
@@ -25,17 +29,26 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
25
29
 
26
30
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
27
31
 
32
+ var GUTTER_SIZES = ['m', 'l', 'xl'];
33
+ exports.GUTTER_SIZES = GUTTER_SIZES;
34
+
28
35
  var EuiTimeline = function EuiTimeline(_ref) {
29
36
  var className = _ref.className,
30
37
  _ref$items = _ref.items,
31
38
  items = _ref$items === void 0 ? [] : _ref$items,
32
39
  children = _ref.children,
40
+ _ref$gutterSize = _ref.gutterSize,
41
+ gutterSize = _ref$gutterSize === void 0 ? 'xl' : _ref$gutterSize,
33
42
  rest = _objectWithoutProperties(_ref, _excluded);
34
43
 
35
44
  var classes = (0, _classnames.default)('euiTimeline', className);
45
+ var euiTheme = (0, _services.useEuiTheme)();
46
+ var styles = (0, _timeline.euiTimelineStyles)(euiTheme);
47
+ var cssStyles = [styles.euiTimeline, styles[gutterSize]];
36
48
  return (// eslint-disable-next-line jsx-a11y/no-redundant-roles
37
49
  (0, _react2.jsx)("ol", _extends({
38
50
  className: classes,
51
+ css: cssStyles,
39
52
  role: "list"
40
53
  }, rest), items.map(function (item, index) {
41
54
  return (0, _react2.jsx)(_timeline_item.EuiTimelineItem, _extends({
@@ -55,17 +68,15 @@ EuiTimeline.propTypes = {
55
68
  * Vertical alignment of the event with the icon
56
69
  */
57
70
  verticalAlign: _propTypes.default.any,
58
-
59
- /**
60
- * Sets the HTML element for `EuiTimelineItem`.
61
- * By default, the element renders as a `<li/>`.
62
- * Only change the HTML element when it is not wrapped in a `EuiTimeline` that renders as a `<ol/>`.
63
- */
64
- component: _propTypes.default.any,
65
71
  className: _propTypes.default.string,
66
72
  "aria-label": _propTypes.default.string,
67
73
  "data-test-subj": _propTypes.default.string
68
74
  }).isRequired),
75
+
76
+ /**
77
+ * Sets the size of the vertical space between each timeline item
78
+ */
79
+ gutterSize: _propTypes.default.any,
69
80
  className: _propTypes.default.string,
70
81
  "aria-label": _propTypes.default.string,
71
82
  "data-test-subj": _propTypes.default.string
@@ -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;
@@ -3,14 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports._EuiTimelineItem = exports.VERTICAL_ALIGN = exports.EuiTimelineItem = void 0;
6
+ exports.VERTICAL_ALIGN = exports.EuiTimelineItem = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
- var _system = require("../provider/system");
13
-
14
12
  var _timeline_item_event = require("./timeline_item_event");
15
13
 
16
14
  var _timeline_item_icon = require("./timeline_item_icon");
@@ -19,7 +17,7 @@ var _timeline_item = require("./timeline_item.styles");
19
17
 
20
18
  var _react2 = require("@emotion/react");
21
19
 
22
- var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className", "component", "euiTheme"];
20
+ var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className"];
23
21
 
24
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
23
 
@@ -32,22 +30,18 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
32
30
  var VERTICAL_ALIGN = ['top', 'center'];
33
31
  exports.VERTICAL_ALIGN = VERTICAL_ALIGN;
34
32
 
35
- var _EuiTimelineItem = function _EuiTimelineItem(_ref) {
33
+ var EuiTimelineItem = function EuiTimelineItem(_ref) {
36
34
  var children = _ref.children,
37
35
  _ref$verticalAlign = _ref.verticalAlign,
38
36
  verticalAlign = _ref$verticalAlign === void 0 ? 'center' : _ref$verticalAlign,
39
37
  icon = _ref.icon,
40
38
  iconAriaLabel = _ref.iconAriaLabel,
41
39
  className = _ref.className,
42
- _ref$component = _ref.component,
43
- component = _ref$component === void 0 ? 'li' : _ref$component,
44
- euiTheme = _ref.euiTheme,
45
40
  rest = _objectWithoutProperties(_ref, _excluded);
46
41
 
47
- var styles = (0, _timeline_item.euiTimelineItemStyles)(euiTheme);
48
- var cssStyles = [styles.euiTimelineItem];
49
- var Element = component;
50
- return (0, _react2.jsx)(Element, _extends({
42
+ var styles = (0, _timeline_item.euiTimelineItemStyles)();
43
+ var cssStyles = [styles.euiTimelineItem, styles[verticalAlign]];
44
+ return (0, _react2.jsx)("li", _extends({
51
45
  css: cssStyles
52
46
  }, rest), (0, _react2.jsx)(_timeline_item_icon.EuiTimelineItemIcon, {
53
47
  icon: icon,
@@ -58,22 +52,13 @@ var _EuiTimelineItem = function _EuiTimelineItem(_ref) {
58
52
  }, children));
59
53
  };
60
54
 
61
- exports._EuiTimelineItem = _EuiTimelineItem;
62
- _EuiTimelineItem.propTypes = {
55
+ exports.EuiTimelineItem = EuiTimelineItem;
56
+ EuiTimelineItem.propTypes = {
63
57
  /**
64
58
  * Vertical alignment of the event with the icon
65
59
  */
66
60
  verticalAlign: _propTypes.default.any,
67
-
68
- /**
69
- * Sets the HTML element for `EuiTimelineItem`.
70
- * By default, the element renders as a `<li/>`.
71
- * Only change the HTML element when it is not wrapped in a `EuiTimeline` that renders as a `<ol/>`.
72
- */
73
- component: _propTypes.default.any,
74
61
  className: _propTypes.default.string,
75
62
  "aria-label": _propTypes.default.string,
76
63
  "data-test-subj": _propTypes.default.string
77
- };
78
- var EuiTimelineItem = (0, _system.withEuiSystem)(_EuiTimelineItem);
79
- exports.EuiTimelineItem = EuiTimelineItem;
64
+ };
@@ -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
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports._EuiTimelineItemIcon = exports.EuiTimelineItemIcon = void 0;
6
+ exports.EuiTimelineItemIcon = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -11,7 +11,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
12
  var _avatar = require("../avatar");
13
13
 
14
- var _system = require("../provider/system");
14
+ var _services = require("../../services");
15
15
 
16
16
  var _timeline_item_icon = require("./timeline_item_icon.styles");
17
17
 
@@ -26,12 +26,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
26
26
  * in compliance with, at your election, the Elastic License 2.0 or the Server
27
27
  * Side Public License, v 1.
28
28
  */
29
- var _EuiTimelineItemIcon = function _EuiTimelineItemIcon(_ref) {
29
+ var EuiTimelineItemIcon = function EuiTimelineItemIcon(_ref) {
30
30
  var icon = _ref.icon,
31
31
  _ref$verticalAlign = _ref.verticalAlign,
32
32
  verticalAlign = _ref$verticalAlign === void 0 ? 'center' : _ref$verticalAlign,
33
- iconAriaLabel = _ref.iconAriaLabel,
34
- euiTheme = _ref.euiTheme;
33
+ iconAriaLabel = _ref.iconAriaLabel;
34
+ var euiTheme = (0, _services.useEuiTheme)();
35
35
  var styles = (0, _timeline_item_icon.euiTimelineItemIconStyles)(euiTheme);
36
36
  var cssStyles = [styles.euiTimelineItemIcon, styles[verticalAlign]];
37
37
  var cssContentStyles = styles.euiTimelineItemIcon__content;
@@ -48,8 +48,8 @@ var _EuiTimelineItemIcon = function _EuiTimelineItemIcon(_ref) {
48
48
  }, iconRender));
49
49
  };
50
50
 
51
- exports._EuiTimelineItemIcon = _EuiTimelineItemIcon;
52
- _EuiTimelineItemIcon.propTypes = {
51
+ exports.EuiTimelineItemIcon = EuiTimelineItemIcon;
52
+ EuiTimelineItemIcon.propTypes = {
53
53
  /**
54
54
  * Any `ReactNode`, but preferably `EuiAvatar`, or a `string` as an `EuiIcon['type']`.
55
55
  */
@@ -61,6 +61,4 @@ _EuiTimelineItemIcon.propTypes = {
61
61
  * If no `aria-label` is passed we assume the icon is purely decorative.
62
62
  */
63
63
  iconAriaLabel: _propTypes.default.string
64
- };
65
- var EuiTimelineItemIcon = (0, _system.withEuiSystem)(_EuiTimelineItemIcon);
66
- exports.EuiTimelineItemIcon = EuiTimelineItemIcon;
64
+ };
@@ -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
@@ -3,19 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports._EuiTitle = exports.TITLE_SIZES = exports.TEXT_TRANSFORM = exports.EuiTitle = void 0;
6
+ exports.TITLE_SIZES = exports.TEXT_TRANSFORM = exports.EuiTitle = void 0;
7
7
 
8
8
  var _classnames = _interopRequireDefault(require("classnames"));
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
12
+ var _services = require("../../services");
13
+
12
14
  var _clone_element = require("../../services/theme/clone_element");
13
15
 
14
16
  var _title = require("./title.styles");
15
17
 
16
- var _system = require("../provider/system");
17
-
18
- var _excluded = ["size", "children", "className", "textTransform", "euiTheme"];
18
+ var _excluded = ["size", "children", "className", "textTransform"];
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -34,15 +34,15 @@ exports.TITLE_SIZES = TITLE_SIZES;
34
34
  var TEXT_TRANSFORM = ['uppercase'];
35
35
  exports.TEXT_TRANSFORM = TEXT_TRANSFORM;
36
36
 
37
- var _EuiTitle = function _EuiTitle(_ref) {
37
+ var EuiTitle = function EuiTitle(_ref) {
38
38
  var _ref$size = _ref.size,
39
39
  size = _ref$size === void 0 ? 'm' : _ref$size,
40
40
  children = _ref.children,
41
41
  className = _ref.className,
42
42
  textTransform = _ref.textTransform,
43
- euiTheme = _ref.euiTheme,
44
43
  rest = _objectWithoutProperties(_ref, _excluded);
45
44
 
45
+ var euiTheme = (0, _services.useEuiTheme)();
46
46
  var styles = (0, _title.euiTitleStyles)(euiTheme);
47
47
  var cssStyles = [styles.euiTitle, textTransform ? styles[textTransform] : undefined, styles[size]];
48
48
  var classes = (0, _classnames.default)('euiTitle', className, children.props.className);
@@ -55,8 +55,8 @@ var _EuiTitle = function _EuiTitle(_ref) {
55
55
  return (0, _clone_element.cloneElementWithCss)(children, props);
56
56
  };
57
57
 
58
- exports._EuiTitle = _EuiTitle;
59
- _EuiTitle.propTypes = {
58
+ exports.EuiTitle = EuiTitle;
59
+ EuiTitle.propTypes = {
60
60
  className: _propTypes.default.string,
61
61
  "aria-label": _propTypes.default.string,
62
62
  "data-test-subj": _propTypes.default.string,
@@ -68,6 +68,4 @@ _EuiTitle.propTypes = {
68
68
  size: _propTypes.default.any,
69
69
  textTransform: _propTypes.default.any,
70
70
  id: _propTypes.default.string
71
- };
72
- var EuiTitle = (0, _system.withEuiSystem)(_EuiTitle);
73
- exports.EuiTitle = EuiTitle;
71
+ };
@@ -48,9 +48,9 @@ var logicalPaddings = {
48
48
  };
49
49
  var logicalPosition = {
50
50
  top: 'inset-block-start',
51
- right: 'inset-inline-start',
51
+ right: 'inset-inline-end',
52
52
  bottom: 'inset-block-end',
53
- left: 'inset-inline-end',
53
+ left: 'inset-inline-start',
54
54
  horizontal: 'inset-block',
55
55
  vertical: 'inset-inline',
56
56
  inset: 'inset'
@@ -11,20 +11,16 @@ var _react2 = require("@emotion/react");
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- 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)."; }
15
-
16
- var _ref = process.env.NODE_ENV === "production" ? {
17
- name: "bd8dxy-EuiUtilityClasses",
18
- styles: ".euiYolo{color:coral;};label:EuiUtilityClasses;"
19
- } : {
20
- name: "bd8dxy-EuiUtilityClasses",
21
- styles: ".euiYolo{color:coral;};label:EuiUtilityClasses;",
22
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
23
- };
24
-
14
+ /*
15
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
16
+ * or more contributor license agreements. Licensed under the Elastic License
17
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
18
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
19
+ * Side Public License, v 1.
20
+ */
25
21
  var EuiUtilityClasses = function EuiUtilityClasses() {
26
22
  return (0, _react2.jsx)(_react2.Global, {
27
- styles: _ref
23
+ styles: /*#__PURE__*/(0, _react2.css)(";label:EuiUtilityClasses;")
28
24
  });
29
25
  };
30
26
 
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.replaceEmotionPrefix = void 0;
9
+
10
+ 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 _setPrototypeOf(_this, BabelRegExp.prototype); } _inherits(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); }
11
+
12
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
+
14
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
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 replaceEmotionPrefix = function replaceEmotionPrefix(selector) {
24
+ var _euiMatch$groups;
25
+
26
+ // Matches the Emotion className pattern + the EUI variant naming convention.
27
+ // Starts with `css-[hash]-`.
28
+ // Contains `eui[ComponentName] or `Eui[ComponentName]`.
29
+ // Capture the component name (from above) and all variant additions until the end of the string.
30
+ var euiMatch = selector.match( /*#__PURE__*/_wrapRegExp(/css\x2D[0-9A-Z_a-z]{6,}\x2D([Ee]ui[A-Z][\x2D0-9A-Z_a-z]*$)/, {
31
+ euiComponent: 1
32
+ })); // Use the captured group (`euiComponent`) if available and prepend with `emotion-`,
33
+ // otherwise use the full selector.
34
+
35
+ return euiMatch !== null && euiMatch !== void 0 && (_euiMatch$groups = euiMatch.groups) !== null && _euiMatch$groups !== void 0 && _euiMatch$groups.euiComponent ? "emotion-".concat(euiMatch.groups.euiComponent) : selector;
36
+ };
37
+
38
+ exports.replaceEmotionPrefix = replaceEmotionPrefix;
@@ -36,6 +36,10 @@ declare module '@elastic/eui/lib/test/react_warnings' {
36
36
  declare module '@elastic/eui/lib/test/sleep' {
37
37
  export function sleep(ms?: number): Promise<unknown>;
38
38
 
39
+ }
40
+ declare module '@elastic/eui/lib/test/emotion-prefix' {
41
+ export const replaceEmotionPrefix: (selector: string) => string;
42
+
39
43
  }
40
44
  declare module '@elastic/eui/lib/test' {
41
45
  export { requiredProps } from '@elastic/eui/lib/test/required_props';
@@ -43,5 +47,6 @@ declare module '@elastic/eui/lib/test' {
43
47
  export { findTestSubject } from '@elastic/eui/lib/test/find_test_subject';
44
48
  export { startThrowingReactWarnings, stopThrowingReactWarnings, } from '@elastic/eui/lib/test/react_warnings';
45
49
  export { sleep } from '@elastic/eui/lib/test/sleep';
50
+ export * from '@elastic/eui/lib/test/emotion-prefix';
46
51
 
47
52
  }
package/lib/test/index.js CHANGED
@@ -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
+ });