@elastic/eui 67.1.9 → 67.1.10

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 (47) hide show
  1. package/es/components/description_list/description_list.styles.js +2 -2
  2. package/es/components/description_list/description_list_description.js +6 -2
  3. package/es/components/description_list/description_list_description.styles.js +2 -2
  4. package/es/components/description_list/description_list_title.styles.js +2 -2
  5. package/es/components/flyout/flyout.styles.js +7 -7
  6. package/es/components/image/image_wrapper.styles.js +3 -3
  7. package/es/components/page/page.styles.js +2 -2
  8. package/es/components/toast/global_toast_list.styles.js +5 -5
  9. package/es/global_styling/mixins/_responsive.js +46 -1
  10. package/eui.d.ts +19 -1
  11. package/lib/components/description_list/description_list.styles.js +1 -1
  12. package/lib/components/description_list/description_list_description.js +5 -1
  13. package/lib/components/description_list/description_list_description.styles.js +1 -1
  14. package/lib/components/description_list/description_list_title.styles.js +1 -1
  15. package/lib/components/flyout/flyout.styles.js +6 -6
  16. package/lib/components/image/image_wrapper.styles.js +2 -2
  17. package/lib/components/page/page.styles.js +1 -1
  18. package/lib/components/toast/global_toast_list.styles.js +4 -4
  19. package/lib/global_styling/mixins/_responsive.js +60 -3
  20. package/optimize/es/components/description_list/description_list.styles.js +2 -2
  21. package/optimize/es/components/description_list/description_list_description.js +6 -2
  22. package/optimize/es/components/description_list/description_list_description.styles.js +2 -2
  23. package/optimize/es/components/description_list/description_list_title.styles.js +2 -2
  24. package/optimize/es/components/flyout/flyout.styles.js +7 -7
  25. package/optimize/es/components/image/image_wrapper.styles.js +3 -3
  26. package/optimize/es/components/page/page.styles.js +2 -2
  27. package/optimize/es/components/toast/global_toast_list.styles.js +5 -5
  28. package/optimize/es/global_styling/mixins/_responsive.js +46 -1
  29. package/optimize/lib/components/description_list/description_list.styles.js +1 -1
  30. package/optimize/lib/components/description_list/description_list_description.js +5 -1
  31. package/optimize/lib/components/description_list/description_list_description.styles.js +1 -1
  32. package/optimize/lib/components/description_list/description_list_title.styles.js +1 -1
  33. package/optimize/lib/components/flyout/flyout.styles.js +6 -6
  34. package/optimize/lib/components/image/image_wrapper.styles.js +2 -2
  35. package/optimize/lib/components/page/page.styles.js +1 -1
  36. package/optimize/lib/components/toast/global_toast_list.styles.js +4 -4
  37. package/optimize/lib/global_styling/mixins/_responsive.js +60 -3
  38. package/package.json +1 -1
  39. package/test-env/components/description_list/description_list.styles.js +1 -1
  40. package/test-env/components/description_list/description_list_description.js +5 -1
  41. package/test-env/components/description_list/description_list_description.styles.js +1 -1
  42. package/test-env/components/description_list/description_list_title.styles.js +1 -1
  43. package/test-env/components/flyout/flyout.styles.js +6 -6
  44. package/test-env/components/image/image_wrapper.styles.js +2 -2
  45. package/test-env/components/page/page.styles.js +1 -1
  46. package/test-env/components/toast/global_toast_list.styles.js +4 -4
  47. package/test-env/global_styling/mixins/_responsive.js +60 -3
@@ -34,8 +34,8 @@ var euiImageWrapperStyles = function euiImageWrapperStyles(euiThemeContext) {
34
34
  // Floats
35
35
  // 1: Logical properties/values in `float` is currently not yet supported by all browsers w/o flags
36
36
  // @see https://caniuse.com/mdn-css_properties_float_flow_relative_values for when we can remove left/right fallbacks
37
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{float:left;float:", _global_styling.logicalSide.left, ";", (0, _global_styling.logicalCSS)('margin-left', '0'), ";", (0, _global_styling.logicalCSS)('margin-top', '0'), ";};label:left;"),
38
- right: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{float:right;float:", _global_styling.logicalSide.right, ";", (0, _global_styling.logicalCSS)('margin-right', '0'), ";", (0, _global_styling.logicalCSS)('margin-top', '0'), ";};label:right;"),
37
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{float:left;float:", _global_styling.logicalSide.left, ";", (0, _global_styling.logicalCSS)('margin-left', '0'), ";", (0, _global_styling.logicalCSS)('margin-top', '0'), ";};label:left;"),
38
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{float:right;float:", _global_styling.logicalSide.right, ";", (0, _global_styling.logicalCSS)('margin-right', '0'), ";", (0, _global_styling.logicalCSS)('margin-top', '0'), ";};label:right;"),
39
39
  // Sizes
40
40
  fullWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '100%'), ";;label:fullWidth;")
41
41
  };
