@elastic/eui 101.1.0 → 101.2.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/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/eui.d.ts +39 -0
- 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/panel/panel.styles.js +1 -1
- 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/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/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/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/panel/panel.styles.js +1 -1
- 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/package.json +1 -1
- 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/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
|
@@ -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
|
|
@@ -23,7 +23,9 @@ import { isColorDark } from '../../services';
|
|
|
23
23
|
import { euiButtonColor, euiButtonFillColor } from '../../global_styling/mixins/_button';
|
|
24
24
|
import { chromaValid, parseColor } from '../color_picker/utils';
|
|
25
25
|
export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
26
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
26
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
27
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
28
|
+
var badgeColorsAccentText = getBadgeColors(euiThemeContext, euiTheme.colors.textAccent);
|
|
27
29
|
return {
|
|
28
30
|
// Colors shared between buttons and badges
|
|
29
31
|
primary: euiButtonFillColor(euiThemeContext, 'primary'),
|
|
@@ -32,16 +34,24 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
|
|
|
32
34
|
danger: euiButtonFillColor(euiThemeContext, 'danger'),
|
|
33
35
|
accent: euiButtonFillColor(euiThemeContext, 'accent'),
|
|
34
36
|
accentSecondary: euiButtonFillColor(euiThemeContext, 'accentSecondary'),
|
|
35
|
-
disabled: euiButtonColor(euiThemeContext, 'disabled'),
|
|
37
|
+
disabled: _objectSpread(_objectSpread({}, euiButtonColor(euiThemeContext, 'disabled')), {}, {
|
|
38
|
+
borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
|
|
39
|
+
}),
|
|
36
40
|
// Colors unique to badges
|
|
37
|
-
default: getBadgeColors(euiThemeContext, euiTheme.components.badgeBackground),
|
|
41
|
+
default: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.components.badgeBackground)), {}, {
|
|
42
|
+
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
43
|
+
}),
|
|
38
44
|
// Hollow has a border and is used for autocompleters and beta badges
|
|
39
45
|
hollow: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.colors.emptyShade)), {}, {
|
|
40
|
-
borderColor: euiTheme.components.badgeBorderColorHollow
|
|
46
|
+
borderColor: highContrastMode ? euiTheme.border.color : euiTheme.components.badgeBorderColorHollow
|
|
41
47
|
}),
|
|
42
48
|
// Colors used by beta and notification badges
|
|
43
|
-
subdued: getBadgeColors(euiThemeContext, euiTheme.components.badgeBackgroundSubdued),
|
|
44
|
-
|
|
49
|
+
subdued: _objectSpread(_objectSpread({}, getBadgeColors(euiThemeContext, euiTheme.components.badgeBackgroundSubdued)), {}, {
|
|
50
|
+
borderColor: highContrastMode ? euiTheme.border.color : ''
|
|
51
|
+
}),
|
|
52
|
+
accentText: _objectSpread(_objectSpread({}, badgeColorsAccentText), {}, {
|
|
53
|
+
borderColor: highContrastMode ? badgeColorsAccentText.backgroundColor : ''
|
|
54
|
+
}),
|
|
45
55
|
accentSecondaryText: getBadgeColors(euiThemeContext, euiTheme.colors.textAccentSecondary)
|
|
46
56
|
};
|
|
47
57
|
};
|
|
@@ -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;"),
|
|
@@ -1121,6 +1121,15 @@ EuiBasicTable.propTypes = {
|
|
|
1121
1121
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
1122
1122
|
*/
|
|
1123
1123
|
repositionOnScroll: PropTypes.bool,
|
|
1124
|
+
/**
|
|
1125
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
1126
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
1127
|
+
* information (action & additional information).
|
|
1128
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
1129
|
+
* the tooltip content and would result in repetitive output.
|
|
1130
|
+
* @default false
|
|
1131
|
+
*/
|
|
1132
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
1124
1133
|
/**
|
|
1125
1134
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
1126
1135
|
* hidden.
|
|
@@ -1236,6 +1245,7 @@ EuiBasicTable.propTypes = {
|
|
|
1236
1245
|
title: PropTypes.node,
|
|
1237
1246
|
id: PropTypes.string,
|
|
1238
1247
|
repositionOnScroll: PropTypes.bool,
|
|
1248
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
1239
1249
|
onMouseOut: PropTypes.func,
|
|
1240
1250
|
"aria-label": PropTypes.string,
|
|
1241
1251
|
"data-test-subj": PropTypes.string,
|
|
@@ -1376,6 +1386,7 @@ EuiBasicTable.propTypes = {
|
|
|
1376
1386
|
title: PropTypes.node,
|
|
1377
1387
|
id: PropTypes.string,
|
|
1378
1388
|
repositionOnScroll: PropTypes.bool,
|
|
1389
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
1379
1390
|
onMouseOut: PropTypes.func,
|
|
1380
1391
|
"aria-label": PropTypes.string,
|
|
1381
1392
|
"data-test-subj": PropTypes.string,
|
|
@@ -615,6 +615,15 @@ EuiInMemoryTable.propTypes = {
|
|
|
615
615
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
616
616
|
*/
|
|
617
617
|
repositionOnScroll: PropTypes.bool,
|
|
618
|
+
/**
|
|
619
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
620
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
621
|
+
* information (action & additional information).
|
|
622
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
623
|
+
* the tooltip content and would result in repetitive output.
|
|
624
|
+
* @default false
|
|
625
|
+
*/
|
|
626
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
618
627
|
/**
|
|
619
628
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
620
629
|
* hidden.
|
|
@@ -730,6 +739,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
730
739
|
title: PropTypes.node,
|
|
731
740
|
id: PropTypes.string,
|
|
732
741
|
repositionOnScroll: PropTypes.bool,
|
|
742
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
733
743
|
onMouseOut: PropTypes.func,
|
|
734
744
|
"aria-label": PropTypes.string,
|
|
735
745
|
"data-test-subj": PropTypes.string,
|
|
@@ -870,6 +880,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
870
880
|
title: PropTypes.node,
|
|
871
881
|
id: PropTypes.string,
|
|
872
882
|
repositionOnScroll: PropTypes.bool,
|
|
883
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
873
884
|
onMouseOut: PropTypes.func,
|
|
874
885
|
"aria-label": PropTypes.string,
|
|
875
886
|
"data-test-subj": PropTypes.string,
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["className", "color", "style"];
|
|
2
|
+
var _excluded = ["className", "color", "style", "toolTipProps", "showToolTip"];
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
@@ -23,11 +23,16 @@ import { useEuiMemoizedStyles } from '../../services';
|
|
|
23
23
|
import { useEuiI18n } from '../i18n';
|
|
24
24
|
import { getChromaColor } from './utils';
|
|
25
25
|
import { euiColorPickerSwatchStyles } from './color_picker_swatch.styles';
|
|
26
|
+
import { EuiToolTip } from '../tool_tip';
|
|
26
27
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
27
28
|
export var EuiColorPickerSwatch = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
29
|
+
var _toolTipProps$anchorP;
|
|
28
30
|
var className = _ref.className,
|
|
29
31
|
color = _ref.color,
|
|
30
32
|
style = _ref.style,
|
|
33
|
+
toolTipProps = _ref.toolTipProps,
|
|
34
|
+
_ref$showToolTip = _ref.showToolTip,
|
|
35
|
+
showToolTip = _ref$showToolTip === void 0 ? true : _ref$showToolTip,
|
|
31
36
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
37
|
var classes = classNames('euiColorPickerSwatch', className);
|
|
33
38
|
var styles = useEuiMemoizedStyles(euiColorPickerSwatchStyles);
|
|
@@ -40,7 +45,7 @@ export var EuiColorPickerSwatch = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
40
45
|
var ariaLabel = useEuiI18n('euiColorPickerSwatch.ariaLabel', 'Select {color} as the color', {
|
|
41
46
|
color: color
|
|
42
47
|
});
|
|
43
|
-
|
|
48
|
+
var element = ___EmotionJSX("button", _extends({
|
|
44
49
|
type: "button",
|
|
45
50
|
css: styles.euiColorPickerSwatch,
|
|
46
51
|
className: classes,
|
|
@@ -50,12 +55,89 @@ export var EuiColorPickerSwatch = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
50
55
|
background: background
|
|
51
56
|
}, style)
|
|
52
57
|
}, rest));
|
|
58
|
+
return showToolTip ? ___EmotionJSX(EuiToolTip, _extends({
|
|
59
|
+
content: color
|
|
60
|
+
}, toolTipProps, {
|
|
61
|
+
anchorProps: _objectSpread(_objectSpread({}, toolTipProps === null || toolTipProps === void 0 ? void 0 : toolTipProps.anchorProps), {}, {
|
|
62
|
+
css: [toolTipProps === null || toolTipProps === void 0 || (_toolTipProps$anchorP = toolTipProps.anchorProps) === null || _toolTipProps$anchorP === void 0 ? void 0 : _toolTipProps$anchorP.css, styles.tooltip]
|
|
63
|
+
})
|
|
64
|
+
// since the button already has a descriptive `ariaLabel` we can disable
|
|
65
|
+
// the tooltip content from being read additionally by screen readers
|
|
66
|
+
,
|
|
67
|
+
disableScreenReaderOutput: true
|
|
68
|
+
}), element) : element;
|
|
53
69
|
});
|
|
54
70
|
EuiColorPickerSwatch.propTypes = {
|
|
55
71
|
className: PropTypes.string,
|
|
56
72
|
"aria-label": PropTypes.string,
|
|
57
73
|
"data-test-subj": PropTypes.string,
|
|
58
74
|
css: PropTypes.any,
|
|
59
|
-
color: PropTypes.string
|
|
75
|
+
color: PropTypes.string,
|
|
76
|
+
/**
|
|
77
|
+
* renders a tooltip with the color value to provide a visual text alternative
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
showToolTip: PropTypes.bool,
|
|
81
|
+
/** Additional props for the EuiToolip when `showToolTip={true}` */toolTipProps: PropTypes.shape({
|
|
82
|
+
/**
|
|
83
|
+
* Passes onto the span wrapping the trigger.
|
|
84
|
+
*/
|
|
85
|
+
anchorClassName: PropTypes.string,
|
|
86
|
+
/**
|
|
87
|
+
* Passes onto the span wrapping the trigger.
|
|
88
|
+
*/
|
|
89
|
+
anchorProps: PropTypes.shape({
|
|
90
|
+
className: PropTypes.string,
|
|
91
|
+
"aria-label": PropTypes.string,
|
|
92
|
+
"data-test-subj": PropTypes.string,
|
|
93
|
+
css: PropTypes.any
|
|
94
|
+
}),
|
|
95
|
+
/**
|
|
96
|
+
* Passes onto the tooltip itself, not the trigger.
|
|
97
|
+
*/
|
|
98
|
+
className: PropTypes.string,
|
|
99
|
+
/**
|
|
100
|
+
* The main content of your tooltip.
|
|
101
|
+
*/
|
|
102
|
+
content: PropTypes.node,
|
|
103
|
+
/**
|
|
104
|
+
* Common display alternatives for the anchor wrapper
|
|
105
|
+
*/
|
|
106
|
+
display: PropTypes.any,
|
|
107
|
+
/**
|
|
108
|
+
* An optional title for your tooltip.
|
|
109
|
+
*/
|
|
110
|
+
title: PropTypes.node,
|
|
111
|
+
/**
|
|
112
|
+
* Unless you provide one, this will be randomly generated.
|
|
113
|
+
*/
|
|
114
|
+
id: PropTypes.string,
|
|
115
|
+
/**
|
|
116
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
117
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
118
|
+
*
|
|
119
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
120
|
+
*/
|
|
121
|
+
repositionOnScroll: PropTypes.bool,
|
|
122
|
+
/**
|
|
123
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
124
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
125
|
+
* information (action & additional information).
|
|
126
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
127
|
+
* the tooltip content and would result in repetitive output.
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
131
|
+
/**
|
|
132
|
+
* If supplied, called when mouse movement causes the tool tip to be
|
|
133
|
+
* hidden.
|
|
134
|
+
*/
|
|
135
|
+
onMouseOut: PropTypes.func,
|
|
136
|
+
"aria-label": PropTypes.string,
|
|
137
|
+
"data-test-subj": PropTypes.string,
|
|
138
|
+
css: PropTypes.any,
|
|
139
|
+
delay: PropTypes.any,
|
|
140
|
+
position: PropTypes.any
|
|
141
|
+
})
|
|
60
142
|
};
|
|
61
143
|
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
|
};
|
|
@@ -193,6 +193,15 @@ EuiTableHeaderCell.propTypes = {
|
|
|
193
193
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
194
194
|
*/
|
|
195
195
|
repositionOnScroll: PropTypes.bool,
|
|
196
|
+
/**
|
|
197
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
198
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
199
|
+
* information (action & additional information).
|
|
200
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
201
|
+
* the tooltip content and would result in repetitive output.
|
|
202
|
+
* @default false
|
|
203
|
+
*/
|
|
204
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
196
205
|
/**
|
|
197
206
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
198
207
|
* hidden.
|
|
@@ -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() {
|
|
@@ -81,6 +81,15 @@ EuiIconTip.propTypes = {
|
|
|
81
81
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
82
82
|
*/
|
|
83
83
|
repositionOnScroll: PropTypes.bool,
|
|
84
|
+
/**
|
|
85
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
86
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
87
|
+
* information (action & additional information).
|
|
88
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
89
|
+
* the tooltip content and would result in repetitive output.
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
84
93
|
/**
|
|
85
94
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
86
95
|
* hidden.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
1
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll", "disableScreenReaderOutput"];
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
3
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
4
4
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
@@ -245,6 +245,8 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
245
245
|
delay = _this$props.delay,
|
|
246
246
|
display = _this$props.display,
|
|
247
247
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
248
|
+
_this$props$disableSc = _this$props.disableScreenReaderOutput,
|
|
249
|
+
disableScreenReaderOutput = _this$props$disableSc === void 0 ? false : _this$props$disableSc,
|
|
248
250
|
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
249
251
|
var _this$state = this.state,
|
|
250
252
|
arrowStyles = _this$state.arrowStyles,
|
|
@@ -260,8 +262,10 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
260
262
|
onFocus: this.onFocus,
|
|
261
263
|
onKeyDown: this.onEscapeKey,
|
|
262
264
|
onMouseOver: this.showToolTip,
|
|
263
|
-
onMouseOut: this.onMouseOut
|
|
264
|
-
id
|
|
265
|
+
onMouseOut: this.onMouseOut
|
|
266
|
+
// `id` defines if the trigger and tooltip are automatically linked via `aria-describedby`.
|
|
267
|
+
,
|
|
268
|
+
id: !disableScreenReaderOutput ? id : undefined,
|
|
265
269
|
className: anchorClasses,
|
|
266
270
|
display: display,
|
|
267
271
|
isVisible: visible
|
|
@@ -291,7 +295,8 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
291
295
|
_defineProperty(EuiToolTip, "defaultProps", {
|
|
292
296
|
position: 'top',
|
|
293
297
|
delay: 'regular',
|
|
294
|
-
display: 'inlineBlock'
|
|
298
|
+
display: 'inlineBlock',
|
|
299
|
+
disableScreenReaderOutput: false
|
|
295
300
|
});
|
|
296
301
|
EuiToolTip.propTypes = {
|
|
297
302
|
/**
|
|
@@ -346,6 +351,15 @@ EuiToolTip.propTypes = {
|
|
|
346
351
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
347
352
|
*/
|
|
348
353
|
repositionOnScroll: PropTypes.bool,
|
|
354
|
+
/**
|
|
355
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
356
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
357
|
+
* information (action & additional information).
|
|
358
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
359
|
+
* the tooltip content and would result in repetitive output.
|
|
360
|
+
* @default false
|
|
361
|
+
*/
|
|
362
|
+
disableScreenReaderOutput: PropTypes.bool,
|
|
349
363
|
/**
|
|
350
364
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
351
365
|
* hidden.
|
|
@@ -47,7 +47,7 @@ export var EuiToolTipAnchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
47
47
|
_onBlur();
|
|
48
48
|
children.props.onBlur && children.props.onBlur(e);
|
|
49
49
|
},
|
|
50
|
-
'aria-describedby': isVisible ? classNames(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
50
|
+
'aria-describedby': isVisible && id ? classNames(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
51
51
|
}))
|
|
52
52
|
);
|
|
53
53
|
});
|
|
@@ -44,10 +44,11 @@ export var euiButtonColor = function euiButtonColor(euiThemeContext, color) {
|
|
|
44
44
|
* @returns Style object `{ backgroundColor, color }`
|
|
45
45
|
*/
|
|
46
46
|
export var euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
|
|
47
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
47
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
48
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
48
49
|
var backgroundTokenName = getTokenName('backgroundFilled', color);
|
|
49
50
|
var textColorTokenName = getTokenName('textColorFilled', color);
|
|
50
|
-
var foreground = euiTheme.components.buttons[textColorTokenName];
|
|
51
|
+
var foreground = highContrastMode ? color === 'warning' ? euiTheme.colors.ink : euiTheme.colors.textInverse : euiTheme.components.buttons[textColorTokenName];
|
|
51
52
|
var background = euiTheme.components.buttons[backgroundTokenName];
|
|
52
53
|
return _objectSpread({
|
|
53
54
|
color: foreground,
|
package/eui.d.ts
CHANGED
|
@@ -1547,6 +1547,9 @@ declare module '@elastic/eui/src/components/code/code_syntax.styles' {
|
|
|
1547
1547
|
backgroundColor: string;
|
|
1548
1548
|
color: string;
|
|
1549
1549
|
};
|
|
1550
|
+
/**
|
|
1551
|
+
* These variables are computationally expensive - do not call them outside `useEuiMemoizedStyles`
|
|
1552
|
+
*/
|
|
1550
1553
|
export const euiCodeSyntaxVariables: (euiThemeContext: UseEuiTheme) => {
|
|
1551
1554
|
backgroundColor: string;
|
|
1552
1555
|
color: string;
|
|
@@ -3386,6 +3389,15 @@ declare module '@elastic/eui/src/components/tool_tip/tool_tip' {
|
|
|
3386
3389
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
3387
3390
|
*/
|
|
3388
3391
|
repositionOnScroll?: boolean;
|
|
3392
|
+
/**
|
|
3393
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
3394
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
3395
|
+
* information (action & additional information).
|
|
3396
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
3397
|
+
* the tooltip content and would result in repetitive output.
|
|
3398
|
+
* @default false
|
|
3399
|
+
*/
|
|
3400
|
+
disableScreenReaderOutput?: boolean;
|
|
3389
3401
|
/**
|
|
3390
3402
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
3391
3403
|
* hidden.
|
|
@@ -8003,15 +8015,18 @@ declare module '@elastic/eui/src/components/badge/color_utils' {
|
|
|
8003
8015
|
backgroundColor: string;
|
|
8004
8016
|
};
|
|
8005
8017
|
disabled: {
|
|
8018
|
+
borderColor: string;
|
|
8006
8019
|
border: string;
|
|
8007
8020
|
color: string;
|
|
8008
8021
|
backgroundColor: string;
|
|
8009
8022
|
} | {
|
|
8023
|
+
borderColor: string;
|
|
8010
8024
|
border?: undefined;
|
|
8011
8025
|
color: string;
|
|
8012
8026
|
backgroundColor: string;
|
|
8013
8027
|
};
|
|
8014
8028
|
default: {
|
|
8029
|
+
borderColor: string;
|
|
8015
8030
|
backgroundColor: string;
|
|
8016
8031
|
color: string;
|
|
8017
8032
|
};
|
|
@@ -8021,10 +8036,12 @@ declare module '@elastic/eui/src/components/badge/color_utils' {
|
|
|
8021
8036
|
color: string;
|
|
8022
8037
|
};
|
|
8023
8038
|
subdued: {
|
|
8039
|
+
borderColor: string;
|
|
8024
8040
|
backgroundColor: string;
|
|
8025
8041
|
color: string;
|
|
8026
8042
|
};
|
|
8027
8043
|
accentText: {
|
|
8044
|
+
borderColor: string;
|
|
8028
8045
|
backgroundColor: string;
|
|
8029
8046
|
color: string;
|
|
8030
8047
|
};
|
|
@@ -13271,17 +13288,39 @@ declare module '@elastic/eui/src/components/color_picker/color_picker_swatch.sty
|
|
|
13271
13288
|
import { UseEuiTheme } from '@elastic/eui/src/services';
|
|
13272
13289
|
export const euiColorPickerSwatchStyles: (euiThemeContext: UseEuiTheme) => {
|
|
13273
13290
|
euiColorPickerSwatch: import("@emotion/react").SerializedStyles;
|
|
13291
|
+
tooltip: import("@emotion/react").SerializedStyles;
|
|
13274
13292
|
};
|
|
13275
13293
|
|
|
13276
13294
|
}
|
|
13277
13295
|
declare module '@elastic/eui/src/components/color_picker/color_picker_swatch' {
|
|
13278
13296
|
import React, { ButtonHTMLAttributes } from 'react';
|
|
13279
13297
|
import { CommonProps } from '@elastic/eui/src/components/common';
|
|
13298
|
+
import { EuiToolTipProps } from '@elastic/eui/src/components/tool_tip';
|
|
13280
13299
|
export type EuiColorPickerSwatchProps = CommonProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> & {
|
|
13281
13300
|
color?: string;
|
|
13301
|
+
/**
|
|
13302
|
+
* renders a tooltip with the color value to provide a visual text alternative
|
|
13303
|
+
* @default true
|
|
13304
|
+
*/
|
|
13305
|
+
showToolTip?: boolean;
|
|
13306
|
+
/** Additional props for the EuiToolip when `showToolTip={true}` */
|
|
13307
|
+
toolTipProps?: Omit<EuiToolTipProps, 'children' | 'delay' | 'position'> & {
|
|
13308
|
+
delay?: EuiToolTipProps['delay'];
|
|
13309
|
+
position?: EuiToolTipProps['position'];
|
|
13310
|
+
};
|
|
13282
13311
|
};
|
|
13283
13312
|
export const EuiColorPickerSwatch: React.ForwardRefExoticComponent<CommonProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color"> & {
|
|
13284
13313
|
color?: string | undefined;
|
|
13314
|
+
/**
|
|
13315
|
+
* renders a tooltip with the color value to provide a visual text alternative
|
|
13316
|
+
* @default true
|
|
13317
|
+
*/
|
|
13318
|
+
showToolTip?: boolean | undefined;
|
|
13319
|
+
/** Additional props for the EuiToolip when `showToolTip={true}` */
|
|
13320
|
+
toolTipProps?: (Omit<EuiToolTipProps, "children" | "position" | "delay"> & {
|
|
13321
|
+
delay?: import ("@elastic/eui/src/components/tool_tip/tool_tip").ToolTipDelay | undefined;
|
|
13322
|
+
position?: import ("@elastic/eui/src/components/tool_tip").ToolTipPositions | undefined;
|
|
13323
|
+
}) | undefined;
|
|
13285
13324
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
13286
13325
|
|
|
13287
13326
|
}
|