@elastic/eui 106.4.0-amsterdam.0 → 106.5.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/avatar/avatar.js +2 -0
- package/es/components/badge/badge.js +5 -7
- package/es/components/basic_table/basic_table.js +6 -0
- package/es/components/basic_table/in_memory_table.js +6 -0
- package/es/components/color_picker/color_picker_swatch.js +4 -0
- package/es/components/datagrid/data_grid.styles.js +1 -1
- package/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -4
- package/es/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -1
- package/es/components/modal/modal.js +16 -5
- package/es/components/provider/provider.js +2 -2
- package/es/components/table/table_header_cell.js +4 -0
- package/es/components/tool_tip/icon_tip.js +4 -0
- package/es/components/tool_tip/tool_tip.js +8 -2
- package/es/services/color/contrast.js +11 -0
- package/es/services/color/vis_color_store.js +1 -1
- package/es/services/theme/context.js +2 -2
- package/eui.d.ts +477 -469
- package/i18ntokens.json +2305 -2287
- package/lib/components/avatar/avatar.js +2 -0
- package/lib/components/badge/badge.js +3 -5
- package/lib/components/basic_table/basic_table.js +6 -0
- package/lib/components/basic_table/in_memory_table.js +6 -0
- package/lib/components/color_picker/color_picker_swatch.js +4 -0
- package/lib/components/datagrid/data_grid.styles.js +1 -1
- package/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -4
- package/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -1
- package/lib/components/modal/modal.js +15 -4
- package/lib/components/provider/provider.js +2 -2
- package/lib/components/table/table_header_cell.js +4 -0
- package/lib/components/tool_tip/icon_tip.js +4 -0
- package/lib/components/tool_tip/tool_tip.js +9 -3
- package/lib/services/color/contrast.js +12 -1
- package/lib/services/color/vis_color_store.js +2 -2
- package/lib/services/theme/context.js +2 -2
- package/optimize/es/components/avatar/avatar.js +2 -0
- package/optimize/es/components/badge/badge.js +5 -7
- package/optimize/es/components/datagrid/data_grid.styles.js +1 -1
- package/optimize/es/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -4
- package/optimize/es/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -1
- package/optimize/es/components/modal/modal.js +16 -5
- package/optimize/es/components/provider/provider.js +2 -2
- package/optimize/es/components/tool_tip/tool_tip.js +4 -2
- package/optimize/es/services/color/contrast.js +11 -0
- package/optimize/es/services/color/vis_color_store.js +1 -1
- package/optimize/es/services/theme/context.js +2 -2
- package/optimize/lib/components/avatar/avatar.js +2 -0
- package/optimize/lib/components/badge/badge.js +3 -5
- package/optimize/lib/components/datagrid/data_grid.styles.js +1 -1
- package/optimize/lib/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -4
- package/optimize/lib/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -1
- package/optimize/lib/components/modal/modal.js +15 -4
- package/optimize/lib/components/provider/provider.js +2 -2
- package/optimize/lib/components/tool_tip/tool_tip.js +5 -3
- package/optimize/lib/services/color/contrast.js +12 -1
- package/optimize/lib/services/color/vis_color_store.js +2 -2
- package/optimize/lib/services/theme/context.js +2 -2
- package/package.json +1 -1
- package/test-env/components/avatar/avatar.js +2 -0
- package/test-env/components/badge/badge.js +3 -5
- package/test-env/components/basic_table/basic_table.js +6 -0
- package/test-env/components/basic_table/in_memory_table.js +6 -0
- package/test-env/components/color_picker/color_picker_swatch.js +4 -0
- package/test-env/components/datagrid/data_grid.styles.js +1 -1
- package/test-env/components/date_picker/super_date_picker/quick_select_popover/quick_select.js +4 -4
- package/test-env/components/date_picker/super_date_picker/super_date_picker.styles.js +1 -1
- package/test-env/components/modal/modal.js +15 -4
- package/test-env/components/provider/provider.js +2 -2
- package/test-env/components/table/table_header_cell.js +4 -0
- package/test-env/components/tool_tip/icon_tip.js +4 -0
- package/test-env/components/tool_tip/tool_tip.js +9 -3
- package/test-env/services/color/contrast.js +12 -1
- package/test-env/services/color/vis_color_store.js +2 -2
- package/test-env/services/theme/context.js +2 -2
|
@@ -26,6 +26,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
26
26
|
import React, { useMemo } from 'react';
|
|
27
27
|
import PropTypes from "prop-types";
|
|
28
28
|
import classNames from 'classnames';
|
|
29
|
+
import { warnIfContrastBelowMin, wcagContrastMin } from '../../services/color/contrast';
|
|
29
30
|
import { isColorDark, hexToRgb, isValidHex, useEuiPaletteColorBlindBehindText } from '../../services/color';
|
|
30
31
|
import { toInitials, useEuiMemoizedStyles, useEuiTheme } from '../../services';
|
|
31
32
|
import { EuiIcon } from '../icon';
|
|
@@ -83,6 +84,7 @@ export var EuiAvatar = function EuiAvatar(_ref) {
|
|
|
83
84
|
checkValidColor(color);
|
|
84
85
|
var assignedColor = color || visColors[Math.floor(name.length % visColors.length)];
|
|
85
86
|
var textColor = isColorDark.apply(void 0, _toConsumableArray(hexToRgb(assignedColor))) ? '#FFFFFF' : '#000000';
|
|
87
|
+
warnIfContrastBelowMin(textColor, assignedColor, wcagContrastMin);
|
|
86
88
|
return {
|
|
87
89
|
backgroundColor: assignedColor,
|
|
88
90
|
color: textColor
|
|
@@ -25,11 +25,12 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
25
25
|
import React, { useMemo } from 'react';
|
|
26
26
|
import PropTypes from "prop-types";
|
|
27
27
|
import classNames from 'classnames';
|
|
28
|
-
import { useEuiTheme, useEuiMemoizedStyles, getSecureRelForTarget
|
|
28
|
+
import { useEuiTheme, useEuiMemoizedStyles, getSecureRelForTarget } from '../../services';
|
|
29
29
|
import { validateHref } from '../../services/security/href_validator';
|
|
30
30
|
import { EuiInnerText } from '../inner_text';
|
|
31
31
|
import { EuiIcon } from '../icon';
|
|
32
|
-
import { getTextColor,
|
|
32
|
+
import { getTextColor, getIsValidColor } from './color_utils';
|
|
33
|
+
import { warnIfContrastBelowMin, wcagContrastMin } from '../../services/color/contrast';
|
|
33
34
|
import { euiBadgeStyles } from './badge.styles';
|
|
34
35
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
35
36
|
export var ICON_SIDES = ['left', 'right'];
|
|
@@ -68,11 +69,8 @@ export var EuiBadge = function EuiBadge(_ref) {
|
|
|
68
69
|
// Set dark or light text color based upon best contrast
|
|
69
70
|
var textColor = getTextColor(euiTheme, color);
|
|
70
71
|
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
if (contrastRatio < wcagContrastMin) {
|
|
74
|
-
console.warn("Warning: ".concat(color, " badge has a low contrast of ").concat(contrastRatio.toFixed(2), ". Should be above ").concat(wcagContrastMin, "."));
|
|
75
|
-
}
|
|
72
|
+
// Emit a warning if contrast is below WCAG threshold (centralized util)
|
|
73
|
+
warnIfContrastBelowMin(textColor, color, wcagContrastMin);
|
|
76
74
|
return _objectSpread({
|
|
77
75
|
'--euiBadgeBackgroundColor': color,
|
|
78
76
|
'--euiBadgeTextColor': textColor
|
|
@@ -1135,6 +1135,10 @@ EuiBasicTable.propTypes = {
|
|
|
1135
1135
|
* hidden.
|
|
1136
1136
|
*/
|
|
1137
1137
|
onMouseOut: PropTypes.func,
|
|
1138
|
+
/**
|
|
1139
|
+
* Offset in pixels from the anchor. Defaults to 16.
|
|
1140
|
+
*/
|
|
1141
|
+
offset: PropTypes.number,
|
|
1138
1142
|
"aria-label": PropTypes.string,
|
|
1139
1143
|
"data-test-subj": PropTypes.string,
|
|
1140
1144
|
css: PropTypes.any,
|
|
@@ -1250,6 +1254,7 @@ EuiBasicTable.propTypes = {
|
|
|
1250
1254
|
repositionOnScroll: PropTypes.bool,
|
|
1251
1255
|
disableScreenReaderOutput: PropTypes.bool,
|
|
1252
1256
|
onMouseOut: PropTypes.func,
|
|
1257
|
+
offset: PropTypes.number,
|
|
1253
1258
|
"aria-label": PropTypes.string,
|
|
1254
1259
|
"data-test-subj": PropTypes.string,
|
|
1255
1260
|
css: PropTypes.any,
|
|
@@ -1391,6 +1396,7 @@ EuiBasicTable.propTypes = {
|
|
|
1391
1396
|
repositionOnScroll: PropTypes.bool,
|
|
1392
1397
|
disableScreenReaderOutput: PropTypes.bool,
|
|
1393
1398
|
onMouseOut: PropTypes.func,
|
|
1399
|
+
offset: PropTypes.number,
|
|
1394
1400
|
"aria-label": PropTypes.string,
|
|
1395
1401
|
"data-test-subj": PropTypes.string,
|
|
1396
1402
|
css: PropTypes.any,
|
|
@@ -630,6 +630,10 @@ EuiInMemoryTable.propTypes = {
|
|
|
630
630
|
* hidden.
|
|
631
631
|
*/
|
|
632
632
|
onMouseOut: PropTypes.func,
|
|
633
|
+
/**
|
|
634
|
+
* Offset in pixels from the anchor. Defaults to 16.
|
|
635
|
+
*/
|
|
636
|
+
offset: PropTypes.number,
|
|
633
637
|
"aria-label": PropTypes.string,
|
|
634
638
|
"data-test-subj": PropTypes.string,
|
|
635
639
|
css: PropTypes.any,
|
|
@@ -745,6 +749,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
745
749
|
repositionOnScroll: PropTypes.bool,
|
|
746
750
|
disableScreenReaderOutput: PropTypes.bool,
|
|
747
751
|
onMouseOut: PropTypes.func,
|
|
752
|
+
offset: PropTypes.number,
|
|
748
753
|
"aria-label": PropTypes.string,
|
|
749
754
|
"data-test-subj": PropTypes.string,
|
|
750
755
|
css: PropTypes.any,
|
|
@@ -886,6 +891,7 @@ EuiInMemoryTable.propTypes = {
|
|
|
886
891
|
repositionOnScroll: PropTypes.bool,
|
|
887
892
|
disableScreenReaderOutput: PropTypes.bool,
|
|
888
893
|
onMouseOut: PropTypes.func,
|
|
894
|
+
offset: PropTypes.number,
|
|
889
895
|
"aria-label": PropTypes.string,
|
|
890
896
|
"data-test-subj": PropTypes.string,
|
|
891
897
|
css: PropTypes.any,
|
|
@@ -133,6 +133,10 @@ EuiColorPickerSwatch.propTypes = {
|
|
|
133
133
|
* hidden.
|
|
134
134
|
*/
|
|
135
135
|
onMouseOut: PropTypes.func,
|
|
136
|
+
/**
|
|
137
|
+
* Offset in pixels from the anchor. Defaults to 16.
|
|
138
|
+
*/
|
|
139
|
+
offset: PropTypes.number,
|
|
136
140
|
"aria-label": PropTypes.string,
|
|
137
141
|
"data-test-subj": PropTypes.string,
|
|
138
142
|
css: PropTypes.any,
|
|
@@ -52,7 +52,7 @@ export var euiDataGridStyles = function euiDataGridStyles(euiThemeContext) {
|
|
|
52
52
|
};
|
|
53
53
|
var border = "".concat(euiTheme.border.width.thin, " solid ").concat(borderColors.default);
|
|
54
54
|
return {
|
|
55
|
-
euiDataGrid: /*#__PURE__*/css("display:flex;flex-direction:column;align-items:stretch;", logicalCSS('height', '100%'), " overflow:hidden;*:where(& .euiDataGridRow){background-color:", euiTheme.components.dataGridRowBackground, ";}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow:hover){background-color:", euiTheme.components.dataGridRowBackgroundHover, ";}*:where(
|
|
55
|
+
euiDataGrid: /*#__PURE__*/css("display:flex;flex-direction:column;align-items:stretch;", logicalCSS('height', '100%'), " overflow:hidden;*:where(& .euiDataGridRow){background-color:", euiTheme.components.dataGridRowBackground, ";}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow:hover){background-color:", euiTheme.components.dataGridRowBackgroundHover, ";}*:where(& .euiDataGridRow--selected){background-color:", euiTheme.components.dataGridRowBackgroundSelect, ";}*:where(& .euiDataGridRow--marked){background-color:", euiTheme.components.dataGridRowBackgroundMarked, ";.euiDataGridRowCell.euiDataGridRowCell{", outlineSelectors.marked, "{", euiDataGridCellOutlineStyles(euiThemeContext).markedStyles, ";}}}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow--marked){&:hover{background-color:", euiTheme.components.dataGridRowBackgroundMarkedHover, ";}}*:where(\n &.euiDataGrid--rowHoverHighlight .euiDataGridRow--selected:hover\n ){background-color:", euiTheme.components.dataGridRowBackgroundSelectHover, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow){background-color:", euiTheme.components.dataGridRowStripesBackground, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow--striped){background-color:", euiTheme.components.dataGridRowStripesBackgroundStriped, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundHover, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow--striped:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundStripedHover, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow--selected){background-color:", euiTheme.components.dataGridRowStripesBackgroundSelect, ";}*:where(&.euiDataGrid--stripes .euiDataGridRow--marked){background-color:", euiTheme.components.dataGridRowBackgroundMarked, ";}*:where(\n &.euiDataGrid--stripes.euiDataGrid--rowHoverHighlight\n .euiDataGridRow--selected:hover\n ){background-color:", euiTheme.components.dataGridRowStripesBackgroundSelectHover, ";}*:where(&.euiDataGrid--rowHoverHighlight .euiDataGridRow)::before{content:'';position:absolute;z-index:-1;pointer-events:none;inset:0;background-color:", euiTheme.components.dataGridRowBackground, ";};label:euiDataGrid;"),
|
|
56
56
|
cellPadding: {
|
|
57
57
|
cellPadding: function cellPadding(size) {
|
|
58
58
|
return /*#__PURE__*/css(".euiDataGridHeaderCell,.euiDataGridRowCell__content{padding:", _cellPadding[size], ";}.euiDataGridRowCell__content--lineCountHeight,.euiDataGridRowCell__content--autoBelowLineCountHeight{", highContrastModeStyles(euiThemeContext, {
|
|
@@ -119,8 +119,8 @@ export var EuiQuickSelect = /*#__PURE__*/function (_Component) {
|
|
|
119
119
|
max = _this$getBounds.max;
|
|
120
120
|
var diff = max.diff(min);
|
|
121
121
|
_this.props.applyTime({
|
|
122
|
-
start: moment(max).
|
|
123
|
-
end: moment(max).add(diff
|
|
122
|
+
start: moment(max).toISOString(),
|
|
123
|
+
end: moment(max).add(diff, 'ms').toISOString(),
|
|
124
124
|
keepPopoverOpen: true
|
|
125
125
|
});
|
|
126
126
|
});
|
|
@@ -130,8 +130,8 @@ export var EuiQuickSelect = /*#__PURE__*/function (_Component) {
|
|
|
130
130
|
max = _this$getBounds2.max;
|
|
131
131
|
var diff = max.diff(min);
|
|
132
132
|
_this.props.applyTime({
|
|
133
|
-
start: moment(min).subtract(diff
|
|
134
|
-
end: moment(min).
|
|
133
|
+
start: moment(min).subtract(diff, 'ms').toISOString(),
|
|
134
|
+
end: moment(min).toISOString(),
|
|
135
135
|
keepPopoverOpen: true
|
|
136
136
|
});
|
|
137
137
|
});
|
|
@@ -75,7 +75,7 @@ export var euiSuperDatePickerStyles = function euiSuperDatePickerStyles(euiTheme
|
|
|
75
75
|
full: "\n label: isAutoRefreshOnly;\n display: block;\n "
|
|
76
76
|
},
|
|
77
77
|
// isQuickSelectOnly forces `width` to be `auto`
|
|
78
|
-
isQuickSelectOnly: /*#__PURE__*/css(logicalCSS('min-width', 0), ".euiFormControlLayout__prepend{", logicalCSS('max-width', 'none'), ";};label:isQuickSelectOnly;"),
|
|
78
|
+
isQuickSelectOnly: /*#__PURE__*/css(logicalCSS('min-width', 0), ".euiFormControlLayout__prepend{", logicalCSS('max-width', 'none'), ";}.euiFormControlLayoutDelimited__delimiter:first-child{", logicalCSS('padding-horizontal', 0), ";};label:isQuickSelectOnly;"),
|
|
79
79
|
euiSuperDatePicker__range: _ref,
|
|
80
80
|
euiSuperDatePicker__rangeInput: /*#__PURE__*/css("flex-grow:1;", logicalCSS('width', 'auto'), " overflow:hidden;;label:euiSuperDatePicker__rangeInput;"),
|
|
81
81
|
euiSuperDatePicker__prettyFormat: /*#__PURE__*/css(_buttonStyles(euiThemeContext), " text-align:start;", isRefreshVariant && prettyFormatStyles, ";;label:euiSuperDatePicker__prettyFormat;"),
|
|
@@ -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", "children", "initialFocus", "onClose", "maxWidth", "role", "style", "focusTrapProps"];
|
|
2
|
+
var _excluded = ["className", "children", "initialFocus", "onClose", "maxWidth", "role", "style", "focusTrapProps", "aria-describedby"];
|
|
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; }
|
|
@@ -19,13 +19,14 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
19
19
|
import React from 'react';
|
|
20
20
|
import PropTypes from "prop-types";
|
|
21
21
|
import classnames from 'classnames';
|
|
22
|
-
import { keys, useEuiTheme } from '../../services';
|
|
22
|
+
import { keys, useEuiTheme, useGeneratedHtmlId } from '../../services';
|
|
23
23
|
import { isDOMNode } from '../../utils';
|
|
24
24
|
import { EuiButtonIcon } from '../button';
|
|
25
25
|
import { EuiFocusTrap } from '../focus_trap';
|
|
26
26
|
import { EuiOverlayMask } from '../overlay_mask';
|
|
27
27
|
import { EuiI18n } from '../i18n';
|
|
28
28
|
import { euiModalStyles } from './modal.styles';
|
|
29
|
+
import { EuiScreenReaderOnly } from '../accessibility';
|
|
29
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
30
31
|
export var EuiModal = function EuiModal(_ref) {
|
|
31
32
|
var className = _ref.className,
|
|
@@ -38,6 +39,7 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
38
39
|
role = _ref$role === void 0 ? 'dialog' : _ref$role,
|
|
39
40
|
style = _ref.style,
|
|
40
41
|
focusTrapProps = _ref.focusTrapProps,
|
|
42
|
+
_ariaDescribedBy = _ref['aria-describedby'],
|
|
41
43
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
44
|
var onKeyDown = function onKeyDown(event) {
|
|
43
45
|
if (event.key === keys.ESCAPE) {
|
|
@@ -59,6 +61,14 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
59
61
|
var styles = euiModalStyles(euiTheme);
|
|
60
62
|
var cssStyles = [styles.euiModal, maxWidth === true && styles.defaultMaxWidth];
|
|
61
63
|
var cssCloseIconStyles = [styles.euiModal__closeIcon];
|
|
64
|
+
var descriptionId = useGeneratedHtmlId();
|
|
65
|
+
var ariaDescribedBy = classnames(descriptionId, _ariaDescribedBy);
|
|
66
|
+
var screenReaderDescription = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
67
|
+
id: descriptionId
|
|
68
|
+
}, ___EmotionJSX(EuiI18n, {
|
|
69
|
+
token: "euiModal.screenReaderModalDialog",
|
|
70
|
+
default: "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close."
|
|
71
|
+
})));
|
|
62
72
|
return ___EmotionJSX(EuiOverlayMask, null, ___EmotionJSX(EuiFocusTrap, _extends({}, focusTrapProps, {
|
|
63
73
|
initialFocus: initialFocus,
|
|
64
74
|
scrollLock: true,
|
|
@@ -70,8 +80,9 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
70
80
|
tabIndex: 0,
|
|
71
81
|
style: newStyle,
|
|
72
82
|
role: role,
|
|
73
|
-
"aria-modal": true
|
|
74
|
-
|
|
83
|
+
"aria-modal": true,
|
|
84
|
+
"aria-describedby": ariaDescribedBy
|
|
85
|
+
}, rest), children, screenReaderDescription, ___EmotionJSX(EuiI18n, {
|
|
75
86
|
token: "euiModal.closeModal",
|
|
76
87
|
default: "Closes this modal window"
|
|
77
88
|
}, function (closeModal) {
|
|
@@ -83,7 +94,7 @@ export var EuiModal = function EuiModal(_ref) {
|
|
|
83
94
|
color: "text",
|
|
84
95
|
"aria-label": closeModal
|
|
85
96
|
});
|
|
86
|
-
})
|
|
97
|
+
}))));
|
|
87
98
|
};
|
|
88
99
|
EuiModal.propTypes = {
|
|
89
100
|
className: PropTypes.string,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { EuiThemeBorealis } from '@elastic/eui-theme-borealis';
|
|
11
11
|
import { EuiThemeProvider } from '../../services';
|
|
12
12
|
import { emitEuiProviderWarning } from '../../services/theme/warning';
|
|
13
13
|
import { cache as fallbackCache } from '../../services/emotion/css';
|
|
@@ -26,7 +26,7 @@ export var EuiProvider = function EuiProvider(_ref) {
|
|
|
26
26
|
var _ref$cache = _ref.cache,
|
|
27
27
|
cache = _ref$cache === void 0 ? fallbackCache : _ref$cache,
|
|
28
28
|
_ref$theme = _ref.theme,
|
|
29
|
-
theme = _ref$theme === void 0 ?
|
|
29
|
+
theme = _ref$theme === void 0 ? EuiThemeBorealis : _ref$theme,
|
|
30
30
|
_ref$globalStyles = _ref.globalStyles,
|
|
31
31
|
Globals = _ref$globalStyles === void 0 ? EuiGlobalStyles : _ref$globalStyles,
|
|
32
32
|
_ref$utilityClasses = _ref.utilityClasses,
|
|
@@ -225,6 +225,10 @@ EuiTableHeaderCell.propTypes = {
|
|
|
225
225
|
* hidden.
|
|
226
226
|
*/
|
|
227
227
|
onMouseOut: PropTypes.func,
|
|
228
|
+
/**
|
|
229
|
+
* Offset in pixels from the anchor. Defaults to 16.
|
|
230
|
+
*/
|
|
231
|
+
offset: PropTypes.number,
|
|
228
232
|
"aria-label": PropTypes.string,
|
|
229
233
|
"data-test-subj": PropTypes.string,
|
|
230
234
|
css: PropTypes.any,
|
|
@@ -38,6 +38,7 @@ import { toolTipManager } from './tool_tip_manager';
|
|
|
38
38
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
39
39
|
export var POSITIONS = ['top', 'right', 'bottom', 'left'];
|
|
40
40
|
var DISPLAYS = ['inlineBlock', 'block'];
|
|
41
|
+
export var DEFAULT_TOOLTIP_OFFSET = 16;
|
|
41
42
|
var delayToMsMap = {
|
|
42
43
|
regular: 250,
|
|
43
44
|
long: 250 * 5
|
|
@@ -112,7 +113,9 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
_defineProperty(_this, "positionToolTip", function () {
|
|
116
|
+
var _this$props$offset;
|
|
115
117
|
var requestedPosition = _this.props.position;
|
|
118
|
+
var offset = (_this$props$offset = _this.props.offset) !== null && _this$props$offset !== void 0 ? _this$props$offset : DEFAULT_TOOLTIP_OFFSET;
|
|
116
119
|
if (!_this.anchor || !_this.popover) {
|
|
117
120
|
return;
|
|
118
121
|
}
|
|
@@ -120,8 +123,7 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
|
|
|
120
123
|
anchor: _this.anchor,
|
|
121
124
|
popover: _this.popover,
|
|
122
125
|
position: requestedPosition,
|
|
123
|
-
offset:
|
|
124
|
-
// offset popover 16px from the anchor
|
|
126
|
+
offset: offset,
|
|
125
127
|
arrowConfig: {
|
|
126
128
|
arrowWidth: 12,
|
|
127
129
|
arrowBuffer: 4
|
|
@@ -368,6 +370,10 @@ EuiToolTip.propTypes = {
|
|
|
368
370
|
* hidden.
|
|
369
371
|
*/
|
|
370
372
|
onMouseOut: PropTypes.func,
|
|
373
|
+
/**
|
|
374
|
+
* Offset in pixels from the anchor. Defaults to 16.
|
|
375
|
+
*/
|
|
376
|
+
offset: PropTypes.number,
|
|
371
377
|
"aria-label": PropTypes.string,
|
|
372
378
|
"data-test-subj": PropTypes.string,
|
|
373
379
|
css: PropTypes.any
|
|
@@ -10,6 +10,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10
10
|
import chroma from 'chroma-js';
|
|
11
11
|
import { shade, tint, lightness as getLightness } from './manipulation';
|
|
12
12
|
import { getOn } from '../theme/utils';
|
|
13
|
+
export var getColorContrast = function getColorContrast(textColor, backgroundColor) {
|
|
14
|
+
return chroma.contrast(textColor, backgroundColor);
|
|
15
|
+
};
|
|
13
16
|
export var wcagContrastMin = 4.5; // WCAG AA minimum contrast ratio for normal (non-large) text
|
|
14
17
|
|
|
15
18
|
/**
|
|
@@ -68,4 +71,12 @@ export var makeDisabledContrastColor = function makeDisabledContrastColor(color)
|
|
|
68
71
|
return function (themeOrBackground) {
|
|
69
72
|
return makeHighContrastColor(color, ratio)(themeOrBackground);
|
|
70
73
|
};
|
|
74
|
+
};
|
|
75
|
+
export var warnIfContrastBelowMin = function warnIfContrastBelowMin(textColor, backgroundColor) {
|
|
76
|
+
var min = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : wcagContrastMin;
|
|
77
|
+
var ratio = getColorContrast(textColor, backgroundColor);
|
|
78
|
+
if (ratio < min) {
|
|
79
|
+
// eslint-disable-next-line no-console
|
|
80
|
+
console.warn("Warning: ".concat(backgroundColor, " background with ").concat(textColor, " text has a low contrast of ").concat(ratio.toFixed(2), ". Should be above ").concat(min, "."));
|
|
81
|
+
}
|
|
71
82
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { EuiVisColorStore } from '@elastic/eui-theme-common';
|
|
10
|
-
import {
|
|
10
|
+
import { colorVis } from '@elastic/eui-theme-borealis';
|
|
11
11
|
|
|
12
12
|
// initialsetup of Vis color storage with default colors
|
|
13
13
|
export var EUI_VIS_COLOR_STORE = EuiVisColorStore.getInstance(colorVis, false);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { createContext } from 'react';
|
|
10
|
-
import {
|
|
10
|
+
import { EuiThemeBorealis } from '@elastic/eui-theme-borealis';
|
|
11
11
|
import { DEFAULT_COLOR_MODE, getComputed } from './utils';
|
|
12
12
|
export var DEFAULTS = {
|
|
13
|
-
system:
|
|
13
|
+
system: EuiThemeBorealis,
|
|
14
14
|
modifications: {},
|
|
15
15
|
colorMode: DEFAULT_COLOR_MODE,
|
|
16
16
|
highContrastMode: false
|