@elastic/eui 64.0.0 → 64.0.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 (71) hide show
  1. package/dist/eui_charts_theme.js +330 -330
  2. package/dist/eui_charts_theme.js.map +1 -1
  3. package/dist/eui_theme_dark.css +3 -312
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +3 -312
  6. package/dist/eui_theme_light.min.css +1 -1
  7. package/es/components/basic_table/collapsed_item_actions.js +1 -2
  8. package/es/components/breadcrumbs/breadcrumb.styles.js +2 -2
  9. package/es/components/image/image_button.styles.js +1 -1
  10. package/es/components/link/link.styles.js +6 -5
  11. package/es/components/text/text.styles.js +1 -1
  12. package/es/components/toast/global_toast_list.styles.js +2 -2
  13. package/es/global_styling/functions/logicals.js +16 -2
  14. package/es/global_styling/mixins/_helpers.js +11 -4
  15. package/es/global_styling/mixins/_states.js +3 -4
  16. package/es/global_styling/mixins/_typography.js +3 -1
  17. package/es/global_styling/reset/global_styles.js +1 -1
  18. package/es/global_styling/utility/utility.js +10 -2
  19. package/eui.d.ts +72 -55
  20. package/i18ntokens.json +4 -4
  21. package/lib/components/basic_table/collapsed_item_actions.js +1 -2
  22. package/lib/components/breadcrumbs/breadcrumb.styles.js +2 -2
  23. package/lib/components/image/image_button.styles.js +1 -1
  24. package/lib/components/link/link.styles.js +6 -5
  25. package/lib/components/text/text.styles.js +1 -1
  26. package/lib/components/toast/global_toast_list.styles.js +1 -1
  27. package/lib/global_styling/functions/logicals.js +21 -4
  28. package/lib/global_styling/mixins/_helpers.js +17 -6
  29. package/lib/global_styling/mixins/_states.js +3 -4
  30. package/lib/global_styling/mixins/_typography.js +4 -1
  31. package/lib/global_styling/reset/global_styles.js +1 -1
  32. package/lib/global_styling/utility/utility.js +16 -3
  33. package/optimize/es/components/basic_table/collapsed_item_actions.js +1 -2
  34. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +2 -2
  35. package/optimize/es/components/image/image_button.styles.js +1 -1
  36. package/optimize/es/components/link/link.styles.js +6 -5
  37. package/optimize/es/components/text/text.styles.js +1 -1
  38. package/optimize/es/components/toast/global_toast_list.styles.js +2 -2
  39. package/optimize/es/global_styling/functions/logicals.js +16 -2
  40. package/optimize/es/global_styling/mixins/_helpers.js +11 -4
  41. package/optimize/es/global_styling/mixins/_states.js +3 -4
  42. package/optimize/es/global_styling/mixins/_typography.js +3 -1
  43. package/optimize/es/global_styling/reset/global_styles.js +1 -1
  44. package/optimize/es/global_styling/utility/utility.js +10 -2
  45. package/optimize/lib/components/basic_table/collapsed_item_actions.js +1 -2
  46. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +2 -2
  47. package/optimize/lib/components/image/image_button.styles.js +1 -1
  48. package/optimize/lib/components/link/link.styles.js +6 -5
  49. package/optimize/lib/components/text/text.styles.js +1 -1
  50. package/optimize/lib/components/toast/global_toast_list.styles.js +1 -1
  51. package/optimize/lib/global_styling/functions/logicals.js +21 -4
  52. package/optimize/lib/global_styling/mixins/_helpers.js +17 -6
  53. package/optimize/lib/global_styling/mixins/_states.js +3 -4
  54. package/optimize/lib/global_styling/mixins/_typography.js +4 -1
  55. package/optimize/lib/global_styling/reset/global_styles.js +1 -1
  56. package/optimize/lib/global_styling/utility/utility.js +16 -3
  57. package/package.json +1 -1
  58. package/src/global_styling/mixins/_helpers.scss +9 -0
  59. package/src/global_styling/utility/_utility.scss +0 -127
  60. package/test-env/components/basic_table/collapsed_item_actions.js +1 -2
  61. package/test-env/components/breadcrumbs/breadcrumb.styles.js +2 -2
  62. package/test-env/components/image/image_button.styles.js +1 -1
  63. package/test-env/components/link/link.styles.js +6 -5
  64. package/test-env/components/text/text.styles.js +1 -1
  65. package/test-env/components/toast/global_toast_list.styles.js +1 -1
  66. package/test-env/global_styling/functions/logicals.js +21 -4
  67. package/test-env/global_styling/mixins/_helpers.js +17 -6
  68. package/test-env/global_styling/mixins/_states.js +3 -4
  69. package/test-env/global_styling/mixins/_typography.js +4 -1
  70. package/test-env/global_styling/reset/global_styles.js +1 -1
  71. package/test-env/global_styling/utility/utility.js +16 -3
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.logicals = exports.logicalTextAlignStyle = exports.logicalTextAlignCSS = exports.logicalText = exports.logicalStyle = exports.logicalSizeStyle = exports.logicalSizeCSS = exports.logicalSide = exports.logicalCSS = exports.LOGICAL_TEXT_ALIGNMENT = exports.LOGICAL_SIDES = exports.LOGICAL_PROPERTIES = void 0;
6
+ exports.logicals = exports.logicalTextAlignStyle = exports.logicalTextAlignCSS = exports.logicalText = exports.logicalStyle = exports.logicalSizeStyle = exports.logicalSizeCSS = exports.logicalSide = exports.logicalCSSWithFallback = exports.logicalCSS = exports.LOGICAL_TEXT_ALIGNMENT = exports.LOGICAL_SIDES = exports.LOGICAL_PROPERTIES = void 0;
7
7
 
8
8
  var _common = require("../../components/common");
9
9
 
@@ -64,8 +64,8 @@ var logicalSize = {
64
64
  'min-width': 'min-inline-size'
65
65
  };
66
66
  var logicalOverflow = {
67
- 'overflow-x': 'overflow-block',
68
- 'overflow-y': 'overflow-inline'
67
+ 'overflow-x': 'overflow-inline',
68
+ 'overflow-y': 'overflow-block'
69
69
  };
