@elastic/eui 69.0.0 → 70.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 (191) hide show
  1. package/dist/eui_theme_dark.css +0 -375
  2. package/dist/eui_theme_dark.json +0 -27
  3. package/dist/eui_theme_dark.json.d.ts +0 -27
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -375
  6. package/dist/eui_theme_light.json +0 -27
  7. package/dist/eui_theme_light.json.d.ts +0 -27
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/basic_table/in_memory_table.js +8 -2
  10. package/es/components/code/code.js +7 -3
  11. package/es/components/code/code.styles.js +32 -0
  12. package/es/components/code/code_block.js +72 -315
  13. package/es/components/code/code_block.styles.js +153 -0
  14. package/es/components/code/code_block_controls.js +29 -0
  15. package/es/components/code/code_block_controls.styles.js +43 -0
  16. package/es/components/code/code_block_copy.js +65 -0
  17. package/es/components/code/code_block_full_screen.js +90 -0
  18. package/es/components/code/code_block_line.styles.js +49 -0
  19. package/es/components/code/code_block_overflow.js +78 -0
  20. package/es/components/code/code_block_virtualized.js +59 -0
  21. package/es/components/code/code_syntax.styles.js +43 -0
  22. package/es/components/code/utils.js +43 -37
  23. package/es/components/collapsible_nav/collapsible_nav.js +0 -5
  24. package/es/components/overlay_mask/overlay_mask.js +8 -14
  25. package/es/components/overlay_mask/overlay_mask.styles.js +4 -14
  26. package/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
  27. package/es/components/provider/provider.js +1 -5
  28. package/es/components/resizable_container/helpers.js +2 -2
  29. package/es/components/resizable_container/resizable_container.js +6 -9
  30. package/es/components/resizable_container/resizable_container.styles.js +28 -0
  31. package/es/components/resizable_container/resizable_panel.js +25 -48
  32. package/es/components/resizable_container/resizable_panel.styles.js +69 -0
  33. package/es/components/search_bar/query/ast.js +14 -3
  34. package/es/components/tool_tip/tool_tip.js +3 -2
  35. package/es/components/tool_tip/tool_tip.styles.js +17 -22
  36. package/es/components/tool_tip/tool_tip_arrow.js +17 -3
  37. package/es/components/tool_tip/tool_tip_popover.js +7 -7
  38. package/es/components/tour/tour.styles.js +4 -3
  39. package/es/components/tour/tour_step.js +7 -5
  40. package/es/global_styling/functions/logicals.js +5 -3
  41. package/es/global_styling/functions/math.js +37 -19
  42. package/es/global_styling/mixins/_padding.js +13 -9
  43. package/eui.d.ts +291 -37
  44. package/i18ntokens.json +22 -22
  45. package/lib/components/basic_table/in_memory_table.js +8 -2
  46. package/lib/components/code/code.js +9 -3
  47. package/lib/components/code/code.styles.js +35 -0
  48. package/lib/components/code/code_block.js +72 -320
  49. package/lib/components/code/code_block.styles.js +154 -0
  50. package/lib/components/code/code_block_controls.js +48 -0
  51. package/lib/components/code/code_block_controls.styles.js +39 -0
  52. package/lib/components/code/code_block_copy.js +78 -0
  53. package/lib/components/code/code_block_full_screen.js +108 -0
  54. package/lib/components/code/code_block_line.styles.js +45 -0
  55. package/lib/components/code/code_block_overflow.js +82 -0
  56. package/lib/components/code/code_block_virtualized.js +72 -0
  57. package/lib/components/code/code_syntax.styles.js +57 -0
  58. package/lib/components/code/utils.js +40 -39
  59. package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
  60. package/lib/components/overlay_mask/overlay_mask.js +9 -14
  61. package/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
  62. package/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
  63. package/lib/components/provider/provider.js +7 -12
  64. package/lib/components/resizable_container/helpers.js +2 -2
  65. package/lib/components/resizable_container/resizable_container.js +7 -9
  66. package/lib/components/resizable_container/resizable_container.styles.js +31 -0
  67. package/lib/components/resizable_container/resizable_panel.js +28 -49
  68. package/lib/components/resizable_container/resizable_panel.styles.js +74 -0
  69. package/lib/components/search_bar/query/ast.js +14 -3
  70. package/lib/components/tool_tip/tool_tip.js +3 -2
  71. package/lib/components/tool_tip/tool_tip.styles.js +18 -26
  72. package/lib/components/tool_tip/tool_tip_arrow.js +19 -4
  73. package/lib/components/tool_tip/tool_tip_popover.js +6 -6
  74. package/lib/components/tour/tour.styles.js +3 -2
  75. package/lib/components/tour/tour_step.js +7 -5
  76. package/lib/global_styling/functions/logicals.js +5 -3
  77. package/lib/global_styling/functions/math.js +37 -19
  78. package/lib/global_styling/mixins/_padding.js +17 -10
  79. package/optimize/es/components/basic_table/in_memory_table.js +1 -1
  80. package/optimize/es/components/code/code.js +7 -3
  81. package/optimize/es/components/code/code.styles.js +32 -0
  82. package/optimize/es/components/code/code_block.js +70 -299
  83. package/optimize/es/components/code/code_block.styles.js +153 -0
  84. package/optimize/es/components/code/code_block_controls.js +29 -0
  85. package/optimize/es/components/code/code_block_controls.styles.js +43 -0
  86. package/optimize/es/components/code/code_block_copy.js +55 -0
  87. package/optimize/es/components/code/code_block_full_screen.js +80 -0
  88. package/optimize/es/components/code/code_block_line.styles.js +49 -0
  89. package/optimize/es/components/code/code_block_overflow.js +67 -0
  90. package/optimize/es/components/code/code_block_virtualized.js +59 -0
  91. package/optimize/es/components/code/code_syntax.styles.js +43 -0
  92. package/optimize/es/components/code/utils.js +43 -37
  93. package/optimize/es/components/overlay_mask/overlay_mask.js +8 -9
  94. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +4 -14
  95. package/optimize/es/components/overlay_mask/overlay_mask_body.styles.js +18 -0
  96. package/optimize/es/components/provider/provider.js +1 -5
  97. package/optimize/es/components/resizable_container/helpers.js +2 -2
  98. package/optimize/es/components/resizable_container/resizable_container.js +6 -9
  99. package/optimize/es/components/resizable_container/resizable_container.styles.js +28 -0
  100. package/optimize/es/components/resizable_container/resizable_panel.js +25 -48
  101. package/optimize/es/components/resizable_container/resizable_panel.styles.js +69 -0
  102. package/optimize/es/components/search_bar/query/ast.js +14 -3
  103. package/optimize/es/components/tool_tip/tool_tip.js +3 -2
  104. package/optimize/es/components/tool_tip/tool_tip.styles.js +17 -22
  105. package/optimize/es/components/tool_tip/tool_tip_arrow.js +9 -3
  106. package/optimize/es/components/tool_tip/tool_tip_popover.js +7 -7
  107. package/optimize/es/components/tour/tour.styles.js +4 -3
  108. package/optimize/es/components/tour/tour_step.js +7 -5
  109. package/optimize/es/global_styling/functions/logicals.js +5 -3
  110. package/optimize/es/global_styling/functions/math.js +35 -17
  111. package/optimize/es/global_styling/mixins/_padding.js +13 -9
  112. package/optimize/lib/components/basic_table/in_memory_table.js +1 -1
  113. package/optimize/lib/components/code/code.js +9 -3
  114. package/optimize/lib/components/code/code.styles.js +35 -0
  115. package/optimize/lib/components/code/code_block.js +71 -306
  116. package/optimize/lib/components/code/code_block.styles.js +156 -0
  117. package/optimize/lib/components/code/code_block_controls.js +48 -0
  118. package/optimize/lib/components/code/code_block_controls.styles.js +39 -0
  119. package/optimize/lib/components/code/code_block_copy.js +78 -0
  120. package/optimize/lib/components/code/code_block_full_screen.js +108 -0
  121. package/optimize/lib/components/code/code_block_line.styles.js +45 -0
  122. package/optimize/lib/components/code/code_block_overflow.js +82 -0
  123. package/optimize/lib/components/code/code_block_virtualized.js +81 -0
  124. package/optimize/lib/components/code/code_syntax.styles.js +57 -0
  125. package/optimize/lib/components/code/utils.js +40 -37
  126. package/optimize/lib/components/overlay_mask/overlay_mask.js +9 -9
  127. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +13 -17
  128. package/optimize/lib/components/overlay_mask/overlay_mask_body.styles.js +20 -0
  129. package/optimize/lib/components/provider/provider.js +7 -12
  130. package/optimize/lib/components/resizable_container/helpers.js +2 -2
  131. package/optimize/lib/components/resizable_container/resizable_container.js +7 -9
  132. package/optimize/lib/components/resizable_container/resizable_container.styles.js +31 -0
  133. package/optimize/lib/components/resizable_container/resizable_panel.js +28 -49
  134. package/optimize/lib/components/resizable_container/resizable_panel.styles.js +76 -0
  135. package/optimize/lib/components/search_bar/query/ast.js +14 -3
  136. package/optimize/lib/components/tool_tip/tool_tip.js +3 -2
  137. package/optimize/lib/components/tool_tip/tool_tip.styles.js +18 -26
  138. package/optimize/lib/components/tool_tip/tool_tip_arrow.js +10 -10
  139. package/optimize/lib/components/tool_tip/tool_tip_popover.js +6 -6
  140. package/optimize/lib/components/tour/tour.styles.js +3 -2
  141. package/optimize/lib/components/tour/tour_step.js +7 -5
  142. package/optimize/lib/global_styling/functions/logicals.js +4 -10
  143. package/optimize/lib/global_styling/functions/math.js +37 -19
  144. package/optimize/lib/global_styling/mixins/_padding.js +17 -10
  145. package/package.json +8 -7
  146. package/src/components/index.scss +0 -1
  147. package/src/components/resizable_container/_index.scss +0 -2
  148. package/src/global_styling/mixins/_header.scss +1 -1
  149. package/src/global_styling/variables/_index.scss +0 -1
  150. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  151. package/test-env/components/basic_table/in_memory_table.js +8 -2
  152. package/test-env/components/code/code.styles.js +35 -0
  153. package/test-env/components/code/code_block.styles.js +156 -0
  154. package/test-env/components/code/code_block_controls.js +48 -0
  155. package/test-env/components/code/code_block_controls.styles.js +39 -0
  156. package/test-env/components/code/code_block_copy.js +78 -0
  157. package/test-env/components/code/code_block_full_screen.js +108 -0
  158. package/test-env/components/code/code_block_line.styles.js +45 -0
  159. package/test-env/components/code/code_block_overflow.js +82 -0
  160. package/test-env/components/code/code_block_virtualized.js +81 -0
  161. package/test-env/components/code/code_syntax.styles.js +57 -0
  162. package/test-env/components/code/utils.js +40 -37
  163. package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
  164. package/test-env/components/overlay_mask/overlay_mask.js +9 -14
  165. package/test-env/components/overlay_mask/overlay_mask.styles.js +13 -17
  166. package/test-env/components/overlay_mask/overlay_mask_body.styles.js +20 -0
  167. package/test-env/components/provider/provider.js +7 -12
  168. package/test-env/components/resizable_container/helpers.js +2 -2
  169. package/test-env/components/resizable_container/resizable_container.js +7 -9
  170. package/test-env/components/resizable_container/resizable_container.styles.js +31 -0
  171. package/test-env/components/resizable_container/resizable_panel.js +28 -49
  172. package/test-env/components/resizable_container/resizable_panel.styles.js +76 -0
  173. package/test-env/components/search_bar/query/ast.js +14 -3
  174. package/test-env/components/tool_tip/tool_tip.js +3 -2
  175. package/test-env/components/tool_tip/tool_tip.styles.js +18 -26
  176. package/test-env/components/tool_tip/tool_tip_arrow.js +16 -11
  177. package/test-env/components/tool_tip/tool_tip_popover.js +6 -6
  178. package/test-env/components/tour/tour.styles.js +3 -2
  179. package/test-env/components/tour/tour_step.js +7 -5
  180. package/test-env/global_styling/functions/logicals.js +4 -10
  181. package/test-env/global_styling/functions/math.js +37 -19
  182. package/test-env/global_styling/mixins/_padding.js +17 -10
  183. package/src/components/code/_code.scss +0 -15
  184. package/src/components/code/_code_block.scss +0 -177
  185. package/src/components/code/_index.scss +0 -4
  186. package/src/components/code/_mixins.scss +0 -127
  187. package/src/components/code/_variables.scss +0 -5
  188. package/src/components/resizable_container/_resizable_container.scss +0 -8
  189. package/src/components/resizable_container/_resizable_panel.scss +0 -51
  190. package/src/global_styling/variables/_colors_code.scss +0 -23
  191. package/src/themes/amsterdam/overrides/_code.scss +0 -9
