@elastic/eui 67.1.0 → 67.1.1

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 (153) hide show
  1. package/dist/eui_theme_dark.css +0 -292
  2. package/dist/eui_theme_dark.json +0 -24
  3. package/dist/eui_theme_dark.json.d.ts +0 -24
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -292
  6. package/dist/eui_theme_light.json +0 -24
  7. package/dist/eui_theme_light.json.d.ts +0 -24
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/accordion/accordion.js +5 -4
  10. package/es/components/accordion/accordion.styles.js +1 -1
  11. package/es/components/badge/badge.styles.js +10 -4
  12. package/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  13. package/es/components/button/button_icon/button_icon.js +11 -7
  14. package/es/components/collapsible_nav/collapsible_nav.js +8 -0
  15. package/es/components/expression/expression.styles.js +4 -2
  16. package/es/components/flyout/flyout.js +27 -48
  17. package/es/components/flyout/flyout.styles.js +111 -0
  18. package/es/components/flyout/flyout_body.js +14 -6
  19. package/es/components/flyout/flyout_body.styles.js +21 -0
  20. package/es/components/flyout/flyout_footer.js +8 -1
  21. package/es/components/flyout/flyout_footer.styles.js +14 -0
  22. package/es/components/flyout/flyout_header.js +9 -4
  23. package/es/components/flyout/flyout_header.styles.js +28 -0
  24. package/es/components/image/image_wrapper.js +3 -3
  25. package/es/components/markdown_editor/markdown_format.styles.js +11 -6
  26. package/es/components/page/page_header/page_header_content.js +1 -1
  27. package/es/components/page/page_section/page_section.js +3 -4
  28. package/es/components/pagination/pagination_button.styles.js +5 -3
  29. package/es/components/progress/progress.js +2 -2
  30. package/es/components/text/text.styles.js +6 -3
  31. package/es/components/tool_tip/tool_tip.styles.js +7 -6
  32. package/es/components/tour/tour.styles.js +11 -6
  33. package/es/global_styling/functions/index.js +1 -0
  34. package/es/global_styling/functions/math.js +46 -0
  35. package/es/global_styling/mixins/_helpers.js +5 -2
  36. package/eui.d.ts +95 -7
  37. package/i18ntokens.json +2 -2
  38. package/lib/components/accordion/accordion.js +5 -4
  39. package/lib/components/accordion/accordion.styles.js +1 -1
  40. package/lib/components/badge/badge.styles.js +9 -3
  41. package/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  42. package/lib/components/button/button_icon/button_icon.js +11 -7
  43. package/lib/components/collapsible_nav/collapsible_nav.js +8 -0
  44. package/lib/components/expression/expression.styles.js +3 -1
  45. package/lib/components/flyout/flyout.js +27 -47
  46. package/lib/components/flyout/flyout.styles.js +122 -0
  47. package/lib/components/flyout/flyout_body.js +16 -6
  48. package/lib/components/flyout/flyout_body.styles.js +32 -0
  49. package/lib/components/flyout/flyout_footer.js +10 -1
  50. package/lib/components/flyout/flyout_footer.styles.js +24 -0
  51. package/lib/components/flyout/flyout_header.js +11 -4
  52. package/lib/components/flyout/flyout_header.styles.js +31 -0
  53. package/lib/components/image/image_wrapper.js +3 -3
  54. package/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  55. package/lib/components/page/page_header/page_header_content.js +1 -1
  56. package/lib/components/page/page_section/page_section.js +3 -4
  57. package/lib/components/pagination/pagination_button.styles.js +4 -2
  58. package/lib/components/progress/progress.js +2 -2
  59. package/lib/components/text/text.styles.js +5 -2
  60. package/lib/components/tool_tip/tool_tip.styles.js +6 -5
  61. package/lib/components/tour/tour.styles.js +10 -5
  62. package/lib/global_styling/functions/index.js +13 -0
  63. package/lib/global_styling/functions/math.js +55 -0
  64. package/lib/global_styling/mixins/_helpers.js +5 -2
  65. package/optimize/es/components/accordion/accordion.js +5 -4
  66. package/optimize/es/components/accordion/accordion.styles.js +1 -1
  67. package/optimize/es/components/badge/badge.styles.js +10 -4
  68. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  69. package/optimize/es/components/button/button_icon/button_icon.js +11 -7
  70. package/optimize/es/components/expression/expression.styles.js +4 -2
  71. package/optimize/es/components/flyout/flyout.js +27 -48
  72. package/optimize/es/components/flyout/flyout.styles.js +111 -0
  73. package/optimize/es/components/flyout/flyout_body.js +14 -6
  74. package/optimize/es/components/flyout/flyout_body.styles.js +21 -0
  75. package/optimize/es/components/flyout/flyout_footer.js +8 -1
  76. package/optimize/es/components/flyout/flyout_footer.styles.js +14 -0
  77. package/optimize/es/components/flyout/flyout_header.js +9 -4
  78. package/optimize/es/components/flyout/flyout_header.styles.js +28 -0
  79. package/optimize/es/components/image/image_wrapper.js +3 -3
  80. package/optimize/es/components/markdown_editor/markdown_format.styles.js +11 -6
  81. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  82. package/optimize/es/components/page/page_section/page_section.js +3 -4
  83. package/optimize/es/components/pagination/pagination_button.styles.js +5 -3
  84. package/optimize/es/components/progress/progress.js +2 -2
  85. package/optimize/es/components/text/text.styles.js +6 -3
  86. package/optimize/es/components/tool_tip/tool_tip.styles.js +7 -6
  87. package/optimize/es/components/tour/tour.styles.js +11 -6
  88. package/optimize/es/global_styling/functions/index.js +1 -0
  89. package/optimize/es/global_styling/functions/math.js +44 -0
  90. package/optimize/es/global_styling/mixins/_helpers.js +5 -2
  91. package/optimize/lib/components/accordion/accordion.js +5 -4
  92. package/optimize/lib/components/accordion/accordion.styles.js +1 -1
  93. package/optimize/lib/components/badge/badge.styles.js +9 -3
  94. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  95. package/optimize/lib/components/button/button_icon/button_icon.js +11 -7
  96. package/optimize/lib/components/expression/expression.styles.js +3 -1
  97. package/optimize/lib/components/flyout/flyout.js +27 -47
  98. package/optimize/lib/components/flyout/flyout.styles.js +124 -0
  99. package/optimize/lib/components/flyout/flyout_body.js +16 -6
  100. package/optimize/lib/components/flyout/flyout_body.styles.js +32 -0
  101. package/optimize/lib/components/flyout/flyout_footer.js +10 -1
  102. package/optimize/lib/components/flyout/flyout_footer.styles.js +24 -0
  103. package/optimize/lib/components/flyout/flyout_header.js +11 -4
  104. package/optimize/lib/components/flyout/flyout_header.styles.js +31 -0
  105. package/optimize/lib/components/image/image_wrapper.js +3 -3
  106. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  107. package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
  108. package/optimize/lib/components/page/page_section/page_section.js +3 -4
  109. package/optimize/lib/components/pagination/pagination_button.styles.js +4 -2
  110. package/optimize/lib/components/progress/progress.js +2 -2
  111. package/optimize/lib/components/text/text.styles.js +5 -2
  112. package/optimize/lib/components/tool_tip/tool_tip.styles.js +6 -5
  113. package/optimize/lib/components/tour/tour.styles.js +10 -5
  114. package/optimize/lib/global_styling/functions/index.js +13 -0
  115. package/optimize/lib/global_styling/functions/math.js +57 -0
  116. package/optimize/lib/global_styling/mixins/_helpers.js +5 -2
  117. package/package.json +1 -1
  118. package/src/components/index.scss +0 -1
  119. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
  120. package/test-env/components/accordion/accordion.js +5 -4
  121. package/test-env/components/accordion/accordion.styles.js +1 -1
  122. package/test-env/components/badge/badge.styles.js +9 -3
  123. package/test-env/components/breadcrumbs/breadcrumb.styles.js +3 -1
  124. package/test-env/components/button/button_icon/button_icon.js +11 -7
  125. package/test-env/components/collapsible_nav/collapsible_nav.js +8 -0
  126. package/test-env/components/expression/expression.styles.js +3 -1
  127. package/test-env/components/flyout/flyout.styles.js +124 -0
  128. package/test-env/components/flyout/flyout_body.js +16 -6
  129. package/test-env/components/flyout/flyout_body.styles.js +32 -0
  130. package/test-env/components/flyout/flyout_footer.js +10 -1
  131. package/test-env/components/flyout/flyout_footer.styles.js +24 -0
  132. package/test-env/components/flyout/flyout_header.js +11 -4
  133. package/test-env/components/flyout/flyout_header.styles.js +31 -0
  134. package/test-env/components/image/image_wrapper.js +3 -3
  135. package/test-env/components/markdown_editor/markdown_format.styles.js +10 -5
  136. package/test-env/components/page/page_header/page_header_content.js +1 -1
  137. package/test-env/components/page/page_section/page_section.js +3 -4
  138. package/test-env/components/pagination/pagination_button.styles.js +4 -2
  139. package/test-env/components/progress/progress.js +2 -2
  140. package/test-env/components/text/text.styles.js +5 -2
  141. package/test-env/components/tool_tip/tool_tip.styles.js +6 -5
  142. package/test-env/components/tour/tour.styles.js +10 -5
  143. package/test-env/global_styling/functions/index.js +13 -0
  144. package/test-env/global_styling/functions/math.js +57 -0
  145. package/test-env/global_styling/mixins/_helpers.js +5 -2
  146. package/src/components/flyout/_flyout.scss +0 -196
  147. package/src/components/flyout/_flyout_body.scss +0 -18
  148. package/src/components/flyout/_flyout_footer.scss +0 -4
  149. package/src/components/flyout/_flyout_header.scss +0 -7
  150. package/src/components/flyout/_index.scss +0 -7
  151. package/src/components/flyout/_mixins.scss +0 -18
  152. package/src/components/flyout/_variables.scss +0 -8
  153. package/src/themes/amsterdam/global_styling/variables/_flyout.scss +0 -1