70
70
  var logicalBorders = {
71
71
  'border-horizontal': 'border-inline',
@@ -113,6 +113,23 @@ exports.LOGICAL_PROPERTIES = LOGICAL_PROPERTIES;
113
113
  var logicalCSS = function logicalCSS(property, value) {
114
114
  return "".concat(logicals[property], ": ").concat(value, ";");
115
115
  };
116
+ /**
117
+ * Some logical properties are not yet fully supported by all browsers.
118
+ * For those cases, we should use the old property as a fallback for
119
+ * browsers missing support, while allowing supporting browsers to use
120
+ * the logical properties.
121
+ *
122
+ * Examples:
123
+ * https://caniuse.com/?search=overflow-block
124
+ * https://caniuse.com/mdn-css_properties_float_flow_relative_values
125
+ */
126
+
127
+
128
+ exports.logicalCSS = logicalCSS;
129
+
130
+ var logicalCSSWithFallback = function logicalCSSWithFallback(property, value) {
131
+ return "\n ".concat(property, ": ").concat(value, ";\n ").concat(logicalCSS(property, value), "\n");
132
+ };
116
133
  /**
117
134
  *
118
135
  * @param property A string that is a valid CSS logical property
@@ -121,7 +138,7 @@ var logicalCSS = function logicalCSS(property, value) {
121
138
  */
122
139
 
123
140
 
124
- exports.logicalCSS = logicalCSS;
141
+ exports.logicalCSSWithFallback = logicalCSSWithFallback;
125
142
 
126
143
  var logicalStyle = function logicalStyle(property, value) {
127
144
  // Strip hyphens and camelCase the CSS logical property so React doesn't throw errors
@@ -3,12 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useEuiYScrollWithShadows = exports.useEuiYScroll = exports.useEuiXScrollWithShadows = exports.useEuiXScroll = exports.useEuiScrollBar = exports.useEuiOverflowScroll = exports.euiYScrollWithShadows = exports.euiYScroll = exports.euiXScrollWithShadows = exports.euiXScroll = exports.euiScrollBarStyles = exports.euiOverflowScroll = void 0;
6
+ exports.useEuiYScrollWithShadows = exports.useEuiYScroll = exports.useEuiXScrollWithShadows = exports.useEuiXScroll = exports.useEuiScrollBar = exports.useEuiOverflowScroll = exports.euiYScrollWithShadows = exports.euiYScroll = exports.euiXScrollWithShadows = exports.euiXScroll = exports.euiScrollBarStyles = exports.euiOverflowScroll = exports.euiFullHeight = void 0;
7
7
 
8
8
  var _theme = require("../../services/theme");
9
9
 
10
10
  var _color = require("../../services/color");
11
11
 
12
+ var _functions = require("../functions");
13
+
12
14
  /*
13
15
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
16
  * or more contributor license agreements. Licensed under the Elastic License
@@ -38,7 +40,7 @@ var euiScrollBarStyles = function euiScrollBarStyles(_ref) {
38
40
  // so it's being added to this mixin for allowing support wherever custom scrollbars are
39
41
 
40
42
  var firefoxSupport = "scrollbar-color: ".concat(thumbColor, " ").concat(trackColor, ";");
41
- return "scrollbar-width: ".concat(width, ";\n\n &::-webkit-scrollbar {\n width: ").concat(scrollBarSize, ";\n height: ").concat(scrollBarSize, ";\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ").concat(thumbColor, ";\n background-clip: content-box;\n border-radius: ").concat(scrollBarSize, ";\n border: ").concat(scrollBarCorner, " solid ").concat(trackColor, ";\n }\n\n &::-webkit-scrollbar-corner,\n &::-webkit-scrollbar-track {\n background-color: ").concat(trackColor, ";\n }\n\n ").concat(firefoxSupport, "\n ");
43
+ return "scrollbar-width: ".concat(width, ";\n\n &::-webkit-scrollbar {\n ").concat((0, _functions.logicalCSS)('width', scrollBarSize), "\n ").concat((0, _functions.logicalCSS)('height', scrollBarSize), "\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ").concat(thumbColor, ";\n background-clip: content-box;\n border-radius: ").concat(scrollBarSize, ";\n border: ").concat(scrollBarCorner, " solid ").concat(trackColor, ";\n }\n\n &::-webkit-scrollbar-corner,\n &::-webkit-scrollbar-track {\n background-color: ").concat(trackColor, ";\n }\n\n ").concat(firefoxSupport, "\n ");
42
44
  };
43
45
 
44
46
  exports.euiScrollBarStyles = euiScrollBarStyles;
@@ -92,12 +94,11 @@ var euiOverflowShadowStyles = function euiOverflowShadowStyles(_ref3) {
92
94
  */
93
95
 
94
96
 
95
- // TODO: How do we use Emotion to output the CSS class utilities instead?
96
97
  var euiYScroll = function euiYScroll(euiTheme) {
97
98
  var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
98
99
  height = _ref5.height;
99
100
 
100
- return "\n ".concat(euiScrollBarStyles(euiTheme), "\n height: ").concat(height || '100%', ";\n overflow-y: auto;\n overflow-x: hidden;\n &:focus {\n outline: none; /* 1 */\n }\n");
101
+ return "\n ".concat(euiScrollBarStyles(euiTheme), "\n ").concat((0, _functions.logicalCSS)('height', height || '100%'), "\n ").concat((0, _functions.logicalCSSWithFallback)('overflow-y', 'auto'), "\n ").concat((0, _functions.logicalCSSWithFallback)('overflow-x', 'hidden'), "\n &:focus {\n outline: none; /* 1 */\n }\n");
101
102
  };
102
103
 
103
104
  exports.euiYScroll = euiYScroll;
@@ -140,7 +141,7 @@ var useEuiYScrollWithShadows = function useEuiYScrollWithShadows() {
140
141
  exports.useEuiYScrollWithShadows = useEuiYScrollWithShadows;
141
142
 
142
143
  var euiXScroll = function euiXScroll(euiTheme) {
143
- return "\n ".concat(euiScrollBarStyles(euiTheme), "\n overflow-x: auto;\n &:focus {\n outline: none; /* 1 */\n }\n");
144
+ return "\n ".concat(euiScrollBarStyles(euiTheme), "\n ").concat((0, _functions.logicalCSSWithFallback)('overflow-x', 'auto'), "\n &:focus {\n outline: none; /* 1 */\n }\n");
144
145
  };
145
146
 
146
147
  exports.euiXScroll = euiXScroll;
@@ -196,5 +197,15 @@ var useEuiOverflowScroll = function useEuiOverflowScroll(direction) {
196
197
  mask: mask
197
198
  });
198
199
  };
200
+ /**
201
+ * For quickly applying a full-height element whether using flex or not
202
+ */
203
+
204
+
205
+ exports.useEuiOverflowScroll = useEuiOverflowScroll;
206
+
207
+ var euiFullHeight = function euiFullHeight() {
208
+ return "\n ".concat((0, _functions.logicalCSS)('height', '100%'), "\n flex: 1 1 auto;\n overflow: hidden;\n");
209
+ };
199
210
 
200
- exports.useEuiOverflowScroll = useEuiOverflowScroll;
211
+ exports.euiFullHeight = euiFullHeight;
@@ -23,7 +23,8 @@ var _services = require("../../services");
23
23
  * @param offset Accepts a specific measurement or 'inset', 'outset' or 'center' to adjust outline position
24
24
  * @param color Accepts any CSS color, **Note: only works in -webkit-**
25
25
  */
26
- var euiFocusRing = function euiFocusRing(euiTheme) {
26
+ var euiFocusRing = function euiFocusRing(_ref) {
27
+ var euiTheme = _ref.euiTheme;
27
28
  var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'center';
28
29
  var options = arguments.length > 2 ? arguments[2] : undefined;
29
30
  // Width is enforced as a constant at the global theme layer
@@ -51,9 +52,7 @@ var euiFocusRing = function euiFocusRing(euiTheme) {
51
52
  exports.euiFocusRing = euiFocusRing;
52
53
 
53
54
  var useEuiFocusRing = function useEuiFocusRing(offset, color) {
54
- var _useEuiTheme = (0, _services.useEuiTheme)(),
55
- euiTheme = _useEuiTheme.euiTheme;
56
-
55
+ var euiTheme = (0, _services.useEuiTheme)();
57
56
  return euiFocusRing(euiTheme, offset, {
58
57
  color: color
59
58
  });
@@ -9,6 +9,8 @@ var _typography = require("../functions/typography");
9
9
 
10
10
  var _hooks = require("../../services/theme/hooks");
11
11
 
12
+ var _functions = require("../functions");
13
+
12
14
  /*
13
15
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
16
  * or more contributor license agreements. Licensed under the Elastic License
@@ -54,7 +56,8 @@ exports.euiTextBreakWord = euiTextBreakWord;
54
56
 
55
57
  var euiTextTruncate = function euiTextTruncate() {
56
58
  var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
57
- return "\n max-width: ".concat(maxWidth, "; // Ensure that the node has a maximum width after which truncation can occur\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
59
+ return "\n ".concat((0, _functions.logicalCSS)('max-width', maxWidth) // Ensure that the node has a maximum width after which truncation can occur
60
+ , "\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
58
61
  };
59
62
  /**
60
63
  * Fixed-width numbers for tabular data
@@ -49,7 +49,7 @@ var EuiGlobalStyles = function EuiGlobalStyles(_ref) {
49
49
  * Final styles
50
50
  */
51
51
 
52
- var styles = /*#__PURE__*/(0, _react2.css)(_reset.resetStyles, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", (0, _mixins.euiFocusRing)(euiTheme), ";}::selection{background:", (0, _color.transparentize)(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
52
+ var styles = /*#__PURE__*/(0, _react2.css)(_reset.resetStyles, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", (0, _mixins.euiFocusRing)(euiThemeContext), ";}::selection{background:", (0, _color.transparentize)(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
53
53
  return (0, _react2.jsx)(_react2.Global, {
54
54
  styles: styles
55
55
  });
@@ -3,14 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EuiUtilityClasses = void 0;
6
+ exports.globalStyles = exports.EuiUtilityClasses = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _react2 = require("@emotion/react");
11
11
 
12
+ var _hooks = require("../../services/theme/hooks");
13
+
12
14
  var _screen_reader_only = require("../../components/accessibility/screen_reader_only/screen_reader_only.styles");
13
15
 
16
+ var _mixins = require("../mixins");
17
+
18
+ var _functions = require("../functions");
19
+
14
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
21
 
16
22
  /*
@@ -20,11 +26,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
20
26
  * in compliance with, at your election, the Elastic License 2.0 or the Server
21
27
  * Side Public License, v 1.
22
28
  */
23
- var globalStyles = /*#__PURE__*/(0, _react2.css)(".euiScreenReaderOnly{", (0, _screen_reader_only.euiScreenReaderOnly)(), ";};label:globalStyles;");
29
+ var globalStyles = function globalStyles(euiThemeContext) {
30
+ return /*#__PURE__*/(0, _react2.css)(".euiScreenReaderOnly{", (0, _screen_reader_only.euiScreenReaderOnly)(), ";}.eui-alignBaseline{vertical-align:baseline!important;}.eui-alignBottom{vertical-align:bottom!important;}.eui-alignMiddle{vertical-align:middle!important;}.eui-alignTop{vertical-align:top!important;}.eui-displayBlock{display:block!important;}.eui-displayInline{display:inline!important;}.eui-displayInlineBlock{display:inline-block!important;}.eui-fullWidth{display:block!important;", (0, _functions.logicalCSS)('width', '100% !important'), ";}.eui-fullHeight{", (0, _mixins.euiFullHeight)(), ";}.eui-textCenter{text-align:center!important;}.eui-textLeft{text-align:start!important;}.eui-textRight{text-align:end!important;}.eui-textNoWrap{white-space:nowrap!important;}.eui-textInheritColor{color:inherit!important;}.eui-textBreakWord{", (0, _mixins.euiTextBreakWord)(), ";}.eui-textBreakAll{overflow-wrap:break-word!important;word-break:break-all!important;}.eui-textBreakNormal{overflow-wrap:normal!important;word-wrap:normal!important;word-break:normal!important;}.eui-textTruncate{", (0, _mixins.euiTextTruncate)(), ";}.eui-textNumber{", (0, _mixins.euiNumberFormat)(euiThemeContext), ";}.eui-scrollBar{", (0, _mixins.euiScrollBarStyles)(euiThemeContext), ";}.eui-yScroll{", (0, _mixins.euiYScroll)(euiThemeContext), ";}.eui-xScroll{", (0, _mixins.euiXScroll)(euiThemeContext), ";}.eui-yScrollWithShadows{", (0, _mixins.euiYScrollWithShadows)(euiThemeContext), ";}.eui-xScrollWithShadows{", (0, _mixins.euiXScrollWithShadows)(euiThemeContext), ";}[class*='eui-showFor']{display:none!important;}", Object.keys(euiThemeContext.euiTheme.breakpoint).map(function (size) {
31
+ return "\n .eui-hideFor--".concat(size, " {\n ").concat((0, _mixins.euiBreakpoint)(euiThemeContext, [size]), " {\n display: none !important;\n }\n }\n .eui-showFor--").concat(size, " {\n ").concat((0, _mixins.euiBreakpoint)(euiThemeContext, [size]), " {\n display: inline !important;\n }\n }\n .eui-showFor--").concat(size, "--block {\n ").concat((0, _mixins.euiBreakpoint)(euiThemeContext, [size]), " {\n display: block !important;\n }\n }\n .eui-showFor--").concat(size, "--inlineBlock {\n ").concat((0, _mixins.euiBreakpoint)(euiThemeContext, [size]), " {\n display: inline-block !important;\n }\n }\n .eui-showFor--").concat(size, "--flex {\n ").concat((0, _mixins.euiBreakpoint)(euiThemeContext, [size]), " {\n display: flex !important;\n }\n }");
32
+ }), ";;label:globalStyles;");
33
+ };
34
+
35
+ exports.globalStyles = globalStyles;
24
36
 
25
37
  var EuiUtilityClasses = function EuiUtilityClasses() {
38
+ var euiTheme = (0, _hooks.useEuiTheme)();
26
39
  return (0, _react2.jsx)(_react2.Global, {
27
- styles: globalStyles
40
+ styles: globalStyles(euiTheme)
28
41
  });
29
42
  };
30
43
 
@@ -81,8 +81,7 @@ export var CollapsedItemActions = /*#__PURE__*/function (_Component) {
81
81
  _defineProperty(_assertThisInitialized(_this), "registerPopoverDiv", function (popoverDiv) {
82
82
  if (!_this.popoverDiv) {
83
83
  _this.popoverDiv = popoverDiv;
84
-
85
- _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
84
+ _this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
86
85
  }
87
86
  });
88
87
 
@@ -50,8 +50,8 @@ export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiT
50
50
  isTruncated: /*#__PURE__*/css(euiTextTruncate("".concat(parseFloat(euiTheme.size.base) * 10, "px")), ";;label:isTruncated;"),
51
51
  isTruncatedLast: /*#__PURE__*/css(euiTextTruncate('none'), ";;label:isTruncatedLast;"),
52
52
  // Types
53
- page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiTheme, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiTheme, 'center'), ";};label:page;"),
54
- application: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";background-color:", transparentize(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", logicalCSS('padding-vertical', euiTheme.size.xs), " ", logicalCSS('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", transparentize(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", euiFocusRing(euiTheme, 'inset'), ";:focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
53
+ page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiThemeContext, 'center'), ";};label:page;"),
54
+ application: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";background-color:", transparentize(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", logicalCSS('padding-vertical', euiTheme.size.xs), " ", logicalCSS('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", transparentize(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", euiFocusRing(euiThemeContext, 'inset'), ";:focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
55
55
  applicationStyles: {
56
56
  onlyChild: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";clip-path:none;", logicalCSS('padding-horizontal', euiTheme.size.m), ",;;label:onlyChild;"),
57
57
  firstChild: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, " 0 0 ", euiTheme.border.radius.medium, ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%\n );", logicalCSS('padding-left', euiTheme.size.m), ",;;label:firstChild;"),
@@ -14,7 +14,7 @@ export var euiImageButtonStyles = function euiImageButtonStyles(euiThemeContext)
14
14
  var euiTheme = euiThemeContext.euiTheme;
15
15
  return {
16
16
  // Base
17
- euiImageButton: /*#__PURE__*/css("position:relative;cursor:pointer;text-align:match-parent;line-height:0;&::before{opacity:0;content:'';pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0;", euiCanAnimate, "{transition:opacity ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";}}&:hover,&:focus{&::before{opacity:1;}[class*='euiImageButton__icon']{opacity:1;}}&:focus{", euiFocusRing(euiTheme, 'outset'), ";};label:euiImageButton;"),
17
+ euiImageButton: /*#__PURE__*/css("position:relative;cursor:pointer;text-align:match-parent;line-height:0;&::before{opacity:0;content:'';pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0;", euiCanAnimate, "{transition:opacity ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";}}&:hover,&:focus{&::before{opacity:1;}[class*='euiImageButton__icon']{opacity:1;}}&:focus{", euiFocusRing(euiThemeContext, 'outset'), ";};label:euiImageButton;"),
18
18
  fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:fullWidth;"),
19
19
  shadowHover: /*#__PURE__*/css("&::before{", euiShadow(euiThemeContext, 's'), ";};label:shadowHover;"),
20
20
  hasShadowHover: /*#__PURE__*/css("&::before{", euiShadow(euiThemeContext, 'm'), ";};label:hasShadowHover;")
@@ -20,8 +20,9 @@ export var euiLinkHoverCSS = function euiLinkHoverCSS() {
20
20
  export var euiLinkFocusCSS = function euiLinkFocusCSS(euiTheme) {
21
21
  return "\n text-decoration: underline;\n text-decoration-thickness: ".concat(euiTheme.border.width.thick, " !important;\n ");
22
22
  };
23
- export var euiLinkCSS = function euiLinkCSS(euiTheme) {
24
- return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n text-align: left;\n\n &:hover {\n ").concat(euiLinkHoverCSS(), "\n }\n\n &:focus {\n ").concat(euiFocusRing(euiTheme, 'outset'), "\n ").concat(euiLinkFocusCSS(euiTheme), "\n }\n ");
23
+ export var euiLinkCSS = function euiLinkCSS(euiThemeContext) {
24
+ var euiTheme = euiThemeContext.euiTheme;
25
+ return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n text-align: left;\n\n &:hover {\n ").concat(euiLinkHoverCSS(), "\n }\n\n &:focus {\n ").concat(euiFocusRing(euiThemeContext, 'outset'), "\n ").concat(euiLinkFocusCSS(euiTheme), "\n }\n ");
25
26
  };
26
27
 
27
28
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -33,10 +34,10 @@ var _ref = process.env.NODE_ENV === "production" ? {
33
34
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
34
35
  };
35
36
 
36
- export var euiLinkStyles = function euiLinkStyles(_ref2) {
37
- var euiTheme = _ref2.euiTheme;
37
+ export var euiLinkStyles = function euiLinkStyles(euiThemeContext) {
38
+ var euiTheme = euiThemeContext.euiTheme;
38
39
  return {
39
- euiLink: /*#__PURE__*/css(euiLinkCSS(euiTheme), " user-select:text;&[target='_blank']{position:relative;};label:euiLink;"),
40
+ euiLink: /*#__PURE__*/css(euiLinkCSS(euiThemeContext), " user-select:text;&[target='_blank']{position:relative;};label:euiLink;"),
40
41
  disabled: _ref,
41
42
  // Color styles
42
43
  primary: /*#__PURE__*/css(_colorCSS(euiTheme.colors.primaryText), ";label:primary;"),
@@ -58,7 +58,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
58
58
  export var euiTextStyles = function euiTextStyles(euiThemeContext) {
59
59
  var euiTheme = euiThemeContext.euiTheme;
60
60
  return {
61
- euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiTheme), ";}img{display:block;", logicalCSS('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", logicalTextAlignCSS('center'), " ", logicalCSS('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", logicalCSS('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", logicalCSS('height', euiTheme.border.width.thick), " ", logicalCSS('width', '50%'), " ", logicalCSS('left', '25%'), " ", logicalCSS('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", logicalCSS('top', '0'), ";}&:after{", logicalCSS('bottom', '0'), ";}}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:euiText;"),
61
+ euiText: /*#__PURE__*/css(euiText(euiTheme, true), ";clear:both;a:not([class]){", euiLinkCSS(euiThemeContext), ";}img{display:block;", logicalCSS('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", logicalTextAlignCSS('center'), " ", logicalCSS('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", logicalCSS('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", logicalCSS('height', euiTheme.border.width.thick), " ", logicalCSS('width', '50%'), " ", logicalCSS('left', '25%'), " ", logicalCSS('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", logicalCSS('top', '0'), ";}&:after{", logicalCSS('bottom', '0'), ";}}h1{", euiTitle(euiThemeContext, 'l'), ";}h2{", euiTitle(euiThemeContext, 'm'), ";}h3{", euiTitle(euiThemeContext, 's'), ";}h4,dt{", euiTitle(euiThemeContext, 'xs'), ";}h5{", euiTitle(euiThemeContext, 'xxs'), ";}h6{", euiTitle(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", euiBackgroundColor(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", logicalCSS('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", logicalCSS('padding-vertical', euiTheme.size.xxs), " ", logicalCSS('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:euiText;"),
62
62
  constrainedWidth: /*#__PURE__*/css(logicalCSS('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
63
63
  // Sizes
64
64
  m: /*#__PURE__*/css(euiScaleText(euiThemeContext, {
@@ -10,7 +10,7 @@ var _templateObject;
10
10
  * Side Public License, v 1.
11
11
  */
12
12
  import { css, keyframes } from '@emotion/react';
13
- import { euiBreakpoint, euiScrollBarStyles, logicalCSS, logicalSizeCSS } from '../../global_styling';
13
+ import { euiBreakpoint, euiScrollBarStyles, logicalCSS, logicalCSSWithFallback, logicalSizeCSS } from '../../global_styling';
14
14
  export var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
15
15
  var euiTheme = euiThemeContext.euiTheme;
16
16
  var euiToastWidth = euiTheme.base * 20;
@@ -20,7 +20,7 @@ export var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiTheme
20
20
  * 2. Allow some padding for shadow
21
21
  */
22
22
  // Base
23
- euiGlobalToastList: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", logicalCSS('bottom', 0), ";", logicalCSS('width', "".concat(euiToastWidth + euiTheme.base * 5, "px")), ";", logicalCSS('max-height', '100vh'), ";overflow-y:auto;", logicalCSS('overflow-y', 'auto'), ";scrollbar-width:none;&::-webkit-scrollbar{", logicalSizeCSS(0, 0), ";}&:not(:empty){", logicalCSS('padding-left', euiTheme.size.base), ";", logicalCSS('padding-right', euiTheme.size.base), ";", logicalCSS('padding-vertical', euiTheme.size.base), ";}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{&:not(:empty){", logicalCSS('left', 0), ";", logicalCSS('width', '100%'), ";}};label:euiGlobalToastList;"),
23
+ euiGlobalToastList: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", logicalCSS('bottom', 0), ";", logicalCSS('width', "".concat(euiToastWidth + euiTheme.base * 5, "px")), ";", logicalCSS('max-height', '100vh'), ";", logicalCSSWithFallback('overflow-y', 'auto'), ";scrollbar-width:none;&::-webkit-scrollbar{", logicalSizeCSS(0, 0), ";}&:not(:empty){", logicalCSS('padding-left', euiTheme.size.base), ";", logicalCSS('padding-right', euiTheme.size.base), ";", logicalCSS('padding-vertical', euiTheme.size.base), ";}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{&:not(:empty){", logicalCSS('left', 0), ";", logicalCSS('width', '100%'), ";}};label:euiGlobalToastList;"),
24
24
  // Variants
25
25
  right: /*#__PURE__*/css("&:not(:empty){", logicalCSS('right', 0), ";", logicalCSS('padding-left', "".concat(euiTheme.base * 4, "px")), ";}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{&:not(:empty){", logicalCSS('padding-left', euiTheme.size.base), ";}};label:right;"),
26
26
  left: /*#__PURE__*/css("&:not(:empty){", logicalCSS('left', 0), ";", logicalCSS('padding-right', "".concat(euiTheme.base * 4, "px")), ";}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{&:not(:empty){", logicalCSS('padding-right', euiTheme.size.base), ";}};label:left;")
@@ -62,8 +62,8 @@ var logicalSize = {
62
62
  'min-width': 'min-inline-size'
63
63
  };
64
64
  var logicalOverflow = {
65
- 'overflow-x': 'overflow-block',
66
- 'overflow-y': 'overflow-inline'
65
+ 'overflow-x': 'overflow-inline',
66
+ 'overflow-y': 'overflow-block'
67
67
  };
68
68
  var logicalBorders = {
69
69
  'border-horizontal': 'border-inline',
@@ -107,6 +107,20 @@ export var LOGICAL_PROPERTIES = keysOf(logicals);
107
107
  export var logicalCSS = function logicalCSS(property, value) {
108
108
  return "".concat(logicals[property], ": ").concat(value, ";");
109
109
  };
110
+ /**
111
+ * Some logical properties are not yet fully supported by all browsers.
112
+ * For those cases, we should use the old property as a fallback for
113
+ * browsers missing support, while allowing supporting browsers to use
114
+ * the logical properties.
115
+ *
116
+ * Examples:
117
+ * https://caniuse.com/?search=overflow-block
118
+ * https://caniuse.com/mdn-css_properties_float_flow_relative_values
119
+ */
120
+
121
+ export var logicalCSSWithFallback = function logicalCSSWithFallback(property, value) {
122
+ return "\n ".concat(property, ": ").concat(value, ";\n ").concat(logicalCSS(property, value), "\n");
123
+ };
110
124
  /**
111
125
  *
112
126
  * @param property A string that is a valid CSS logical property
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { useEuiTheme } from '../../services/theme';
9
9
  import { transparentize } from '../../services/color';
10
+ import { logicalCSS, logicalCSSWithFallback } from '../functions';
10
11
  /**
11
12
  * Set scroll bar appearance on Chrome (and firefox).
12
13
  * All parameters are optional and default to specific global settings.
@@ -34,7 +35,7 @@ export var euiScrollBarStyles = function euiScrollBarStyles(_ref) {
34
35
  // so it's being added to this mixin for allowing support wherever custom scrollbars are
35
36
 
36
37
  var firefoxSupport = "scrollbar-color: ".concat(thumbColor, " ").concat(trackColor, ";");
37
- return "scrollbar-width: ".concat(width, ";\n\n &::-webkit-scrollbar {\n width: ").concat(scrollBarSize, ";\n height: ").concat(scrollBarSize, ";\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ").concat(thumbColor, ";\n background-clip: content-box;\n border-radius: ").concat(scrollBarSize, ";\n border: ").concat(scrollBarCorner, " solid ").concat(trackColor, ";\n }\n\n &::-webkit-scrollbar-corner,\n &::-webkit-scrollbar-track {\n background-color: ").concat(trackColor, ";\n }\n\n ").concat(firefoxSupport, "\n ");
38
+ return "scrollbar-width: ".concat(width, ";\n\n &::-webkit-scrollbar {\n ").concat(logicalCSS('width', scrollBarSize), "\n ").concat(logicalCSS('height', scrollBarSize), "\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: ").concat(thumbColor, ";\n background-clip: content-box;\n border-radius: ").concat(scrollBarSize, ";\n border: ").concat(scrollBarCorner, " solid ").concat(trackColor, ";\n }\n\n &::-webkit-scrollbar-corner,\n &::-webkit-scrollbar-track {\n background-color: ").concat(trackColor, ";\n }\n\n ").concat(firefoxSupport, "\n ");
38
39
  };
39
40
  export var useEuiScrollBar = function useEuiScrollBar(options) {
40
41
  var euiTheme = useEuiTheme();
@@ -82,12 +83,11 @@ var euiOverflowShadowStyles = function euiOverflowShadowStyles(_ref3) {
82
83
  */
83
84
 
84
85
 
85
- // TODO: How do we use Emotion to output the CSS class utilities instead?
86
86
  export var euiYScroll = function euiYScroll(euiTheme) {
87
87
  var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
88
88
  height = _ref5.height;
89
89
 
90
- return "\n ".concat(euiScrollBarStyles(euiTheme), "\n height: ").concat(height || '100%', ";\n overflow-y: auto;\n overflow-x: hidden;\n &:focus {\n outline: none; /* 1 */\n }\n");
90
+ return "\n ".concat(euiScrollBarStyles(euiTheme), "\n ").concat(logicalCSS('height', height || '100%'), "\n ").concat(logicalCSSWithFallback('overflow-y', 'auto'), "\n ").concat(logicalCSSWithFallback('overflow-x', 'hidden'), "\n &:focus {\n outline: none; /* 1 */\n }\n");
91
91
  };
92
92
  export var useEuiYScroll = function useEuiYScroll() {
93
93
  var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
@@ -118,7 +118,7 @@ export var useEuiYScrollWithShadows = function useEuiYScrollWithShadows() {
118
118
  });
119
119
  };
120
120
  export var euiXScroll = function euiXScroll(euiTheme) {
121
- return "\n ".concat(euiScrollBarStyles(euiTheme), "\n overflow-x: auto;\n &:focus {\n outline: none; /* 1 */\n }\n");
121
+ return "\n ".concat(euiScrollBarStyles(euiTheme), "\n ").concat(logicalCSSWithFallback('overflow-x', 'auto'), "\n &:focus {\n outline: none; /* 1 */\n }\n");
122
122
  };
123
123
  export var useEuiXScroll = function useEuiXScroll() {
124
124
  var euiTheme = useEuiTheme();
@@ -158,4 +158,11 @@ export var useEuiOverflowScroll = function useEuiOverflowScroll(direction) {
158
158
  direction: direction,
159
159
  mask: mask
160
160
  });
161
+ };
162
+ /**
163
+ * For quickly applying a full-height element whether using flex or not
164
+ */
165
+
166
+ export var euiFullHeight = function euiFullHeight() {
167
+ return "\n ".concat(logicalCSS('height', '100%'), "\n flex: 1 1 auto;\n overflow: hidden;\n");
161
168
  };
@@ -15,7 +15,8 @@ import { useEuiTheme } from '../../services';
15
15
  * @param offset Accepts a specific measurement or 'inset', 'outset' or 'center' to adjust outline position
16
16
  * @param color Accepts any CSS color, **Note: only works in -webkit-**
17
17
  */
18
- export var euiFocusRing = function euiFocusRing(euiTheme) {
18
+ export var euiFocusRing = function euiFocusRing(_ref) {
19
+ var euiTheme = _ref.euiTheme;
19
20
  var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'center';
20
21
  var options = arguments.length > 2 ? arguments[2] : undefined;
21
22
  // Width is enforced as a constant at the global theme layer
@@ -40,9 +41,7 @@ export var euiFocusRing = function euiFocusRing(euiTheme) {
40
41
  return "\n outline: ".concat(outlineWidth, " solid ").concat(outlineColor, ";\n outline-offset: ").concat(outlineOffset, ";\n\n // \uD83D\uDC40 Chrome respects :focus-visible and allows coloring the `auto` style\n &:focus-visible {\n outline-style: auto;\n }\n\n // \uD83D\uDE45\u200D\u2640\uFE0F But Chrome also needs to have the outline forcefully removed from regular `:focus` state\n &:not(:focus-visible) {\n outline: none;\n }\n ");
41
42
  };
42
43
  export var useEuiFocusRing = function useEuiFocusRing(offset, color) {
43
- var _useEuiTheme = useEuiTheme(),
44
- euiTheme = _useEuiTheme.euiTheme;
45
-
44
+ var euiTheme = useEuiTheme();
46
45
  return euiFocusRing(euiTheme, offset, {
47
46
  color: color
48
47
  });
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { euiLineHeightFromBaseline, euiFontSizeFromScale } from '../functions/typography';
9
9
  import { useEuiTheme } from '../../services/theme/hooks';
10
+ import { logicalCSS } from '../functions';
10
11
 
11
12
  /**
12
13
  * Returns font-size and line-height
@@ -36,7 +37,8 @@ export var euiTextBreakWord = function euiTextBreakWord() {
36
37
 
37
38
  export var euiTextTruncate = function euiTextTruncate() {
38
39
  var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
39
- return "\n max-width: ".concat(maxWidth, "; // Ensure that the node has a maximum width after which truncation can occur\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
40
+ return "\n ".concat(logicalCSS('max-width', maxWidth) // Ensure that the node has a maximum width after which truncation can occur
41
+ , "\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n");
40
42
  };
41
43
  /**
42
44
  * Fixed-width numbers for tabular data
@@ -42,7 +42,7 @@ export var EuiGlobalStyles = function EuiGlobalStyles(_ref) {
42
42
  * Final styles
43
43
  */
44
44
 
45
- var styles = /*#__PURE__*/css(reset, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", euiFocusRing(euiTheme), ";}::selection{background:", transparentize(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
45
+ var styles = /*#__PURE__*/css(reset, " html{", scrollbarStyles, " ", fontReset, " text-size-adjust:100%;font-kerning:normal;height:100%;background-color:", colors.body, ";color:", colors.text, ";}code,pre,kbd,samp{font-family:", font.familyCode, ";}input,textarea,select{", fontReset, ";}button{font-family:", font.family, ";}em{font-style:italic;}strong{font-weight:", font.weight.bold, ";}*:focus{", euiFocusRing(euiThemeContext), ";}::selection{background:", transparentize(colors.primary, colorMode === 'LIGHT' ? 0.1 : 0.2), ";}a{color:", colors.primaryText, ";&,&:hover,&:focus{text-decoration:none;}}.euiBody-hasPortalContent{position:relative;};label:styles;");
46
46
  return ___EmotionJSX(Global, {
47
47
  styles: styles
48
48
  });
@@ -7,11 +7,19 @@
7
7
  */
8
8
  import React from 'react';
9
9
  import { Global, css } from '@emotion/react';
10
+ import { useEuiTheme } from '../../services/theme/hooks';
10
11
  import { euiScreenReaderOnly } from '../../components/accessibility/screen_reader_only/screen_reader_only.styles';
12
+ import { euiFullHeight, euiTextBreakWord, euiTextTruncate, euiNumberFormat, euiScrollBarStyles, euiYScroll, euiXScroll, euiYScrollWithShadows, euiXScrollWithShadows, euiBreakpoint } from '../mixins';
13
+ import { logicalCSS } from '../functions';
11
14
  import { jsx as ___EmotionJSX } from "@emotion/react";
12
- var globalStyles = /*#__PURE__*/css(".euiScreenReaderOnly{", euiScreenReaderOnly(), ";};label:globalStyles;");
15
+ export var globalStyles = function globalStyles(euiThemeContext) {
16
+ return /*#__PURE__*/css(".euiScreenReaderOnly{", euiScreenReaderOnly(), ";}.eui-alignBaseline{vertical-align:baseline!important;}.eui-alignBottom{vertical-align:bottom!important;}.eui-alignMiddle{vertical-align:middle!important;}.eui-alignTop{vertical-align:top!important;}.eui-displayBlock{display:block!important;}.eui-displayInline{display:inline!important;}.eui-displayInlineBlock{display:inline-block!important;}.eui-fullWidth{display:block!important;", logicalCSS('width', '100% !important'), ";}.eui-fullHeight{", euiFullHeight(), ";}.eui-textCenter{text-align:center!important;}.eui-textLeft{text-align:start!important;}.eui-textRight{text-align:end!important;}.eui-textNoWrap{white-space:nowrap!important;}.eui-textInheritColor{color:inherit!important;}.eui-textBreakWord{", euiTextBreakWord(), ";}.eui-textBreakAll{overflow-wrap:break-word!important;word-break:break-all!important;}.eui-textBreakNormal{overflow-wrap:normal!important;word-wrap:normal!important;word-break:normal!important;}.eui-textTruncate{", euiTextTruncate(), ";}.eui-textNumber{", euiNumberFormat(euiThemeContext), ";}.eui-scrollBar{", euiScrollBarStyles(euiThemeContext), ";}.eui-yScroll{", euiYScroll(euiThemeContext), ";}.eui-xScroll{", euiXScroll(euiThemeContext), ";}.eui-yScrollWithShadows{", euiYScrollWithShadows(euiThemeContext), ";}.eui-xScrollWithShadows{", euiXScrollWithShadows(euiThemeContext), ";}[class*='eui-showFor']{display:none!important;}", Object.keys(euiThemeContext.euiTheme.breakpoint).map(function (size) {
17
+ return "\n .eui-hideFor--".concat(size, " {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: none !important;\n }\n }\n .eui-showFor--").concat(size, " {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: inline !important;\n }\n }\n .eui-showFor--").concat(size, "--block {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: block !important;\n }\n }\n .eui-showFor--").concat(size, "--inlineBlock {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: inline-block !important;\n }\n }\n .eui-showFor--").concat(size, "--flex {\n ").concat(euiBreakpoint(euiThemeContext, [size]), " {\n display: flex !important;\n }\n }");
18
+ }), ";;label:globalStyles;");
19
+ };
13
20
  export var EuiUtilityClasses = function EuiUtilityClasses() {
21
+ var euiTheme = useEuiTheme();
14
22
  return ___EmotionJSX(Global, {
15
- styles: globalStyles
23
+ styles: globalStyles(euiTheme)
16
24
  });
17
25
  };
@@ -96,8 +96,7 @@ var CollapsedItemActions = /*#__PURE__*/function (_Component) {
96
96
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "registerPopoverDiv", function (popoverDiv) {
97
97
  if (!_this.popoverDiv) {
98
98
  _this.popoverDiv = popoverDiv;
99
-
100
- _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
99
+ _this.popoverDiv && _this.popoverDiv.addEventListener('focusout', _this.onPopoverBlur);
101
100
  }
102
101
  });
103
102
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClickItem", function (onClickAction) {
@@ -55,8 +55,8 @@ var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiThemeCon
55
55
  isTruncated: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)("".concat(parseFloat(euiTheme.size.base) * 10, "px")), ";;label:isTruncated;"),
56
56
  isTruncatedLast: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)('none'), ";;label:isTruncatedLast;"),
57
57
  // Types
58
- page: /*#__PURE__*/(0, _react.css)("&:is(a):focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'inset'), ";}&:is(button):focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'center'), ";};label:page;"),
59
- application: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";background-color:", (0, _color.transparentize)(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", (0, _color.transparentize)(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'inset'), ";:focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
58
+ 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;"),
59
+ application: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";background-color:", (0, _color.transparentize)(euiTheme.colors.darkestShade, 0.2), ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%,\n ", euiTheme.size.s, " 50%\n );color:", euiTheme.colors.darkestShade, ";line-height:", euiTheme.size.base, ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.base), " &:is(a),&:is(button){background-color:", (0, _color.transparentize)(euiTheme.colors.primary, 0.2), ";color:", euiTheme.colors.link, ";:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'inset'), ";:focus-visible{border-radius:", euiTheme.border.radius.medium, ";clip-path:none;}}};label:application;"),
60
60
  applicationStyles: {
61
61
  onlyChild: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";clip-path:none;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.m), ",;;label:onlyChild;"),
62
62
  firstChild: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, " 0 0 ", euiTheme.border.radius.medium, ";clip-path:polygon(\n 0 0,\n calc(100% - ", euiTheme.size.s, ") 0,\n 100% 50%,\n calc(100% - ", euiTheme.size.s, ") 100%,\n 0 100%\n );", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.m), ",;;label:firstChild;"),
@@ -17,7 +17,7 @@ var euiImageButtonStyles = function euiImageButtonStyles(euiThemeContext) {
17
17
  var euiTheme = euiThemeContext.euiTheme;
18
18
  return {
19
19
  // Base
20
- euiImageButton: /*#__PURE__*/(0, _react.css)("position:relative;cursor:pointer;text-align:match-parent;line-height:0;&::before{opacity:0;content:'';pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0;", _global_styling.euiCanAnimate, "{transition:opacity ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";}}&:hover,&:focus{&::before{opacity:1;}[class*='euiImageButton__icon']{opacity:1;}}&:focus{", (0, _global_styling.euiFocusRing)(euiTheme, 'outset'), ";};label:euiImageButton;"),
20
+ euiImageButton: /*#__PURE__*/(0, _react.css)("position:relative;cursor:pointer;text-align:match-parent;line-height:0;&::before{opacity:0;content:'';pointer-events:none;position:absolute;top:0;bottom:0;left:0;right:0;", _global_styling.euiCanAnimate, "{transition:opacity ", euiTheme.animation.fast, " ", euiTheme.animation.resistance, ";}}&:hover,&:focus{&::before{opacity:1;}[class*='euiImageButton__icon']{opacity:1;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'outset'), ";};label:euiImageButton;"),
21
21
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), ";;label:fullWidth;"),
22
22
  shadowHover: /*#__PURE__*/(0, _react.css)("&::before{", (0, _mixins.euiShadow)(euiThemeContext, 's'), ";};label:shadowHover;"),
23
23
  hasShadowHover: /*#__PURE__*/(0, _react.css)("&::before{", (0, _mixins.euiShadow)(euiThemeContext, 'm'), ";};label:hasShadowHover;")
@@ -27,8 +27,9 @@ var euiLinkFocusCSS = function euiLinkFocusCSS(euiTheme) {
27
27
 
28
28
  exports.euiLinkFocusCSS = euiLinkFocusCSS;
29
29
 
30
- var euiLinkCSS = function euiLinkCSS(euiTheme) {
31
- return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n text-align: left;\n\n &:hover {\n ").concat(euiLinkHoverCSS(), "\n }\n\n &:focus {\n ").concat((0, _global_styling.euiFocusRing)(euiTheme, 'outset'), "\n ").concat(euiLinkFocusCSS(euiTheme), "\n }\n ");
30
+ var euiLinkCSS = function euiLinkCSS(euiThemeContext) {
31
+ var euiTheme = euiThemeContext.euiTheme;
32
+ return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n text-align: left;\n\n &:hover {\n ").concat(euiLinkHoverCSS(), "\n }\n\n &:focus {\n ").concat((0, _global_styling.euiFocusRing)(euiThemeContext, 'outset'), "\n ").concat(euiLinkFocusCSS(euiTheme), "\n }\n ");
32
33
  };
33
34
 
34
35
  exports.euiLinkCSS = euiLinkCSS;
@@ -42,10 +43,10 @@ var _ref = process.env.NODE_ENV === "production" ? {
42
43
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
43
44
  };
44
45
 
45
- var euiLinkStyles = function euiLinkStyles(_ref2) {
46
- var euiTheme = _ref2.euiTheme;
46
+ var euiLinkStyles = function euiLinkStyles(euiThemeContext) {
47
+ var euiTheme = euiThemeContext.euiTheme;
47
48
  return {
48
- euiLink: /*#__PURE__*/(0, _react.css)(euiLinkCSS(euiTheme), " user-select:text;&[target='_blank']{position:relative;};label:euiLink;"),
49
+ euiLink: /*#__PURE__*/(0, _react.css)(euiLinkCSS(euiThemeContext), " user-select:text;&[target='_blank']{position:relative;};label:euiLink;"),
49
50
  disabled: _ref,
50
51
  // Color styles
51
52
  primary: /*#__PURE__*/(0, _react.css)(_colorCSS(euiTheme.colors.primaryText), ";label:primary;"),
@@ -74,7 +74,7 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
74
74
  var euiTextStyles = function euiTextStyles(euiThemeContext) {
75
75
  var euiTheme = euiThemeContext.euiTheme;
76
76
  return {
77
- euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiTheme), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", (0, _global_styling.logicalTextAlignCSS)('center'), " ", (0, _global_styling.logicalCSS)('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thick), " ", (0, _global_styling.logicalCSS)('width', '50%'), " ", (0, _global_styling.logicalCSS)('left', '25%'), " ", (0, _global_styling.logicalCSS)('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", (0, _global_styling.logicalCSS)('top', '0'), ";}&:after{", (0, _global_styling.logicalCSS)('bottom', '0'), ";}}h1{", (0, _title.euiTitle)(euiThemeContext, 'l'), ";}h2{", (0, _title.euiTitle)(euiThemeContext, 'm'), ";}h3{", (0, _title.euiTitle)(euiThemeContext, 's'), ";}h4,dt{", (0, _title.euiTitle)(euiThemeContext, 'xs'), ";}h5{", (0, _title.euiTitle)(euiThemeContext, 'xxs'), ";}h6{", (0, _title.euiTitle)(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xxs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:euiText;"),
77
+ euiText: /*#__PURE__*/(0, _react.css)(euiText(euiTheme, true), ";clear:both;a:not([class]){", (0, _link.euiLinkCSS)(euiThemeContext), ";}img{display:block;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";}ul{list-style:disc;}ol{list-style:decimal;}blockquote:not(.euiMarkdownFormat__blockquote){position:relative;", (0, _global_styling.logicalTextAlignCSS)('center'), " ", (0, _global_styling.logicalCSS)('margin-horizontal', 'auto'), " font-family:", euiTheme.font.familySerif, ";font-style:italic;letter-spacing:normal;p:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0'), ";}&:before,&:after{position:absolute;content:'';", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thick), " ", (0, _global_styling.logicalCSS)('width', '50%'), " ", (0, _global_styling.logicalCSS)('left', '25%'), " ", (0, _global_styling.logicalCSS)('right', '25%'), " background:", euiTheme.colors.darkShade, ";}&:before{", (0, _global_styling.logicalCSS)('top', '0'), ";}&:after{", (0, _global_styling.logicalCSS)('bottom', '0'), ";}}h1{", (0, _title.euiTitle)(euiThemeContext, 'l'), ";}h2{", (0, _title.euiTitle)(euiThemeContext, 'm'), ";}h3{", (0, _title.euiTitle)(euiThemeContext, 's'), ";}h4,dt{", (0, _title.euiTitle)(euiThemeContext, 'xs'), ";}h5{", (0, _title.euiTitle)(euiThemeContext, 'xxs'), ";}h6{", (0, _title.euiTitle)(euiThemeContext, 'xxxs'), " text-transform:uppercase;}h1,h2,h3,h4,h5,h6,dt{color:inherit;}pre:not(.euiCodeBlock__pre){white-space:pre-wrap;background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'subdued'), ";color:", euiTheme.colors.text, ";}pre:not(.euiCodeBlock__pre),pre:not(.euiCodeBlock__pre) code{display:block;}>:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', '0 !important'), ";}kbd{position:relative;display:inline-block;", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.xxs), " ", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " line-height:1;border:", euiTheme.border.width.thin, " solid ", euiTheme.colors.text, ";border-radius:calc(", euiTheme.border.radius.small, " / 2);};label:euiText;"),
78
78
  constrainedWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', euiTextConstrainedMaxWidth), ";;label:constrainedWidth;"),
79
79
  // Sizes
80
80
  m: /*#__PURE__*/(0, _react.css)(euiScaleText(euiThemeContext, {
@@ -24,7 +24,7 @@ var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext
24
24
  * 2. Allow some padding for shadow
25
25
  */
26
26
  // Base
27
- euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), ";", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth + euiTheme.base * 5, "px")), ";", (0, _global_styling.logicalCSS)('max-height', '100vh'), ";overflow-y:auto;", (0, _global_styling.logicalCSS)('overflow-y', 'auto'), ";scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
27
+ euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), ";", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth + euiTheme.base * 5, "px")), ";", (0, _global_styling.logicalCSS)('max-height', '100vh'), ";", (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'auto'), ";scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
28
28
  // Variants
29
29
  right: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('right', 0), ";", (0, _global_styling.logicalCSS)('padding-left', "".concat(euiTheme.base * 4, "px")), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), ";}};label:right;"),
30
30
  left: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.logicalCSS)('padding-right', "".concat(euiTheme.base * 4, "px")), ";}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{&:not(:empty){", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";}};label:left;")