@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
|
@@ -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;"),
|
|
@@ -1115,6 +1115,15 @@ EuiBasicTable.propTypes = {
|
|
|
1115
1115
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
1116
1116
|
*/
|
|
1117
1117
|
repositionOnScroll: _propTypes.default.bool,
|
|
1118
|
+
/**
|
|
1119
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
1120
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
1121
|
+
* information (action & additional information).
|
|
1122
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
1123
|
+
* the tooltip content and would result in repetitive output.
|
|
1124
|
+
* @default false
|
|
1125
|
+
*/
|
|
1126
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
1118
1127
|
/**
|
|
1119
1128
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
1120
1129
|
* hidden.
|
|
@@ -1230,6 +1239,7 @@ EuiBasicTable.propTypes = {
|
|
|
1230
1239
|
title: _propTypes.default.node,
|
|
1231
1240
|
id: _propTypes.default.string,
|
|
1232
1241
|
repositionOnScroll: _propTypes.default.bool,
|
|
1242
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
1233
1243
|
onMouseOut: _propTypes.default.func,
|
|
1234
1244
|
"aria-label": _propTypes.default.string,
|
|
1235
1245
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -1370,6 +1380,7 @@ EuiBasicTable.propTypes = {
|
|
|
1370
1380
|
title: _propTypes.default.node,
|
|
1371
1381
|
id: _propTypes.default.string,
|
|
1372
1382
|
repositionOnScroll: _propTypes.default.bool,
|
|
1383
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
1373
1384
|
onMouseOut: _propTypes.default.func,
|
|
1374
1385
|
"aria-label": _propTypes.default.string,
|
|
1375
1386
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -616,6 +616,15 @@ EuiInMemoryTable.propTypes = {
|
|
|
616
616
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
617
617
|
*/
|
|
618
618
|
repositionOnScroll: _propTypes.default.bool,
|
|
619
|
+
/**
|
|
620
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
621
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
622
|
+
* information (action & additional information).
|
|
623
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
624
|
+
* the tooltip content and would result in repetitive output.
|
|
625
|
+
* @default false
|
|
626
|
+
*/
|
|
627
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
619
628
|
/**
|
|
620
629
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
621
630
|
* hidden.
|
|
@@ -731,6 +740,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
731
740
|
title: _propTypes.default.node,
|
|
732
741
|
id: _propTypes.default.string,
|
|
733
742
|
repositionOnScroll: _propTypes.default.bool,
|
|
743
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
734
744
|
onMouseOut: _propTypes.default.func,
|
|
735
745
|
"aria-label": _propTypes.default.string,
|
|
736
746
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -871,6 +881,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
871
881
|
title: _propTypes.default.node,
|
|
872
882
|
id: _propTypes.default.string,
|
|
873
883
|
repositionOnScroll: _propTypes.default.bool,
|
|
884
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
874
885
|
onMouseOut: _propTypes.default.func,
|
|
875
886
|
"aria-label": _propTypes.default.string,
|
|
876
887
|
"data-test-subj": _propTypes.default.string,
|
|
@@ -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
|
};
|
|
@@ -16,8 +16,9 @@ var _services = require("../../services");
|
|
|
16
16
|
var _i18n = require("../i18n");
|
|
17
17
|
var _utils = require("./utils");
|
|
18
18
|
var _color_picker_swatch = require("./color_picker_swatch.styles");
|
|
19
|
+
var _tool_tip = require("../tool_tip");
|
|
19
20
|
var _react2 = require("@emotion/react");
|
|
20
|
-
var _excluded = ["className", "color", "style"];
|
|
21
|
+
var _excluded = ["className", "color", "style", "toolTipProps", "showToolTip"];
|
|
21
22
|
/*
|
|
22
23
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
23
24
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -30,9 +31,13 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
30
31
|
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; }
|
|
31
32
|
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; }
|
|
32
33
|
var EuiColorPickerSwatch = exports.EuiColorPickerSwatch = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
34
|
+
var _toolTipProps$anchorP;
|
|
33
35
|
var className = _ref.className,
|
|
34
36
|
color = _ref.color,
|
|
35
37
|
style = _ref.style,
|
|
38
|
+
toolTipProps = _ref.toolTipProps,
|
|
39
|
+
_ref$showToolTip = _ref.showToolTip,
|
|
40
|
+
showToolTip = _ref$showToolTip === void 0 ? true : _ref$showToolTip,
|
|
36
41
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
37
42
|
var classes = (0, _classnames.default)('euiColorPickerSwatch', className);
|
|
38
43
|
var styles = (0, _services.useEuiMemoizedStyles)(_color_picker_swatch.euiColorPickerSwatchStyles);
|
|
@@ -45,7 +50,7 @@ var EuiColorPickerSwatch = exports.EuiColorPickerSwatch = /*#__PURE__*/(0, _reac
|
|
|
45
50
|
var ariaLabel = (0, _i18n.useEuiI18n)('euiColorPickerSwatch.ariaLabel', 'Select {color} as the color', {
|
|
46
51
|
color: color
|
|
47
52
|
});
|
|
48
|
-
|
|
53
|
+
var element = (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
49
54
|
type: "button",
|
|
50
55
|
css: styles.euiColorPickerSwatch,
|
|
51
56
|
className: classes,
|
|
@@ -55,12 +60,89 @@ var EuiColorPickerSwatch = exports.EuiColorPickerSwatch = /*#__PURE__*/(0, _reac
|
|
|
55
60
|
background: background
|
|
56
61
|
}, style)
|
|
57
62
|
}, rest));
|
|
63
|
+
return showToolTip ? (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
64
|
+
content: color
|
|
65
|
+
}, toolTipProps, {
|
|
66
|
+
anchorProps: _objectSpread(_objectSpread({}, toolTipProps === null || toolTipProps === void 0 ? void 0 : toolTipProps.anchorProps), {}, {
|
|
67
|
+
css: [toolTipProps === null || toolTipProps === void 0 || (_toolTipProps$anchorP = toolTipProps.anchorProps) === null || _toolTipProps$anchorP === void 0 ? void 0 : _toolTipProps$anchorP.css, styles.tooltip]
|
|
68
|
+
})
|
|
69
|
+
// since the button already has a descriptive `ariaLabel` we can disable
|
|
70
|
+
// the tooltip content from being read additionally by screen readers
|
|
71
|
+
,
|
|
72
|
+
disableScreenReaderOutput: true
|
|
73
|
+
}), element) : element;
|
|
58
74
|
});
|
|
59
75
|
EuiColorPickerSwatch.propTypes = {
|
|
60
76
|
className: _propTypes.default.string,
|
|
61
77
|
"aria-label": _propTypes.default.string,
|
|
62
78
|
"data-test-subj": _propTypes.default.string,
|
|
63
79
|
css: _propTypes.default.any,
|
|
64
|
-
color: _propTypes.default.string
|
|
80
|
+
color: _propTypes.default.string,
|
|
81
|
+
/**
|
|
82
|
+
* renders a tooltip with the color value to provide a visual text alternative
|
|
83
|
+
* @default true
|
|
84
|
+
*/
|
|
85
|
+
showToolTip: _propTypes.default.bool,
|
|
86
|
+
/** Additional props for the EuiToolip when `showToolTip={true}` */toolTipProps: _propTypes.default.shape({
|
|
87
|
+
/**
|
|
88
|
+
* Passes onto the span wrapping the trigger.
|
|
89
|
+
*/
|
|
90
|
+
anchorClassName: _propTypes.default.string,
|
|
91
|
+
/**
|
|
92
|
+
* Passes onto the span wrapping the trigger.
|
|
93
|
+
*/
|
|
94
|
+
anchorProps: _propTypes.default.shape({
|
|
95
|
+
className: _propTypes.default.string,
|
|
96
|
+
"aria-label": _propTypes.default.string,
|
|
97
|
+
"data-test-subj": _propTypes.default.string,
|
|
98
|
+
css: _propTypes.default.any
|
|
99
|
+
}),
|
|
100
|
+
/**
|
|
101
|
+
* Passes onto the tooltip itself, not the trigger.
|
|
102
|
+
*/
|
|
103
|
+
className: _propTypes.default.string,
|
|
104
|
+
/**
|
|
105
|
+
* The main content of your tooltip.
|
|
106
|
+
*/
|
|
107
|
+
content: _propTypes.default.node,
|
|
108
|
+
/**
|
|
109
|
+
* Common display alternatives for the anchor wrapper
|
|
110
|
+
*/
|
|
111
|
+
display: _propTypes.default.any,
|
|
112
|
+
/**
|
|
113
|
+
* An optional title for your tooltip.
|
|
114
|
+
*/
|
|
115
|
+
title: _propTypes.default.node,
|
|
116
|
+
/**
|
|
117
|
+
* Unless you provide one, this will be randomly generated.
|
|
118
|
+
*/
|
|
119
|
+
id: _propTypes.default.string,
|
|
120
|
+
/**
|
|
121
|
+
* When `true`, the tooltip's position is re-calculated when the user
|
|
122
|
+
* scrolls. This supports having fixed-position tooltip anchors.
|
|
123
|
+
*
|
|
124
|
+
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
125
|
+
*/
|
|
126
|
+
repositionOnScroll: _propTypes.default.bool,
|
|
127
|
+
/**
|
|
128
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
129
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
130
|
+
* information (action & additional information).
|
|
131
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
132
|
+
* the tooltip content and would result in repetitive output.
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
135
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
136
|
+
/**
|
|
137
|
+
* If supplied, called when mouse movement causes the tool tip to be
|
|
138
|
+
* hidden.
|
|
139
|
+
*/
|
|
140
|
+
onMouseOut: _propTypes.default.func,
|
|
141
|
+
"aria-label": _propTypes.default.string,
|
|
142
|
+
"data-test-subj": _propTypes.default.string,
|
|
143
|
+
css: _propTypes.default.any,
|
|
144
|
+
delay: _propTypes.default.any,
|
|
145
|
+
position: _propTypes.default.any
|
|
146
|
+
})
|
|
65
147
|
};
|
|
66
148
|
EuiColorPickerSwatch.displayName = 'EuiColorPickerSwatch';
|
|
@@ -8,14 +8,21 @@ var _react = require("@emotion/react");
|
|
|
8
8
|
var _services = require("../../services");
|
|
9
9
|
var _global_styling = require("../../global_styling");
|
|
10
10
|
var _high_contrast = require("../../global_styling/functions/high_contrast");
|
|
11
|
-
/*
|
|
11
|
+
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)."; } /*
|
|
12
12
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
13
13
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
14
14
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
15
15
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
19
|
+
name: "164u3xw-tooltip",
|
|
20
|
+
styles: "display:inline-flex;label:tooltip;"
|
|
21
|
+
} : {
|
|
22
|
+
name: "164u3xw-tooltip",
|
|
23
|
+
styles: "display:inline-flex;label:tooltip;",
|
|
24
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
25
|
+
};
|
|
19
26
|
var euiColorPickerSwatchStyles = exports.euiColorPickerSwatchStyles = function euiColorPickerSwatchStyles(euiThemeContext) {
|
|
20
27
|
var euiTheme = euiThemeContext.euiTheme;
|
|
21
28
|
return {
|
|
@@ -25,6 +32,7 @@ var euiColorPickerSwatchStyles = exports.euiColorPickerSwatchStyles = function e
|
|
|
25
32
|
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((0, _services.transparentize)(euiTheme.colors.emptyShade, 0.05), ";\n "),
|
|
26
33
|
preferred: "border: ".concat(euiTheme.border.thin, ";"),
|
|
27
34
|
forced: (0, _high_contrast.preventForcedColors)(euiThemeContext)
|
|
28
|
-
}), " cursor:pointer;&:disabled{cursor:default;}&:focus{", (0, _global_styling.euiOutline)(euiThemeContext, 'center'), ";};label:euiColorPickerSwatch;")
|
|
35
|
+
}), " cursor:pointer;&:disabled{cursor:default;}&:focus{", (0, _global_styling.euiOutline)(euiThemeContext, 'center'), ";};label:euiColorPickerSwatch;"),
|
|
36
|
+
tooltip: _ref
|
|
29
37
|
};
|
|
30
38
|
};
|
|
@@ -64,5 +64,8 @@ var euiHeaderDarkStyles = function euiHeaderDarkStyles(euiThemeContext) {
|
|
|
64
64
|
borderColor: euiTheme.components.headerDarkSearchBorderColor,
|
|
65
65
|
placeholderColor: (0, _services.makeHighContrastColor)(controlPlaceholderText, 8)(backgroundColor)
|
|
66
66
|
};
|
|
67
|
-
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((0, _services.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(
|
|
67
|
+
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((0, _services.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(
|
|
68
|
+
// the header is in a faux dark mode, we can't rely on color
|
|
69
|
+
// switch tokens as they'd be in the wrong color mode
|
|
70
|
+
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 ");
|
|
68
71
|
};
|
|
@@ -27,7 +27,7 @@ var euiPanelBorderStyles = exports.euiPanelBorderStyles = function euiPanelBorde
|
|
|
27
27
|
euiTheme.colors.borderBaseFloating is enough then */
|
|
28
28
|
var hasVisibleBorder = hasFloatingBorder && colorMode === 'DARK';
|
|
29
29
|
return (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
30
|
-
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 &::
|
|
30
|
+
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 "),
|
|
31
31
|
preferred: "\n border: ".concat(euiTheme.border.thin, ";\n ")
|
|
32
32
|
});
|
|
33
33
|
};
|
|
@@ -198,6 +198,15 @@ EuiTableHeaderCell.propTypes = {
|
|
|
198
198
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
199
199
|
*/
|
|
200
200
|
repositionOnScroll: _propTypes.default.bool,
|
|
201
|
+
/**
|
|
202
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
203
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
204
|
+
* information (action & additional information).
|
|
205
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
206
|
+
* the tooltip content and would result in repetitive output.
|
|
207
|
+
* @default false
|
|
208
|
+
*/
|
|
209
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
201
210
|
/**
|
|
202
211
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
203
212
|
* hidden.
|
|
@@ -22,7 +22,7 @@ var euiToastStyles = exports.euiToastStyles = function euiToastStyles(euiThemeCo
|
|
|
22
22
|
var euiTheme = euiThemeContext.euiTheme,
|
|
23
23
|
highContrastMode = euiThemeContext.highContrastMode;
|
|
24
24
|
var highlightStyles = function highlightStyles(color, width) {
|
|
25
|
-
return "\n &:
|
|
25
|
+
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((0, _global_styling.logicalCSS)('border-top', "".concat(width, " solid ").concat(color)), "\n pointer-events: none;\n }\n ");
|
|
26
26
|
};
|
|
27
27
|
return {
|
|
28
28
|
// Base
|
|
@@ -42,11 +42,11 @@ var euiToastStyles = exports.euiToastStyles = function euiToastStyles(euiThemeCo
|
|
|
42
42
|
}) : euiTheme.border.width.thick;
|
|
43
43
|
return (0, _high_contrast.highContrastModeStyles)(euiThemeContext, {
|
|
44
44
|
none: highlightStyles(color, borderWidth),
|
|
45
|
-
preferred: "\n ".concat(highlightStyles(color, borderWidth), "\n \n &::
|
|
45
|
+
preferred: "\n ".concat(highlightStyles(color, borderWidth), "\n \n &::before {\n ").concat((0, _global_styling.logicalCSS)('width', "calc(100% + ".concat((0, _euiThemeCommon.mathWithUnits)(euiTheme.border.width.thin, function (x) {
|
|
46
46
|
return x * 2;
|
|
47
47
|
}), ")")), "\n ").concat((0, _global_styling.logicalCSS)('margin-top', "-".concat(euiTheme.border.width.thin)), "\n ").concat((0, _global_styling.logicalCSS)('margin-left', "-".concat(euiTheme.border.width.thin)), "\n }\n "),
|
|
48
48
|
// 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
|
|
49
|
-
forced: "\n overflow: hidden;\n\n &::
|
|
49
|
+
forced: "\n overflow: hidden;\n\n &::before {\n content: '';\n position: absolute;\n ".concat((0, _global_styling.logicalCSS)('top', 0), "\n ").concat((0, _global_styling.logicalCSS)('horizontal', 0), "\n ").concat((0, _global_styling.logicalCSS)('height', borderWidth), "\n background-color: ").concat(color, ";\n ").concat((0, _high_contrast.preventForcedColors)(euiThemeContext), "\n pointer-events: none;\n }\n ")
|
|
50
50
|
});
|
|
51
51
|
},
|
|
52
52
|
get primary() {
|
|
@@ -86,6 +86,15 @@ EuiIconTip.propTypes = {
|
|
|
86
86
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
87
87
|
*/
|
|
88
88
|
repositionOnScroll: _propTypes.default.bool,
|
|
89
|
+
/**
|
|
90
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
91
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
92
|
+
* information (action & additional information).
|
|
93
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
94
|
+
* the tooltip content and would result in repetitive output.
|
|
95
|
+
* @default false
|
|
96
|
+
*/
|
|
97
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
89
98
|
/**
|
|
90
99
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
91
100
|
* hidden.
|
|
@@ -26,7 +26,7 @@ var _tool_tip_anchor = require("./tool_tip_anchor");
|
|
|
26
26
|
var _tool_tip_arrow = require("./tool_tip_arrow");
|
|
27
27
|
var _tool_tip_manager = require("./tool_tip_manager");
|
|
28
28
|
var _react3 = require("@emotion/react");
|
|
29
|
-
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll"];
|
|
29
|
+
var _excluded = ["children", "className", "anchorClassName", "anchorProps", "content", "title", "delay", "display", "repositionOnScroll", "disableScreenReaderOutput"];
|
|
30
30
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
31
31
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
32
32
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
@@ -246,6 +246,8 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
246
246
|
delay = _this$props.delay,
|
|
247
247
|
display = _this$props.display,
|
|
248
248
|
repositionOnScroll = _this$props.repositionOnScroll,
|
|
249
|
+
_this$props$disableSc = _this$props.disableScreenReaderOutput,
|
|
250
|
+
disableScreenReaderOutput = _this$props$disableSc === void 0 ? false : _this$props$disableSc,
|
|
249
251
|
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
250
252
|
var _this$state = this.state,
|
|
251
253
|
arrowStyles = _this$state.arrowStyles,
|
|
@@ -261,8 +263,10 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
261
263
|
onFocus: this.onFocus,
|
|
262
264
|
onKeyDown: this.onEscapeKey,
|
|
263
265
|
onMouseOver: this.showToolTip,
|
|
264
|
-
onMouseOut: this.onMouseOut
|
|
265
|
-
id
|
|
266
|
+
onMouseOut: this.onMouseOut
|
|
267
|
+
// `id` defines if the trigger and tooltip are automatically linked via `aria-describedby`.
|
|
268
|
+
,
|
|
269
|
+
id: !disableScreenReaderOutput ? id : undefined,
|
|
266
270
|
className: anchorClasses,
|
|
267
271
|
display: display,
|
|
268
272
|
isVisible: visible
|
|
@@ -292,7 +296,8 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
292
296
|
(0, _defineProperty2.default)(EuiToolTip, "defaultProps", {
|
|
293
297
|
position: 'top',
|
|
294
298
|
delay: 'regular',
|
|
295
|
-
display: 'inlineBlock'
|
|
299
|
+
display: 'inlineBlock',
|
|
300
|
+
disableScreenReaderOutput: false
|
|
296
301
|
});
|
|
297
302
|
EuiToolTip.propTypes = {
|
|
298
303
|
/**
|
|
@@ -347,6 +352,15 @@ EuiToolTip.propTypes = {
|
|
|
347
352
|
* When nesting an `EuiTooltip` in a scrollable container, `repositionOnScroll` should be `true`
|
|
348
353
|
*/
|
|
349
354
|
repositionOnScroll: _propTypes.default.bool,
|
|
355
|
+
/**
|
|
356
|
+
* Disables the tooltip content being read by screen readers when focusing the trigger element.
|
|
357
|
+
* Do not use when the trigger `aria-label` and tooltip `content` can be rephrased to be standalone
|
|
358
|
+
* information (action & additional information).
|
|
359
|
+
* Enable this prop only when the trigger has a descriptive label that either duplicates or includes
|
|
360
|
+
* the tooltip content and would result in repetitive output.
|
|
361
|
+
* @default false
|
|
362
|
+
*/
|
|
363
|
+
disableScreenReaderOutput: _propTypes.default.bool,
|
|
350
364
|
/**
|
|
351
365
|
* If supplied, called when mouse movement causes the tool tip to be
|
|
352
366
|
* hidden.
|
|
@@ -55,7 +55,7 @@ var EuiToolTipAnchor = exports.EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwar
|
|
|
55
55
|
_onBlur();
|
|
56
56
|
children.props.onBlur && children.props.onBlur(e);
|
|
57
57
|
},
|
|
58
|
-
'aria-describedby': isVisible ? (0, _classnames.default)(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
58
|
+
'aria-describedby': isVisible && id ? (0, _classnames.default)(id, children.props['aria-describedby']) : children.props['aria-describedby']
|
|
59
59
|
}))
|
|
60
60
|
);
|
|
61
61
|
});
|
|
@@ -46,10 +46,11 @@ var euiButtonColor = exports.euiButtonColor = function euiButtonColor(euiThemeCo
|
|
|
46
46
|
* @returns Style object `{ backgroundColor, color }`
|
|
47
47
|
*/
|
|
48
48
|
var euiButtonFillColor = exports.euiButtonFillColor = function euiButtonFillColor(euiThemeContext, color) {
|
|
49
|
-
var euiTheme = euiThemeContext.euiTheme
|
|
49
|
+
var euiTheme = euiThemeContext.euiTheme,
|
|
50
|
+
highContrastMode = euiThemeContext.highContrastMode;
|
|
50
51
|
var backgroundTokenName = (0, _euiThemeCommon.getTokenName)('backgroundFilled', color);
|
|
51
52
|
var textColorTokenName = (0, _euiThemeCommon.getTokenName)('textColorFilled', color);
|
|
52
|
-
var foreground = euiTheme.components.buttons[textColorTokenName];
|
|
53
|
+
var foreground = highContrastMode ? color === 'warning' ? euiTheme.colors.ink : euiTheme.colors.textInverse : euiTheme.components.buttons[textColorTokenName];
|
|
53
54
|
var background = euiTheme.components.buttons[backgroundTokenName];
|
|
54
55
|
return _objectSpread({
|
|
55
56
|
color: foreground,
|