@elastic/eui 67.1.8 → 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 (75) hide show
  1. package/es/components/button/button.js +1 -0
  2. package/es/components/button/button_display/_button_display.js +3 -3
  3. package/es/components/button/button_display/_button_display.styles.js +2 -1
  4. package/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  5. package/es/components/description_list/description_list.styles.js +2 -2
  6. package/es/components/description_list/description_list_description.js +6 -2
  7. package/es/components/description_list/description_list_description.styles.js +2 -2
  8. package/es/components/description_list/description_list_title.styles.js +2 -2
  9. package/es/components/facet/facet_button.js +55 -1
  10. package/es/components/flyout/flyout.styles.js +7 -7
  11. package/es/components/image/image_wrapper.styles.js +3 -3
  12. package/es/components/page/page.styles.js +2 -2
  13. package/es/components/toast/global_toast_list.styles.js +5 -5
  14. package/es/global_styling/mixins/_helpers.js +1 -1
  15. package/es/global_styling/mixins/_responsive.js +46 -1
  16. package/eui.d.ts +23 -4
  17. package/lib/components/button/button.js +1 -0
  18. package/lib/components/button/button_display/_button_display.js +3 -3
  19. package/lib/components/button/button_display/_button_display.styles.js +2 -1
  20. package/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  21. package/lib/components/description_list/description_list.styles.js +1 -1
  22. package/lib/components/description_list/description_list_description.js +5 -1
  23. package/lib/components/description_list/description_list_description.styles.js +1 -1
  24. package/lib/components/description_list/description_list_title.styles.js +1 -1
  25. package/lib/components/facet/facet_button.js +56 -2
  26. package/lib/components/flyout/flyout.styles.js +6 -6
  27. package/lib/components/image/image_wrapper.styles.js +2 -2
  28. package/lib/components/page/page.styles.js +1 -1
  29. package/lib/components/toast/global_toast_list.styles.js +4 -4
  30. package/lib/global_styling/mixins/_helpers.js +1 -1
  31. package/lib/global_styling/mixins/_responsive.js +60 -3
  32. package/optimize/es/components/button/button.js +1 -0
  33. package/optimize/es/components/button/button_display/_button_display.js +2 -2
  34. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -1
  35. package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +1 -1
  36. package/optimize/es/components/description_list/description_list.styles.js +2 -2
  37. package/optimize/es/components/description_list/description_list_description.js +6 -2
  38. package/optimize/es/components/description_list/description_list_description.styles.js +2 -2
  39. package/optimize/es/components/description_list/description_list_title.styles.js +2 -2
  40. package/optimize/es/components/flyout/flyout.styles.js +7 -7
  41. package/optimize/es/components/image/image_wrapper.styles.js +3 -3
  42. package/optimize/es/components/page/page.styles.js +2 -2
  43. package/optimize/es/components/toast/global_toast_list.styles.js +5 -5
  44. package/optimize/es/global_styling/mixins/_helpers.js +1 -1
  45. package/optimize/es/global_styling/mixins/_responsive.js +46 -1
  46. package/optimize/lib/components/button/button.js +1 -0
  47. package/optimize/lib/components/button/button_display/_button_display.js +2 -2
  48. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -1
  49. package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +1 -1
  50. package/optimize/lib/components/description_list/description_list.styles.js +1 -1
  51. package/optimize/lib/components/description_list/description_list_description.js +5 -1
  52. package/optimize/lib/components/description_list/description_list_description.styles.js +1 -1
  53. package/optimize/lib/components/description_list/description_list_title.styles.js +1 -1
  54. package/optimize/lib/components/flyout/flyout.styles.js +6 -6
  55. package/optimize/lib/components/image/image_wrapper.styles.js +2 -2
  56. package/optimize/lib/components/page/page.styles.js +1 -1
  57. package/optimize/lib/components/toast/global_toast_list.styles.js +4 -4
  58. package/optimize/lib/global_styling/mixins/_helpers.js +1 -1
  59. package/optimize/lib/global_styling/mixins/_responsive.js +60 -3
  60. package/package.json +1 -1
  61. package/test-env/components/button/button.js +1 -0
  62. package/test-env/components/button/button_display/_button_display.js +3 -3
  63. package/test-env/components/button/button_display/_button_display.styles.js +2 -1
  64. package/test-env/components/date_picker/super_date_picker/super_update_button.js +1 -1
  65. package/test-env/components/description_list/description_list.styles.js +1 -1
  66. package/test-env/components/description_list/description_list_description.js +5 -1
  67. package/test-env/components/description_list/description_list_description.styles.js +1 -1
  68. package/test-env/components/description_list/description_list_title.styles.js +1 -1
  69. package/test-env/components/facet/facet_button.js +56 -2
  70. package/test-env/components/flyout/flyout.styles.js +6 -6
  71. package/test-env/components/image/image_wrapper.styles.js +2 -2
  72. package/test-env/components/page/page.styles.js +1 -1
  73. package/test-env/components/toast/global_toast_list.styles.js +4 -4
  74. package/test-env/global_styling/mixins/_helpers.js +1 -1
  75. package/test-env/global_styling/mixins/_responsive.js +60 -3
