@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
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiFlyoutHeaderStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
13
+
14
+ var _ref = process.env.NODE_ENV === "production" ? {
15
+ name: "1hivny1-euiFlyoutHeader",
16
+ styles: "flex-grow:0;label:euiFlyoutHeader;"
17
+ } : {
18
+ name: "1hivny1-euiFlyoutHeader",
19
+ styles: "flex-grow:0;label:euiFlyoutHeader;",
20
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
21
+ };
22
+
23
+ var euiFlyoutHeaderStyles = function euiFlyoutHeaderStyles(euiThemeContext) {
24
+ var euiTheme = euiThemeContext.euiTheme;
25
+ return {
26
+ euiFlyoutHeader: _ref,
27
+ hasBorder: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), ";;label:hasBorder;")
28
+ };
29
+ };
30
+
31
+ exports.euiFlyoutHeaderStyles = euiFlyoutHeaderStyles;
@@ -64,10 +64,10 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
64
64
  optionalCaptionText = _useInnerText2[1];
65
65
 
66
66
  return (0, _react2.jsx)("figure", (0, _extends2.default)({
67
- "aria-label": optionalCaptionText
68
- }, wrapperProps, {
69
- className: classes,
67
+ "aria-label": optionalCaptionText,
70
68
  css: cssFigureStyles
69
+ }, wrapperProps, {
70
+ className: classes
71
71
  }), allowFullScreen ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_image_button.EuiImageButton, {
72
72
  hasAlt: !!alt,
73
73
  hasShadow: hasShadow,
@@ -29,11 +29,16 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
29
29
  var measurement = options.measurement;
30
30
  var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
31
31
 
32
- var fontSizeNumeric = parseFloat(String(fontSize));
33
- var blockQuoteBorderWidth = fontSizeNumeric / 4;
34
- var tablePaddingVertical = fontSizeNumeric / 4;
35
- var tablePaddingHorizontal = fontSizeNumeric / 2;
36
- return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('border-left-width', "".concat(blockQuoteBorderWidth).concat(measurement)), "\n ").concat((0, _global_styling.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((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', "".concat(tablePaddingVertical).concat(measurement)), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', "".concat(tablePaddingHorizontal).concat(measurement)), "\n }\n ");
32
+ var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
33
+ return x / 4;
34
+ });
35
+ var tablePaddingVertical = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
36
+ return x / 4;
37
+ });
38
+ var tablePaddingHorizontal = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
39
+ return x / 2;
40
+ });
41
+ return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('border-left-width', blockQuoteBorderWidth), "\n ").concat((0, _global_styling.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((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', tablePaddingVertical), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
37
42
  };
38
43
  /**
39
44
  * Styles
@@ -77,7 +77,7 @@ var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
77
77
 
78
78
  var isResponsiveBreakpoint = (0, _services.useIsWithinBreakpoints)(['xs', 's'], !!responsive);
79
79
  var useTheme = (0, _services.useEuiTheme)();
80
- var classes = (0, _classnames.default)('euiPageHeaderContent');
80
+ var classes = (0, _classnames.default)('euiPageHeaderContent', className);
81
81
  var pageHeaderStyles = (0, _page_header.euiPageHeaderStyles)(useTheme);
82
82
  var contentStyles = (0, _page_header_content.euiPageHeaderContentStyles)(useTheme);
83
83
  var styles = (0, _restrict_width.setStyleForRestrictedPageWidth)(restrictWidth, style);
@@ -53,12 +53,11 @@ var EuiPageSection = function EuiPageSection(_ref) {
53
53
  var colors = (0, _global_styling.useEuiBackgroundColorCSS)();
54
54
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
55
55
  var contentStyles = (0, _page_section.euiPageSectionContentStyles)();
56
- var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
56
+ 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];
57
57
  return (0, _react2.jsx)(Component, (0, _extends2.default)({
58
58
  css: cssStyles
59
- }, rest), (0, _react2.jsx)("div", (0, _extends2.default)({
60
- css: cssContentStyles
61
- }, contentProps, {
59
+ }, rest), (0, _react2.jsx)("div", (0, _extends2.default)({}, contentProps, {
60
+ css: cssContentStyles,
62
61
  style: widthStyles
63
62
  }), children));
64
63
  };
@@ -21,7 +21,9 @@ var _mixins = require("../../themes/amsterdam/global_styling/mixins");
21
21
  var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeContext) {
22
22
  var euiTheme = euiThemeContext.euiTheme;
23
23
  var fontSizeS = (0, _global_styling.euiFontSize)(euiThemeContext, 's');
24
- var halfSizeM = parseInt(euiTheme.size.m.replace('px', '')) / 2;
24
+ var halfSizeM = (0, _global_styling.mathWithUnits)(euiTheme.size.m, function (x) {
25
+ return x / 2;
26
+ });
25
27
  var disabled = (0, _mixins.euiButtonEmptyColor)(euiThemeContext, 'disabled'); // && to increase specificity. Can likely be removed once EuiButtonEmpty has been converted.
26
28
 
27
29
  return {
@@ -29,7 +31,7 @@ var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeConte
29
31
  euiPaginationButton: /*#__PURE__*/(0, _react.css)("&&{", fontSizeS, ";padding:0;", (0, _global_styling.logicalTextAlignCSS)('center'), " border-radius:", euiTheme.border.radius.medium, ";outline-offset:-", euiTheme.focus.width, ";};label:euiPaginationButton;"),
30
32
  // States
31
33
  isActive: /*#__PURE__*/(0, _react.css)("&&{font-weight:", euiTheme.font.weight.bold, ";color:", euiTheme.colors.primary, ";.euiButtonEmpty__content{cursor:default;}&&,&&:hover{text-decoration:underline;}};label:isActive;"),
32
- isPlaceholder: /*#__PURE__*/(0, _react.css)("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", (0, _global_styling.logicalCSS)('padding-top', "".concat(halfSizeM, "px")), ";", (0, _global_styling.logicalCSS)('padding-bottom', 0), ";", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.s), ";", (0, _global_styling.logicalCSS)('height', euiTheme.size.l), ";};label:isPlaceholder;")
34
+ isPlaceholder: /*#__PURE__*/(0, _react.css)("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", (0, _global_styling.logicalCSS)('padding-top', halfSizeM), ";", (0, _global_styling.logicalCSS)('padding-bottom', 0), ";", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.s), ";", (0, _global_styling.logicalCSS)('height', euiTheme.size.l), ";};label:isPlaceholder;")
33
35
  };