@@ -11,6 +11,8 @@ var _excluded = ["children", "className", "banner"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classNames from 'classnames';
14
+ import { useEuiTheme } from '../../services';
15
+ import { euiFlyoutBodyStyles } from './flyout_body.styles';
14
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
17
  export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
16
18
  var children = _ref.children,
@@ -19,16 +21,22 @@ export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
19
21
  rest = _objectWithoutProperties(_ref, _excluded);
20
22
 
21
23
  var classes = classNames('euiFlyoutBody', className);
22
- var overflowClasses = classNames('euiFlyoutBody__overflow', {
23
- 'euiFlyoutBody__overflow--hasBanner': banner
24
- });
24
+ var euiTheme = useEuiTheme();
25
+ var styles = euiFlyoutBodyStyles(euiTheme);
26
+ var cssStyles = [styles.euiFlyoutBody];
27
+ var bannerCssStyles = [banner && styles.euiFlyoutBody__banner];
28
+ var overflowCssStyles = [banner ? styles.euiFlyoutBody__overflow.hasBanner : styles.euiFlyoutBody__overflow.noBanner];
25
29
  return ___EmotionJSX("div", _extends({
26
30
  className: classes
27
- }, rest), ___EmotionJSX("div", {
31
+ }, rest, {
32
+ css: cssStyles
33
+ }), ___EmotionJSX("div", {
28
34
  tabIndex: 0,
29
- className: overflowClasses
35
+ className: "euiFlyoutBody__overflow",
36
+ css: overflowCssStyles
30
37
  }, banner && ___EmotionJSX("div", {
31
- className: "euiFlyoutBody__banner"
38
+ className: "euiFlyoutBody__banner",
39
+ css: bannerCssStyles
32
40
  }, banner), ___EmotionJSX("div", {
33
41
  className: "euiFlyoutBody__overflowContent"
34
42
  }, children)));
@@ -0,0 +1,21 @@
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, logicalCSSWithFallback, euiYScrollWithShadows } from '../../global_styling';
10
+ export var euiFlyoutBodyStyles = function euiFlyoutBodyStyles(euiThemeContext) {
11
+ return {
12
+ euiFlyoutBody: /*#__PURE__*/css(logicalCSSWithFallback('overflow-y', 'hidden'), " ", logicalCSS('height', '100%'), ";;label:euiFlyoutBody;"),
13
+ euiFlyoutBody__overflow: {
14
+ noBanner: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext), ";;label:noBanner;"),
15
+ hasBanner: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext, {
16
+ side: 'end'
17
+ }), ";;label:hasBanner;")
18
+ },
19
+ euiFlyoutBody__banner: /*#__PURE__*/css(logicalCSSWithFallback('overflow-x', 'hidden'), ";;label:euiFlyoutBody__banner;")
20
+ };
21
+ };
@@ -11,6 +11,8 @@ var _excluded = ["children", "className"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classNames from 'classnames';
14
+ import { useEuiTheme } from '../../services';
15
+ import { euiFlyoutFooterStyles } from './flyout_footer.styles';
14
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
17
  export var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
16
18
  var children = _ref.children,
@@ -18,7 +20,12 @@ export var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
18
20
  rest = _objectWithoutProperties(_ref, _excluded);
19
21
 
20
22
  var classes = classNames('euiFlyoutFooter', className);
23
+ var euiTheme = useEuiTheme();
24
+ var styles = euiFlyoutFooterStyles(euiTheme);
25
+ var cssStyles = [styles.euiFlyoutFooter];
21
26
  return ___EmotionJSX("div", _extends({
22
27
  className: classes
23
- }, rest), children);
28
+ }, rest, {
29
+ css: cssStyles
30
+ }), children);
24
31
  };
