@elastic/eui 67.1.0 → 67.1.2
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/dist/eui_theme_dark.css +0 -292
- package/dist/eui_theme_dark.json +0 -24
- package/dist/eui_theme_dark.json.d.ts +0 -24
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -292
- package/dist/eui_theme_light.json +0 -24
- package/dist/eui_theme_light.json.d.ts +0 -24
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accordion/accordion.js +5 -4
- package/es/components/accordion/accordion.styles.js +1 -1
- package/es/components/avatar/avatar.js +7 -1
- package/es/components/badge/badge.styles.js +10 -4
- package/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
- package/es/components/button/button_display/_button_display_content.js +2 -2
- package/es/components/button/button_icon/button_icon.js +11 -7
- package/es/components/collapsible_nav/collapsible_nav.js +8 -0
- package/es/components/expression/expression.styles.js +4 -2
- package/es/components/flyout/flyout.js +28 -48
- package/es/components/flyout/flyout.styles.js +111 -0
- package/es/components/flyout/flyout_body.js +14 -6
- package/es/components/flyout/flyout_body.styles.js +21 -0
- package/es/components/flyout/flyout_footer.js +8 -1
- package/es/components/flyout/flyout_footer.styles.js +14 -0
- package/es/components/flyout/flyout_header.js +9 -4
- package/es/components/flyout/flyout_header.styles.js +28 -0
- package/es/components/image/image_wrapper.js +3 -3
- package/es/components/markdown_editor/markdown_format.styles.js +11 -6
- package/es/components/notification/notification_event.js +2 -3
- package/es/components/page/page_header/page_header_content.js +1 -1
- package/es/components/page/page_section/page_section.js +3 -4
- package/es/components/pagination/pagination_button.styles.js +5 -3
- package/es/components/progress/progress.js +2 -2
- package/es/components/text/text.styles.js +6 -3
- package/es/components/tool_tip/tool_tip.styles.js +7 -6
- package/es/components/tour/tour.styles.js +11 -6
- package/es/global_styling/functions/index.js +1 -0
- package/es/global_styling/functions/math.js +46 -0
- package/es/global_styling/mixins/_helpers.js +5 -2
- package/eui.d.ts +95 -7
- package/i18ntokens.json +2 -2
- package/lib/components/accordion/accordion.js +5 -4
- package/lib/components/accordion/accordion.styles.js +1 -1
- package/lib/components/avatar/avatar.js +7 -1
- package/lib/components/badge/badge.styles.js +9 -3
- package/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
- package/lib/components/button/button_display/_button_display_content.js +2 -2
- package/lib/components/button/button_icon/button_icon.js +11 -7
- package/lib/components/collapsible_nav/collapsible_nav.js +8 -0
- package/lib/components/expression/expression.styles.js +3 -1
- package/lib/components/flyout/flyout.js +28 -47
- package/lib/components/flyout/flyout.styles.js +122 -0
- package/lib/components/flyout/flyout_body.js +16 -6
- package/lib/components/flyout/flyout_body.styles.js +32 -0
- package/lib/components/flyout/flyout_footer.js +10 -1
- package/lib/components/flyout/flyout_footer.styles.js +24 -0
- package/lib/components/flyout/flyout_header.js +11 -4
- package/lib/components/flyout/flyout_header.styles.js +31 -0
- package/lib/components/image/image_wrapper.js +3 -3
- package/lib/components/markdown_editor/markdown_format.styles.js +10 -5
- package/lib/components/notification/notification_event.js +2 -3
- package/lib/components/page/page_header/page_header_content.js +1 -1
- package/lib/components/page/page_section/page_section.js +3 -4
- package/lib/components/pagination/pagination_button.styles.js +4 -2
- package/lib/components/progress/progress.js +2 -2
- package/lib/components/text/text.styles.js +5 -2
- package/lib/components/tool_tip/tool_tip.styles.js +6 -5
- package/lib/components/tour/tour.styles.js +10 -5
- package/lib/global_styling/functions/index.js +13 -0
- package/lib/global_styling/functions/math.js +55 -0
- package/lib/global_styling/mixins/_helpers.js +5 -2
- package/optimize/es/components/accordion/accordion.js +5 -4
- package/optimize/es/components/accordion/accordion.styles.js +1 -1
- package/optimize/es/components/avatar/avatar.js +7 -1
- package/optimize/es/components/badge/badge.styles.js +10 -4
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
- package/optimize/es/components/button/button_display/_button_display_content.js +2 -2
- package/optimize/es/components/button/button_icon/button_icon.js +11 -7
- package/optimize/es/components/expression/expression.styles.js +4 -2
- package/optimize/es/components/flyout/flyout.js +28 -48
- package/optimize/es/components/flyout/flyout.styles.js +111 -0
- package/optimize/es/components/flyout/flyout_body.js +14 -6
- package/optimize/es/components/flyout/flyout_body.styles.js +21 -0
- package/optimize/es/components/flyout/flyout_footer.js +8 -1
- package/optimize/es/components/flyout/flyout_footer.styles.js +14 -0
- package/optimize/es/components/flyout/flyout_header.js +9 -4
- package/optimize/es/components/flyout/flyout_header.styles.js +28 -0
- package/optimize/es/components/image/image_wrapper.js +3 -3
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +11 -6
- package/optimize/es/components/notification/notification_event.js +2 -3
- package/optimize/es/components/page/page_header/page_header_content.js +1 -1
- package/optimize/es/components/page/page_section/page_section.js +3 -4
- package/optimize/es/components/pagination/pagination_button.styles.js +5 -3
- package/optimize/es/components/progress/progress.js +2 -2
- package/optimize/es/components/text/text.styles.js +6 -3
- package/optimize/es/components/tool_tip/tool_tip.styles.js +7 -6
- package/optimize/es/components/tour/tour.styles.js +11 -6
- package/optimize/es/global_styling/functions/index.js +1 -0
- package/optimize/es/global_styling/functions/math.js +44 -0
- package/optimize/es/global_styling/mixins/_helpers.js +5 -2
- package/optimize/lib/components/accordion/accordion.js +5 -4
- package/optimize/lib/components/accordion/accordion.styles.js +1 -1
- package/optimize/lib/components/avatar/avatar.js +8 -1
- package/optimize/lib/components/badge/badge.styles.js +9 -3
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
- package/optimize/lib/components/button/button_display/_button_display_content.js +2 -2
- package/optimize/lib/components/button/button_icon/button_icon.js +11 -7
- package/optimize/lib/components/expression/expression.styles.js +3 -1
- package/optimize/lib/components/flyout/flyout.js +28 -47
- package/optimize/lib/components/flyout/flyout.styles.js +124 -0
- package/optimize/lib/components/flyout/flyout_body.js +16 -6
- package/optimize/lib/components/flyout/flyout_body.styles.js +32 -0
- package/optimize/lib/components/flyout/flyout_footer.js +10 -1
- package/optimize/lib/components/flyout/flyout_footer.styles.js +24 -0
- package/optimize/lib/components/flyout/flyout_header.js +11 -4
- package/optimize/lib/components/flyout/flyout_header.styles.js +31 -0
- package/optimize/lib/components/image/image_wrapper.js +3 -3
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +10 -5
- package/optimize/lib/components/notification/notification_event.js +2 -3
- package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
- package/optimize/lib/components/page/page_section/page_section.js +3 -4
- package/optimize/lib/components/pagination/pagination_button.styles.js +4 -2
- package/optimize/lib/components/progress/progress.js +2 -2
- package/optimize/lib/components/text/text.styles.js +5 -2
- package/optimize/lib/components/tool_tip/tool_tip.styles.js +6 -5
- package/optimize/lib/components/tour/tour.styles.js +10 -5
- package/optimize/lib/global_styling/functions/index.js +13 -0
- package/optimize/lib/global_styling/functions/math.js +57 -0
- package/optimize/lib/global_styling/mixins/_helpers.js +5 -2
- package/package.json +1 -1
- package/src/components/index.scss +0 -1
- package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
- package/test-env/components/accordion/accordion.js +5 -4
- package/test-env/components/accordion/accordion.styles.js +1 -1
- package/test-env/components/avatar/avatar.js +8 -1
- package/test-env/components/badge/badge.styles.js +9 -3
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +3 -1
- package/test-env/components/button/button_display/_button_display_content.js +2 -2
- package/test-env/components/button/button_icon/button_icon.js +11 -7
- package/test-env/components/collapsible_nav/collapsible_nav.js +8 -0
- package/test-env/components/expression/expression.styles.js +3 -1
- package/test-env/components/flyout/flyout.styles.js +124 -0
- package/test-env/components/flyout/flyout_body.js +16 -6
- package/test-env/components/flyout/flyout_body.styles.js +32 -0
- package/test-env/components/flyout/flyout_footer.js +10 -1
- package/test-env/components/flyout/flyout_footer.styles.js +24 -0
- package/test-env/components/flyout/flyout_header.js +11 -4
- package/test-env/components/flyout/flyout_header.styles.js +31 -0
- package/test-env/components/image/image_wrapper.js +3 -3
- package/test-env/components/markdown_editor/markdown_format.styles.js +10 -5
- package/test-env/components/notification/notification_event.js +2 -3
- package/test-env/components/page/page_header/page_header_content.js +1 -1
- package/test-env/components/page/page_section/page_section.js +3 -4
- package/test-env/components/pagination/pagination_button.styles.js +4 -2
- package/test-env/components/progress/progress.js +2 -2
- package/test-env/components/text/text.styles.js +5 -2
- package/test-env/components/tool_tip/tool_tip.styles.js +6 -5
- package/test-env/components/tour/tour.styles.js +10 -5
- package/test-env/global_styling/functions/index.js +13 -0
- package/test-env/global_styling/functions/math.js +57 -0
- package/test-env/global_styling/mixins/_helpers.js +5 -2
- package/src/components/flyout/_flyout.scss +0 -196
- package/src/components/flyout/_flyout_body.scss +0 -18
- package/src/components/flyout/_flyout_footer.scss +0 -4
- package/src/components/flyout/_flyout_header.scss +0 -7
- package/src/components/flyout/_index.scss +0 -7
- package/src/components/flyout/_mixins.scss +0 -18
- package/src/components/flyout/_variables.scss +0 -8
- package/src/themes/amsterdam/global_styling/variables/_flyout.scss +0 -1
|
@@ -29,11 +29,16 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
29
29
|
var measurement = options.measurement;
|
|
30
30
|
var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
|
|
31
31
|
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
|
|
32
|
+
var blockQuoteBorderWidth = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
33
|
+
return x / 4;
|
|
34
|
+
});
|
|
35
|
+
var tablePaddingVertical = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
36
|
+
return x / 4;
|
|
37
|
+
});
|
|
38
|
+
var tablePaddingHorizontal = (0, _global_styling.mathWithUnits)(fontSize, function (x) {
|
|
39
|
+
return x / 2;
|
|
40
|
+
});
|
|
41
|
+
return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('border-left-width', blockQuoteBorderWidth), "\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiCheckbox .euiCheckbox__input ~ .euiCheckbox__label { // Extra specificity necessary to override default checkbox CSS\n font-size: ").concat(fontSize, ";\n ").concat((0, _global_styling.logicalCSS)('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat((0, _global_styling.logicalCSS)('padding-vertical', tablePaddingVertical), "\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
|
|
37
42
|
};
|
|
38
43
|
/**
|
|
39
44
|
* Styles
|
|
@@ -66,9 +66,8 @@ var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
|
|
|
66
66
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
67
67
|
|
|
68
68
|
var classes = (0, _classnames.default)('euiNotificationEvent', {
|
|
69
|
-
'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
|
|
70
|
-
|
|
71
|
-
});
|
|
69
|
+
'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
|
|
70
|
+
}, className);
|
|
72
71
|
var classesTitle = (0, _classnames.default)('euiNotificationEvent__title', {
|
|
73
72
|
'euiNotificationEvent__title--isRead': isRead
|
|
74
73
|
});
|
|
@@ -80,7 +80,7 @@ var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
|
|
|
80
80
|
|
|
81
81
|
var isResponsiveBreakpoint = (0, _services.useIsWithinBreakpoints)(['xs', 's'], !!responsive);
|
|
82
82
|
var useTheme = (0, _services.useEuiTheme)();
|
|
83
|
-
var classes = (0, _classnames.default)('euiPageHeaderContent');
|
|
83
|
+
var classes = (0, _classnames.default)('euiPageHeaderContent', className);
|
|
84
84
|
var pageHeaderStyles = (0, _page_header.euiPageHeaderStyles)(useTheme);
|
|
85
85
|
var contentStyles = (0, _page_header_content.euiPageHeaderContentStyles)(useTheme);
|
|
86
86
|
var styles = (0, _restrict_width.setStyleForRestrictedPageWidth)(restrictWidth, style);
|
|
@@ -56,12 +56,11 @@ var EuiPageSection = function EuiPageSection(_ref) {
|
|
|
56
56
|
var colors = (0, _global_styling.useEuiBackgroundColorCSS)();
|
|
57
57
|
var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
|
|
58
58
|
var contentStyles = (0, _page_section.euiPageSectionContentStyles)();
|
|
59
|
-
var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
|
|
59
|
+
var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth, (contentProps === null || contentProps === void 0 ? void 0 : contentProps.css) && contentProps.css];
|
|
60
60
|
return (0, _react2.jsx)(Component, _extends({
|
|
61
61
|
css: cssStyles
|
|
62
|
-
}, rest), (0, _react2.jsx)("div", _extends({
|
|
63
|
-
css: cssContentStyles
|
|
64
|
-
}, contentProps, {
|
|
62
|
+
}, rest), (0, _react2.jsx)("div", _extends({}, contentProps, {
|
|
63
|
+
css: cssContentStyles,
|
|
65
64
|
style: widthStyles
|
|
66
65
|
}), children));
|
|
67
66
|
};
|
|
@@ -21,7 +21,9 @@ var _mixins = require("../../themes/amsterdam/global_styling/mixins");
|
|
|
21
21
|
var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeContext) {
|
|
22
22
|
var euiTheme = euiThemeContext.euiTheme;
|
|
23
23
|
var fontSizeS = (0, _global_styling.euiFontSize)(euiThemeContext, 's');
|
|
24
|
-
var halfSizeM =
|
|
24
|
+
var halfSizeM = (0, _global_styling.mathWithUnits)(euiTheme.size.m, function (x) {
|
|
25
|
+
return x / 2;
|
|
26
|
+
});
|
|
25
27
|
var disabled = (0, _mixins.euiButtonEmptyColor)(euiThemeContext, 'disabled'); // && to increase specificity. Can likely be removed once EuiButtonEmpty has been converted.
|
|
26
28
|
|
|
27
29
|
return {
|
|
@@ -29,7 +31,7 @@ var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeConte
|
|
|
29
31
|
euiPaginationButton: /*#__PURE__*/(0, _react.css)("&&{", fontSizeS, ";padding:0;", (0, _global_styling.logicalTextAlignCSS)('center'), " border-radius:", euiTheme.border.radius.medium, ";outline-offset:-", euiTheme.focus.width, ";};label:euiPaginationButton;"),
|
|
30
32
|
// States
|
|
31
33
|
isActive: /*#__PURE__*/(0, _react.css)("&&{font-weight:", euiTheme.font.weight.bold, ";color:", euiTheme.colors.primary, ";.euiButtonEmpty__content{cursor:default;}&&,&&:hover{text-decoration:underline;}};label:isActive;"),
|
|
32
|
-
isPlaceholder: /*#__PURE__*/(0, _react.css)("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", (0, _global_styling.logicalCSS)('padding-top',
|
|
34
|
+
isPlaceholder: /*#__PURE__*/(0, _react.css)("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", (0, _global_styling.logicalCSS)('padding-top', halfSizeM), ";", (0, _global_styling.logicalCSS)('padding-bottom', 0), ";", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.s), ";", (0, _global_styling.logicalCSS)('height', euiTheme.size.l), ";};label:isPlaceholder;")
|
|
33
35
|
};
|
|
34
36
|
};
|
|
35
37
|
|
|
@@ -105,9 +105,9 @@ var EuiProgress = function EuiProgress(_ref) {
|
|
|
105
105
|
}, label && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
|
|
106
106
|
return (0, _react2.jsx)("span", _extends({
|
|
107
107
|
title: innerText,
|
|
108
|
-
ref: ref
|
|
108
|
+
ref: ref,
|
|
109
|
+
css: labelCssStyles
|
|
109
110
|
}, labelProps, {
|
|
110
|
-
css: labelCssStyles,
|
|
111
111
|
className: labelClasses
|
|
112
112
|
}), label);
|
|
113
113
|
}), valueRender && (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
|
|
@@ -61,8 +61,11 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
61
61
|
}; // Generate margins for headings based on customScale (not on heading level)
|
|
62
62
|
|
|
63
63
|
var customScale = _customScale === 'xxxs' ? 'xxs' : _customScale || 'm';
|
|
64
|
-
var
|
|
65
|
-
var
|
|
64
|
+
var marginSize = euiTheme.size[customScale];
|
|
65
|
+
var headingMarginTop = (0, _global_styling.mathWithUnits)(marginSize, function (x) {
|
|
66
|
+
return x * 2;
|
|
67
|
+
});
|
|
68
|
+
var headingMarginBottom = marginSize;
|
|
66
69
|
return "\n font-size: ".concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n\n h1 {\n font-size: ").concat(headings.h1.fontSize, ";\n line-height: ").concat(headings.h1.lineHeight, ";\n }\n h1:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n\n h2 {\n font-size: ").concat(headings.h2.fontSize, ";\n line-height: ").concat(headings.h2.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h3 {\n font-size: ").concat(headings.h3.fontSize, ";\n line-height: ").concat(headings.h3.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h4 {\n font-size: ").concat(headings.h4.fontSize, ";\n line-height: ").concat(headings.h4.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h5 {\n font-size: ").concat(headings.h5.fontSize, ";\n line-height: ").concat(headings.h5.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n h6 {\n font-size: ").concat(headings.h6.fontSize, ";\n line-height: ").concat(headings.h6.lineHeight, ";\n\n &:not(:first-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat((0, _global_styling.logicalCSS)('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat((0, _global_styling.logicalCSS)('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat((0, _global_styling.logicalCSS)('margin-top', fontSize), "\n }\n\n dt,\n .eui-definitionListReverse dd {\n font-size: ").concat(fontSize, ";\n line-height: ").concat(lineHeight, ";\n }\n\n .eui-definitionListReverse dt {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat((0, _global_styling.euiFontSize)(euiThemeContext, 's', options).fontSize, ";\n }\n\n pre:not(.euiCodeBlock__pre) {\n padding: ").concat(lineHeightSize, ";\n }\n\n code:not(.euiCode):not(.euiCodeBlock__code) {\n font-size: .9em; // 90% of parent font size\n }\n ").concat( // when textSize is 'm', the 'kbd' element gets a line between the text and the border-bottom
|
|
67
70
|
_customScale === 'm' ? "\n kbd {\n ".concat((0, _global_styling.logicalCSS)('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat((0, _global_styling.logicalCSS)('min-width', euiTheme.size.l), "\n ").concat((0, _global_styling.logicalTextAlignCSS)('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat((0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat((0, _global_styling.logicalCSS)('bottom', euiTheme.size.xxs), "\n ").concat((0, _global_styling.logicalCSS)('left', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', '100%'), "\n }") : '', "\n ");
|
|
68
71
|
};
|
|
@@ -48,12 +48,13 @@ var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
|
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
50
|
var arrowSize = euiTheme.size.m;
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
var arrowPlusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
|
|
52
|
+
return (x / 2 + 1) * -1;
|
|
53
|
+
}); // 1.
|
|
54
54
|
|
|
55
|
-
var arrowMinusSize =
|
|
56
|
-
|
|
55
|
+
var arrowMinusSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
|
|
56
|
+
return (x / 2 - 1) * -1;
|
|
57
|
+
}); // 1.
|
|
57
58
|
|
|
58
59
|
return {
|
|
59
60
|
// Base
|
|
@@ -40,15 +40,20 @@ exports.euiTourStyles = euiTourStyles;
|
|
|
40
40
|
var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
41
41
|
var euiTheme = _ref2.euiTheme;
|
|
42
42
|
var arrowSize = euiTheme.size[_popover_arrow.popoverArrowSize];
|
|
43
|
-
var
|
|
43
|
+
var arrowHalfSize = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
|
|
44
|
+
return x / 2;
|
|
45
|
+
});
|
|
46
|
+
var arrowOffset = (0, _global_styling.mathWithUnits)(arrowSize, function (x) {
|
|
47
|
+
return x * -2;
|
|
48
|
+
});
|
|
44
49
|
return {
|
|
45
50
|
// Base
|
|
46
51
|
euiTourBeacon: /*#__PURE__*/(0, _react.css)("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[_popover_panel.openAnimationTiming], ";;label:euiTourBeacon;"),
|
|
47
52
|
// Positions
|
|
48
|
-
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top',
|
|
49
|
-
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top',
|
|
50
|
-
top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left',
|
|
51
|
-
bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top',
|
|
53
|
+
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowOffset), ";;label:right;"),
|
|
54
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowHalfSize), ";", (0, _global_styling.logicalCSS)('left', arrowSize), ";;label:left;"),
|
|
55
|
+
top: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowSize), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:top;"),
|
|
56
|
+
bottom: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('top', arrowOffset), ";", (0, _global_styling.logicalCSS)('left', arrowHalfSize), ";;label:bottom;")
|
|
52
57
|
};
|
|
53
58
|
};
|
|
54
59
|
|
|
@@ -17,6 +17,19 @@ Object.keys(_logicals).forEach(function (key) {
|
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
var _math = require("./math");
|
|
21
|
+
|
|
22
|
+
Object.keys(_math).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _math[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _math[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
20
33
|
var _size = require("./size");
|
|
21
34
|
|
|
22
35
|
Object.keys(_size).forEach(function (key) {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.mathWithUnits = void 0;
|
|
9
|
+
|
|
10
|
+
function _wrapRegExp() { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = new RegExp(re, flags); _groups.set(_this, groups || _groups.get(re)); return _setPrototypeOf(_this, BabelRegExp.prototype); } _inherits(BabelRegExp, RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === "string") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\$<([^>]+)>/g, function (_, name) { return "$" + groups[name]; })); } else if (typeof substitution === "function") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = arguments; if (_typeof(args[args.length - 1]) !== "object") { args = [].slice.call(args); args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }
|
|
11
|
+
|
|
12
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
|
|
14
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
+
* Side Public License, v 1.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Utility for performing math callbacks on a string with CSS units
|
|
26
|
+
* and returning a string with its unit preserved.
|
|
27
|
+
*
|
|
28
|
+
* Example usage:
|
|
29
|
+
* mathWithUnits('4px', (x) => x / 2) = '2px';
|
|
30
|
+
* mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
|
|
31
|
+
*/
|
|
32
|
+
var mathWithUnits = function mathWithUnits(value, callback) {
|
|
33
|
+
var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
34
|
+
|
|
35
|
+
if (typeof value === 'string') {
|
|
36
|
+
var _matches$groups;
|
|
37
|
+
|
|
38
|
+
var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
|
|
39
|
+
value: 1,
|
|
40
|
+
unit: 2
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var matches = regex.exec(value);
|
|
44
|
+
if (!(matches !== null && matches !== void 0 && (_matches$groups = matches.groups) !== null && _matches$groups !== void 0 && _matches$groups.value)) return value;
|
|
45
|
+
var numericValue = Number(matches.groups.value);
|
|
46
|
+
var passedUnit = matches.groups.unit || unit;
|
|
47
|
+
return "".concat(callback(numericValue)).concat(passedUnit);
|
|
48
|
+
} else if (typeof value === 'number') {
|
|
49
|
+
return "".concat(callback(value)).concat(unit);
|
|
50
|
+
} else {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.mathWithUnits = mathWithUnits;
|
|
@@ -117,12 +117,15 @@ exports.useEuiYScroll = useEuiYScroll;
|
|
|
117
117
|
|
|
118
118
|
var euiYScrollWithShadows = function euiYScrollWithShadows(euiTheme) {
|
|
119
119
|
var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
120
|
-
height = _ref7.height
|
|
120
|
+
height = _ref7.height,
|
|
121
|
+
_ref7$side = _ref7.side,
|
|
122
|
+
side = _ref7$side === void 0 ? 'both' : _ref7$side;
|
|
121
123
|
|
|
122
124
|
return "\n ".concat(euiYScroll(euiTheme, {
|
|
123
125
|
height: height
|
|
124
126
|
}), "\n ").concat(euiOverflowShadowStyles(euiTheme, {
|
|
125
|
-
direction: 'y'
|
|
127
|
+
direction: 'y',
|
|
128
|
+
side: side
|
|
126
129
|
}), "\n");
|
|
127
130
|
};
|
|
128
131
|
|
|
@@ -190,10 +190,10 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
190
190
|
|
|
191
191
|
if (_arrowDisplay !== 'none') {
|
|
192
192
|
iconButton = ___EmotionJSX(EuiButtonIcon, _extends({
|
|
193
|
-
color: "text"
|
|
193
|
+
color: "text",
|
|
194
|
+
css: cssIconButtonStyles
|
|
194
195
|
}, arrowProps, {
|
|
195
196
|
className: iconButtonClasses,
|
|
196
|
-
css: cssIconButtonStyles,
|
|
197
197
|
iconType: "arrowRight",
|
|
198
198
|
onClick: this.onToggle,
|
|
199
199
|
"aria-controls": id,
|
|
@@ -229,10 +229,11 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
229
229
|
childrenContent = children;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
var button = ___EmotionJSX(ButtonElement, _extends({
|
|
232
|
+
var button = ___EmotionJSX(ButtonElement, _extends({
|
|
233
|
+
css: cssButtonStyles
|
|
234
|
+
}, buttonProps, {
|
|
233
235
|
id: buttonId,
|
|
234
236
|
className: buttonClasses,
|
|
235
|
-
css: cssButtonStyles,
|
|
236
237
|
"aria-controls": id,
|
|
237
238
|
"aria-expanded": isOpen,
|
|
238
239
|
onClick: isDisabled ? undefined : this.onToggle,
|
|
@@ -43,7 +43,7 @@ export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref
|
|
|
43
43
|
export var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
|
|
44
44
|
var euiTheme = _ref6.euiTheme;
|
|
45
45
|
return {
|
|
46
|
-
euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden
|
|
46
|
+
euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
|
|
47
47
|
isOpen: /*#__PURE__*/css(logicalCSS('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
|
|
48
48
|
};
|
|
49
49
|
};
|
|
@@ -4,6 +4,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["className", "color", "imageUrl", "initials", "initialsLength", "iconType", "iconSize", "iconColor", "name", "size", "type", "isDisabled", "style"];
|
|
6
6
|
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
+
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
10
|
+
|
|
7
11
|
/*
|
|
8
12
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
13
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -49,7 +53,9 @@ export var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
49
53
|
var classes = classNames('euiAvatar', (_classNames = {}, _defineProperty(_classNames, "euiAvatar--".concat(size), size), _defineProperty(_classNames, "euiAvatar--".concat(type), type), _defineProperty(_classNames, 'euiAvatar-isDisabled', isDisabled), _classNames), className);
|
|
50
54
|
var cssStyles = [styles.euiAvatar, styles[size], styles[type], isPlain && styles.plain, isSubdued && styles.subdued, isDisabled && styles.isDisabled];
|
|
51
55
|
checkValidInitials(initials);
|
|
52
|
-
|
|
56
|
+
|
|
57
|
+
var avatarStyle = _objectSpread({}, style);
|
|
58
|
+
|
|
53
59
|
var iconCustomColor = iconColor;
|
|
54
60
|
var isNamedColor = color === 'plain' || color === 'subdued' || color === null;
|
|
55
61
|
|
|
@@ -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, euiFocusRing, euiTextTruncate, logicalCSS, logicalTextAlignCSS } from '../../global_styling';
|
|
11
|
+
import { euiFontSize, euiFocusRing, euiTextTruncate, logicalCSS, logicalTextAlignCSS, mathWithUnits } from '../../global_styling';
|
|
12
12
|
import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins';
|
|
13
13
|
import { tint, transparentize } from '../../services';
|
|
14
14
|
|
|
@@ -25,14 +25,18 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
25
25
|
var euiTheme = euiThemeContext.euiTheme,
|
|
26
26
|
colorMode = euiThemeContext.colorMode;
|
|
27
27
|
return {
|
|
28
|
-
euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.base + 2, "px;font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:",
|
|
28
|
+
euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.base + 2, "px;font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
|
|
29
|
+
return x / 2;
|
|
30
|
+
}), ";", logicalTextAlignCSS('left'), " &:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
29
31
|
clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
30
32
|
disabled: /*#__PURE__*/css("color:", euiButtonColor(euiThemeContext, 'disabled').color, "!important;background-color:", euiButtonColor(euiThemeContext, 'disabled').backgroundColor, "!important;;label:disabled;"),
|
|
31
33
|
// Hollow has a border and is mostly used for autocompleters.
|
|
32
34
|
hollow: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";border-color:", colorMode === 'DARK' ? tint(euiTheme.border.color, 0.15) : euiTheme.border.color, ";color:", euiTheme.colors.text, ";;label:hollow;"),
|
|
33
35
|
// Content wrapper
|
|
34
36
|
euiBadge__content: /*#__PURE__*/css(logicalCSS( // Ensure proper height in case of just displaying an icon
|
|
35
|
-
'min-height', "".concat(
|
|
37
|
+
'min-height', "".concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
38
|
+
return euiTheme.base + x * 2;
|
|
39
|
+
}))), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
|
|
36
40
|
// Text
|
|
37
41
|
text: {
|
|
38
42
|
euiBadge__text: /*#__PURE__*/css(euiTextTruncate(), " cursor:inherit;;label:euiBadge__text;"),
|
|
@@ -46,7 +50,9 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
46
50
|
},
|
|
47
51
|
// Clickable icons (iconOnClick)
|
|
48
52
|
iconButton: {
|
|
49
|
-
euiBadge__iconButton: /*#__PURE__*/css("font-size:0;&:focus{background-color:", transparentize(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:",
|
|
53
|
+
euiBadge__iconButton: /*#__PURE__*/css("font-size:0;&:focus{background-color:", transparentize(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
|
|
54
|
+
return x / 2;
|
|
55
|
+
}), ";}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
|
|
50
56
|
right: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.xs), ";;label:right;"),
|
|
51
57
|
left: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), ";;label:left;")
|
|
52
58
|
},
|
|
@@ -9,7 +9,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
9
9
|
*/
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
11
|
import { transparentize } from '../../services/color';
|
|
12
|
-
import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS } from '../../global_styling';
|
|
12
|
+
import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, mathWithUnits } from '../../global_styling';
|
|
13
13
|
|
|
14
14
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
15
|
name: "1k7t4ns-isCollapsed",
|
|
@@ -47,7 +47,9 @@ export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiT
|
|
|
47
47
|
var euiTheme = euiThemeContext.euiTheme;
|
|
48
48
|
return {
|
|
49
49
|
euiBreadcrumb__content: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
|
|
50
|
-
isTruncated: /*#__PURE__*/css(euiTextTruncate(
|
|
50
|
+
isTruncated: /*#__PURE__*/css(euiTextTruncate(mathWithUnits(euiTheme.size.base, function (x) {
|
|
51
|
+
return x * 10;
|
|
52
|
+
})), ";;label:isTruncated;"),
|
|
51
53
|
isTruncatedLast: /*#__PURE__*/css(euiTextTruncate('none'), ";;label:isTruncatedLast;"),
|
|
52
54
|
// Types
|
|
53
55
|
page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiThemeContext, 'center'), ";};label:page;"),
|
|
@@ -64,9 +64,9 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
var isText = typeof children === 'string';
|
|
67
|
-
return ___EmotionJSX("span", _extends({
|
|
67
|
+
return ___EmotionJSX("span", _extends({
|
|
68
68
|
css: cssStyles
|
|
69
|
-
}), icon, isText ? ___EmotionJSX("span", _extends({}, textProps, {
|
|
69
|
+
}, contentProps), icon, isText ? ___EmotionJSX("span", _extends({}, textProps, {
|
|
70
70
|
className: classNames('eui-textTruncate', textProps === null || textProps === void 0 ? void 0 : textProps.className)
|
|
71
71
|
}), children) : children);
|
|
72
72
|
};
|
|
@@ -69,11 +69,15 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
|
|
72
|
-
var
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
var styles = {
|
|
73
|
+
euiButtonIcon: /*#__PURE__*/css(";label:euiButtonIcon;"),
|
|
74
|
+
colors: useEuiButtonColorCSS({
|
|
75
|
+
display: display
|
|
76
|
+
}),
|
|
77
|
+
// Temporary extra style for empty `:hover` state until we decide how to handle universally
|
|
78
|
+
hoverStyles: /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;")
|
|
79
|
+
};
|
|
80
|
+
var cssStyles = [styles.euiButtonIcon, styles.colors[color], display === 'empty' && styles.hoverStyles];
|
|
77
81
|
var classes = classNames('euiButtonIcon', size && sizeToClassNameMap[size], className);
|
|
78
82
|
|
|
79
83
|
if (_color === 'ghost') {
|
|
@@ -119,7 +123,7 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
|
|
|
119
123
|
rel: rel
|
|
120
124
|
});
|
|
121
125
|
return ___EmotionJSX("a", _extends({
|
|
122
|
-
css:
|
|
126
|
+
css: cssStyles,
|
|
123
127
|
tabIndex: isAriaHidden ? -1 : undefined,
|
|
124
128
|
className: classes,
|
|
125
129
|
href: href,
|
|
@@ -131,7 +135,7 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
|
|
|
131
135
|
|
|
132
136
|
var buttonType;
|
|
133
137
|
return ___EmotionJSX("button", _extends({
|
|
134
|
-
css:
|
|
138
|
+
css: cssStyles,
|
|
135
139
|
tabIndex: isAriaHidden ? -1 : undefined,
|
|
136
140
|
disabled: isDisabled,
|
|
137
141
|
className: classes,
|
|
@@ -10,7 +10,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
import { css } from '@emotion/react';
|
|
13
|
-
import { euiFontSize, logicalCSS, logicalTextAlignCSS, euiTextBreakWord, euiTextTruncate } from '../../global_styling';
|
|
13
|
+
import { euiFontSize, logicalCSS, logicalTextAlignCSS, euiTextBreakWord, euiTextTruncate, mathWithUnits } from '../../global_styling';
|
|
14
14
|
import { transparentize } from '../../services/color';
|
|
15
15
|
|
|
16
16
|
var _colorCSS = function _colorCSS(color) {
|
|
@@ -20,7 +20,9 @@ var _colorCSS = function _colorCSS(color) {
|
|
|
20
20
|
export var euiExpressionStyles = function euiExpressionStyles(euiThemeContext) {
|
|
21
21
|
var euiTheme = euiThemeContext.euiTheme;
|
|
22
22
|
return {
|
|
23
|
-
euiExpression: /*#__PURE__*/css(euiTextBreakWord(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", logicalCSS('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", euiFontSize(euiThemeContext, 's'), ";", logicalTextAlignCSS('left'), " padding:",
|
|
23
|
+
euiExpression: /*#__PURE__*/css(euiTextBreakWord(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", logicalCSS('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", euiFontSize(euiThemeContext, 's'), ";", logicalTextAlignCSS('left'), " padding:", mathWithUnits(euiTheme.size.s, function (x) {
|
|
24
|
+
return x / 2;
|
|
25
|
+
}), " 0;color:", euiTheme.colors.text, ";&:focus{", logicalCSS('border-bottom-style', 'solid'), ";}&+.euiExpression{", logicalCSS('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
|
|
24
26
|
// Variants
|
|
25
27
|
columns: /*#__PURE__*/css("border-color:transparent;", logicalCSS('border-bottom-style', 'solid'), " ", logicalCSS('margin-bottom', euiTheme.size.xs), " ", logicalCSS('width', '100%'), " display:flex;padding:", euiTheme.size.xs, ";border-radius:", euiTheme.size.xs, ";;label:columns;"),
|
|
26
28
|
truncate: /*#__PURE__*/css(logicalCSS('max-width', '100%'), ";;label:truncate;"),
|
|
@@ -17,31 +17,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
*/
|
|
18
18
|
import React, { useEffect, useRef, useState, forwardRef, Fragment } from 'react';
|
|
19
19
|
import classnames from 'classnames';
|
|
20
|
-
import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint } from '../../services';
|
|
21
|
-
import {
|
|
20
|
+
import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme } from '../../services';
|
|
21
|
+
import { logicalStyle } from '../../global_styling';
|
|
22
22
|
import { EuiFocusTrap } from '../focus_trap';
|
|
23
23
|
import { EuiOverlayMask } from '../overlay_mask';
|
|
24
24
|
import { EuiButtonIcon } from '../button';
|
|
25
25
|
import { EuiI18n } from '../i18n';
|
|
26
26
|
import { useResizeObserver } from '../observer/resize_observer';
|
|
27
27
|
import { EuiPortal } from '../portal';
|
|
28
|
+
import { euiFlyoutStyles, euiFlyoutCloseButtonStyles } from './flyout.styles';
|
|
28
29
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
33
|
-
export var TYPES = keysOf(typeToClassNameMap);
|
|
34
|
-
var sideToClassNameMap = {
|
|
35
|
-
left: 'euiFlyout--left',
|
|
36
|
-
right: null
|
|
37
|
-
};
|
|
38
|
-
export var SIDES = keysOf(sideToClassNameMap);
|
|
39
|
-
var sizeToClassNameMap = {
|
|
40
|
-
s: 'euiFlyout--small',
|
|
41
|
-
m: 'euiFlyout--medium',
|
|
42
|
-
l: 'euiFlyout--large'
|
|
43
|
-
};
|
|
44
|
-
export var SIZES = keysOf(sizeToClassNameMap);
|
|
30
|
+
export var TYPES = ['push', 'overlay'];
|
|
31
|
+
export var SIDES = ['left', 'right'];
|
|
32
|
+
export var SIZES = ['s', 'm', 'l'];
|
|
45
33
|
|
|
46
34
|
/**
|
|
47
35
|
* Custom type checker for named flyout sizes since the prop
|
|
@@ -51,13 +39,7 @@ function isEuiFlyoutSizeNamed(value) {
|
|
|
51
39
|
return SIZES.includes(value);
|
|
52
40
|
}
|
|
53
41
|
|
|
54
|
-
var
|
|
55
|
-
none: 'euiFlyout--paddingNone',
|
|
56
|
-
s: 'euiFlyout--paddingSmall',
|
|
57
|
-
m: 'euiFlyout--paddingMedium',
|
|
58
|
-
l: 'euiFlyout--paddingLarge'
|
|
59
|
-
};
|
|
60
|
-
export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
|
|
42
|
+
export var PADDING_SIZES = ['none', 's', 'm', 'l'];
|
|
61
43
|
var defaultElement = 'div';
|
|
62
44
|
export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
63
45
|
var className = _ref.className,
|
|
@@ -148,41 +130,37 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
148
130
|
onClose(event);
|
|
149
131
|
}
|
|
150
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* Set inline styles
|
|
135
|
+
*/
|
|
151
136
|
|
|
152
|
-
var newStyle;
|
|
153
|
-
var widthClassName;
|
|
154
|
-
var sizeClassName; // Setting max-width
|
|
155
137
|
|
|
156
|
-
|
|
157
|
-
widthClassName = 'euiFlyout--maxWidth-default';
|
|
158
|
-
} else if (maxWidth !== false) {
|
|
159
|
-
var value = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
|
|
160
|
-
newStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
161
|
-
maxWidth: value
|
|
162
|
-
});
|
|
163
|
-
} // Setting size
|
|
138
|
+
var newStyle = style;
|
|
164
139
|
|
|
140
|
+
if (typeof maxWidth !== 'boolean') {
|
|
141
|
+
newStyle = _objectSpread(_objectSpread({}, newStyle), logicalStyle('max-width', maxWidth));
|
|
142
|
+
}
|
|
165
143
|
|
|
166
|
-
if (isEuiFlyoutSizeNamed(size)) {
|
|
167
|
-
|
|
168
|
-
} else if (newStyle) {
|
|
169
|
-
newStyle.width = size;
|
|
170
|
-
} else {
|
|
171
|
-
newStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
172
|
-
width: size
|
|
173
|
-
});
|
|
144
|
+
if (!isEuiFlyoutSizeNamed(size)) {
|
|
145
|
+
newStyle = _objectSpread(_objectSpread({}, newStyle), logicalStyle('width', size));
|
|
174
146
|
}
|
|
175
147
|
|
|
176
|
-
var
|
|
148
|
+
var euiTheme = useEuiTheme();
|
|
149
|
+
var styles = euiFlyoutStyles(euiTheme);
|
|
150
|
+
var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, styles[type], type === 'push' && styles.pushSide[side], styles[side]];
|
|
151
|
+
var classes = classnames('euiFlyout', className);
|
|
177
152
|
var closeButton;
|
|
178
153
|
|
|
179
154
|
if (onClose && !hideCloseButton) {
|
|
180
|
-
var closeButtonClasses = classnames('euiFlyout__closeButton',
|
|
155
|
+
var closeButtonClasses = classnames('euiFlyout__closeButton', closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.className);
|
|
156
|
+
var closeButtonStyles = euiFlyoutCloseButtonStyles(euiTheme);
|
|
157
|
+
var closeButtonCssStyles = [closeButtonStyles.euiFlyout__closeButton, closeButtonStyles[closeButtonPosition], closeButtonPosition === 'outside' && closeButtonStyles.outsideSide[side]];
|
|
181
158
|
closeButton = ___EmotionJSX(EuiI18n, {
|
|
182
159
|
token: "euiFlyout.closeAriaLabel",
|
|
183
160
|
default: "Close this dialog"
|
|
184
161
|
}, function (closeAriaLabel) {
|
|
185
162
|
return ___EmotionJSX(EuiButtonIcon, _extends({
|
|
163
|
+
css: closeButtonCssStyles,
|
|
186
164
|
display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
|
|
187
165
|
iconType: "cross",
|
|
188
166
|
color: "text",
|
|
@@ -235,11 +213,13 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
235
213
|
disabled: isPushed,
|
|
236
214
|
clickOutsideDisables: !ownFocus,
|
|
237
215
|
onClickOutside: onClickOutside
|
|
238
|
-
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
216
|
+
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
217
|
+
css: cssStyles
|
|
218
|
+
}, rest, {
|
|
239
219
|
role: role,
|
|
240
220
|
className: classes,
|
|
241
221
|
tabIndex: -1,
|
|
242
|
-
style: newStyle
|
|
222
|
+
style: newStyle,
|
|
243
223
|
ref: setRef
|
|
244
224
|
}), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
245
225
|
|