@elastic/eui 101.1.0 → 101.2.0-classic.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/badge/badge.styles.js +2 -2
- package/es/components/badge/color_utils.js +16 -6
- package/es/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/es/components/basic_table/basic_table.js +11 -0
- package/es/components/basic_table/in_memory_table.js +11 -0
- package/es/components/code/code.styles.js +4 -2
- package/es/components/code/code_syntax.styles.js +6 -3
- package/es/components/color_picker/color_picker_swatch.js +85 -3
- package/es/components/color_picker/color_picker_swatch.styles.js +11 -1
- package/es/components/header/header.styles.js +4 -1
- package/es/components/panel/panel.styles.js +1 -1
- package/es/components/provider/provider.js +2 -2
- package/es/components/table/table_header_cell.js +9 -0
- package/es/components/toast/toast.styles.js +3 -3
- package/es/components/tool_tip/icon_tip.js +9 -0
- package/es/components/tool_tip/tool_tip.js +18 -4
- package/es/components/tool_tip/tool_tip_anchor.js +1 -1
- package/es/global_styling/mixins/_button.js +3 -2
- package/es/services/color/vis_color_store.js +1 -1
- package/es/services/theme/context.js +2 -2
- package/eui.d.ts +366 -327
- package/lib/components/badge/badge.styles.js +2 -2
- package/lib/components/badge/color_utils.js +16 -6
- package/lib/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/lib/components/basic_table/basic_table.js +11 -0
- package/lib/components/basic_table/in_memory_table.js +11 -0
- package/lib/components/code/code.styles.js +3 -1
- package/lib/components/code/code_syntax.styles.js +6 -3
- package/lib/components/color_picker/color_picker_swatch.js +85 -3
- package/lib/components/color_picker/color_picker_swatch.styles.js +11 -3
- package/lib/components/header/header.styles.js +4 -1
- package/lib/components/icon/svgs/aggregate.svg +0 -0
- package/lib/components/icon/svgs/color.svg +0 -0
- package/lib/components/icon/svgs/continuityAbove.svg +0 -0
- package/lib/components/icon/svgs/continuityAboveBelow.svg +0 -0
- package/lib/components/icon/svgs/continuityBelow.svg +0 -0
- package/lib/components/icon/svgs/continuityWithin.svg +0 -0
- package/lib/components/icon/svgs/documentation.svg +0 -0
- package/lib/components/icon/svgs/eraser.svg +0 -0
- package/lib/components/icon/svgs/folder_check.svg +0 -0
- package/lib/components/icon/svgs/folder_closed.svg +0 -0
- package/lib/components/icon/svgs/folder_exclamation.svg +0 -0
- package/lib/components/icon/svgs/folder_open.svg +0 -0
- package/lib/components/icon/svgs/fullScreenExit.svg +0 -0
- package/lib/components/icon/svgs/function.svg +0 -0
- package/lib/components/icon/svgs/layers.svg +0 -0
- package/lib/components/icon/svgs/menu.svg +0 -0
- package/lib/components/icon/svgs/ml_data_visualizer.svg +0 -0
- package/lib/components/icon/svgs/pageSelect.svg +0 -0
- package/lib/components/icon/svgs/pagesSelect.svg +0 -0
- package/lib/components/icon/svgs/percent.svg +0 -0
- package/lib/components/icon/svgs/push.svg +0 -0
- package/lib/components/icon/svgs/quote.svg +0 -0
- package/lib/components/icon/svgs/reporter.svg +0 -0
- package/lib/components/icon/svgs/securitySignal.svg +0 -0
- package/lib/components/icon/svgs/securitySignalDetected.svg +0 -0
- package/lib/components/icon/svgs/securitySignalResolved.svg +0 -0
- package/lib/components/icon/svgs/timeline.svg +0 -0
- package/lib/components/icon/svgs/users.svg +0 -0
- package/lib/components/icon/svgs/wordWrap.svg +0 -0
- package/lib/components/icon/svgs/wordWrapDisabled.svg +0 -0
- package/lib/components/panel/panel.styles.js +1 -1
- package/lib/components/provider/provider.js +2 -2
- package/lib/components/table/table_header_cell.js +9 -0
- package/lib/components/toast/toast.styles.js +3 -3
- package/lib/components/tool_tip/icon_tip.js +9 -0
- package/lib/components/tool_tip/tool_tip.js +18 -4
- package/lib/components/tool_tip/tool_tip_anchor.js +1 -1
- package/lib/global_styling/mixins/_button.js +3 -2
- package/lib/services/color/vis_color_store.js +2 -2
- package/lib/services/theme/context.js +2 -2
- package/optimize/es/components/badge/badge.styles.js +2 -2
- package/optimize/es/components/badge/color_utils.js +16 -6
- package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/optimize/es/components/code/code.styles.js +4 -2
- package/optimize/es/components/code/code_syntax.styles.js +6 -3
- package/optimize/es/components/color_picker/color_picker_swatch.js +18 -2
- package/optimize/es/components/color_picker/color_picker_swatch.styles.js +11 -1
- package/optimize/es/components/header/header.styles.js +4 -1
- package/optimize/es/components/panel/panel.styles.js +1 -1
- package/optimize/es/components/provider/provider.js +2 -2
- package/optimize/es/components/toast/toast.styles.js +3 -3
- package/optimize/es/components/tool_tip/tool_tip.js +9 -4
- package/optimize/es/components/tool_tip/tool_tip_anchor.js +1 -1
- package/optimize/es/global_styling/mixins/_button.js +3 -2
- package/optimize/es/services/color/vis_color_store.js +1 -1
- package/optimize/es/services/theme/context.js +2 -2
- package/optimize/lib/components/badge/badge.styles.js +2 -2
- package/optimize/lib/components/badge/color_utils.js +16 -6
- package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/optimize/lib/components/code/code.styles.js +3 -1
- package/optimize/lib/components/code/code_syntax.styles.js +6 -3
- package/optimize/lib/components/color_picker/color_picker_swatch.js +18 -2
- package/optimize/lib/components/color_picker/color_picker_swatch.styles.js +11 -3
- package/optimize/lib/components/header/header.styles.js +4 -1
- package/optimize/lib/components/icon/svgs/aggregate.svg +0 -0
- package/optimize/lib/components/icon/svgs/color.svg +0 -0
- package/optimize/lib/components/icon/svgs/continuityAbove.svg +0 -0
- package/optimize/lib/components/icon/svgs/continuityAboveBelow.svg +0 -0
- package/optimize/lib/components/icon/svgs/continuityBelow.svg +0 -0
- package/optimize/lib/components/icon/svgs/continuityWithin.svg +0 -0
- package/optimize/lib/components/icon/svgs/documentation.svg +0 -0
- package/optimize/lib/components/icon/svgs/eraser.svg +0 -0
- package/optimize/lib/components/icon/svgs/folder_check.svg +0 -0
- package/optimize/lib/components/icon/svgs/folder_closed.svg +0 -0
- package/optimize/lib/components/icon/svgs/folder_exclamation.svg +0 -0
- package/optimize/lib/components/icon/svgs/folder_open.svg +0 -0
- package/optimize/lib/components/icon/svgs/fullScreenExit.svg +0 -0
- package/optimize/lib/components/icon/svgs/function.svg +0 -0
- package/optimize/lib/components/icon/svgs/layers.svg +0 -0
- package/optimize/lib/components/icon/svgs/menu.svg +0 -0
- package/optimize/lib/components/icon/svgs/ml_data_visualizer.svg +0 -0
- package/optimize/lib/components/icon/svgs/pageSelect.svg +0 -0
- package/optimize/lib/components/icon/svgs/pagesSelect.svg +0 -0
- package/optimize/lib/components/icon/svgs/percent.svg +0 -0
- package/optimize/lib/components/icon/svgs/push.svg +0 -0
- package/optimize/lib/components/icon/svgs/quote.svg +0 -0
- package/optimize/lib/components/icon/svgs/reporter.svg +0 -0
- package/optimize/lib/components/icon/svgs/securitySignal.svg +0 -0
- package/optimize/lib/components/icon/svgs/securitySignalDetected.svg +0 -0
- package/optimize/lib/components/icon/svgs/securitySignalResolved.svg +0 -0
- package/optimize/lib/components/icon/svgs/timeline.svg +0 -0
- package/optimize/lib/components/icon/svgs/users.svg +0 -0
- package/optimize/lib/components/icon/svgs/wordWrap.svg +0 -0
- package/optimize/lib/components/icon/svgs/wordWrapDisabled.svg +0 -0
- package/optimize/lib/components/panel/panel.styles.js +1 -1
- package/optimize/lib/components/provider/provider.js +2 -2
- package/optimize/lib/components/toast/toast.styles.js +3 -3
- package/optimize/lib/components/tool_tip/tool_tip.js +9 -4
- package/optimize/lib/components/tool_tip/tool_tip_anchor.js +1 -1
- package/optimize/lib/global_styling/mixins/_button.js +3 -2
- package/optimize/lib/services/color/vis_color_store.js +2 -2
- package/optimize/lib/services/theme/context.js +2 -2
- package/package.json +4 -4
- package/test-env/components/badge/badge.styles.js +2 -2
- package/test-env/components/badge/color_utils.js +16 -6
- package/test-env/components/badge/notification_badge/badge_notification.styles.js +1 -1
- package/test-env/components/basic_table/basic_table.js +11 -0
- package/test-env/components/basic_table/in_memory_table.js +11 -0
- package/test-env/components/code/code.styles.js +3 -1
- package/test-env/components/code/code_syntax.styles.js +6 -3
- package/test-env/components/color_picker/color_picker_swatch.js +85 -3
- package/test-env/components/color_picker/color_picker_swatch.styles.js +11 -3
- package/test-env/components/header/header.styles.js +4 -1
- package/test-env/components/panel/panel.styles.js +1 -1
- package/test-env/components/provider/provider.js +2 -2
- package/test-env/components/table/table_header_cell.js +9 -0
- package/test-env/components/toast/toast.styles.js +3 -3
- package/test-env/components/tool_tip/icon_tip.js +9 -0
- package/test-env/components/tool_tip/tool_tip.js +18 -4
- package/test-env/components/tool_tip/tool_tip_anchor.js +1 -1
- package/test-env/global_styling/mixins/_button.js +3 -2
- package/test-env/services/color/vis_color_store.js +2 -2
- package/test-env/services/theme/context.js +2 -2
- package/CHANGELOG.md +0 -5
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.EUI_VIS_COLOR_STORE = void 0;
|
|
7
7
|
var _euiThemeCommon = require("@elastic/eui-theme-common");
|
|
8
|
-
var
|
|
8
|
+
var _colors_vis = require("../../themes/amsterdam/global_styling/variables/_colors_vis");
|
|
9
9
|
/*
|
|
10
10
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
11
11
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -15,4 +15,4 @@ var _euiThemeBorealis = require("@elastic/eui-theme-borealis");
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
// initialsetup of Vis color storage with default colors
|
|
18
|
-
var EUI_VIS_COLOR_STORE = exports.EUI_VIS_COLOR_STORE = _euiThemeCommon.EuiVisColorStore.getInstance(
|
|
18
|
+
var EUI_VIS_COLOR_STORE = exports.EUI_VIS_COLOR_STORE = _euiThemeCommon.EuiVisColorStore.getInstance(_colors_vis.colorVis, true);
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultComputedTheme = exports.EuiThemeContext = exports.EuiSystemContext = exports.EuiNestedThemeContext = exports.EuiModificationsContext = exports.EuiHighContrastModeContext = exports.EuiColorModeContext = exports.DEFAULTS = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
8
|
+
var _theme = require("../../themes/amsterdam/theme");
|
|
9
9
|
var _utils = require("./utils");
|
|
10
10
|
/*
|
|
11
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -16,7 +16,7 @@ var _utils = require("./utils");
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
var DEFAULTS = exports.DEFAULTS = {
|
|
19
|
-
system:
|
|
19
|
+
system: _theme.EuiThemeAmsterdam,
|
|
20
20
|
modifications: {},
|
|
21
21
|
colorMode: _utils.DEFAULT_COLOR_MODE,
|
|
22
22
|
highContrastMode: false
|
|
@@ -34,14 +34,14 @@ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
|
|
|
34
34
|
}), ";", logicalTextAlignCSS('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
35
35
|
clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
36
36
|
// Colors
|
|
37
|
-
default: /*#__PURE__*/css(setBadgeColorVars(badgeColors.default), "
|
|
37
|
+
default: /*#__PURE__*/css(setBadgeColorVars(badgeColors.default), " border-color:", badgeColors.default.borderColor, ";;label:default;"),
|
|
38
38
|
hollow: /*#__PURE__*/css(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
39
39
|
primary: /*#__PURE__*/css(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
|
|
40
40
|
accent: /*#__PURE__*/css(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
|
|
41
41
|
warning: /*#__PURE__*/css(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
|
|
42
42
|
danger: /*#__PURE__*/css(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
|
|
43
43
|
success: /*#__PURE__*/css(setBadgeColorVars(badgeColors.success), ";label:success;"),
|
|
44
|
-
disabled: /*#__PURE__*/css(setBadgeColorVars(badgeColors.disabled), "
|
|
44
|
+
disabled: /*#__PURE__*/css(setBadgeColorVars(badgeColors.disabled), " border-color:", badgeColors.disabled.borderColor, ";*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
|
|
45
45
|
// Content wrapper
|
|
46
46
|
euiBadge__content: /*#__PURE__*/css(logicalCSS(
|
|
47
47
|
// Ensure proper height in case of just displaying an icon
|
|
@@ -15,7 +15,9 @@ import { isColorDark } from '../../services';
|
|
|
15
15
|
import { euiButtonColor, euiButtonFillColor } from '../../global_styling/mixins/_button';
|
|
16
16
|
import { chromaValid, parseColor } from '../color_picker/utils';
|
|
17
17
|
export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
18
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
18
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
19
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
20
|
+
var badgeColorsAccentText = getBadgeColors(euiThemeContext, euiTheme.colors.textAccent);
|
|
19
21
|
return {
|
|
20
22
|
// Colors shared between buttons and badges
|
|
21
23
|
primary: euiButtonFillColor(euiThemeContext, 'primary'),
|
|
@@ -24,16 +26,24 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
|
24
26
|
danger: euiButtonFillColor(euiThemeContext, 'danger'),
|
|
25
27
|
accent: euiButtonFillColor(euiThemeContext, 'accent'),
|
|
26
28
|
accentSecondary: euiButtonFillColor(euiThemeContext, 'accentSecondary'),
|
|
27
|
-
disabled: euiButtonColor(euiThemeContext, 'disabled'),
|
|
29
|
+
disabled: _objectSpread(_objectSpread({}, euiButtonColor(euiThemeContext, 'disabled')), {}, {
|
|
30
|
+
borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
|
|
31
|
+
}),
|
|
28
32
|
// Colors unique to badges
|
|
29
|
-
default: getBadgeColors(euiThemeContext, euiTheme.components.badgeBackground),
|
|
33
|
+
default: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.components.badgeBackground)), {}, {
|
|
34
|
+
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
35
|
+
}),
|
|
30
36
|
// Hollow has a border and is used for autocompleters and beta badges
|
|
31
37
|
hollow: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.colors.emptyShade)), {}, {
|
|
32
|
-
borderColor: euiTheme.components.badgeBorderColorHollow
|
|
38
|
+
borderColor: highContrastMode ? euiTheme.border.color : euiTheme.components.badgeBorderColorHollow
|
|
33
39
|
}),
|
|
34
40
|
// Colors used by beta and notification badges
|
|
35
|
-
subdued: getBadgeColors(euiThemeContext, euiTheme.components.badgeBackgroundSubdued),
|
|
36
|
-
|
|
41
|
+
subdued: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.components.badgeBackgroundSubdued)), {}, {
|
|
42
|
+
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
43
|
+
}),
|
|
44
|
+
accentText: _objectSpread(_objectSpread({}, badgeColorsAccentText), {}, {
|
|
45
|
+
borderColor: highContrastMode ? badgeColorsAccentText.backgroundColor : ''
|
|
46
|
+
}),
|
|
37
47
|
accentSecondaryText: getBadgeColors(euiThemeContext, euiTheme.colors.textAccentSecondary)
|
|
38
48
|
};
|
|
39
49
|
};
|
|
@@ -15,7 +15,7 @@ export var euiNotificationBadgeStyles = function euiNotificationBadgeStyles(euiT
|
|
|
15
15
|
var badgeColors = euiBadgeColors(euiThemeContext);
|
|
16
16
|
return {
|
|
17
17
|
euiNotificationBadge: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", logicalCSS('padding-horizontal', euiTheme.size.xs), " border-radius:", euiTheme.border.radius.small, ";", highContrastModeStyles(euiThemeContext, {
|
|
18
|
-
|
|
18
|
+
preferred: "\n border: ".concat(euiTheme.border.thin, ";\n overflow: hidden; /* Fix text clipping */\n ")
|
|
19
19
|
}), " cursor:default;font-size:", euiFontSizeFromScale('xs', euiTheme), ";font-weight:", euiTheme.font.weight.medium, ";", euiNumberFormat(euiThemeContext), " text-align:center;", euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in;};label:euiNotificationBadge;"),
|
|
20
20
|
// Sizes
|
|
21
21
|
s: /*#__PURE__*/css(logicalCSS('height', euiTheme.size.base), " ", logicalCSS('min-width', euiTheme.size.base), ";;label:s;"),
|
|
@@ -8,7 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { css } from '@emotion/react';
|
|
11
|
-
import { logicalShorthandCSS } from '../../global_styling';
|
|
11
|
+
import { highContrastModeStyles, logicalShorthandCSS } from '../../global_styling';
|
|
12
12
|
import { euiCodeSyntaxVariables } from './code_syntax.styles';
|
|
13
13
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
14
14
|
name: "gfiv3z-transparentBackground",
|
|
@@ -25,7 +25,9 @@ export var euiCodeStyles = function euiCodeStyles(euiThemeContext) {
|
|
|
25
25
|
/*
|
|
26
26
|
* 1. Size the code against the text its embedded within.
|
|
27
27
|
*/
|
|
28
|
-
euiCode: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:0.9em;", logicalShorthandCSS('padding', '0.2em 0.5em'), "background
|
|
28
|
+
euiCode: /*#__PURE__*/css("font-family:", euiTheme.font.familyCode, ";font-size:0.9em;", logicalShorthandCSS('padding', '0.2em 0.5em'), "background-color:", codeSyntaxVariables.backgroundColor, ";", highContrastModeStyles(euiThemeContext, {
|
|
29
|
+
forced: "\n border: ".concat(euiTheme.border.thin, ";\n ")
|
|
30
|
+
}), " border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.bold, ";color:", codeSyntaxVariables.inlineCodeColor, ";", codeSyntaxVariables.tokensCss, " .token.atrule .token.rule,.token.keyword{color:", codeSyntaxVariables.inlineCodeKeywordColor, ";};label:euiCode;"),
|
|
29
31
|
transparentBackground: _ref
|
|
30
32
|
};
|
|
31
33
|
};
|
|
@@ -14,9 +14,12 @@ export var euiCodeTextColors = function euiCodeTextColors(_ref) {
|
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* These variables are computationally expensive - do not call them outside `useEuiMemoizedStyles`
|
|
19
|
+
*/
|
|
18
20
|
export var euiCodeSyntaxVariables = function euiCodeSyntaxVariables(euiThemeContext) {
|
|
19
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
21
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
22
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
20
23
|
var _euiCodeTextColors = euiCodeTextColors(euiThemeContext),
|
|
21
24
|
backgroundColor = _euiCodeTextColors.backgroundColor,
|
|
22
25
|
color = _euiCodeTextColors.color;
|
|
@@ -46,7 +49,7 @@ export var euiCodeSyntaxVariables = function euiCodeSyntaxVariables(euiThemeCont
|
|
|
46
49
|
selectorClassColor: euiTheme.components.codeSelectorClassColor,
|
|
47
50
|
selectorIdColor: euiTheme.components.codeSelectorIdColor,
|
|
48
51
|
get tokensCss() {
|
|
49
|
-
return "\n .token.punctuation:not(.interpolation-punctuation):not([class*='attr-']) {\n opacity: .7;\n }\n\n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata,\n .token.coord,\n .token.blockquote {\n color: ".concat(this.commentColor, ";\n font-style: italic;\n }\n\n .token.selector {\n color: ").concat(this.selectorTagColor, ";\n }\n\n .token.string,\n .token.interpolation,\n .token.interpolation-punctuation,\n .token.doc-comment .token.keyword,\n .token.attr-value,\n .token.url .token.content {\n color: ").concat(this.stringColor, ";\n }\n\n .token.number,\n .token.boolean,\n .token.keyword.nil,\n .token.regex,\n .token.variable,\n .token.unit,\n .token.hexcode,\n .token.attr-name,\n .token.attr-equals {\n color: ").concat(this.numberColor, ";\n }\n\n .token.atrule .token.rule,\n .token.keyword {\n color: ").concat(this.keywordColor, ";\n }\n\n .token.function {\n color: ").concat(this.functionTitleColor, ";\n }\n\n .token.tag {\n color: ").concat(this.tagColor, ";\n }\n\n .token.class-name {\n color: ").concat(this.typeColor, ";\n }\n\n .token.property {\n color: ").concat(this.attributeColor, ";\n }\n\n .token.console,\n .token.list-punctuation,\n .token.url-reference,\n .token.url .token.url {\n color: ").concat(this.symbolColor, ";\n }\n\n .token.paramater {\n color: ").concat(this.paramsColor, ";\n }\n\n .token.meta,\n .token.important {\n color: ").concat(this.metaColor, ";\n }\n\n .token.title {\n color: ").concat(this.titleColor, ";\n }\n\n .token.section {\n color: ").concat(this.sectionColor, ";\n }\n\n .token.prefix.inserted,\n .token.prefix.deleted {\n padding-inline-start: -").concat(euiTheme.size.xs, ";\n margin-inline-start: -").concat(euiTheme.size.xs, ";\n }\n\n .token.prefix.inserted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.additionColor, ";\n color: ").concat(this.additionColor, ";\n }\n\n .token.prefix.deleted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.deletionColor, ";\n color: ").concat(this.deletionColor, ";\n }\n\n .token.selector .token.class {\n color: ").concat(this.selectorClassColor, ";\n }\n\n .token.selector .token.id {\n color: ").concat(this.selectorIdColor, ";\n }\n\n .token.italic {\n font-style: italic;\n }\n\n .token.important,\n .token.bold {\n font-weight: ").concat(euiTheme.font.weight.bold, ";\n }\n\n .token.url-reference,\n .token.url .token.url {\n text-decoration: underline;\n }\n\n .token.entity {\n cursor: help;\n }");
|
|
52
|
+
return "\n .token.punctuation:not(.interpolation-punctuation):not([class*='attr-']) {\n opacity: ".concat(highContrastMode ? '1' : '.7', ";\n }\n\n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata,\n .token.coord,\n .token.blockquote {\n color: ").concat(this.commentColor, ";\n font-style: italic;\n }\n\n .token.selector {\n color: ").concat(this.selectorTagColor, ";\n }\n\n .token.string,\n .token.interpolation,\n .token.interpolation-punctuation,\n .token.doc-comment .token.keyword,\n .token.attr-value,\n .token.url .token.content {\n color: ").concat(this.stringColor, ";\n }\n\n .token.number,\n .token.boolean,\n .token.keyword.nil,\n .token.regex,\n .token.variable,\n .token.unit,\n .token.hexcode,\n .token.attr-name,\n .token.attr-equals {\n color: ").concat(this.numberColor, ";\n }\n\n .token.atrule .token.rule,\n .token.keyword {\n color: ").concat(this.keywordColor, ";\n }\n\n .token.function {\n color: ").concat(this.functionTitleColor, ";\n }\n\n .token.tag {\n color: ").concat(this.tagColor, ";\n }\n\n .token.class-name {\n color: ").concat(this.typeColor, ";\n }\n\n .token.property {\n color: ").concat(this.attributeColor, ";\n }\n\n .token.console,\n .token.list-punctuation,\n .token.url-reference,\n .token.url .token.url {\n color: ").concat(this.symbolColor, ";\n }\n\n .token.paramater {\n color: ").concat(this.paramsColor, ";\n }\n\n .token.meta,\n .token.important {\n color: ").concat(this.metaColor, ";\n }\n\n .token.title {\n color: ").concat(this.titleColor, ";\n }\n\n .token.section {\n color: ").concat(this.sectionColor, ";\n }\n\n .token.prefix.inserted,\n .token.prefix.deleted {\n padding-inline-start: -").concat(euiTheme.size.xs, ";\n margin-inline-start: -").concat(euiTheme.size.xs, ";\n }\n\n .token.prefix.inserted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.additionColor, ";\n color: ").concat(this.additionColor, ";\n }\n\n .token.prefix.deleted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.deletionColor, ";\n color: ").concat(this.deletionColor, ";\n }\n\n .token.selector .token.class {\n color: ").concat(this.selectorClassColor, ";\n }\n\n .token.selector .token.id {\n color: ").concat(this.selectorIdColor, ";\n }\n\n .token.italic {\n font-style: italic;\n }\n\n .token.important,\n .token.bold {\n font-weight: ").concat(euiTheme.font.weight.bold, ";\n }\n\n .token.url-reference,\n .token.url .token.url {\n text-decoration: underline;\n }\n\n .token.entity {\n cursor: help;\n }");
|
|
50
53
|
}
|
|
51
54
|
};
|
|
52
55
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
var _excluded = ["className", "color", "style"];
|
|
4
|
+
var _excluded = ["className", "color", "style", "toolTipProps", "showToolTip"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/*
|
|
@@ -18,11 +18,16 @@ import { useEuiMemoizedStyles } from '../../services';
|
|
|
18
18
|
import { useEuiI18n } from '../i18n';
|
|
19
19
|
import { getChromaColor } from './utils';
|
|
20
20
|
import { euiColorPickerSwatchStyles } from './color_picker_swatch.styles';
|
|
21
|
+
import { EuiToolTip } from '../tool_tip';
|
|
21
22
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
22
23
|
export var EuiColorPickerSwatch = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
24
|
+
var _toolTipProps$anchorP;
|
|
23
25
|
var className = _ref.className,
|
|
24
26
|
color = _ref.color,
|
|
25
27
|
style = _ref.style,
|
|
28
|
+
toolTipProps = _ref.toolTipProps,
|
|
29
|
+
_ref$showToolTip = _ref.showToolTip,
|
|
30
|
+
showToolTip = _ref$showToolTip === void 0 ? true : _ref$showToolTip,
|
|
26
31
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
32
|
var classes = classNames('euiColorPickerSwatch', className);
|
|
28
33
|
var styles = useEuiMemoizedStyles(euiColorPickerSwatchStyles);
|
|
@@ -35,7 +40,7 @@ export var EuiColorPickerSwatch = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
35
40
|
var ariaLabel = useEuiI18n('euiColorPickerSwatch.ariaLabel', 'Select {color} as the color', {
|
|
36
41
|
color: color
|
|
37
42
|
});
|
|
38
|
-
|
|
43
|
+
var element = ___EmotionJSX("button", _extends({
|
|
39
44
|
type: "button",
|
|
40
45
|
css: styles.euiColorPickerSwatch,
|
|
41
46
|
className: classes,
|
|
@@ -45,5 +50,16 @@ export var EuiColorPickerSwatch = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
45
50
|
background: background
|
|
46
51
|
}, style)
|
|
47
52
|
}, rest));
|
|
53
|
+
return showToolTip ? ___EmotionJSX(EuiToolTip, _extends({
|
|
54
|
+
content: color
|
|
55
|
+
}, toolTipProps, {
|
|
56
|
+
anchorProps: _objectSpread(_objectSpread({}, toolTipProps === null || toolTipProps === void 0 ? void 0 : toolTipProps.anchorProps), {}, {
|
|
57
|
+
css: [toolTipProps === null || toolTipProps === void 0 || (_toolTipProps$anchorP = toolTipProps.anchorProps) === null || _toolTipProps$anchorP === void 0 ? void 0 : _toolTipProps$anchorP.css, styles.tooltip]
|
|
58
|
+
})
|
|
59
|
+
// since the button already has a descriptive `ariaLabel` we can disable
|
|
60
|
+
// the tooltip content from being read additionally by screen readers
|
|
61
|
+
,
|
|
62
|
+
disableScreenReaderOutput: true
|
|
63
|
+
}), element) : element;
|
|
48
64
|
});
|
|
49
65
|
EuiColorPickerSwatch.displayName = 'EuiColorPickerSwatch';
|
|
@@ -1,3 +1,4 @@
|
|
|
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)."; }
|
|
1
2
|
/*
|
|
2
3
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
3
4
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -10,6 +11,14 @@ import { css } from '@emotion/react';
|
|
|
10
11
|
import { transparentize } from '../../services';
|
|
11
12
|
import { logicalSizeCSS, mathWithUnits, euiOutline } from '../../global_styling';
|
|
12
13
|
import { highContrastModeStyles, preventForcedColors } from '../../global_styling/functions/high_contrast';
|
|
14
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
15
|
+
name: "164u3xw-tooltip",
|
|
16
|
+
styles: "display:inline-flex;label:tooltip;"
|
|
17
|
+
} : {
|
|
18
|
+
name: "164u3xw-tooltip",
|
|
19
|
+
styles: "display:inline-flex;label:tooltip;",
|
|
20
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
21
|
+
};
|
|
13
22
|
export var euiColorPickerSwatchStyles = function euiColorPickerSwatchStyles(euiThemeContext) {
|
|
14
23
|
var euiTheme = euiThemeContext.euiTheme;
|
|
15
24
|
return {
|
|
@@ -19,6 +28,7 @@ export var euiColorPickerSwatchStyles = function euiColorPickerSwatchStyles(euiT
|
|
|
19
28
|
none: "\n border: ".concat(euiTheme.border.width.thin, " solid\n ").concat(euiTheme.colors.borderBaseFormsColorSwatch, ";\n box-shadow: inset 0 0 0 ").concat(euiTheme.border.width.thin, "\n ").concat(transparentize(euiTheme.colors.emptyShade, 0.05), ";\n "),
|
|
20
29
|
preferred: "border: ".concat(euiTheme.border.thin, ";"),
|
|
21
30
|
forced: preventForcedColors(euiThemeContext)
|
|
22
|
-
}), " cursor:pointer;&:disabled{cursor:default;}&:focus{", euiOutline(euiThemeContext, 'center'), ";};label:euiColorPickerSwatch;")
|
|
31
|
+
}), " cursor:pointer;&:disabled{cursor:default;}&:focus{", euiOutline(euiThemeContext, 'center'), ";};label:euiColorPickerSwatch;"),
|
|
32
|
+
tooltip: _ref
|
|
23
33
|
};
|
|
24
34
|
};
|
|
@@ -57,5 +57,8 @@ var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext) {
|
|
|
57
57
|
borderColor: euiTheme.components.headerDarkSearchBorderColor,
|
|
58
58
|
placeholderColor: makeHighContrastColor(controlPlaceholderText, 8)(backgroundColor)
|
|
59
59
|
};
|
|
60
|
-
return "\n background-color: ".concat(backgroundColor, ";\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat(makeHighContrastColor(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat(euiTheme.components.headerDarkSectionItemBackgroundFocus, ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n input {\n box-shadow: inset 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(selectableSitewide.borderColor, ";\n }\n\n &--group {\n border-color: ").concat(
|
|
60
|
+
return "\n background-color: ".concat(backgroundColor, ";\n\n .euiHeaderLogo__text,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n color: ").concat(euiTheme.colors.ghost, ";\n }\n\n .euiHeaderLink-isActive {\n color: ").concat(makeHighContrastColor(euiTheme.colors.primary)(backgroundColor), ";\n }\n\n .euiHeaderLogo,\n .euiHeaderLink,\n .euiHeaderSectionItemButton {\n &:focus {\n background-color: ").concat(euiTheme.components.headerDarkSectionItemBackgroundFocus, ";\n }\n }\n\n .euiHeaderSectionItemButton__notification--badge {\n box-shadow: 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(backgroundColor, ";\n }\n\n .euiHeaderSectionItemButton__notification--dot {\n stroke: ").concat(backgroundColor, ";\n }\n\n .euiSelectableTemplateSitewide .euiFormControlLayout {\n background-color: transparent;\n\n input {\n box-shadow: inset 0 0 0 ").concat(euiTheme.border.width.thin, " ").concat(selectableSitewide.borderColor, ";\n }\n\n &--group {\n border-color: ").concat(
|
|
61
|
+
// the header is in a faux dark mode, we can't rely on color
|
|
62
|
+
// switch tokens as they'd be in the wrong color mode
|
|
63
|
+
highContrastMode ? euiTheme.colors.plainLight : euiTheme.components.headerDarkSearchBorderColor, ";\n\n input {\n box-shadow: none;\n }\n }\n\n &__append {\n border-color: ").concat(highContrastMode ? euiTheme.colors.plainLight : '', "\n }\n\n &:not(:focus-within) {\n /* Increase contrast of filled text to be more than placeholder text */\n color: ").concat(selectableSitewide.color, ";\n\n input {\n /* Increase contrast of placeholder text */\n &::placeholder {\n color: ").concat(selectableSitewide.placeholderColor, ";\n }\n\n /* Inherit color from form control layout */\n color: inherit;\n background-color: transparent;\n }\n\n .euiFormControlLayout__append,\n .euiFormControlLayout__prepend {\n background-color: transparent;\n }\n\n .euiFormLabel {\n color: inherit;\n }\n }\n }\n ");
|
|
61
64
|
};
|
|
@@ -23,7 +23,7 @@ export var euiPanelBorderStyles = function euiPanelBorderStyles(euiThemeContext,
|
|
|
23
23
|
euiTheme.colors.borderBaseFloating is enough then */
|
|
24
24
|
var hasVisibleBorder = hasFloatingBorder && colorMode === 'DARK';
|
|
25
25
|
return highContrastModeStyles(euiThemeContext, {
|
|
26
|
-
none: "\n /* Using a pseudo element for the border instead of floating border only \n because the transparent border might otherwise be visible with arbitrary \n full-width/height content in light mode. */\n &::
|
|
26
|
+
none: "\n /* Using a pseudo element for the border instead of floating border only \n because the transparent border might otherwise be visible with arbitrary \n full-width/height content in light mode. */\n &::after {\n content: '';\n position: absolute;\n /* ensure to keep on top of flush content */\n z-index: 0;\n inset: 0;\n border: ".concat(euiTheme.border.width.thin, " solid\n ").concat((borderColor !== null && borderColor !== void 0 ? borderColor : hasVisibleBorder) ? euiTheme.border.color : euiTheme.colors.borderBaseFloating, ";\n border-radius: inherit;\n pointer-events: none;\n }\n "),
|
|
27
27
|
preferred: "\n border: ".concat(euiTheme.border.thin, ";\n ")
|
|
28
28
|
});
|
|
29
29
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { EuiThemeAmsterdam } from '../../themes';
|
|
11
11
|
import { EuiThemeProvider } from '../../services';
|
|
12
12
|
import { emitEuiProviderWarning } from '../../services/theme/warning';
|
|
13
13
|
import { cache as fallbackCache } from '../../services/emotion/css';
|
|
@@ -26,7 +26,7 @@ export var EuiProvider = function EuiProvider(_ref) {
|
|
|
26
26
|
var _ref$cache = _ref.cache,
|
|
27
27
|
cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
|
|
28
28
|
_ref$theme = _ref.theme,
|
|
29
|
-
theme = _ref$theme === void 0 ?
|
|
29
|
+
theme = _ref$theme === void 0 ? EuiThemeAmsterdam : _ref$theme,
|
|
30
30
|
_ref$globalStyles = _ref.globalStyles,
|
|
31
31
|
Globals = _ref$globalStyles === void 0 ? EuiGlobalStyles : _ref$globalStyles,
|
|
32
32
|
_ref$utilityClasses = _ref.utilityClasses,
|
|
@@ -16,7 +16,7 @@ export var euiToastStyles = function euiToastStyles(euiThemeContext) {
|
|
|
16
16
|
var euiTheme = euiThemeContext.euiTheme,
|
|
17
17
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
18
18
|
var highlightStyles = function highlightStyles(color, width) {
|
|
19
|
-
return "\n &:
|
|
19
|
+
return "\n &:before {\n content: '';\n position: absolute;\n /* ensure highlight border is on top of panel border */\n z-index: 1;\n inset: 0;\n border-radius: inherit;\n ".concat(logicalCSS('border-top', "".concat(width, " solid ").concat(color)), "\n pointer-events: none;\n }\n ");
|
|
20
20
|
};
|
|
21
21
|
return {
|
|
22
22
|
// Base
|
|
@@ -36,11 +36,11 @@ export var euiToastStyles = function euiToastStyles(euiThemeContext) {
|
|
|
36
36
|
}) : euiTheme.border.width.thick;
|
|
37
37
|
return highContrastModeStyles(euiThemeContext, {
|
|
38
38
|
none: highlightStyles(color, borderWidth),
|
|
39
|
-
preferred: "\n ".concat(highlightStyles(color, borderWidth), "\n \n &::
|
|
39
|
+
preferred: "\n ".concat(highlightStyles(color, borderWidth), "\n \n &::before {\n ").concat(logicalCSS('width', "calc(100% + ".concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
|
|
40
40
|
return x * 2;
|
|
41
41
|
}), ")")), "\n ").concat(logicalCSS('margin-top', "-".concat(euiTheme.border.width.thin)), "\n ").concat(logicalCSS('margin-left', "-".concat(euiTheme.border.width.thin)), "\n }\n "),
|
|
42
42
|
// Windows high contrast mode ignores/overrides border colors, which have semantic meaning here. To get around this, we'll use a pseudo element that ignores forced colors
|
|
43
|
-
forced: "\n overflow: hidden;\n\n &::
|
|
43
|
+
forced: "\n overflow: hidden;\n\n &::before {\n content: '';\n position: absolute;\n ".concat(logicalCSS('top', 0), "\n ").concat(logicalCSS('horizontal', 0), "\n ").concat(logicalCSS('height', borderWidth), "\n background-color: ").concat(color, ";\n ").concat(preventForcedColors(euiThemeContext), "\n pointer-events: none;\n }\n ")
|
|
44
44
|
});
|
|
45
45
|
},
|
|
46
46
|
get primary() {
|
|
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
9
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll", "disableScreenReaderOutput"];
|
|
10
10
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
11
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12
12
|
/*
|
|
@@ -237,6 +237,8 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
237
237
|
delay = _this$props.delay,
|
|
238
238
|
display = _this$props.display,
|
|
239
239
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
240
|
+
_this$props$disableSc = _this$props.disableScreenReaderOutput,
|
|
241
|
+
disableScreenReaderOutput = _this$props$disableSc === void 0 ? false : _this$props$disableSc,
|
|
240
242
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
241
243
|
var _this$state = this.state,
|
|
242
244
|
arrowStyles = _this$state.arrowStyles,
|
|
@@ -252,8 +254,10 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
252
254
|
onFocus: this.onFocus,
|
|
253
255
|
onKeyDown: this.onEscapeKey,
|
|
254
256
|
onMouseOver: this.showToolTip,
|
|
255
|
-
onMouseOut: this.onMouseOut
|
|
256
|
-
id
|
|
257
|
+
onMouseOut: this.onMouseOut
|
|
258
|
+
// `id` defines if the trigger and tooltip are automatically linked via `aria-describedby`.
|
|
259
|
+
,
|
|
260
|
+
id: !disableScreenReaderOutput ? id : undefined,
|
|
257
261
|
className: anchorClasses,
|
|
258
262
|
display: display,
|
|
259
263
|
isVisible: visible
|
|
@@ -283,5 +287,6 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
283
287
|
_defineProperty(EuiToolTip, "defaultProps", {
|
|
284
288
|
position: 'top',
|
|
285
289
|
delay: 'regular',
|
|
286
|
-
display: 'inlineBlock'
|
|
290
|
+
display: 'inlineBlock',
|
|
291
|
+
disableScreenReaderOutput: false
|
|
287
292
|
});
|
|
@@ -45,7 +45,7 @@ export var EuiToolTipAnchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
45
45
|
_onBlur();
|
|
46
46
|
children.props.onBlur && children.props.onBlur(e);
|
|
47
47
|
},
|
|
48
|
-
'aria-describedby': isVisible ? classNames(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
48
|
+
'aria-describedby': isVisible && id ? classNames(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
49
49
|
}))
|
|
50
50
|
);
|
|
51
51
|
});
|
|
@@ -41,10 +41,11 @@ export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
|
41
41
|
* @returns Style object `{ backgroundColor, color }`
|
|
42
42
|
*/
|
|
43
43
|
export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
|
|
44
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
44
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
45
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
45
46
|
var backgroundTokenName = getTokenName('backgroundFilled', color);
|
|
46
47
|
var textColorTokenName = getTokenName('textColorFilled', color);
|
|
47
|
-
var foreground = euiTheme.components.buttons[textColorTokenName];
|
|
48
|
+
var foreground = highContrastMode ? color === 'warning' ? euiTheme.colors.ink : euiTheme.colors.textInverse : euiTheme.components.buttons[textColorTokenName];
|
|
48
49
|
var background = euiTheme.components.buttons[backgroundTokenName];
|
|
49
50
|
return _objectSpread({
|
|
50
51
|
color: foreground,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { EuiVisColorStore } from '@elastic/eui-theme-common';
|
|
10
|
-
import { colorVis } from '
|
|
10
|
+
import { colorVis } from '../../themes/amsterdam/global_styling/variables/_colors_vis';
|
|
11
11
|
|
|
12
12
|
// initialsetup of Vis color storage with default colors
|
|
13
13
|
export var EUI_VIS_COLOR_STORE = EuiVisColorStore.getInstance(colorVis, true);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { createContext } from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { EuiThemeAmsterdam } from '../../themes/amsterdam/theme';
|
|
11
11
|
import { DEFAULT_COLOR_MODE, getComputed } from './utils';
|
|
12
12
|
export var DEFAULTS = {
|
|
13
|
-
system:
|
|
13
|
+
system: EuiThemeAmsterdam,
|
|
14
14
|
modifications: {},
|
|
15
15
|
colorMode: DEFAULT_COLOR_MODE,
|
|
16
16
|
highContrastMode: false
|
|
@@ -38,14 +38,14 @@ var euiBadgeStyles = exports.euiBadgeStyles = function euiBadgeStyles(euiThemeCo
|
|
|
38
38
|
}), ";", (0, _global_styling.logicalTextAlignCSS)('left'), "color:var(--euiBadgeTextColor, ", badgeColors.default.color, ");background-color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );*::selection{color:var(\n --euiBadgeBackgroundColor,\n ", badgeColors.default.backgroundColor, "\n );background-color:var(\n --euiBadgeTextColor,\n ", badgeColors.default.color, "\n );}&:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
|
|
39
39
|
clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
|
|
40
40
|
// Colors
|
|
41
|
-
default: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.default), "
|
|
41
|
+
default: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.default), " border-color:", badgeColors.default.borderColor, ";;label:default;"),
|
|
42
42
|
hollow: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.hollow), " border-color:", badgeColors.hollow.borderColor, ";;label:hollow;"),
|
|
43
43
|
primary: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.primary), ";label:primary;"),
|
|
44
44
|
accent: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.accent), ";label:accent;"),
|
|
45
45
|
warning: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.warning), ";label:warning;"),
|
|
46
46
|
danger: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.danger), ";label:danger;"),
|
|
47
47
|
success: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.success), ";label:success;"),
|
|
48
|
-
disabled: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.disabled), "
|
|
48
|
+
disabled: /*#__PURE__*/(0, _react.css)(setBadgeColorVars(badgeColors.disabled), " border-color:", badgeColors.disabled.borderColor, ";*::selection{color:", euiTheme.colors.emptyShade, ";};label:disabled;"),
|
|
49
49
|
// Content wrapper
|
|
50
50
|
euiBadge__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)(
|
|
51
51
|
// Ensure proper height in case of just displaying an icon
|
|
@@ -20,7 +20,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
20
20
|
* Side Public License, v 1.
|
|
21
21
|
*/
|
|
22
22
|
var euiBadgeColors = exports.euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
23
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
23
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
24
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
25
|
+
var badgeColorsAccentText = getBadgeColors(euiThemeContext, euiTheme.colors.textAccent);
|
|
24
26
|
return {
|
|
25
27
|
// Colors shared between buttons and badges
|
|
26
28
|
primary: (0, _button.euiButtonFillColor)(euiThemeContext, 'primary'),
|
|
@@ -29,16 +31,24 @@ var euiBadgeColors = exports.euiBadgeColors = function euiBadgeColors(euiThemeCo
|
|
|
29
31
|
danger: (0, _button.euiButtonFillColor)(euiThemeContext, 'danger'),
|
|
30
32
|
accent: (0, _button.euiButtonFillColor)(euiThemeContext, 'accent'),
|
|
31
33
|
accentSecondary: (0, _button.euiButtonFillColor)(euiThemeContext, 'accentSecondary'),
|
|
32
|
-
disabled: (0, _button.euiButtonColor)(euiThemeContext, 'disabled'),
|
|
34
|
+
disabled: _objectSpread(_objectSpread({}, (0, _button.euiButtonColor)(euiThemeContext, 'disabled')), {}, {
|
|
35
|
+
borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
|
|
36
|
+
}),
|
|
33
37
|
// Colors unique to badges
|
|
34
|
-
default: getBadgeColors(euiThemeContext, euiTheme.components.badgeBackground),
|
|
38
|
+
default: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.components.badgeBackground)), {}, {
|
|
39
|
+
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
40
|
+
}),
|
|
35
41
|
// Hollow has a border and is used for autocompleters and beta badges
|
|
36
42
|
hollow: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.colors.emptyShade)), {}, {
|
|
37
|
-
borderColor: euiTheme.components.badgeBorderColorHollow
|
|
43
|
+
borderColor: highContrastMode ? euiTheme.border.color : euiTheme.components.badgeBorderColorHollow
|
|
38
44
|
}),
|
|
39
45
|
// Colors used by beta and notification badges
|
|
40
|
-
subdued: getBadgeColors(euiThemeContext, euiTheme.components.badgeBackgroundSubdued),
|
|
41
|
-
|
|
46
|
+
subdued: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.components.badgeBackgroundSubdued)), {}, {
|
|
47
|
+
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
48
|
+
}),
|
|
49
|
+
accentText: _objectSpread(_objectSpread({}, badgeColorsAccentText), {}, {
|
|
50
|
+
borderColor: highContrastMode ? badgeColorsAccentText.backgroundColor : ''
|
|
51
|
+
}),
|
|
42
52
|
accentSecondaryText: getBadgeColors(euiThemeContext, euiTheme.colors.textAccentSecondary)
|
|
43
53
|
};
|
|
44
54
|
};
|
|
@@ -21,7 +21,7 @@ var euiNotificationBadgeStyles = exports.euiNotificationBadgeStyles = function e
|
|
|
21
21
|
var badgeColors = (0, _color_utils.euiBadgeColors)(euiThemeContext);
|
|
22
22
|
return {
|
|
23
23
|
euiNotificationBadge: /*#__PURE__*/(0, _react.css)("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", (0, _global_styling.logicalCSS)('padding-horizontal', euiTheme.size.xs), " border-radius:", euiTheme.border.radius.small, ";", (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
24
|
-
|
|
24
|
+
preferred: "\n border: ".concat(euiTheme.border.thin, ";\n overflow: hidden; /* Fix text clipping */\n ")
|
|
25
25
|
}), " cursor:default;font-size:", (0, _global_styling.euiFontSizeFromScale)('xs', euiTheme), ";font-weight:", euiTheme.font.weight.medium, ";", (0, _global_styling.euiNumberFormat)(euiThemeContext), " text-align:center;", _global_styling.euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in;};label:euiNotificationBadge;"),
|
|
26
26
|
// Sizes
|
|
27
27
|
s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('height', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('min-width', euiTheme.size.base), ";;label:s;"),
|
|
@@ -29,7 +29,9 @@ var euiCodeStyles = exports.euiCodeStyles = function euiCodeStyles(euiThemeConte
|
|
|
29
29
|
/*
|
|
30
30
|
* 1. Size the code against the text its embedded within.
|
|
31
31
|
*/
|
|
32
|
-
euiCode: /*#__PURE__*/(0, _react.css)("font-family:", euiTheme.font.familyCode, ";font-size:0.9em;", (0, _global_styling.logicalShorthandCSS)('padding', '0.2em 0.5em'), "background:", codeSyntaxVariables.backgroundColor, ";
|
|
32
|
+
euiCode: /*#__PURE__*/(0, _react.css)("font-family:", euiTheme.font.familyCode, ";font-size:0.9em;", (0, _global_styling.logicalShorthandCSS)('padding', '0.2em 0.5em'), "background-color:", codeSyntaxVariables.backgroundColor, ";", (0, _global_styling.highContrastModeStyles)(euiThemeContext, {
|
|
33
|
+
forced: "\n border: ".concat(euiTheme.border.thin, ";\n ")
|
|
34
|
+
}), " border-radius:", euiTheme.border.radius.small, ";font-weight:", euiTheme.font.weight.bold, ";color:", codeSyntaxVariables.inlineCodeColor, ";", codeSyntaxVariables.tokensCss, " .token.atrule .token.rule,.token.keyword{color:", codeSyntaxVariables.inlineCodeKeywordColor, ";};label:euiCode;"),
|
|
33
35
|
transparentBackground: _ref
|
|
34
36
|
};
|
|
35
37
|
};
|
|
@@ -20,9 +20,12 @@ var euiCodeTextColors = exports.euiCodeTextColors = function euiCodeTextColors(_
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* These variables are computationally expensive - do not call them outside `useEuiMemoizedStyles`
|
|
25
|
+
*/
|
|
24
26
|
var euiCodeSyntaxVariables = exports.euiCodeSyntaxVariables = function euiCodeSyntaxVariables(euiThemeContext) {
|
|
25
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
27
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
28
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
26
29
|
var _euiCodeTextColors = euiCodeTextColors(euiThemeContext),
|
|
27
30
|
backgroundColor = _euiCodeTextColors.backgroundColor,
|
|
28
31
|
color = _euiCodeTextColors.color;
|
|
@@ -52,7 +55,7 @@ var euiCodeSyntaxVariables = exports.euiCodeSyntaxVariables = function euiCodeSy
|
|
|
52
55
|
selectorClassColor: euiTheme.components.codeSelectorClassColor,
|
|
53
56
|
selectorIdColor: euiTheme.components.codeSelectorIdColor,
|
|
54
57
|
get tokensCss() {
|
|
55
|
-
return "\n .token.punctuation:not(.interpolation-punctuation):not([class*='attr-']) {\n opacity: .7;\n }\n\n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata,\n .token.coord,\n .token.blockquote {\n color: ".concat(this.commentColor, ";\n font-style: italic;\n }\n\n .token.selector {\n color: ").concat(this.selectorTagColor, ";\n }\n\n .token.string,\n .token.interpolation,\n .token.interpolation-punctuation,\n .token.doc-comment .token.keyword,\n .token.attr-value,\n .token.url .token.content {\n color: ").concat(this.stringColor, ";\n }\n\n .token.number,\n .token.boolean,\n .token.keyword.nil,\n .token.regex,\n .token.variable,\n .token.unit,\n .token.hexcode,\n .token.attr-name,\n .token.attr-equals {\n color: ").concat(this.numberColor, ";\n }\n\n .token.atrule .token.rule,\n .token.keyword {\n color: ").concat(this.keywordColor, ";\n }\n\n .token.function {\n color: ").concat(this.functionTitleColor, ";\n }\n\n .token.tag {\n color: ").concat(this.tagColor, ";\n }\n\n .token.class-name {\n color: ").concat(this.typeColor, ";\n }\n\n .token.property {\n color: ").concat(this.attributeColor, ";\n }\n\n .token.console,\n .token.list-punctuation,\n .token.url-reference,\n .token.url .token.url {\n color: ").concat(this.symbolColor, ";\n }\n\n .token.paramater {\n color: ").concat(this.paramsColor, ";\n }\n\n .token.meta,\n .token.important {\n color: ").concat(this.metaColor, ";\n }\n\n .token.title {\n color: ").concat(this.titleColor, ";\n }\n\n .token.section {\n color: ").concat(this.sectionColor, ";\n }\n\n .token.prefix.inserted,\n .token.prefix.deleted {\n padding-inline-start: -").concat(euiTheme.size.xs, ";\n margin-inline-start: -").concat(euiTheme.size.xs, ";\n }\n\n .token.prefix.inserted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.additionColor, ";\n color: ").concat(this.additionColor, ";\n }\n\n .token.prefix.deleted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.deletionColor, ";\n color: ").concat(this.deletionColor, ";\n }\n\n .token.selector .token.class {\n color: ").concat(this.selectorClassColor, ";\n }\n\n .token.selector .token.id {\n color: ").concat(this.selectorIdColor, ";\n }\n\n .token.italic {\n font-style: italic;\n }\n\n .token.important,\n .token.bold {\n font-weight: ").concat(euiTheme.font.weight.bold, ";\n }\n\n .token.url-reference,\n .token.url .token.url {\n text-decoration: underline;\n }\n\n .token.entity {\n cursor: help;\n }");
|
|
58
|
+
return "\n .token.punctuation:not(.interpolation-punctuation):not([class*='attr-']) {\n opacity: ".concat(highContrastMode ? '1' : '.7', ";\n }\n\n .token.comment,\n .token.prolog,\n .token.doctype,\n .token.cdata,\n .token.coord,\n .token.blockquote {\n color: ").concat(this.commentColor, ";\n font-style: italic;\n }\n\n .token.selector {\n color: ").concat(this.selectorTagColor, ";\n }\n\n .token.string,\n .token.interpolation,\n .token.interpolation-punctuation,\n .token.doc-comment .token.keyword,\n .token.attr-value,\n .token.url .token.content {\n color: ").concat(this.stringColor, ";\n }\n\n .token.number,\n .token.boolean,\n .token.keyword.nil,\n .token.regex,\n .token.variable,\n .token.unit,\n .token.hexcode,\n .token.attr-name,\n .token.attr-equals {\n color: ").concat(this.numberColor, ";\n }\n\n .token.atrule .token.rule,\n .token.keyword {\n color: ").concat(this.keywordColor, ";\n }\n\n .token.function {\n color: ").concat(this.functionTitleColor, ";\n }\n\n .token.tag {\n color: ").concat(this.tagColor, ";\n }\n\n .token.class-name {\n color: ").concat(this.typeColor, ";\n }\n\n .token.property {\n color: ").concat(this.attributeColor, ";\n }\n\n .token.console,\n .token.list-punctuation,\n .token.url-reference,\n .token.url .token.url {\n color: ").concat(this.symbolColor, ";\n }\n\n .token.paramater {\n color: ").concat(this.paramsColor, ";\n }\n\n .token.meta,\n .token.important {\n color: ").concat(this.metaColor, ";\n }\n\n .token.title {\n color: ").concat(this.titleColor, ";\n }\n\n .token.section {\n color: ").concat(this.sectionColor, ";\n }\n\n .token.prefix.inserted,\n .token.prefix.deleted {\n padding-inline-start: -").concat(euiTheme.size.xs, ";\n margin-inline-start: -").concat(euiTheme.size.xs, ";\n }\n\n .token.prefix.inserted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.additionColor, ";\n color: ").concat(this.additionColor, ";\n }\n\n .token.prefix.deleted {\n box-shadow: -").concat(euiTheme.size.xs, " 0 ").concat(this.deletionColor, ";\n color: ").concat(this.deletionColor, ";\n }\n\n .token.selector .token.class {\n color: ").concat(this.selectorClassColor, ";\n }\n\n .token.selector .token.id {\n color: ").concat(this.selectorIdColor, ";\n }\n\n .token.italic {\n font-style: italic;\n }\n\n .token.important,\n .token.bold {\n font-weight: ").concat(euiTheme.font.weight.bold, ";\n }\n\n .token.url-reference,\n .token.url .token.url {\n text-decoration: underline;\n }\n\n .token.entity {\n cursor: help;\n }");
|
|
56
59
|
}
|
|
57
60
|
};
|
|
58
61
|
};
|
|
@@ -15,8 +15,9 @@ var _services = require("../../services");
|
|
|
15
15
|
var _i18n = require("../i18n");
|
|
16
16
|
var _utils = require("./utils");
|
|
17
17
|
var _color_picker_swatch = require("./color_picker_swatch.styles");
|
|
18
|
+
var _tool_tip = require("../tool_tip");
|
|
18
19
|
var _react2 = require("@emotion/react");
|
|
19
|
-
var _excluded = ["className", "color", "style"];
|
|
20
|
+
var _excluded = ["className", "color", "style", "toolTipProps", "showToolTip"];
|
|
20
21
|
/*
|
|
21
22
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
22
23
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -29,9 +30,13 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
29
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30
31
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
32
|
var EuiColorPickerSwatch = exports.EuiColorPickerSwatch = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
33
|
+
var _toolTipProps$anchorP;
|
|
32
34
|
var className = _ref.className,
|
|
33
35
|
color = _ref.color,
|
|
34
36
|
style = _ref.style,
|
|
37
|
+
toolTipProps = _ref.toolTipProps,
|
|
38
|
+
_ref$showToolTip = _ref.showToolTip,
|
|
39
|
+
showToolTip = _ref$showToolTip === void 0 ? true : _ref$showToolTip,
|
|
35
40
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
36
41
|
var classes = (0, _classnames.default)('euiColorPickerSwatch', className);
|
|
37
42
|
var styles = (0, _services.useEuiMemoizedStyles)(_color_picker_swatch.euiColorPickerSwatchStyles);
|
|
@@ -44,7 +49,7 @@ var EuiColorPickerSwatch = exports.EuiColorPickerSwatch = /*#__PURE__*/(0, _reac
|
|
|
44
49
|
var ariaLabel = (0, _i18n.useEuiI18n)('euiColorPickerSwatch.ariaLabel', 'Select {color} as the color', {
|
|
45
50
|
color: color
|
|
46
51
|
});
|
|
47
|
-
|
|
52
|
+
var element = (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
48
53
|
type: "button",
|
|
49
54
|
css: styles.euiColorPickerSwatch,
|
|
50
55
|
className: classes,
|
|
@@ -54,5 +59,16 @@ var EuiColorPickerSwatch = exports.EuiColorPickerSwatch = /*#__PURE__*/(0, _reac
|
|
|
54
59
|
background: background
|
|
55
60
|
}, style)
|
|
56
61
|
}, rest));
|
|
62
|
+
return showToolTip ? (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
63
|
+
content: color
|
|
64
|
+
}, toolTipProps, {
|
|
65
|
+
anchorProps: _objectSpread(_objectSpread({}, toolTipProps === null || toolTipProps === void 0 ? void 0 : toolTipProps.anchorProps), {}, {
|
|
66
|
+
css: [toolTipProps === null || toolTipProps === void 0 || (_toolTipProps$anchorP = toolTipProps.anchorProps) === null || _toolTipProps$anchorP === void 0 ? void 0 : _toolTipProps$anchorP.css, styles.tooltip]
|
|
67
|
+
})
|
|
68
|
+
// since the button already has a descriptive `ariaLabel` we can disable
|
|
69
|
+
// the tooltip content from being read additionally by screen readers
|
|
70
|
+
,
|
|
71
|
+
disableScreenReaderOutput: true
|
|
72
|
+
}), element) : element;
|
|
57
73
|
});
|
|
58
74
|
EuiColorPickerSwatch.displayName = 'EuiColorPickerSwatch';
|