@elastic/eui 59.0.1 → 59.1.0-rc1
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 +2 -136
- package/dist/eui_theme_dark.json +0 -6
- package/dist/eui_theme_dark.json.d.ts +0 -6
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +2 -136
- package/dist/eui_theme_light.json +0 -6
- package/dist/eui_theme_light.json.d.ts +0 -6
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/accessibility/skip_link/skip_link.js +9 -7
- package/es/components/avatar/avatar.js +9 -7
- package/es/components/bottom_bar/bottom_bar.js +8 -9
- package/es/components/breadcrumbs/breadcrumbs.js +2 -1
- package/es/components/button/{button_content.js → _button_content_deprecated.js} +4 -3
- package/es/components/button/button.js +16 -10
- package/es/components/button/button_display/_button_display.js +141 -0
- package/es/components/button/button_display/_button_display.styles.js +53 -0
- package/es/components/button/button_display/_button_display_content.js +100 -0
- package/es/components/button/button_display/_button_display_content.styles.js +61 -0
- package/es/components/button/button_empty/button_empty.js +3 -2
- package/es/components/button/button_group/button_group.js +2 -1
- package/es/components/button/button_group/button_group_button.js +3 -2
- package/es/components/call_out/call_out.js +9 -8
- package/es/components/card/card.js +2 -1
- package/es/components/card/card_select.js +2 -1
- package/es/components/date_picker/auto_refresh/auto_refresh.js +2 -1
- package/es/components/expression/expression.js +11 -10
- package/es/components/facet/facet_button.js +36 -19
- package/es/components/facet/facet_button.styles.js +64 -0
- package/es/components/facet/facet_group.js +17 -27
- package/es/components/facet/facet_group.styles.js +79 -0
- package/es/components/header/header_links/header_link.js +2 -1
- package/es/components/health/health.js +7 -6
- package/es/components/horizontal_rule/horizontal_rule.js +7 -6
- package/es/components/link/link.js +8 -7
- package/es/components/loading/loading_chart.js +7 -6
- package/es/components/loading/loading_content.js +7 -6
- package/es/components/loading/loading_logo.js +7 -6
- package/es/components/loading/loading_spinner.js +20 -8
- package/es/components/loading/loading_spinner.styles.js +4 -4
- package/es/components/mark/mark.js +9 -8
- package/es/components/markdown_editor/markdown_format.js +7 -6
- package/es/components/notification/notification_event.js +2 -1
- package/es/components/pagination/pagination_button.js +2 -1
- package/es/components/panel/panel.js +8 -7
- package/es/components/provider/cache/cache_context.js +12 -0
- package/es/components/provider/cache/cache_provider.js +17 -0
- package/es/components/provider/cache/index.js +9 -0
- package/es/components/provider/index.js +1 -1
- package/es/components/provider/provider.js +39 -5
- package/es/components/provider/system/index.js +8 -0
- package/es/components/provider/system/system.js +33 -0
- package/es/components/spacer/spacer.js +7 -6
- package/es/components/text/text.js +7 -6
- package/es/components/text/text_color.js +7 -6
- package/es/components/timeline/timeline_item.js +7 -6
- package/es/components/timeline/timeline_item_icon.js +7 -6
- package/es/components/title/title.js +7 -6
- package/es/global_styling/utility/utility.js +27 -0
- package/es/services/theme/hooks.js +2 -2
- package/es/services/theme/provider.js +1 -5
- package/eui.d.ts +1030 -357
- package/i18ntokens.json +12 -12
- package/lib/components/accessibility/skip_link/skip_link.js +13 -10
- package/lib/components/avatar/avatar.js +12 -8
- package/lib/components/bottom_bar/bottom_bar.js +9 -6
- package/lib/components/breadcrumbs/breadcrumbs.js +2 -1
- package/lib/components/button/{button_content.js → _button_content_deprecated.js} +6 -5
- package/lib/components/button/button.js +19 -13
- package/lib/components/button/button_display/_button_display.js +146 -0
- package/lib/components/button/button_display/_button_display.styles.js +59 -0
- package/lib/components/button/button_display/_button_display_content.js +111 -0
- package/lib/components/button/button_display/_button_display_content.styles.js +64 -0
- package/lib/components/button/button_empty/button_empty.js +4 -3
- package/lib/components/button/button_group/button_group.js +2 -1
- package/lib/components/button/button_group/button_group_button.js +3 -2
- package/lib/components/call_out/call_out.js +14 -10
- package/lib/components/card/card.js +2 -1
- package/lib/components/card/card_select.js +2 -1
- package/lib/components/date_picker/auto_refresh/auto_refresh.js +2 -1
- package/lib/components/expression/expression.js +14 -12
- package/lib/components/facet/facet_button.js +43 -21
- package/lib/components/facet/facet_button.styles.js +79 -0
- package/lib/components/facet/facet_group.js +20 -29
- package/lib/components/facet/facet_group.styles.js +82 -0
- package/lib/components/header/header_links/header_link.js +2 -1
- package/lib/components/health/health.js +10 -8
- package/lib/components/horizontal_rule/horizontal_rule.js +10 -8
- package/lib/components/link/link.js +13 -7
- package/lib/components/loading/loading_chart.js +10 -8
- package/lib/components/loading/loading_content.js +10 -8
- package/lib/components/loading/loading_logo.js +10 -8
- package/lib/components/loading/loading_spinner.js +23 -10
- package/lib/components/loading/loading_spinner.styles.js +4 -4
- package/lib/components/mark/mark.js +12 -10
- package/lib/components/markdown_editor/markdown_format.js +10 -8
- package/lib/components/notification/notification_event.js +2 -1
- package/lib/components/panel/panel.js +11 -9
- package/lib/components/provider/cache/cache_context.js +24 -0
- package/lib/components/provider/cache/cache_provider.js +29 -0
- package/lib/components/provider/cache/index.js +31 -0
- package/lib/components/provider/index.js +12 -7
- package/lib/components/provider/provider.js +40 -5
- package/lib/components/provider/system/index.js +18 -0
- package/lib/components/provider/system/system.js +45 -0
- package/lib/components/spacer/spacer.js +10 -8
- package/lib/components/text/text.js +10 -8
- package/lib/components/text/text_color.js +10 -8
- package/lib/components/timeline/timeline_item.js +10 -8
- package/lib/components/timeline/timeline_item_icon.js +10 -8
- package/lib/components/title/title.js +11 -9
- package/lib/global_styling/utility/utility.js +31 -0
- package/lib/services/theme/hooks.js +2 -2
- package/lib/services/theme/provider.js +3 -6
- package/optimize/es/components/accessibility/skip_link/skip_link.js +6 -5
- package/optimize/es/components/avatar/avatar.js +7 -5
- package/optimize/es/components/bottom_bar/bottom_bar.js +8 -9
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +2 -1
- package/optimize/es/components/button/{button_content.js → _button_content_deprecated.js} +1 -1
- package/optimize/es/components/button/button.js +13 -8
- package/optimize/es/components/button/button_display/_button_display.js +73 -0
- package/optimize/es/components/button/button_display/_button_display.styles.js +53 -0
- package/optimize/es/components/button/button_display/_button_display_content.js +67 -0
- package/optimize/es/components/button/button_display/_button_display_content.styles.js +61 -0
- package/optimize/es/components/button/button_empty/button_empty.js +1 -1
- package/optimize/es/components/button/button_group/button_group_button.js +1 -1
- package/optimize/es/components/call_out/call_out.js +8 -7
- package/optimize/es/components/expression/expression.js +10 -9
- package/optimize/es/components/facet/facet_button.js +35 -18
- package/optimize/es/components/facet/facet_button.styles.js +64 -0
- package/optimize/es/components/facet/facet_group.js +14 -24
- package/optimize/es/components/facet/facet_group.styles.js +79 -0
- package/optimize/es/components/health/health.js +6 -5
- package/optimize/es/components/horizontal_rule/horizontal_rule.js +6 -5
- package/optimize/es/components/link/link.js +7 -6
- package/optimize/es/components/loading/loading_chart.js +6 -5
- package/optimize/es/components/loading/loading_content.js +6 -5
- package/optimize/es/components/loading/loading_logo.js +6 -5
- package/optimize/es/components/loading/loading_spinner.js +8 -6
- package/optimize/es/components/loading/loading_spinner.styles.js +4 -4
- package/optimize/es/components/mark/mark.js +8 -7
- package/optimize/es/components/markdown_editor/markdown_format.js +6 -5
- package/optimize/es/components/panel/panel.js +7 -6
- package/optimize/es/components/provider/cache/cache_context.js +12 -0
- package/optimize/es/components/provider/cache/cache_provider.js +17 -0
- package/optimize/es/components/provider/cache/index.js +9 -0
- package/optimize/es/components/provider/index.js +1 -1
- package/optimize/es/components/provider/provider.js +39 -5
- package/optimize/es/components/provider/system/index.js +8 -0
- package/optimize/es/components/provider/system/system.js +33 -0
- package/optimize/es/components/spacer/spacer.js +6 -5
- package/optimize/es/components/text/text.js +6 -5
- package/optimize/es/components/text/text_color.js +6 -5
- package/optimize/es/components/timeline/timeline_item.js +6 -5
- package/optimize/es/components/timeline/timeline_item_icon.js +6 -5
- package/optimize/es/components/title/title.js +6 -5
- package/optimize/es/global_styling/utility/utility.js +27 -0
- package/optimize/es/services/theme/hooks.js +2 -2
- package/optimize/es/services/theme/provider.js +1 -5
- package/optimize/lib/components/accessibility/skip_link/skip_link.js +8 -6
- package/optimize/lib/components/avatar/avatar.js +9 -5
- package/optimize/lib/components/bottom_bar/bottom_bar.js +9 -6
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +2 -1
- package/optimize/lib/components/button/{button_content.js → _button_content_deprecated.js} +3 -3
- package/optimize/lib/components/button/button.js +16 -11
- package/optimize/lib/components/button/button_display/_button_display.js +79 -0
- package/optimize/lib/components/button/button_display/_button_display.styles.js +59 -0
- package/optimize/lib/components/button/button_display/_button_display_content.js +78 -0
- package/optimize/lib/components/button/button_display/_button_display_content.styles.js +64 -0
- package/optimize/lib/components/button/button_empty/button_empty.js +2 -2
- package/optimize/lib/components/button/button_group/button_group_button.js +1 -1
- package/optimize/lib/components/call_out/call_out.js +13 -9
- package/optimize/lib/components/expression/expression.js +11 -9
- package/optimize/lib/components/facet/facet_button.js +40 -18
- package/optimize/lib/components/facet/facet_button.styles.js +79 -0
- package/optimize/lib/components/facet/facet_group.js +15 -24
- package/optimize/lib/components/facet/facet_group.styles.js +82 -0
- package/optimize/lib/components/health/health.js +7 -5
- package/optimize/lib/components/horizontal_rule/horizontal_rule.js +7 -5
- package/optimize/lib/components/link/link.js +12 -6
- package/optimize/lib/components/loading/loading_chart.js +7 -5
- package/optimize/lib/components/loading/loading_content.js +7 -5
- package/optimize/lib/components/loading/loading_logo.js +7 -5
- package/optimize/lib/components/loading/loading_spinner.js +9 -6
- package/optimize/lib/components/loading/loading_spinner.styles.js +4 -4
- package/optimize/lib/components/mark/mark.js +9 -7
- package/optimize/lib/components/markdown_editor/markdown_format.js +7 -5
- package/optimize/lib/components/panel/panel.js +8 -6
- package/optimize/lib/components/provider/cache/cache_context.js +24 -0
- package/optimize/lib/components/provider/cache/cache_provider.js +29 -0
- package/optimize/lib/components/provider/cache/index.js +31 -0
- package/optimize/lib/components/provider/index.js +12 -7
- package/optimize/lib/components/provider/provider.js +40 -5
- package/optimize/lib/components/provider/system/index.js +18 -0
- package/optimize/lib/components/provider/system/system.js +54 -0
- package/optimize/lib/components/spacer/spacer.js +7 -5
- package/optimize/lib/components/text/text.js +7 -5
- package/optimize/lib/components/text/text_color.js +7 -5
- package/optimize/lib/components/timeline/timeline_item.js +7 -5
- package/optimize/lib/components/timeline/timeline_item_icon.js +7 -5
- package/optimize/lib/components/title/title.js +8 -6
- package/optimize/lib/global_styling/utility/utility.js +31 -0
- package/optimize/lib/services/theme/hooks.js +2 -2
- package/optimize/lib/services/theme/provider.js +3 -6
- package/package.json +1 -1
- package/src/components/index.scss +0 -1
- package/src/components/selectable/selectable_message/_selectable_message.scss +1 -0
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/accessibility/skip_link/skip_link.js +13 -10
- package/test-env/components/avatar/avatar.js +12 -8
- package/test-env/components/bottom_bar/bottom_bar.js +9 -6
- package/test-env/components/breadcrumbs/breadcrumbs.js +2 -1
- package/test-env/components/button/{button_content.js → _button_content_deprecated.js} +6 -5
- package/test-env/components/button/button.js +19 -13
- package/test-env/components/button/button_display/_button_display.js +143 -0
- package/test-env/components/button/button_display/_button_display.styles.js +59 -0
- package/test-env/components/button/button_display/_button_display_content.js +108 -0
- package/test-env/components/button/button_display/_button_display_content.styles.js +64 -0
- package/test-env/components/button/button_empty/button_empty.js +4 -3
- package/test-env/components/button/button_group/button_group.js +2 -1
- package/test-env/components/button/button_group/button_group_button.js +3 -2
- package/test-env/components/call_out/call_out.js +14 -10
- package/test-env/components/card/card.js +2 -1
- package/test-env/components/card/card_select.js +2 -1
- package/test-env/components/date_picker/auto_refresh/auto_refresh.js +2 -1
- package/test-env/components/expression/expression.js +14 -12
- package/test-env/components/facet/facet_button.js +43 -21
- package/test-env/components/facet/facet_button.styles.js +79 -0
- package/test-env/components/facet/facet_group.js +20 -29
- package/test-env/components/facet/facet_group.styles.js +82 -0
- package/test-env/components/header/header_links/header_link.js +2 -1
- package/test-env/components/health/health.js +10 -8
- package/test-env/components/horizontal_rule/horizontal_rule.js +10 -8
- package/test-env/components/link/link.js +13 -7
- package/test-env/components/loading/loading_chart.js +10 -8
- package/test-env/components/loading/loading_content.js +10 -8
- package/test-env/components/loading/loading_logo.js +10 -8
- package/test-env/components/loading/loading_spinner.js +23 -10
- package/test-env/components/loading/loading_spinner.styles.js +4 -4
- package/test-env/components/mark/mark.js +12 -10
- package/test-env/components/markdown_editor/markdown_format.js +10 -8
- package/test-env/components/notification/notification_event.js +2 -1
- package/test-env/components/panel/panel.js +11 -9
- package/test-env/components/provider/cache/cache_context.js +24 -0
- package/test-env/components/provider/cache/cache_provider.js +29 -0
- package/test-env/components/provider/cache/index.js +31 -0
- package/test-env/components/provider/index.js +12 -7
- package/test-env/components/provider/provider.js +40 -5
- package/test-env/components/provider/system/index.js +18 -0
- package/test-env/components/provider/system/system.js +54 -0
- package/test-env/components/spacer/spacer.js +10 -8
- package/test-env/components/text/text.js +10 -8
- package/test-env/components/text/text_color.js +10 -8
- package/test-env/components/timeline/timeline_item.js +10 -8
- package/test-env/components/timeline/timeline_item_icon.js +10 -8
- package/test-env/components/title/title.js +11 -9
- package/test-env/global_styling/utility/utility.js +31 -0
- package/test-env/services/theme/hooks.js +2 -2
- package/test-env/services/theme/provider.js +3 -6
- package/src/components/facet/_facet_button.scss +0 -69
- package/src/components/facet/_facet_group.scss +0 -24
- package/src/components/facet/_index.scss +0 -4
- package/src/components/facet/_variables.scss +0 -6
- package/src/themes/amsterdam/overrides/_facet.scss +0 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "color", "component", "cloneElement", "style"];
|
|
3
|
+
var _excluded = ["children", "color", "component", "cloneElement", "style", "euiTheme"];
|
|
4
4
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
@@ -15,11 +15,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
15
15
|
*/
|
|
16
16
|
import React, { isValidElement } from 'react';
|
|
17
17
|
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
18
|
-
import {
|
|
18
|
+
import { withEuiSystem } from '../provider/system';
|
|
19
19
|
import { euiTextColorStyles } from './text_color.styles';
|
|
20
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
21
21
|
export var COLORS = ['default', 'subdued', 'success', 'accent', 'danger', 'warning', 'ghost', 'inherit'];
|
|
22
|
-
export var
|
|
22
|
+
export var _EuiTextColor = function _EuiTextColor(_ref) {
|
|
23
23
|
var children = _ref.children,
|
|
24
24
|
_ref$color = _ref.color,
|
|
25
25
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
@@ -28,10 +28,10 @@ export var EuiTextColor = function EuiTextColor(_ref) {
|
|
|
28
28
|
_ref$cloneElement = _ref.cloneElement,
|
|
29
29
|
cloneElement = _ref$cloneElement === void 0 ? false : _ref$cloneElement,
|
|
30
30
|
style = _ref.style,
|
|
31
|
+
euiTheme = _ref.euiTheme,
|
|
31
32
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
33
|
|
|
33
34
|
var isNamedColor = COLORS.includes(color);
|
|
34
|
-
var euiTheme = useEuiTheme();
|
|
35
35
|
var styles = euiTextColorStyles(euiTheme);
|
|
36
36
|
var cssStyles = [styles.euiTextColor, isNamedColor ? styles[color] : styles.customColor]; // We're checking if is a custom color.
|
|
37
37
|
// If it is a custom color we set the `color` of the `.euiTextColor` div to that custom color.
|
|
@@ -56,4 +56,5 @@ export var EuiTextColor = function EuiTextColor(_ref) {
|
|
|
56
56
|
var Component = component;
|
|
57
57
|
return ___EmotionJSX(Component, props, children);
|
|
58
58
|
}
|
|
59
|
-
};
|
|
59
|
+
};
|
|
60
|
+
export var EuiTextColor = withEuiSystem(_EuiTextColor);
|
|
@@ -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", "verticalAlign", "icon", "iconAriaLabel", "className", "component"];
|
|
3
|
+
var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "className", "component", "euiTheme"];
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -10,13 +10,13 @@ var _excluded = ["children", "verticalAlign", "icon", "iconAriaLabel", "classNam
|
|
|
10
10
|
* Side Public License, v 1.
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import {
|
|
13
|
+
import { withEuiSystem } from '../provider/system';
|
|
14
14
|
import { EuiTimelineItemEvent } from './timeline_item_event';
|
|
15
15
|
import { EuiTimelineItemIcon } from './timeline_item_icon';
|
|
16
16
|
import { euiTimelineItemStyles } from './timeline_item.styles';
|
|
17
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
18
|
export var VERTICAL_ALIGN = ['top', 'center'];
|
|
19
|
-
export var
|
|
19
|
+
export var _EuiTimelineItem = function _EuiTimelineItem(_ref) {
|
|
20
20
|
var children = _ref.children,
|
|
21
21
|
_ref$verticalAlign = _ref.verticalAlign,
|
|
22
22
|
verticalAlign = _ref$verticalAlign === void 0 ? 'center' : _ref$verticalAlign,
|
|
@@ -25,9 +25,9 @@ export var EuiTimelineItem = function EuiTimelineItem(_ref) {
|
|
|
25
25
|
className = _ref.className,
|
|
26
26
|
_ref$component = _ref.component,
|
|
27
27
|
component = _ref$component === void 0 ? 'li' : _ref$component,
|
|
28
|
+
euiTheme = _ref.euiTheme,
|
|
28
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
30
|
|
|
30
|
-
var euiTheme = useEuiTheme();
|
|
31
31
|
var styles = euiTimelineItemStyles(euiTheme);
|
|
32
32
|
var cssStyles = [styles.euiTimelineItem];
|
|
33
33
|
var Element = component;
|
|
@@ -40,4 +40,5 @@ export var EuiTimelineItem = function EuiTimelineItem(_ref) {
|
|
|
40
40
|
}), ___EmotionJSX(EuiTimelineItemEvent, {
|
|
41
41
|
verticalAlign: verticalAlign
|
|
42
42
|
}, children));
|
|
43
|
-
};
|
|
43
|
+
};
|
|
44
|
+
export var EuiTimelineItem = withEuiSystem(_EuiTimelineItem);
|
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { EuiAvatar } from '../avatar';
|
|
10
|
-
import {
|
|
10
|
+
import { withEuiSystem } from '../provider/system';
|
|
11
11
|
import { euiTimelineItemIconStyles } from './timeline_item_icon.styles';
|
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
13
|
-
export var
|
|
13
|
+
export var _EuiTimelineItemIcon = function _EuiTimelineItemIcon(_ref) {
|
|
14
14
|
var icon = _ref.icon,
|
|
15
15
|
_ref$verticalAlign = _ref.verticalAlign,
|
|
16
16
|
verticalAlign = _ref$verticalAlign === void 0 ? 'center' : _ref$verticalAlign,
|
|
17
|
-
iconAriaLabel = _ref.iconAriaLabel
|
|
18
|
-
|
|
17
|
+
iconAriaLabel = _ref.iconAriaLabel,
|
|
18
|
+
euiTheme = _ref.euiTheme;
|
|
19
19
|
var styles = euiTimelineItemIconStyles(euiTheme);
|
|
20
20
|
var cssStyles = [styles.euiTimelineItemIcon, styles[verticalAlign]];
|
|
21
21
|
var cssContentStyles = styles.euiTimelineItemIcon__content;
|
|
@@ -30,4 +30,5 @@ export var EuiTimelineItemIcon = function EuiTimelineItemIcon(_ref) {
|
|
|
30
30
|
}, ___EmotionJSX("div", {
|
|
31
31
|
css: cssContentStyles
|
|
32
32
|
}, iconRender));
|
|
33
|
-
};
|
|
33
|
+
};
|
|
34
|
+
export var EuiTimelineItemIcon = withEuiSystem(_EuiTimelineItemIcon);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["size", "children", "className", "textTransform"];
|
|
3
|
+
var _excluded = ["size", "children", "className", "textTransform", "euiTheme"];
|
|
4
4
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
@@ -14,20 +14,20 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
14
|
* Side Public License, v 1.
|
|
15
15
|
*/
|
|
16
16
|
import classNames from 'classnames';
|
|
17
|
-
import { useEuiTheme } from '../../services';
|
|
18
17
|
import { cloneElementWithCss } from '../../services/theme/clone_element';
|
|
19
18
|
import { euiTitleStyles } from './title.styles';
|
|
19
|
+
import { withEuiSystem } from '../provider/system';
|
|
20
20
|
export var TITLE_SIZES = ['xxxs', 'xxs', 'xs', 's', 'm', 'l'];
|
|
21
21
|
export var TEXT_TRANSFORM = ['uppercase'];
|
|
22
|
-
export var
|
|
22
|
+
export var _EuiTitle = function _EuiTitle(_ref) {
|
|
23
23
|
var _ref$size = _ref.size,
|
|
24
24
|
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
25
25
|
children = _ref.children,
|
|
26
26
|
className = _ref.className,
|
|
27
27
|
textTransform = _ref.textTransform,
|
|
28
|
+
euiTheme = _ref.euiTheme,
|
|
28
29
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
30
|
|
|
30
|
-
var euiTheme = useEuiTheme();
|
|
31
31
|
var styles = euiTitleStyles(euiTheme);
|
|
32
32
|
var cssStyles = [styles.euiTitle, textTransform ? styles[textTransform] : undefined, styles[size]];
|
|
33
33
|
var classes = classNames('euiTitle', className, children.props.className);
|
|
@@ -38,4 +38,5 @@ export var EuiTitle = function EuiTitle(_ref) {
|
|
|
38
38
|
}, rest);
|
|
39
39
|
|
|
40
40
|
return cloneElementWithCss(children, props);
|
|
41
|
-
};
|
|
41
|
+
};
|
|
42
|
+
export var EuiTitle = withEuiSystem(_EuiTitle);
|
|
@@ -0,0 +1,27 @@
|
|
|
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 React from 'react';
|
|
11
|
+
import { Global, css } from '@emotion/react';
|
|
12
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
13
|
+
|
|
14
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "bd8dxy-EuiUtilityClasses",
|
|
16
|
+
styles: ".euiYolo{color:coral;};label:EuiUtilityClasses;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "bd8dxy-EuiUtilityClasses",
|
|
19
|
+
styles: ".euiYolo{color:coral;};label:EuiUtilityClasses;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export var EuiUtilityClasses = function EuiUtilityClasses() {
|
|
24
|
+
return ___EmotionJSX(Global, {
|
|
25
|
+
styles: _ref
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -21,7 +21,7 @@ export var useEuiTheme = function useEuiTheme() {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
export var withEuiTheme = function withEuiTheme(Component) {
|
|
24
|
-
var componentName = Component.displayName || Component.name || '
|
|
24
|
+
var componentName = Component.displayName || Component.name || 'ComponentWithTheme';
|
|
25
25
|
|
|
26
26
|
var Render = function Render(props, ref) {
|
|
27
27
|
var _useEuiTheme = useEuiTheme(),
|
|
@@ -40,6 +40,6 @@ export var withEuiTheme = function withEuiTheme(Component) {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
var WithEuiTheme = /*#__PURE__*/forwardRef(Render);
|
|
43
|
-
WithEuiTheme.displayName =
|
|
43
|
+
WithEuiTheme.displayName = componentName;
|
|
44
44
|
return WithEuiTheme;
|
|
45
45
|
};
|
|
@@ -8,7 +8,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
8
8
|
* Side Public License, v 1.
|
|
9
9
|
*/
|
|
10
10
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
11
|
-
import { CacheProvider } from '@emotion/react';
|
|
12
11
|
import isEqual from 'lodash/isEqual';
|
|
13
12
|
import { EuiSystemContext, EuiThemeContext, EuiModificationsContext, EuiColorModeContext } from './context';
|
|
14
13
|
import { buildTheme, getColorMode, getComputed, mergeDeep } from './utils';
|
|
@@ -17,7 +16,6 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
17
16
|
var _system = _ref.theme,
|
|
18
17
|
_colorMode = _ref.colorMode,
|
|
19
18
|
_modifications = _ref.modify,
|
|
20
|
-
cache = _ref.cache,
|
|
21
19
|
children = _ref.children;
|
|
22
20
|
var parentSystem = useContext(EuiSystemContext);
|
|
23
21
|
var parentModifications = useContext(EuiModificationsContext);
|
|
@@ -91,7 +89,5 @@ export var EuiThemeProvider = function EuiThemeProvider(_ref) {
|
|
|
91
89
|
value: modifications
|
|
92
90
|
}, ___EmotionJSX(EuiThemeContext.Provider, {
|
|
93
91
|
value: theme
|
|
94
|
-
},
|
|
95
|
-
value: cache
|
|
96
|
-
}, children) : children))));
|
|
92
|
+
}, children))));
|
|
97
93
|
};
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.POSITIONS = exports.EuiSkipLink = void 0;
|
|
8
|
+
exports._EuiSkipLink = exports.POSITIONS = exports.EuiSkipLink = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -15,29 +15,29 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
17
|
|
|
18
|
-
var _services = require("../../../services");
|
|
19
|
-
|
|
20
18
|
var _button = require("../../button/button");
|
|
21
19
|
|
|
20
|
+
var _system = require("../../provider/system");
|
|
21
|
+
|
|
22
22
|
var _screen_reader_only = require("../screen_reader_only");
|
|
23
23
|
|
|
24
24
|
var _skip_link = require("./skip_link.styles");
|
|
25
25
|
|
|
26
26
|
var _react2 = require("@emotion/react");
|
|
27
27
|
|
|
28
|
-
var _excluded = ["destinationId", "tabIndex", "position", "children", "className"];
|
|
28
|
+
var _excluded = ["destinationId", "tabIndex", "position", "children", "className", "euiTheme"];
|
|
29
29
|
var POSITIONS = ['static', 'fixed', 'absolute'];
|
|
30
30
|
exports.POSITIONS = POSITIONS;
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _EuiSkipLink = function _EuiSkipLink(_ref) {
|
|
33
33
|
var destinationId = _ref.destinationId,
|
|
34
34
|
tabIndex = _ref.tabIndex,
|
|
35
35
|
_ref$position = _ref.position,
|
|
36
36
|
position = _ref$position === void 0 ? 'static' : _ref$position,
|
|
37
37
|
children = _ref.children,
|
|
38
38
|
className = _ref.className,
|
|
39
|
+
euiTheme = _ref.euiTheme,
|
|
39
40
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
40
|
-
var euiTheme = (0, _services.useEuiTheme)();
|
|
41
41
|
var styles = (0, _skip_link.euiSkipLinkStyles)(euiTheme);
|
|
42
42
|
var classes = (0, _classnames.default)('euiSkipLink', className);
|
|
43
43
|
var cssStyles = [styles.euiSkipLink, position !== 'static' ? styles[position] : undefined]; // Create the `href` from `destinationId`
|
|
@@ -61,4 +61,6 @@ var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
61
61
|
}, optionalProps, rest), children));
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
+
exports._EuiSkipLink = _EuiSkipLink;
|
|
65
|
+
var EuiSkipLink = (0, _system.withEuiSystem)(_EuiSkipLink);
|
|
64
66
|
exports.EuiSkipLink = EuiSkipLink;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.checkValidColor = exports.TYPES = exports.SIZES = exports.EuiAvatar = void 0;
|
|
8
|
+
exports.checkValidColor = exports._EuiAvatar = exports.TYPES = exports.SIZES = exports.EuiAvatar = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -21,6 +21,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
21
21
|
|
|
22
22
|
var _color = require("../../services/color");
|
|
23
23
|
|
|
24
|
+
var _system = require("../provider/system");
|
|
25
|
+
|
|
24
26
|
var _services = require("../../services");
|
|
25
27
|
|
|
26
28
|
var _icon = require("../icon");
|
|
@@ -29,17 +31,18 @@ var _avatar = require("./avatar.styles");
|
|
|
29
31
|
|
|
30
32
|
var _react2 = require("@emotion/react");
|
|
31
33
|
|
|
32
|
-
var _excluded = ["className", "color", "imageUrl", "initials", "initialsLength", "iconType", "iconSize", "iconColor", "name", "size", "type", "isDisabled", "style"];
|
|
34
|
+
var _excluded = ["className", "color", "euiTheme", "imageUrl", "initials", "initialsLength", "iconType", "iconSize", "iconColor", "name", "size", "type", "isDisabled", "style"];
|
|
33
35
|
var SIZES = ['s', 'm', 'l', 'xl'];
|
|
34
36
|
exports.SIZES = SIZES;
|
|
35
37
|
var TYPES = ['space', 'user'];
|
|
36
38
|
exports.TYPES = TYPES;
|
|
37
39
|
|
|
38
|
-
var
|
|
40
|
+
var _EuiAvatar = function _EuiAvatar(_ref) {
|
|
39
41
|
var _classNames;
|
|
40
42
|
|
|
41
43
|
var className = _ref.className,
|
|
42
44
|
color = _ref.color,
|
|
45
|
+
euiTheme = _ref.euiTheme,
|
|
43
46
|
imageUrl = _ref.imageUrl,
|
|
44
47
|
initials = _ref.initials,
|
|
45
48
|
initialsLength = _ref.initialsLength,
|
|
@@ -55,7 +58,6 @@ var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
55
58
|
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
56
59
|
style = _ref.style,
|
|
57
60
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
58
|
-
var euiTheme = (0, _services.useEuiTheme)();
|
|
59
61
|
var styles = (0, _avatar.euiAvatarStyles)(euiTheme);
|
|
60
62
|
var visColors = (0, _services.euiPaletteColorBlindBehindText)();
|
|
61
63
|
var isPlain = color === 'plain';
|
|
@@ -108,8 +110,10 @@ var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
108
110
|
role: isDisabled ? 'presentation' : 'img',
|
|
109
111
|
title: name
|
|
110
112
|
}, rest), content);
|
|
111
|
-
};
|
|
113
|
+
};
|
|
112
114
|
|
|
115
|
+
exports._EuiAvatar = _EuiAvatar;
|
|
116
|
+
var EuiAvatar = (0, _system.withEuiSystem)(_EuiAvatar); // TODO: Migrate to a service
|
|
113
117
|
|
|
114
118
|
exports.EuiAvatar = EuiAvatar;
|
|
115
119
|
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.paddingSizeToClassNameMap = exports.POSITIONS = exports.EuiBottomBar = void 0;
|
|
10
|
+
exports.paddingSizeToClassNameMap = exports._EuiBottomBar = exports.POSITIONS = exports.EuiBottomBar = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -31,13 +31,15 @@ var _resize_observer = require("../observer/resize_observer");
|
|
|
31
31
|
|
|
32
32
|
var _portal = require("../portal");
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _system = require("../provider/system");
|
|
35
35
|
|
|
36
36
|
var _provider = require("../../services/theme/provider");
|
|
37
37
|
|
|
38
|
+
var _bottom_bar = require("./bottom_bar.styles");
|
|
39
|
+
|
|
38
40
|
var _react2 = require("@emotion/react");
|
|
39
41
|
|
|
40
|
-
var _excluded = ["position", "paddingSize", "affordForDisplacement", "children", "className", "bodyClassName", "landmarkHeading", "usePortal", "left", "right", "bottom", "top", "style"];
|
|
42
|
+
var _excluded = ["position", "paddingSize", "affordForDisplacement", "children", "className", "bodyClassName", "landmarkHeading", "usePortal", "left", "right", "bottom", "top", "style", "euiTheme"];
|
|
41
43
|
|
|
42
44
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
43
45
|
|
|
@@ -79,8 +81,8 @@ var _EuiBottomBar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
79
81
|
bottom = _ref$bottom === void 0 ? 0 : _ref$bottom,
|
|
80
82
|
top = _ref.top,
|
|
81
83
|
style = _ref.style,
|
|
84
|
+
euiTheme = _ref.euiTheme,
|
|
82
85
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
83
|
-
var euiTheme = (0, _services.useEuiTheme)();
|
|
84
86
|
var styles = (0, _bottom_bar.euiBottomBarStyles)(euiTheme); // Force some props if `fixed` position, but not if the user has supplied these
|
|
85
87
|
|
|
86
88
|
affordForDisplacement = position !== 'fixed' ? false : affordForDisplacement;
|
|
@@ -154,10 +156,11 @@ var _EuiBottomBar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
154
156
|
return usePortal ? (0, _react2.jsx)(_portal.EuiPortal, null, bar) : bar;
|
|
155
157
|
});
|
|
156
158
|
|
|
159
|
+
exports._EuiBottomBar = _EuiBottomBar;
|
|
157
160
|
var EuiBottomBar = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
158
|
-
var BottomBar = _EuiBottomBar;
|
|
161
|
+
var BottomBar = (0, _system.withEuiSystem)(_EuiBottomBar);
|
|
159
162
|
return (0, _react2.jsx)(_provider.EuiThemeProvider, {
|
|
160
|
-
colorMode:
|
|
163
|
+
colorMode: "dark"
|
|
161
164
|
}, (0, _react2.jsx)(BottomBar, (0, _extends2.default)({
|
|
162
165
|
ref: ref
|
|
163
166
|
}, props)));
|
|
@@ -183,7 +183,8 @@ var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
183
183
|
}, linkProps, breadcrumbRest), text);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
return (0, _react2.jsx)(_link.EuiLink
|
|
186
|
+
return (0, _react2.jsx)(_link.EuiLink // @ts-expect-error Ref forwarding type mismatch
|
|
187
|
+
, (0, _extends2.default)({
|
|
187
188
|
ref: ref,
|
|
188
189
|
color: isLastBreadcrumb ? 'text' : 'subdued',
|
|
189
190
|
onClick: onClick,
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.ICON_SIDES = exports.
|
|
8
|
+
exports.ICON_SIDES = exports.EuiButtonContentDeprecated = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -31,7 +31,7 @@ var iconSideToClassNameMap = {
|
|
|
31
31
|
var ICON_SIDES = (0, _common.keysOf)(iconSideToClassNameMap);
|
|
32
32
|
exports.ICON_SIDES = ICON_SIDES;
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var EuiButtonContentDeprecated = function EuiButtonContentDeprecated(_ref) {
|
|
35
35
|
var children = _ref.children,
|
|
36
36
|
textProps = _ref.textProps,
|
|
37
37
|
_ref$isLoading = _ref.isLoading,
|
|
@@ -66,4 +66,4 @@ var EuiButtonContent = function EuiButtonContent(_ref) {
|
|
|
66
66
|
}), buttonIcon, (0, _react2.jsx)("span", textProps, children));
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
exports.
|
|
69
|
+
exports.EuiButtonContentDeprecated = EuiButtonContentDeprecated;
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.sizeToClassNameMap = exports.colorToClassNameMap = exports.SIZES = exports.
|
|
10
|
+
exports.sizeToClassNameMap = exports.colorToClassNameMap = exports.SIZES = exports.EuiButtonDisplayDeprecated = exports.EuiButton = exports.COLORS = void 0;
|
|
11
11
|
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
|
|
@@ -23,7 +23,7 @@ var _common = require("../common");
|
|
|
23
23
|
|
|
24
24
|
var _services = require("../../services");
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _button_content_deprecated = require("./_button_content_deprecated");
|
|
27
27
|
|
|
28
28
|
var _href_validator = require("../../services/security/href_validator");
|
|
29
29
|
|
|
@@ -110,24 +110,29 @@ var EuiButton = function EuiButton(_ref) {
|
|
|
110
110
|
relObj.type = type;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
return (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
return (// eslint-disable-next-line react/jsx-pascal-case
|
|
114
|
+
(0, _react2.jsx)(EuiButtonDisplayDeprecated, (0, _extends2.default)({
|
|
115
|
+
element: element,
|
|
116
|
+
baseClassName: "euiButton",
|
|
117
|
+
ref: buttonRef
|
|
118
|
+
}, elementProps, relObj, rest))
|
|
119
|
+
);
|
|
118
120
|
};
|
|
119
121
|
|
|
120
122
|
exports.EuiButton = EuiButton;
|
|
121
123
|
EuiButton.displayName = 'EuiButton';
|
|
122
124
|
|
|
123
125
|
/**
|
|
126
|
+
* *DEPRECATED*
|
|
124
127
|
* EuiButtonDisplay is an internal-only component used for displaying
|
|
125
128
|
* any element as a button.
|
|
126
129
|
* NOTE: This component *must* be below EuiButton in the file and
|
|
127
130
|
* EuiButton must also set a displayName for react-docgen-typescript
|
|
128
131
|
* to correctly set EuiButton's docgenInfo and display a props table.
|
|
132
|
+
* This component has been deprecated in favor of the new EuiButtonDisplay
|
|
133
|
+
* that can be found in `src/components/button/button_display/_button_display.tsx`
|
|
129
134
|
*/
|
|
130
|
-
var
|
|
135
|
+
var EuiButtonDisplayDeprecated = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
131
136
|
var _ref2$element = _ref2.element,
|
|
132
137
|
element = _ref2$element === void 0 ? 'button' : _ref2$element,
|
|
133
138
|
baseClassName = _ref2.baseClassName,
|
|
@@ -160,7 +165,7 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
|
|
|
160
165
|
|
|
161
166
|
var contentClassNames = (0, _classnames.default)('euiButton__content', contentProps && contentProps.className);
|
|
162
167
|
var textClassNames = (0, _classnames.default)('euiButton__text', textProps && textProps.className);
|
|
163
|
-
var innerNode = (0, _react2.jsx)(
|
|
168
|
+
var innerNode = (0, _react2.jsx)(_button_content_deprecated.EuiButtonContentDeprecated, (0, _extends2.default)({
|
|
164
169
|
isLoading: isLoading,
|
|
165
170
|
iconType: iconType,
|
|
166
171
|
iconSide: iconSide,
|
|
@@ -187,5 +192,5 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
|
|
|
187
192
|
ref: ref
|
|
188
193
|
}, rest), innerNode);
|
|
189
194
|
});
|
|
190
|
-
exports.
|
|
191
|
-
|
|
195
|
+
exports.EuiButtonDisplayDeprecated = EuiButtonDisplayDeprecated;
|
|
196
|
+
EuiButtonDisplayDeprecated.displayName = 'EuiButtonDisplay';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.EuiButtonDisplay = void 0;
|
|
11
|
+
|
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
+
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
+
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
+
|
|
20
|
+
var _react2 = require("@emotion/react");
|
|
21
|
+
|
|
22
|
+
var _services = require("../../../services");
|
|
23
|
+
|
|
24
|
+
var _button_display = require("./_button_display.styles");
|
|
25
|
+
|
|
26
|
+
var _button_display_content = require("./_button_display_content");
|
|
27
|
+
|
|
28
|
+
var _excluded = ["element", "children", "iconType", "iconSide", "size", "isDisabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps"];
|
|
29
|
+
|
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
+
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
+
|
|
34
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
35
|
+
|
|
36
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* EuiButtonDisplay is an internal-only component used for displaying
|
|
40
|
+
* any element as a button.
|
|
41
|
+
*/
|
|
42
|
+
var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
43
|
+
var _ref$element = _ref.element,
|
|
44
|
+
element = _ref$element === void 0 ? 'button' : _ref$element,
|
|
45
|
+
children = _ref.children,
|
|
46
|
+
iconType = _ref.iconType,
|
|
47
|
+
iconSide = _ref.iconSide,
|
|
48
|
+
_ref$size = _ref.size,
|
|
49
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
50
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
51
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
52
|
+
isLoading = _ref.isLoading,
|
|
53
|
+
isSelected = _ref.isSelected,
|
|
54
|
+
fullWidth = _ref.fullWidth,
|
|
55
|
+
minWidth = _ref.minWidth,
|
|
56
|
+
contentProps = _ref.contentProps,
|
|
57
|
+
textProps = _ref.textProps,
|
|
58
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
59
|
+
var buttonIsDisabled = isLoading || isDisabled;
|
|
60
|
+
var minWidthPx = minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
|
|
61
|
+
var theme = (0, _services.useEuiTheme)();
|
|
62
|
+
var styles = (0, _button_display.euiButtonDisplayStyles)(theme, minWidthPx);
|
|
63
|
+
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, isDisabled && styles.isDisabled];
|
|
64
|
+
var innerNode = (0, _react2.jsx)(_button_display_content.EuiButtonDisplayContent, (0, _extends2.default)({
|
|
65
|
+
isLoading: isLoading,
|
|
66
|
+
isDisabled: buttonIsDisabled,
|
|
67
|
+
iconType: iconType,
|
|
68
|
+
iconSide: iconSide,
|
|
69
|
+
textProps: _objectSpread({}, textProps)
|
|
70
|
+
}, contentProps), children);
|
|
71
|
+
return (0, _react2.createElement)(element, _objectSpread({
|
|
72
|
+
css: cssStyles,
|
|
73
|
+
disabled: element === 'button' && buttonIsDisabled,
|
|
74
|
+
'aria-pressed': element === 'button' ? isSelected : undefined,
|
|
75
|
+
ref: ref
|
|
76
|
+
}, rest), innerNode);
|
|
77
|
+
});
|
|
78
|
+
exports.EuiButtonDisplay = EuiButtonDisplay;
|
|
79
|
+
EuiButtonDisplay.displayName = 'EuiButtonDisplay';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiButtonDisplayStyles = exports.euiButtonBaseCSS = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../../global_styling");
|
|
11
|
+
|
|
12
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
13
|
+
|
|
14
|
+
// Provides a solid reset and base for handling sizing layout
|
|
15
|
+
// Does not include any visual styles
|
|
16
|
+
var euiButtonBaseCSS = function euiButtonBaseCSS() {
|
|
17
|
+
return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat((0, _global_styling.logicalTextAlignStyle)('center'), ";\n white-space: nowrap;\n ").concat((0, _global_styling.logicalCSS)('max-width', '100%'), ";\n vertical-align: middle;\n ");
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
exports.euiButtonBaseCSS = euiButtonBaseCSS;
|
|
21
|
+
|
|
22
|
+
var _buttonSize = function _buttonSize(size) {
|
|
23
|
+
return "\n ".concat((0, _global_styling.logicalCSS)('height', size), ";\n // prevents descenders from getting cut off\n line-height: ").concat(size, ";\n ");
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
27
|
+
name: "15xpz7k-fullWidth",
|
|
28
|
+
styles: "display:block;width:100%;label:fullWidth;"
|
|
29
|
+
} : {
|
|
30
|
+
name: "15xpz7k-fullWidth",
|
|
31
|
+
styles: "display:block;width:100%;label:fullWidth;",
|
|
32
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
36
|
+
name: "8595p9-isDisabled",
|
|
37
|
+
styles: "cursor:not-allowed;label:isDisabled;"
|
|
38
|
+
} : {
|
|
39
|
+
name: "8595p9-isDisabled",
|
|
40
|
+
styles: "cursor:not-allowed;label:isDisabled;",
|
|
41
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext, minWidth) {
|
|
45
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
46
|
+
return {
|
|
47
|
+
// Base
|
|
48
|
+
euiButtonDisplay: /*#__PURE__*/(0, _react.css)(euiButtonBaseCSS(), ";", minWidth && (0, _global_styling.logicalCSS)('min-width', minWidth), ";;label:euiButtonDisplay;"),
|
|
49
|
+
// States
|
|
50
|
+
isDisabled: _ref2,
|
|
51
|
+
fullWidth: _ref,
|
|
52
|
+
// Sizes
|
|
53
|
+
xs: /*#__PURE__*/(0, _react.css)(_buttonSize(euiTheme.size.l), (0, _global_styling.euiFontSize)(euiThemeContext, 'xs'), ";label:xs;"),
|
|
54
|
+
s: /*#__PURE__*/(0, _react.css)(_buttonSize(euiTheme.size.xl), (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";label:s;"),
|
|
55
|
+
m: /*#__PURE__*/(0, _react.css)(_buttonSize(euiTheme.size.xxl), (0, _global_styling.euiFontSize)(euiThemeContext, 's'), ";label:m;")
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports.euiButtonDisplayStyles = euiButtonDisplayStyles;
|