@@ -12,7 +12,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
12
12
  * Side Public License, v 1.
13
13
  */
14
14
  import { css, keyframes } from '@emotion/react';
15
- import { logicalCSS, logicalSizeCSS, euiFontSize, mathWithUnits } from '../../global_styling';
15
+ import { logicalCSS, logicalSizeCSS, euiFontSize, euiCanAnimate, mathWithUnits } from '../../global_styling';
16
16
  import { COLOR_MODES_STANDARD, tint, shade } from '../../services';
17
17
  import { euiShadow } from '../../themes/amsterdam';
18
18
  export var euiToolTipBackgroundColor = function euiToolTipBackgroundColor(euiTheme, colorMode) {
@@ -33,39 +33,34 @@ var euiToolTipAnimationHorizontal = function euiToolTipAnimationHorizontal(size)
33
33
  export var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
34
34
  var euiTheme = euiThemeContext.euiTheme,
35
35
  colorMode = euiThemeContext.colorMode;
36
- var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards");
37
- /*
38
- * 1. Shift arrow 1px more than half its size to account for border radius
39
- */
36
+ var animationTiming = "".concat(euiTheme.animation.slow, " ease-out 0s forwards"); // Shift arrow 1px more than half its size to account for border radius
40
37
 
41
38
  var arrowSize = euiTheme.size.m;
42
39
  var arrowPlusSize = mathWithUnits(arrowSize, function (x) {
43
40
  return (x / 2 + 1) * -1;
44
- }); // 1.
45
-
41
+ });
46
42
  var arrowMinusSize = mathWithUnits(arrowSize, function (x) {
47
43
  return (x / 2 - 1) * -1;
48
- }); // 1.
49
-
44
+ });
50
45
  return {
51
46
  // Base
52
47
  euiToolTip: /*#__PURE__*/css(euiShadow(euiThemeContext), ";border-radius:", euiTheme.border.radius.medium, ";background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";color:", euiTheme.colors.ghost, ";z-index:", euiTheme.levels.toast, ";", logicalCSS('max-width', '256px'), " overflow-wrap:break-word;padding:", euiTheme.size.s, ";", euiFontSize(euiThemeContext, 's'), ";position:absolute;[class*='euiHorizontalRule']{background-color:", euiToolTipBorderColor(euiTheme, colorMode), ";};label:euiToolTip;"),
53
48
  // Sizes
54
49
  s: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";;label:s;"),
55
50
  // Positions
56
- top: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, ";;label:top;"),
57
- bottom: /*#__PURE__*/css("animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";[class*='euiToolTip__arrow']{transform:translateY(", arrowMinusSize, ") rotateZ(45deg);};label:bottom;"),
58
- left: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";[class*='euiToolTip__arrow']{transform:translateX(", arrowPlusSize, ") rotateZ(45deg);};label:left;"),
59
- right: /*#__PURE__*/css("animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";[class*='euiToolTip__arrow']{transform:translateX(", arrowMinusSize, ") rotateZ(45deg);};label:right;"),
60
- // Elements
61
- euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), ";transform:translateY(", arrowPlusSize, ") rotateZ(45deg);;label:euiToolTip__arrow;")
62
- };
63
- };
64
- export var euiToolTipPopoverStyles = function euiToolTipPopoverStyles(_ref4) {
65
- var euiTheme = _ref4.euiTheme,
66
- colorMode = _ref4.colorMode;
67
- return {
68
- // Elements
51
+ top: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:top;"),
52
+ bottom: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationVertical(euiTheme.size.base), " ", animationTiming, ";};label:bottom;"),
53
+ left: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal("-".concat(euiTheme.size.base)), " ", animationTiming, ";};label:left;"),
54
+ right: /*#__PURE__*/css(euiCanAnimate, "{animation:", euiToolTipAnimationHorizontal(euiTheme.size.base), " ", animationTiming, ";};label:right;"),
55
+ // Arrow
56
+ euiToolTip__arrow: /*#__PURE__*/css("content:'';position:absolute;transform-origin:center;border-radius:2px;background-color:", euiToolTipBackgroundColor(euiTheme, colorMode), ";", logicalSizeCSS(arrowSize, arrowSize), ";;label:euiToolTip__arrow;"),
57
+ arrowPositions: {
58
+ top: /*#__PURE__*/css("transform:translateY(", arrowPlusSize, ") rotateZ(45deg);;label:top;"),
59
+ bottom: /*#__PURE__*/css("transform:translateY(", arrowMinusSize, ") rotateZ(45deg);;label:bottom;"),
60
+ left: /*#__PURE__*/css("transform:translateX(", arrowPlusSize, ") rotateZ(45deg);;label:left;"),
61
+ right: /*#__PURE__*/css("transform:translateX(", arrowMinusSize, ") rotateZ(45deg);;label:right;")
62
+ },
63
+ // Title
69
64
  euiToolTip__title: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.bold, ";", logicalCSS('border-bottom', "solid ".concat(euiTheme.border.width.thin, " ").concat(euiToolTipBorderColor(euiTheme, colorMode))), ";", logicalCSS('padding-bottom', euiTheme.size.xs), ";", logicalCSS('margin-bottom', euiTheme.size.xs), ";;label:euiToolTip__title;")