34
36
  };
35
37
 
@@ -102,9 +102,9 @@ var EuiProgress = function EuiProgress(_ref) {
102
102
  }, label && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
103
103
  return (0, _react2.jsx)("span", (0, _extends2.default)({
104
104
  title: innerText,
105
- ref: ref
105
+ ref: ref,
106
+ css: labelCssStyles
106
107
  }, labelProps, {
107
- css: labelCssStyles,
108
108
  className: labelClasses
109
109
  }), label);
110
110
  }), valueRender && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
@@ -61,8 +61,11 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
61
61
  }; // Generate margins for headings based on customScale (not on heading level)
62
62
 
63
63
  var customScale = _customScale === 'xxxs' ? 'xxs' : _customScale || 'm';
64
- var headingMarginTop = "".concat(parseFloat(euiTheme.size[customScale]) * 2, "px");
65
- var headingMarginBottom = euiTheme.size[customScale];
64
+ var marginSize = euiTheme.size[customScale];
65
+ var headingMarginTop = (0, _global_styling.mathWithUnits)(marginSize, function (x) {
66
+ return x * 2;
67
+ });
68
+ var headingMarginBottom = marginSize;
66
69
  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((0, _global_styling.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((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.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((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.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((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.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((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.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((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat((0, _global_styling.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((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.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
67
70
  _customScale === 'm' ? "\n kbd {\n ".concat((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat((0, _global_styling.logicalCSS)('min-width', euiTheme.size.l), "\n ").concat((0, _global_styling.logicalTextAlignCSS)('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat((0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat((0, _global_styling.logicalCSS)('bottom', euiTheme.size.xxs), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n }") : '', "\n ");
68
71
  };
@@ -50,12 +50,13 @@ var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
50
50
  */
51
51
 
52
52
  var arrowSize = euiTheme.size.m;
53
- var arrowSizeInt = parseInt(arrowSize, 10);
54
- var arrowPlusSize = "".concat((arrowSizeInt / 2 + 1) * -1, "px");
55
- /* 1 */
53
+ var arrowPlusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
54
+ return (x / 2 + 1) * -1;
55
+ }); // 1.
56
56
 
57
- var arrowMinusSize = "".concat((arrowSizeInt / 2 - 1) * -1, "px");
58
- /* 1 */
57
+ var arrowMinusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
58
+ return (x / 2 - 1) * -1;
59
+ }); // 1.
59
60
 
60
61
  return {
61
62
  // Base
@@ -40,15 +40,20 @@ exports.euiTourStyles = euiTourStyles;
40
40
  var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
41
41
  var euiTheme = _ref2.euiTheme;
42
42
  var arrowSize = euiTheme.size[_popover_arrow.popoverArrowSize];
43
- var arrowSizeInt = parseInt(arrowSize, 10);
43
+ var arrowHalfSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
44
+ return x / 2;
45
+ });
46
+ var arrowOffset = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
47
+ return x * -2;
48
+ });
44
49
  return {
45
50
  // Base
46
51
  euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";;label:euiTourBeacon;"),
47
52
  // Positions
48
- right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt / 2, "px")), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt * -2, "px")), ";;label:right;"),
49
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt / 2, "px")), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
50
- top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt / 2, "px")), ";;label:top;"),
51
- bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', "".concat(arrowSizeInt * -2, "px")), ";", (0, _global_styling.logicalCSS)('left', "".concat(arrowSizeInt / 2, "px")), ";;label:bottom;")
53
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowOffset), ";;label:right;"),
54
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
55
+ top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:top;"),
56
+ bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowOffset), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:bottom;")
52
57
  };
