@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
|
@@ -30,6 +30,11 @@ var _avatar = require("./avatar.styles");
|
|
|
30
30
|
var _react2 = require("@emotion/react");
|
|
31
31
|
|
|
32
32
|
var _excluded = ["className", "color", "imageUrl", "initials", "initialsLength", "iconType", "iconSize", "iconColor", "name", "size", "type", "isDisabled", "style"];
|
|
33
|
+
|
|
34
|
+
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; }
|
|
35
|
+
|
|
36
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
37
|
+
|
|
33
38
|
var SIZES = ['s', 'm', 'l', 'xl'];
|
|
34
39
|
exports.SIZES = SIZES;
|
|
35
40
|
var TYPES = ['space', 'user'];
|
|
@@ -63,7 +68,9 @@ var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
63
68
|
var classes = (0, _classnames.default)('euiAvatar', (_classNames = {}, (0, _defineProperty2.default)(_classNames, "euiAvatar--".concat(size), size), (0, _defineProperty2.default)(_classNames, "euiAvatar--".concat(type), type), (0, _defineProperty2.default)(_classNames, 'euiAvatar-isDisabled', isDisabled), _classNames), className);
|
|
64
69
|
var cssStyles = [styles.euiAvatar, styles[size], styles[type], isPlain && styles.plain, isSubdued && styles.subdued, isDisabled && styles.isDisabled];
|
|
65
70
|
checkValidInitials(initials);
|
|
66
|
-
|
|
71
|
+
|
|
72
|
+
var avatarStyle = _objectSpread({}, style);
|
|
73
|
+
|
|
67
74
|
var iconCustomColor = iconColor;
|
|
68
75
|
var isNamedColor = color === 'plain' || color === 'subdued' || color === null;
|
|
69
76
|
|
|
@@ -28,14 +28,18 @@ var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
28
28
|
var euiTheme = euiThemeContext.euiTheme,
|
|
29
29
|
colorMode = euiThemeContext.colorMode;
|
|
30
30
|
return {
|
|
31
|
-
euiBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", (0, _global_styling.logicalCSS)('max-width', '100%'), " font-size:", (0, _global_styling.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:",
|
|
31
|
+
euiBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", (0, _global_styling.logicalCSS)('max-width', '100%'), " font-size:", (0, _global_styling.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:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.medium, function (x) {
|
|
32
|
+
return x / 2;
|
|
33
|
+
}), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " &:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
32
34
|
clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
33
35
|
disabled: /*#__PURE__*/(0, _react.css)("color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled').color, "!important;background-color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled').backgroundColor, "!important;;label:disabled;"),
|
|
34
36
|
// Hollow has a border and is mostly used for autocompleters.
|
|
35
37
|
hollow: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";border-color:", colorMode === 'DARK' ? (0, _services.tint)(euiTheme.border.color, 0.15) : euiTheme.border.color, ";color:", euiTheme.colors.text, ";;label:hollow;"),
|
|
36
38
|
// Content wrapper
|
|
37
39
|
euiBadge__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)( // Ensure proper height in case of just displaying an icon
|
|
38
|
-
'min-height', "".concat(
|
|
40
|
+
'min-height', "".concat((0, _global_styling.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
41
|
+
return euiTheme.base + x * 2;
|
|
42
|
+
}))), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
|
|
39
43
|
// Text
|
|
40
44
|
text: {
|
|
41
45
|
euiBadge__text: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)(), " cursor:inherit;;label:euiBadge__text;"),
|
|
@@ -49,7 +53,9 @@ var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
49
53
|
},
|
|
50
54
|
// Clickable icons (iconOnClick)
|
|
51
55
|
iconButton: {
|
|
52
|
-
euiBadge__iconButton: /*#__PURE__*/(0, _react.css)("font-size:0;&:focus{background-color:", (0, _services.transparentize)(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:",
|
|
56
|
+
euiBadge__iconButton: /*#__PURE__*/(0, _react.css)("font-size:0;&:focus{background-color:", (0, _services.transparentize)(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", (0, _global_styling.mathWithUnits)(euiTheme.border.radius.small, function (x) {
|
|
57
|
+
return x / 2;
|
|
58
|
+
}), ";}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
|
|
53
59
|
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";;label:right;"),
|
|
54
60
|
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";;label:left;")
|
|
55
61
|
},
|
|
@@ -52,7 +52,9 @@ var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiThemeCon
|
|
|
52
52
|
var euiTheme = euiThemeContext.euiTheme;
|
|
53
53
|
return {
|
|
54
54
|
euiBreadcrumb__content: /*#__PURE__*/(0, _react.css)("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
|
|
55
|
-
isTruncated: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)(
|
|
55
|
+
isTruncated: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)((0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
56
|
+
return x * 10;
|
|
57
|
+
})), ";;label:isTruncated;"),
|
|
56
58
|
isTruncatedLast: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)('none'), ";;label:isTruncatedLast;"),
|
|
57
59
|
// Types
|
|
58
60
|
page: /*#__PURE__*/(0, _react.css)("&:is(a):focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'inset'), ";}&:is(button):focus{", (0, _global_styling.euiFocusRing)(euiThemeContext, 'center'), ";};label:page;"),
|
|
@@ -76,9 +76,9 @@ var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
var isText = typeof children === 'string';
|
|
79
|
-
return (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
79
|
+
return (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
80
80
|
css: cssStyles
|
|
81
|
-
}), icon, isText ? (0, _react2.jsx)("span", (0, _extends2.default)({}, textProps, {
|
|
81
|
+
}, contentProps), icon, isText ? (0, _react2.jsx)("span", (0, _extends2.default)({}, textProps, {
|
|
82
82
|
className: (0, _classnames.default)('eui-textTruncate', textProps === null || textProps === void 0 ? void 0 : textProps.className)
|
|
83
83
|
}), children) : children);
|
|
84
84
|
};
|
|
@@ -83,11 +83,15 @@ var EuiButtonIcon = function EuiButtonIcon(props) {
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
var styles = {
|
|
87
|
+
euiButtonIcon: /*#__PURE__*/(0, _react2.css)(";label:euiButtonIcon;"),
|
|
88
|
+
colors: (0, _button.useEuiButtonColorCSS)({
|
|
89
|
+
display: display
|
|
90
|
+
}),
|
|
91
|
+
// Temporary extra style for empty `:hover` state until we decide how to handle universally
|
|
92
|
+
hoverStyles: /*#__PURE__*/(0, _react2.css)("&:hover{background-color:", (0, _button.euiButtonEmptyColor)(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;")
|
|
93
|
+
};
|
|
94
|
+
var cssStyles = [styles.euiButtonIcon, styles.colors[color], display === 'empty' && styles.hoverStyles];
|
|
91
95
|
var classes = (0, _classnames.default)('euiButtonIcon', size && sizeToClassNameMap[size], className);
|
|
92
96
|
|
|
93
97
|
if (_color === 'ghost') {
|
|
@@ -133,7 +137,7 @@ var EuiButtonIcon = function EuiButtonIcon(props) {
|
|
|
133
137
|
rel: rel
|
|
134
138
|
});
|
|
135
139
|
return (0, _react2.jsx)("a", (0, _extends2.default)({
|
|
136
|
-
css:
|
|
140
|
+
css: cssStyles,
|
|
137
141
|
tabIndex: isAriaHidden ? -1 : undefined,
|
|
138
142
|
className: classes,
|
|
139
143
|
href: href,
|
|
@@ -145,7 +149,7 @@ var EuiButtonIcon = function EuiButtonIcon(props) {
|
|
|
145
149
|
|
|
146
150
|
var buttonType;
|
|
147
151
|
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
148
|
-
css:
|
|
152
|
+
css: cssStyles,
|
|
149
153
|
tabIndex: isAriaHidden ? -1 : undefined,
|
|
150
154
|
disabled: isDisabled,
|
|
151
155
|
className: classes,
|
|
@@ -24,7 +24,9 @@ var _colorCSS = function _colorCSS(color) {
|
|
|
24
24
|
var euiExpressionStyles = function euiExpressionStyles(euiThemeContext) {
|
|
25
25
|
var euiTheme = euiThemeContext.euiTheme;
|
|
26
26
|
return {
|
|
27
|
-
euiExpression: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " padding:",
|
|
27
|
+
euiExpression: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextBreakWord)(), ";display:inline-block;font-family:", euiTheme.font.familyCode, ";", (0, _global_styling.logicalCSS)('border-bottom', "".concat(euiTheme.border.width.thick, " solid transparent")), " ", (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";", (0, _global_styling.logicalTextAlignCSS)('left'), " padding:", (0, _global_styling.mathWithUnits)(euiTheme.size.s, function (x) {
|
|
28
|
+
return x / 2;
|
|
29
|
+
}), " 0;color:", euiTheme.colors.text, ";&:focus{", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), ";}&+.euiExpression{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.s), ";};label:euiExpression;"),
|
|
28
30
|
// Variants
|
|
29
31
|
columns: /*#__PURE__*/(0, _react.css)("border-color:transparent;", (0, _global_styling.logicalCSS)('border-bottom-style', 'solid'), " ", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.xs), " ", (0, _global_styling.logicalCSS)('width', '100%'), " display:flex;padding:", euiTheme.size.xs, ";border-radius:", euiTheme.size.xs, ";;label:columns;"),
|
|
30
32
|
truncate: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '100%'), ";;label:truncate;"),
|
|
@@ -23,7 +23,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
23
23
|
|
|
24
24
|
var _services = require("../../services");
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _global_styling = require("../../global_styling");
|
|
27
27
|
|
|
28
28
|
var _focus_trap = require("../focus_trap");
|
|
29
29
|
|
|
@@ -37,6 +37,8 @@ var _resize_observer = require("../observer/resize_observer");
|
|
|
37
37
|
|
|
38
38
|
var _portal = require("../portal");
|
|
39
39
|
|
|
40
|
+
var _flyout = require("./flyout.styles");
|
|
41
|
+
|
|
40
42
|
var _react2 = require("@emotion/react");
|
|
41
43
|
|
|
42
44
|
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonAriaLabel", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "role", "pushMinBreakpoint", "focusTrapProps"];
|
|
@@ -49,24 +51,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
49
51
|
|
|
50
52
|
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) { (0, _defineProperty2.default)(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; }
|
|
51
53
|
|
|
52
|
-
var
|
|
53
|
-
push: 'euiFlyout--push',
|
|
54
|
-
overlay: null
|
|
55
|
-
};
|
|
56
|
-
var TYPES = (0, _common.keysOf)(typeToClassNameMap);
|
|
54
|
+
var TYPES = ['push', 'overlay'];
|
|
57
55
|
exports.TYPES = TYPES;
|
|
58
|
-
var
|
|
59
|
-
left: 'euiFlyout--left',
|
|
60
|
-
right: null
|
|
61
|
-
};
|
|
62
|
-
var SIDES = (0, _common.keysOf)(sideToClassNameMap);
|
|
56
|
+
var SIDES = ['left', 'right'];
|
|
63
57
|
exports.SIDES = SIDES;
|
|
64
|
-
var
|
|
65
|
-
s: 'euiFlyout--small',
|
|
66
|
-
m: 'euiFlyout--medium',
|
|
67
|
-
l: 'euiFlyout--large'
|
|
68
|
-
};
|
|
69
|
-
var SIZES = (0, _common.keysOf)(sizeToClassNameMap);
|
|
58
|
+
var SIZES = ['s', 'm', 'l'];
|
|
70
59
|
exports.SIZES = SIZES;
|
|
71
60
|
|
|
72
61
|
/**
|
|
@@ -77,13 +66,7 @@ function isEuiFlyoutSizeNamed(value) {
|
|
|
77
66
|
return SIZES.includes(value);
|
|
78
67
|
}
|
|
79
68
|
|
|
80
|
-
var
|
|
81
|
-
none: 'euiFlyout--paddingNone',
|
|
82
|
-
s: 'euiFlyout--paddingSmall',
|
|
83
|
-
m: 'euiFlyout--paddingMedium',
|
|
84
|
-
l: 'euiFlyout--paddingLarge'
|
|
85
|
-
};
|
|
86
|
-
var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
|
|
69
|
+
var PADDING_SIZES = ['none', 's', 'm', 'l'];
|
|
87
70
|
exports.PADDING_SIZES = PADDING_SIZES;
|
|
88
71
|
var defaultElement = 'div';
|
|
89
72
|
var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
@@ -174,41 +157,37 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
174
157
|
onClose(event);
|
|
175
158
|
}
|
|
176
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* Set inline styles
|
|
162
|
+
*/
|
|
177
163
|
|
|
178
|
-
var newStyle;
|
|
179
|
-
var widthClassName;
|
|
180
|
-
var sizeClassName; // Setting max-width
|
|
181
164
|
|
|
182
|
-
|
|
183
|
-
widthClassName = 'euiFlyout--maxWidth-default';
|
|
184
|
-
} else if (maxWidth !== false) {
|
|
185
|
-
var value = typeof maxWidth === 'number' ? "".concat(maxWidth, "px") : maxWidth;
|
|
186
|
-
newStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
187
|
-
maxWidth: value
|
|
188
|
-
});
|
|
189
|
-
} // Setting size
|
|
165
|
+
var newStyle = style;
|
|
190
166
|
|
|
167
|
+
if (typeof maxWidth !== 'boolean') {
|
|
168
|
+
newStyle = _objectSpread(_objectSpread({}, newStyle), (0, _global_styling.logicalStyle)('max-width', maxWidth));
|
|
169
|
+
}
|
|
191
170
|
|
|
192
|
-
if (isEuiFlyoutSizeNamed(size)) {
|
|
193
|
-
|
|
194
|
-
} else if (newStyle) {
|
|
195
|
-
newStyle.width = size;
|
|
196
|
-
} else {
|
|
197
|
-
newStyle = _objectSpread(_objectSpread({}, style), {}, {
|
|
198
|
-
width: size
|
|
199
|
-
});
|
|
171
|
+
if (!isEuiFlyoutSizeNamed(size)) {
|
|
172
|
+
newStyle = _objectSpread(_objectSpread({}, newStyle), (0, _global_styling.logicalStyle)('width', size));
|
|
200
173
|
}
|
|
201
174
|
|
|
202
|
-
var
|
|
175
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
176
|
+
var styles = (0, _flyout.euiFlyoutStyles)(euiTheme);
|
|
177
|
+
var cssStyles = [styles.euiFlyout, styles.paddingSizes[paddingSize], isEuiFlyoutSizeNamed(size) && styles[size], maxWidth === false && styles.noMaxWidth, styles[type], type === 'push' && styles.pushSide[side], styles[side]];
|
|
178
|
+
var classes = (0, _classnames.default)('euiFlyout', className);
|
|
203
179
|
var closeButton;
|
|
204
180
|
|
|
205
181
|
if (onClose && !hideCloseButton) {
|
|
206
|
-
var closeButtonClasses = (0, _classnames.default)('euiFlyout__closeButton',
|
|
182
|
+
var closeButtonClasses = (0, _classnames.default)('euiFlyout__closeButton', closeButtonProps === null || closeButtonProps === void 0 ? void 0 : closeButtonProps.className);
|
|
183
|
+
var closeButtonStyles = (0, _flyout.euiFlyoutCloseButtonStyles)(euiTheme);
|
|
184
|
+
var closeButtonCssStyles = [closeButtonStyles.euiFlyout__closeButton, closeButtonStyles[closeButtonPosition], closeButtonPosition === 'outside' && closeButtonStyles.outsideSide[side]];
|
|
207
185
|
closeButton = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
208
186
|
token: "euiFlyout.closeAriaLabel",
|
|
209
187
|
default: "Close this dialog"
|
|
210
188
|
}, function (closeAriaLabel) {
|
|
211
189
|
return (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
|
|
190
|
+
css: closeButtonCssStyles,
|
|
212
191
|
display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
|
|
213
192
|
iconType: "cross",
|
|
214
193
|
color: "text",
|
|
@@ -261,11 +240,13 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
261
240
|
disabled: isPushed,
|
|
262
241
|
clickOutsideDisables: !ownFocus,
|
|
263
242
|
onClickOutside: onClickOutside
|
|
264
|
-
}, focusTrapProps), (0, _react2.jsx)(Element, (0, _extends2.default)({
|
|
243
|
+
}, focusTrapProps), (0, _react2.jsx)(Element, (0, _extends2.default)({
|
|
244
|
+
css: cssStyles
|
|
245
|
+
}, rest, {
|
|
265
246
|
role: role,
|
|
266
247
|
className: classes,
|
|
267
248
|
tabIndex: -1,
|
|
268
|
-
style: newStyle
|
|
249
|
+
style: newStyle,
|
|
269
250
|
ref: setRef
|
|
270
251
|
}), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
271
252
|
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.euiFlyoutStyles = exports.euiFlyoutCloseButtonStyles = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
14
|
+
var _global_styling = require("../../global_styling");
|
|
15
|
+
|
|
16
|
+
var _mixins = require("../../themes/amsterdam/global_styling/mixins");
|
|
17
|
+
|
|
18
|
+
var _color = require("../../services/color");
|
|
19
|
+
|
|
20
|
+
var _form = require("../form/form.styles");
|
|
21
|
+
|
|
22
|
+
var _templateObject, _templateObject2;
|
|
23
|
+
|
|
24
|
+
var euiFlyoutSlideInRight = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
|
|
25
|
+
var euiFlyoutSlideInLeft = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n}\n"])));
|
|
26
|
+
|
|
27
|
+
var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
|
|
28
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
29
|
+
return {
|
|
30
|
+
euiFlyout__closeButton: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('right', euiTheme.size.s), " ", (0, _global_styling.logicalCSS)('top', euiTheme.size.s), " z-index:3;;label:euiFlyout__closeButton;"),
|
|
31
|
+
inside: /*#__PURE__*/(0, _react.css)("background-color:", (0, _color.transparentize)(euiTheme.colors.emptyShade, 0.9), ";;label:inside;"),
|
|
32
|
+
outside: /*#__PURE__*/(0, _react.css)((0, _mixins.euiShadowXLarge)(euiThemeContext), ";animation:none!important;;label:outside;"),
|
|
33
|
+
outsideSide: {
|
|
34
|
+
// `transforms` pull in close buttons a little
|
|
35
|
+
// `!important` is necessary here to override the hover/focus transitions of buttons
|
|
36
|
+
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(-100% - ", euiTheme.size.l, "))!important;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(-100% - ", euiTheme.size.xs, "))!important;};label:right;"),
|
|
37
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('right', 0), " ", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(100% + ", euiTheme.size.l, "))!important;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(100% + ", euiTheme.size.xs, "))!important;};label:left;")
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.euiFlyoutCloseButtonStyles = euiFlyoutCloseButtonStyles;
|
|
43
|
+
|
|
44
|
+
var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
45
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
46
|
+
return {
|
|
47
|
+
euiFlyout: /*#__PURE__*/(0, _react.css)("position:fixed;", (0, _global_styling.logicalCSS)('top', 0), " ", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{", (0, _global_styling.logicalCSS)('max-width', '90vw !important'), ";};label:euiFlyout;"),
|
|
48
|
+
// Flyout sizes
|
|
49
|
+
s: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
|
|
50
|
+
m: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
|
|
51
|
+
l: /*#__PURE__*/(0, _react.css)(composeFlyoutSizing(euiThemeContext, 'l'), ";;label:l;"),
|
|
52
|
+
noMaxWidth: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', 'none'), ";;label:noMaxWidth;"),
|
|
53
|
+
// Side
|
|
54
|
+
right: /*#__PURE__*/(0, _react.css)("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", (0, _global_styling.logicalCSS)('right', 0), " ", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
|
|
55
|
+
// Left-side flyouts should only be used for navigation
|
|
56
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", _global_styling.euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, ";};label:left;"),
|
|
57
|
+
// Type
|
|
58
|
+
overlay: /*#__PURE__*/(0, _react.css)((0, _mixins.euiShadowXLarge)(euiThemeContext), ";;label:overlay;"),
|
|
59
|
+
push: /*#__PURE__*/(0, _react.css)("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
|
|
60
|
+
pushSide: {
|
|
61
|
+
right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-left', euiTheme.border.thick), ";;label:right;"),
|
|
62
|
+
left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-right', euiTheme.border.thick), ";;label:left;")
|
|
63
|
+
},
|
|
64
|
+
// Padding
|
|
65
|
+
paddingSizes: {
|
|
66
|
+
none: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 'none'), ";;label:none;"),
|
|
67
|
+
s: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 's'), ";;label:s;"),
|
|
68
|
+
m: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 'm'), ";;label:m;"),
|
|
69
|
+
l: /*#__PURE__*/(0, _react.css)(composeFlyoutPadding(euiThemeContext, 'l'), ";;label:l;")
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.euiFlyoutStyles = euiFlyoutStyles;
|
|
75
|
+
|
|
76
|
+
var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
|
|
77
|
+
var euiTheme = euiThemeContext.euiTheme; // 1. Calculating the minimum width based on the screen takeover breakpoint
|
|
78
|
+
|
|
79
|
+
var flyoutSizes = {
|
|
80
|
+
s: {
|
|
81
|
+
min: "".concat(Math.round(euiTheme.breakpoint.m * 0.5), "px"),
|
|
82
|
+
// 1.
|
|
83
|
+
width: '25vw',
|
|
84
|
+
max: "".concat(Math.round(euiTheme.breakpoint.s * 0.7), "px")
|
|
85
|
+
},
|
|
86
|
+
m: {
|
|
87
|
+
// Calculated for forms plus padding
|
|
88
|
+
min: "".concat((0, _global_styling.mathWithUnits)((0, _form.euiFormMaxWidth)(euiThemeContext), function (x) {
|
|
89
|
+
return x + 24;
|
|
90
|
+
})),
|
|
91
|
+
width: '50vw',
|
|
92
|
+
max: "".concat(euiTheme.breakpoint.m, "px")
|
|
93
|
+
},
|
|
94
|
+
l: {
|
|
95
|
+
min: "".concat(Math.round(euiTheme.breakpoint.m * 0.9), "px"),
|
|
96
|
+
// 1.
|
|
97
|
+
width: '75vw',
|
|
98
|
+
max: "".concat(euiTheme.breakpoint.l, "px")
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return "\n ".concat((0, _global_styling.logicalCSS)('max-width', flyoutSizes[size].max), "\n\n ").concat((0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'xl']), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', flyoutSizes[size].min), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].width), "\n }\n ").concat((0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), " {\n ").concat((0, _global_styling.logicalCSS)('min-width', 0), "\n ").concat((0, _global_styling.logicalCSS)('width', flyoutSizes[size].min), "\n }\n ");
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddingSize) {
|
|
105
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
106
|
+
var paddingModifierMap = {
|
|
107
|
+
none: 0,
|
|
108
|
+
s: euiTheme.size.s,
|
|
109
|
+
m: euiTheme.size.base,
|
|
110
|
+
l: euiTheme.size.l
|
|
111
|
+
}; // Footer padding
|
|
112
|
+
|
|
113
|
+
var footerPaddingSizes = {
|
|
114
|
+
none: 0,
|
|
115
|
+
s: euiTheme.size.s,
|
|
116
|
+
m: "".concat((0, _global_styling.mathWithUnits)(euiTheme.size.base, function (x) {
|
|
117
|
+
return x * 0.75;
|
|
118
|
+
}), " ").concat(euiTheme.size.base, ";"),
|
|
119
|
+
l: "".concat((0, _global_styling.mathWithUnits)(euiTheme.size.l, function (x) {
|
|
120
|
+
return x / 1.5;
|
|
121
|
+
}), " ").concat(euiTheme.size.l, ";")
|
|
122
|
+
};
|
|
123
|
+
return "\n .euiFlyoutHeader {\n ".concat((0, _global_styling.logicalCSS)('padding-horizontal', paddingModifierMap[paddingSize]), "\n ").concat((0, _global_styling.logicalCSS)('padding-top', paddingModifierMap[paddingSize]), "\n }\n\n [class*='euiFlyoutHeader-hasBorder'] {\n ").concat((0, _global_styling.logicalCSS)('padding-bottom', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutBody__overflowContent {\n padding: ").concat(paddingModifierMap[paddingSize], ";\n }\n\n .euiFlyoutBody__banner .euiCallOut {\n ").concat((0, _global_styling.logicalCSS)('padding-horizontal', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutFooter {\n padding: ").concat(footerPaddingSizes[paddingSize], ";\n }\n ");
|
|
124
|
+
};
|
|
@@ -15,6 +15,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
|
|
18
|
+
var _services = require("../../services");
|
|
19
|
+
|
|
20
|
+
var _flyout_body = require("./flyout_body.styles");
|
|
21
|
+
|
|
18
22
|
var _react2 = require("@emotion/react");
|
|
19
23
|
|
|
20
24
|
var _excluded = ["children", "className", "banner"];
|
|
@@ -25,16 +29,22 @@ var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
|
|
|
25
29
|
banner = _ref.banner,
|
|
26
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
27
31
|
var classes = (0, _classnames.default)('euiFlyoutBody', className);
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
33
|
+
var styles = (0, _flyout_body.euiFlyoutBodyStyles)(euiTheme);
|
|
34
|
+
var cssStyles = [styles.euiFlyoutBody];
|
|
35
|
+
var bannerCssStyles = [banner && styles.euiFlyoutBody__banner];
|
|
36
|
+
var overflowCssStyles = [banner ? styles.euiFlyoutBody__overflow.hasBanner : styles.euiFlyoutBody__overflow.noBanner];
|
|
31
37
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
32
38
|
className: classes
|
|
33
|
-
}, rest
|
|
39
|
+
}, rest, {
|
|
40
|
+
css: cssStyles
|
|
41
|
+
}), (0, _react2.jsx)("div", {
|
|
34
42
|
tabIndex: 0,
|
|
35
|
-
className:
|
|
43
|
+
className: "euiFlyoutBody__overflow",
|
|
44
|
+
css: overflowCssStyles
|
|
36
45
|
}, banner && (0, _react2.jsx)("div", {
|
|
37
|
-
className: "euiFlyoutBody__banner"
|
|
46
|
+
className: "euiFlyoutBody__banner",
|
|
47
|
+
css: bannerCssStyles
|
|
38
48
|
}, banner), (0, _react2.jsx)("div", {
|
|
39
49
|
className: "euiFlyoutBody__overflowContent"
|
|
40
50
|
}, children)));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiFlyoutBodyStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiFlyoutBodyStyles = function euiFlyoutBodyStyles(euiThemeContext) {
|
|
20
|
+
return {
|
|
21
|
+
euiFlyoutBody: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSSWithFallback)('overflow-y', 'hidden'), " ", (0, _global_styling.logicalCSS)('height', '100%'), ";;label:euiFlyoutBody;"),
|
|
22
|
+
euiFlyoutBody__overflow: {
|
|
23
|
+
noBanner: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiYScrollWithShadows)(euiThemeContext), ";;label:noBanner;"),
|
|
24
|
+
hasBanner: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiYScrollWithShadows)(euiThemeContext, {
|
|
25
|
+
side: 'end'
|
|
26
|
+
}), ";;label:hasBanner;")
|
|
27
|
+
},
|
|
28
|
+
euiFlyoutBody__banner: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSSWithFallback)('overflow-x', 'hidden'), ";;label:euiFlyoutBody__banner;")
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.euiFlyoutBodyStyles = euiFlyoutBodyStyles;
|
|
@@ -15,6 +15,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
|
|
18
|
+
var _services = require("../../services");
|
|
19
|
+
|
|
20
|
+
var _flyout_footer = require("./flyout_footer.styles");
|
|
21
|
+
|
|
18
22
|
var _react2 = require("@emotion/react");
|
|
19
23
|
|
|
20
24
|
var _excluded = ["children", "className"];
|
|
@@ -24,9 +28,14 @@ var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
|
|
|
24
28
|
className = _ref.className,
|
|
25
29
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
26
30
|
var classes = (0, _classnames.default)('euiFlyoutFooter', className);
|
|
31
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
32
|
+
var styles = (0, _flyout_footer.euiFlyoutFooterStyles)(euiTheme);
|
|
33
|
+
var cssStyles = [styles.euiFlyoutFooter];
|
|
27
34
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
28
35
|
className: classes
|
|
29
|
-
}, rest
|
|
36
|
+
}, rest, {
|
|
37
|
+
css: cssStyles
|
|
38
|
+
}), children);
|
|
30
39
|
};
|
|
31
40
|
|
|
32
41
|
exports.EuiFlyoutFooter = EuiFlyoutFooter;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiFlyoutFooterStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
12
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
13
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
14
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
15
|
+
* Side Public License, v 1.
|
|
16
|
+
*/
|
|
17
|
+
var euiFlyoutFooterStyles = function euiFlyoutFooterStyles(euiThemeContext) {
|
|
18
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
19
|
+
return {
|
|
20
|
+
euiFlyoutFooter: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.lightestShade, ";flex-grow:0;;label:euiFlyoutFooter;")
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.euiFlyoutFooterStyles = euiFlyoutFooterStyles;
|
|
@@ -15,6 +15,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
|
|
18
|
+
var _services = require("../../services");
|
|
19
|
+
|
|
20
|
+
var _flyout_header = require("./flyout_header.styles");
|
|
21
|
+
|
|
18
22
|
var _react2 = require("@emotion/react");
|
|
19
23
|
|
|
20
24
|
var _excluded = ["children", "className", "hasBorder"];
|
|
@@ -25,12 +29,15 @@ var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
|
|
|
25
29
|
_ref$hasBorder = _ref.hasBorder,
|
|
26
30
|
hasBorder = _ref$hasBorder === void 0 ? false : _ref$hasBorder,
|
|
27
31
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
|
-
var classes = (0, _classnames.default)('euiFlyoutHeader',
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
var classes = (0, _classnames.default)('euiFlyoutHeader', className);
|
|
33
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
34
|
+
var styles = (0, _flyout_header.euiFlyoutHeaderStyles)(euiTheme);
|
|
35
|
+
var cssStyles = [styles.euiFlyoutHeader, hasBorder && styles.hasBorder];
|
|
31
36
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
32
37
|
className: classes
|
|
33
|
-
}, rest
|
|
38
|
+
}, rest, {
|
|
39
|
+
css: cssStyles
|
|
40
|
+
}), children);
|
|
34
41
|
};
|
|
35
42
|
|
|
36
43
|
exports.EuiFlyoutHeader = EuiFlyoutHeader;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiFlyoutHeaderStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
13
|
+
|
|
14
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "1hivny1-euiFlyoutHeader",
|
|
16
|
+
styles: "flex-grow:0;label:euiFlyoutHeader;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "1hivny1-euiFlyoutHeader",
|
|
19
|
+
styles: "flex-grow:0;label:euiFlyoutHeader;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var euiFlyoutHeaderStyles = function euiFlyoutHeaderStyles(euiThemeContext) {
|
|
24
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
25
|
+
return {
|
|
26
|
+
euiFlyoutHeader: _ref,
|
|
27
|
+
hasBorder: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-bottom', euiTheme.border.thin), ";;label:hasBorder;")
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
exports.euiFlyoutHeaderStyles = euiFlyoutHeaderStyles;
|
|
@@ -62,10 +62,10 @@ var EuiImageWrapper = function EuiImageWrapper(_ref) {
|
|
|
62
62
|
optionalCaptionText = _useInnerText2[1];
|
|
63
63
|
|
|
64
64
|
return (0, _react2.jsx)("figure", (0, _extends2.default)({
|
|
65
|
-
"aria-label": optionalCaptionText
|
|
66
|
-
}, wrapperProps, {
|
|
67
|
-
className: classes,
|
|
65
|
+
"aria-label": optionalCaptionText,
|
|
68
66
|
css: cssFigureStyles
|
|
67
|
+
}, wrapperProps, {
|
|
68
|
+
className: classes
|
|
69
69
|
}), allowFullScreen ? (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_image_button.EuiImageButton, {
|
|
70
70
|
hasAlt: !!alt,
|
|
71
71
|
hasShadow: hasShadow,
|
|
@@ -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
|