70
65
  };
71
66
  };
@@ -1,5 +1,11 @@
1
+ var _excluded = ["position"];
2
+
1
3
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
4
 
5
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
+
7
+ 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; }
8
+
3
9
  /*
4
10
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
11
  * or more contributor license agreements. Licensed under the Elastic License
@@ -8,13 +14,21 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
8
14
  * Side Public License, v 1.
9
15
  */
10
16
  import React from 'react';
17
+ import PropTypes from "prop-types";
11
18
  import { useEuiTheme } from '../../services';
12
19
  import { euiToolTipStyles } from './tool_tip.styles';
13
20
  import { jsx as ___EmotionJSX } from "@emotion/react";
14
- export var EuiToolTipArrow = function EuiToolTipArrow(props) {
21
+ export var EuiToolTipArrow = function EuiToolTipArrow(_ref) {
22
+ var position = _ref.position,
23
+ props = _objectWithoutProperties(_ref, _excluded);
24
+
15
25
  var euiTheme = useEuiTheme();
16
- var toolTipCss = euiToolTipStyles(euiTheme);
26
+ var styles = euiToolTipStyles(euiTheme);
27
+ var cssStyles = [styles.euiToolTip__arrow, styles.arrowPositions[position]];
17
28
  return ___EmotionJSX("div", _extends({
18
- css: [toolTipCss.euiToolTip__arrow, ";label:EuiToolTipArrow;"]
29
+ css: cssStyles
19
30
  }, props));
31
+ };
32
+ EuiToolTipArrow.propTypes = {
33
+ position: PropTypes.oneOf(["top", "right", "bottom", "left"]).isRequired
20
34
  };
@@ -17,7 +17,7 @@ import React, { useEffect, useRef, useCallback } from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classNames from 'classnames';
19
19
  import { useEuiTheme } from '../../services';
20
- import { euiToolTipStyles, euiToolTipPopoverStyles } from './tool_tip.styles';
20
+ import { euiToolTipStyles } from './tool_tip.styles';
21
21
  import { jsx as ___EmotionJSX } from "@emotion/react";
22
22
  export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
23
23
  var children = _ref.children,
@@ -30,9 +30,8 @@ export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
30
30
 
31
31
  var popover = useRef();
32
32
  var euiTheme = useEuiTheme();
33
- var toolTipCss = euiToolTipStyles(euiTheme);
34
- var popoverStyles = euiToolTipPopoverStyles(euiTheme);
35
- var titleCss = [popoverStyles.euiToolTip__title];
33
+ var styles = euiToolTipStyles(euiTheme);
34
+ var cssStyles = [styles.euiToolTip, calculatedPosition && styles[calculatedPosition]];
36
35
  var updateDimensions = useCallback(function () {
37
36
  requestAnimationFrame(function () {
38
37
  // Because of this delay, sometimes `positionToolTip` becomes unavailable.
@@ -58,11 +57,12 @@ export var EuiToolTipPopover = function EuiToolTipPopover(_ref) {
58
57
  }, [updateDimensions]);
59
58
  var classes = classNames('euiToolTipPopover', className);
60
59
  return ___EmotionJSX("div", _extends({
61
- css: [toolTipCss.euiToolTip, calculatedPosition && toolTipCss[calculatedPosition], ";label:EuiToolTipPopover;"],
60
+ css: cssStyles,
62
61
  className: classes,
63
- ref: setPopoverRef
62
+ ref: setPopoverRef,
63
+ "data-position": calculatedPosition
64
64
  }, rest), title && ___EmotionJSX("div", {
65
- css: titleCss,
65
+ css: styles.euiToolTip__title,
66
66
  className: "euiToolTip__title"
67
67
  }, title), children);
68
68
  };
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { css } from '@emotion/react';
9
9
  import { shade, tint, COLOR_MODES_STANDARD } from '../../services';
10
- import { logicalCSS, mathWithUnits } from '../../global_styling';
10
+ import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../global_styling';
11
11
  import { openAnimationTiming } from '../popover/popover_panel/_popover_panel.styles';
12
12
  import { popoverArrowSize } from '../popover/popover_arrow/_popover_arrow.styles';
13
13
 
@@ -20,7 +20,7 @@ export var euiTourStyles = function euiTourStyles(_ref) {
20
20
  colorMode = _ref.colorMode;
21
21
  return {
22
22
  // Targets EuiPopoverPanel
23
- euiTour: /*#__PURE__*/css("&[data-popover-open='true']{[class*='euiTourBeacon']{opacity:1;}}[data-popover-arrow='top']{&:before{", logicalCSS('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";}};label:euiTour;")
23
+ euiTour: /*#__PURE__*/css("[data-popover-arrow='top']::before{", logicalCSS('border-top-color', backgroundColor(euiTheme.colors.lightestShade, colorMode)), ";};label:euiTour;")
24
24
  };
25
25
  };
26
26
  export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
@@ -34,7 +34,8 @@ export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
34
34
  });
35
35
  return {
36
36
  // Base
37
- euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";;label:euiTourBeacon;"),
37
+ euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;", euiCanAnimate, "{opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";};label:euiTourBeacon;"),
38
+ isOpen: /*#__PURE__*/css(euiCanAnimate, "{opacity:1;};label:isOpen;"),
38
39
  // Positions
39
40
  right: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowOffset), ";;label:right;"),
40
41
  left: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowSize), ";;label:left;"),
