@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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
7
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
8
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
9
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
10
|
+
* Side Public License, v 1.
|
|
11
|
+
*/
|
|
12
|
+
import { css, keyframes } from '@emotion/react';
|
|
13
|
+
import { euiCanAnimate, euiBreakpoint, logicalCSS, mathWithUnits } from '../../global_styling';
|
|
14
|
+
import { euiShadowXLarge } from '../../themes/amsterdam/global_styling/mixins';
|
|
15
|
+
import { transparentize } from '../../services/color';
|
|
16
|
+
import { euiFormMaxWidth } from '../form/form.styles';
|
|
17
|
+
var euiFlyoutSlideInRight = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n }\n"])));
|
|
18
|
+
var euiFlyoutSlideInLeft = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 0;\n transform: translateX(-100%);\n }\n 75% {\n opacity: 1;\n transform: translateX(0%);\n}\n"])));
|
|
19
|
+
export var euiFlyoutCloseButtonStyles = function euiFlyoutCloseButtonStyles(euiThemeContext) {
|
|
20
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
21
|
+
return {
|
|
22
|
+
euiFlyout__closeButton: /*#__PURE__*/css("position:absolute;", logicalCSS('right', euiTheme.size.s), " ", logicalCSS('top', euiTheme.size.s), " z-index:3;;label:euiFlyout__closeButton;"),
|
|
23
|
+
inside: /*#__PURE__*/css("background-color:", transparentize(euiTheme.colors.emptyShade, 0.9), ";;label:inside;"),
|
|
24
|
+
outside: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), ";animation:none!important;;label:outside;"),
|
|
25
|
+
outsideSide: {
|
|
26
|
+
// `transforms` pull in close buttons a little
|
|
27
|
+
// `!important` is necessary here to override the hover/focus transitions of buttons
|
|
28
|
+
right: /*#__PURE__*/css(logicalCSS('left', 0), " ", euiBreakpoint(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(-100% - ", euiTheme.size.l, "))!important;}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(-100% - ", euiTheme.size.xs, "))!important;};label:right;"),
|
|
29
|
+
left: /*#__PURE__*/css(logicalCSS('right', 0), " ", euiBreakpoint(euiThemeContext, ['m', 'xl']), "{transform:translateX(calc(100% + ", euiTheme.size.l, "))!important;}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{transform:translateX(calc(100% + ", euiTheme.size.xs, "))!important;};label:left;")
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export var euiFlyoutStyles = function euiFlyoutStyles(euiThemeContext) {
|
|
34
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
35
|
+
return {
|
|
36
|
+
euiFlyout: /*#__PURE__*/css("position:fixed;", logicalCSS('top', 0), " ", logicalCSS('bottom', 0), " ", logicalCSS('height', '100%'), " z-index:", euiTheme.levels.flyout, ";background:", euiTheme.colors.emptyShade, ";display:flex;flex-direction:column;align-items:stretch;&:focus{outline:none;}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{", logicalCSS('max-width', '90vw !important'), ";};label:euiFlyout;"),
|
|
37
|
+
// Flyout sizes
|
|
38
|
+
s: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 's'), ";;label:s;"),
|
|
39
|
+
m: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'm'), ";;label:m;"),
|
|
40
|
+
l: /*#__PURE__*/css(composeFlyoutSizing(euiThemeContext, 'l'), ";;label:l;"),
|
|
41
|
+
noMaxWidth: /*#__PURE__*/css(logicalCSS('max-width', 'none'), ";;label:noMaxWidth;"),
|
|
42
|
+
// Side
|
|
43
|
+
right: /*#__PURE__*/css("clip-path:polygon(-50% 0, 100% 0, 100% 100%, -50% 100%);", logicalCSS('right', 0), " ", euiCanAnimate, "{animation:", euiFlyoutSlideInRight, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";};label:right;"),
|
|
44
|
+
// Left-side flyouts should only be used for navigation
|
|
45
|
+
left: /*#__PURE__*/css(logicalCSS('left', 0), " clip-path:polygon(0 0, 150% 0, 150% 100%, 0 100%);", euiCanAnimate, "{animation:", euiFlyoutSlideInLeft, ";};label:left;"),
|
|
46
|
+
// Type
|
|
47
|
+
overlay: /*#__PURE__*/css(euiShadowXLarge(euiThemeContext), ";;label:overlay;"),
|
|
48
|
+
push: /*#__PURE__*/css("clip-path:none;animation-duration:0s!important;z-index:", Number(euiTheme.levels.flyout) - 1, ";;label:push;"),
|
|
49
|
+
pushSide: {
|
|
50
|
+
right: /*#__PURE__*/css(logicalCSS('border-left', euiTheme.border.thick), ";;label:right;"),
|
|
51
|
+
left: /*#__PURE__*/css(logicalCSS('border-right', euiTheme.border.thick), ";;label:left;")
|
|
52
|
+
},
|
|
53
|
+
// Padding
|
|
54
|
+
paddingSizes: {
|
|
55
|
+
none: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'none'), ";;label:none;"),
|
|
56
|
+
s: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 's'), ";;label:s;"),
|
|
57
|
+
m: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'm'), ";;label:m;"),
|
|
58
|
+
l: /*#__PURE__*/css(composeFlyoutPadding(euiThemeContext, 'l'), ";;label:l;")
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var composeFlyoutSizing = function composeFlyoutSizing(euiThemeContext, size) {
|
|
64
|
+
var euiTheme = euiThemeContext.euiTheme; // 1. Calculating the minimum width based on the screen takeover breakpoint
|
|
65
|
+
|
|
66
|
+
var flyoutSizes = {
|
|
67
|
+
s: {
|
|
68
|
+
min: "".concat(Math.round(euiTheme.breakpoint.m * 0.5), "px"),
|
|
69
|
+
// 1.
|
|
70
|
+
width: '25vw',
|
|
71
|
+
max: "".concat(Math.round(euiTheme.breakpoint.s * 0.7), "px")
|
|
72
|
+
},
|
|
73
|
+
m: {
|
|
74
|
+
// Calculated for forms plus padding
|
|
75
|
+
min: "".concat(mathWithUnits(euiFormMaxWidth(euiThemeContext), function (x) {
|
|
76
|
+
return x + 24;
|
|
77
|
+
})),
|
|
78
|
+
width: '50vw',
|
|
79
|
+
max: "".concat(euiTheme.breakpoint.m, "px")
|
|
80
|
+
},
|
|
81
|
+
l: {
|
|
82
|
+
min: "".concat(Math.round(euiTheme.breakpoint.m * 0.9), "px"),
|
|
83
|
+
// 1.
|
|
84
|
+
width: '75vw',
|
|
85
|
+
max: "".concat(euiTheme.breakpoint.l, "px")
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return "\n ".concat(logicalCSS('max-width', flyoutSizes[size].max), "\n\n ").concat(euiBreakpoint(euiThemeContext, ['m', 'xl']), " {\n ").concat(logicalCSS('min-width', flyoutSizes[size].min), "\n ").concat(logicalCSS('width', flyoutSizes[size].width), "\n }\n ").concat(euiBreakpoint(euiThemeContext, ['xs', 's']), " {\n ").concat(logicalCSS('min-width', 0), "\n ").concat(logicalCSS('width', flyoutSizes[size].min), "\n }\n ");
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
var composeFlyoutPadding = function composeFlyoutPadding(euiThemeContext, paddingSize) {
|
|
92
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
93
|
+
var paddingModifierMap = {
|
|
94
|
+
none: 0,
|
|
95
|
+
s: euiTheme.size.s,
|
|
96
|
+
m: euiTheme.size.base,
|
|
97
|
+
l: euiTheme.size.l
|
|
98
|
+
}; // Footer padding
|
|
99
|
+
|
|
100
|
+
var footerPaddingSizes = {
|
|
101
|
+
none: 0,
|
|
102
|
+
s: euiTheme.size.s,
|
|
103
|
+
m: "".concat(mathWithUnits(euiTheme.size.base, function (x) {
|
|
104
|
+
return x * 0.75;
|
|
105
|
+
}), " ").concat(euiTheme.size.base, ";"),
|
|
106
|
+
l: "".concat(mathWithUnits(euiTheme.size.l, function (x) {
|
|
107
|
+
return x / 1.5;
|
|
108
|
+
}), " ").concat(euiTheme.size.l, ";")
|
|
109
|
+
};
|
|
110
|
+
return "\n .euiFlyoutHeader {\n ".concat(logicalCSS('padding-horizontal', paddingModifierMap[paddingSize]), "\n ").concat(logicalCSS('padding-top', paddingModifierMap[paddingSize]), "\n }\n\n [class*='euiFlyoutHeader-hasBorder'] {\n ").concat(logicalCSS('padding-bottom', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutBody__overflowContent {\n padding: ").concat(paddingModifierMap[paddingSize], ";\n }\n\n .euiFlyoutBody__banner .euiCallOut {\n ").concat(logicalCSS('padding-horizontal', paddingModifierMap[paddingSize]), "\n }\n\n .euiFlyoutFooter {\n padding: ").concat(footerPaddingSizes[paddingSize], ";\n }\n ");
|
|
111
|
+
};
|
|
@@ -11,6 +11,8 @@ var _excluded = ["children", "className", "banner"];
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiTheme } from '../../services';
|
|
15
|
+
import { euiFlyoutBodyStyles } from './flyout_body.styles';
|
|
14
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
17
|
export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
|
|
16
18
|
var children = _ref.children,
|
|
@@ -19,16 +21,22 @@ export var EuiFlyoutBody = function EuiFlyoutBody(_ref) {
|
|
|
19
21
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
22
|
|
|
21
23
|
var classes = classNames('euiFlyoutBody', className);
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
var euiTheme = useEuiTheme();
|
|
25
|
+
var styles = euiFlyoutBodyStyles(euiTheme);
|
|
26
|
+
var cssStyles = [styles.euiFlyoutBody];
|
|
27
|
+
var bannerCssStyles = [banner && styles.euiFlyoutBody__banner];
|
|
28
|
+
var overflowCssStyles = [banner ? styles.euiFlyoutBody__overflow.hasBanner : styles.euiFlyoutBody__overflow.noBanner];
|
|
25
29
|
return ___EmotionJSX("div", _extends({
|
|
26
30
|
className: classes
|
|
27
|
-
}, rest
|
|
31
|
+
}, rest, {
|
|
32
|
+
css: cssStyles
|
|
33
|
+
}), ___EmotionJSX("div", {
|
|
28
34
|
tabIndex: 0,
|
|
29
|
-
className:
|
|
35
|
+
className: "euiFlyoutBody__overflow",
|
|
36
|
+
css: overflowCssStyles
|
|
30
37
|
}, banner && ___EmotionJSX("div", {
|
|
31
|
-
className: "euiFlyoutBody__banner"
|
|
38
|
+
className: "euiFlyoutBody__banner",
|
|
39
|
+
css: bannerCssStyles
|
|
32
40
|
}, banner), ___EmotionJSX("div", {
|
|
33
41
|
className: "euiFlyoutBody__overflowContent"
|
|
34
42
|
}, children)));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { css } from '@emotion/react';
|
|
9
|
+
import { logicalCSS, logicalCSSWithFallback, euiYScrollWithShadows } from '../../global_styling';
|
|
10
|
+
export var euiFlyoutBodyStyles = function euiFlyoutBodyStyles(euiThemeContext) {
|
|
11
|
+
return {
|
|
12
|
+
euiFlyoutBody: /*#__PURE__*/css(logicalCSSWithFallback('overflow-y', 'hidden'), " ", logicalCSS('height', '100%'), ";;label:euiFlyoutBody;"),
|
|
13
|
+
euiFlyoutBody__overflow: {
|
|
14
|
+
noBanner: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext), ";;label:noBanner;"),
|
|
15
|
+
hasBanner: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext, {
|
|
16
|
+
side: 'end'
|
|
17
|
+
}), ";;label:hasBanner;")
|
|
18
|
+
},
|
|
19
|
+
euiFlyoutBody__banner: /*#__PURE__*/css(logicalCSSWithFallback('overflow-x', 'hidden'), ";;label:euiFlyoutBody__banner;")
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -11,6 +11,8 @@ var _excluded = ["children", "className"];
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiTheme } from '../../services';
|
|
15
|
+
import { euiFlyoutFooterStyles } from './flyout_footer.styles';
|
|
14
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
17
|
export var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
|
|
16
18
|
var children = _ref.children,
|
|
@@ -18,7 +20,12 @@ export var EuiFlyoutFooter = function EuiFlyoutFooter(_ref) {
|
|
|
18
20
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
21
|
|
|
20
22
|
var classes = classNames('euiFlyoutFooter', className);
|
|
23
|
+
var euiTheme = useEuiTheme();
|
|
24
|
+
var styles = euiFlyoutFooterStyles(euiTheme);
|
|
25
|
+
var cssStyles = [styles.euiFlyoutFooter];
|
|
21
26
|
return ___EmotionJSX("div", _extends({
|
|
22
27
|
className: classes
|
|
23
|
-
}, rest
|
|
28
|
+
}, rest, {
|
|
29
|
+
css: cssStyles
|
|
30
|
+
}), children);
|
|
24
31
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
4
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
5
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
6
|
+
* Side Public License, v 1.
|
|
7
|
+
*/
|
|
8
|
+
import { css } from '@emotion/react';
|
|
9
|
+
export var euiFlyoutFooterStyles = function euiFlyoutFooterStyles(euiThemeContext) {
|
|
10
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
11
|
+
return {
|
|
12
|
+
euiFlyoutFooter: /*#__PURE__*/css("background-color:", euiTheme.colors.lightestShade, ";flex-grow:0;;label:euiFlyoutFooter;")
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -11,6 +11,8 @@ var _excluded = ["children", "className", "hasBorder"];
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
+
import { useEuiTheme } from '../../services';
|
|
15
|
+
import { euiFlyoutHeaderStyles } from './flyout_header.styles';
|
|
14
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
17
|
export var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
|
|
16
18
|
var children = _ref.children,
|
|
@@ -19,10 +21,13 @@ export var EuiFlyoutHeader = function EuiFlyoutHeader(_ref) {
|
|
|
19
21
|
hasBorder = _ref$hasBorder === void 0 ? false : _ref$hasBorder,
|
|
20
22
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
23
|
|
|
22
|
-
var classes = classNames('euiFlyoutHeader',
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
var classes = classNames('euiFlyoutHeader', className);
|
|
25
|
+
var euiTheme = useEuiTheme();
|
|
26
|
+
var styles = euiFlyoutHeaderStyles(euiTheme);
|
|
27
|
+
var cssStyles = [styles.euiFlyoutHeader, hasBorder && styles.hasBorder];
|
|
25
28
|
return ___EmotionJSX("div", _extends({
|
|
26
29
|
className: classes
|
|
27
|
-
}, rest
|
|
30
|
+
}, rest, {
|
|
31
|
+
css: cssStyles
|
|
32
|
+
}), children);
|
|
28
33
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
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)."; }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { logicalCSS } from '../../global_styling';
|
|
12
|
+
|
|
13
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "1hivny1-euiFlyoutHeader",
|
|
15
|
+
styles: "flex-grow:0;label:euiFlyoutHeader;"
|
|
16
|
+
} : {
|
|
17
|
+
name: "1hivny1-euiFlyoutHeader",
|
|
18
|
+
styles: "flex-grow:0;label:euiFlyoutHeader;",
|
|
19
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export var euiFlyoutHeaderStyles = function euiFlyoutHeaderStyles(euiThemeContext) {
|
|
23
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
24
|
+
return {
|
|
25
|
+
euiFlyoutHeader: _ref,
|
|
26
|
+
hasBorder: /*#__PURE__*/css(logicalCSS('border-bottom', euiTheme.border.thin), ";;label:hasBorder;")
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -44,10 +44,10 @@ export var EuiImageWrapper = function EuiImageWrapper(_ref) {
|
|
|
44
44
|
optionalCaptionText = _useInnerText2[1];
|
|
45
45
|
|
|
46
46
|
return ___EmotionJSX("figure", _extends({
|
|
47
|
-
"aria-label": optionalCaptionText
|
|
48
|
-
}, wrapperProps, {
|
|
49
|
-
className: classes,
|
|
47
|
+
"aria-label": optionalCaptionText,
|
|
50
48
|
css: cssFigureStyles
|
|
49
|
+
}, wrapperProps, {
|
|
50
|
+
className: classes
|
|
51
51
|
}), allowFullScreen ? ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiImageButton, {
|
|
52
52
|
hasAlt: !!alt,
|
|
53
53
|
hasShadow: hasShadow,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalCSS, euiFontSize } from '../../global_styling';
|
|
9
|
+
import { logicalCSS, euiFontSize, mathWithUnits } from '../../global_styling';
|
|
10
10
|
/**
|
|
11
11
|
* Mixins
|
|
12
12
|
*/
|
|
@@ -20,11 +20,16 @@ var euiScaleMarkdownFormatText = function euiScaleMarkdownFormatText(euiTheme, o
|
|
|
20
20
|
var measurement = options.measurement;
|
|
21
21
|
var lineHeightSize = measurement === 'em' ? "".concat(lineHeight, "em") : lineHeight; // Custom scales
|
|
22
22
|
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
23
|
+
var blockQuoteBorderWidth = mathWithUnits(fontSize, function (x) {
|
|
24
|
+
return x / 4;
|
|
25
|
+
});
|
|
26
|
+
var tablePaddingVertical = mathWithUnits(fontSize, function (x) {
|
|
27
|
+
return x / 4;
|
|
28
|
+
});
|
|
29
|
+
var tablePaddingHorizontal = mathWithUnits(fontSize, function (x) {
|
|
30
|
+
return x / 2;
|
|
31
|
+
});
|
|
32
|
+
return "\n .euiMarkdownFormat__blockquote {\n padding: 0 ".concat(fontSize, ";\n ").concat(logicalCSS('border-left-width', blockQuoteBorderWidth), "\n ").concat(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(logicalCSS('padding-left', lineHeightSize), "\n line-height: ").concat(lineHeight, ";\n }\n\n .euiCheckbox + *:not(.euiCheckbox) {\n ").concat(logicalCSS('margin-top', fontSize), "\n }\n\n .euiMarkdownFormat__codeblockWrapper {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table {\n ").concat(logicalCSS('margin-bottom', fontSize), "\n }\n\n .euiMarkdownFormat__table th,\n .euiMarkdownFormat__table td {\n ").concat(logicalCSS('padding-vertical', tablePaddingVertical), "\n ").concat(logicalCSS('padding-horizontal', tablePaddingHorizontal), "\n }\n ");
|
|
28
33
|
};
|
|
29
34
|
/**
|
|
30
35
|
* Styles
|
|
@@ -42,9 +42,8 @@ export var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
|
|
|
42
42
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
43
|
|
|
44
44
|
var classes = classNames('euiNotificationEvent', {
|
|
45
|
-
'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
|
|
46
|
-
|
|
47
|
-
});
|
|
45
|
+
'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
|
|
46
|
+
}, className);
|
|
48
47
|
var classesTitle = classNames('euiNotificationEvent__title', {
|
|
49
48
|
'euiNotificationEvent__title--isRead': isRead
|
|
50
49
|
});
|
|
@@ -54,7 +54,7 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
|
|
|
54
54
|
|
|
55
55
|
var isResponsiveBreakpoint = useIsWithinBreakpoints(['xs', 's'], !!responsive);
|
|
56
56
|
var useTheme = useEuiTheme();
|
|
57
|
-
var classes = classNames('euiPageHeaderContent');
|
|
57
|
+
var classes = classNames('euiPageHeaderContent', className);
|
|
58
58
|
var pageHeaderStyles = euiPageHeaderStyles(useTheme);
|
|
59
59
|
var contentStyles = euiPageHeaderContentStyles(useTheme);
|
|
60
60
|
var styles = setStyleForRestrictedPageWidth(restrictWidth, style);
|
|
@@ -42,12 +42,11 @@ export var EuiPageSection = function EuiPageSection(_ref) {
|
|
|
42
42
|
var colors = useEuiBackgroundColorCSS();
|
|
43
43
|
var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
|
|
44
44
|
var contentStyles = euiPageSectionContentStyles();
|
|
45
|
-
var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
|
|
45
|
+
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];
|
|
46
46
|
return ___EmotionJSX(Component, _extends({
|
|
47
47
|
css: cssStyles
|
|
48
|
-
}, rest), ___EmotionJSX("div", _extends({
|
|
49
|
-
css: cssContentStyles
|
|
50
|
-
}, contentProps, {
|
|
48
|
+
}, rest), ___EmotionJSX("div", _extends({}, contentProps, {
|
|
49
|
+
css: cssContentStyles,
|
|
51
50
|
style: widthStyles
|
|
52
51
|
}), children));
|
|
53
52
|
};
|
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalCSS, logicalTextAlignCSS, euiFontSize } from '../../global_styling';
|
|
9
|
+
import { logicalCSS, logicalTextAlignCSS, mathWithUnits, euiFontSize } from '../../global_styling';
|
|
10
10
|
import { euiButtonEmptyColor } from '../../themes/amsterdam/global_styling/mixins';
|
|
11
11
|
export var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThemeContext) {
|
|
12
12
|
var euiTheme = euiThemeContext.euiTheme;
|
|
13
13
|
var fontSizeS = euiFontSize(euiThemeContext, 's');
|
|
14
|
-
var halfSizeM =
|
|
14
|
+
var halfSizeM = mathWithUnits(euiTheme.size.m, function (x) {
|
|
15
|
+
return x / 2;
|
|
16
|
+
});
|
|
15
17
|
var disabled = euiButtonEmptyColor(euiThemeContext, 'disabled'); // && to increase specificity. Can likely be removed once EuiButtonEmpty has been converted.
|
|
16
18
|
|
|
17
19
|
return {
|
|
@@ -19,7 +21,7 @@ export var euiPaginationButtonStyles = function euiPaginationButtonStyles(euiThe
|
|
|
19
21
|
euiPaginationButton: /*#__PURE__*/css("&&{", fontSizeS, ";padding:0;", logicalTextAlignCSS('center'), " border-radius:", euiTheme.border.radius.medium, ";outline-offset:-", euiTheme.focus.width, ";};label:euiPaginationButton;"),
|
|
20
22
|
// States
|
|
21
23
|
isActive: /*#__PURE__*/css("&&{font-weight:", euiTheme.font.weight.bold, ";color:", euiTheme.colors.primary, ";.euiButtonEmpty__content{cursor:default;}&&,&&:hover{text-decoration:underline;}};label:isActive;"),
|
|
22
|
-
isPlaceholder: /*#__PURE__*/css("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", logicalCSS('padding-top',
|
|
24
|
+
isPlaceholder: /*#__PURE__*/css("&&{align-items:baseline;color:", disabled.color, ";", fontSizeS, ";", logicalCSS('padding-top', halfSizeM), ";", logicalCSS('padding-bottom', 0), ";", logicalCSS('padding-horizontal', euiTheme.size.s), ";", logicalCSS('height', euiTheme.size.l), ";};label:isPlaceholder;")
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
export var euiPaginationButtonArrowStyles = function euiPaginationButtonArrowStyles(_ref) {
|
|
@@ -79,9 +79,9 @@ export var EuiProgress = function EuiProgress(_ref) {
|
|
|
79
79
|
}, label && ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
|
|
80
80
|
return ___EmotionJSX("span", _extends({
|
|
81
81
|
title: innerText,
|
|
82
|
-
ref: ref
|
|
82
|
+
ref: ref,
|
|
83
|
+
css: labelCssStyles
|
|
83
84
|
}, labelProps, {
|
|
84
|
-
css: labelCssStyles,
|
|
85
85
|
className: labelClasses
|
|
86
86
|
}), label);
|
|
87
87
|
}), valueRender && ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
|
-
import { logicalCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor } from '../../global_styling';
|
|
9
|
+
import { logicalCSS, logicalTextAlignCSS, euiFontSize, euiBackgroundColor, mathWithUnits } from '../../global_styling';
|
|
10
10
|
import { euiLinkCSS } from '../link/link.styles';
|
|
11
11
|
import { euiTitle } from '../title/title.styles';
|
|
12
12
|
/**
|
|
@@ -45,8 +45,11 @@ var euiScaleText = function euiScaleText(euiThemeContext, options) {
|
|
|
45
45
|
}; // Generate margins for headings based on customScale (not on heading level)
|
|
46
46
|
|
|
47
47
|
var customScale = _customScale === 'xxxs' ? 'xxs' : _customScale || 'm';
|
|
48
|
-
var
|
|
49
|
-
var
|
|
48
|
+
var marginSize = euiTheme.size[customScale];
|
|
49
|
+
var headingMarginTop = mathWithUnits(marginSize, function (x) {
|
|
50
|
+
return x * 2;
|
|
51
|
+
});
|
|
52
|
+
var headingMarginBottom = marginSize;
|
|
50
53
|
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(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(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(logicalCSS('margin-top', headingMarginTop), "\n }\n\n &:not(:last-child) {\n ").concat(logicalCSS('margin-bottom', headingMarginBottom), "\n }\n }\n\n p,\n ul,\n ol,\n dl,\n blockquote,\n img,\n pre {\n ").concat(logicalCSS('margin-bottom', lineHeightSize), "\n }\n\n ul,\n ol {\n ").concat(logicalCSS('margin-left', lineHeightSize), "\n }\n \n blockquote {\n font-size: ").concat(fontSize, ";\n padding: ").concat(lineHeightSize, ";\n }\n\n dd + dt {\n ").concat(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(euiFontSize(euiThemeContext, 'xs', options).fontSize, ";\n color: ").concat(euiTheme.colors.text, ";\n }\n\n small {\n font-size: ").concat(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
|
|
51
54
|
_customScale === 'm' ? "\n kbd {\n ".concat(logicalCSS('padding-bottom', euiTheme.size.xs), "\n // ensures when only one character the shape looks like a square\n ").concat(logicalCSS('min-width', euiTheme.size.l), "\n ").concat(logicalTextAlignCSS('center'), "\n }\n \n kbd::after {\n content: '';\n ").concat(logicalCSS('border-bottom', "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.text)), "\n position: absolute;\n ").concat(logicalCSS('bottom', euiTheme.size.xxs), "\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('width', '100%'), "\n }") : '', "\n ");
|
|
52
55
|
};
|
|
@@ -12,7 +12,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
12
12
|
* Side Public License, v 1.
|
|
13
13
|
*/
|
|
14
14
|
import { css, keyframes } from '@emotion/react';
|
|
15
|
-
import { logicalCSS, logicalSizeCSS, euiFontSize } from '../../global_styling';
|
|
15
|
+
import { logicalCSS, logicalSizeCSS, euiFontSize, mathWithUnits } from '../../global_styling';
|
|
16
16
|
import { COLOR_MODES_STANDARD, tint, shade } from '../../services';
|
|
17
17
|
import { euiShadow } from '../../themes/amsterdam';
|
|
18
18
|
export var euiToolTipBackgroundColor = function euiToolTipBackgroundColor(euiTheme, colorMode) {
|
|
@@ -39,12 +39,13 @@ export var euiToolTipStyles = function euiToolTipStyles(euiThemeContext) {
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
var arrowSize = euiTheme.size.m;
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
var arrowPlusSize = mathWithUnits(arrowSize, function (x) {
|
|
43
|
+
return (x / 2 + 1) * -1;
|
|
44
|
+
}); // 1.
|
|
45
45
|
|
|
46
|
-
var arrowMinusSize =
|
|
47
|
-
|
|
46
|
+
var arrowMinusSize = mathWithUnits(arrowSize, function (x) {
|
|
47
|
+
return (x / 2 - 1) * -1;
|
|
48
|
+
}); // 1.
|
|
48
49
|
|
|
49
50
|
return {
|
|
50
51
|
// Base
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { css } from '@emotion/react';
|
|
9
9
|
import { shade, tint, COLOR_MODES_STANDARD } from '../../services';
|
|
10
|
-
import { logicalCSS } from '../../global_styling';
|
|
10
|
+
import { logicalCSS, mathWithUnits } from '../../global_styling';
|
|
11
11
|
import { openAnimationTiming } from '../popover/popover_panel/_popover_panel.styles';
|
|
12
12
|
import { popoverArrowSize } from '../popover/popover_arrow/_popover_arrow.styles';
|
|
13
13
|
|
|
@@ -26,15 +26,20 @@ export var euiTourStyles = function euiTourStyles(_ref) {
|
|
|
26
26
|
export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
27
27
|
var euiTheme = _ref2.euiTheme;
|
|
28
28
|
var arrowSize = euiTheme.size[popoverArrowSize];
|
|
29
|
-
var
|
|
29
|
+
var arrowHalfSize = mathWithUnits(arrowSize, function (x) {
|
|
30
|
+
return x / 2;
|
|
31
|
+
});
|
|
32
|
+
var arrowOffset = mathWithUnits(arrowSize, function (x) {
|
|
33
|
+
return x * -2;
|
|
34
|
+
});
|
|
30
35
|
return {
|
|
31
36
|
// Base
|
|
32
37
|
euiTourBeacon: /*#__PURE__*/css("pointer-events:none;position:absolute;opacity:0;transition:opacity 0s ", euiTheme.animation[openAnimationTiming], ";;label:euiTourBeacon;"),
|
|
33
38
|
// Positions
|
|
34
|
-
right: /*#__PURE__*/css(logicalCSS('top',
|
|
35
|
-
left: /*#__PURE__*/css(logicalCSS('top',
|
|
36
|
-
top: /*#__PURE__*/css(logicalCSS('top', arrowSize), ";", logicalCSS('left',
|
|
37
|
-
bottom: /*#__PURE__*/css(logicalCSS('top',
|
|
39
|
+
right: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowOffset), ";;label:right;"),
|
|
40
|
+
left: /*#__PURE__*/css(logicalCSS('top', arrowHalfSize), ";", logicalCSS('left', arrowSize), ";;label:left;"),
|
|
41
|
+
top: /*#__PURE__*/css(logicalCSS('top', arrowSize), ";", logicalCSS('left', arrowHalfSize), ";;label:top;"),
|
|
42
|
+
bottom: /*#__PURE__*/css(logicalCSS('top', arrowOffset), ";", logicalCSS('left', arrowHalfSize), ";;label:bottom;")
|
|
38
43
|
};
|
|
39
44
|
};
|
|
40
45
|
export var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
|
+
import _setPrototypeOf from "@babel/runtime/helpers/setPrototypeOf";
|
|
4
|
+
|
|
5
|
+
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); }
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Utility for performing math callbacks on a string with CSS units
|
|
17
|
+
* and returning a string with its unit preserved.
|
|
18
|
+
*
|
|
19
|
+
* Example usage:
|
|
20
|
+
* mathWithUnits('4px', (x) => x / 2) = '2px';
|
|
21
|
+
* mathWithUnits(euiTheme.size.xs, (x) => x + 2) = '6px';
|
|
22
|
+
*/
|
|
23
|
+
export var mathWithUnits = function mathWithUnits(value, callback) {
|
|
24
|
+
var unit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
25
|
+
|
|
26
|
+
if (typeof value === 'string') {
|
|
27
|
+
var _matches$groups;
|
|
28
|
+
|
|
29
|
+
var regex = /*#__PURE__*/_wrapRegExp(/(\x2D?[\.0-9]+)(%|[A-Za-z]*)/, {
|
|
30
|
+
value: 1,
|
|
31
|
+
unit: 2
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var matches = regex.exec(value);
|
|
35
|
+
if (!(matches !== null && matches !== void 0 && (_matches$groups = matches.groups) !== null && _matches$groups !== void 0 && _matches$groups.value)) return value;
|
|
36
|
+
var numericValue = Number(matches.groups.value);
|
|
37
|
+
var passedUnit = matches.groups.unit || unit;
|
|
38
|
+
return "".concat(callback(numericValue)).concat(passedUnit);
|
|
39
|
+
} else if (typeof value === 'number') {
|
|
40
|
+
return "".concat(callback(value)).concat(unit);
|
|
41
|
+
} else {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -100,12 +100,15 @@ export var useEuiYScroll = function useEuiYScroll() {
|
|
|
100
100
|
};
|
|
101
101
|
export var euiYScrollWithShadows = function euiYScrollWithShadows(euiTheme) {
|
|
102
102
|
var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
103
|
-
height = _ref7.height
|
|
103
|
+
height = _ref7.height,
|
|
104
|
+
_ref7$side = _ref7.side,
|
|
105
|
+
side = _ref7$side === void 0 ? 'both' : _ref7$side;
|
|
104
106
|
|
|
105
107
|
return "\n ".concat(euiYScroll(euiTheme, {
|
|
106
108
|
height: height
|
|
107
109
|
}), "\n ").concat(euiOverflowShadowStyles(euiTheme, {
|
|
108
|
-
direction: 'y'
|
|
110
|
+
direction: 'y',
|
|
111
|
+
side: side
|
|
109
112
|
}), "\n");
|
|
110
113
|
};
|
|
111
114
|
export var useEuiYScrollWithShadows = function useEuiYScrollWithShadows() {
|
|
@@ -211,10 +211,10 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
211
211
|
|
|
212
212
|
if (_arrowDisplay !== 'none') {
|
|
213
213
|
iconButton = (0, _react2.jsx)(_button.EuiButtonIcon, (0, _extends2.default)({
|
|
214
|
-
color: "text"
|
|
214
|
+
color: "text",
|
|
215
|
+
css: cssIconButtonStyles
|
|
215
216
|
}, arrowProps, {
|
|
216
217
|
className: iconButtonClasses,
|
|
217
|
-
css: cssIconButtonStyles,
|
|
218
218
|
iconType: "arrowRight",
|
|
219
219
|
onClick: this.onToggle,
|
|
220
220
|
"aria-controls": id,
|
|
@@ -250,10 +250,11 @@ var EuiAccordionClass = /*#__PURE__*/function (_Component) {
|
|
|
250
250
|
childrenContent = children;
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
var button = (0, _react2.jsx)(ButtonElement, (0, _extends2.default)({
|
|
253
|
+
var button = (0, _react2.jsx)(ButtonElement, (0, _extends2.default)({
|
|
254
|
+
css: cssButtonStyles
|
|
255
|
+
}, buttonProps, {
|
|
254
256
|
id: buttonId,
|
|
255
257
|
className: buttonClasses,
|
|
256
|
-
css: cssButtonStyles,
|
|
257
258
|
"aria-controls": id,
|
|
258
259
|
"aria-expanded": isOpen,
|
|
259
260
|
onClick: isDisabled ? undefined : this.onToggle,
|
|
@@ -50,7 +50,7 @@ exports.euiAccordionChildrenStyles = euiAccordionChildrenStyles;
|
|
|
50
50
|
var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
|
|
51
51
|
var euiTheme = _ref6.euiTheme;
|
|
52
52
|
return {
|
|
53
|
-
euiAccordion__childWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 0), " opacity:0;overflow:hidden;transition:", _global_styling.logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden
|
|
53
|
+
euiAccordion__childWrapper: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 0), " opacity:0;overflow:hidden;transition:", _global_styling.logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
|
|
54
54
|
isOpen: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
|
|
55
55
|
};
|
|
56
56
|
};
|