@@ -22,7 +22,7 @@ var _form = require("../form/form.styles");
22
22
  var _templateObject, _templateObject2;
23
23
 
24
24
  var euiFlyoutSlideInRight = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
25
- var euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n}\n"])));
25
+ var euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
26
26
 
27
27
  var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
28
28
  var euiTheme = euiThemeContext.euiTheme;
@@ -33,8 +33,8 @@ var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeCon
33
33
  outsideSide: {
34
34
  // `transforms` pull in close buttons a little
35
35
  // `!important` is necessary here to override the hover/focus transitions of buttons
36
- right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(-100% - ", euiTheme.size.l, "))!important;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(-100% - ", euiTheme.size.xs, "))!important;};label:right;"),
37
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(100% + ", euiTheme.size.l, "))!important;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(100% + ", euiTheme.size.xs, "))!important;};label:left;")
36
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{transform:translateX(calc(-100% - ", euiTheme.size.xs, "))!important;}", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{transform:translateX(calc(-100% - ", euiTheme.size.l, "))!important;};label:right;"),
37
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{transform:translateX(calc(100% + ", euiTheme.size.xs, "))!important;}", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{transform:translateX(calc(100% + ", euiTheme.size.l, "))!important;};label:left;")
38
38
  }
39
39
  };
40
40
  };
@@ -44,7 +44,7 @@ exports.euiFlyoutCloseButtonStyles = euiFlyoutCloseButtonStyles;
44
44
  var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
45
45
  var euiTheme = euiThemeContext.euiTheme;
46
46
  return {
47
- euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
47
+ euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
48
48
  // Flyout sizes
49
49
  s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
50
50
  m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
@@ -53,7 +53,7 @@ var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
53
53
  // Side
54
54
  right: /*#__PURE__*/(0, _react.css)("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", (0, _global_styling.logicalCSS)('right', 0), " ", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
55
55
  // Left-side flyouts should only be used for navigation
56
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, ";};label:left;"),
56
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:left;"),
57
57
  // Type
58
58
  overlay: /*#__PURE__*/(0, _react.css)((0, _mixins.euiShadowXLarge)(euiThemeContext), ";;label:overlay;"),
59
59
  push: /*#__PURE__*/(0, _react.css)("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
@@ -98,7 +98,7 @@ var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
98
98
  max: "".concat(euiTheme.breakpoint.l, "px")
99
99
  }
100
100
  };
101
- return "\n ".concat((0, _global_styling.logicalCSS)('max-width', flyoutSizes[size].max), "\n\n ").concat((0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', flyoutSizes[size].min), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].width), "\n }\n ").concat((0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].min), "\n }\n ");
101
+ return "\n ".concat((0, _global_styling.logicalCSS)('max-width', flyoutSizes[size].max), "\n\n ").concat((0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].min), "\n }\n ").concat((0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', flyoutSizes[size].min), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].width), "\n }\n ");
102
102
  };
103
103
 
104
104
  var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddingSize) {
@@ -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
 
@@ -66,7 +66,7 @@ var euiOverflowShadowStyles = function euiOverflowShadowStyles(_ref3) {
66
66
 
67
67
  var direction = _direction || 'y';
68
68
  var side = _side || 'both';
69
- var hideHeight = "calc(".concat(size.base, " * 0.75 * 1.25)");
69
+ var hideHeight = size.s;
70
70
  var gradientStart = "\n ".concat((0, _color.transparentize)('red', 0.1), " 0%,\n ").concat((0, _color.transparentize)('red', 1), " ").concat(hideHeight, "\n ");
71
71
  var gradientEnd = "\n ".concat((0, _color.transparentize)('red', 1), " calc(100% - ").concat(hideHeight, "),\n ").concat((0, _color.transparentize)('red', 0.1), " 100%\n ");
72
72
  var gradient = '';
@@ -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;