@@ -1,4 +1,4 @@
1
- var _excluded = ["anchorPosition", "anchor", "children", "className", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction"];
1
+ var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "style", "subtitle", "title", "decoration", "footerAction", "panelProps"];
2
2
 
3
3
  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; }
4
4
 
@@ -58,6 +58,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
58
58
  anchor = _ref.anchor,
59
59
  children = _ref.children,
60
60
  className = _ref.className,
61
+ css = _ref.css,
61
62
  _ref$closePopover = _ref.closePopover,
62
63
  closePopover = _ref$closePopover === void 0 ? function () {} : _ref$closePopover,
63
64
  content = _ref.content,
@@ -77,6 +78,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
77
78
  _ref$decoration = _ref.decoration,
78
79
  decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
79
80
  footerAction = _ref.footerAction,
81
+ panelProps = _ref.panelProps,
80
82
  rest = _objectWithoutProperties(_ref, _excluded);
81
83
 
82
84
  var titleId = useGeneratedHtmlId();
@@ -120,7 +122,7 @@ export var EuiTourStep = function EuiTourStep(_ref) {
120
122
  var headerStyles = euiTourHeaderStyles(euiTheme);
121
123
  var footerStyles = euiTourFooterStyles(euiTheme);
122
124
  var beaconStyles = euiTourBeaconStyles(euiTheme);
123
- var beaconCss = [beaconStyles.euiTourBeacon, popoverPosition && beaconStyles[popoverPosition]];
125
+ var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
124
126
  var finishButtonProps = {
125
127
  color: 'text',
126
128
  flush: 'right',
@@ -181,9 +183,9 @@ export var EuiTourStep = function EuiTourStep(_ref) {
181
183
  ownFocus: false,
182
184
  panelClassName: classes,
183
185
  panelStyle: style,
184
- panelProps: {
185
- css: tourStyles.euiTour
186
- },
186
+ panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
187
+ css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
188
+ }),
187
189
  offset: hasBeacon ? 10 : 0,
188
190
  'aria-labelledby': titleId,
189
191
  arrowChildren: hasBeacon && ___EmotionJSX(EuiBeacon, {
@@ -1,3 +1,7 @@
1
+ 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; }
2
+
3
+ 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; }
4
+
1
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
6
 
3
7
  /*
@@ -83,9 +87,7 @@ export var logicalSizeCSS = function logicalSizeCSS(width, height) {
83
87
  */
84
88
 
85
89
  export var logicalSizeStyle = function logicalSizeStyle(width, height) {
86
- var _ref2;
87
-
88
- return _ref2 = {}, _defineProperty(_ref2, logicals.width, width), _defineProperty(_ref2, logicals.height, height), _ref2;
90
+ return _objectSpread(_objectSpread({}, logicalStyle('width', width)), logicalStyle('height', height));
89
91
  }; // Text alignment is separate because its the value that changes not the property
90
92
 
91
93
  export var logicalText = {
@@ -21,26 +21,44 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
21
21
  * Example usage:
22
22
  * mathWithUnits('4px', (x) => x / 2) = '2px';
23
23
  * mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
24
+ * mathWithUnits([euiTheme.size.l, euiTheme.size.s], (x, y) => x - y) = '16px';
24
25
  */
25
- export var mathWithUnits = function mathWithUnits(value, callback) {
26
+ // Unfortunately, this is the CSSProperties[] type used for several euiTheme vars
27
+ export var mathWithUnits = function mathWithUnits(values, callback) {
26
28
  var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
29
+ if (!Array.isArray(values)) values = [values];
30
+ var foundNumericValues = [];
31
+ var foundUnit = '';
32
+ values.forEach(function (value) {
33
+ if (typeof value === 'string') {
34
+ var _matches$groups, _matches$groups2;
27
35
 
28
- if (typeof value === 'string') {
29
- var _matches$groups;
30
-
31
- var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
32
- value: 1,
33
- unit: 2
34
- });
35
-
36
- var matches = regex.exec(value);
37
- if (!(matches !== null && matches !== void 0 && (_matches$groups = matches.groups) !== null && _matches$groups !== void 0 && _matches$groups.value)) return value;
38
- var numericValue = Number(matches.groups.value);
39
- var passedUnit = matches.groups.unit || unit;
40
- return "".concat(callback(numericValue)).concat(passedUnit);
41
- } else if (typeof value === 'number') {
42
- return "".concat(callback(value)).concat(unit);
43
- } else {
44
- return value;
45
- }
36
+ var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
37
+ value: 1,
38
+ unit: 2
39
+ });
40
+
41
+ var matches = regex.exec(value);
42
+ var numericValue = Number(matches === null || matches === void 0 ? void 0 : (_matches$groups = matches.groups) === null || _matches$groups === void 0 ? void 0 : _matches$groups.value);
43
+
44
+ if (!isNaN(numericValue)) {
45
+ foundNumericValues.push(numericValue);
46
+ } else {
47
+ throw new Error('No valid numeric value found');
48
+ }
49
+
50
+ if (!unit && matches !== null && matches !== void 0 && (_matches$groups2 = matches.groups) !== null && _matches$groups2 !== void 0 && _matches$groups2.unit) {
51
+ if (!foundUnit) {
52
+ foundUnit = matches.groups.unit;
53
+ } else if (foundUnit !== matches.groups.unit) {
54
+ throw new Error('Multiple units found. Use `calc()` to mix and math multiple unit types (e.g. `%` & `px`) instead');
55
+ }
56
+ }
57
+ } else if (typeof value === 'number') {
58
+ foundNumericValues.push(value);
59
+ } else {
60
+ throw new Error('Invalid value type - pass a string or number');
61
+ }
62
+ });
63
+ return "".concat(callback.apply(void 0, foundNumericValues)).concat(unit || foundUnit);
46
64
  };
