@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,155 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject;
4
+
5
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
6
+
7
+ /*
8
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
+ * or more contributor license agreements. Licensed under the Elastic License
10
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
11
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
12
+ * Side Public License, v 1.
13
+ */
14
+ import { css, keyframes } from '@emotion/react';
15
+ import { logicalCSS, logicalTextAlignCSS, euiCantAnimate, euiFontSize, euiTextTruncate } from '../../global_styling';
16
+ import { euiPaletteColorBlind, makeHighContrastColor } from '../../services';
17
+ import { euiText } from '../text/text.styles';
18
+ /**
19
+ * DRY utilities for native/determinate progress components vs non-native indeterminate
20
+ */
21
+
22
+ var crossBrowserProgressValue = function crossBrowserProgressValue(cssProperties) {
23
+ return "\n &::-webkit-progress-value {\n ".concat(cssProperties, "\n }\n &::-moz-progress-bar {\n ").concat(cssProperties, "\n }\n");
24
+ };
25
+
26
+ var indeterminateProgressValue = function indeterminateProgressValue(cssProperties) {
27
+ return "\n &:before {\n ".concat(cssProperties, "\n }\n");
28
+ };
29
+ /**
30
+ * Color utilities
31
+ */
32
+
33
+
34
+ var visColors = euiPaletteColorBlind();
35
+
36
+ var nativeVsIndeterminateColor = function nativeVsIndeterminateColor(color, isNative) {
37
+ var selectors = isNative ? crossBrowserProgressValue : indeterminateProgressValue;
38
+ return selectors("background-color: ".concat(color, ";"));
39
+ };
40
+ /**
41
+ * DRY utils for non-static positions
42
+ */
43
+
44
+
45
+ var nonStaticPositioning = function nonStaticPositioning(isNative) {
46
+ return "\n top: 0;\n left: 0;\n right: 0;\n background-color: transparent;\n ".concat(isNative ? "\n &::-webkit-progress-bar {\n background-color: transparent;\n }" : '', "\n");
47
+ };
48
+ /**
49
+ * Animations
50
+ */
51
+
52
+
53
+ var euiIndeterminateAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scaleX(1) translateX(-100%);\n }\n 100% {\n transform: scaleX(1) translateX(100%);\n }\n"])));
54
+ /**
55
+ * Emotion styles
56
+ */
57
+
58
+ var _ref2 = process.env.NODE_ENV === "production" ? {
59
+ name: "187h6sp-static",
60
+ styles: "position:relative;label:static;"
61
+ } : {
62
+ name: "187h6sp-static",
63
+ styles: "position:relative;label:static;",
64
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
65
+ };
66
+
67
+ export var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
68
+ var euiTheme = _ref3.euiTheme;
69
+ return {
70
+ euiProgress: /*#__PURE__*/css("overflow:hidden;background-color:", euiTheme.colors.lightShade, ";;label:euiProgress;"),
71
+ // https://css-tricks.com/html5-progress-element/
72
+ // Good resource if you need to work in here. There's some gotchas with
73
+ // dealing with cross-browser progress bars.
74
+ native: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", crossBrowserProgressValue("transition: width ".concat(euiTheme.animation.normal, " linear;")), ";;label:native;"),
75
+ // An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
76
+ // we apply this style to a <div> instead of a <progress> element.
77
+ // See https://css-tricks.com/html5-progress-element/ for more info.
78
+ indeterminate: /*#__PURE__*/css("&:before{position:absolute;content:'';", logicalCSS('width', '100%'), " top:0;bottom:0;left:0;transform:scaleX(0) translateX(0%);animation:", euiIndeterminateAnimation, " 1s ", euiTheme.animation.resistance, " infinite;", euiCantAnimate, "{animation-duration:2s;animation-timing-function:linear;}};label:indeterminate;"),
79
+ // Sizes
80
+ xs: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.xxs), ";;label:xs;"),
81
+ s: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.xs), ";;label:s;"),
82
+ m: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.s), ";;label:m;"),
83
+ l: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.m), ";;label:l;"),
84
+ // Positioning
85
+ fixed: /*#__PURE__*/css("position:fixed;z-index:", Number(euiTheme.levels.header) + 1, ";", nonStaticPositioning(isNative), ";;label:fixed;"),
86
+ absolute: /*#__PURE__*/css("position:absolute;", nonStaticPositioning(isNative), ";;label:absolute;"),
87
+ static: _ref2,
88
+ // Colors
89
+ primary: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.primary, isNative), ";;label:primary;"),
90
+ success: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.success, isNative), ";;label:success;"),
91
+ warning: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.warning, isNative), ";;label:warning;"),
92
+ danger: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.danger, isNative), ";;label:danger;"),
93
+ subdued: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.subduedText, isNative), ";;label:subdued;"),
94
+ accent: /*#__PURE__*/css(nativeVsIndeterminateColor(euiTheme.colors.accent, isNative), ";;label:accent;"),
95
+ vis0: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[0], isNative), ";;label:vis0;"),
96
+ vis1: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[1], isNative), ";;label:vis1;"),
97
+ vis2: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[2], isNative), ";;label:vis2;"),
98
+ vis3: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[3], isNative), ";;label:vis3;"),
99
+ vis4: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[4], isNative), ";;label:vis4;"),
100
+ vis5: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[5], isNative), ";;label:vis5;"),
101
+ vis6: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[6], isNative), ";;label:vis6;"),
102
+ vis7: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[7], isNative), ";;label:vis7;"),
103
+ vis8: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[8], isNative), ";;label:vis8;"),
104
+ vis9: /*#__PURE__*/css(nativeVsIndeterminateColor(visColors[9], isNative), ";;label:vis9;"),
105
+ customColor: /*#__PURE__*/css(nativeVsIndeterminateColor('currentColor', isNative), ";;label:customColor;")
106
+ };
107
+ };
108
+ /**
109
+ * Data styles
110
+ */
111
+
112
+ export var euiProgressDataStyles = function euiProgressDataStyles(euiThemeContext) {
113
+ return {
114
+ euiProgress__data: /*#__PURE__*/css("display:flex;justify-content:space-between;gap:", euiThemeContext.euiTheme.size.xs, ";", euiText(euiThemeContext.euiTheme), " ", euiFontSize(euiThemeContext, 'xs'), ";;label:euiProgress__data;"),
115
+ // Sizes
116
+ l: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";;label:l;")
117
+ };
118
+ };
119
+ export var euiProgressLabelStyles = {
120
+ euiProgress__label: /*#__PURE__*/css("flex-grow:1;", euiTextTruncate(), ";;label:euiProgress__label;")
121
+ };
122
+
123
+ var _ref = process.env.NODE_ENV === "production" ? {
124
+ name: "15ioh86-customColor",
125
+ styles: "color:currentColor;label:customColor;"
126
+ } : {
127
+ name: "15ioh86-customColor",
128
+ styles: "color:currentColor;label:customColor;",
129
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
130
+ };
131
+
132
+ export var euiProgressValueTextStyles = function euiProgressValueTextStyles(_ref4) {
133
+ var euiTheme = _ref4.euiTheme;
134
+ return {
135
+ euiProgress__valueText: /*#__PURE__*/css("flex-grow:1;flex-shrink:0;font-feature-settings:'tnum' 1;", logicalTextAlignCSS('right'), " ", euiTextTruncate(), ";;label:euiProgress__valueText;"),
136
+ // Colors
137
+ primary: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:primary;"),
138
+ success: /*#__PURE__*/css("color:", euiTheme.colors.successText, ";;label:success;"),
139
+ warning: /*#__PURE__*/css("color:", euiTheme.colors.warningText, ";;label:warning;"),
140
+ danger: /*#__PURE__*/css("color:", euiTheme.colors.dangerText, ";;label:danger;"),
141
+ subdued: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
142
+ accent: /*#__PURE__*/css("color:", euiTheme.colors.accentText, ";;label:accent;"),
143
+ vis0: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[0])(euiTheme), ";;label:vis0;"),
144
+ vis1: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[1])(euiTheme), ";;label:vis1;"),
145
+ vis2: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[2])(euiTheme), ";;label:vis2;"),
146
+ vis3: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[3])(euiTheme), ";;label:vis3;"),
147
+ vis4: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[4])(euiTheme), ";;label:vis4;"),
148
+ vis5: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[5])(euiTheme), ";;label:vis5;"),
149
+ vis6: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[6])(euiTheme), ";;label:vis6;"),
150
+ vis7: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[7])(euiTheme), ";;label:vis7;"),
151
+ vis8: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[8])(euiTheme), ";;label:vis8;"),
152
+ vis9: /*#__PURE__*/css("color:", makeHighContrastColor(visColors[9])(euiTheme), ";;label:vis9;"),
153
+ customColor: _ref
154
+ };
155
+ };
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import React from 'react';
9
+ import { CacheProvider } from '@emotion/react';
10
+ import { jsx as ___EmotionJSX } from "@emotion/react";
11
+ export var EuiCacheProvider = function EuiCacheProvider(_ref) {
12
+ var cache = _ref.cache,
13
+ children = _ref.children;
14
+ return children && cache ? ___EmotionJSX(CacheProvider, {
15
+ value: cache
16
+ }, children) : ___EmotionJSX(React.Fragment, null, children);
17
+ };
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ export * from './cache_provider';
@@ -7,22 +7,52 @@
7
7
  */