53
58
  };
54
59
 
@@ -17,6 +17,19 @@ Object.keys(_logicals).forEach(function (key) {
17
17
  });
18
18
  });
19
19
 
20
+ var _math = require("./math");
21
+
22
+ Object.keys(_math).forEach(function (key) {
23
+ if (key === "default" || key === "__esModule") return;
24
+ if (key in exports && exports[key] === _math[key]) return;
25
+ Object.defineProperty(exports, key, {
26
+ enumerable: true,
27
+ get: function get() {
28
+ return _math[key];
29
+ }
30
+ });
31
+ });
32
+
20
33
  var _size = require("./size");
21
34
 
22
35
  Object.keys(_size).forEach(function (key) {
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.mathWithUnits = void 0;
11
+
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+
14
+ var _setPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/setPrototypeOf"));
15
+
16
+ function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); _groups.set(_this, groups || _groups.get(re)); return (0, _setPrototypeOf2.default)(_this, BabelRegExp.prototype); } (0, _inherits2.default)(BabelRegExp, RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; if (_typeof(args[args.length - 1]) !== "object") { args = [].slice.call(args); args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }
17
+
18
+ /*
19
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
20
+ * or more contributor license agreements. Licensed under the Elastic License
21
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
22
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
23
+ * Side Public License, v 1.
24
+ */
25
+
26
+ /**
27
+ * Utility for performing math callbacks on a string with CSS units
28
+ * and returning a string with its unit preserved.
29
+ *
30
+ * Example usage:
31
+ * mathWithUnits('4px', (x) => x / 2) = '2px';
32
+ * mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
33
+ */
34
+ var mathWithUnits = function mathWithUnits(value, callback) {
35
+ var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
36
+
37
+ if (typeof value === 'string') {
38
+ var _matches$groups;
39
+
40
+ var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
41
+ value: 1,
42
+ unit: 2
43
+ });
44
+
45
+ var matches = regex.exec(value);
46
+ if (!(matches !== null && matches !== void 0 && (_matches$groups = matches.groups) !== null && _matches$groups !== void 0 && _matches$groups.value)) return value;
47
+ var numericValue = Number(matches.groups.value);
48
+ var passedUnit = matches.groups.unit || unit;
49
+ return "".concat(callback(numericValue)).concat(passedUnit);
50
+ } else if (typeof value === 'number') {
51
+ return "".concat(callback(value)).concat(unit);
52
+ } else {
53
+ return value;
54
+ }
55
+ };
56
+
57
+ exports.mathWithUnits = mathWithUnits;
@@ -117,12 +117,15 @@ exports.useEuiYScroll = useEuiYScroll;
117
117
 
118
118
  var euiYScrollWithShadows = function euiYScrollWithShadows(euiTheme) {
119
119
  var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
120
- height = _ref7.height;
120
+ height = _ref7.height,
121
+ _ref7$side = _ref7.side,
122
+ side = _ref7$side === void 0 ? 'both' : _ref7$side;
121
123
 
122
124
  return "\n ".concat(euiYScroll(euiTheme, {
123
125
  height: height
124
126
  }), "\n ").concat(euiOverflowShadowStyles(euiTheme, {
125
- direction: 'y'
127
+ direction: 'y',
128
+ side: side
126
129
  }), "\n");
127
130
  };
