@elastic/eui 92.2.1 → 93.0.0
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 -200
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -200
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +0 -9
- package/es/components/basic_table/in_memory_table.js +0 -10
- package/es/components/beacon/beacon.js +9 -6
- package/es/components/breadcrumbs/breadcrumb.js +0 -10
- package/es/components/breadcrumbs/breadcrumbs.js +0 -10
- package/es/components/code/code.js +2 -2
- package/es/components/code/code.styles.js +2 -4
- package/es/components/code/code_block.js +5 -3
- package/es/components/code/code_block.styles.js +4 -7
- package/es/components/code/code_block_controls.js +2 -2
- package/es/components/code/code_block_controls.styles.js +2 -4
- package/es/components/code/code_block_full_screen.js +2 -2
- package/es/components/code/code_syntax.styles.js +39 -34
- package/es/components/comment_list/comment_event.js +3 -2
- package/es/components/comment_list/comment_event.styles.js +2 -18
- package/es/components/context_menu/context_menu.js +2 -6
- package/es/components/context_menu/context_menu_item.js +2 -14
- package/es/components/empty_prompt/empty_prompt.js +62 -65
- package/es/components/empty_prompt/empty_prompt.styles.js +115 -0
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +0 -10
- package/es/components/header/header_links/header_links.js +0 -10
- package/es/components/page/page_header/page_header_content.js +0 -10
- package/es/components/popover/popover.js +3 -15
- package/es/components/search_bar/search_bar.js +36 -32
- package/es/components/search_bar/search_bar.styles.js +22 -0
- package/es/components/text_truncate/text_truncate.js +4 -1
- package/es/components/tour/_tour_footer.js +97 -0
- package/es/components/tour/_tour_footer.styles.js +23 -0
- package/es/components/tour/_tour_header.js +37 -0
- package/es/components/tour/_tour_header.styles.js +20 -0
- package/es/components/tour/tour.styles.js +5 -28
- package/es/components/tour/tour_step.js +45 -130
- package/es/global_styling/mixins/_color.js +46 -13
- package/eui.d.ts +125 -63
- package/i18ntokens.json +94 -94
- package/lib/components/basic_table/basic_table.js +0 -9
- package/lib/components/basic_table/in_memory_table.js +0 -10
- package/lib/components/beacon/beacon.js +11 -6
- package/lib/components/breadcrumbs/breadcrumb.js +0 -10
- package/lib/components/code/code.js +2 -2
- package/lib/components/code/code.styles.js +2 -4
- package/lib/components/code/code_block.js +5 -3
- package/lib/components/code/code_block.styles.js +4 -7
- package/lib/components/code/code_block_controls.js +2 -2
- package/lib/components/code/code_block_controls.styles.js +2 -4
- package/lib/components/code/code_block_full_screen.js +2 -2
- package/lib/components/code/code_syntax.styles.js +40 -36
- package/lib/components/comment_list/comment_event.js +2 -1
- package/lib/components/comment_list/comment_event.styles.js +3 -20
- package/lib/components/context_menu/context_menu.js +2 -6
- package/lib/components/context_menu/context_menu_item.js +2 -14
- package/lib/components/empty_prompt/empty_prompt.js +64 -64
- package/lib/components/empty_prompt/empty_prompt.styles.js +120 -0
- package/lib/components/popover/popover.js +3 -15
- package/lib/components/search_bar/search_bar.js +37 -33
- package/lib/components/search_bar/search_bar.styles.js +30 -0
- package/lib/components/text_truncate/text_truncate.js +4 -1
- package/lib/components/tour/_tour_footer.js +105 -0
- package/lib/components/tour/_tour_footer.styles.js +31 -0
- package/lib/components/tour/_tour_header.js +48 -0
- package/lib/components/tour/_tour_header.styles.js +27 -0
- package/lib/components/tour/tour.styles.js +7 -32
- package/lib/components/tour/tour_step.js +42 -117
- package/lib/global_styling/mixins/_color.js +50 -15
- package/optimize/es/components/basic_table/basic_table.js +0 -9
- package/optimize/es/components/basic_table/in_memory_table.js +0 -10
- package/optimize/es/components/beacon/beacon.js +9 -6
- package/optimize/es/components/code/code.js +2 -2
- package/optimize/es/components/code/code.styles.js +2 -4
- package/optimize/es/components/code/code_block.js +5 -3
- package/optimize/es/components/code/code_block.styles.js +4 -7
- package/optimize/es/components/code/code_block_controls.js +2 -2
- package/optimize/es/components/code/code_block_controls.styles.js +2 -4
- package/optimize/es/components/code/code_block_full_screen.js +2 -2
- package/optimize/es/components/code/code_syntax.styles.js +39 -34
- package/optimize/es/components/comment_list/comment_event.js +3 -2
- package/optimize/es/components/comment_list/comment_event.styles.js +2 -18
- package/optimize/es/components/context_menu/context_menu.js +2 -6
- package/optimize/es/components/context_menu/context_menu_item.js +2 -6
- package/optimize/es/components/empty_prompt/empty_prompt.js +62 -62
- package/optimize/es/components/empty_prompt/empty_prompt.styles.js +112 -0
- package/optimize/es/components/popover/popover.js +3 -5
- package/optimize/es/components/search_bar/search_bar.js +36 -32
- package/optimize/es/components/search_bar/search_bar.styles.js +22 -0
- package/optimize/es/components/text_truncate/text_truncate.js +4 -1
- package/optimize/es/components/tour/_tour_footer.js +89 -0
- package/optimize/es/components/tour/_tour_footer.styles.js +23 -0
- package/optimize/es/components/tour/_tour_header.js +33 -0
- package/optimize/es/components/tour/_tour_header.styles.js +20 -0
- package/optimize/es/components/tour/tour.styles.js +5 -28
- package/optimize/es/components/tour/tour_step.js +45 -113
- package/optimize/es/global_styling/mixins/_color.js +46 -13
- package/optimize/lib/components/basic_table/basic_table.js +0 -9
- package/optimize/lib/components/basic_table/in_memory_table.js +0 -10
- package/optimize/lib/components/beacon/beacon.js +12 -6
- package/optimize/lib/components/code/code.js +2 -2
- package/optimize/lib/components/code/code.styles.js +2 -4
- package/optimize/lib/components/code/code_block.js +5 -3
- package/optimize/lib/components/code/code_block.styles.js +4 -7
- package/optimize/lib/components/code/code_block_controls.js +2 -2
- package/optimize/lib/components/code/code_block_controls.styles.js +2 -4
- package/optimize/lib/components/code/code_block_full_screen.js +2 -2
- package/optimize/lib/components/code/code_syntax.styles.js +40 -36
- package/optimize/lib/components/comment_list/comment_event.js +2 -1
- package/optimize/lib/components/comment_list/comment_event.styles.js +3 -20
- package/optimize/lib/components/context_menu/context_menu.js +2 -6
- package/optimize/lib/components/context_menu/context_menu_item.js +2 -6
- package/optimize/lib/components/empty_prompt/empty_prompt.js +65 -62
- package/optimize/lib/components/empty_prompt/empty_prompt.styles.js +118 -0
- package/optimize/lib/components/popover/popover.js +3 -5
- package/optimize/lib/components/search_bar/search_bar.js +37 -33
- package/optimize/lib/components/search_bar/search_bar.styles.js +30 -0
- package/optimize/lib/components/text_truncate/text_truncate.js +4 -1
- package/optimize/lib/components/tour/_tour_footer.js +100 -0
- package/optimize/lib/components/tour/_tour_footer.styles.js +31 -0
- package/optimize/lib/components/tour/_tour_header.js +43 -0
- package/optimize/lib/components/tour/_tour_header.styles.js +27 -0
- package/optimize/lib/components/tour/tour.styles.js +7 -32
- package/optimize/lib/components/tour/tour_step.js +42 -110
- package/optimize/lib/global_styling/mixins/_color.js +50 -15
- package/package.json +1 -1
- package/src/components/index.scss +0 -2
- package/test-env/components/basic_table/basic_table.js +0 -9
- package/test-env/components/basic_table/in_memory_table.js +0 -10
- package/test-env/components/beacon/beacon.js +12 -6
- package/test-env/components/breadcrumbs/breadcrumb.js +0 -10
- package/test-env/components/code/code.styles.js +2 -4
- package/test-env/components/code/code_block.styles.js +4 -7
- package/test-env/components/code/code_block_controls.js +2 -2
- package/test-env/components/code/code_block_controls.styles.js +2 -4
- package/test-env/components/code/code_block_full_screen.js +2 -2
- package/test-env/components/code/code_syntax.styles.js +40 -36
- package/test-env/components/comment_list/comment_event.js +2 -1
- package/test-env/components/comment_list/comment_event.styles.js +3 -20
- package/test-env/components/context_menu/context_menu.js +2 -6
- package/test-env/components/context_menu/context_menu_item.js +2 -14
- package/test-env/components/empty_prompt/empty_prompt.js +65 -62
- package/test-env/components/empty_prompt/empty_prompt.styles.js +118 -0
- package/test-env/components/popover/popover.js +3 -15
- package/test-env/components/search_bar/search_bar.js +37 -33
- package/test-env/components/search_bar/search_bar.styles.js +30 -0
- package/test-env/components/text_truncate/text_truncate.js +4 -1
- package/test-env/components/tour/_tour_footer.js +100 -0
- package/test-env/components/tour/_tour_footer.styles.js +31 -0
- package/test-env/components/tour/_tour_header.js +48 -0
- package/test-env/components/tour/_tour_header.styles.js +27 -0
- package/test-env/components/tour/tour.styles.js +7 -32
- package/test-env/components/tour/tour_step.js +42 -114
- package/test-env/global_styling/mixins/_color.js +50 -15
- package/src/components/empty_prompt/_empty_prompt.scss +0 -128
- package/src/components/empty_prompt/_index.scss +0 -1
- package/src/components/search_bar/_index.scss +0 -1
- package/src/components/search_bar/_search_bar.scss +0 -10
|
@@ -24,6 +24,7 @@ import { useFullScreen, EuiCodeBlockFullScreenWrapper } from './code_block_full_
|
|
|
24
24
|
import { EuiCodeBlockControls } from './code_block_controls';
|
|
25
25
|
import { EuiCodeBlockVirtualized } from './code_block_virtualized';
|
|
26
26
|
import { euiCodeBlockStyles, euiCodeBlockPreStyles, euiCodeBlockCodeStyles } from './code_block.styles';
|
|
27
|
+
import { useEuiCodeSyntaxVariables } from './code_syntax.styles';
|
|
27
28
|
|
|
28
29
|
// Based on observed line height for non-virtualized code blocks
|
|
29
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
@@ -58,6 +59,7 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
58
59
|
lineNumbers = _ref$lineNumbers === void 0 ? false : _ref$lineNumbers,
|
|
59
60
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
60
61
|
var euiTheme = useEuiTheme();
|
|
62
|
+
var euiCodeSyntaxVariables = useEuiCodeSyntaxVariables();
|
|
61
63
|
var language = useMemo(function () {
|
|
62
64
|
return checkSupportedLanguage(_language);
|
|
63
65
|
}, [_language]);
|
|
@@ -109,7 +111,7 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
109
111
|
onKeyDown = _useFullScreen.onKeyDown;
|
|
110
112
|
var hasControls = !!(copyButton || fullScreenButton);
|
|
111
113
|
var hasBothControls = !!(copyButton && fullScreenButton);
|
|
112
|
-
var styles = euiCodeBlockStyles(euiTheme);
|
|
114
|
+
var styles = euiCodeBlockStyles(euiTheme, euiCodeSyntaxVariables);
|
|
113
115
|
var cssStyles = [styles.euiCodeBlock, styles[fontSize], transparentBackground && styles.transparentBackground, hasControls && (hasBothControls ? styles.hasBothControls[paddingSize] : styles.hasControls[paddingSize])];
|
|
114
116
|
var _useMemo = useMemo(function () {
|
|
115
117
|
var isWhiteSpacePre = whiteSpace === 'pre' || isVirtualized;
|
|
@@ -134,14 +136,14 @@ export var EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
134
136
|
preProps = _useMemo2[0],
|
|
135
137
|
preFullscreenProps = _useMemo2[1];
|
|
136
138
|
var codeProps = useMemo(function () {
|
|
137
|
-
var styles = euiCodeBlockCodeStyles(euiTheme);
|
|
139
|
+
var styles = euiCodeBlockCodeStyles(euiTheme, euiCodeSyntaxVariables);
|
|
138
140
|
var cssStyles = [styles.euiCodeBlock__code, isVirtualized && styles.isVirtualized];
|
|
139
141
|
return _objectSpread({
|
|
140
142
|
className: 'euiCodeBlock__code',
|
|
141
143
|
css: cssStyles,
|
|
142
144
|
'data-code-language': language
|
|
143
145
|
}, rest);
|
|
144
|
-
}, [language, euiTheme, isVirtualized, rest]);
|
|
146
|
+
}, [language, euiTheme, euiCodeSyntaxVariables, isVirtualized, rest]);
|
|
145
147
|
return ___EmotionJSX("div", {
|
|
146
148
|
css: cssStyles,
|
|
147
149
|
className: classNames('euiCodeBlock', className),
|
|
@@ -19,7 +19,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
19
19
|
|
|
20
20
|
import { css } from '@emotion/react';
|
|
21
21
|
import { euiPaddingSize, euiFontSize, euiScrollBarStyles, mathWithUnits } from '../../global_styling';
|
|
22
|
-
import { euiCodeSyntaxColors, euiCodeSyntaxTokens } from './code_syntax.styles';
|
|
23
22
|
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
24
23
|
name: "i92zwx-isFullScreen",
|
|
25
24
|
styles: "position:fixed;inset:0;label:isFullScreen;"
|
|
@@ -36,11 +35,10 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
|
36
35
|
styles: "background:transparent;label:transparentBackground;",
|
|
37
36
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
37
|
};
|
|
39
|
-
export var euiCodeBlockStyles = function euiCodeBlockStyles(euiThemeContext) {
|
|
38
|
+
export var euiCodeBlockStyles = function euiCodeBlockStyles(euiThemeContext, euiCodeSyntaxVariables) {
|
|
40
39
|
var euiTheme = euiThemeContext.euiTheme;
|
|
41
|
-
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
42
40
|
return {
|
|
43
|
-
euiCodeBlock: /*#__PURE__*/css("max-inline-size:100%;display:block;position:relative;background:",
|
|
41
|
+
euiCodeBlock: /*#__PURE__*/css("max-inline-size:100%;display:block;position:relative;background:", euiCodeSyntaxVariables.backgroundColor, ";", euiCodeSyntaxVariables.tokensCss, ";;label:euiCodeBlock;"),
|
|
44
42
|
// Font size
|
|
45
43
|
s: /*#__PURE__*/css(euiFontSize(euiThemeContext, 'xs'), ";;label:s;"),
|
|
46
44
|
m: /*#__PURE__*/css(euiFontSize(euiThemeContext, 's'), ";;label:m;"),
|
|
@@ -112,11 +110,10 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
112
110
|
styles: "position:relative;label:isVirtualized;",
|
|
113
111
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
114
112
|
};
|
|
115
|
-
export var euiCodeBlockCodeStyles = function euiCodeBlockCodeStyles(euiThemeContext) {
|
|
113
|
+
export var euiCodeBlockCodeStyles = function euiCodeBlockCodeStyles(euiThemeContext, euiCodeSyntaxVariables) {
|
|
116
114
|
var euiTheme = euiThemeContext.euiTheme;
|
|
117
|
-
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
118
115
|
return {
|
|
119
|
-
euiCodeBlock__code: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:inherit;color:",
|
|
116
|
+
euiCodeBlock__code: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:inherit;color:", euiCodeSyntaxVariables.color, ";display:block;;label:euiCodeBlock__code;"),
|
|
120
117
|
isVirtualized: _ref
|
|
121
118
|
};
|
|
122
119
|
};
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
import React, { Fragment } from 'react';
|
|
10
10
|
import { useEuiTheme } from '../../services';
|
|
11
|
+
import { useEuiCodeSyntaxVariables } from './code_syntax.styles';
|
|
11
12
|
import { euiCodeBlockControlsStyles } from './code_block_controls.styles';
|
|
12
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
13
14
|
export var EuiCodeBlockControls = function EuiCodeBlockControls(_ref) {
|
|
14
15
|
var paddingSize = _ref.paddingSize,
|
|
15
16
|
controls = _ref.controls;
|
|
16
|
-
var
|
|
17
|
-
var styles = euiCodeBlockControlsStyles(euiTheme);
|
|
17
|
+
var styles = euiCodeBlockControlsStyles(useEuiTheme(), useEuiCodeSyntaxVariables());
|
|
18
18
|
var cssStyles = [styles.euiCodeBlock__controls, styles.offset[paddingSize]];
|
|
19
19
|
var hasControls = controls.some(function (control) {
|
|
20
20
|
return !!control;
|
|
@@ -16,7 +16,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
16
16
|
|
|
17
17
|
import { css } from '@emotion/react';
|
|
18
18
|
import { euiPaddingSize } from '../../global_styling';
|
|
19
|
-
import { euiCodeSyntaxColors } from './code_syntax.styles';
|
|
20
19
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
21
20
|
name: "to86kv-none",
|
|
22
21
|
styles: "inset-block-start:0;inset-inline-end:0;label:none;"
|
|
@@ -25,11 +24,10 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
25
24
|
styles: "inset-block-start:0;inset-inline-end:0;label:none;",
|
|
26
25
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
27
26
|
};
|
|
28
|
-
export var euiCodeBlockControlsStyles = function euiCodeBlockControlsStyles(euiThemeContext) {
|
|
27
|
+
export var euiCodeBlockControlsStyles = function euiCodeBlockControlsStyles(euiThemeContext, euiCodeSyntaxVariables) {
|
|
29
28
|
var euiTheme = euiThemeContext.euiTheme;
|
|
30
|
-
var euiCodeSyntax = euiCodeSyntaxColors(euiThemeContext);
|
|
31
29
|
return {
|
|
32
|
-
euiCodeBlock__controls: /*#__PURE__*/css("position:absolute;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";background:",
|
|
30
|
+
euiCodeBlock__controls: /*#__PURE__*/css("position:absolute;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";background:", euiCodeSyntaxVariables.backgroundColor, ";;label:euiCodeBlock__controls;"),
|
|
33
31
|
offset: {
|
|
34
32
|
none: _ref,
|
|
35
33
|
s: /*#__PURE__*/css("inset-block-start:", euiPaddingSize(euiThemeContext, 's'), ";inset-inline-end:", euiPaddingSize(euiThemeContext, 's'), ";;label:s;"),
|
|
@@ -13,6 +13,7 @@ import { useEuiI18n } from '../i18n';
|
|
|
13
13
|
import { EuiButtonIcon } from '../button';
|
|
14
14
|
import { EuiFocusTrap } from '../focus_trap';
|
|
15
15
|
import { EuiOverlayMask } from '../overlay_mask';
|
|
16
|
+
import { useEuiCodeSyntaxVariables } from './code_syntax.styles';
|
|
16
17
|
import { euiCodeBlockStyles } from './code_block.styles';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -68,8 +69,7 @@ export var useFullScreen = function useFullScreen(_ref) {
|
|
|
68
69
|
*/
|
|
69
70
|
export var EuiCodeBlockFullScreenWrapper = function EuiCodeBlockFullScreenWrapper(_ref2) {
|
|
70
71
|
var children = _ref2.children;
|
|
71
|
-
var
|
|
72
|
-
var styles = euiCodeBlockStyles(euiThemeContext);
|
|
72
|
+
var styles = euiCodeBlockStyles(useEuiTheme(), useEuiCodeSyntaxVariables());
|
|
73
73
|
var cssStyles = [styles.euiCodeBlock, styles.l,
|
|
74
74
|
// Force fullscreen to use large font
|
|
75
75
|
styles.isFullScreen];
|
|
@@ -6,39 +6,44 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { useMemo } from 'react';
|
|
10
|
+
import { useEuiTheme, makeHighContrastColor, euiPaletteColorBlind } from '../../services';
|
|
10
11
|
var visColors = euiPaletteColorBlind();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
12
|
+
|
|
13
|
+
// These variables are computationally expensive, so it needs
|
|
14
|
+
// to be a hook in order to memoize it per theme
|
|
15
|
+
export var useEuiCodeSyntaxVariables = function useEuiCodeSyntaxVariables() {
|
|
16
|
+
var _useEuiTheme = useEuiTheme(),
|
|
17
|
+
euiTheme = _useEuiTheme.euiTheme;
|
|
18
|
+
return useMemo(function () {
|
|
19
|
+
var backgroundColor = euiTheme.colors.lightestShade;
|
|
20
|
+
return {
|
|
21
|
+
backgroundColor: backgroundColor,
|
|
22
|
+
color: makeHighContrastColor(euiTheme.colors.text)(backgroundColor),
|
|
23
|
+
inlineCodeColor: makeHighContrastColor(visColors[3])(backgroundColor),
|
|
24
|
+
selectedBackgroundColor: 'inherit',
|
|
25
|
+
commentColor: makeHighContrastColor(euiTheme.colors.subduedText)(backgroundColor),
|
|
26
|
+
selectorTagColor: 'inherit',
|
|
27
|
+
stringColor: makeHighContrastColor(visColors[2])(backgroundColor),
|
|
28
|
+
tagColor: makeHighContrastColor(visColors[1])(backgroundColor),
|
|
29
|
+
nameColor: makeHighContrastColor(visColors[1])(backgroundColor),
|
|
30
|
+
numberColor: makeHighContrastColor(visColors[0])(backgroundColor),
|
|
31
|
+
keywordColor: makeHighContrastColor(visColors[3])(backgroundColor),
|
|
32
|
+
functionTitleColor: 'inherit',
|
|
33
|
+
typeColor: makeHighContrastColor(visColors[1])(backgroundColor),
|
|
34
|
+
attributeColor: 'inherit',
|
|
35
|
+
symbolColor: makeHighContrastColor(visColors[9])(backgroundColor),
|
|
36
|
+
paramsColor: 'inherit',
|
|
37
|
+
metaColor: makeHighContrastColor(euiTheme.colors.subduedText)(backgroundColor),
|
|
38
|
+
titleColor: makeHighContrastColor(visColors[7])(backgroundColor),
|
|
39
|
+
sectionColor: makeHighContrastColor(visColors[9])(backgroundColor),
|
|
40
|
+
additionColor: makeHighContrastColor(visColors[0])(backgroundColor),
|
|
41
|
+
deletionColor: makeHighContrastColor(euiTheme.colors.danger)(backgroundColor),
|
|
42
|
+
selectorClassColor: 'inherit',
|
|
43
|
+
selectorIdColor: 'inherit',
|
|
44
|
+
get tokensCss() {
|
|
45
|
+
return "\n .token.punctuation:not(.interpolation-punctuation):not([class*='attr-']) {\n opacity: .7;\n }\n\n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata,\n .token.coord,\n .token.blockquote {\n color: ".concat(this.commentColor, ";\n font-style: italic;\n }\n\n .token.selector {\n color: ").concat(this.selectorTagColor, ";\n }\n\n .token.string,\n .token.interpolation,\n .token.interpolation-punctuation,\n .token.doc-comment .token.keyword,\n .token.attr-value,\n .token.url .token.content {\n color: ").concat(this.stringColor, ";\n }\n\n .token.number,\n .token.boolean,\n .token.keyword.nil,\n .token.regex,\n .token.variable,\n .token.unit,\n .token.hexcode,\n .token.attr-name,\n .token.attr-equals {\n color: ").concat(this.numberColor, ";\n }\n\n .token.atrule .token.rule,\n .token.keyword {\n color: ").concat(this.keywordColor, ";\n }\n\n .token.function {\n color: ").concat(this.functionTitleColor, ";\n }\n\n .token.tag {\n color: ").concat(this.tagColor, ";\n }\n\n .token.class-name {\n color: ").concat(this.typeColor, ";\n }\n\n .token.property {\n color: ").concat(this.attributeColor, ";\n }\n\n .token.console,\n .token.list-punctuation,\n .token.url-reference,\n .token.url .token.url {\n color: ").concat(this.symbolColor, ";\n }\n\n .token.paramater {\n color: ").concat(this.paramsColor, ";\n }\n\n .token.meta,\n .token.important {\n color: ").concat(this.metaColor, ";\n }\n\n .token.title {\n color: ").concat(this.titleColor, ";\n }\n\n .token.section {\n color: ").concat(this.sectionColor, ";\n }\n\n .token.prefix.inserted,\n .token.prefix.deleted {\n padding-inline-start: -").concat(euiTheme.size.xs, ";\n margin-inline-start: -").concat(euiTheme.size.xs, ";\n }\n\n .token.prefix.inserted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.additionColor, ";\n color: ").concat(this.additionColor, ";\n }\n\n .token.prefix.deleted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.deletionColor, ";\n color: ").concat(this.deletionColor, ";\n }\n\n .token.selector .token.class {\n color: ").concat(this.selectorClassColor, ";\n }\n\n .token.selector .token.id {\n color: ").concat(this.selectorIdColor, ";\n }\n\n .token.italic {\n font-style: italic;\n }\n\n .token.important,\n .token.bold {\n font-weight: ").concat(euiTheme.font.weight.bold, ";\n }\n\n .token.url-reference,\n .token.url .token.url {\n text-decoration: underline;\n }\n\n .token.entity {\n cursor: help;\n }");
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}, [euiTheme]);
|
|
44
49
|
};
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
import React, { useMemo } from 'react';
|
|
10
10
|
import classNames from 'classnames';
|
|
11
11
|
import { useEuiTheme } from '../../services';
|
|
12
|
+
import { useEuiBorderColorCSS } from '../../global_styling';
|
|
12
13
|
import { EuiPanel } from '../panel';
|
|
13
14
|
import { EuiAvatar } from '../avatar';
|
|
14
|
-
import {
|
|
15
|
+
import { euiCommentEventStyles, euiCommentEventHeaderStyles, euiCommentEventBodyStyles } from './comment_event.styles';
|
|
15
16
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
16
17
|
export var EuiCommentEvent = function EuiCommentEvent(_ref) {
|
|
17
18
|
var children = _ref.children,
|
|
@@ -63,7 +64,7 @@ export var EuiCommentEvent = function EuiCommentEvent(_ref) {
|
|
|
63
64
|
* Styles
|
|
64
65
|
*/
|
|
65
66
|
var euiTheme = useEuiTheme();
|
|
66
|
-
var borderStyles =
|
|
67
|
+
var borderStyles = useEuiBorderColorCSS();
|
|
67
68
|
var styles = euiCommentEventStyles(euiTheme);
|
|
68
69
|
var cssStyles = [styles.euiCommentEvent, showEventBorders && styles.border, showEventBorders && borderStyles[eventColor]];
|
|
69
70
|
var headerStyles = euiCommentEventHeaderStyles(euiTheme);
|
|
@@ -8,23 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { tintOrShade } from '../../services';
|
|
12
11
|
import { logicalCSS } from '../../global_styling';
|
|
13
|
-
export var euiCommentEventBorderColors = function euiCommentEventBorderColors(_ref3) {
|
|
14
|
-
var euiTheme = _ref3.euiTheme,
|
|
15
|
-
colorMode = _ref3.colorMode;
|
|
16
|
-
var ratio = 0.6;
|
|
17
|
-
return {
|
|
18
|
-
warning: /*#__PURE__*/css("border-color:", tintOrShade(euiTheme.colors.warning, 0.4, colorMode), ";;label:warning;"),
|
|
19
|
-
accent: /*#__PURE__*/css("border-color:", tintOrShade(euiTheme.colors.accent, ratio, colorMode), ";;label:accent;"),
|
|
20
|
-
primary: /*#__PURE__*/css("border-color:", tintOrShade(euiTheme.colors.primary, ratio, colorMode), ";;label:primary;"),
|
|
21
|
-
success: /*#__PURE__*/css("border-color:", tintOrShade(euiTheme.colors.success, ratio, colorMode), ";;label:success;"),
|
|
22
|
-
danger: /*#__PURE__*/css("border-color:", tintOrShade(euiTheme.colors.danger, ratio, colorMode), ";;label:danger;"),
|
|
23
|
-
subdued: /*#__PURE__*/css("border-color:", euiTheme.border.color, ";;label:subdued;"),
|
|
24
|
-
transparent: /*#__PURE__*/css("border-color:", euiTheme.border.color, ";;label:transparent;"),
|
|
25
|
-
plain: /*#__PURE__*/css("border-color:", euiTheme.border.color, ";;label:plain;")
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
12
|
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
29
13
|
name: "yoyozp-euiCommentEvent",
|
|
30
14
|
styles: "overflow:hidden;label:euiCommentEvent;"
|
|
@@ -62,8 +46,8 @@ export var euiCommentEventHeaderStyles = function euiCommentEventHeaderStyles(eu
|
|
|
62
46
|
euiCommentEvent__headerActions: /*#__PURE__*/css("display:flex;flex-wrap:wrap;gap:", euiTheme.size.xs, ";;label:euiCommentEvent__headerActions;")
|
|
63
47
|
};
|
|
64
48
|
};
|
|
65
|
-
export var euiCommentEventBodyStyles = function euiCommentEventBodyStyles(
|
|
66
|
-
var euiTheme =
|
|
49
|
+
export var euiCommentEventBodyStyles = function euiCommentEventBodyStyles(_ref3) {
|
|
50
|
+
var euiTheme = _ref3.euiTheme;
|
|
67
51
|
return {
|
|
68
52
|
euiCommentEvent__body: /*#__PURE__*/css(";label:euiCommentEvent__body;"),
|
|
69
53
|
// types
|
|
@@ -8,7 +8,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
var _excluded = ["isSeparator", "key"],
|
|
11
|
-
_excluded2 = ["panel", "name", "key", "icon", "onClick"
|
|
11
|
+
_excluded2 = ["panel", "name", "key", "icon", "onClick"],
|
|
12
12
|
_excluded3 = ["theme", "panels", "onPanelChange", "className", "initialPanelId", "size"];
|
|
13
13
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -211,8 +211,6 @@ export var EuiContextMenuClass = /*#__PURE__*/function (_Component) {
|
|
|
211
211
|
key = item.key,
|
|
212
212
|
icon = item.icon,
|
|
213
213
|
onClick = item.onClick,
|
|
214
|
-
toolTipTitle = item.toolTipTitle,
|
|
215
|
-
toolTipContent = item.toolTipContent,
|
|
216
214
|
rest = _objectWithoutProperties(item, _excluded2);
|
|
217
215
|
var onClickHandler = panel ? function (event) {
|
|
218
216
|
if (onClick && event) {
|
|
@@ -231,9 +229,7 @@ export var EuiContextMenuClass = /*#__PURE__*/function (_Component) {
|
|
|
231
229
|
key: key || (typeof name === 'string' ? name : undefined) || index,
|
|
232
230
|
icon: icon,
|
|
233
231
|
onClick: onClickHandler,
|
|
234
|
-
hasPanel: Boolean(panel)
|
|
235
|
-
toolTipTitle: toolTipTitle,
|
|
236
|
-
toolTipContent: toolTipContent
|
|
232
|
+
hasPanel: Boolean(panel)
|
|
237
233
|
}, rest), name);
|
|
238
234
|
});
|
|
239
235
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "className", "hasPanel", "icon", "buttonRef", "disabled", "layoutAlign", "
|
|
3
|
+
var _excluded = ["children", "className", "hasPanel", "icon", "buttonRef", "disabled", "layoutAlign", "toolTipContent", "toolTipProps", "href", "target", "rel", "size"];
|
|
4
4
|
/*
|
|
5
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
6
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -34,10 +34,7 @@ export var EuiContextMenuItem = function EuiContextMenuItem(_ref) {
|
|
|
34
34
|
_disabled = _ref.disabled,
|
|
35
35
|
_ref$layoutAlign = _ref.layoutAlign,
|
|
36
36
|
layoutAlign = _ref$layoutAlign === void 0 ? 'center' : _ref$layoutAlign,
|
|
37
|
-
toolTipTitle = _ref.toolTipTitle,
|
|
38
37
|
toolTipContent = _ref.toolTipContent,
|
|
39
|
-
_ref$toolTipPosition = _ref.toolTipPosition,
|
|
40
|
-
toolTipPosition = _ref$toolTipPosition === void 0 ? 'right' : _ref$toolTipPosition,
|
|
41
38
|
toolTipProps = _ref.toolTipProps,
|
|
42
39
|
href = _ref.href,
|
|
43
40
|
target = _ref.target,
|
|
@@ -108,8 +105,7 @@ export var EuiContextMenuItem = function EuiContextMenuItem(_ref) {
|
|
|
108
105
|
if (toolTipContent) {
|
|
109
106
|
var anchorClasses = classNames('eui-displayBlock', toolTipProps === null || toolTipProps === void 0 ? void 0 : toolTipProps.anchorClassName);
|
|
110
107
|
return ___EmotionJSX(EuiToolTip, _extends({
|
|
111
|
-
|
|
112
|
-
position: toolTipPosition
|
|
108
|
+
position: "right"
|
|
113
109
|
}, toolTipProps, {
|
|
114
110
|
anchorClassName: anchorClasses,
|
|
115
111
|
content: toolTipContent
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["icon", "iconType", "iconColor", "title", "titleSize", "paddingSize", "body", "actions", "className", "layout", "hasBorder", "color", "footer"];
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
4
|
/*
|
|
7
5
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
8
6
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -11,9 +9,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
11
9
|
* Side Public License, v 1.
|
|
12
10
|
*/
|
|
13
11
|
|
|
14
|
-
import React from 'react';
|
|
12
|
+
import React, { useMemo } from 'react';
|
|
15
13
|
import classNames from 'classnames';
|
|
16
|
-
import {
|
|
14
|
+
import { useEuiTheme } from '../../services';
|
|
17
15
|
import { EuiTitle } from '../title';
|
|
18
16
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
19
17
|
import { EuiSpacer } from '../spacer';
|
|
@@ -21,14 +19,9 @@ import { EuiIcon } from '../icon';
|
|
|
21
19
|
import { isNamedColor } from '../icon/named_colors';
|
|
22
20
|
import { EuiText } from '../text';
|
|
23
21
|
import { EuiPanel } from '../panel/panel';
|
|
22
|
+
import { euiEmptyPromptStyles } from './empty_prompt.styles';
|
|
24
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
25
|
-
var
|
|
26
|
-
none: null,
|
|
27
|
-
s: 'euiEmptyPrompt--paddingSmall',
|
|
28
|
-
m: 'euiEmptyPrompt--paddingMedium',
|
|
29
|
-
l: 'euiEmptyPrompt--paddingLarge'
|
|
30
|
-
};
|
|
31
|
-
export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
|
|
24
|
+
export var PADDING_SIZES = ['none', 's', 'm', 'l'];
|
|
32
25
|
export var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
|
|
33
26
|
var icon = _ref.icon,
|
|
34
27
|
iconType = _ref.iconType,
|
|
@@ -48,41 +41,41 @@ export var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
|
|
|
48
41
|
color = _ref$color === void 0 ? 'transparent' : _ref$color,
|
|
49
42
|
footer = _ref.footer,
|
|
50
43
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
-
var
|
|
44
|
+
var classes = classNames('euiEmptyPrompt', className);
|
|
45
|
+
var euiTheme = useEuiTheme();
|
|
46
|
+
var styles = useMemo(function () {
|
|
47
|
+
return euiEmptyPromptStyles(euiTheme);
|
|
48
|
+
}, [euiTheme]);
|
|
49
|
+
var cssStyles = [styles.euiEmptyPrompt, styles[layout]];
|
|
50
|
+
var mainStyles = [styles.main.euiEmptyPrompt__main, styles.main[layout], styles.main[paddingSize], layout === 'horizontal' && styles.main.horizontalPadding[paddingSize]];
|
|
51
|
+
var contentStyles = [styles.content.euiEmptyPrompt__content, styles.content[layout]];
|
|
52
|
+
|
|
52
53
|
// Default the iconColor to `subdued`,
|
|
53
54
|
// otherwise try to match the iconColor with the panel color unless iconColor is specified
|
|
54
55
|
var iconColor = _iconColor !== null && _iconColor !== void 0 ? _iconColor : isNamedColor(color) ? color : 'subdued';
|
|
55
|
-
var iconNode =
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
bodyNode = ___EmotionJSX(React.Fragment, null, title && ___EmotionJSX(EuiSpacer, {
|
|
70
|
-
size: "m"
|
|
71
|
-
}), ___EmotionJSX(EuiText, {
|
|
72
|
-
color: "subdued"
|
|
73
|
-
}, body));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
var actionsNode;
|
|
77
|
-
if (actions) {
|
|
78
|
-
var actionsRow;
|
|
56
|
+
var iconNode = useMemo(function () {
|
|
57
|
+
if (!iconType && !icon) return null;
|
|
58
|
+
var iconStyles = [styles.icon.euiEmptyPrompt__icon, styles.icon[layout]];
|
|
59
|
+
return ___EmotionJSX("div", {
|
|
60
|
+
className: "euiEmptyPrompt__icon",
|
|
61
|
+
css: iconStyles
|
|
62
|
+
}, iconType ? ___EmotionJSX(EuiIcon, {
|
|
63
|
+
type: iconType,
|
|
64
|
+
size: "xxl",
|
|
65
|
+
color: iconColor
|
|
66
|
+
}) : icon);
|
|
67
|
+
}, [icon, iconType, iconColor, layout, styles.icon]);
|
|
68
|
+
var actionsNode = useMemo(function () {
|
|
69
|
+
if (!actions) return null;
|
|
79
70
|
if (Array.isArray(actions)) {
|
|
80
|
-
|
|
71
|
+
var actionStyles = [styles.actions.euiEmptyPrompt__actions, styles.actions[layout]];
|
|
72
|
+
return ___EmotionJSX(EuiFlexGroup, {
|
|
81
73
|
className: "euiEmptyPrompt__actions",
|
|
74
|
+
css: actionStyles,
|
|
82
75
|
gutterSize: "m",
|
|
83
76
|
alignItems: "center",
|
|
84
77
|
justifyContent: "center",
|
|
85
|
-
direction:
|
|
78
|
+
direction: layout === 'vertical' ? 'column' : 'row'
|
|
86
79
|
}, actions.map(function (action, index) {
|
|
87
80
|
return ___EmotionJSX(EuiFlexItem, {
|
|
88
81
|
key: index,
|
|
@@ -90,30 +83,37 @@ export var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
|
|
|
90
83
|
}, action);
|
|
91
84
|
}));
|
|
92
85
|
} else {
|
|
93
|
-
|
|
86
|
+
return actions;
|
|
94
87
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
88
|
+
}, [actions, layout, styles.actions]);
|
|
89
|
+
var footerNode = useMemo(function () {
|
|
90
|
+
if (!footer) return null;
|
|
91
|
+
var footerStyles = [styles.footer.euiEmptyPrompt__footer, styles.footer[paddingSize], styles.footer[color], color === 'transparent' && !hasBorder && styles.footer.roundedBorders];
|
|
92
|
+
return ___EmotionJSX("div", {
|
|
93
|
+
className: "euiEmptyPrompt__footer",
|
|
94
|
+
css: footerStyles
|
|
95
|
+
}, footer);
|
|
96
|
+
}, [footer, paddingSize, color, hasBorder, styles.footer]);
|
|
97
|
+
return ___EmotionJSX(EuiPanel, _extends({
|
|
98
|
+
css: cssStyles,
|
|
102
99
|
className: classes,
|
|
103
100
|
color: color,
|
|
104
|
-
paddingSize:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}, rest)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, iconNode
|
|
111
|
-
className: "
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
paddingSize: "none",
|
|
102
|
+
grow: false,
|
|
103
|
+
hasBorder: hasBorder
|
|
104
|
+
}, rest), ___EmotionJSX("div", {
|
|
105
|
+
className: "euiEmptyPrompt__main",
|
|
106
|
+
css: mainStyles
|
|
107
|
+
}, iconNode, ___EmotionJSX("div", {
|
|
108
|
+
className: "euiEmptyPrompt__content",
|
|
109
|
+
css: contentStyles
|
|
110
|
+
}, title && ___EmotionJSX(EuiTitle, {
|
|
111
|
+
size: titleSize
|
|
112
|
+
}, title), title && body && ___EmotionJSX(EuiSpacer, {
|
|
113
|
+
size: "m"
|
|
114
|
+
}), body && ___EmotionJSX(EuiText, {
|
|
115
|
+
color: "subdued"
|
|
116
|
+
}, body), actionsNode && (body || title) && ___EmotionJSX(EuiSpacer, {
|
|
117
|
+
size: "l"
|
|
118
|
+
}), actionsNode)), footerNode);
|
|
119
119
|
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
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)."; }
|
|
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
|
+
|
|
13
|
+
import { css } from '@emotion/react';
|
|
14
|
+
import { euiBreakpoint, euiPaddingSize, euiBorderColor, logicalCSS, mathWithUnits } from '../../global_styling';
|
|
15
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
16
|
+
name: "x4698b-roundedBorders",
|
|
17
|
+
styles: "border-radius:inherit;label:roundedBorders;"
|
|
18
|
+
} : {
|
|
19
|
+
name: "x4698b-roundedBorders",
|
|
20
|
+
styles: "border-radius:inherit;label:roundedBorders;",
|
|
21
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
22
|
+
};
|
|
23
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
24
|
+
name: "zv101j-euiEmptyPrompt__footer",
|
|
25
|
+
styles: "border-end-end-radius:inherit;border-end-start-radius:inherit;label:euiEmptyPrompt__footer;"
|
|
26
|
+
} : {
|
|
27
|
+
name: "zv101j-euiEmptyPrompt__footer",
|
|
28
|
+
styles: "border-end-end-radius:inherit;border-end-start-radius:inherit;label:euiEmptyPrompt__footer;",
|
|
29
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
30
|
+
};
|
|
31
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
32
|
+
name: "1rdinfv-vertical",
|
|
33
|
+
styles: "margin:auto;label:vertical;"
|
|
34
|
+
} : {
|
|
35
|
+
name: "1rdinfv-vertical",
|
|
36
|
+
styles: "margin:auto;label:vertical;",
|
|
37
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
|
+
};
|
|
39
|
+
var _ref4 = process.env.NODE_ENV === "production" ? {
|
|
40
|
+
name: "1w25ahh-vertical",
|
|
41
|
+
styles: "justify-content:center;label:vertical;"
|
|
42
|
+
} : {
|
|
43
|
+
name: "1w25ahh-vertical",
|
|
44
|
+
styles: "justify-content:center;label:vertical;",
|
|
45
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
46
|
+
};
|
|
47
|
+
var _ref5 = process.env.NODE_ENV === "production" ? {
|
|
48
|
+
name: "1o9qvqj-euiEmptyPrompt__main",
|
|
49
|
+
styles: "display:flex;flex-direction:column;label:euiEmptyPrompt__main;"
|
|
50
|
+
} : {
|
|
51
|
+
name: "1o9qvqj-euiEmptyPrompt__main",
|
|
52
|
+
styles: "display:flex;flex-direction:column;label:euiEmptyPrompt__main;",
|
|
53
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
54
|
+
};
|
|
55
|
+
export var euiEmptyPromptStyles = function euiEmptyPromptStyles(euiThemeContext) {
|
|
56
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
57
|
+
var iconMaxWidth = mathWithUnits(euiTheme.size.l, function (x) {
|
|
58
|
+
return x * 15;
|
|
59
|
+
});
|
|
60
|
+
var generatePaddingStyles = function generatePaddingStyles() {
|
|
61
|
+
var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'padding';
|
|
62
|
+
return {
|
|
63
|
+
none: null,
|
|
64
|
+
s: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 's'), ";;label:s;"),
|
|
65
|
+
m: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'm'), ";;label:m;"),
|
|
66
|
+
l: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'l'), ";;label:l;")
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var generateFooterBorder = function generateFooterBorder(color) {
|
|
70
|
+
return "".concat(euiTheme.border.width.thin, " solid ").concat(euiBorderColor(euiThemeContext, color));
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
euiEmptyPrompt: /*#__PURE__*/css("text-align:center;margin:auto;", euiBreakpoint(euiThemeContext, ['l', 'xl']), "{", logicalCSS('max-width', 'max-content'), ";};label:euiEmptyPrompt;"),
|
|
74
|
+
vertical: /*#__PURE__*/css(";label:vertical;"),
|
|
75
|
+
horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{justify-content:flex-start;text-align:start;};label:horizontal;"),
|
|
76
|
+
main: _objectSpread(_objectSpread({
|
|
77
|
+
euiEmptyPrompt__main: _ref5,
|
|
78
|
+
vertical: _ref4,
|
|
79
|
+
horizontal: /*#__PURE__*/css("align-items:center;", euiBreakpoint(euiThemeContext, ['l', 'xl']), "{flex-direction:row-reverse;};label:horizontal;")
|
|
80
|
+
}, generatePaddingStyles()), {}, {
|
|
81
|
+
horizontalPadding: generatePaddingStyles('gap')
|
|
82
|
+
}),
|
|
83
|
+
content: {
|
|
84
|
+
euiEmptyPrompt__content: /*#__PURE__*/css(logicalCSS('max-width', '36em'), ";;label:euiEmptyPrompt__content;"),
|
|
85
|
+
vertical: _ref3,
|
|
86
|
+
horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{padding-block:", euiTheme.size.l, ";padding-inline:0;};label:horizontal;")
|
|
87
|
+
},
|
|
88
|
+
icon: {
|
|
89
|
+
euiEmptyPrompt__icon: /*#__PURE__*/css(logicalCSS('max-width', iconMaxWidth), " margin:auto;&>*{flex-shrink:1;", logicalCSS('max-width', '100%'), ";};label:euiEmptyPrompt__icon;"),
|
|
90
|
+
vertical: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.base), ";;label:vertical;"),
|
|
91
|
+
horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{", logicalCSS('min-width', '40%'), " ", logicalCSS('max-width', '50%'), "&&>*{", logicalCSS('max-width', iconMaxWidth), ";}};label:horizontal;")
|
|
92
|
+
},
|
|
93
|
+
actions: {
|
|
94
|
+
euiEmptyPrompt__actions: /*#__PURE__*/css(";label:euiEmptyPrompt__actions;"),
|
|
95
|
+
vertical: /*#__PURE__*/css(";label:vertical;"),
|
|
96
|
+
horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{justify-content:flex-start;};label:horizontal;")
|
|
97
|
+
},
|
|
98
|
+
footer: _objectSpread({
|
|
99
|
+
euiEmptyPrompt__footer: _ref2,
|
|
100
|
+
roundedBorders: _ref,
|
|
101
|
+
// Colors
|
|
102
|
+
transparent: /*#__PURE__*/css("background-color:", euiTheme.colors.body, ";;label:transparent;"),
|
|
103
|
+
plain: /*#__PURE__*/css("background-color:", euiTheme.colors.body, ";;label:plain;"),
|
|
104
|
+
subdued: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('subdued')), ";;label:subdued;"),
|
|
105
|
+
primary: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('primary')), ";;label:primary;"),
|
|
106
|
+
accent: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('accent')), ";;label:accent;"),
|
|
107
|
+
danger: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('danger')), ";;label:danger;"),
|
|
108
|
+
warning: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('warning')), ";;label:warning;"),
|
|
109
|
+
success: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('success')), ";;label:success;")
|
|
110
|
+
}, generatePaddingStyles())
|
|
111
|
+
};
|
|
112
|
+
};
|