8
8
  import React from 'react';
9
9
  import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
10
+ import { EuiUtilityClasses } from '../../global_styling/utility/utility';
10
11
  import { EuiThemeProvider } from '../../services';
11
12
  import { EuiThemeAmsterdam } from '../../themes';
13
+ import { EuiCacheProvider } from './cache';
12
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
+
16
+ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
17
+ return obj.hasOwnProperty('key');
18
+ };
19
+
13
20
  export var EuiProvider = function EuiProvider(_ref) {
14
21
  var cache = _ref.cache,
15
22
  _ref$theme = _ref.theme,
16
23
  theme = _ref$theme === void 0 ? EuiThemeAmsterdam : _ref$theme,
17
24
  _ref$globalStyles = _ref.globalStyles,
18
- GlobalStyles = _ref$globalStyles === void 0 ? EuiGlobalStyles : _ref$globalStyles,
25
+ Globals = _ref$globalStyles === void 0 ? EuiGlobalStyles : _ref$globalStyles,
26
+ _ref$utilityClasses = _ref.utilityClasses,
27
+ Utilities = _ref$utilityClasses === void 0 ? EuiUtilityClasses : _ref$utilityClasses,
19
28
  colorMode = _ref.colorMode,
20
29
  modify = _ref.modify,
21
30
  children = _ref.children;
22
- return ___EmotionJSX(EuiThemeProvider, {
31
+ var defaultCache;
32
+ var globalCache;
33
+ var utilityCache;
34
+
35
+ if (cache) {
36
+ if (isEmotionCacheObject(cache)) {
37
+ defaultCache = cache;
38
+ } else {
39
+ defaultCache = cache.default;
40
+ globalCache = cache.global;
41
+ utilityCache = cache.utility;
42
+ }
43
+ }
44
+
45
+ return ___EmotionJSX(EuiCacheProvider, {
46
+ cache: defaultCache
47
+ }, ___EmotionJSX(EuiThemeProvider, {
23
48
  theme: theme !== null && theme !== void 0 ? theme : undefined,
24
49
  colorMode: colorMode,
25
- modify: modify,
26
- cache: cache
27
- }, theme !== null && GlobalStyles !== false ? ___EmotionJSX(GlobalStyles, null) : null, children);
50
+ modify: modify
51
+ }, theme && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiCacheProvider, {
52
+ cache: globalCache,
53
+ children: Globals && ___EmotionJSX(Globals, null)
54
+ }), ___EmotionJSX(EuiCacheProvider, {
55
+ cache: utilityCache,
56
+ children: Utilities && ___EmotionJSX(Utilities, null)
57
+ })), children));
28
58
  };