128
131
 
@@ -1,196 +0,0 @@
1
- .euiFlyout {
2
- @include euiFlyout;
3
- animation: euiFlyout $euiAnimSpeedNormal $euiAnimSlightResistance;
4
-
5
- // Remove focus ring because of `tabindex=0`
6
- &:focus {
7
- outline: none;
8
- }
9
- }
10
-
11
- .euiFlyout__closeButton {
12
- position: absolute;
13
- right: $euiSizeS;
14
- top: $euiSizeS;
15
- z-index: 3;
16
-
17
- &:not(.euiFlyout__closeButton--outside) {
18
- background-color: transparentize($euiColorEmptyShade, .1);
19
- }
20
-
21
- &--outside {
22
- // match dropshadow
23
- @include euiBottomShadowLarge;
24
- right: auto;
25
- left: 0;
26
- // Override the hover and focus transitions of buttons
27
- // sass-lint:disable-block no-important
28
- transform: translateX(calc(-100% - #{$euiSizeL})) !important;
29
- animation: none !important;
30
-
31
- .euiFlyout--left & {
32
- left: auto;
33
- right: 0;
34
- transform: translateX(calc(100% + #{$euiSizeL})) !important;
35
- }
36
- }
37
- }
38
-
39
- .euiFlyoutBody__banner {
40
- overflow-x: hidden;
41
- }
42
-
43
- /**
44
- * 1. Calculating the minimum width based on the screen takeover breakpoint
45
- */
46
- $flyoutSizes: (
47
- 'small': (
48
- min: round(map-get($euiBreakpoints, 'm') * .5), /* 1 */
49
- width: 25vw,
50
- max: round(map-get($euiBreakpoints, 's') * .7),
51
- ),
52
- 'medium': (
53
- // Calculated for forms plus padding
54
- min: $euiFormMaxWidth + ($euiSizeM * 2),
55
- width: 50vw,
56
- max: map-get($euiBreakpoints, 'm'),
57
- ),
58
- 'large': (
59
- min: round(map-get($euiBreakpoints, 'm') * .9), /* 1 */
60
- width: 75vw,
61
- max: map-get($euiBreakpoints, 'l'),
62
- )
63
- );
64
-
65
- @each $name, $sizing in $flyoutSizes {
66
- .euiFlyout--#{$name} {
67
- min-width: map-get($sizing, min);
68
- width: map-get($sizing, width);
69
-
70
- &.euiFlyout--maxWidth-default {
71
- max-width: map-get($sizing, max);
72
- }
73
- }
74
- }
75
-
76
- @each $modifier, $paddingAmount in $euiFlyoutPaddingModifiers {
77
- .euiFlyout--#{$modifier} {
78
-
79
- .euiFlyoutHeader {
80
- padding: $paddingAmount $paddingAmount 0;
81
- }
82
-
83
- .euiFlyoutHeader--hasBorder {
84
- padding-bottom: $paddingAmount;
85
- }
86
-
87
- .euiFlyoutBody__overflowContent {
88
- padding: $paddingAmount;
89
- }
90
-
91
- .euiFlyoutBody__banner .euiCallOut {
92
- padding-left: $paddingAmount;
93
- padding-right: $paddingAmount;
94
- }
95
-
96
- .euiFlyoutFooter {
97
- @if $paddingAmount == $euiSizeL {
98
- padding: ($paddingAmount / 1.5) $paddingAmount;
99
- } @else if $paddingAmount == $euiSize {
100
- padding: ($paddingAmount * .75) $paddingAmount;
101
- } @else {
102
- padding: $paddingAmount;
103
- }
104
- }
105
- }
106
- }
107
-
108
- @keyframes euiFlyout {
109
- 0% {
110
- opacity: 0;
111
- transform: translateX(100%);
112
- }
113
-
114
- 75% {
115
- opacity: 1;
116
- transform: translateX(0%);
117
- }
118
- }
119
-
120
- /**
121
- * 1. Leave only a small sliver exposed on small screens so users understand that this is not a new page
122
- * 2. If a custom maxWidth is set, we need to override it.
123
- */
124
- @include euiBreakpoint('xs', 's') {
125
- // sass-lint:disable-block no-important
126
- .euiFlyout {
127
- max-width: 90vw !important; /* 1, 2 */
128
- }
129
-
130
- .euiFlyout--small {
131
- min-width: 0;
132
- width: map-get(map-get($flyoutSizes, 'small'), 'min');
133
- }
134
-
135
- .euiFlyout--medium {
136
- min-width: 0;
137
- width: map-get(map-get($flyoutSizes, 'medium'), 'min');
138
- }
139
-
140
- .euiFlyout--large {
141
- min-width: 0;
142
- width: map-get(map-get($flyoutSizes, 'large'), 'min');
143
- }
144
-
145
- // Pull in close buttons a little
146
- .euiFlyout__closeButton--outside {
147
- // Override the hover and focus transitions of buttons
148
- // sass-lint:disable-block no-important
149
- transform: translateX(calc(-100% - #{$euiSizeXS})) !important;
150
-
151
- .euiFlyout--left & {
152
- transform: translateX(calc(100% + #{$euiSizeXS})) !important;
153
- }
154
- }
155
- }
156
-
157
- /**
158
- * Left side flyout (should only be used for navigation)
159
- */
160
- .euiFlyout--left {
161
- border-right: $euiFlyoutBorder;
162
- border-left: none;
163
- right: auto;
164
- left: 0;
165
- clip-path: polygon(0 0, 150% 0, 150% 100%, 0 100%);
166
- animation-name: euiFlyoutLeft;
167
- }
168
-
169
- // Specific keyframes so in comes in from the left
170
- @keyframes euiFlyoutLeft {
171
- 0% {
172
- opacity: 0;
173
- transform: translateX(-100%);
174
- }
175
-
176
- 75% {
177
- opacity: 1;
178
- transform: translateX(0%);
179
- }
180
- }
181
-
182
- /**
183
- * Pushed style (inside body)
184
- */
185
- .euiFlyout.euiFlyout--push {
186
- box-shadow: none;
187
- clip-path: none;
188
- animation-duration: 0s; // Don't animate on loading a docked nav
189
- border-left: $euiBorderThick;
190
- z-index: $euiZHeader - 1; // Make sure the header shadows are above
191
-
192
- &.euiFlyout--left {
193
- border-left: none;
194
- border-right: $euiBorderThick;
195
- }
196
- }
@@ -1,18 +0,0 @@
1
- .euiFlyoutBody {
2
- flex-grow: 1;
3
- overflow-y: hidden;
4
- height: 100%;
5
-
6
- .euiFlyoutBody__overflow {
7
- @include euiYScrollWithShadows;
8
-
9
- &.euiFlyoutBody__overflow--hasBanner {
10
- @include euiOverflowShadow('y', 'end');
11
- }
12
- }
13
-
14
- .euiFlyoutBody__banner .euiCallOut {
15
- border: none; // Remove border from callout when it is a flyout banner
16
- border-radius: 0; // Ensures no border-radius in all themes
17
- }
18
- }
@@ -1,4 +0,0 @@
1
- .euiFlyoutFooter {
2
- background: $euiColorLightestShade;
3
- flex-grow: 0;
4
- }
@@ -1,7 +0,0 @@
1
- .euiFlyoutHeader {
2
- flex-grow: 0;
3
- }
4
-
5
- .euiFlyoutHeader--hasBorder {
6
- border-bottom: $euiBorderThin;
7
- }
@@ -1,7 +0,0 @@
1
- @import 'variables';
2
- @import 'mixins';
3
-
4
- @import 'flyout';
5
- @import 'flyout_body';
6
- @import 'flyout_footer';
7
- @import 'flyout_header';
@@ -1,18 +0,0 @@
1
-
2
- @mixin euiFlyout {
3
- border-left: $euiFlyoutBorder;
4
- // The mixin augments the above
5
- // sass-lint:disable mixins-before-declarations
6
- @include euiBottomShadowLarge;
7
- position: fixed;
8
- top: 0;
9
- bottom: 0;
10
- right: 0;
11
- height: 100%;
12
- z-index: $euiZFlyout;
13
- background: $euiColorEmptyShade;
14
- display: flex;
15
- flex-direction: column;
16
- align-items: stretch;
17
- clip-path: polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);
18
- }
@@ -1,8 +0,0 @@
1
- $euiFlyoutBorder: $euiBorderThin !default;
2
-
3
- $euiFlyoutPaddingModifiers: (
4
- 'paddingNone': 0,
5
- 'paddingSmall': $euiSizeS,
6
- 'paddingMedium': $euiSize,
7
- 'paddingLarge': $euiSizeL
8
- ) !default;
@@ -1 +0,0 @@
1
- $euiFlyoutBorder: none;