@elastic/eui 94.3.0 → 94.4.1
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/README.md +3 -0
- package/dist/eui_charts_theme.js +1519 -1519
- package/dist/eui_charts_theme.js.map +1 -1
- package/dist/eui_theme_dark.css +41 -497
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +41 -497
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/es/components/form/form.styles.js +26 -3
- package/es/components/markdown_editor/markdown_editor.js +12 -8
- package/es/components/markdown_editor/markdown_editor.styles.js +29 -0
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +22 -9
- package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +33 -0
- package/es/components/markdown_editor/markdown_editor_footer.js +11 -2
- package/es/components/markdown_editor/markdown_editor_footer.styles.js +26 -0
- package/es/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/es/components/markdown_editor/markdown_editor_text_area.styles.js +22 -0
- package/es/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/es/components/markdown_editor/markdown_editor_toolbar.styles.js +21 -0
- package/es/components/markdown_editor/markdown_format.js +9 -6
- package/es/components/markdown_editor/markdown_format.styles.js +25 -10
- package/es/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -3
- package/es/components/markdown_editor/plugins/markdown_tooltip/renderer.js +13 -2
- package/es/components/selectable/selectable.js +10 -2
- package/es/components/selectable/selectable_list/selectable_list.js +95 -42
- package/es/components/selectable/selectable_list/selectable_list_item.js +234 -204
- package/es/components/selectable/selectable_option.js +9 -1
- package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
- package/es/components/text/text_color.js +4 -1
- package/es/components/toast/global_toast_list_item.js +5 -5
- package/eui.d.ts +332 -234
- package/i18ntokens.json +124 -106
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/lib/components/form/form.styles.js +30 -4
- package/lib/components/markdown_editor/markdown_editor.js +12 -8
- package/lib/components/markdown_editor/markdown_editor.styles.js +37 -0
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +20 -8
- package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
- package/lib/components/markdown_editor/markdown_editor_footer.js +10 -1
- package/lib/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
- package/lib/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/lib/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/lib/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
- package/lib/components/markdown_editor/markdown_format.js +8 -5
- package/lib/components/markdown_editor/markdown_format.styles.js +25 -10
- package/lib/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
- package/lib/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
- package/lib/components/selectable/selectable.js +10 -2
- package/lib/components/selectable/selectable_list/selectable_list.js +95 -42
- package/lib/components/selectable/selectable_list/selectable_list_item.js +241 -210
- package/lib/components/selectable/selectable_option.js +12 -1
- package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
- package/lib/components/text/text_color.js +6 -2
- package/lib/components/toast/global_toast_list_item.js +5 -5
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/optimize/es/components/form/form.styles.js +26 -3
- package/optimize/es/components/markdown_editor/markdown_editor.js +12 -8
- package/optimize/es/components/markdown_editor/markdown_editor.styles.js +29 -0
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.js +19 -9
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +33 -0
- package/optimize/es/components/markdown_editor/markdown_editor_footer.js +11 -2
- package/optimize/es/components/markdown_editor/markdown_editor_footer.styles.js +26 -0
- package/optimize/es/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/optimize/es/components/markdown_editor/markdown_editor_text_area.styles.js +22 -0
- package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/optimize/es/components/markdown_editor/markdown_editor_toolbar.styles.js +21 -0
- package/optimize/es/components/markdown_editor/markdown_format.js +9 -6
- package/optimize/es/components/markdown_editor/markdown_format.styles.js +25 -10
- package/optimize/es/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -3
- package/optimize/es/components/markdown_editor/plugins/markdown_tooltip/renderer.js +13 -2
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +81 -38
- package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +217 -198
- package/optimize/es/components/selectable/selectable_option.js +9 -1
- package/optimize/es/components/text/text_color.js +4 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/optimize/lib/components/form/form.styles.js +30 -4
- package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -8
- package/optimize/lib/components/markdown_editor/markdown_editor.styles.js +37 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.js +24 -16
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +10 -1
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/optimize/lib/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
- package/optimize/lib/components/markdown_editor/markdown_format.js +8 -5
- package/optimize/lib/components/markdown_editor/markdown_format.styles.js +25 -10
- package/optimize/lib/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
- package/optimize/lib/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +81 -38
- package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +224 -204
- package/optimize/lib/components/selectable/selectable_option.js +12 -1
- package/optimize/lib/components/text/text_color.js +6 -2
- package/package.json +5 -12
- package/src/components/date_picker/react-datepicker/LICENSE +21 -0
- package/src/components/date_picker/react-datepicker/README.md +168 -0
- package/src/components/date_picker/super_date_picker/date_popover/_absolute_tab.scss +13 -18
- package/src/components/form/checkbox/_checkbox.scss +23 -6
- package/src/components/index.scss +0 -1
- package/src/components/selectable/selectable_list/_selectable_list_item.scss +4 -0
- package/src/components/selectable/selectable_templates/_selectable_template_sitewide_option.scss +5 -1
- package/src/services/theme/README.md +153 -0
- package/src/test/README.md +44 -0
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
- package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
- package/test-env/components/form/form.styles.js +30 -4
- package/test-env/components/markdown_editor/markdown_editor.js +12 -8
- package/test-env/components/markdown_editor/markdown_editor.styles.js +37 -0
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +24 -16
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
- package/test-env/components/markdown_editor/markdown_editor_footer.js +10 -1
- package/test-env/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
- package/test-env/components/markdown_editor/markdown_editor_text_area.js +6 -1
- package/test-env/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +10 -2
- package/test-env/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
- package/test-env/components/markdown_editor/markdown_format.js +8 -5
- package/test-env/components/markdown_editor/markdown_format.styles.js +25 -10
- package/test-env/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
- package/test-env/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
- package/test-env/components/selectable/selectable.js +10 -2
- package/test-env/components/selectable/selectable_list/selectable_list.js +95 -42
- package/test-env/components/selectable/selectable_list/selectable_list_item.js +233 -205
- package/test-env/components/selectable/selectable_option.js +12 -1
- package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
- package/test-env/components/text/text_color.js +6 -2
- package/test-env/components/toast/global_toast_list_item.js +5 -5
- package/src/components/markdown_editor/_index.scss +0 -9
- package/src/components/markdown_editor/_markdown_editor.scss +0 -22
- package/src/components/markdown_editor/_markdown_editor_drop_zone.scss +0 -58
- package/src/components/markdown_editor/_markdown_editor_footer.scss +0 -42
- package/src/components/markdown_editor/_markdown_editor_preview.scss +0 -20
- package/src/components/markdown_editor/_markdown_editor_text_area.scss +0 -43
- package/src/components/markdown_editor/_markdown_editor_toolbar.scss +0 -29
- package/src/components/markdown_editor/_markdown_format.scss +0 -78
- package/src/components/markdown_editor/_variables.scss +0 -1
- package/src/components/markdown_editor/plugins/markdown_tooltip.scss +0 -4
- package/src/themes/amsterdam/overrides/_markdown_editor.scss +0 -18
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -12,35 +13,32 @@ var _i18n = require("../../i18n");
|
|
|
12
13
|
var _icon = require("../../icon");
|
|
13
14
|
var _accessibility = require("../../accessibility");
|
|
14
15
|
var _badge = require("../../badge");
|
|
16
|
+
var _tool_tip = require("../../tool_tip");
|
|
15
17
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["children", "className", "disabled", "checked", "isFocused", "showIcons", "prepend", "append", "allowExclusions", "onFocusBadge", "paddingSize", "role", "searchable", "textWrap"],
|
|
18
|
+
var _excluded = ["children", "className", "disabled", "checked", "isFocused", "showIcons", "prepend", "append", "allowExclusions", "onFocusBadge", "paddingSize", "role", "searchable", "textWrap", "toolTipContent", "toolTipProps", "aria-describedby"],
|
|
17
19
|
_excluded2 = ["children", "className"];
|
|
20
|
+
/*
|
|
21
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
22
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
23
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
24
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
25
|
+
* Side Public License, v 1.
|
|
26
|
+
*/
|
|
18
27
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
function
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
34
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
35
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
36
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
26
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
27
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
28
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
29
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
32
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
34
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
37
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
36
38
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
37
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
41
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
42
|
-
* Side Public License, v 1.
|
|
43
|
-
*/
|
|
39
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
40
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
41
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
44
42
|
function resolveIconAndColor(checked) {
|
|
45
43
|
switch (checked) {
|
|
46
44
|
case 'on':
|
|
@@ -71,198 +69,223 @@ var paddingSizeToClassNameMap = {
|
|
|
71
69
|
};
|
|
72
70
|
var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
|
|
73
71
|
exports.PADDING_SIZES = PADDING_SIZES;
|
|
74
|
-
var EuiSelectableListItem =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
instructions = screenReaderStrings.unchecked.instructions;
|
|
197
|
-
break;
|
|
198
|
-
case 'mixed':
|
|
199
|
-
state = screenReaderStrings.mixed.state;
|
|
200
|
-
instructions = (0, _react2.jsx)(_react.default.Fragment, null, screenReaderStrings.mixed.instructions, ' ', allowExclusions ? screenReaderStrings.mixed.excludeInstructions : screenReaderStrings.mixed.uncheckInstructions);
|
|
201
|
-
break;
|
|
202
|
-
case undefined:
|
|
203
|
-
default:
|
|
204
|
-
instructions = allowExclusions || searchable ? screenReaderStrings.checked.instructions : undefined;
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
var prependNode;
|
|
208
|
-
if (prepend) {
|
|
209
|
-
prependNode = (0, _react2.jsx)("span", {
|
|
210
|
-
className: "euiSelectableListItem__prepend"
|
|
211
|
-
}, prepend);
|
|
72
|
+
var EuiSelectableListItem = function EuiSelectableListItem(_ref) {
|
|
73
|
+
var children = _ref.children,
|
|
74
|
+
className = _ref.className,
|
|
75
|
+
disabled = _ref.disabled,
|
|
76
|
+
checked = _ref.checked,
|
|
77
|
+
isFocused = _ref.isFocused,
|
|
78
|
+
_ref$showIcons = _ref.showIcons,
|
|
79
|
+
showIcons = _ref$showIcons === void 0 ? true : _ref$showIcons,
|
|
80
|
+
prepend = _ref.prepend,
|
|
81
|
+
append = _ref.append,
|
|
82
|
+
allowExclusions = _ref.allowExclusions,
|
|
83
|
+
_ref$onFocusBadge = _ref.onFocusBadge,
|
|
84
|
+
onFocusBadge = _ref$onFocusBadge === void 0 ? true : _ref$onFocusBadge,
|
|
85
|
+
_ref$paddingSize = _ref.paddingSize,
|
|
86
|
+
paddingSize = _ref$paddingSize === void 0 ? 's' : _ref$paddingSize,
|
|
87
|
+
_ref$role = _ref.role,
|
|
88
|
+
role = _ref$role === void 0 ? 'option' : _ref$role,
|
|
89
|
+
searchable = _ref.searchable,
|
|
90
|
+
_ref$textWrap = _ref.textWrap,
|
|
91
|
+
textWrap = _ref$textWrap === void 0 ? 'truncate' : _ref$textWrap,
|
|
92
|
+
toolTipContent = _ref.toolTipContent,
|
|
93
|
+
toolTipProps = _ref.toolTipProps,
|
|
94
|
+
_ariaDescribedBy = _ref['aria-describedby'],
|
|
95
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
96
|
+
var classes = (0, _classnames.default)('euiSelectableListItem', {
|
|
97
|
+
'euiSelectableListItem-isFocused': isFocused
|
|
98
|
+
}, paddingSizeToClassNameMap[paddingSize], className);
|
|
99
|
+
var textClasses = (0, _classnames.default)('euiSelectableListItem__text', _defineProperty({}, "euiSelectableListItem__text--".concat(textWrap), textWrap));
|
|
100
|
+
var optionIcon = (0, _react.useMemo)(function () {
|
|
101
|
+
if (showIcons) {
|
|
102
|
+
var _resolveIconAndColor = resolveIconAndColor(checked),
|
|
103
|
+
icon = _resolveIconAndColor.icon,
|
|
104
|
+
color = _resolveIconAndColor.color;
|
|
105
|
+
return (0, _react2.jsx)(_icon.EuiIcon, {
|
|
106
|
+
className: "euiSelectableListItem__icon",
|
|
107
|
+
color: color,
|
|
108
|
+
type: icon
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}, [showIcons, checked]);
|
|
112
|
+
var prependNode = (0, _react.useMemo)(function () {
|
|
113
|
+
if (prepend) {
|
|
114
|
+
return (0, _react2.jsx)("span", {
|
|
115
|
+
className: "euiSelectableListItem__prepend"
|
|
116
|
+
}, prepend);
|
|
117
|
+
}
|
|
118
|
+
}, [prepend]);
|
|
119
|
+
var onFocusBadgeNode = (0, _react.useMemo)(function () {
|
|
120
|
+
var defaultOnFocusBadgeProps = {
|
|
121
|
+
'aria-hidden': true,
|
|
122
|
+
iconType: 'returnKey',
|
|
123
|
+
iconSide: 'left',
|
|
124
|
+
color: 'hollow'
|
|
125
|
+
};
|
|
126
|
+
if (onFocusBadge === true) {
|
|
127
|
+
return (0, _react2.jsx)(_badge.EuiBadge, _extends({
|
|
128
|
+
className: "euiSelectableListItem__onFocusBadge"
|
|
129
|
+
}, defaultOnFocusBadgeProps));
|
|
130
|
+
} else if (typeof onFocusBadge !== 'boolean' && !!onFocusBadge) {
|
|
131
|
+
var _children = onFocusBadge.children,
|
|
132
|
+
_className = onFocusBadge.className,
|
|
133
|
+
restBadgeProps = _objectWithoutProperties(onFocusBadge, _excluded2);
|
|
134
|
+
return (0, _react2.jsx)(_badge.EuiBadge, _extends({
|
|
135
|
+
className: (0, _classnames.default)('euiSelectableListItem__onFocusBadge', _className)
|
|
136
|
+
}, defaultOnFocusBadgeProps, restBadgeProps), _children);
|
|
137
|
+
}
|
|
138
|
+
}, [onFocusBadge]);
|
|
139
|
+
var showOnFocusBadge = !!(isFocused && !disabled && onFocusBadgeNode);
|
|
140
|
+
var appendNode = (0, _react.useMemo)(function () {
|
|
141
|
+
if (append || showOnFocusBadge) {
|
|
142
|
+
return (0, _react2.jsx)("span", {
|
|
143
|
+
className: "euiSelectableListItem__append"
|
|
144
|
+
}, append, " ", showOnFocusBadge ? onFocusBadgeNode : null);
|
|
145
|
+
}
|
|
146
|
+
}, [append, showOnFocusBadge, onFocusBadgeNode]);
|
|
147
|
+
var screenReaderText = (0, _react.useMemo)(function () {
|
|
148
|
+
var state;
|
|
149
|
+
var instructions;
|
|
150
|
+
var screenReaderStrings = {
|
|
151
|
+
checked: {
|
|
152
|
+
state: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
153
|
+
token: "euiSelectableListItem.checkedOption",
|
|
154
|
+
default: "Checked option."
|
|
155
|
+
}),
|
|
156
|
+
instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
157
|
+
token: "euiSelectableListItem.checkOptionInstructions",
|
|
158
|
+
default: "To check this option, press Enter."
|
|
159
|
+
})
|
|
160
|
+
},
|
|
161
|
+
unchecked: {
|
|
162
|
+
instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
163
|
+
token: "euiSelectableListItem.uncheckOptionInstructions",
|
|
164
|
+
default: "To uncheck this option, press Enter."
|
|
165
|
+
})
|
|
166
|
+
},
|
|
167
|
+
excluded: {
|
|
168
|
+
state: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
169
|
+
token: "euiSelectableListItem.excludedOption",
|
|
170
|
+
default: "Excluded option."
|
|
171
|
+
}),
|
|
172
|
+
instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
173
|
+
token: "euiSelectableListItem.excludeOptionInstructions",
|
|
174
|
+
default: "To exclude this option, press Enter."
|
|
175
|
+
})
|
|
176
|
+
},
|
|
177
|
+
mixed: {
|
|
178
|
+
state: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
179
|
+
token: "euiSelectableListItem.mixedOption",
|
|
180
|
+
default: "Mixed (indeterminate) option."
|
|
181
|
+
}),
|
|
182
|
+
instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
183
|
+
token: "euiSelectableListItem.mixedOptionInstructions",
|
|
184
|
+
default: "To check this option for all, press Enter once."
|
|
185
|
+
}),
|
|
186
|
+
uncheckInstructions: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
187
|
+
token: "euiSelectableListItem.mixedOptionUncheckInstructions",
|
|
188
|
+
default: "To uncheck this option for all, press Enter twice."
|
|
189
|
+
}),
|
|
190
|
+
excludeInstructions: (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
191
|
+
token: "euiSelectableListItem.mixedOptionExcludeInstructions",
|
|
192
|
+
default: "To exclude this option for all, press Enter twice."
|
|
193
|
+
})
|
|
212
194
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
195
|
+
};
|
|
196
|
+
switch (checked) {
|
|
197
|
+
case 'on':
|
|
198
|
+
state = screenReaderStrings.checked.state;
|
|
199
|
+
instructions = allowExclusions ? screenReaderStrings.excluded.instructions : searchable ? screenReaderStrings.unchecked.instructions : undefined;
|
|
200
|
+
break;
|
|
201
|
+
case 'off':
|
|
202
|
+
state = screenReaderStrings.excluded.state;
|
|
203
|
+
instructions = screenReaderStrings.unchecked.instructions;
|
|
204
|
+
break;
|
|
205
|
+
case 'mixed':
|
|
206
|
+
state = screenReaderStrings.mixed.state;
|
|
207
|
+
instructions = (0, _react2.jsx)(_react.default.Fragment, null, screenReaderStrings.mixed.instructions, ' ', allowExclusions ? screenReaderStrings.mixed.excludeInstructions : screenReaderStrings.mixed.uncheckInstructions);
|
|
208
|
+
break;
|
|
209
|
+
case undefined:
|
|
210
|
+
default:
|
|
211
|
+
instructions = allowExclusions || searchable ? screenReaderStrings.checked.instructions : undefined;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
return state || instructions ? (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("div", null, state || instructions ? '. ' : null, state, state && instructions ? ' ' : null, instructions)) : null;
|
|
215
|
+
}, [checked, searchable, allowExclusions]);
|
|
234
216
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
217
|
+
// aria-checked is intended to be used with role="checkbox" but
|
|
218
|
+
// the MDN documentation lists it as a possibility for role="option".
|
|
219
|
+
// See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
|
|
220
|
+
// and https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/option_role
|
|
221
|
+
var ariaChecked = (0, _react.useMemo)(function () {
|
|
222
|
+
var rolesThatCanBeMixed = ['option', 'checkbox', 'menuitemcheckbox'];
|
|
223
|
+
var rolesThatCanBeChecked = [].concat(rolesThatCanBeMixed, ['radio', 'menuitemradio', 'switch']);
|
|
224
|
+
if (!rolesThatCanBeChecked.includes(role)) return undefined;
|
|
225
|
+
switch (checked) {
|
|
226
|
+
case 'on':
|
|
227
|
+
case 'off':
|
|
228
|
+
return true;
|
|
229
|
+
case 'mixed':
|
|
230
|
+
if (rolesThatCanBeMixed.includes(role)) {
|
|
231
|
+
return 'mixed';
|
|
232
|
+
} else {
|
|
233
|
+
return false;
|
|
240
234
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
235
|
+
default:
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
}, [role, checked]);
|
|
239
|
+
var hasToolTip = !!toolTipContent && !disabled;
|
|
240
|
+
var _useState = (0, _react.useState)(null),
|
|
241
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
242
|
+
tooltipRef = _useState2[0],
|
|
243
|
+
setTooltipRef = _useState2[1]; // Needs to be state and not a ref to trigger useEffect
|
|
244
|
+
var _useState3 = (0, _react.useState)(_ariaDescribedBy),
|
|
245
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
246
|
+
ariaDescribedBy = _useState4[0],
|
|
247
|
+
setAriaDescribedBy = _useState4[1];
|
|
248
|
+
|
|
249
|
+
// Manually trigger the tooltip on keyboard focus
|
|
250
|
+
(0, _react.useEffect)(function () {
|
|
251
|
+
if (!tooltipRef) return;
|
|
252
|
+
if (isFocused) {
|
|
253
|
+
tooltipRef.showToolTip();
|
|
254
|
+
} else {
|
|
255
|
+
tooltipRef.hideToolTip();
|
|
256
256
|
}
|
|
257
|
-
}]);
|
|
258
|
-
|
|
259
|
-
|
|
257
|
+
}, [isFocused, tooltipRef]);
|
|
258
|
+
|
|
259
|
+
// Manually set the `aria-describedby` id on the <li> wrapper
|
|
260
|
+
(0, _react.useEffect)(function () {
|
|
261
|
+
if (tooltipRef) {
|
|
262
|
+
var tooltipId = tooltipRef.state.id;
|
|
263
|
+
setAriaDescribedBy((0, _classnames.default)(tooltipId, _ariaDescribedBy));
|
|
264
|
+
}
|
|
265
|
+
}, [tooltipRef, _ariaDescribedBy]);
|
|
266
|
+
var content = (0, _react2.jsx)("span", {
|
|
267
|
+
className: "euiSelectableListItem__content"
|
|
268
|
+
}, optionIcon, prependNode, (0, _react2.jsx)("span", {
|
|
269
|
+
className: textClasses
|
|
270
|
+
}, children, screenReaderText), appendNode);
|
|
271
|
+
return (0, _react2.jsx)("li", _extends({
|
|
272
|
+
role: role,
|
|
273
|
+
"aria-disabled": disabled,
|
|
274
|
+
"aria-checked": ariaChecked // Whether the item is "checked"
|
|
275
|
+
,
|
|
276
|
+
"aria-selected": !disabled && isFocused // Whether the item has keyboard focus per W3 spec
|
|
277
|
+
,
|
|
278
|
+
className: classes
|
|
279
|
+
}, rest, {
|
|
280
|
+
"aria-describedby": ariaDescribedBy
|
|
281
|
+
}), hasToolTip ? (0, _react2.jsx)(_tool_tip.EuiToolTip, _extends({
|
|
282
|
+
ref: setTooltipRef,
|
|
283
|
+
content: toolTipContent,
|
|
284
|
+
anchorClassName: "euiSelectableListItem__tooltipAnchor",
|
|
285
|
+
position: "left"
|
|
286
|
+
}, toolTipProps), content) : content);
|
|
287
|
+
};
|
|
260
288
|
exports.EuiSelectableListItem = EuiSelectableListItem;
|
|
261
|
-
_defineProperty(EuiSelectableListItem, "defaultProps", {
|
|
262
|
-
showIcons: true,
|
|
263
|
-
onFocusBadge: true,
|
|
264
|
-
textWrap: 'truncate'
|
|
265
|
-
});
|
|
266
289
|
EuiSelectableListItem.propTypes = {
|
|
267
290
|
className: _propTypes.default.string,
|
|
268
291
|
"aria-label": _propTypes.default.string,
|
|
@@ -272,7 +295,7 @@ EuiSelectableListItem.propTypes = {
|
|
|
272
295
|
/**
|
|
273
296
|
* Applies an icon and visual styling to activated items
|
|
274
297
|
*/
|
|
275
|
-
checked: _propTypes.default.
|
|
298
|
+
checked: _propTypes.default.any,
|
|
276
299
|
/**
|
|
277
300
|
* Shows icons based on `checked` type
|
|
278
301
|
*/
|
|
@@ -355,5 +378,13 @@ EuiSelectableListItem.propTypes = {
|
|
|
355
378
|
* How to handle long text within the item.
|
|
356
379
|
* Wrapping only works if virtualization is off.
|
|
357
380
|
*/
|
|
358
|
-
textWrap: _propTypes.default.oneOf(["truncate", "wrap"])
|
|
381
|
+
textWrap: _propTypes.default.oneOf(["truncate", "wrap"]),
|
|
382
|
+
/**
|
|
383
|
+
* Optional custom tooltip content for the button
|
|
384
|
+
*/
|
|
385
|
+
toolTipContent: _propTypes.default.node,
|
|
386
|
+
/**
|
|
387
|
+
* Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
|
|
388
|
+
*/
|
|
389
|
+
toolTipProps: _propTypes.default.any
|
|
359
390
|
};
|
|
@@ -2,4 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.OPTION_CHECKED_STATES = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var OPTION_CHECKED_STATES = ['on', 'off', 'mixed', undefined];
|
|
16
|
+
exports.OPTION_CHECKED_STATES = OPTION_CHECKED_STATES;
|
|
@@ -384,7 +384,7 @@ EuiSelectableTemplateSitewide.propTypes = {
|
|
|
384
384
|
* 'on' to indicate inclusion, 'off' to indicate exclusion,
|
|
385
385
|
* or 'mixed' to indicate inclusion for some.
|
|
386
386
|
*/
|
|
387
|
-
checked: _propTypes.default.
|
|
387
|
+
checked: _propTypes.default.any,
|
|
388
388
|
disabled: _propTypes.default.bool,
|
|
389
389
|
/**
|
|
390
390
|
* Node to add between the selection icon and the label
|
|
@@ -414,7 +414,15 @@ EuiSelectableTemplateSitewide.propTypes = {
|
|
|
414
414
|
* Note: when searching, custom truncation props are ignored. The highlighted search
|
|
415
415
|
* text will always take precedence.
|
|
416
416
|
*/
|
|
417
|
-
truncationProps: _propTypes.default.any
|
|
417
|
+
truncationProps: _propTypes.default.any,
|
|
418
|
+
/**
|
|
419
|
+
* Optional custom tooltip content for the button
|
|
420
|
+
*/
|
|
421
|
+
toolTipContent: _propTypes.default.node,
|
|
422
|
+
/**
|
|
423
|
+
* Optional props to pass to the underlying **[EuiToolTip](/#/display/tooltip)**
|
|
424
|
+
*/
|
|
425
|
+
toolTipProps: _propTypes.default.any
|
|
418
426
|
}).isRequired).isRequired,
|
|
419
427
|
/**
|
|
420
428
|
* Override some of the EuiPopover props housing the list.
|
|
@@ -4,7 +4,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.EuiTextColor = exports.COLORS = void 0;
|
|
7
|
+
exports._isNamedColor = exports.EuiTextColor = exports.COLORS = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _services = require("../../services");
|
|
@@ -30,6 +30,10 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
30
30
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
31
|
var COLORS = ['default', 'subdued', 'success', 'accent', 'danger', 'warning', 'ghost', 'inherit'];
|
|
32
32
|
exports.COLORS = COLORS;
|
|
33
|
+
var _isNamedColor = function _isNamedColor(color) {
|
|
34
|
+
return COLORS.includes(color);
|
|
35
|
+
};
|
|
36
|
+
exports._isNamedColor = _isNamedColor;
|
|
33
37
|
var EuiTextColor = function EuiTextColor(_ref) {
|
|
34
38
|
var children = _ref.children,
|
|
35
39
|
_ref$color = _ref.color,
|
|
@@ -40,7 +44,7 @@ var EuiTextColor = function EuiTextColor(_ref) {
|
|
|
40
44
|
cloneElement = _ref$cloneElement === void 0 ? false : _ref$cloneElement,
|
|
41
45
|
style = _ref.style,
|
|
42
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
var isNamedColor =
|
|
47
|
+
var isNamedColor = _isNamedColor(color);
|
|
44
48
|
var styles = (0, _services.useEuiMemoizedStyles)(_text_color.euiTextColorStyles);
|
|
45
49
|
var cssStyles = [styles.euiTextColor, isNamedColor ? styles[color] : styles.customColor];
|
|
46
50
|
|
|
@@ -39,13 +39,13 @@ var EuiGlobalToastListItem = function EuiGlobalToastListItem(_ref) {
|
|
|
39
39
|
};
|
|
40
40
|
exports.EuiGlobalToastListItem = EuiGlobalToastListItem;
|
|
41
41
|
EuiGlobalToastListItem.propTypes = {
|
|
42
|
-
className: _propTypes.default.string,
|
|
43
|
-
"aria-label": _propTypes.default.string,
|
|
44
|
-
"data-test-subj": _propTypes.default.string,
|
|
45
|
-
css: _propTypes.default.any,
|
|
46
42
|
isDismissed: _propTypes.default.bool,
|
|
47
43
|
/**
|
|
48
44
|
* ReactElement to render as this component's content
|
|
49
45
|
*/
|
|
50
|
-
children: _propTypes.default.element
|
|
46
|
+
children: _propTypes.default.element,
|
|
47
|
+
className: _propTypes.default.string,
|
|
48
|
+
"aria-label": _propTypes.default.string,
|
|
49
|
+
"data-test-subj": _propTypes.default.string,
|
|
50
|
+
css: _propTypes.default.any
|
|
51
51
|
};
|