@@ -37,7 +37,7 @@ var euiPageStyles = function euiPageStyles(euiThemeContext) {
37
37
  grow: _ref2,
38
38
  // Direction
39
39
  column: _ref,
40
- row: /*#__PURE__*/(0, _react.css)("flex-direction:column;", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{flex-direction:row;};label:row;"),
40
+ row: /*#__PURE__*/(0, _react.css)("flex-direction:column;", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{flex-direction:row;};label:row;"),
41
41
  // Max widths
42
42
  restrictWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-horizontal', 'auto'), ";;label:restrictWidth;")
43
43
  };
@@ -17,17 +17,17 @@ var _templateObject;
17
17
 
18
18
  var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
19
19
  var euiTheme = euiThemeContext.euiTheme;
20
- var euiToastWidth = euiTheme.base * 20;
20
+ var euiToastWidth = euiTheme.base * 25;
21
21
  return {
22
22
  /**
23
23
  * 1. Allow list to expand as items are added, but cap it at the screen height.
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'), ";", (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;"),
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, "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.euiMaxBreakpoint)(euiThemeContext, 'm'), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
28
28
  // Variants
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
- 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;")
29
+ right: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('right', 0), ";", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('padding-left', "".concat(euiTheme.base * 4, "px")), ";}};label:right;"),
30
+ left: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('padding-right', "".concat(euiTheme.base * 4, "px")), ";}};label:left;")
31
31
  };
32
32
  };
33
33
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useEuiBreakpoint = exports.euiBreakpoint = void 0;
6
+ exports.useEuiMinBreakpoint = exports.useEuiMaxBreakpoint = exports.useEuiBreakpoint = exports.euiMinBreakpoint = exports.euiMaxBreakpoint = exports.euiBreakpoint = void 0;
7
7
 
8
8
  var _sorting = require("../../services/breakpoint/_sorting");
9
9
 
@@ -18,7 +18,7 @@ var _hooks = require("../../services/theme/hooks");
18
18
  */
19
19
 
20
20
  /**
21
- * Generates a CSS media query rule string based on the input breakpoint ranges.
21
+ * Generates a CSS media query rule string based on the input breakpoint *ranges*.
22
22
  * Examples with default theme breakpoints:
23
23
  *
24
24
  * euiBreakpoint(['s']) becomes `@media only screen and (min-width: 575px) and (max-width: 767px)`
@@ -60,5 +60,62 @@ var useEuiBreakpoint = function useEuiBreakpoint(sizes) {
60
60
  var euiTheme = (0, _hooks.useEuiTheme)();
61
61
  return euiBreakpoint(euiTheme, sizes);
62
62
  };
63
+ /**
64
+ * Min/Max width breakpoint utilities that generate only a single min/max query/bound
65
+ *
66
+ * *Unlike the above euiBreakpoint utility*, these utilities treat breakpoint
67
+ * sizes as a one-dimensional point, rather than a two-dimensional *screen range*.
68
+ * Examples with default theme breakpoints:
69
+ *
70
+ * euiMaxBreakpoint('m') becomes `@media only screen and (max-width: 767px)`
71
+ * euiMinBreakpoint('m') becomes `@media only screen and (min-width: 768px)`
72
+ *
73
+ * This is safer and more intentional to use than euiBreakpoint(['xs', 's']) / euiBreakpoint(['m', 'xl'])
74
+ * in the event that consumers add larger or smaller custom breakpoints (e.g 'xxs' or `xxl`)
75
+ * and if the intention of the media query is actually "m and below/above" vs. "only screens m/l/xl".
76
+ */
77
+
78
+
79
+ exports.useEuiBreakpoint = useEuiBreakpoint;
80
+
81
+ var euiMinBreakpoint = function euiMinBreakpoint(_ref2, size) {
82
+ var euiTheme = _ref2.euiTheme;
83
+ var minBreakpointSize = euiTheme.breakpoint[size];
84
+
85
+ if (minBreakpointSize) {
86
+ return "@media only screen and (min-width: ".concat(minBreakpointSize, "px)");
87
+ } else {
88
+ console.warn("Invalid min breakpoint size: ".concat(size));
89
+ return '@media only screen';
90
+ }
91
+ };
92
+
93
+ exports.euiMinBreakpoint = euiMinBreakpoint;
94
+
95
+ var useEuiMinBreakpoint = function useEuiMinBreakpoint(size) {
96
+ var euiTheme = (0, _hooks.useEuiTheme)();
97
+ return euiMinBreakpoint(euiTheme, size);
98
+ };
99
+
100
+ exports.useEuiMinBreakpoint = useEuiMinBreakpoint;
101
+
102
+ var euiMaxBreakpoint = function euiMaxBreakpoint(_ref3, size) {
103
+ var euiTheme = _ref3.euiTheme;
104
+ var maxBreakpointSize = euiTheme.breakpoint[size];
105
+
106
+ if (maxBreakpointSize) {
107
+ return "@media only screen and (max-width: ".concat(maxBreakpointSize - 1, "px)");
108
+ } else {
109
+ console.warn("Invalid max breakpoint size: ".concat(size));
110
+ return '@media only screen';
111
+ }
112
+ };
113
+
114
+ exports.euiMaxBreakpoint = euiMaxBreakpoint;
115
+
116
+ var useEuiMaxBreakpoint = function useEuiMaxBreakpoint(size) {
117
+ var euiTheme = (0, _hooks.useEuiTheme)();
118
+ return euiMaxBreakpoint(euiTheme, size);
119
+ };
63
120
 
64
- exports.useEuiBreakpoint = useEuiBreakpoint;
121
+ exports.useEuiMaxBreakpoint = useEuiMaxBreakpoint;