@@ -8,7 +8,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
8
8
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
9
9
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
10
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
- var _excluded = ["children", "className", "options", "onChange", "searchable", "searchProps", "singleSelection", "isLoading", "listProps", "renderOption", "height", "allowExclusions", "aria-label", "aria-describedby", "loadingMessage", "noMatchesMessage", "emptyMessage", "errorMessage", "isPreFiltered"],
11
+ var _excluded = ["children", "className", "options", "onChange", "onActiveOptionChange", "searchable", "searchProps", "singleSelection", "isLoading", "listProps", "renderOption", "height", "allowExclusions", "aria-label", "aria-describedby", "loadingMessage", "noMatchesMessage", "emptyMessage", "errorMessage", "isPreFiltered"],
12
12
  _excluded2 = ["aria-label", "aria-describedby", "onChange", "defaultValue", "inputRef"],
13
13
  _excluded3 = ["aria-label", "aria-describedby", "isVirtualized", "rowHeight"];
14
14
 
@@ -308,31 +308,42 @@ export var EuiSelectable = /*#__PURE__*/function (_Component) {
308
308
  }
309
309
 
310
310
  _createClass(EuiSelectable, [{
311
+ key: "componentDidUpdate",
312
+ value: function componentDidUpdate(prevProps, prevState) {
313
+ if (prevState.activeOptionIndex !== this.state.activeOptionIndex) {
314
+ var _this$props$onActiveO, _this$props2;
315
+
316
+ var activeOption = this.state.activeOptionIndex != null ? this.state.visibleOptions[this.state.activeOptionIndex] : null;
317
+ (_this$props$onActiveO = (_this$props2 = this.props).onActiveOptionChange) === null || _this$props$onActiveO === void 0 ? void 0 : _this$props$onActiveO.call(_this$props2, activeOption);
318
+ }
319
+ }
320
+ }, {
311
321
  key: "render",
312
322
  value: function render() {
313
323
  var _this2 = this;
314
324
 
315
- var _this$props2 = this.props,
316
- children = _this$props2.children,
317
- className = _this$props2.className,
318
- options = _this$props2.options,
319
- onChange = _this$props2.onChange,
320
- searchable = _this$props2.searchable,
321
- searchProps = _this$props2.searchProps,
322
- singleSelection = _this$props2.singleSelection,
323
- isLoading = _this$props2.isLoading,
324
- listProps = _this$props2.listProps,
325
- renderOption = _this$props2.renderOption,
326
- height = _this$props2.height,
327
- allowExclusions = _this$props2.allowExclusions,
328
- ariaLabel = _this$props2['aria-label'],
329
- ariaDescribedby = _this$props2['aria-describedby'],
330
- loadingMessage = _this$props2.loadingMessage,
331
- noMatchesMessage = _this$props2.noMatchesMessage,
332
- emptyMessage = _this$props2.emptyMessage,
333
- errorMessage = _this$props2.errorMessage,
334
- isPreFiltered = _this$props2.isPreFiltered,
335
- rest = _objectWithoutProperties(_this$props2, _excluded);
325
+ var _this$props3 = this.props,
326
+ children = _this$props3.children,
327
+ className = _this$props3.className,
328
+ options = _this$props3.options,
329
+ onChange = _this$props3.onChange,
330
+ onActiveOptionChange = _this$props3.onActiveOptionChange,
331
+ searchable = _this$props3.searchable,
332
+ searchProps = _this$props3.searchProps,
333
+ singleSelection = _this$props3.singleSelection,
334
+ isLoading = _this$props3.isLoading,
335
+ listProps = _this$props3.listProps,
336
+ renderOption = _this$props3.renderOption,
337
+ height = _this$props3.height,
338
+ allowExclusions = _this$props3.allowExclusions,
339
+ ariaLabel = _this$props3['aria-label'],
340
+ ariaDescribedby = _this$props3['aria-describedby'],
341
+ loadingMessage = _this$props3.loadingMessage,
342
+ noMatchesMessage = _this$props3.noMatchesMessage,
343
+ emptyMessage = _this$props3.emptyMessage,
344
+ errorMessage = _this$props3.errorMessage,
345
+ isPreFiltered = _this$props3.isPreFiltered,
346
+ rest = _objectWithoutProperties(_this$props3, _excluded);
336
347
 
337
348
  var _this$state = this.state,
338
349
  searchValue = _this$state.searchValue,
@@ -1,7 +1,12 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
4
  var _excluded = ["children", "className", "description", "isLoading", "reverse", "textAlign", "title", "titleColor", "titleSize", "titleElement", "descriptionElement"];
4
5
 
6
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7
+
8
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
9
+
5
10
  /*
6
11
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
12
  * or more contributor license agreements. Licensed under the Elastic License
@@ -10,31 +15,16 @@ var _excluded = ["children", "className", "description", "isLoading", "reverse",
10
15
  * Side Public License, v 1.
11
16
  */
12
17
  import React, { Fragment, createElement } from 'react';
13
- import { keysOf } from '../common';
14
18
  import classNames from 'classnames';
15
19
  import { EuiText } from '../text';
16
20
  import { EuiTitle } from '../title/title';
17
21
  import { EuiScreenReaderOnly } from '../accessibility';
18
22
  import { EuiI18n } from '../i18n';
23
+ import { useEuiTheme } from '../../services';
24
+ import { euiStatStyles, euiStatTitleStyles } from './stat.styles';
19
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
- var colorToClassNameMap = {
21
- default: null,
22
- subdued: 'euiStat__title--subdued',
23
- primary: 'euiStat__title--primary',
24
- success: 'euiStat__title--success',
25
- danger: 'euiStat__title--danger',
26
- accent: 'euiStat__title--accent'
27
- };
28
- export var COLORS = keysOf(colorToClassNameMap);
29
- var textAlignToClassNameMap = {
30
- left: 'euiStat--leftAligned',
31
- center: 'euiStat--centerAligned',
32
- right: 'euiStat--rightAligned'
33
- };
34
- export var isColorClass = function isColorClass(input) {
35
- return colorToClassNameMap.hasOwnProperty(input);
36
- };
37
- export var ALIGNMENTS = keysOf(textAlignToClassNameMap);
26
+ export var COLORS = ['default', 'subdued', 'primary', 'success', 'danger', 'accent'];
27
+ export var ALIGNMENTS = ['left', 'center', 'right'];
38
28
  export var EuiStat = function EuiStat(_ref) {
39
29
  var children = _ref.children,
40
30
  className = _ref.className,
@@ -56,10 +46,10 @@ export var EuiStat = function EuiStat(_ref) {
56
46
  descriptionElement = _ref$descriptionEleme === void 0 ? 'p' : _ref$descriptionEleme,
57
47
  rest = _objectWithoutProperties(_ref, _excluded);
58
48
 
59
- var classes = classNames('euiStat', textAlignToClassNameMap[textAlign], className);
60
- var titleClasses = classNames('euiStat__title', isColorClass(titleColor) ? colorToClassNameMap[titleColor] : null, {
61
- 'euiStat__title-isLoading': isLoading
62
- });
49
+ var euiTheme = useEuiTheme();
50
+ var styles = euiStatStyles();
51
+ var cssStyles = [styles.euiStat, styles[textAlign]];
52
+ var classes = classNames('euiStat', className);
63
53
  var commonProps = {
64
54
  'aria-hidden': true
65
55
  };
@@ -69,20 +59,21 @@ export var EuiStat = function EuiStat(_ref) {
69
59
  className: "euiStat__description"
70
60
  }, /*#__PURE__*/createElement(descriptionElement, commonProps, description));
71
61
 
72
- var titlePropsWithColor = {
73
- 'aria-hidden': true,
62
+ var isNamedTitleColor = COLORS.includes(titleColor);
63
+ var titleStyles = euiStatTitleStyles(euiTheme);
64
+ var titleCssStyles = [titleStyles.euiStat__title, isNamedTitleColor && titleStyles[titleColor], isLoading && titleStyles.isLoading];
65
+ var titleProps = isNamedTitleColor ? commonProps : _objectSpread(_objectSpread({}, commonProps), {}, {
74
66
  style: {
75
- color: "".concat(titleColor)
67
+ color: titleColor
76
68
  }
77
- };
69
+ });
78
70
  var titleChildren = isLoading ? '--' : title;
79
- var titleDisplay = isColorClass(titleColor) ? ___EmotionJSX(EuiTitle, {
80
- size: titleSize,
81
- className: titleClasses
82
- }, /*#__PURE__*/createElement(titleElement, commonProps, titleChildren)) : ___EmotionJSX(EuiTitle, {
71
+
72
+ var titleDisplay = ___EmotionJSX(EuiTitle, {
83
73
  size: titleSize,
84
- className: titleClasses
85
- }, /*#__PURE__*/createElement(titleElement, titlePropsWithColor, titleChildren));
74
+ className: "euiStat__title",
75
+ css: titleCssStyles
76
+ }, /*#__PURE__*/createElement(titleElement, titleProps, titleChildren));
86
77
 
87
78
  var screenReader = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", null, isLoading ? ___EmotionJSX(EuiI18n, {
88
79
  token: "euiStat.loadingText",
@@ -92,6 +83,7 @@ export var EuiStat = function EuiStat(_ref) {
92
83
  var statDisplay = ___EmotionJSX(Fragment, null, !reverse && descriptionDisplay, titleDisplay, reverse && descriptionDisplay, typeof title === 'string' && typeof description === 'string' && screenReader);
93
84
 
94
85
  return ___EmotionJSX("div", _extends({
86
+ css: cssStyles,
95
87
  className: classes
96
88
  }, rest), statDisplay, children);
97
89
  };
@@ -0,0 +1,38 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject;
4
+
5
+ /*
6
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
+ * or more contributor license agreements. Licensed under the Elastic License
8
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
10
+ * Side Public License, v 1.
11
+ */
12
+ import { css, keyframes } from '@emotion/react';
13
+ import { logicalTextAlignCSS, euiCanAnimate } from '../../global_styling';
14
+ export var euiStatStyles = function euiStatStyles() {
15
+ return {
16
+ euiStat: /*#__PURE__*/css(";label:euiStat;"),
17
+ // Text align
18
+ left: /*#__PURE__*/css(logicalTextAlignCSS('left'), " align-items:flex-start;;label:left;"),
19
+ center: /*#__PURE__*/css(logicalTextAlignCSS('center'), " align-items:center;;label:center;"),
20
+ right: /*#__PURE__*/css(logicalTextAlignCSS('right'), " align-items:flex-end;;label:right;")
21
+ };
22
+ };
23
+ export var euiStatTitleStyles = function euiStatTitleStyles(_ref) {
24
+ var euiTheme = _ref.euiTheme;
25
+ return {
26
+ euiStat__title: /*#__PURE__*/css(";label:euiStat__title;"),
27
+ // Colors
28
+ default: /*#__PURE__*/css("color:", euiTheme.colors.fullShade, ";;label:default;"),
29
+ subdued: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";;label:subdued;"),
30
+ primary: /*#__PURE__*/css("color:", euiTheme.colors.primaryText, ";;label:primary;"),
31
+ success: /*#__PURE__*/css("color:", euiTheme.colors.successText, ";;label:success;"),
32
+ danger: /*#__PURE__*/css("color:", euiTheme.colors.dangerText, ";;label:danger;"),
33
+ accent: /*#__PURE__*/css("color:", euiTheme.colors.accentText, ";;label:accent;"),
34
+ // Loading
35
+ isLoading: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiStatPulse, " 1.5s infinite ease-in-out;};label:isLoading;")
36
+ };
37
+ };
38
+ var euiStatPulse = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% { opacity: 1; }\n 50% { opacity: .25; }\n 100% { opacity: 1; }\n"])));
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["className", "items", "children"];
3
+ var _excluded = ["className", "items", "children", "gutterSize"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -11,19 +11,28 @@ var _excluded = ["className", "items", "children"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classNames from 'classnames';
14
+ import { useEuiTheme } from '../../services';
14
15
  import { EuiTimelineItem } from './timeline_item';
16
+ import { euiTimelineStyles } from './timeline.styles';
15
17
  import { jsx as ___EmotionJSX } from "@emotion/react";
18
+ export var GUTTER_SIZES = ['m', 'l', 'xl'];
16
19
  export var EuiTimeline = function EuiTimeline(_ref) {
17
20
  var className = _ref.className,
18
21
  _ref$items = _ref.items,
19
22
  items = _ref$items === void 0 ? [] : _ref$items,
20
23
  children = _ref.children,
24
+ _ref$gutterSize = _ref.gutterSize,
25
+ gutterSize = _ref$gutterSize === void 0 ? 'xl' : _ref$gutterSize,
21
26
  rest = _objectWithoutProperties(_ref, _excluded);
22
27
 
23
28
  var classes = classNames('euiTimeline', className);
29
+ var euiTheme = useEuiTheme();
30
+ var styles = euiTimelineStyles(euiTheme);
31
+ var cssStyles = [styles.euiTimeline, styles[gutterSize]];
24
32
  return (// eslint-disable-next-line jsx-a11y/no-redundant-roles
25
33
  ___EmotionJSX("ol", _extends({
26
34
  className: classes,
35
+ css: cssStyles,
27
36
  role: "list"
28
37
  }, rest), items.map(function (item, index) {
29
38
  return ___EmotionJSX(EuiTimelineItem, _extends({
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+ import { css } from '@emotion/react';
9
+ import { logicalCSS } from '../../global_styling';
10
+
11
+ var _gutterSizeAdjustment = function _gutterSizeAdjustment(gutterSize) {
12
+ 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(logicalCSS('height', "calc(100% + ".concat(gutterSize, ")")), ";\n }\n ");
13
+ }; // The vertical line should only appear when the EuiTimelineItem's
14
+ // are wrapped in a EuiTimeline. That's why these styles live here.
15
+
16
+
17
+ var timelineVerticalLine = function timelineVerticalLine(euiTheme) {
18
+ return " \n [class*='euiTimelineItem-'] > [class*='euiTimelineItemIcon-']::before {\n content: '';\n position: absolute;\n ".concat(logicalCSS('top', 0), ";\n ").concat(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(logicalCSS('top', '50%'), ";\n }\n \n > [class*='euiTimelineItem-center']:last-child:not(:only-child) > [class*='euiTimelineItemIcon-']::before {\n ").concat(logicalCSS('height', '50%'), ";\n }\n ");
19
+ };
20
+
21
+ export var euiTimelineStyles = function euiTimelineStyles(_ref) {
22
+ var euiTheme = _ref.euiTheme;
23
+ return {
24
+ euiTimeline: /*#__PURE__*/css("display:flex;flex-direction:column;", timelineVerticalLine(euiTheme), ";;label:euiTimeline;"),
25
+ m: /*#__PURE__*/css(_gutterSizeAdjustment(euiTheme.size.base), ";label:m;"),
26
+ l: /*#__PURE__*/css(_gutterSizeAdjustment(euiTheme.size.l), ";label:l;"),
27
+ xl: /*#__PURE__*/css(_gutterSizeAdjustment(euiTheme.size.xl), ";label:xl;")
28
+ };
29
+ };
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className", "component"];
3
+ var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className"];
4
4
 
5
5
  /*
6
6
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -10,7 +10,6 @@ var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "classNam
10
10
  * Side Public License, v 1.
11
11
  */
12
12
  import React from 'react';
13
- import { useEuiTheme } from '../../services';
14
13
  import { EuiTimelineItemEvent } from './timeline_item_event';
15
14
  import { EuiTimelineItemIcon } from './timeline_item_icon';
16
15
  import { euiTimelineItemStyles } from './timeline_item.styles';
@@ -23,15 +22,11 @@ export var EuiTimelineItem = function EuiTimelineItem(_ref) {
23
22
  icon = _ref.icon,
24
23
  iconAriaLabel = _ref.iconAriaLabel,
25
24
  className = _ref.className,
26
- _ref$component = _ref.component,
27
- component = _ref$component === void 0 ? 'li' : _ref$component,
28
25
  rest = _objectWithoutProperties(_ref, _excluded);
29
26
 
30
- var euiTheme = useEuiTheme();
31
- var styles = euiTimelineItemStyles(euiTheme);
32
- var cssStyles = [styles.euiTimelineItem];
33
- var Element = component;
34
- return ___EmotionJSX(Element, _extends({
27
+ var styles = euiTimelineItemStyles();
28
+ var cssStyles = [styles.euiTimelineItem, styles[verticalAlign]];
29
+ return ___EmotionJSX("li", _extends({
35
30
  css: cssStyles
36
31
  }, rest), ___EmotionJSX(EuiTimelineItemIcon, {
37
32
  icon: icon,
@@ -1,3 +1,5 @@
1
+ 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)."; }
2
+
1
3
  /*
2
4
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
5
  * or more contributor license agreements. Licensed under the Elastic License
@@ -6,9 +8,22 @@
6
8
  * Side Public License, v 1.
7
9
  */
8
10
  import { css } from '@emotion/react';
9
- export var euiTimelineItemStyles = function euiTimelineItemStyles(_ref) {
10
- var euiTheme = _ref.euiTheme;
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
+ export var euiTimelineItemStyles = function euiTimelineItemStyles() {
11
22
  return {
12
- euiTimelineItem: /*#__PURE__*/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__*/css(";label:top;"),
27
+ center: /*#__PURE__*/css(";label:center;")
13
28
  };
14
29
  };
@@ -8,6 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
8
  * Side Public License, v 1.
9
9
  */
10
10
  import { css } from '@emotion/react';
11
+ import { logicalCSS } from '../../global_styling';
11
12
 
12
13
  var _ref = process.env.NODE_ENV === "production" ? {
13
14
  name: "8391db-center",
@@ -27,11 +28,20 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
27
28
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
29
  };
29
30
 
30
- export var euiTimelineItemIconStyles = function euiTimelineItemIconStyles(_ref3) {
31
- var euiTheme = _ref3.euiTheme;
31
+ var _ref3 = process.env.NODE_ENV === "production" ? {
32
+ name: "kuz8oa-euiTimelineItemIcon__content",
33
+ styles: "display:flex;justify-content:center;align-items:center;position:relative;label:euiTimelineItemIcon__content;"
34
+ } : {
35
+ name: "kuz8oa-euiTimelineItemIcon__content",
36
+ styles: "display:flex;justify-content:center;align-items:center;position:relative;label:euiTimelineItemIcon__content;",
37
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
38
+ };
39
+
40
+ export var euiTimelineItemIconStyles = function euiTimelineItemIconStyles(_ref4) {
41
+ var euiTheme = _ref4.euiTheme;
32
42
  return {
33
- euiTimelineItemIcon: /*#__PURE__*/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__*/css("min-width:", euiTheme.size.xxl, ";display:flex;justify-content:center;align-items:center;position:relative;;label:euiTimelineItemIcon__content;"),
43
+ euiTimelineItemIcon: /*#__PURE__*/css("display:flex;position:relative;flex-grow:0;justify-content:center;", logicalCSS('margin-right', euiTheme.size.base), ";;label:euiTimelineItemIcon;"),
44
+ euiTimelineItemIcon__content: _ref3,
35
45
  // Vertical alignments
36
46
  top: _ref2,
37
47
  center: _ref