@elastic/eui 64.0.1 → 64.0.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_charts_theme.js +330 -330
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +4 -1
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +4 -1
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/button/button_display/_button_display.js +6 -1
- package/es/components/button/button_empty/button_empty.js +10 -1
- package/es/components/card/card.js +10 -1
- package/es/components/card/card_select.js +10 -1
- package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -1
- package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
- package/es/components/description_list/description_list_title.js +1 -1
- package/es/components/expression/expression.js +12 -2
- package/es/components/header/header_links/header_link.js +10 -1
- package/es/components/image/image.js +6 -1
- package/es/components/notification/notification_event.js +10 -1
- package/es/components/page/page_content/page_content.js +1 -2
- package/es/components/page/page_content/page_content_body.js +1 -2
- package/es/components/page/page_content/page_content_header.js +1 -2
- package/es/components/page/page_content/page_content_header_section.js +1 -2
- package/es/components/page/page_section/page_section.js +15 -3
- package/es/components/page/page_side_bar/page_side_bar.js +1 -2
- package/es/components/page/page_sidebar/page_sidebar.js +5 -1
- package/es/components/page/page_template.js +3 -1
- package/es/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
- package/es/components/page_template/page_template.js +18 -2
- package/es/components/pagination/pagination_button.js +10 -1
- package/es/components/progress/progress.js +6 -1
- package/es/components/provider/cache/cache_provider.js +3 -9
- package/es/components/provider/provider.js +25 -2
- package/es/components/resizable_container/resizable_panel.js +6 -1
- package/es/components/side_nav/side_nav.js +5 -0
- package/es/services/theme/hooks.js +11 -16
- package/eui.d.ts +26 -24
- package/i18ntokens.json +4 -4
- package/lib/components/button/button_display/_button_display.js +6 -1
- package/lib/components/button/button_empty/button_empty.js +10 -1
- package/lib/components/card/card.js +10 -1
- package/lib/components/card/card_select.js +10 -1
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -1
- package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
- package/lib/components/description_list/description_list_title.js +1 -1
- package/lib/components/expression/expression.js +12 -2
- package/lib/components/header/header_links/header_link.js +10 -1
- package/lib/components/image/image.js +6 -1
- package/lib/components/notification/notification_event.js +10 -1
- package/lib/components/page/page_content/page_content.js +1 -2
- package/lib/components/page/page_content/page_content_body.js +1 -2
- package/lib/components/page/page_content/page_content_header.js +1 -2
- package/lib/components/page/page_content/page_content_header_section.js +1 -2
- package/lib/components/page/page_section/page_section.js +15 -3
- package/lib/components/page/page_side_bar/page_side_bar.js +1 -2
- package/lib/components/page/page_sidebar/page_sidebar.js +5 -1
- package/lib/components/page/page_template.js +3 -1
- package/lib/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
- package/lib/components/page_template/page_template.js +18 -2
- package/lib/components/progress/progress.js +6 -1
- package/lib/components/provider/cache/cache_provider.js +3 -11
- package/lib/components/provider/provider.js +31 -6
- package/lib/components/resizable_container/resizable_panel.js +6 -1
- package/lib/components/side_nav/side_nav.js +5 -0
- package/lib/services/theme/hooks.js +10 -15
- package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +0 -1
- package/optimize/es/components/description_list/description_list_title.js +1 -1
- package/optimize/es/components/page/page_content/page_content.js +1 -2
- package/optimize/es/components/page/page_content/page_content_body.js +1 -2
- package/optimize/es/components/page/page_content/page_content_header.js +1 -2
- package/optimize/es/components/page/page_content/page_content_header_section.js +1 -2
- package/optimize/es/components/page/page_section/page_section.js +4 -2
- package/optimize/es/components/page/page_side_bar/page_side_bar.js +1 -2
- package/optimize/es/components/page/page_sidebar/page_sidebar.js +5 -1
- package/optimize/es/components/page/page_template.js +3 -1
- package/optimize/es/components/provider/cache/cache_provider.js +3 -9
- package/optimize/es/components/provider/provider.js +25 -2
- package/optimize/es/services/theme/hooks.js +11 -16
- package/optimize/lib/components/description_list/description_list_title.js +1 -1
- package/optimize/lib/components/page/page_content/page_content.js +1 -2
- package/optimize/lib/components/page/page_content/page_content_body.js +1 -2
- package/optimize/lib/components/page/page_content/page_content_header.js +1 -2
- package/optimize/lib/components/page/page_content/page_content_header_section.js +1 -2
- package/optimize/lib/components/page/page_section/page_section.js +4 -2
- package/optimize/lib/components/page/page_side_bar/page_side_bar.js +1 -2
- package/optimize/lib/components/page/page_sidebar/page_sidebar.js +5 -1
- package/optimize/lib/components/page/page_template.js +3 -1
- package/optimize/lib/components/provider/cache/cache_provider.js +3 -11
- package/optimize/lib/components/provider/provider.js +31 -6
- package/optimize/lib/services/theme/hooks.js +10 -15
- package/package.json +1 -1
- package/src/components/datagrid/_data_grid_data_row.scss +7 -0
- package/test-env/components/button/button_display/_button_display.js +6 -1
- package/test-env/components/button/button_empty/button_empty.js +10 -1
- package/test-env/components/card/card.js +10 -1
- package/test-env/components/card/card_select.js +10 -1
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
- package/test-env/components/description_list/description_list_title.js +1 -1
- package/test-env/components/expression/expression.js +12 -2
- package/test-env/components/header/header_links/header_link.js +10 -1
- package/test-env/components/image/image.js +6 -1
- package/test-env/components/notification/notification_event.js +10 -1
- package/test-env/components/page/page_content/page_content.js +1 -2
- package/test-env/components/page/page_content/page_content_body.js +1 -2
- package/test-env/components/page/page_content/page_content_header.js +1 -2
- package/test-env/components/page/page_content/page_content_header_section.js +1 -2
- package/test-env/components/page/page_section/page_section.js +15 -3
- package/test-env/components/page/page_side_bar/page_side_bar.js +1 -2
- package/test-env/components/page/page_sidebar/page_sidebar.js +5 -1
- package/test-env/components/page/page_template.js +3 -1
- package/test-env/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
- package/test-env/components/page_template/page_template.js +18 -2
- package/test-env/components/progress/progress.js +6 -1
- package/test-env/components/provider/cache/cache_provider.js +3 -11
- package/test-env/components/provider/provider.js +31 -6
- package/test-env/components/resizable_container/resizable_panel.js +6 -1
- package/test-env/components/side_nav/side_nav.js +5 -0
- package/test-env/services/theme/hooks.js +10 -15
|
@@ -7,6 +7,8 @@ exports.EuiProvider = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
11
|
+
|
|
10
12
|
var _global_styles = require("../../global_styling/reset/global_styles");
|
|
11
13
|
|
|
12
14
|
var _utility = require("../../global_styling/utility/utility");
|
|
@@ -15,7 +17,7 @@ var _services = require("../../services");
|
|
|
15
17
|
|
|
16
18
|
var _themes = require("../../themes");
|
|
17
19
|
|
|
18
|
-
var
|
|
20
|
+
var _cache2 = require("./cache");
|
|
19
21
|
|
|
20
22
|
var _react2 = require("@emotion/react");
|
|
21
23
|
|
|
@@ -32,8 +34,16 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
|
|
|
32
34
|
return obj.hasOwnProperty('key');
|
|
33
35
|
};
|
|
34
36
|
|
|
37
|
+
var fallbackCache = (0, _cache.default)({
|
|
38
|
+
key: 'css'
|
|
39
|
+
});
|
|
40
|
+
fallbackCache.compat = true;
|
|
41
|
+
|
|
35
42
|
var EuiProvider = function EuiProvider(_ref) {
|
|
36
|
-
var
|
|
43
|
+
var _defaultCache;
|
|
44
|
+
|
|
45
|
+
var _ref$cache = _ref.cache,
|
|
46
|
+
cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
|
|
37
47
|
_ref$theme = _ref.theme,
|
|
38
48
|
theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
|
|
39
49
|
_ref$globalStyles = _ref.globalStyles,
|
|
@@ -49,24 +59,39 @@ var EuiProvider = function EuiProvider(_ref) {
|
|
|
49
59
|
|
|
50
60
|
if (cache) {
|
|
51
61
|
if (isEmotionCacheObject(cache)) {
|
|
62
|
+
cache.compat = true;
|
|
52
63
|
defaultCache = cache;
|
|
53
64
|
} else {
|
|
65
|
+
if (cache.default) {
|
|
66
|
+
cache.default.compat = true;
|
|
67
|
+
}
|
|
68
|
+
|
|
54
69
|
defaultCache = cache.default;
|
|
70
|
+
|
|
71
|
+
if (cache.global) {
|
|
72
|
+
cache.global.compat = true;
|
|
73
|
+
}
|
|
74
|
+
|
|
55
75
|
globalCache = cache.global;
|
|
76
|
+
|
|
77
|
+
if (cache.utility) {
|
|
78
|
+
cache.utility.compat = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
56
81
|
utilityCache = cache.utility;
|
|
57
82
|
}
|
|
58
83
|
}
|
|
59
84
|
|
|
60
|
-
return (0, _react2.jsx)(
|
|
61
|
-
cache: defaultCache
|
|
85
|
+
return (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
86
|
+
cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
|
|
62
87
|
}, (0, _react2.jsx)(_services.EuiThemeProvider, {
|
|
63
88
|
theme: theme !== null && theme !== void 0 ? theme : undefined,
|
|
64
89
|
colorMode: colorMode,
|
|
65
90
|
modify: modify
|
|
66
|
-
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
91
|
+
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
67
92
|
cache: globalCache,
|
|
68
93
|
children: Globals && (0, _react2.jsx)(Globals, null)
|
|
69
|
-
}), (0, _react2.jsx)(
|
|
94
|
+
}), (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
70
95
|
cache: utilityCache,
|
|
71
96
|
children: Utilities && (0, _react2.jsx)(Utilities, null)
|
|
72
97
|
})), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));
|
|
@@ -355,7 +355,12 @@ EuiResizablePanel.propTypes = {
|
|
|
355
355
|
/**
|
|
356
356
|
* Props to add to the wrapping `.euiResizablePanel` div
|
|
357
357
|
*/
|
|
358
|
-
wrapperProps: _propTypes.default.
|
|
358
|
+
wrapperProps: _propTypes.default.shape({
|
|
359
|
+
className: _propTypes.default.string,
|
|
360
|
+
"aria-label": _propTypes.default.string,
|
|
361
|
+
"data-test-subj": _propTypes.default.string,
|
|
362
|
+
css: _propTypes.default.any
|
|
363
|
+
}),
|
|
359
364
|
|
|
360
365
|
/**
|
|
361
366
|
* Padding to add directly to the wrapping `.euiResizablePanel` div
|
|
@@ -272,6 +272,11 @@ EuiSideNav.propTypes = {
|
|
|
272
272
|
* Adds a couple extra #EuiSideNavHeading props and extends the props of EuiTitle that wraps the `heading`
|
|
273
273
|
*/
|
|
274
274
|
headingProps: _propTypes.default.shape({
|
|
275
|
+
className: _propTypes.default.string,
|
|
276
|
+
"aria-label": _propTypes.default.string,
|
|
277
|
+
"data-test-subj": _propTypes.default.string,
|
|
278
|
+
css: _propTypes.default.any,
|
|
279
|
+
|
|
275
280
|
/**
|
|
276
281
|
* The actual HTML heading element to wrap the `heading`.
|
|
277
282
|
* Default is `h2`
|
|
@@ -23,11 +23,14 @@ var useEuiTheme = function useEuiTheme() {
|
|
|
23
23
|
var theme = (0, _react.useContext)(_context.EuiThemeContext);
|
|
24
24
|
var colorMode = (0, _react.useContext)(_context.EuiColorModeContext);
|
|
25
25
|
var modifications = (0, _react.useContext)(_context.EuiModificationsContext);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
var assembledTheme = (0, _react.useMemo)(function () {
|
|
27
|
+
return {
|
|
28
|
+
euiTheme: theme,
|
|
29
|
+
colorMode: colorMode,
|
|
30
|
+
modifications: modifications
|
|
31
|
+
};
|
|
32
|
+
}, [theme, colorMode, modifications]);
|
|
33
|
+
return assembledTheme;
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
exports.useEuiTheme = useEuiTheme;
|
|
@@ -38,17 +41,9 @@ var withEuiTheme = function withEuiTheme(Component) {
|
|
|
38
41
|
var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
|
|
39
42
|
|
|
40
43
|
var Render = function Render(props, ref) {
|
|
41
|
-
var
|
|
42
|
-
euiTheme = _useEuiTheme.euiTheme,
|
|
43
|
-
colorMode = _useEuiTheme.colorMode,
|
|
44
|
-
modifications = _useEuiTheme.modifications;
|
|
45
|
-
|
|
44
|
+
var theme = useEuiTheme();
|
|
46
45
|
return (0, _react2.jsx)(Component, _extends({
|
|
47
|
-
theme:
|
|
48
|
-
euiTheme: euiTheme,
|
|
49
|
-
colorMode: colorMode,
|
|
50
|
-
modifications: modifications
|
|
51
|
-
},
|
|
46
|
+
theme: theme,
|
|
52
47
|
ref: ref
|
|
53
48
|
}, props));
|
|
54
49
|
};
|
package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js
CHANGED
|
@@ -11,7 +11,6 @@ var _excluded = ["position", "isDisabled", "isInvalid", "needsUpdating", "value"
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import classNames from 'classnames';
|
|
14
|
-
// eslint-disable-line import/named
|
|
15
14
|
import { useEuiI18n } from '../../../i18n';
|
|
16
15
|
import { EuiPopover } from '../../../popover';
|
|
17
16
|
import { useFormatTimeString } from '../pretty_duration';
|
|
@@ -30,7 +30,7 @@ export var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
|
|
|
30
30
|
|
|
31
31
|
var theme = useEuiTheme();
|
|
32
32
|
var styles = euiDescriptionListTitleStyles(theme);
|
|
33
|
-
var conditionalStyles = compressed && textStyle
|
|
33
|
+
var conditionalStyles = compressed && textStyle !== 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
34
34
|
|
|
35
35
|
switch (type) {
|
|
36
36
|
case 'inline':
|
|
@@ -21,8 +21,7 @@ var horizontalPositionToClassNameMap = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
* Use EuiPageSection instead
|
|
24
|
+
* @deprecated Use EuiPageSection instead
|
|
26
25
|
*/
|
|
27
26
|
export var EuiPageContent_Deprecated = function EuiPageContent_Deprecated(_ref) {
|
|
28
27
|
var verticalPosition = _ref.verticalPosition,
|
|
@@ -24,8 +24,7 @@ var paddingSizeToClassNameMap = {
|
|
|
24
24
|
export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* Use EuiPageSection instead
|
|
27
|
+
* @deprecated Use EuiPageSection instead
|
|
29
28
|
*/
|
|
30
29
|
export var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
|
|
31
30
|
var children = _ref.children,
|
|
@@ -14,8 +14,7 @@ import classNames from 'classnames';
|
|
|
14
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Use EuiPageHeader instead
|
|
17
|
+
* @deprecated Use EuiPageHeader instead
|
|
19
18
|
*/
|
|
20
19
|
export var EuiPageContentHeader_Deprecated = function EuiPageContentHeader_Deprecated(_ref) {
|
|
21
20
|
var children = _ref.children,
|
|
@@ -14,8 +14,7 @@ import classNames from 'classnames';
|
|
|
14
14
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* Use EuiPageHeader instead
|
|
17
|
+
* @deprecated Use EuiPageHeader instead
|
|
19
18
|
*/
|
|
20
19
|
export var EuiPageContentHeaderSection_Deprecated = function EuiPageContentHeaderSection_Deprecated(_ref) {
|
|
21
20
|
var children = _ref.children,
|
|
@@ -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", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps"];
|
|
3
|
+
var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps", "component"];
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -29,6 +29,8 @@ export var EuiPageSection = function EuiPageSection(_ref) {
|
|
|
29
29
|
_ref$grow = _ref.grow,
|
|
30
30
|
grow = _ref$grow === void 0 ? false : _ref$grow,
|
|
31
31
|
contentProps = _ref.contentProps,
|
|
32
|
+
_ref$component = _ref.component,
|
|
33
|
+
Component = _ref$component === void 0 ? 'section' : _ref$component,
|
|
32
34
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
35
|
|
|
34
36
|
// Set max-width as a style prop
|
|
@@ -41,7 +43,7 @@ export var EuiPageSection = function EuiPageSection(_ref) {
|
|
|
41
43
|
var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
|
|
42
44
|
var contentStyles = euiPageSectionContentStyles();
|
|
43
45
|
var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
|
|
44
|
-
return ___EmotionJSX(
|
|
46
|
+
return ___EmotionJSX(Component, _extends({
|
|
45
47
|
css: cssStyles
|
|
46
48
|
}, rest), ___EmotionJSX("div", _extends({
|
|
47
49
|
css: cssContentStyles
|
|
@@ -22,8 +22,7 @@ var paddingSizeToClassNameMap = {
|
|
|
22
22
|
export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
* Use the new EuiPageSidebar instead
|
|
25
|
+
* @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
|
|
27
26
|
*/
|
|
28
27
|
export var EuiPageSideBar_Deprecated = function EuiPageSideBar_Deprecated(_ref) {
|
|
29
28
|
var children = _ref.children,
|
|
@@ -46,13 +46,17 @@ export var EuiPageSidebar = function EuiPageSidebar(_ref) {
|
|
|
46
46
|
setInlineStyles = _useState2[1];
|
|
47
47
|
|
|
48
48
|
useEffect(function () {
|
|
49
|
+
var updatedStyles = _objectSpread(_objectSpread({}, style), logicalStyle('min-width', isResponding ? '100%' : minWidth));
|
|
50
|
+
|
|
49
51
|
if (sticky) {
|
|
50
52
|
var _document$body$datase;
|
|
51
53
|
|
|
52
54
|
var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
|
|
53
55
|
var offset = _typeof(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
|
|
54
|
-
|
|
56
|
+
updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), logicalStyle('top', offset)), logicalStyle('max-height', "calc(100vh - ".concat(offset, "px)")));
|
|
55
57
|
}
|
|
58
|
+
|
|
59
|
+
setInlineStyles(updatedStyles);
|
|
56
60
|
}, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
|
|
57
61
|
return ___EmotionJSX("div", _extends({
|
|
58
62
|
className: className,
|
|
@@ -32,7 +32,9 @@ export var TEMPLATES = ['default', 'centeredBody', 'centeredContent', 'empty'];
|
|
|
32
32
|
/**
|
|
33
33
|
* This component has been deprecated in favor of the new
|
|
34
34
|
* namespaced version. You can still import this component
|
|
35
|
-
*
|
|
35
|
+
* until August 2023 by importing `as EuiPageTemplate`.
|
|
36
|
+
*
|
|
37
|
+
* @deprecated use EuiPageTemplate from page_template/page_template instead
|
|
36
38
|
*/
|
|
37
39
|
export var EuiPageTemplate_Deprecated = function EuiPageTemplate_Deprecated(_ref) {
|
|
38
40
|
var _pageBodyProps2;
|
|
@@ -6,18 +6,12 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import createCache from '@emotion/cache';
|
|
10
9
|
import { CacheProvider } from '@emotion/react';
|
|
11
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
12
|
-
var defaultCache = createCache({
|
|
13
|
-
key: 'css'
|
|
14
|
-
});
|
|
15
|
-
defaultCache.compat = true;
|
|
16
11
|
export var EuiCacheProvider = function EuiCacheProvider(_ref) {
|
|
17
|
-
var
|
|
18
|
-
cache = _ref$cache === void 0 ? defaultCache : _ref$cache,
|
|
12
|
+
var cache = _ref.cache,
|
|
19
13
|
children = _ref.children;
|
|
20
|
-
return ___EmotionJSX(CacheProvider, {
|
|
14
|
+
return children && cache ? ___EmotionJSX(CacheProvider, {
|
|
21
15
|
value: cache
|
|
22
|
-
}, children);
|
|
16
|
+
}, children) : ___EmotionJSX(React.Fragment, null, children);
|
|
23
17
|
};
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Side Public License, v 1.
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import createCache from '@emotion/cache';
|
|
9
10
|
import { EuiGlobalStyles } from '../../global_styling/reset/global_styles';
|
|
10
11
|
import { EuiUtilityClasses } from '../../global_styling/utility/utility';
|
|
11
12
|
import { EuiThemeProvider, CurrentEuiBreakpointProvider } from '../../services';
|
|
@@ -17,8 +18,15 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
|
|
|
17
18
|
return obj.hasOwnProperty('key');
|
|
18
19
|
};
|
|
19
20
|
|
|
21
|
+
var fallbackCache = createCache({
|
|
22
|
+
key: 'css'
|
|
23
|
+
});
|
|
24
|
+
fallbackCache.compat = true;
|
|
20
25
|
export var EuiProvider = function EuiProvider(_ref) {
|
|
21
|
-
var
|
|
26
|
+
var _defaultCache;
|
|
27
|
+
|
|
28
|
+
var _ref$cache = _ref.cache,
|
|
29
|
+
cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
|
|
22
30
|
_ref$theme = _ref.theme,
|
|
23
31
|
theme = _ref$theme === void 0 ? EuiThemeAmsterdam : _ref$theme,
|
|
24
32
|
_ref$globalStyles = _ref.globalStyles,
|
|
@@ -34,16 +42,31 @@ export var EuiProvider = function EuiProvider(_ref) {
|
|
|
34
42
|
|
|
35
43
|
if (cache) {
|
|
36
44
|
if (isEmotionCacheObject(cache)) {
|
|
45
|
+
cache.compat = true;
|
|
37
46
|
defaultCache = cache;
|
|
38
47
|
} else {
|
|
48
|
+
if (cache.default) {
|
|
49
|
+
cache.default.compat = true;
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
defaultCache = cache.default;
|
|
53
|
+
|
|
54
|
+
if (cache.global) {
|
|
55
|
+
cache.global.compat = true;
|
|
56
|
+
}
|
|
57
|
+
|
|
40
58
|
globalCache = cache.global;
|
|
59
|
+
|
|
60
|
+
if (cache.utility) {
|
|
61
|
+
cache.utility.compat = true;
|
|
62
|
+
}
|
|
63
|
+
|
|
41
64
|
utilityCache = cache.utility;
|
|
42
65
|
}
|
|
43
66
|
}
|
|
44
67
|
|
|
45
68
|
return ___EmotionJSX(EuiCacheProvider, {
|
|
46
|
-
cache: defaultCache
|
|
69
|
+
cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
|
|
47
70
|
}, ___EmotionJSX(EuiThemeProvider, {
|
|
48
71
|
theme: theme !== null && theme !== void 0 ? theme : undefined,
|
|
49
72
|
colorMode: colorMode,
|
|
@@ -7,18 +7,21 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
7
7
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
|
-
import React, { forwardRef, useContext } from 'react';
|
|
10
|
+
import React, { forwardRef, useContext, useMemo } from 'react';
|
|
11
11
|
import { EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
13
13
|
export var useEuiTheme = function useEuiTheme() {
|
|
14
14
|
var theme = useContext(EuiThemeContext);
|
|
15
15
|
var colorMode = useContext(EuiColorModeContext);
|
|
16
16
|
var modifications = useContext(EuiModificationsContext);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
var assembledTheme = useMemo(function () {
|
|
18
|
+
return {
|
|
19
|
+
euiTheme: theme,
|
|
20
|
+
colorMode: colorMode,
|
|
21
|
+
modifications: modifications
|
|
22
|
+
};
|
|
23
|
+
}, [theme, colorMode, modifications]);
|
|
24
|
+
return assembledTheme;
|
|
22
25
|
};
|
|
23
26
|
// Provide the component props interface as the generic to allow the docs props table to populate.
|
|
24
27
|
// e.g., `const EuiComponent = withEuiTheme<EuiComponentProps>(_EuiComponent)`
|
|
@@ -26,17 +29,9 @@ export var withEuiTheme = function withEuiTheme(Component) {
|
|
|
26
29
|
var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
|
|
27
30
|
|
|
28
31
|
var Render = function Render(props, ref) {
|
|
29
|
-
var
|
|
30
|
-
euiTheme = _useEuiTheme.euiTheme,
|
|
31
|
-
colorMode = _useEuiTheme.colorMode,
|
|
32
|
-
modifications = _useEuiTheme.modifications;
|
|
33
|
-
|
|
32
|
+
var theme = useEuiTheme();
|
|
34
33
|
return ___EmotionJSX(Component, _extends({
|
|
35
|
-
theme:
|
|
36
|
-
euiTheme: euiTheme,
|
|
37
|
-
colorMode: colorMode,
|
|
38
|
-
modifications: modifications
|
|
39
|
-
},
|
|
34
|
+
theme: theme,
|
|
40
35
|
ref: ref
|
|
41
36
|
}, props));
|
|
42
37
|
};
|
|
@@ -46,7 +46,7 @@ var EuiDescriptionListTitle = function EuiDescriptionListTitle(_ref) {
|
|
|
46
46
|
|
|
47
47
|
var theme = (0, _services.useEuiTheme)();
|
|
48
48
|
var styles = (0, _description_list_title.euiDescriptionListTitleStyles)(theme);
|
|
49
|
-
var conditionalStyles = compressed && textStyle
|
|
49
|
+
var conditionalStyles = compressed && textStyle !== 'reverse' ? [styles.fontStyles.compressed] : [styles.fontStyles[textStyle]];
|
|
50
50
|
|
|
51
51
|
switch (type) {
|
|
52
52
|
case 'inline':
|
|
@@ -28,8 +28,7 @@ var horizontalPositionToClassNameMap = {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
* Use EuiPageSection instead
|
|
31
|
+
* @deprecated Use EuiPageSection instead
|
|
33
32
|
*/
|
|
34
33
|
var EuiPageContent_Deprecated = function EuiPageContent_Deprecated(_ref) {
|
|
35
34
|
var verticalPosition = _ref.verticalPosition,
|
|
@@ -34,8 +34,7 @@ var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
|
|
|
34
34
|
exports.PADDING_SIZES = PADDING_SIZES;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
38
|
-
* Use EuiPageSection instead
|
|
37
|
+
* @deprecated Use EuiPageSection instead
|
|
39
38
|
*/
|
|
40
39
|
var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
|
|
41
40
|
var children = _ref.children,
|
|
@@ -20,8 +20,7 @@ var _react2 = require("@emotion/react");
|
|
|
20
20
|
var _excluded = ["children", "className", "responsive"];
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Use EuiPageHeader instead
|
|
23
|
+
* @deprecated Use EuiPageHeader instead
|
|
25
24
|
*/
|
|
26
25
|
var EuiPageContentHeader_Deprecated = function EuiPageContentHeader_Deprecated(_ref) {
|
|
27
26
|
var children = _ref.children,
|
|
@@ -20,8 +20,7 @@ var _react2 = require("@emotion/react");
|
|
|
20
20
|
var _excluded = ["children", "className"];
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Use EuiPageHeader instead
|
|
23
|
+
* @deprecated Use EuiPageHeader instead
|
|
25
24
|
*/
|
|
26
25
|
var EuiPageContentHeaderSection_Deprecated = function EuiPageContentHeaderSection_Deprecated(_ref) {
|
|
27
26
|
var children = _ref.children,
|
|
@@ -23,7 +23,7 @@ var _global_styling = require("../../../global_styling");
|
|
|
23
23
|
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps"];
|
|
26
|
+
var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps", "component"];
|
|
27
27
|
|
|
28
28
|
var EuiPageSection = function EuiPageSection(_ref) {
|
|
29
29
|
var children = _ref.children,
|
|
@@ -39,6 +39,8 @@ var EuiPageSection = function EuiPageSection(_ref) {
|
|
|
39
39
|
_ref$grow = _ref.grow,
|
|
40
40
|
grow = _ref$grow === void 0 ? false : _ref$grow,
|
|
41
41
|
contentProps = _ref.contentProps,
|
|
42
|
+
_ref$component = _ref.component,
|
|
43
|
+
Component = _ref$component === void 0 ? 'section' : _ref$component,
|
|
42
44
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
43
45
|
// Set max-width as a style prop
|
|
44
46
|
var widthStyles = (0, _restrict_width.setStyleForRestrictedPageWidth)(restrictWidth, contentProps === null || contentProps === void 0 ? void 0 : contentProps.style);
|
|
@@ -50,7 +52,7 @@ var EuiPageSection = function EuiPageSection(_ref) {
|
|
|
50
52
|
var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
|
|
51
53
|
var contentStyles = (0, _page_section.euiPageSectionContentStyles)();
|
|
52
54
|
var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
|
|
53
|
-
return (0, _react2.jsx)(
|
|
55
|
+
return (0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
54
56
|
css: cssStyles
|
|
55
57
|
}, rest), (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
56
58
|
css: cssContentStyles
|
|
@@ -30,8 +30,7 @@ var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
|
|
|
30
30
|
exports.PADDING_SIZES = PADDING_SIZES;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
* Use the new EuiPageSidebar instead
|
|
33
|
+
* @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
|
|
35
34
|
*/
|
|
36
35
|
var EuiPageSideBar_Deprecated = function EuiPageSideBar_Deprecated(_ref) {
|
|
37
36
|
var children = _ref.children,
|
|
@@ -63,13 +63,17 @@ var EuiPageSidebar = function EuiPageSidebar(_ref) {
|
|
|
63
63
|
setInlineStyles = _useState2[1];
|
|
64
64
|
|
|
65
65
|
(0, _react.useEffect)(function () {
|
|
66
|
+
var updatedStyles = _objectSpread(_objectSpread({}, style), (0, _global_styling.logicalStyle)('min-width', isResponding ? '100%' : minWidth));
|
|
67
|
+
|
|
66
68
|
if (sticky) {
|
|
67
69
|
var _document$body$datase;
|
|
68
70
|
|
|
69
71
|
var euiHeaderFixedCounter = Number((_document$body$datase = document.body.dataset.fixedHeaders) !== null && _document$body$datase !== void 0 ? _document$body$datase : 0);
|
|
70
72
|
var offset = (0, _typeof2.default)(sticky) === 'object' ? sticky === null || sticky === void 0 ? void 0 : sticky.offset : themeContext.euiTheme.base * 3 * euiHeaderFixedCounter;
|
|
71
|
-
|
|
73
|
+
updatedStyles = _objectSpread(_objectSpread(_objectSpread({}, updatedStyles), (0, _global_styling.logicalStyle)('top', offset)), (0, _global_styling.logicalStyle)('max-height', "calc(100vh - ".concat(offset, "px)")));
|
|
72
74
|
}
|
|
75
|
+
|
|
76
|
+
setInlineStyles(updatedStyles);
|
|
73
77
|
}, [style, sticky, themeContext.euiTheme.base, isResponding, minWidth]);
|
|
74
78
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
75
79
|
className: className,
|
|
@@ -49,7 +49,9 @@ exports.TEMPLATES = TEMPLATES;
|
|
|
49
49
|
/**
|
|
50
50
|
* This component has been deprecated in favor of the new
|
|
51
51
|
* namespaced version. You can still import this component
|
|
52
|
-
*
|
|
52
|
+
* until August 2023 by importing `as EuiPageTemplate`.
|
|
53
|
+
*
|
|
54
|
+
* @deprecated use EuiPageTemplate from page_template/page_template instead
|
|
53
55
|
*/
|
|
54
56
|
var EuiPageTemplate_Deprecated = function EuiPageTemplate_Deprecated(_ref) {
|
|
55
57
|
var _pageBodyProps2;
|
|
@@ -9,8 +9,6 @@ exports.EuiCacheProvider = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
13
|
-
|
|
14
12
|
var _react2 = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
/*
|
|
@@ -20,18 +18,12 @@ var _react2 = require("@emotion/react");
|
|
|
20
18
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
19
|
* Side Public License, v 1.
|
|
22
20
|
*/
|
|
23
|
-
var defaultCache = (0, _cache.default)({
|
|
24
|
-
key: 'css'
|
|
25
|
-
});
|
|
26
|
-
defaultCache.compat = true;
|
|
27
|
-
|
|
28
21
|
var EuiCacheProvider = function EuiCacheProvider(_ref) {
|
|
29
|
-
var
|
|
30
|
-
cache = _ref$cache === void 0 ? defaultCache : _ref$cache,
|
|
22
|
+
var cache = _ref.cache,
|
|
31
23
|
children = _ref.children;
|
|
32
|
-
return (0, _react2.jsx)(_react2.CacheProvider, {
|
|
24
|
+
return children && cache ? (0, _react2.jsx)(_react2.CacheProvider, {
|
|
33
25
|
value: cache
|
|
34
|
-
}, children);
|
|
26
|
+
}, children) : (0, _react2.jsx)(_react.default.Fragment, null, children);
|
|
35
27
|
};
|
|
36
28
|
|
|
37
29
|
exports.EuiCacheProvider = EuiCacheProvider;
|
|
@@ -9,6 +9,8 @@ exports.EuiProvider = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
+
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
13
|
+
|
|
12
14
|
var _global_styles = require("../../global_styling/reset/global_styles");
|
|
13
15
|
|
|
14
16
|
var _utility = require("../../global_styling/utility/utility");
|
|
@@ -17,7 +19,7 @@ var _services = require("../../services");
|
|
|
17
19
|
|
|
18
20
|
var _themes = require("../../themes");
|
|
19
21
|
|
|
20
|
-
var
|
|
22
|
+
var _cache2 = require("./cache");
|
|
21
23
|
|
|
22
24
|
var _react2 = require("@emotion/react");
|
|
23
25
|
|
|
@@ -32,8 +34,16 @@ var isEmotionCacheObject = function isEmotionCacheObject(obj) {
|
|
|
32
34
|
return obj.hasOwnProperty('key');
|
|
33
35
|
};
|
|
34
36
|
|
|
37
|
+
var fallbackCache = (0, _cache.default)({
|
|
38
|
+
key: 'css'
|
|
39
|
+
});
|
|
40
|
+
fallbackCache.compat = true;
|
|
41
|
+
|
|
35
42
|
var EuiProvider = function EuiProvider(_ref) {
|
|
36
|
-
var
|
|
43
|
+
var _defaultCache;
|
|
44
|
+
|
|
45
|
+
var _ref$cache = _ref.cache,
|
|
46
|
+
cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
|
|
37
47
|
_ref$theme = _ref.theme,
|
|
38
48
|
theme = _ref$theme === void 0 ? _themes.EuiThemeAmsterdam : _ref$theme,
|
|
39
49
|
_ref$globalStyles = _ref.globalStyles,
|
|
@@ -49,24 +59,39 @@ var EuiProvider = function EuiProvider(_ref) {
|
|
|
49
59
|
|
|
50
60
|
if (cache) {
|
|
51
61
|
if (isEmotionCacheObject(cache)) {
|
|
62
|
+
cache.compat = true;
|
|
52
63
|
defaultCache = cache;
|
|
53
64
|
} else {
|
|
65
|
+
if (cache.default) {
|
|
66
|
+
cache.default.compat = true;
|
|
67
|
+
}
|
|
68
|
+
|
|
54
69
|
defaultCache = cache.default;
|
|
70
|
+
|
|
71
|
+
if (cache.global) {
|
|
72
|
+
cache.global.compat = true;
|
|
73
|
+
}
|
|
74
|
+
|
|
55
75
|
globalCache = cache.global;
|
|
76
|
+
|
|
77
|
+
if (cache.utility) {
|
|
78
|
+
cache.utility.compat = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
56
81
|
utilityCache = cache.utility;
|
|
57
82
|
}
|
|
58
83
|
}
|
|
59
84
|
|
|
60
|
-
return (0, _react2.jsx)(
|
|
61
|
-
cache: defaultCache
|
|
85
|
+
return (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
86
|
+
cache: (_defaultCache = defaultCache) !== null && _defaultCache !== void 0 ? _defaultCache : fallbackCache
|
|
62
87
|
}, (0, _react2.jsx)(_services.EuiThemeProvider, {
|
|
63
88
|
theme: theme !== null && theme !== void 0 ? theme : undefined,
|
|
64
89
|
colorMode: colorMode,
|
|
65
90
|
modify: modify
|
|
66
|
-
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(
|
|
91
|
+
}, theme && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
67
92
|
cache: globalCache,
|
|
68
93
|
children: Globals && (0, _react2.jsx)(Globals, null)
|
|
69
|
-
}), (0, _react2.jsx)(
|
|
94
|
+
}), (0, _react2.jsx)(_cache2.EuiCacheProvider, {
|
|
70
95
|
cache: utilityCache,
|
|
71
96
|
children: Utilities && (0, _react2.jsx)(Utilities, null)
|
|
72
97
|
})), (0, _react2.jsx)(_services.CurrentEuiBreakpointProvider, null, children)));
|