@@ -0,0 +1,14 @@
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
+ export var euiFlyoutFooterStyles = function euiFlyoutFooterStyles(euiThemeContext) {
10
+ var euiTheme = euiThemeContext.euiTheme;
11
+ return {
12
+ euiFlyoutFooter: /*#__PURE__*/css("background-color:", euiTheme.colors.lightestShade, ";flex-grow:0;;label:euiFlyoutFooter;")
13
+ };
14
+ };
@@ -11,6 +11,8 @@ var _excluded = ["children", "className", "hasBorder"];
11
11
  */
12
12
  import React from 'react';
13
13
  import classNames from 'classnames';
14
+ import { useEuiTheme } from '../../services';
15
+ import { euiFlyoutHeaderStyles } from './flyout_header.styles';
14
16
  import { jsx as ___EmotionJSX } from "@emotion/react";
15
17
  export var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
16
18
  var children = _ref.children,
@@ -19,10 +21,13 @@ export var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
19
21
  hasBorder = _ref$hasBorder === void 0 ? false : _ref$hasBorder,
20
22
  rest = _objectWithoutProperties(_ref, _excluded);
21
23
 
22
- var classes = classNames('euiFlyoutHeader', {
23
- 'euiFlyoutHeader--hasBorder': hasBorder
24
- }, className);
24
+ var classes = classNames('euiFlyoutHeader', className);
25
+ var euiTheme = useEuiTheme();
26
+ var styles = euiFlyoutHeaderStyles(euiTheme);
27
+ var cssStyles = [styles.euiFlyoutHeader, hasBorder && styles.hasBorder];
25
28
  return ___EmotionJSX("div", _extends({
26
29
  className: classes
27
- }, rest), children);
30
+ }, rest, {
31
+ css: cssStyles
32
+ }), children);
28
33
  };
