@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.
- package/es/components/description_list/description_list.styles.js +2 -2
- package/es/components/description_list/description_list_description.js +6 -2
- package/es/components/description_list/description_list_description.styles.js +2 -2
- package/es/components/description_list/description_list_title.styles.js +2 -2
- package/es/components/flyout/flyout.styles.js +7 -7
- package/es/components/image/image_wrapper.styles.js +3 -3
- package/es/components/page/page.styles.js +2 -2
- package/es/components/toast/global_toast_list.styles.js +5 -5
- package/es/global_styling/mixins/_responsive.js +46 -1
- package/eui.d.ts +19 -1
- package/lib/components/description_list/description_list.styles.js +1 -1
- package/lib/components/description_list/description_list_description.js +5 -1
- package/lib/components/description_list/description_list_description.styles.js +1 -1
- package/lib/components/description_list/description_list_title.styles.js +1 -1
- package/lib/components/flyout/flyout.styles.js +6 -6
- package/lib/components/image/image_wrapper.styles.js +2 -2
- package/lib/components/page/page.styles.js +1 -1
- package/lib/components/toast/global_toast_list.styles.js +4 -4
- package/lib/global_styling/mixins/_responsive.js +60 -3
- package/optimize/es/components/description_list/description_list.styles.js +2 -2
- package/optimize/es/components/description_list/description_list_description.js +6 -2
- package/optimize/es/components/description_list/description_list_description.styles.js +2 -2
- package/optimize/es/components/description_list/description_list_title.styles.js +2 -2
- package/optimize/es/components/flyout/flyout.styles.js +7 -7
- package/optimize/es/components/image/image_wrapper.styles.js +3 -3
- package/optimize/es/components/page/page.styles.js +2 -2
- package/optimize/es/components/toast/global_toast_list.styles.js +5 -5
- package/optimize/es/global_styling/mixins/_responsive.js +46 -1
- package/optimize/lib/components/description_list/description_list.styles.js +1 -1
- package/optimize/lib/components/description_list/description_list_description.js +5 -1
- package/optimize/lib/components/description_list/description_list_description.styles.js +1 -1
- package/optimize/lib/components/description_list/description_list_title.styles.js +1 -1
- package/optimize/lib/components/flyout/flyout.styles.js +6 -6
- package/optimize/lib/components/image/image_wrapper.styles.js +2 -2
- package/optimize/lib/components/page/page.styles.js +1 -1
- package/optimize/lib/components/toast/global_toast_list.styles.js +4 -4
- package/optimize/lib/global_styling/mixins/_responsive.js +60 -3
- package/package.json +1 -1
- package/test-env/components/description_list/description_list.styles.js +1 -1
- package/test-env/components/description_list/description_list_description.js +5 -1
- package/test-env/components/description_list/description_list_description.styles.js +1 -1
- package/test-env/components/description_list/description_list_title.styles.js +1 -1
- package/test-env/components/flyout/flyout.styles.js +6 -6
- package/test-env/components/image/image_wrapper.styles.js +2 -2
- package/test-env/components/page/page.styles.js +1 -1
- package/test-env/components/toast/global_toast_list.styles.js +4 -4
- package/test-env/global_styling/mixins/_responsive.js +60 -3
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalTextAlignCSS,
|
|
9
|
+
import { logicalTextAlignCSS, euiMinBreakpoint } from '../../global_styling';
|
|
10
10
|
export var euiDescriptionListStyles = function euiDescriptionListStyles(euiThemeContext) {
|
|
11
11
|
// Flex display for column and responsive column
|
|
12
12
|
var columnDisplay = "\n display: flex;\n align-items: baseline;\n flex-wrap: wrap; \n ";
|
|
@@ -17,7 +17,7 @@ export var euiDescriptionListStyles = function euiDescriptionListStyles(euiTheme
|
|
|
17
17
|
inline: /*#__PURE__*/css(";label:inline;"),
|
|
18
18
|
column: /*#__PURE__*/css(columnDisplay, ";;label:column;"),
|
|
19
19
|
// Responsive columns behave as a row on breakpoints xs-s
|
|
20
|
-
responsiveColumn: /*#__PURE__*/css(
|
|
20
|
+
responsiveColumn: /*#__PURE__*/css(euiMinBreakpoint(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
21
21
|
// Alignment
|
|
22
22
|
center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;"),
|
|
23
23
|
left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;")
|
|
@@ -28,7 +28,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
28
|
import React, { useContext } from 'react';
|
|
29
29
|
import PropTypes from "prop-types";
|
|
30
30
|
import classNames from 'classnames';
|
|
31
|
-
import { useEuiTheme } from '../../services';
|
|
31
|
+
import { useEuiTheme, useIsWithinMinBreakpoint } from '../../services';
|
|
32
32
|
import { euiDescriptionListDescriptionStyles } from './description_list_description.styles';
|
|
33
33
|
import { EuiDescriptionListContext } from './description_list_context'; // Export required for correct inference by HOCs
|
|
34
34
|
|
|
@@ -45,6 +45,7 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
|
|
|
45
45
|
align = _useContext.align,
|
|
46
46
|
gutterSize = _useContext.gutterSize;
|
|
47
47
|
|
|
48
|
+
var showResponsiveColumns = useIsWithinMinBreakpoint('m');
|
|
48
49
|
var theme = useEuiTheme();
|
|
49
50
|
var styles = euiDescriptionListDescriptionStyles(theme);
|
|
50
51
|
var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
@@ -60,7 +61,10 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
|
|
|
60
61
|
conditionalStyles.push(styles.left);
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
if (type === 'column' || showResponsiveColumns) {
|
|
65
|
+
conditionalStyles.push(styles[gutterSize]);
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
break;
|
|
65
69
|
}
|
|
66
70
|
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { euiFontSize,
|
|
11
|
+
import { euiFontSize, euiMaxBreakpoint, euiMinBreakpoint, logicalTextAlignCSS, logicalCSS } from '../../global_styling';
|
|
12
12
|
import { euiTitle } from '../title/title.styles';
|
|
13
13
|
|
|
14
14
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
@@ -28,7 +28,7 @@ export var euiDescriptionListDescriptionStyles = function euiDescriptionListDesc
|
|
|
28
28
|
// Types
|
|
29
29
|
row: /*#__PURE__*/css(";label:row;"),
|
|
30
30
|
column: /*#__PURE__*/css(columnDisplay, ";;label:column;"),
|
|
31
|
-
responsiveColumn: /*#__PURE__*/css(
|
|
31
|
+
responsiveColumn: /*#__PURE__*/css(euiMaxBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('width', '100%'), " padding:0;}", euiMinBreakpoint(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
32
32
|
inline: _ref,
|
|
33
33
|
// This nested block handles just the font styling based on compressed and reverse
|
|
34
34
|
fontStyles: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { euiFontSize, euiTextBreakWord, logicalTextAlignCSS,
|
|
9
|
+
import { euiFontSize, euiTextBreakWord, logicalTextAlignCSS, euiMaxBreakpoint, euiMinBreakpoint, logicalCSS } from '../../global_styling';
|
|
10
10
|
import { tint } from '../../services';
|
|
11
11
|
import { euiTitle } from '../title/title.styles';
|
|
12
12
|
export var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiThemeContext) {
|
|
@@ -18,7 +18,7 @@ export var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyle
|
|
|
18
18
|
// Types
|
|
19
19
|
row: /*#__PURE__*/css(";label:row;"),
|
|
20
20
|
column: /*#__PURE__*/css(columnDisplay, ";;label:column;"),
|
|
21
|
-
responsiveColumn: /*#__PURE__*/css(
|
|
21
|
+
responsiveColumn: /*#__PURE__*/css(euiMaxBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('width', '100%'), " padding:0;}", euiMinBreakpoint(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
22
22
|
inline: /*#__PURE__*/css("display:inline;border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.medium, ";background-color:", colorMode === 'DARK' ? tint(euiTheme.colors.lightestShade, 0.5) : euiTheme.colors.lightestShade, ";", logicalCSS('margin-vertical', '0'), " ", logicalCSS('margin-horizontal', euiTheme.size.xs), "&:first-of-type{", logicalCSS('margin-left', '0'), ";};label:inline;"),
|
|
23
23
|
// This nested block handles just the font styling based on compressed and reverse
|
|
24
24
|
fontStyles: {
|
|
@@ -10,12 +10,12 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
import { css, keyframes } from '@emotion/react';
|
|
13
|
-
import { euiCanAnimate,
|
|
13
|
+
import { euiCanAnimate, euiMaxBreakpoint, euiMinBreakpoint, logicalCSS, mathWithUnits } from '../../global_styling';
|
|
14
14
|
import { euiShadowXLarge } from '../../themes/amsterdam/global_styling/mixins';
|
|
15
15
|
import { transparentize } from '../../services/color';
|
|
16
16
|
import { euiFormMaxWidth } from '../form/form.styles';
|
|
17
17
|
var euiFlyoutSlideInRight = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
|
|
18
|
-
var euiFlyoutSlideInLeft = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n}\n"])));
|
|
18
|
+
var euiFlyoutSlideInLeft = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
|
|
19
19
|
export var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
|
|
20
20
|
var euiTheme = euiThemeContext.euiTheme;
|
|
21
21
|
return {
|
|
@@ -25,15 +25,15 @@ export var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiT
|
|
|
25
25
|
outsideSide: {
|
|
26
26
|
// `transforms` pull in close buttons a little
|
|
27
27
|
// `!important` is necessary here to override the hover/focus transitions of buttons
|
|
28
|
-
right: /*#__PURE__*/css(logicalCSS('left', 0), " ",
|
|
29
|
-
left: /*#__PURE__*/css(logicalCSS('right', 0), " ",
|
|
28
|
+
right: /*#__PURE__*/css(logicalCSS('left', 0), " ", euiMaxBreakpoint(euiThemeContext, 'm'), "{transform:translateX(calc(-100% - ", euiTheme.size.xs, "))!important;}", euiMinBreakpoint(euiThemeContext, 'm'), "{transform:translateX(calc(-100% - ", euiTheme.size.l, "))!important;};label:right;"),
|
|
29
|
+
left: /*#__PURE__*/css(logicalCSS('right', 0), " ", euiMaxBreakpoint(euiThemeContext, 'm'), "{transform:translateX(calc(100% + ", euiTheme.size.xs, "))!important;}", euiMinBreakpoint(euiThemeContext, 'm'), "{transform:translateX(calc(100% + ", euiTheme.size.l, "))!important;};label:left;")
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
34
34
|
var euiTheme = euiThemeContext.euiTheme;
|
|
35
35
|
return {
|
|
36
|
-
euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('bottom', 0), " ", logicalCSS('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}",
|
|
36
|
+
euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('bottom', 0), " ", logicalCSS('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", euiMaxBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('max-width', '90vw !important'), ";};label:euiFlyout;"),
|
|
37
37
|
// Flyout sizes
|
|
38
38
|
s: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
|
|
39
39
|
m: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
|
|
@@ -42,7 +42,7 @@ export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
|
42
42
|
// Side
|
|
43
43
|
right: /*#__PURE__*/css("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", logicalCSS('right', 0), " ", euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
|
|
44
44
|
// Left-side flyouts should only be used for navigation
|
|
45
|
-
left: /*#__PURE__*/css(logicalCSS('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, ";};label:left;"),
|
|
45
|
+
left: /*#__PURE__*/css(logicalCSS('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:left;"),
|
|
46
46
|
// Type
|
|
47
47
|
overlay: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), ";;label:overlay;"),
|
|
48
48
|
push: /*#__PURE__*/css("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
|
|
@@ -85,7 +85,7 @@ var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
|
|
|
85
85
|
max: "".concat(euiTheme.breakpoint.l, "px")
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
return "\n ".concat(logicalCSS('max-width', flyoutSizes[size].max), "\n\n ").concat(
|
|
88
|
+
return "\n ".concat(logicalCSS('max-width', flyoutSizes[size].max), "\n\n ").concat(euiMaxBreakpoint(euiThemeContext, 'm'), " {\n ").concat(logicalCSS('min-width', 0), "\n ").concat(logicalCSS('width', flyoutSizes[size].min), "\n }\n ").concat(euiMinBreakpoint(euiThemeContext, 'm'), " {\n ").concat(logicalCSS('min-width', flyoutSizes[size].min), "\n ").concat(logicalCSS('width', flyoutSizes[size].width), "\n }\n ");
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddingSize) {
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import {
|
|
11
|
+
import { euiMinBreakpoint, logicalCSS, logicalTextAlignCSS, logicalSide } from '../../global_styling';
|
|
12
12
|
|
|
13
13
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
14
|
name: "gacnmc-allowFullScreen",
|
|
@@ -33,8 +33,8 @@ export var euiImageWrapperStyles = function euiImageWrapperStyles(euiThemeContex
|
|
|
33
33
|
// Floats
|
|
34
34
|
// 1: Logical properties/values in `float` is currently not yet supported by all browsers w/o flags
|
|
35
35
|
// @see https://caniuse.com/mdn-css_properties_float_flow_relative_values for when we can remove left/right fallbacks
|
|
36
|
-
left: /*#__PURE__*/css(
|
|
37
|
-
right: /*#__PURE__*/css(
|
|
36
|
+
left: /*#__PURE__*/css(euiMinBreakpoint(euiThemeContext, 'm'), "{float:left;float:", logicalSide.left, ";", logicalCSS('margin-left', '0'), ";", logicalCSS('margin-top', '0'), ";};label:left;"),
|
|
37
|
+
right: /*#__PURE__*/css(euiMinBreakpoint(euiThemeContext, 'm'), "{float:right;float:", logicalSide.right, ";", logicalCSS('margin-right', '0'), ";", logicalCSS('margin-top', '0'), ";};label:right;"),
|
|
38
38
|
// Sizes
|
|
39
39
|
fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), ";;label:fullWidth;")
|
|
40
40
|
};
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import {
|
|
11
|
+
import { euiMinBreakpoint, logicalCSS } from '../../global_styling';
|
|
12
12
|
|
|
13
13
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
14
|
name: "ll8kmq-column",
|
|
@@ -36,7 +36,7 @@ export var euiPageStyles = function euiPageStyles(euiThemeContext) {
|
|
|
36
36
|
grow: _ref2,
|
|
37
37
|
// Direction
|
|
38
38
|
column: _ref,
|
|
39
|
-
row: /*#__PURE__*/css("flex-direction:column;",
|
|
39
|
+
row: /*#__PURE__*/css("flex-direction:column;", euiMinBreakpoint(euiThemeContext, 'm'), "{flex-direction:row;};label:row;"),
|
|
40
40
|
// Max widths
|
|
41
41
|
restrictWidth: /*#__PURE__*/css(logicalCSS('margin-horizontal', 'auto'), ";;label:restrictWidth;")
|
|
42
42
|
};
|
|
@@ -10,20 +10,20 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
import { css, keyframes } from '@emotion/react';
|
|
13
|
-
import {
|
|
13
|
+
import { euiMaxBreakpoint, euiMinBreakpoint, euiScrollBarStyles, logicalCSS, logicalCSSWithFallback, logicalSizeCSS } from '../../global_styling';
|
|
14
14
|
export var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
|
|
15
15
|
var euiTheme = euiThemeContext.euiTheme;
|
|
16
|
-
var euiToastWidth = euiTheme.base *
|
|
16
|
+
var euiToastWidth = euiTheme.base * 25;
|
|
17
17
|
return {
|
|
18
18
|
/**
|
|
19
19
|
* 1. Allow list to expand as items are added, but cap it at the screen height.
|
|
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
|
|
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, "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), ";}", euiMaxBreakpoint(euiThemeContext, 'm'), "{&:not(:empty){", logicalCSS('left', 0), ";", logicalCSS('width', '100%'), ";}};label:euiGlobalToastList;"),
|
|
24
24
|
// Variants
|
|
25
|
-
right: /*#__PURE__*/css("&:not(:empty){", logicalCSS('right', 0), ";", logicalCSS('padding-left', "".concat(euiTheme.base * 4, "px")), ";}
|
|
26
|
-
left: /*#__PURE__*/css("&:not(:empty){", logicalCSS('left', 0), ";", logicalCSS('padding-right', "".concat(euiTheme.base * 4, "px")), ";}
|
|
25
|
+
right: /*#__PURE__*/css("&:not(:empty){", logicalCSS('right', 0), ";", euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('padding-left', "".concat(euiTheme.base * 4, "px")), ";}};label:right;"),
|
|
26
|
+
left: /*#__PURE__*/css("&:not(:empty){", logicalCSS('left', 0), ";", euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('padding-right', "".concat(euiTheme.base * 4, "px")), ";}};label:left;")
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
export var euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref) {
|
|
@@ -9,7 +9,7 @@ import { sortMapBySmallToLargeValues } from '../../services/breakpoint/_sorting'
|
|
|
9
9
|
import { useEuiTheme } from '../../services/theme/hooks';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Generates a CSS media query rule string based on the input breakpoint ranges
|
|
12
|
+
* Generates a CSS media query rule string based on the input breakpoint *ranges*.
|
|
13
13
|
* Examples with default theme breakpoints:
|
|
14
14
|
*
|
|
15
15
|
* euiBreakpoint(['s']) becomes `@media only screen and (min-width: 575px) and (max-width: 767px)`
|
|
@@ -47,4 +47,49 @@ export var euiBreakpoint = function euiBreakpoint(_ref, sizes) {
|
|
|
47
47
|
export var useEuiBreakpoint = function useEuiBreakpoint(sizes) {
|
|
48
48
|
var euiTheme = useEuiTheme();
|
|
49
49
|
return euiBreakpoint(euiTheme, sizes);
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Min/Max width breakpoint utilities that generate only a single min/max query/bound
|
|
53
|
+
*
|
|
54
|
+
* *Unlike the above euiBreakpoint utility*, these utilities treat breakpoint
|
|
55
|
+
* sizes as a one-dimensional point, rather than a two-dimensional *screen range*.
|
|
56
|
+
* Examples with default theme breakpoints:
|
|
57
|
+
*
|
|
58
|
+
* euiMaxBreakpoint('m') becomes `@media only screen and (max-width: 767px)`
|
|
59
|
+
* euiMinBreakpoint('m') becomes `@media only screen and (min-width: 768px)`
|
|
60
|
+
*
|
|
61
|
+
* This is safer and more intentional to use than euiBreakpoint(['xs', 's']) / euiBreakpoint(['m', 'xl'])
|
|
62
|
+
* in the event that consumers add larger or smaller custom breakpoints (e.g 'xxs' or `xxl`)
|
|
63
|
+
* and if the intention of the media query is actually "m and below/above" vs. "only screens m/l/xl".
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
export var euiMinBreakpoint = function euiMinBreakpoint(_ref2, size) {
|
|
67
|
+
var euiTheme = _ref2.euiTheme;
|
|
68
|
+
var minBreakpointSize = euiTheme.breakpoint[size];
|
|
69
|
+
|
|
70
|
+
if (minBreakpointSize) {
|
|
71
|
+
return "@media only screen and (min-width: ".concat(minBreakpointSize, "px)");
|
|
72
|
+
} else {
|
|
73
|
+
console.warn("Invalid min breakpoint size: ".concat(size));
|
|
74
|
+
return '@media only screen';
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export var useEuiMinBreakpoint = function useEuiMinBreakpoint(size) {
|
|
78
|
+
var euiTheme = useEuiTheme();
|
|
79
|
+
return euiMinBreakpoint(euiTheme, size);
|
|
80
|
+
};
|
|
81
|
+
export var euiMaxBreakpoint = function euiMaxBreakpoint(_ref3, size) {
|
|
82
|
+
var euiTheme = _ref3.euiTheme;
|
|
83
|
+
var maxBreakpointSize = euiTheme.breakpoint[size];
|
|
84
|
+
|
|
85
|
+
if (maxBreakpointSize) {
|
|
86
|
+
return "@media only screen and (max-width: ".concat(maxBreakpointSize - 1, "px)");
|
|
87
|
+
} else {
|
|
88
|
+
console.warn("Invalid max breakpoint size: ".concat(size));
|
|
89
|
+
return '@media only screen';
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
export var useEuiMaxBreakpoint = function useEuiMaxBreakpoint(size) {
|
|
93
|
+
var euiTheme = useEuiTheme();
|
|
94
|
+
return euiMaxBreakpoint(euiTheme, size);
|
|
50
95
|
};
|
package/eui.d.ts
CHANGED
|
@@ -7290,7 +7290,7 @@ declare module '@elastic/eui/src/global_styling/mixins/_responsive' {
|
|
|
7290
7290
|
import { UseEuiTheme } from '@elastic/eui/src/services/theme/hooks';
|
|
7291
7291
|
import { _EuiThemeBreakpoint } from '@elastic/eui/src/global_styling/variables';
|
|
7292
7292
|
/**
|
|
7293
|
-
* Generates a CSS media query rule string based on the input breakpoint ranges
|
|
7293
|
+
* Generates a CSS media query rule string based on the input breakpoint *ranges*.
|
|
7294
7294
|
* Examples with default theme breakpoints:
|
|
7295
7295
|
*
|
|
7296
7296
|
* euiBreakpoint(['s']) becomes `@media only screen and (min-width: 575px) and (max-width: 767px)`
|
|
@@ -7304,6 +7304,24 @@ declare module '@elastic/eui/src/global_styling/mixins/_responsive' {
|
|
|
7304
7304
|
*/
|
|
7305
7305
|
export const euiBreakpoint: ({ euiTheme }: UseEuiTheme, sizes: [_EuiThemeBreakpoint, ..._EuiThemeBreakpoint[]]) => string;
|
|
7306
7306
|
export const useEuiBreakpoint: (sizes: [_EuiThemeBreakpoint, ..._EuiThemeBreakpoint[]]) => string;
|
|
7307
|
+
/**
|
|
7308
|
+
* Min/Max width breakpoint utilities that generate only a single min/max query/bound
|
|
7309
|
+
*
|
|
7310
|
+
* *Unlike the above euiBreakpoint utility*, these utilities treat breakpoint
|
|
7311
|
+
* sizes as a one-dimensional point, rather than a two-dimensional *screen range*.
|
|
7312
|
+
* Examples with default theme breakpoints:
|
|
7313
|
+
*
|
|
7314
|
+
* euiMaxBreakpoint('m') becomes `@media only screen and (max-width: 767px)`
|
|
7315
|
+
* euiMinBreakpoint('m') becomes `@media only screen and (min-width: 768px)`
|
|
7316
|
+
*
|
|
7317
|
+
* This is safer and more intentional to use than euiBreakpoint(['xs', 's']) / euiBreakpoint(['m', 'xl'])
|
|
7318
|
+
* in the event that consumers add larger or smaller custom breakpoints (e.g 'xxs' or `xxl`)
|
|
7319
|
+
* and if the intention of the media query is actually "m and below/above" vs. "only screens m/l/xl".
|
|
7320
|
+
*/
|
|
7321
|
+
export const euiMinBreakpoint: ({ euiTheme }: UseEuiTheme, size: _EuiThemeBreakpoint) => string;
|
|
7322
|
+
export const useEuiMinBreakpoint: (size: _EuiThemeBreakpoint) => string;
|
|
7323
|
+
export const euiMaxBreakpoint: ({ euiTheme }: UseEuiTheme, size: _EuiThemeBreakpoint) => string;
|
|
7324
|
+
export const useEuiMaxBreakpoint: (size: _EuiThemeBreakpoint) => string;
|
|
7307
7325
|
|
|
7308
7326
|
}
|
|
7309
7327
|
declare module '@elastic/eui/src/global_styling/mixins' {
|
|
@@ -26,7 +26,7 @@ var euiDescriptionListStyles = function euiDescriptionListStyles(euiThemeContext
|
|
|
26
26
|
inline: /*#__PURE__*/(0, _react.css)(";label:inline;"),
|
|
27
27
|
column: /*#__PURE__*/(0, _react.css)(columnDisplay, ";;label:column;"),
|
|
28
28
|
// Responsive columns behave as a row on breakpoints xs-s
|
|
29
|
-
responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.
|
|
29
|
+
responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
30
30
|
// Alignment
|
|
31
31
|
center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), ";;label:center;"),
|
|
32
32
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;")
|
|
@@ -59,6 +59,7 @@ var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref)
|
|
|
59
59
|
align = _useContext.align,
|
|
60
60
|
gutterSize = _useContext.gutterSize;
|
|
61
61
|
|
|
62
|
+
var showResponsiveColumns = (0, _services.useIsWithinMinBreakpoint)('m');
|
|
62
63
|
var theme = (0, _services.useEuiTheme)();
|
|
63
64
|
var styles = (0, _description_list_description.euiDescriptionListDescriptionStyles)(theme);
|
|
64
65
|
var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
@@ -74,7 +75,10 @@ var EuiDescriptionListDescription = function EuiDescriptionListDescription(_ref)
|
|
|
74
75
|
conditionalStyles.push(styles.left);
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
|
|
78
|
+
if (type === 'column' || showResponsiveColumns) {
|
|
79
|
+
conditionalStyles.push(styles[gutterSize]);
|
|
80
|
+
}
|
|
81
|
+
|
|
78
82
|
break;
|
|
79
83
|
}
|
|
80
84
|
|
|
@@ -30,7 +30,7 @@ var euiDescriptionListDescriptionStyles = function euiDescriptionListDescription
|
|
|
30
30
|
// Types
|
|
31
31
|
row: /*#__PURE__*/(0, _react.css)(";label:row;"),
|
|
32
32
|
column: /*#__PURE__*/(0, _react.css)(columnDisplay, ";;label:column;"),
|
|
33
|
-
responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.
|
|
33
|
+
responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('width', '100%'), " padding:0;}", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
34
34
|
inline: _ref,
|
|
35
35
|
// This nested block handles just the font styling based on compressed and reverse
|
|
36
36
|
fontStyles: {
|
|
@@ -29,7 +29,7 @@ var euiDescriptionListTitleStyles = function euiDescriptionListTitleStyles(euiTh
|
|
|
29
29
|
// Types
|
|
30
30
|
row: /*#__PURE__*/(0, _react.css)(";label:row;"),
|
|
31
31
|
column: /*#__PURE__*/(0, _react.css)(columnDisplay, ";;label:column;"),
|
|
32
|
-
responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.
|
|
32
|
+
responsiveColumn: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('width', '100%'), " padding:0;}", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
33
33
|
inline: /*#__PURE__*/(0, _react.css)("display:inline;border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.medium, ";background-color:", colorMode === 'DARK' ? (0, _services.tint)(euiTheme.colors.lightestShade, 0.5) : euiTheme.colors.lightestShade, ";", (0, _global_styling.logicalCSS)('margin-vertical', '0'), " ", (0, _global_styling.logicalCSS)('margin-horizontal', euiTheme.size.xs), "&:first-of-type{", (0, _global_styling.logicalCSS)('margin-left', '0'), ";};label:inline;"),
|
|
34
34
|
// This nested block handles just the font styling based on compressed and reverse
|
|
35
35
|
fontStyles: {
|
|
@@ -20,7 +20,7 @@ var _templateObject, _templateObject2;
|
|
|
20
20
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
21
21
|
|
|
22
22
|
var euiFlyoutSlideInRight = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
|
|
23
|
-
var euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n}\n"])));
|
|
23
|
+
var euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
|
|
24
24
|
|
|
25
25
|
var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
|
|
26
26
|
var euiTheme = euiThemeContext.euiTheme;
|
|
@@ -31,8 +31,8 @@ var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeCon
|
|
|
31
31
|
outsideSide: {
|
|
32
32
|
// `transforms` pull in close buttons a little
|
|
33
33
|
// `!important` is necessary here to override the hover/focus transitions of buttons
|
|
34
|
-
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.
|
|
35
|
-
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.
|
|
34
|
+
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;"),
|
|
35
|
+
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;")
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
};
|
|
@@ -42,7 +42,7 @@ exports.euiFlyoutCloseButtonStyles = euiFlyoutCloseButtonStyles;
|
|
|
42
42
|
var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
43
43
|
var euiTheme = euiThemeContext.euiTheme;
|
|
44
44
|
return {
|
|
45
|
-
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.
|
|
45
|
+
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;"),
|
|
46
46
|
// Flyout sizes
|
|
47
47
|
s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
|
|
48
48
|
m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
|
|
@@ -51,7 +51,7 @@ var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
|
51
51
|
// Side
|
|
52
52
|
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;"),
|
|
53
53
|
// Left-side flyouts should only be used for navigation
|
|
54
|
-
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;"),
|
|
54
|
+
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;"),
|
|
55
55
|
// Type
|
|
56
56
|
overlay: /*#__PURE__*/(0, _react.css)((0, _mixins.euiShadowXLarge)(euiThemeContext), ";;label:overlay;"),
|
|
57
57
|
push: /*#__PURE__*/(0, _react.css)("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
|
|
@@ -96,7 +96,7 @@ var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
|
|
|
96
96
|
max: "".concat(euiTheme.breakpoint.l, "px")
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
return "\n ".concat((0, _global_styling.logicalCSS)('max-width', flyoutSizes[size].max), "\n\n ").concat((0, _global_styling.
|
|
99
|
+
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 ");
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
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.
|
|
38
|
-
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.
|
|
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.
|
|
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
|
};
|
|
@@ -15,17 +15,17 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
|
|
|
15
15
|
|
|
16
16
|
var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
|
|
17
17
|
var euiTheme = euiThemeContext.euiTheme;
|
|
18
|
-
var euiToastWidth = euiTheme.base *
|
|
18
|
+
var euiToastWidth = euiTheme.base * 25;
|
|
19
19
|
return {
|
|
20
20
|
/**
|
|
21
21
|
* 1. Allow list to expand as items are added, but cap it at the screen height.
|
|
22
22
|
* 2. Allow some padding for shadow
|
|
23
23
|
*/
|
|
24
24
|
// Base
|
|
25
|
-
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
|
|
25
|
+
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;"),
|
|
26
26
|
// Variants
|
|
27
|
-
right: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('right', 0), ";", (0, _global_styling.
|
|
28
|
-
left: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.
|
|
27
|
+
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;"),
|
|
28
|
+
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;")
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -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.
|
|
121
|
+
exports.useEuiMaxBreakpoint = useEuiMaxBreakpoint;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalTextAlignCSS,
|
|
9
|
+
import { logicalTextAlignCSS, euiMinBreakpoint } from '../../global_styling';
|
|
10
10
|
export var euiDescriptionListStyles = function euiDescriptionListStyles(euiThemeContext) {
|
|
11
11
|
// Flex display for column and responsive column
|
|
12
12
|
var columnDisplay = "\n display: flex;\n align-items: baseline;\n flex-wrap: wrap; \n ";
|
|
@@ -17,7 +17,7 @@ export var euiDescriptionListStyles = function euiDescriptionListStyles(euiTheme
|
|
|
17
17
|
inline: /*#__PURE__*/css(";label:inline;"),
|
|
18
18
|
column: /*#__PURE__*/css(columnDisplay, ";;label:column;"),
|
|
19
19
|
// Responsive columns behave as a row on breakpoints xs-s
|
|
20
|
-
responsiveColumn: /*#__PURE__*/css(
|
|
20
|
+
responsiveColumn: /*#__PURE__*/css(euiMinBreakpoint(euiThemeContext, 'm'), "{", columnDisplay, ";};label:responsiveColumn;"),
|
|
21
21
|
// Alignment
|
|
22
22
|
center: /*#__PURE__*/css(logicalTextAlignCSS('center'), ";;label:center;"),
|
|
23
23
|
left: /*#__PURE__*/css(logicalTextAlignCSS('left'), ";;label:left;")
|
|
@@ -12,7 +12,7 @@ var _excluded = ["children", "className"];
|
|
|
12
12
|
*/
|
|
13
13
|
import React, { useContext } from 'react';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
|
-
import { useEuiTheme } from '../../services';
|
|
15
|
+
import { useEuiTheme, useIsWithinMinBreakpoint } from '../../services';
|
|
16
16
|
import { euiDescriptionListDescriptionStyles } from './description_list_description.styles';
|
|
17
17
|
import { EuiDescriptionListContext } from './description_list_context'; // Export required for correct inference by HOCs
|
|
18
18
|
|
|
@@ -29,6 +29,7 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
|
|
|
29
29
|
align = _useContext.align,
|
|
30
30
|
gutterSize = _useContext.gutterSize;
|
|
31
31
|
|
|
32
|
+
var showResponsiveColumns = useIsWithinMinBreakpoint('m');
|
|
32
33
|
var theme = useEuiTheme();
|
|
33
34
|
var styles = euiDescriptionListDescriptionStyles(theme);
|
|
34
35
|
var conditionalStyles = compressed && textStyle === 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
@@ -44,7 +45,10 @@ export var EuiDescriptionListDescription = function EuiDescriptionListDescriptio
|
|
|
44
45
|
conditionalStyles.push(styles.left);
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
if (type === 'column' || showResponsiveColumns) {
|
|
49
|
+
conditionalStyles.push(styles[gutterSize]);
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
break;
|
|
49
53
|
}
|
|
50
54
|
|