@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.
Files changed (145) hide show
  1. package/README.md +3 -0
  2. package/dist/eui_charts_theme.js +1519 -1519
  3. package/dist/eui_charts_theme.js.map +1 -1
  4. package/dist/eui_theme_dark.css +41 -497
  5. package/dist/eui_theme_dark.min.css +1 -1
  6. package/dist/eui_theme_light.css +41 -497
  7. package/dist/eui_theme_light.min.css +1 -1
  8. package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
  9. package/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
  10. package/es/components/form/form.styles.js +26 -3
  11. package/es/components/markdown_editor/markdown_editor.js +12 -8
  12. package/es/components/markdown_editor/markdown_editor.styles.js +29 -0
  13. package/es/components/markdown_editor/markdown_editor_drop_zone.js +22 -9
  14. package/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +33 -0
  15. package/es/components/markdown_editor/markdown_editor_footer.js +11 -2
  16. package/es/components/markdown_editor/markdown_editor_footer.styles.js +26 -0
  17. package/es/components/markdown_editor/markdown_editor_text_area.js +6 -1
  18. package/es/components/markdown_editor/markdown_editor_text_area.styles.js +22 -0
  19. package/es/components/markdown_editor/markdown_editor_toolbar.js +10 -2
  20. package/es/components/markdown_editor/markdown_editor_toolbar.styles.js +21 -0
  21. package/es/components/markdown_editor/markdown_format.js +9 -6
  22. package/es/components/markdown_editor/markdown_format.styles.js +25 -10
  23. package/es/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -3
  24. package/es/components/markdown_editor/plugins/markdown_tooltip/renderer.js +13 -2
  25. package/es/components/selectable/selectable.js +10 -2
  26. package/es/components/selectable/selectable_list/selectable_list.js +95 -42
  27. package/es/components/selectable/selectable_list/selectable_list_item.js +234 -204
  28. package/es/components/selectable/selectable_option.js +9 -1
  29. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
  30. package/es/components/text/text_color.js +4 -1
  31. package/es/components/toast/global_toast_list_item.js +5 -5
  32. package/eui.d.ts +332 -234
  33. package/i18ntokens.json +124 -106
  34. package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
  35. package/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
  36. package/lib/components/form/form.styles.js +30 -4
  37. package/lib/components/markdown_editor/markdown_editor.js +12 -8
  38. package/lib/components/markdown_editor/markdown_editor.styles.js +37 -0
  39. package/lib/components/markdown_editor/markdown_editor_drop_zone.js +20 -8
  40. package/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
  41. package/lib/components/markdown_editor/markdown_editor_footer.js +10 -1
  42. package/lib/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
  43. package/lib/components/markdown_editor/markdown_editor_text_area.js +6 -1
  44. package/lib/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
  45. package/lib/components/markdown_editor/markdown_editor_toolbar.js +10 -2
  46. package/lib/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
  47. package/lib/components/markdown_editor/markdown_format.js +8 -5
  48. package/lib/components/markdown_editor/markdown_format.styles.js +25 -10
  49. package/lib/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
  50. package/lib/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
  51. package/lib/components/selectable/selectable.js +10 -2
  52. package/lib/components/selectable/selectable_list/selectable_list.js +95 -42
  53. package/lib/components/selectable/selectable_list/selectable_list_item.js +241 -210
  54. package/lib/components/selectable/selectable_option.js +12 -1
  55. package/lib/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
  56. package/lib/components/text/text_color.js +6 -2
  57. package/lib/components/toast/global_toast_list_item.js +5 -5
  58. package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
  59. package/optimize/es/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
  60. package/optimize/es/components/form/form.styles.js +26 -3
  61. package/optimize/es/components/markdown_editor/markdown_editor.js +12 -8
  62. package/optimize/es/components/markdown_editor/markdown_editor.styles.js +29 -0
  63. package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.js +19 -9
  64. package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.styles.js +33 -0
  65. package/optimize/es/components/markdown_editor/markdown_editor_footer.js +11 -2
  66. package/optimize/es/components/markdown_editor/markdown_editor_footer.styles.js +26 -0
  67. package/optimize/es/components/markdown_editor/markdown_editor_text_area.js +6 -1
  68. package/optimize/es/components/markdown_editor/markdown_editor_text_area.styles.js +22 -0
  69. package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +10 -2
  70. package/optimize/es/components/markdown_editor/markdown_editor_toolbar.styles.js +21 -0
  71. package/optimize/es/components/markdown_editor/markdown_format.js +9 -6
  72. package/optimize/es/components/markdown_editor/markdown_format.styles.js +25 -10
  73. package/optimize/es/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -3
  74. package/optimize/es/components/markdown_editor/plugins/markdown_tooltip/renderer.js +13 -2
  75. package/optimize/es/components/selectable/selectable_list/selectable_list.js +81 -38
  76. package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +217 -198
  77. package/optimize/es/components/selectable/selectable_option.js +9 -1
  78. package/optimize/es/components/text/text_color.js +4 -1
  79. package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
  80. package/optimize/lib/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
  81. package/optimize/lib/components/form/form.styles.js +30 -4
  82. package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -8
  83. package/optimize/lib/components/markdown_editor/markdown_editor.styles.js +37 -0
  84. package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.js +24 -16
  85. package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
  86. package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +10 -1
  87. package/optimize/lib/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
  88. package/optimize/lib/components/markdown_editor/markdown_editor_text_area.js +6 -1
  89. package/optimize/lib/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
  90. package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +10 -2
  91. package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
  92. package/optimize/lib/components/markdown_editor/markdown_format.js +8 -5
  93. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +25 -10
  94. package/optimize/lib/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
  95. package/optimize/lib/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
  96. package/optimize/lib/components/selectable/selectable_list/selectable_list.js +81 -38
  97. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +224 -204
  98. package/optimize/lib/components/selectable/selectable_option.js +12 -1
  99. package/optimize/lib/components/text/text_color.js +6 -2
  100. package/package.json +5 -12
  101. package/src/components/date_picker/react-datepicker/LICENSE +21 -0
  102. package/src/components/date_picker/react-datepicker/README.md +168 -0
  103. package/src/components/date_picker/super_date_picker/date_popover/_absolute_tab.scss +13 -18
  104. package/src/components/form/checkbox/_checkbox.scss +23 -6
  105. package/src/components/index.scss +0 -1
  106. package/src/components/selectable/selectable_list/_selectable_list_item.scss +4 -0
  107. package/src/components/selectable/selectable_templates/_selectable_template_sitewide_option.scss +5 -1
  108. package/src/services/theme/README.md +153 -0
  109. package/src/test/README.md +44 -0
  110. package/src/themes/amsterdam/overrides/_index.scss +0 -1
  111. package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +5 -1
  112. package/test-env/components/date_picker/super_date_picker/date_popover/absolute_tab.js +25 -11
  113. package/test-env/components/form/form.styles.js +30 -4
  114. package/test-env/components/markdown_editor/markdown_editor.js +12 -8
  115. package/test-env/components/markdown_editor/markdown_editor.styles.js +37 -0
  116. package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +24 -16
  117. package/test-env/components/markdown_editor/markdown_editor_drop_zone.styles.js +38 -0
  118. package/test-env/components/markdown_editor/markdown_editor_footer.js +10 -1
  119. package/test-env/components/markdown_editor/markdown_editor_footer.styles.js +33 -0
  120. package/test-env/components/markdown_editor/markdown_editor_text_area.js +6 -1
  121. package/test-env/components/markdown_editor/markdown_editor_text_area.styles.js +29 -0
  122. package/test-env/components/markdown_editor/markdown_editor_toolbar.js +10 -2
  123. package/test-env/components/markdown_editor/markdown_editor_toolbar.styles.js +28 -0
  124. package/test-env/components/markdown_editor/markdown_format.js +8 -5
  125. package/test-env/components/markdown_editor/markdown_format.styles.js +25 -10
  126. package/test-env/components/markdown_editor/plugins/markdown_checkbox/renderer.js +9 -4
  127. package/test-env/components/markdown_editor/plugins/markdown_tooltip/renderer.js +19 -10
  128. package/test-env/components/selectable/selectable.js +10 -2
  129. package/test-env/components/selectable/selectable_list/selectable_list.js +95 -42
  130. package/test-env/components/selectable/selectable_list/selectable_list_item.js +233 -205
  131. package/test-env/components/selectable/selectable_option.js +12 -1
  132. package/test-env/components/selectable/selectable_templates/selectable_template_sitewide.js +10 -2
  133. package/test-env/components/text/text_color.js +6 -2
  134. package/test-env/components/toast/global_toast_list_item.js +5 -5
  135. package/src/components/markdown_editor/_index.scss +0 -9
  136. package/src/components/markdown_editor/_markdown_editor.scss +0 -22
  137. package/src/components/markdown_editor/_markdown_editor_drop_zone.scss +0 -58
  138. package/src/components/markdown_editor/_markdown_editor_footer.scss +0 -42
  139. package/src/components/markdown_editor/_markdown_editor_preview.scss +0 -20
  140. package/src/components/markdown_editor/_markdown_editor_text_area.scss +0 -43
  141. package/src/components/markdown_editor/_markdown_editor_toolbar.scss +0 -29
  142. package/src/components/markdown_editor/_markdown_format.scss +0 -78
  143. package/src/components/markdown_editor/_variables.scss +0 -1
  144. package/src/components/markdown_editor/plugins/markdown_tooltip.scss +0 -4
  145. 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 _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); }
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
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
39
- * or more contributor license agreements. Licensed under the Elastic License
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 = /*#__PURE__*/function (_Component) {
75
- _inherits(EuiSelectableListItem, _Component);
76
- var _super = _createSuper(EuiSelectableListItem);
77
- function EuiSelectableListItem(props) {
78
- var _this;
79
- _classCallCheck(this, EuiSelectableListItem);
80
- _this = _super.call(this, props);
81
- // aria-checked is intended to be used with role="checkbox" but
82
- // the MDN documentation lists it as a possibility for role="option".
83
- // See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked
84
- // and https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/option_role
85
- _defineProperty(_assertThisInitialized(_this), "isChecked", function (role, checked) {
86
- var rolesThatCanBeMixed = ['option', 'checkbox', 'menuitemcheckbox'];
87
- var rolesThatCanBeChecked = [].concat(rolesThatCanBeMixed, ['radio', 'menuitemradio', 'switch']);
88
- if (!rolesThatCanBeChecked.includes(role)) return undefined;
89
- switch (checked) {
90
- case 'on':
91
- case 'off':
92
- return true;
93
- case 'mixed':
94
- if (rolesThatCanBeMixed.includes(role)) {
95
- return 'mixed';
96
- } else {
97
- return false;
98
- }
99
- default:
100
- return false;
101
- }
102
- });
103
- return _this;
104
- }
105
- _createClass(EuiSelectableListItem, [{
106
- key: "render",
107
- value: function render() {
108
- var _this$props = this.props,
109
- children = _this$props.children,
110
- className = _this$props.className,
111
- disabled = _this$props.disabled,
112
- checked = _this$props.checked,
113
- isFocused = _this$props.isFocused,
114
- showIcons = _this$props.showIcons,
115
- prepend = _this$props.prepend,
116
- append = _this$props.append,
117
- allowExclusions = _this$props.allowExclusions,
118
- onFocusBadge = _this$props.onFocusBadge,
119
- _this$props$paddingSi = _this$props.paddingSize,
120
- paddingSize = _this$props$paddingSi === void 0 ? 's' : _this$props$paddingSi,
121
- _this$props$role = _this$props.role,
122
- role = _this$props$role === void 0 ? 'option' : _this$props$role,
123
- searchable = _this$props.searchable,
124
- textWrap = _this$props.textWrap,
125
- rest = _objectWithoutProperties(_this$props, _excluded);
126
- var classes = (0, _classnames.default)('euiSelectableListItem', {
127
- 'euiSelectableListItem-isFocused': isFocused
128
- }, paddingSizeToClassNameMap[paddingSize], className);
129
- var textClasses = (0, _classnames.default)('euiSelectableListItem__text', _defineProperty({}, "euiSelectableListItem__text--".concat(textWrap), textWrap));
130
- var optionIcon;
131
- if (showIcons) {
132
- var _resolveIconAndColor = resolveIconAndColor(checked),
133
- icon = _resolveIconAndColor.icon,
134
- color = _resolveIconAndColor.color;
135
- optionIcon = (0, _react2.jsx)(_icon.EuiIcon, {
136
- className: "euiSelectableListItem__icon",
137
- color: color,
138
- type: icon
139
- });
140
- }
141
- var state;
142
- var instructions;
143
- var screenReaderStrings = {
144
- checked: {
145
- state: (0, _react2.jsx)(_i18n.EuiI18n, {
146
- token: "euiSelectableListItem.checkedOption",
147
- default: "Checked option."
148
- }),
149
- instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
150
- token: "euiSelectableListItem.checkOptionInstructions",
151
- default: "To check this option, press Enter."
152
- })
153
- },
154
- unchecked: {
155
- instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
156
- token: "euiSelectableListItem.uncheckOptionInstructions",
157
- default: "To uncheck this option, press Enter."
158
- })
159
- },
160
- excluded: {
161
- state: (0, _react2.jsx)(_i18n.EuiI18n, {
162
- token: "euiSelectableListItem.excludedOption",
163
- default: "Excluded option."
164
- }),
165
- instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
166
- token: "euiSelectableListItem.excludeOptionInstructions",
167
- default: "To exclude this option, press Enter."
168
- })
169
- },
170
- mixed: {
171
- state: (0, _react2.jsx)(_i18n.EuiI18n, {
172
- token: "euiSelectableListItem.mixedOption",
173
- default: "Mixed (indeterminate) option."
174
- }),
175
- instructions: (0, _react2.jsx)(_i18n.EuiI18n, {
176
- token: "euiSelectableListItem.mixedOptionInstructions",
177
- default: "To check this option for all, press Enter once."
178
- }),
179
- uncheckInstructions: (0, _react2.jsx)(_i18n.EuiI18n, {
180
- token: "euiSelectableListItem.mixedOptionUncheckInstructions",
181
- default: "To uncheck this option for all, press Enter twice."
182
- }),
183
- excludeInstructions: (0, _react2.jsx)(_i18n.EuiI18n, {
184
- token: "euiSelectableListItem.mixedOptionExcludeInstructions",
185
- default: "To exclude this option for all, press Enter twice."
186
- })
187
- }
188
- };
189
- switch (checked) {
190
- case 'on':
191
- state = screenReaderStrings.checked.state;
192
- instructions = allowExclusions ? screenReaderStrings.excluded.instructions : searchable ? screenReaderStrings.unchecked.instructions : undefined;
193
- break;
194
- case 'off':
195
- state = screenReaderStrings.excluded.state;
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
- var appendNode;
214
- if (append || !!onFocusBadge) {
215
- var onFocusBadgeNode;
216
- var defaultOnFocusBadgeProps = {
217
- 'aria-hidden': true,
218
- iconType: 'returnKey',
219
- iconSide: 'left',
220
- color: 'hollow'
221
- };
222
- if (onFocusBadge === true) {
223
- onFocusBadgeNode = (0, _react2.jsx)(_badge.EuiBadge, _extends({
224
- className: "euiSelectableListItem__onFocusBadge"
225
- }, defaultOnFocusBadgeProps));
226
- } else if (typeof onFocusBadge !== 'boolean' && !!onFocusBadge) {
227
- var _children = onFocusBadge.children,
228
- _className = onFocusBadge.className,
229
- restBadgeProps = _objectWithoutProperties(onFocusBadge, _excluded2);
230
- onFocusBadgeNode = (0, _react2.jsx)(_badge.EuiBadge, _extends({
231
- className: (0, _classnames.default)('euiSelectableListItem__onFocusBadge', _className)
232
- }, defaultOnFocusBadgeProps, restBadgeProps), _children);
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
- // Only display the append wrapper if append exists or isFocused
236
- if (append || isFocused && !disabled) {
237
- appendNode = (0, _react2.jsx)("span", {
238
- className: "euiSelectableListItem__append"
239
- }, append, " ", isFocused && !disabled ? onFocusBadgeNode : null);
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
- var screenReaderText = (state || instructions) && (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("div", null, state || instructions ? '. ' : null, state, state && instructions ? ' ' : null, instructions));
243
- return (0, _react2.jsx)("li", _extends({
244
- role: role,
245
- "aria-disabled": disabled,
246
- "aria-checked": this.isChecked(role, checked) // Whether the item is "checked"
247
- ,
248
- "aria-selected": !disabled && isFocused // Whether the item has keyboard focus per W3 spec
249
- ,
250
- className: classes
251
- }, rest), (0, _react2.jsx)("span", {
252
- className: "euiSelectableListItem__content"
253
- }, optionIcon, prependNode, (0, _react2.jsx)("span", {
254
- className: textClasses
255
- }, children, screenReaderText), appendNode));
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
- return EuiSelectableListItem;
259
- }(_react.Component);
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.oneOf(["on", "off", "mixed", undefined]),
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.oneOf(["on", "off", "mixed", undefined]),
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 = COLORS.includes(color);
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
  };