@@ -0,0 +1,28 @@
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
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS } from '../../global_styling';
12
+
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "1hivny1-euiFlyoutHeader",
15
+ styles: "flex-grow:0;label:euiFlyoutHeader;"
16
+ } : {
17
+ name: "1hivny1-euiFlyoutHeader",
18
+ styles: "flex-grow:0;label:euiFlyoutHeader;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+
22
+ export var euiFlyoutHeaderStyles = function euiFlyoutHeaderStyles(euiThemeContext) {
23
+ var euiTheme = euiThemeContext.euiTheme;
24
+ return {
25
+ euiFlyoutHeader: _ref,
26
+ hasBorder: /*#__PURE__*/css(logicalCSS('border-bottom', euiTheme.border.thin), ";;label:hasBorder;")
27
+ };
28
+ };
@@ -44,10 +44,10 @@ export var EuiImageWrapper = function EuiImageWrapper(_ref) {
44
44
  optionalCaptionText = _useInnerText2[1];
45
45
 
46
46
  return ___EmotionJSX("figure", _extends({
47
- "aria-label": optionalCaptionText
48
- }, wrapperProps, {
49
- className: classes,
47
+ "aria-label": optionalCaptionText,
50
48
  css: cssFigureStyles
49
+ }, wrapperProps, {
50
+ className: classes
51
51
  }), allowFullScreen ? ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiImageButton, {
52
52
  hasAlt: !!alt,
53
53
  hasShadow: hasShadow,
@@ -6,7 +6,7 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import { css } from '@emotion/react';
9
- import { logicalCSS, euiFontSize } from '../../global_styling';
9
+ import { logicalCSS, euiFontSize, mathWithUnits } from '../../global_styling';
10
10
  /**
11
11
  * Mixins
12
12
  */
@@ -20,11 +20,16 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
20
20
  var measurement = options.measurement;
21
21
  var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
22
22
 
23
- var fontSizeNumeric = parseFloat(String(fontSize));
24
- var blockQuoteBorderWidth = fontSizeNumeric / 4;
25
- var tablePaddingVertical = fontSizeNumeric / 4;
26
- var tablePaddingHorizontal = fontSizeNumeric / 2;
27
- return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat(logicalCSS('border-left-width', "".concat(blockQuoteBorderWidth).concat(measurement)), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ").concat(fontSize, ";\n ").concat(logicalCSS('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat(logicalCSS('padding-vertical', "".concat(tablePaddingVertical).concat(measurement)), "\n ").concat(logicalCSS('padding-horizontal', "".concat(tablePaddingHorizontal).concat(measurement)), "\n }\n ");
23
+ var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
24
+ return x / 4;
25
+ });
26
+ var tablePaddingVertical = mathWithUnits(fontSize, function (x) {
27
+ return x / 4;
28
+ });
29
+ var tablePaddingHorizontal = mathWithUnits(fontSize, function (x) {
30
+ return x / 2;
31
+ });
32
+ return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ").concat(fontSize, ";\n ").concat(logicalCSS('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat(logicalCSS('padding-vertical', tablePaddingVertical), "\n ").concat(logicalCSS('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
28
33
  };
29
34
  /**
30
35
  * Styles
@@ -54,7 +54,7 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
54
54
 
55
55
  var isResponsiveBreakpoint = useIsWithinBreakpoints(['xs', 's'], !!responsive);
56
56
  var useTheme = useEuiTheme();
57
- var classes = classNames('euiPageHeaderContent');
57
+ var classes = classNames('euiPageHeaderContent', className);
58
58
  var pageHeaderStyles = euiPageHeaderStyles(useTheme);
59
59
  var contentStyles = euiPageHeaderContentStyles(useTheme);
60
60
  var styles = setStyleForRestrictedPageWidth(restrictWidth, style);
@@ -42,12 +42,11 @@ export var EuiPageSection = function EuiPageSection(_ref) {
42
42
  var colors = useEuiBackgroundColorCSS();
43
43
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
44
44
  var contentStyles = euiPageSectionContentStyles();
45
- var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
45
+ var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth, (contentProps === null || contentProps === void 0 ? void 0 : contentProps.css) && contentProps.css];
46
46
  return ___EmotionJSX(Component, _extends({
47
47
  css: cssStyles
48
- }, rest), ___EmotionJSX("div", _extends({
49
- css: cssContentStyles
50
- }, contentProps, {
48
+ }, rest), ___EmotionJSX("div", _extends({}, contentProps, {
49
+ css: cssContentStyles,
51
50
  style: widthStyles
52
51
  }), children));
53
52
  };
@@ -6,12 +6,14 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import { css } from '@emotion/react';
9
- import { logicalCSS, logicalTextAlignCSS, euiFontSize } from '../../global_styling';
9
+ import { logicalCSS, logicalTextAlignCSS, mathWithUnits, euiFontSize } from '../../global_styling';
10
10
  import { euiButtonEmptyColor } from '../../themes/amsterdam/global_styling/mixins';
11
11
  export var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeContext) {
12
12
  var euiTheme = euiThemeContext.euiTheme;
13
13
  var fontSizeS = euiFontSize(euiThemeContext, 's');
14
- var halfSizeM = parseInt(euiTheme.size.m.replace('px', '')) / 2;
14
+ var halfSizeM = mathWithUnits(euiTheme.size.m, function (x) {
15
+ return x / 2;
16
+ });
15
17
  var disabled = euiButtonEmptyColor(euiThemeContext, 'disabled'); // && to increase specificity. Can likely be removed once EuiButtonEmpty has been converted.
16
18
 
17
19
  return {
@@ -19,7 +21,7 @@ export var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThe
19
21
  euiPaginationButton: /*#__PURE__*/css("&&{", fontSizeS, ";padding:0;", logicalTextAlignCSS('center'), " border-radius:", euiTheme.border.radius.medium, ";outline-offset:-", euiTheme.focus.width, ";};label:euiPaginationButton;"),
20
22
  // States
21
23
  isActive: /*#__PURE__*/css("&&{font-weight:", euiTheme.font.weight.bold, ";color:", euiTheme.colors.primary, ";.euiButtonEmpty__content{cursor:default;}&&,&&:hover{text-decoration:underline;}};label:isActive;"),
22
- isPlaceholder: /*#__PURE__*/css("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", logicalCSS('padding-top', "".concat(halfSizeM, "px")), ";", logicalCSS('padding-bottom', 0), ";", logicalCSS('padding-horizontal', euiTheme.size.s), ";", logicalCSS('height', euiTheme.size.l), ";};label:isPlaceholder;")
24
+ isPlaceholder: /*#__PURE__*/css("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", logicalCSS('padding-top', halfSizeM), ";", logicalCSS('padding-bottom', 0), ";", logicalCSS('padding-horizontal', euiTheme.size.s), ";", logicalCSS('height', euiTheme.size.l), ";};label:isPlaceholder;")
23
25
  };