@@ -23,18 +23,22 @@ export var euiPaddingSize = function euiPaddingSize(_ref, size) {
23
23
  return euiTheme.size[size];
24
24
  }
25
25
  };
26
+ export var euiPaddingSizeCSS = function euiPaddingSizeCSS(euiThemeContext, side) {
27
+ var property = side ? "padding-".concat(logicalSide[side]) : 'padding';
28
+ return {
29
+ none: null,
30
+ xs: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'xs'), ";;label:xs;"),
31
+ s: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 's'), ";;label:s;"),
32
+ m: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'm'), ";;label:m;"),
33
+ l: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'l'), ";;label:l;"),
34
+ xl: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'xl'), ";;label:xl;")
35
+ };
36
+ };
26
37
  export var useEuiPaddingSize = function useEuiPaddingSize(size) {
27
38
  var euiTheme = useEuiTheme();
28
39
  return euiPaddingSize(euiTheme, size);
29
40
  };
30
41
  export var useEuiPaddingCSS = function useEuiPaddingCSS(side) {
31
- var property = side ? "padding-".concat(logicalSide[side]) : 'padding';
32
- return {
33
- none: null,
34
- xs: /*#__PURE__*/css(property, ":", useEuiPaddingSize('xs'), ";;label:xs;"),
35
- s: /*#__PURE__*/css(property, ":", useEuiPaddingSize('s'), ";;label:s;"),
36
- m: /*#__PURE__*/css(property, ":", useEuiPaddingSize('m'), ";;label:m;"),
37
- l: /*#__PURE__*/css(property, ":", useEuiPaddingSize('l'), ";;label:l;"),
38
- xl: /*#__PURE__*/css(property, ":", useEuiPaddingSize('xl'), ";;label:xl;")
39
- };
42
+ var euiTheme = useEuiTheme();
43
+ return euiPaddingSizeCSS(euiTheme, side);
40
44
  };