@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,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["destinationId", "tabIndex", "position", "children", "className"];
|
|
1
|
+
var _excluded = ["destinationId", "tabIndex", "position", "children", "className", "euiTheme"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -16,22 +16,22 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
16
16
|
import React from 'react';
|
|
17
17
|
import PropTypes from "prop-types";
|
|
18
18
|
import classNames from 'classnames';
|
|
19
|
-
import { useEuiTheme } from '../../../services';
|
|
20
19
|
import { EuiButton } from '../../button/button';
|
|
20
|
+
import { withEuiSystem } from '../../provider/system';
|
|
21
21
|
import { EuiScreenReaderOnly } from '../screen_reader_only';
|
|
22
22
|
import { euiSkipLinkStyles } from './skip_link.styles';
|
|
23
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
24
24
|
export var POSITIONS = ['static', 'fixed', 'absolute'];
|
|
25
|
-
export var
|
|
25
|
+
export var _EuiSkipLink = function _EuiSkipLink(_ref) {
|
|
26
26
|
var destinationId = _ref.destinationId,
|
|
27
27
|
tabIndex = _ref.tabIndex,
|
|
28
28
|
_ref$position = _ref.position,
|
|
29
29
|
position = _ref$position === void 0 ? 'static' : _ref$position,
|
|
30
30
|
children = _ref.children,
|
|
31
31
|
className = _ref.className,
|
|
32
|
+
euiTheme = _ref.euiTheme,
|
|
32
33
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
33
34
|
|
|
34
|
-
var euiTheme = useEuiTheme();
|
|
35
35
|
var styles = euiSkipLinkStyles(euiTheme);
|
|
36
36
|
var classes = classNames('euiSkipLink', className);
|
|
37
37
|
var cssStyles = [styles.euiSkipLink, position !== 'static' ? styles[position] : undefined]; // Create the `href` from `destinationId`
|
|
@@ -54,7 +54,7 @@ export var EuiSkipLink = function EuiSkipLink(_ref) {
|
|
|
54
54
|
fill: true
|
|
55
55
|
}, optionalProps, rest), children));
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
_EuiSkipLink.propTypes = {
|
|
58
58
|
href: PropTypes.string,
|
|
59
59
|
onClick: PropTypes.func,
|
|
60
60
|
|
|
@@ -148,7 +148,8 @@ EuiSkipLink.propTypes = {
|
|
|
148
148
|
iconSide: PropTypes.oneOf(["left", "right"]),
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
* Object of props passed to the <span/> wrapping the content's text
|
|
151
|
+
* Object of props passed to the <span/> wrapping the content's text (only if the children is a `string`)
|
|
152
|
+
* It doesn't apply to the icon.
|
|
152
153
|
*/
|
|
153
154
|
textProps: PropTypes.shape({
|
|
154
155
|
className: PropTypes.string,
|
|
@@ -162,4 +163,5 @@ EuiSkipLink.propTypes = {
|
|
|
162
163
|
"aria-label": PropTypes.string,
|
|
163
164
|
"data-test-subj": PropTypes.string,
|
|
164
165
|
buttonRef: PropTypes.any
|
|
165
|
-
};
|
|
166
|
+
};
|
|
167
|
+
export var EuiSkipLink = withEuiSystem(_EuiSkipLink);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "color", "imageUrl", "initials", "initialsLength", "iconType", "iconSize", "iconColor", "name", "size", "type", "isDisabled", "style"];
|
|
1
|
+
var _excluded = ["className", "color", "euiTheme", "imageUrl", "initials", "initialsLength", "iconType", "iconSize", "iconColor", "name", "size", "type", "isDisabled", "style"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -31,17 +31,19 @@ import React from 'react';
|
|
|
31
31
|
import PropTypes from "prop-types";
|
|
32
32
|
import classNames from 'classnames';
|
|
33
33
|
import { isColorDark, hexToRgb, isValidHex } from '../../services/color';
|
|
34
|
-
import {
|
|
34
|
+
import { withEuiSystem } from '../provider/system';
|
|
35
|
+
import { euiPaletteColorBlindBehindText, toInitials } from '../../services';
|
|
35
36
|
import { EuiIcon } from '../icon';
|
|
36
37
|
import { euiAvatarStyles } from './avatar.styles';
|
|
37
38
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
38
39
|
export var SIZES = ['s', 'm', 'l', 'xl'];
|
|
39
40
|
export var TYPES = ['space', 'user'];
|
|
40
|
-
export var
|
|
41
|
+
export var _EuiAvatar = function _EuiAvatar(_ref) {
|
|
41
42
|
var _classNames;
|
|
42
43
|
|
|
43
44
|
var className = _ref.className,
|
|
44
45
|
color = _ref.color,
|
|
46
|
+
euiTheme = _ref.euiTheme,
|
|
45
47
|
imageUrl = _ref.imageUrl,
|
|
46
48
|
initials = _ref.initials,
|
|
47
49
|
initialsLength = _ref.initialsLength,
|
|
@@ -58,7 +60,6 @@ export var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
58
60
|
style = _ref.style,
|
|
59
61
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
60
62
|
|
|
61
|
-
var euiTheme = useEuiTheme();
|
|
62
63
|
var styles = euiAvatarStyles(euiTheme);
|
|
63
64
|
var visColors = euiPaletteColorBlindBehindText();
|
|
64
65
|
var isPlain = color === 'plain';
|
|
@@ -111,9 +112,8 @@ export var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
111
112
|
role: isDisabled ? 'presentation' : 'img',
|
|
112
113
|
title: name
|
|
113
114
|
}, rest), content);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
EuiAvatar.propTypes = {
|
|
115
|
+
};
|
|
116
|
+
_EuiAvatar.propTypes = {
|
|
117
117
|
className: PropTypes.string,
|
|
118
118
|
"aria-label": PropTypes.string,
|
|
119
119
|
"data-test-subj": PropTypes.string,
|
|
@@ -174,6 +174,8 @@ EuiAvatar.propTypes = {
|
|
|
174
174
|
*/
|
|
175
175
|
isDisabled: PropTypes.bool
|
|
176
176
|
};
|
|
177
|
+
export var EuiAvatar = withEuiSystem(_EuiAvatar); // TODO: Migrate to a service
|
|
178
|
+
|
|
177
179
|
export var checkValidColor = function checkValidColor(color) {
|
|
178
180
|
var validHex = color && isValidHex(color) || color === 'plain' || color === 'subdued';
|
|
179
181
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["position", "paddingSize", "affordForDisplacement", "children", "className", "bodyClassName", "landmarkHeading", "usePortal", "left", "right", "bottom", "top", "style"];
|
|
1
|
+
var _excluded = ["position", "paddingSize", "affordForDisplacement", "children", "className", "bodyClassName", "landmarkHeading", "usePortal", "left", "right", "bottom", "top", "style", "euiTheme"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -34,13 +34,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
34
34
|
import classNames from 'classnames';
|
|
35
35
|
import PropTypes from "prop-types";
|
|
36
36
|
import React, { forwardRef, useEffect, useState } from 'react';
|
|
37
|
-
import { useCombinedRefs
|
|
37
|
+
import { useCombinedRefs } from '../../services';
|
|
38
38
|
import { EuiScreenReaderOnly } from '../accessibility';
|
|
39
39
|
import { EuiI18n } from '../i18n';
|
|
40
40
|
import { useResizeObserver } from '../observer/resize_observer';
|
|
41
41
|
import { EuiPortal } from '../portal';
|
|
42
|
-
import {
|
|
42
|
+
import { withEuiSystem } from '../provider/system';
|
|
43
43
|
import { EuiThemeProvider } from '../../services/theme/provider';
|
|
44
|
+
import { euiBottomBarStyles } from './bottom_bar.styles';
|
|
44
45
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
45
46
|
// Exported for testing
|
|
46
47
|
export var paddingSizeToClassNameMap = {
|
|
@@ -50,8 +51,7 @@ export var paddingSizeToClassNameMap = {
|
|
|
50
51
|
l: 'euiBottomBar--paddingLarge'
|
|
51
52
|
};
|
|
52
53
|
export var POSITIONS = ['static', 'fixed', 'sticky'];
|
|
53
|
-
|
|
54
|
-
var _EuiBottomBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
54
|
+
export var _EuiBottomBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
55
55
|
var _ref$position = _ref.position,
|
|
56
56
|
position = _ref$position === void 0 ? 'fixed' : _ref$position,
|
|
57
57
|
_ref$paddingSize = _ref.paddingSize,
|
|
@@ -72,9 +72,9 @@ var _EuiBottomBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
72
72
|
bottom = _ref$bottom === void 0 ? 0 : _ref$bottom,
|
|
73
73
|
top = _ref.top,
|
|
74
74
|
style = _ref.style,
|
|
75
|
+
euiTheme = _ref.euiTheme,
|
|
75
76
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
76
77
|
|
|
77
|
-
var euiTheme = useEuiTheme();
|
|
78
78
|
var styles = euiBottomBarStyles(euiTheme); // Force some props if `fixed` position, but not if the user has supplied these
|
|
79
79
|
|
|
80
80
|
affordForDisplacement = position !== 'fixed' ? false : affordForDisplacement;
|
|
@@ -148,7 +148,6 @@ var _EuiBottomBar = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
148
148
|
|
|
149
149
|
return usePortal ? ___EmotionJSX(EuiPortal, null, bar) : bar;
|
|
150
150
|
});
|
|
151
|
-
|
|
152
151
|
_EuiBottomBar.propTypes = {
|
|
153
152
|
className: PropTypes.string,
|
|
154
153
|
"aria-label": PropTypes.string,
|
|
@@ -213,9 +212,9 @@ _EuiBottomBar.propTypes = {
|
|
|
213
212
|
left: PropTypes.any
|
|
214
213
|
};
|
|
215
214
|
export var EuiBottomBar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
216
|
-
var BottomBar = _EuiBottomBar;
|
|
215
|
+
var BottomBar = withEuiSystem(_EuiBottomBar);
|
|
217
216
|
return ___EmotionJSX(EuiThemeProvider, {
|
|
218
|
-
colorMode:
|
|
217
|
+
colorMode: "dark"
|
|
219
218
|
}, ___EmotionJSX(BottomBar, _extends({
|
|
220
219
|
ref: ref
|
|
221
220
|
}, props)));
|
|
@@ -184,7 +184,8 @@ export var EuiBreadcrumbs = function EuiBreadcrumbs(_ref) {
|
|
|
184
184
|
}, linkProps, breadcrumbRest), text);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
return ___EmotionJSX(EuiLink
|
|
187
|
+
return ___EmotionJSX(EuiLink // @ts-expect-error Ref forwarding type mismatch
|
|
188
|
+
, _extends({
|
|
188
189
|
ref: ref,
|
|
189
190
|
color: isLastBreadcrumb ? 'text' : 'subdued',
|
|
190
191
|
onClick: onClick,
|
|
@@ -25,7 +25,7 @@ var iconSideToClassNameMap = {
|
|
|
25
25
|
right: 'euiButtonContent--iconRight'
|
|
26
26
|
};
|
|
27
27
|
export var ICON_SIDES = keysOf(iconSideToClassNameMap);
|
|
28
|
-
export var
|
|
28
|
+
export var EuiButtonContentDeprecated = function EuiButtonContentDeprecated(_ref) {
|
|
29
29
|
var children = _ref.children,
|
|
30
30
|
textProps = _ref.textProps,
|
|
31
31
|
_ref$isLoading = _ref.isLoading,
|
|
@@ -60,7 +60,7 @@ export var EuiButtonContent = function EuiButtonContent(_ref) {
|
|
|
60
60
|
className: contentClassNames
|
|
61
61
|
}), buttonIcon, ___EmotionJSX("span", textProps, children));
|
|
62
62
|
};
|
|
63
|
-
|
|
63
|
+
EuiButtonContentDeprecated.propTypes = {
|
|
64
64
|
/**
|
|
65
65
|
* Any `type` accepted by EuiIcon
|
|
66
66
|
*/
|
|
@@ -73,7 +73,8 @@ EuiButtonContent.propTypes = {
|
|
|
73
73
|
isLoading: PropTypes.bool,
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
|
-
* Object of props passed to the <span/> wrapping the content's text
|
|
76
|
+
* Object of props passed to the <span/> wrapping the content's text (only if the children is a `string`)
|
|
77
|
+
* It doesn't apply to the icon.
|
|
77
78
|
*/
|
|
78
79
|
textProps: PropTypes.shape({
|
|
79
80
|
className: PropTypes.string,
|
|
@@ -25,7 +25,7 @@ import PropTypes from "prop-types";
|
|
|
25
25
|
import classNames from 'classnames';
|
|
26
26
|
import { keysOf } from '../common';
|
|
27
27
|
import { getSecureRelForTarget } from '../../services';
|
|
28
|
-
import { EuiButtonContent } from './
|
|
28
|
+
import { EuiButtonContentDeprecated as EuiButtonContent } from './_button_content_deprecated';
|
|
29
29
|
import { validateHref } from '../../services/security/href_validator';
|
|
30
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
31
31
|
export var colorToClassNameMap = {
|
|
@@ -94,11 +94,13 @@ export var EuiButton = function EuiButton(_ref) {
|
|
|
94
94
|
relObj.type = type;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
return (// eslint-disable-next-line react/jsx-pascal-case
|
|
98
|
+
___EmotionJSX(EuiButtonDisplayDeprecated, _extends({
|
|
99
|
+
element: element,
|
|
100
|
+
baseClassName: "euiButton",
|
|
101
|
+
ref: buttonRef
|
|
102
|
+
}, elementProps, relObj, rest))
|
|
103
|
+
);
|
|
102
104
|
};
|
|
103
105
|
EuiButton.propTypes = {
|
|
104
106
|
href: PropTypes.string,
|
|
@@ -196,7 +198,8 @@ EuiButton.propTypes = {
|
|
|
196
198
|
iconSide: PropTypes.oneOf(["left", "right"]),
|
|
197
199
|
|
|
198
200
|
/**
|
|
199
|
-
* Object of props passed to the <span/> wrapping the content's text
|
|
201
|
+
* Object of props passed to the <span/> wrapping the content's text (only if the children is a `string`)
|
|
202
|
+
* It doesn't apply to the icon.
|
|
200
203
|
*/
|
|
201
204
|
textProps: PropTypes.shape({
|
|
202
205
|
className: PropTypes.string,
|
|
@@ -214,13 +217,16 @@ EuiButton.propTypes = {
|
|
|
214
217
|
EuiButton.displayName = 'EuiButton';
|
|
215
218
|
|
|
216
219
|
/**
|
|
220
|
+
* *DEPRECATED*
|
|
217
221
|
* EuiButtonDisplay is an internal-only component used for displaying
|
|
218
222
|
* any element as a button.
|
|
219
223
|
* NOTE: This component *must* be below EuiButton in the file and
|
|
220
224
|
* EuiButton must also set a displayName for react-docgen-typescript
|
|
221
225
|
* to correctly set EuiButton's docgenInfo and display a props table.
|
|
226
|
+
* This component has been deprecated in favor of the new EuiButtonDisplay
|
|
227
|
+
* that can be found in `src/components/button/button_display/_button_display.tsx`
|
|
222
228
|
*/
|
|
223
|
-
export var
|
|
229
|
+
export var EuiButtonDisplayDeprecated = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
224
230
|
var _ref2$element = _ref2.element,
|
|
225
231
|
element = _ref2$element === void 0 ? 'button' : _ref2$element,
|
|
226
232
|
baseClassName = _ref2.baseClassName,
|
|
@@ -283,7 +289,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
283
289
|
ref: ref
|
|
284
290
|
}, rest), innerNode);
|
|
285
291
|
});
|
|
286
|
-
|
|
292
|
+
EuiButtonDisplayDeprecated.propTypes = {
|
|
287
293
|
children: PropTypes.node,
|
|
288
294
|
|
|
289
295
|
/**
|
|
@@ -356,4 +362,4 @@ EuiButtonDisplay.propTypes = {
|
|
|
356
362
|
*/
|
|
357
363
|
baseClassName: PropTypes.string.isRequired
|
|
358
364
|
};
|
|
359
|
-
|
|
365
|
+
EuiButtonDisplayDeprecated.displayName = 'EuiButtonDisplay';
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
var _excluded = ["element", "children", "iconType", "iconSide", "size", "isDisabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps"];
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
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
|
+
|
|
7
|
+
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) { _defineProperty(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; }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
11
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
|
+
|
|
13
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
17
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
18
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
19
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
20
|
+
* Side Public License, v 1.
|
|
21
|
+
*/
|
|
22
|
+
import React, { forwardRef } from 'react'; // @ts-ignore module doesn't export `createElement`
|
|
23
|
+
|
|
24
|
+
import PropTypes from "prop-types";
|
|
25
|
+
import { createElement } from '@emotion/react';
|
|
26
|
+
import { useEuiTheme } from '../../../services';
|
|
27
|
+
import { euiButtonDisplayStyles } from './_button_display.styles';
|
|
28
|
+
import { EuiButtonDisplayContent } from './_button_display_content';
|
|
29
|
+
/**
|
|
30
|
+
* Extends EuiButtonDisplayContentProps which provides
|
|
31
|
+
* `iconType`, `iconSide`, and `textProps`
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* EuiButtonDisplay is an internal-only component used for displaying
|
|
38
|
+
* any element as a button.
|
|
39
|
+
*/
|
|
40
|
+
export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
41
|
+
var _ref$element = _ref.element,
|
|
42
|
+
element = _ref$element === void 0 ? 'button' : _ref$element,
|
|
43
|
+
children = _ref.children,
|
|
44
|
+
iconType = _ref.iconType,
|
|
45
|
+
iconSide = _ref.iconSide,
|
|
46
|
+
_ref$size = _ref.size,
|
|
47
|
+
size = _ref$size === void 0 ? 'm' : _ref$size,
|
|
48
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
49
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
50
|
+
isLoading = _ref.isLoading,
|
|
51
|
+
isSelected = _ref.isSelected,
|
|
52
|
+
fullWidth = _ref.fullWidth,
|
|
53
|
+
minWidth = _ref.minWidth,
|
|
54
|
+
contentProps = _ref.contentProps,
|
|
55
|
+
textProps = _ref.textProps,
|
|
56
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
+
|
|
58
|
+
var buttonIsDisabled = isLoading || isDisabled;
|
|
59
|
+
var minWidthPx = minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
|
|
60
|
+
var theme = useEuiTheme();
|
|
61
|
+
var styles = euiButtonDisplayStyles(theme, minWidthPx);
|
|
62
|
+
var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, isDisabled && styles.isDisabled];
|
|
63
|
+
|
|
64
|
+
var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
|
|
65
|
+
isLoading: isLoading,
|
|
66
|
+
isDisabled: buttonIsDisabled,
|
|
67
|
+
iconType: iconType,
|
|
68
|
+
iconSide: iconSide,
|
|
69
|
+
textProps: _objectSpread({}, textProps)
|
|
70
|
+
}, contentProps), children);
|
|
71
|
+
|
|
72
|
+
return createElement(element, _objectSpread({
|
|
73
|
+
css: cssStyles,
|
|
74
|
+
disabled: element === 'button' && buttonIsDisabled,
|
|
75
|
+
'aria-pressed': element === 'button' ? isSelected : undefined,
|
|
76
|
+
ref: ref
|
|
77
|
+
}, rest), innerNode);
|
|
78
|
+
});
|
|
79
|
+
EuiButtonDisplay.propTypes = {
|
|
80
|
+
children: PropTypes.node,
|
|
81
|
+
size: PropTypes.oneOf(["xs", "s", "m"]),
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Applies the boolean state as the `aria-pressed` property to create a toggle button.
|
|
85
|
+
* *Only use when the readable text does not change between states.*
|
|
86
|
+
*/
|
|
87
|
+
isSelected: PropTypes.bool,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Extends the button to 100% width
|
|
91
|
+
*/
|
|
92
|
+
fullWidth: PropTypes.bool,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Override the default minimum width
|
|
96
|
+
*/
|
|
97
|
+
minWidth: PropTypes.any,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Force disables the button and changes the icon to a loading spinner
|
|
101
|
+
*/
|
|
102
|
+
isLoading: PropTypes.bool,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Object of props passed to the <span/> wrapping the button's content
|
|
106
|
+
*/
|
|
107
|
+
contentProps: PropTypes.any,
|
|
108
|
+
style: PropTypes.any,
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Any `type` accepted by EuiIcon
|
|
112
|
+
*/
|
|
113
|
+
iconType: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "alert", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "asterisk", "auditbeatApp", "beaker", "bell", "bellSlash", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "codeApp", "color", "compute", "console", "consoleApp", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInACircleFilled", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "document", "documentEdit", "documentation", "documents", "dot", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "inputOutput", "inspect", "invert", "ip", "keyboardShortcut", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spacesApp", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelionApp", "timeRefresh", "timeslider", "training", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenClass", "tokenProperty", "tokenEnum", "tokenVariable", "tokenMethod", "tokenAnnotation", "tokenException", "tokenInterface", "tokenParameter", "tokenField", "tokenElement", "tokenFunction", "tokenBoolean", "tokenString", "tokenArray", "tokenNumber", "tokenConstant", "tokenObject", "tokenEvent", "tokenKey", "tokenNull", "tokenStruct", "tokenPackage", "tokenOperator", "tokenEnumMember", "tokenRepo", "tokenSymbol", "tokenFile", "tokenModule", "tokenNamespace", "tokenDate", "tokenIP", "tokenNested", "tokenAlias", "tokenShape", "tokenGeo", "tokenRange", "tokenBinary", "tokenJoin", "tokenPercolator", "tokenFlattened", "tokenRankFeature", "tokenRankFeatures", "tokenKeyword", "tokenTag", "tokenCompletionSuggester", "tokenDenseVector", "tokenText", "tokenTokenCount", "tokenSearchType", "tokenHistogram"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Can only be one side `left` or `right`
|
|
117
|
+
*/
|
|
118
|
+
iconSide: PropTypes.oneOf(["left", "right", undefined]),
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Object of props passed to the <span/> wrapping the content's text/children only (not icon)
|
|
122
|
+
*/
|
|
123
|
+
textProps: PropTypes.shape({
|
|
124
|
+
className: PropTypes.string,
|
|
125
|
+
"aria-label": PropTypes.string,
|
|
126
|
+
"data-test-subj": PropTypes.string,
|
|
127
|
+
ref: PropTypes.any,
|
|
128
|
+
"data-text": PropTypes.string
|
|
129
|
+
}),
|
|
130
|
+
iconSize: PropTypes.oneOf(["s", "m"]),
|
|
131
|
+
isDisabled: PropTypes.bool.isRequired,
|
|
132
|
+
className: PropTypes.string,
|
|
133
|
+
"aria-label": PropTypes.string,
|
|
134
|
+
"data-test-subj": PropTypes.string,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Provide a valid element to render the element as
|
|
138
|
+
*/
|
|
139
|
+
element: PropTypes.oneOf(["a", "button", "span", "label"])
|
|
140
|
+
};
|
|
141
|
+
EuiButtonDisplay.displayName = 'EuiButtonDisplay';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { euiFontSize, logicalCSS, logicalTextAlignStyle } from '../../../global_styling'; // Provides a solid reset and base for handling sizing layout
|
|
12
|
+
// Does not include any visual styles
|
|
13
|
+
|
|
14
|
+
export var euiButtonBaseCSS = function euiButtonBaseCSS() {
|
|
15
|
+
return "\n display: inline-block;\n appearance: none;\n cursor: pointer;\n ".concat(logicalTextAlignStyle('center'), ";\n white-space: nowrap;\n ").concat(logicalCSS('max-width', '100%'), ";\n vertical-align: middle;\n ");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var _buttonSize = function _buttonSize(size) {
|
|
19
|
+
return "\n ".concat(logicalCSS('height', size), ";\n // prevents descenders from getting cut off\n line-height: ").concat(size, ";\n ");
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
23
|
+
name: "15xpz7k-fullWidth",
|
|
24
|
+
styles: "display:block;width:100%;label:fullWidth;"
|
|
25
|
+
} : {
|
|
26
|
+
name: "15xpz7k-fullWidth",
|
|
27
|
+
styles: "display:block;width:100%;label:fullWidth;",
|
|
28
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
32
|
+
name: "8595p9-isDisabled",
|
|
33
|
+
styles: "cursor:not-allowed;label:isDisabled;"
|
|
34
|
+
} : {
|
|
35
|
+
name: "8595p9-isDisabled",
|
|
36
|
+
styles: "cursor:not-allowed;label:isDisabled;",
|
|
37
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext, minWidth) {
|
|
41
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
42
|
+
return {
|
|
43
|
+
// Base
|
|
44
|
+
euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", minWidth && logicalCSS('min-width', minWidth), ";;label:euiButtonDisplay;"),
|
|
45
|
+
// States
|
|
46
|
+
isDisabled: _ref2,
|
|
47
|
+
fullWidth: _ref,
|
|
48
|
+
// Sizes
|
|
49
|
+
xs: /*#__PURE__*/css(_buttonSize(euiTheme.size.l), euiFontSize(euiThemeContext, 'xs'), ";label:xs;"),
|
|
50
|
+
s: /*#__PURE__*/css(_buttonSize(euiTheme.size.xl), euiFontSize(euiThemeContext, 's'), ";label:s;"),
|
|
51
|
+
m: /*#__PURE__*/css(_buttonSize(euiTheme.size.xxl), euiFontSize(euiThemeContext, 's'), ";label:m;")
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
var _excluded = ["children", "textProps", "isLoading", "isDisabled", "iconType", "iconSize", "iconSide"];
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
7
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
12
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
13
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
14
|
+
* Side Public License, v 1.
|
|
15
|
+
*/
|
|
16
|
+
import React from 'react';
|
|
17
|
+
import PropTypes from "prop-types";
|
|
18
|
+
import { useEuiTheme } from '../../../services';
|
|
19
|
+
import { EuiLoadingSpinner } from '../../loading';
|
|
20
|
+
import { EuiIcon } from '../../icon';
|
|
21
|
+
import { euiButtonDisplayContentStyles } from './_button_display_content.styles';
|
|
22
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
23
|
+
export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
|
|
24
|
+
var children = _ref.children,
|
|
25
|
+
textProps = _ref.textProps,
|
|
26
|
+
_ref$isLoading = _ref.isLoading,
|
|
27
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
28
|
+
_ref$isDisabled = _ref.isDisabled,
|
|
29
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
30
|
+
iconType = _ref.iconType,
|
|
31
|
+
_ref$iconSize = _ref.iconSize,
|
|
32
|
+
iconSize = _ref$iconSize === void 0 ? 'm' : _ref$iconSize,
|
|
33
|
+
iconSide = _ref.iconSide,
|
|
34
|
+
contentProps = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
|
|
36
|
+
var theme = useEuiTheme();
|
|
37
|
+
var styles = euiButtonDisplayContentStyles(theme);
|
|
38
|
+
var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide], isDisabled && styles.isDisabled];
|
|
39
|
+
var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
|
|
40
|
+
var cssIconStyles = [styles.euiButtonDisplayContent__icon]; // Add an icon to the button if one exists.
|
|
41
|
+
|
|
42
|
+
var icon; // When the button is disabled the text gets gray
|
|
43
|
+
// and in some buttons the background gets a light gray
|
|
44
|
+
// for better contrast we want to change the border of the spinner
|
|
45
|
+
// to have the same color of the text. This way we ensure the borders
|
|
46
|
+
// are always visible. The default spinner color could be very light.
|
|
47
|
+
|
|
48
|
+
var loadingSpinnerColor = isDisabled ? {
|
|
49
|
+
border: 'currentColor'
|
|
50
|
+
} : undefined;
|
|
51
|
+
|
|
52
|
+
if (isLoading) {
|
|
53
|
+
icon = ___EmotionJSX(EuiLoadingSpinner, {
|
|
54
|
+
css: cssSpinnerStyles,
|
|
55
|
+
size: iconSize,
|
|
56
|
+
color: loadingSpinnerColor
|
|
57
|
+
});
|
|
58
|
+
} else if (iconType) {
|
|
59
|
+
icon = ___EmotionJSX(EuiIcon, {
|
|
60
|
+
css: cssIconStyles,
|
|
61
|
+
type: iconType,
|
|
62
|
+
size: iconSize,
|
|
63
|
+
color: "inherit" // forces the icon to inherit its parent color
|
|
64
|
+
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var isText = typeof children === 'string';
|
|
69
|
+
return ___EmotionJSX("span", _extends({}, contentProps, {
|
|
70
|
+
css: cssStyles
|
|
71
|
+
}), icon, isText ? ___EmotionJSX("span", textProps, children) : children);
|
|
72
|
+
};
|
|
73
|
+
EuiButtonDisplayContent.propTypes = {
|
|
74
|
+
/**
|
|
75
|
+
* Any `type` accepted by EuiIcon
|
|
76
|
+
*/
|
|
77
|
+
iconType: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "alert", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "asterisk", "auditbeatApp", "beaker", "bell", "bellSlash", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "codeApp", "color", "compute", "console", "consoleApp", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInACircleFilled", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "document", "documentEdit", "documentation", "documents", "dot", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "eql", "eraser", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "inputOutput", "inspect", "invert", "ip", "keyboardShortcut", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipelineApp", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spacesApp", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelionApp", "timeRefresh", "timeslider", "training", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenClass", "tokenProperty", "tokenEnum", "tokenVariable", "tokenMethod", "tokenAnnotation", "tokenException", "tokenInterface", "tokenParameter", "tokenField", "tokenElement", "tokenFunction", "tokenBoolean", "tokenString", "tokenArray", "tokenNumber", "tokenConstant", "tokenObject", "tokenEvent", "tokenKey", "tokenNull", "tokenStruct", "tokenPackage", "tokenOperator", "tokenEnumMember", "tokenRepo", "tokenSymbol", "tokenFile", "tokenModule", "tokenNamespace", "tokenDate", "tokenIP", "tokenNested", "tokenAlias", "tokenShape", "tokenGeo", "tokenRange", "tokenBinary", "tokenJoin", "tokenPercolator", "tokenFlattened", "tokenRankFeature", "tokenRankFeatures", "tokenKeyword", "tokenTag", "tokenCompletionSuggester", "tokenDenseVector", "tokenText", "tokenTokenCount", "tokenSearchType", "tokenHistogram"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Can only be one side `left` or `right`
|
|
81
|
+
*/
|
|
82
|
+
iconSide: PropTypes.oneOf(["left", "right", undefined]),
|
|
83
|
+
isLoading: PropTypes.bool,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Object of props passed to the <span/> wrapping the content's text/children only (not icon)
|
|
87
|
+
*/
|
|
88
|
+
textProps: PropTypes.shape({
|
|
89
|
+
className: PropTypes.string,
|
|
90
|
+
"aria-label": PropTypes.string,
|
|
91
|
+
"data-test-subj": PropTypes.string,
|
|
92
|
+
ref: PropTypes.any,
|
|
93
|
+
"data-text": PropTypes.string
|
|
94
|
+
}),
|
|
95
|
+
iconSize: PropTypes.oneOf(["s", "m"]),
|
|
96
|
+
isDisabled: PropTypes.bool.isRequired,
|
|
97
|
+
className: PropTypes.string,
|
|
98
|
+
"aria-label": PropTypes.string,
|
|
99
|
+
"data-test-subj": PropTypes.string
|
|
100
|
+
};
|