24
26
  };
25
27
  export var euiPaginationButtonArrowStyles = function euiPaginationButtonArrowStyles(_ref) {
@@ -79,9 +79,9 @@ export var EuiProgress = function EuiProgress(_ref) {
79
79
  }, label && ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
80
80
  return ___EmotionJSX("span", _extends({
81
81
  title: innerText,
82
- ref: ref
82
+ ref: ref,
83
+ css: labelCssStyles
83
84
  }, labelProps, {
84
- css: labelCssStyles,
85
85
  className: labelClasses
86
86
  }), label);
87
87
  }), valueRender && ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
@@ -6,7 +6,7 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import { css } from '@emotion/react';
9
- import { logicalCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor } from '../../global_styling';
9
+ import { logicalCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor, mathWithUnits } from '../../global_styling';
10
10
  import { euiLinkCSS } from '../link/link.styles';
11
11
  import { euiTitle } from '../title/title.styles';
12
12
  /**
@@ -45,8 +45,11 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
45
45
  }; // Generate margins for headings based on customScale (not on heading level)
46
46
 
47
47
  var customScale = _customScale === 'xxxs' ? 'xxs' : _customScale || 'm';
48
- var headingMarginTop = "".concat(parseFloat(euiTheme.size[customScale]) * 2, "px");
49
- var headingMarginBottom = euiTheme.size[customScale];
48
+ var marginSize = euiTheme.size[customScale];
49
+ var headingMarginTop = mathWithUnits(marginSize, function (x) {
50
+ return x * 2;
51
+ });
52
+ var headingMarginBottom = marginSize;
50
53
  return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(euiFontSize(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
51
54
  _customScale === 'm' ? "\n kbd {\n ".concat(logicalCSS('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat(logicalCSS('min-width', euiTheme.size.l), "\n ").concat(logicalTextAlignCSS('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat(logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat(logicalCSS('bottom', euiTheme.size.xxs), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('width', '100%'), "\n }") : '', "\n ");
52
55
  };
@@ -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 } from '../../global_styling';
15
+ import { logicalCSS, logicalSizeCSS, euiFontSize, 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) {
@@ -39,12 +39,13 @@ export var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
39
39
  */
40
40
 
41
41
  var arrowSize = euiTheme.size.m;
42
- var arrowSizeInt = parseInt(arrowSize, 10);
43
- var arrowPlusSize = "".concat((arrowSizeInt / 2 + 1) * -1, "px");
44
- /* 1 */
42
+ var arrowPlusSize = mathWithUnits(arrowSize, function (x) {
43
+ return (x / 2 + 1) * -1;
44
+ }); // 1.
45
45
 
46
- var arrowMinusSize = "".concat((arrowSizeInt / 2 - 1) * -1, "px");
47
- /* 1 */
46
+ var arrowMinusSize = mathWithUnits(arrowSize, function (x) {
47
+ return (x / 2 - 1) * -1;
48
+ }); // 1.
48
49
 
49
50
  return {
50
51
  // Base
@@ -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 } from '../../global_styling';
10
+ import { logicalCSS, mathWithUnits } 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
 
@@ -26,15 +26,20 @@ export var euiTourStyles = function euiTourStyles(_ref) {
26
26
  export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
27
27
  var euiTheme = _ref2.euiTheme;
28
28
  var arrowSize = euiTheme.size[popoverArrowSize];
29
- var arrowSizeInt = parseInt(arrowSize, 10);
29
+ var arrowHalfSize = mathWithUnits(arrowSize, function (x) {
30
+ return x / 2;
31
+ });
32
+ var arrowOffset = mathWithUnits(arrowSize, function (x) {
33
+ return x * -2;
34
+ });
30
35
  return {
31
36
  // Base
32
37
  euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";;label:euiTourBeacon;"),
33
38
  // Positions
34
- right: /*#__PURE__*/css(logicalCSS('top', "".concat(arrowSizeInt / 2, "px")), ";", logicalCSS('left', "".concat(arrowSizeInt * -2, "px")), ";;label:right;"),
35
- left: /*#__PURE__*/css(logicalCSS('top', "".concat(arrowSizeInt / 2, "px")), ";", logicalCSS('left', arrowSize), ";;label:left;"),
36
- top: /*#__PURE__*/css(logicalCSS('top', arrowSize), ";", logicalCSS('left', "".concat(arrowSizeInt / 2, "px")), ";;label:top;"),
37
- bottom: /*#__PURE__*/css(logicalCSS('top', "".concat(arrowSizeInt * -2, "px")), ";", logicalCSS('left', "".concat(arrowSizeInt / 2, "px")), ";;label:bottom;")
39
+ right: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowOffset), ";;label:right;"),
40
+ left: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowSize), ";;label:left;"),
41
+ top: /*#__PURE__*/css(logicalCSS('top', arrowSize), ";", logicalCSS('left', arrowHalfSize), ";;label:top;"),
42
+ bottom: /*#__PURE__*/css(logicalCSS('top', arrowOffset), ";", logicalCSS('left', arrowHalfSize), ";;label:bottom;")
38
43
  };
39
44
  };
40
45
  export var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
@@ -6,5 +6,6 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  export * from './logicals';
9
+ export * from './math';
9
10
  export * from './size';
10
11
  export * from './typography';
@@ -0,0 +1,44 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
2
+ import _inherits from "@babel/runtime/helpers/inherits";
3
+ import _setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf";
4
+
5
+ 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); }
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
+
15
+ /**
16
+ * Utility for performing math callbacks on a string with CSS units
17
+ * and returning a string with its unit preserved.
18
+ *
19
+ * Example usage:
20
+ * mathWithUnits('4px', (x) => x / 2) = '2px';
21
+ * mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
22
+ */
23
+ export var mathWithUnits = function mathWithUnits(value, callback) {
24
+ var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
25
+
26
+ if (typeof value === 'string') {
27
+ var _matches$groups;
28
+
29
+ var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
30
+ value: 1,
31
+ unit: 2
32
+ });
33
+
34
+ var matches = regex.exec(value);
35
+ if (!(matches !== null && matches !== void 0 && (_matches$groups = matches.groups) !== null && _matches$groups !== void 0 && _matches$groups.value)) return value;
36
+ var numericValue = Number(matches.groups.value);
37
+ var passedUnit = matches.groups.unit || unit;
38
+ return "".concat(callback(numericValue)).concat(passedUnit);
39
+ } else if (typeof value === 'number') {
40
+ return "".concat(callback(value)).concat(unit);
41
+ } else {
42
+ return value;
43
+ }
44
+ };
@@ -100,12 +100,15 @@ export var useEuiYScroll = function useEuiYScroll() {
100
100
  };
101
101
  export var euiYScrollWithShadows = function euiYScrollWithShadows(euiTheme) {
102
102
  var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
103
- height = _ref7.height;
103
+ height = _ref7.height,
104
+ _ref7$side = _ref7.side,
105
+ side = _ref7$side === void 0 ? 'both' : _ref7$side;
104
106
 
105
107
  return "\n ".concat(euiYScroll(euiTheme, {
106
108
  height: height
107
109
  }), "\n ").concat(euiOverflowShadowStyles(euiTheme, {
108
- direction: 'y'
110
+ direction: 'y',
111
+ side: side
109
112
  }), "\n");
110
113
  };
111
114
  export var useEuiYScrollWithShadows = function useEuiYScrollWithShadows() {
@@ -211,10 +211,10 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
211
211
 
212
212
  if (_arrowDisplay !== 'none') {
213
213
  iconButton = (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
214
- color: "text"
214
+ color: "text",
215
+ css: cssIconButtonStyles
215
216
  }, arrowProps, {
216
217
  className: iconButtonClasses,
217
- css: cssIconButtonStyles,
218
218
  iconType: "arrowRight",
219
219
  onClick: this.onToggle,
220
220
  "aria-controls": id,
@@ -250,10 +250,11 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
250
250
  childrenContent = children;
251
251
  }
252
252
 
253
- var button = (0, _react2.jsx)(ButtonElement, (0, _extends2.default)({}, buttonProps, {
253
+ var button = (0, _react2.jsx)(ButtonElement, (0, _extends2.default)({
254
+ css: cssButtonStyles
255
+ }, buttonProps, {
254
256
  id: buttonId,
255
257
  className: buttonClasses,
256
- css: cssButtonStyles,
257
258
  "aria-controls": id,
258
259
  "aria-expanded": isOpen,
259
260
  onClick: isDisabled ? undefined : this.onToggle,
@@ -50,7 +50,7 @@ exports.euiAccordionChildrenStyles = euiAccordionChildrenStyles;
50
50
  var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
51
51
  var euiTheme = _ref6.euiTheme;
52
52
  return {
53
- euiAccordion__childWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 0), " opacity:0;overflow:hidden;transition:", _global_styling.logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;will-change:opacity,visibility,", _global_styling.logicals.height, ";&:focus{outline:none;};label:euiAccordion__childWrapper;"),
53
+ euiAccordion__childWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 0), " opacity:0;overflow:hidden;transition:", _global_styling.logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
54
54
  isOpen: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
55
55
  };
56
56
  };
@@ -28,14 +28,18 @@ var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
28
28
  var euiTheme = euiThemeContext.euiTheme,
29
29
  colorMode = euiThemeContext.colorMode;
30
30
  return {
31
- euiBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", (0, _global_styling.logicalCSS)('max-width', '100%'), " font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.base + 2, "px;font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", parseFloat(String(euiTheme.border.radius.medium)) / 2, "px;", (0, _global_styling.logicalTextAlignCSS)('left'), " &:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
31
+ euiBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", (0, _global_styling.logicalCSS)('max-width', '100%'), " font-size:", (0, _global_styling.euiFontSize)(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.base + 2, "px;font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
32
+ return x / 2;
33
+ }), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " &:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
32
34
  clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
33
35
  disabled: /*#__PURE__*/(0, _react.css)("color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled').color, "!important;background-color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled').backgroundColor, "!important;;label:disabled;"),
34
36
  // Hollow has a border and is mostly used for autocompleters.
35
37
  hollow: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";border-color:", colorMode === 'DARK' ? (0, _services.tint)(euiTheme.border.color, 0.15) : euiTheme.border.color, ";color:", euiTheme.colors.text, ";;label:hollow;"),
36
38
  // Content wrapper
37
39
  euiBadge__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)( // Ensure proper height in case of just displaying an icon
38
- 'min-height', "".concat(euiTheme.base + parseFloat(String(euiTheme.border.width.thin)) * 2, "px")), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
40
+ 'min-height', "".concat((0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
41
+ return euiTheme.base + x * 2;
42
+ }))), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
39
43
  // Text
40
44
  text: {
41
45
  euiBadge__text: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)(), " cursor:inherit;;label:euiBadge__text;"),
@@ -49,7 +53,9 @@ var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
49
53
  },
50
54
  // Clickable icons (iconOnClick)
51
55
  iconButton: {
52
- euiBadge__iconButton: /*#__PURE__*/(0, _react.css)("font-size:0;&:focus{background-color:", (0, _services.transparentize)(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", parseFloat(String(euiTheme.border.radius.small)) / 2, "px;}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
56
+ euiBadge__iconButton: /*#__PURE__*/(0, _react.css)("font-size:0;&:focus{background-color:", (0, _services.transparentize)(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
57
+ return x / 2;
58
+ }), ";}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
53
59
  right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";;label:right;"),
54
60
  left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";;label:left;")
55
61
  },
@@ -52,7 +52,9 @@ var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiThemeCon
52
52
  var euiTheme = euiThemeContext.euiTheme;
53
53
  return {
54
54
  euiBreadcrumb__content: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
55
- isTruncated: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)("".concat(parseFloat(euiTheme.size.base) * 10, "px")), ";;label:isTruncated;"),
55
+ isTruncated: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)((0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
56
+ return x * 10;
57
+ })), ";;label:isTruncated;"),
56
58
  isTruncatedLast: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)('none'), ";;label:isTruncatedLast;"),
57
59
  // Types
58
60
  page: /*#__PURE__*/(0, _react.css)("&:is(a):focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'inset'), ";}&:is(button):focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'center'), ";};label:page;"),
@@ -83,11 +83,15 @@ var EuiButtonIcon = function EuiButtonIcon(props) {
83
83
 
84
84
 
85
85
  var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
86
- var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
87
- display: display
88
- })[color]; // Temporary extra style for empty `:hover` state until we decide how to handle universally
89
-
90
- var hoverStyles = display === 'empty' ? /*#__PURE__*/(0, _react2.css)("&:hover{background-color:", (0, _button.euiButtonEmptyColor)(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;") : /*#__PURE__*/(0, _react2.css)(";label:hoverStyles;");
86
+ var styles = {
87
+ euiButtonIcon: /*#__PURE__*/(0, _react2.css)(";label:euiButtonIcon;"),
88
+ colors: (0, _button.useEuiButtonColorCSS)({
89
+ display: display
90
+ }),
91
+ // Temporary extra style for empty `:hover` state until we decide how to handle universally
92
+ hoverStyles: /*#__PURE__*/(0, _react2.css)("&:hover{background-color:", (0, _button.euiButtonEmptyColor)(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;")
93
+ };
94
+ var cssStyles = [styles.euiButtonIcon, styles.colors[color], display === 'empty' && styles.hoverStyles];
91
95
  var classes = (0, _classnames.default)('euiButtonIcon', size && sizeToClassNameMap[size], className);
92
96
 
93
97
  if (_color === 'ghost') {
@@ -133,7 +137,7 @@ var EuiButtonIcon = function EuiButtonIcon(props) {
133
137
  rel: rel
134
138
  });
135
139
  return (0, _react2.jsx)("a", (0, _extends2.default)({
136
- css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
140
+ css: cssStyles,
137
141
  tabIndex: isAriaHidden ? -1 : undefined,
138
142
  className: classes,
139
143
  href: href,
@@ -145,7 +149,7 @@ var EuiButtonIcon = function EuiButtonIcon(props) {
145
149
 
146
150
  var buttonType;
147
151
  return (0, _react2.jsx)("button", (0, _extends2.default)({
148
- css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
152
+ css: cssStyles,
149
153
  tabIndex: isAriaHidden ? -1 : undefined,
150
154
  disabled: isDisabled,
151
155
  className: classes,
@@ -24,7 +24,9 @@ var _colorCSS = function _colorCSS(color) {
24
24
  var euiExpressionStyles = function euiExpressionStyles(euiThemeContext) {
25
25
  var euiTheme = euiThemeContext.euiTheme;
26
26
  return {
27
- euiExpression: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " padding:", parseFloat(euiTheme.size.s) / 2, "px 0;color:", euiTheme.colors.text, ";&:focus{", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), ";}&+.euiExpression{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
27
+ euiExpression: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " padding:", (0, _global_styling.mathWithUnits)(euiTheme.size.s, function (x) {
28
+ return x / 2;
29
+ }), " 0;color:", euiTheme.colors.text, ";&:focus{", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), ";}&+.euiExpression{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
28
30
  // Variants
29
31
  columns: /*#__PURE__*/(0, _react.css)("border-color:transparent;", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), " ", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('width', '100%'), " display:flex;padding:", euiTheme.size.xs, ";border-radius:", euiTheme.size.xs, ";;label:columns;"),
30
32
  truncate: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), ";;label:truncate;"),