@elastic/eui 116.3.1 → 116.4.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.
Files changed (183) hide show
  1. package/es/components/banner/banner.js +1 -2
  2. package/es/components/banner/banner.styles.js +1 -1
  3. package/es/components/basic_table/basic_table.js +35 -5
  4. package/es/components/basic_table/basic_table.styles.js +19 -1
  5. package/es/components/basic_table/in_memory_table.js +17 -0
  6. package/es/components/basic_table/index.js +2 -1
  7. package/es/components/basic_table/pagination_bar.js +19 -4
  8. package/es/components/basic_table/pagination_bar.styles.js +21 -0
  9. package/es/components/basic_table/panel.styles.js +14 -0
  10. package/es/components/basic_table/use_panel_props.js +28 -0
  11. package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
  12. package/es/components/flyout/flyout.component.js +10 -6
  13. package/es/components/flyout/flyout_menu.js +122 -19
  14. package/es/components/flyout/flyout_menu.styles.js +2 -1
  15. package/es/components/flyout/manager/actions.js +20 -0
  16. package/es/components/flyout/manager/flyout_child.js +23 -1
  17. package/es/components/flyout/manager/flyout_managed.js +65 -19
  18. package/es/components/flyout/manager/hooks.js +1 -1
  19. package/es/components/flyout/manager/index.js +2 -2
  20. package/es/components/flyout/manager/reducer.js +32 -8
  21. package/es/components/flyout/manager/selectors.js +8 -2
  22. package/es/components/flyout/manager/store.js +35 -2
  23. package/es/components/flyout/use_flyout_menu.js +2 -2
  24. package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
  25. package/es/components/notification_icon/assets/info_fill.js +34 -0
  26. package/es/components/notification_icon/assets/warning_static.js +40 -0
  27. package/es/components/notification_icon/notification_icon.js +87 -0
  28. package/es/components/notification_icon/notification_icon.styles.js +22 -0
  29. package/es/components/table/mobile/table_sort_mobile.js +64 -103
  30. package/es/components/toast/global_toast_list.js +132 -6
  31. package/es/components/toast/global_toast_list.styles.js +31 -7
  32. package/es/components/toast/toast.js +242 -47
  33. package/es/components/toast/toast.styles.js +35 -47
  34. package/es/components/toast/toast_action.js +34 -0
  35. package/es/components/toast/types.js +9 -0
  36. package/es/components/tool_tip/tool_tip.js +3 -3
  37. package/eui.d.ts +1203 -971
  38. package/i18ntokens.json +1582 -1546
  39. package/lib/components/banner/banner.js +1 -2
  40. package/lib/components/banner/banner.styles.js +1 -1
  41. package/lib/components/basic_table/basic_table.js +34 -4
  42. package/lib/components/basic_table/basic_table.styles.js +19 -1
  43. package/lib/components/basic_table/in_memory_table.js +17 -0
  44. package/lib/components/basic_table/index.js +8 -1
  45. package/lib/components/basic_table/pagination_bar.js +19 -4
  46. package/lib/components/basic_table/pagination_bar.styles.js +26 -0
  47. package/lib/components/basic_table/panel.styles.js +20 -0
  48. package/lib/components/basic_table/use_panel_props.js +33 -0
  49. package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
  50. package/lib/components/flyout/flyout.component.js +10 -6
  51. package/lib/components/flyout/flyout_menu.js +120 -19
  52. package/lib/components/flyout/flyout_menu.styles.js +2 -1
  53. package/lib/components/flyout/manager/actions.js +21 -1
  54. package/lib/components/flyout/manager/flyout_child.js +23 -1
  55. package/lib/components/flyout/manager/flyout_managed.js +41 -17
  56. package/lib/components/flyout/manager/hooks.js +6 -0
  57. package/lib/components/flyout/manager/index.js +12 -0
  58. package/lib/components/flyout/manager/reducer.js +31 -7
  59. package/lib/components/flyout/manager/selectors.js +9 -3
  60. package/lib/components/flyout/manager/store.js +34 -1
  61. package/lib/components/flyout/use_flyout_menu.js +2 -2
  62. package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
  63. package/lib/components/notification_icon/assets/info_fill.js +41 -0
  64. package/lib/components/notification_icon/assets/warning_static.js +47 -0
  65. package/lib/components/notification_icon/notification_icon.js +93 -0
  66. package/lib/components/notification_icon/notification_icon.styles.js +28 -0
  67. package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  68. package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  69. package/lib/components/table/mobile/table_sort_mobile.js +71 -108
  70. package/lib/components/toast/global_toast_list.js +132 -6
  71. package/lib/components/toast/global_toast_list.styles.js +31 -8
  72. package/lib/components/toast/toast.js +244 -47
  73. package/lib/components/toast/toast.styles.js +32 -45
  74. package/lib/components/toast/toast_action.js +40 -0
  75. package/lib/components/toast/types.js +15 -0
  76. package/lib/components/tool_tip/tool_tip.js +2 -2
  77. package/optimize/es/components/banner/banner.js +1 -2
  78. package/optimize/es/components/banner/banner.styles.js +1 -1
  79. package/optimize/es/components/basic_table/basic_table.js +18 -5
  80. package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
  81. package/optimize/es/components/basic_table/index.js +2 -1
  82. package/optimize/es/components/basic_table/pagination_bar.js +19 -4
  83. package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
  84. package/optimize/es/components/basic_table/panel.styles.js +14 -0
  85. package/optimize/es/components/basic_table/use_panel_props.js +28 -0
  86. package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
  87. package/optimize/es/components/flyout/flyout.component.js +10 -6
  88. package/optimize/es/components/flyout/flyout_menu.js +99 -18
  89. package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
  90. package/optimize/es/components/flyout/manager/actions.js +20 -0
  91. package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
  92. package/optimize/es/components/flyout/manager/hooks.js +1 -1
  93. package/optimize/es/components/flyout/manager/index.js +2 -2
  94. package/optimize/es/components/flyout/manager/reducer.js +32 -8
  95. package/optimize/es/components/flyout/manager/selectors.js +8 -2
  96. package/optimize/es/components/flyout/manager/store.js +35 -2
  97. package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
  98. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
  99. package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
  100. package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
  101. package/optimize/es/components/notification_icon/notification_icon.js +77 -0
  102. package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
  103. package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
  104. package/optimize/es/components/toast/global_toast_list.js +31 -6
  105. package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
  106. package/optimize/es/components/toast/toast.js +143 -47
  107. package/optimize/es/components/toast/toast.styles.js +35 -47
  108. package/optimize/es/components/toast/toast_action.js +33 -0
  109. package/optimize/es/components/toast/types.js +9 -0
  110. package/optimize/es/components/tool_tip/tool_tip.js +3 -3
  111. package/optimize/lib/components/banner/banner.js +1 -2
  112. package/optimize/lib/components/banner/banner.styles.js +1 -1
  113. package/optimize/lib/components/basic_table/basic_table.js +17 -4
  114. package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
  115. package/optimize/lib/components/basic_table/index.js +8 -1
  116. package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
  117. package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
  118. package/optimize/lib/components/basic_table/panel.styles.js +20 -0
  119. package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
  120. package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
  121. package/optimize/lib/components/flyout/flyout.component.js +10 -6
  122. package/optimize/lib/components/flyout/flyout_menu.js +98 -18
  123. package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
  124. package/optimize/lib/components/flyout/manager/actions.js +21 -1
  125. package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
  126. package/optimize/lib/components/flyout/manager/hooks.js +6 -0
  127. package/optimize/lib/components/flyout/manager/index.js +12 -0
  128. package/optimize/lib/components/flyout/manager/reducer.js +31 -7
  129. package/optimize/lib/components/flyout/manager/selectors.js +9 -3
  130. package/optimize/lib/components/flyout/manager/store.js +34 -1
  131. package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
  132. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
  133. package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
  134. package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
  135. package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
  136. package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
  137. package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  138. package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  139. package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
  140. package/optimize/lib/components/toast/global_toast_list.js +31 -6
  141. package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
  142. package/optimize/lib/components/toast/toast.js +146 -47
  143. package/optimize/lib/components/toast/toast.styles.js +33 -45
  144. package/optimize/lib/components/toast/toast_action.js +39 -0
  145. package/optimize/lib/components/toast/types.js +15 -0
  146. package/optimize/lib/components/tool_tip/tool_tip.js +2 -2
  147. package/package.json +7 -5
  148. package/test-env/components/banner/banner.js +1 -2
  149. package/test-env/components/banner/banner.styles.js +1 -1
  150. package/test-env/components/basic_table/basic_table.js +34 -4
  151. package/test-env/components/basic_table/basic_table.styles.js +19 -1
  152. package/test-env/components/basic_table/in_memory_table.js +17 -0
  153. package/test-env/components/basic_table/index.js +8 -1
  154. package/test-env/components/basic_table/pagination_bar.js +19 -4
  155. package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
  156. package/test-env/components/basic_table/panel.styles.js +20 -0
  157. package/test-env/components/basic_table/use_panel_props.js +33 -0
  158. package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
  159. package/test-env/components/flyout/flyout.component.js +10 -6
  160. package/test-env/components/flyout/flyout_menu.js +121 -19
  161. package/test-env/components/flyout/flyout_menu.styles.js +2 -1
  162. package/test-env/components/flyout/manager/actions.js +21 -1
  163. package/test-env/components/flyout/manager/flyout_child.js +23 -1
  164. package/test-env/components/flyout/manager/flyout_managed.js +41 -17
  165. package/test-env/components/flyout/manager/hooks.js +6 -0
  166. package/test-env/components/flyout/manager/index.js +12 -0
  167. package/test-env/components/flyout/manager/reducer.js +31 -7
  168. package/test-env/components/flyout/manager/selectors.js +9 -3
  169. package/test-env/components/flyout/manager/store.js +34 -1
  170. package/test-env/components/flyout/use_flyout_menu.js +2 -2
  171. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
  172. package/test-env/components/notification_icon/assets/info_fill.js +41 -0
  173. package/test-env/components/notification_icon/assets/warning_static.js +47 -0
  174. package/test-env/components/notification_icon/notification_icon.js +46 -0
  175. package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
  176. package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
  177. package/test-env/components/toast/global_toast_list.js +132 -6
  178. package/test-env/components/toast/global_toast_list.styles.js +30 -7
  179. package/test-env/components/toast/toast.js +242 -47
  180. package/test-env/components/toast/toast.styles.js +33 -45
  181. package/test-env/components/toast/toast_action.js +39 -0
  182. package/test-env/components/toast/types.js +15 -0
  183. package/test-env/components/tool_tip/tool_tip.js +2 -2
@@ -7,15 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.EuiTableSortMobile = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
13
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
16
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
12
  var _react = _interopRequireWildcard(require("react"));
18
- var _propTypes = _interopRequireDefault(require("prop-types"));
19
13
  var _classnames = _interopRequireDefault(require("classnames"));
20
14
  var _button_empty = require("../../button/button_empty");
21
15
  var _popover = require("../../popover");
@@ -24,101 +18,70 @@ var _i18n = require("../../i18n");
24
18
  var _table_sort_mobile_item = require("./table_sort_mobile_item");
25
19
  var _react2 = require("@emotion/react");
26
20
  var _excluded = ["className", "anchorPosition", "items"];
27
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
28
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
29
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
30
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /*
21
+ /*
31
22
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
32
23
  * or more contributor license agreements. Licensed under the Elastic License
33
24
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
34
25
  * in compliance with, at your election, the Elastic License 2.0 or the Server
35
26
  * Side Public License, v 1.
36
27
  */
37
- var EuiTableSortMobile = exports.EuiTableSortMobile = /*#__PURE__*/function (_Component) {
38
- function EuiTableSortMobile() {
39
- var _this;
40
- (0, _classCallCheck2.default)(this, EuiTableSortMobile);
41
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
- args[_key] = arguments[_key];
43
- }
44
- _this = _callSuper(this, EuiTableSortMobile, [].concat(args));
45
- (0, _defineProperty2.default)(_this, "state", {
46
- isPopoverOpen: false
47
- });
48
- (0, _defineProperty2.default)(_this, "onButtonClick", function () {
49
- _this.setState({
50
- isPopoverOpen: !_this.state.isPopoverOpen
51
- });
52
- });
53
- (0, _defineProperty2.default)(_this, "closePopover", function () {
54
- _this.setState({
55
- isPopoverOpen: false
56
- });
57
- });
58
- // Aligns the button to the right even when it's the only element present
59
- (0, _defineProperty2.default)(_this, "euiTableSortMobileStyles", {
60
- marginInlineStart: 'auto',
61
- label: 'euiTableSortMobile'
28
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
29
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
30
+ // Aligns the button to the right even when it's the only element present
31
+ var euiTableSortMobileStyles = {
32
+ marginInlineStart: 'auto',
33
+ label: 'euiTableSortMobile'
34
+ };
35
+ var EuiTableSortMobile = exports.EuiTableSortMobile = function EuiTableSortMobile(_ref) {
36
+ var className = _ref.className,
37
+ anchorPosition = _ref.anchorPosition,
38
+ items = _ref.items,
39
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
40
+ var _useState = (0, _react.useState)(false),
41
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
42
+ isPopoverOpen = _useState2[0],
43
+ setIsPopoverOpen = _useState2[1];
44
+ var classes = (0, _classnames.default)('euiTableSortMobile', className);
45
+ var onButtonClick = function onButtonClick() {
46
+ setIsPopoverOpen(function (isOpen) {
47
+ return !isOpen;
62
48
  });
63
- return _this;
64
- }
65
- (0, _inherits2.default)(EuiTableSortMobile, _Component);
66
- return (0, _createClass2.default)(EuiTableSortMobile, [{
67
- key: "render",
68
- value: function render() {
69
- var _this$props = this.props,
70
- className = _this$props.className,
71
- anchorPosition = _this$props.anchorPosition,
72
- items = _this$props.items,
73
- rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
74
- var classes = (0, _classnames.default)('euiTableSortMobile', className);
75
- var mobileSortButton = (0, _react2.jsx)(_button_empty.EuiButtonEmpty, {
76
- iconType: "chevronSingleDown",
77
- iconSide: "right",
78
- onClick: this.onButtonClick.bind(this),
79
- flush: "right",
80
- size: "xs"
81
- }, (0, _react2.jsx)(_i18n.EuiI18n, {
82
- token: "euiTableSortMobile.sorting",
83
- default: "Sorting"
84
- }));
85
- var mobileSortPopover = (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
86
- button: mobileSortButton,
87
- isOpen: this.state.isPopoverOpen,
88
- closePopover: this.closePopover,
89
- anchorPosition: anchorPosition || 'downRight',
90
- panelPaddingSize: "none"
91
- }, rest), (0, _react2.jsx)(_context_menu.EuiContextMenuPanel, {
92
- style: {
93
- minWidth: 200
94
- },
95
- items: items && items.length ? items.map(function (item) {
96
- return (0, _react2.jsx)(_table_sort_mobile_item.EuiTableSortMobileItem, {
97
- key: item.key,
98
- onSort: item.onSort,
99
- isSorted: item.isSorted,
100
- isSortAscending: item.isSortAscending
101
- }, item.name);
102
- }) : undefined
103
- }));
104
- return (0, _react2.jsx)("div", {
105
- className: classes,
106
- css: this.euiTableSortMobileStyles
107
- }, mobileSortPopover);
108
- }
109
- }]);
110
- }(_react.Component);
111
- EuiTableSortMobile.propTypes = {
112
- anchorPosition: _propTypes.default.any,
113
- items: _propTypes.default.arrayOf(_propTypes.default.shape({
114
- name: _propTypes.default.node.isRequired,
115
- key: _propTypes.default.any,
116
- onSort: _propTypes.default.func,
117
- isSorted: _propTypes.default.bool,
118
- isSortAscending: _propTypes.default.bool
119
- }).isRequired),
120
- className: _propTypes.default.string,
121
- "aria-label": _propTypes.default.string,
122
- "data-test-subj": _propTypes.default.string,
123
- css: _propTypes.default.any
124
- };
49
+ };
50
+ var closePopover = function closePopover() {
51
+ setIsPopoverOpen(false);
52
+ };
53
+ var mobileSortButton = (0, _react2.jsx)(_button_empty.EuiButtonEmpty, {
54
+ iconType: "chevronSingleDown",
55
+ iconSide: "right",
56
+ onClick: onButtonClick,
57
+ flush: "right",
58
+ size: "xs"
59
+ }, (0, _react2.jsx)(_i18n.EuiI18n, {
60
+ token: "euiTableSortMobile.sorting",
61
+ default: "Sorting"
62
+ }));
63
+ var mobileSortPopover = (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({
64
+ button: mobileSortButton,
65
+ isOpen: isPopoverOpen,
66
+ closePopover: closePopover,
67
+ anchorPosition: anchorPosition || 'downRight',
68
+ panelPaddingSize: "none"
69
+ }, rest), (0, _react2.jsx)(_context_menu.EuiContextMenuPanel, {
70
+ style: {
71
+ minWidth: 200
72
+ },
73
+ items: items !== null && items !== void 0 && items.length ? items.map(function (item) {
74
+ return (0, _react2.jsx)(_table_sort_mobile_item.EuiTableSortMobileItem, {
75
+ key: item.key,
76
+ onSort: item.onSort,
77
+ isSorted: item.isSorted,
78
+ isSortAscending: item.isSortAscending
79
+ }, item.name);
80
+ }) : undefined
81
+ }));
82
+ return (0, _react2.jsx)("div", {
83
+ className: classes,
84
+ css: euiTableSortMobileStyles
85
+ }, mobileSortPopover);
86
+ };
87
+ EuiTableSortMobile.displayName = 'EuiTableSortMobile';
@@ -22,8 +22,9 @@ var _toast = require("./toast");
22
22
  var _global_toast_list = require("./global_toast_list.styles");
23
23
  var _button = require("../button");
24
24
  var _i18n = require("../i18n");
25
+ var _badge = require("../badge");
25
26
  var _react2 = require("@emotion/react");
26
- var _excluded = ["className", "toasts", "dismissToast", "toastLifeTimeMs", "onClearAllToasts", "side", "showClearAllButtonAt"],
27
+ var _excluded = ["className", "toasts", "dismissToast", "toastLifeTimeMs", "onClearAllToasts", "side", "showClearAllButtonAt", "showNotificationBadge"],
27
28
  _excluded2 = ["text", "toastLifeTimeMs"];
28
29
  /*
29
30
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -54,6 +55,8 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
54
55
  side = _ref$side === void 0 ? 'right' : _ref$side,
55
56
  _ref$showClearAllButt = _ref.showClearAllButtonAt,
56
57
  showClearAllButtonAt = _ref$showClearAllButt === void 0 ? CLEAR_ALL_TOASTS_THRESHOLD_DEFAULT : _ref$showClearAllButt,
58
+ _ref$showNotification = _ref.showNotificationBadge,
59
+ showNotificationBadge = _ref$showNotification === void 0 ? false : _ref$showNotification,
57
60
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
58
61
  var _useState = (0, _react.useState)({}),
59
62
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -228,8 +231,9 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
228
231
  var renderedToasts = (0, _react.useMemo)(function () {
229
232
  return toasts.map(function (toast) {
230
233
  var text = toast.text,
231
- toastLifeTimeMs = toast.toastLifeTimeMs,
234
+ perToastLifeTimeMs = toast.toastLifeTimeMs,
232
235
  rest = (0, _objectWithoutProperties2.default)(toast, _excluded2);
236
+ var effectiveLifeTimeMs = perToastLifeTimeMs !== null && perToastLifeTimeMs !== void 0 ? perToastLifeTimeMs : toastLifeTimeMs;
233
237
  var onClose = function onClose() {
234
238
  return dismissToast(toast);
235
239
  };
@@ -240,9 +244,12 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
240
244
  onClose: onClose,
241
245
  onFocus: onMouseEnter,
242
246
  onBlur: onMouseLeave
243
- }, rest), text));
247
+ }, rest, {
248
+ animationMs: effectiveLifeTimeMs,
249
+ text: text
250
+ })));
244
251
  });
245
- }, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave]);
252
+ }, [toasts, toastIdToDismissedMap, dismissToast, onMouseEnter, onMouseLeave, toastLifeTimeMs]);
246
253
  var clearAllButton = (0, _react.useMemo)(function () {
247
254
  if (toasts.length && showClearAllButtonAt && toasts.length >= showClearAllButtonAt) {
248
255
  return (0, _react2.jsx)(_i18n.EuiI18n, {
@@ -256,7 +263,8 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
256
263
  return (0, _react2.jsx)(_global_toast_list_item.EuiGlobalToastListItem, {
257
264
  isDismissed: false
258
265
  }, (0, _react2.jsx)(_button.EuiButton, {
259
- fill: true,
266
+ fullWidth: true,
267
+ size: "s",
260
268
  color: "text",
261
269
  onClick: function onClick() {
262
270
  toasts.forEach(function (toast) {
@@ -272,23 +280,135 @@ var EuiGlobalToastList = exports.EuiGlobalToastList = function EuiGlobalToastLis
272
280
  }
273
281
  }, [showClearAllButtonAt, onClearAllToasts, toasts, dismissToastProp, styles]);
274
282
  var classes = (0, _classnames.default)('euiGlobalToastList', className);
283
+ var hasContent = renderedToasts.length > 0 || clearAllButton != null;
284
+ var notificationBadge = (0, _react.useMemo)(function () {
285
+ var _toastIdToDismissedMa, _toasts$;
286
+ var toastWasDismissed = (_toastIdToDismissedMa = toastIdToDismissedMap[(_toasts$ = toasts[0]) === null || _toasts$ === void 0 ? void 0 : _toasts$.id]) !== null && _toastIdToDismissedMa !== void 0 ? _toastIdToDismissedMa : false;
287
+ var isListEmpty = toasts.every(function (t) {
288
+ return toastIdToDismissedMap[t.id];
289
+ });
290
+ return showNotificationBadge && toasts.length > 0 && (0, _react2.jsx)(_badge.EuiNotificationBadge, {
291
+ className: "euiGlobalToastList__countBadge",
292
+ css: [styles.notificationBadge.notificationBadge, toastWasDismissed && styles.notificationBadge.hasFadeOut, isListEmpty && styles.notificationBadge.hasFadeOut, ";label:notificationBadge;"],
293
+ size: "m",
294
+ color: "subdued",
295
+ "data-test-subj": "euiGlobalToastListNotificationBadge"
296
+ }, toasts.length);
297
+ }, [showNotificationBadge, toasts, toastIdToDismissedMap, styles]);
275
298
  return (0, _react2.jsx)("div", (0, _extends2.default)({
276
299
  "aria-live": "polite",
277
300
  role: "log",
278
301
  ref: listElement,
279
302
  css: cssStyles,
280
303
  className: classes
281
- }, rest), renderedToasts, clearAllButton);
304
+ }, rest), hasContent && (0, _react2.jsx)("div", {
305
+ css: styles.content
306
+ }, notificationBadge, renderedToasts, clearAllButton));
282
307
  };
283
308
  EuiGlobalToastList.propTypes = {
284
309
  toasts: _propTypes.default.arrayOf(_propTypes.default.shape({
285
310
  id: _propTypes.default.string.isRequired,
311
+ /**
312
+ * Main component text. Accepts text, text block elements such as `<p>`, and inline elements such as `<span>`, `<strong>`, `<em>` or `<EuiLink>`.
313
+ * Avoid passing complex layouts or custom components. Use `children` instead.
314
+ */
286
315
  text: _propTypes.default.node,
287
316
  toastLifeTimeMs: _propTypes.default.number,
317
+ /**
318
+ * Title of the toast. Should be used with text only. Do not pass complex content or custom components.
319
+ * Ensure to always pass a title. It's currently marked as optional for backwards compatibility.
320
+ * In a future major release, this will be required.
321
+ */
288
322
  title: _propTypes.default.node,
323
+ /**
324
+ * Can be used for additional, non-inline content. Use sparingly, as toasts are not meant to have complex content.
325
+ * Where possible, use `text` and `actionProps` instead to display text and actions.
326
+ */
327
+ children: _propTypes.default.node,
289
328
  color: _propTypes.default.any,
329
+ /**
330
+ * Defines a custom icon to be displayed.
331
+ * When no `iconType` is set, a default icon will be used based on the `color` of the toast.
332
+ */
290
333
  iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "addToDashboard", "advancedSettingsApp", "agentApp", "aggregate", "alignBottom", "alignBottomLeft", "alignBottomRight", "alignCenterHorizontal", "alignCenterVertical", "alignLeft", "alignRight", "alignTop", "alignTopLeft", "alignTopRight", "alert", "analyzeEvent", "annotation", "anomalyChart", "chartAnomaly", "anomalySwimLane", "apmApp", "apmTrace", "chartWaterfall", "appSearchApp", "apps", "arrowDown", "chevronSingleDown", "arrowLeft", "chevronSingleLeft", "arrowRight", "chevronSingleRight", "arrowUp", "chevronSingleUp", "arrowStart", "chevronLimitLeft", "arrowEnd", "chevronLimitRight", "article", "asterisk", "at", "archive", "axisX", "axisYLeft", "axisYRight", "auditbeatApp", "backgroundTask", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "briefcase", "branchUser", "broom", "brush", "bug", "bulb", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "chartChangePoint", "chartArea", "chartAreaStack", "chartBarHorizontal", "chartBarHorizontalStack", "chartBarVertical", "chartBarVerticalStack", "chartGauge", "chartHeatmap", "chartLine", "chartPie", "chartTagCloud", "chartThreshold", "check", "checkCircle", "checkInCircleFilled", "checkCircleFill", "cheer", "popper", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "clockControl", "cloud", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "paintBucket", "commandLine", "comment", "compare", "compute", "processor", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "contrastFill", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "crossProjectSearch", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crossCircle", "crosshair", "crosshairs", "currency", "money", "cut", "scissors", "dashboardApp", "dashedCircle", "dataVisualizer", "database", "desktop", "display", "devToolsApp", "diff", "discoverApp", "distributeHorizontal", "distributeVertical", "download", "drag", "dragHorizontal", "dragVertical", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "chevronDoubleLeft", "doubleArrowRight", "chevronDoubleRight", "ellipsis", "editorAlignCenter", "textAlignCenter", "editorAlignLeft", "textAlignLeft", "editorAlignRight", "textAlignRight", "editorBold", "textBold", "editorChecklist", "listCheck", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "textHeading", "editorItalic", "textItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "listNumber", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "redo", "editorStrike", "textStrike", "editorTable", "table", "editorUnderline", "textUnderline", "editorUndo", "undo", "editorUnorderedList", "listBullet", "email", "mail", "empty", "emsApp", "endpoint", "eql", "query", "eraser", "error", "errorFilled", "errorFill", "esqlVis", "exit", "logOut", "expand", "maximize", "expandMini", "export", "exportAction", "upload", "external", "eye", "eyeClosed", "eyeSlash", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "tableInfo", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folder", "folderClosed", "folderClose", "folderCheck", "folderExclamation", "folderOpen", "folderOpened", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "hourglass", "if", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "mapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "tableTime", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "queryField", "kqlFunction", "kqlOperand", "queryOperand", "kqlSelector", "querySelector", "kqlValue", "queryValue", "kubernetesNode", "kubernetesPod", "launch", "rocket", "layers", "lensApp", "lettering", "text", "lineBreak", "lineBreakSlash", "lineDash", "lineDashed", "lineDot", "lineDotted", "lineSolid", "link", "linkSlash", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "pattern", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "queue", "machineLearningApp", "magnet", "magnify", "magnifyExclamation", "magnifyMinus", "magnifyPlus", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "map", "mapMarker", "waypoint", "megaphone", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusCircle", "minusInCircle", "minusInCircleFilled", "minusInSquare", "minusSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "vectorTriangle", "notebookApp", "number", "offline", "wifiSlash", "online", "wifi", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFill", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusCircle", "plusInCircle", "plusInCircleFilled", "plusInSquare", "plusSquare", "popout", "presentation", "productRobot", "productAgent", "productCloudInfra", "productDashboard", "productDiscover", "productML", "productStreamsClassic", "productStreamsWired", "push", "send", "question", "quote", "radar", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "return", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "server", "sessionViewer", "shard", "share", "significantEvents", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "star", "starEmpty", "starEmptySpace", "starFill", "starFilled", "starFillSpace", "starFilledSpace", "starMinusEmpty", "starMinusFill", "starMinusFilled", "starPlusEmpty", "starPlusFill", "starPlusFilled", "stats", "stop", "stopFill", "stopFilled", "stopSlash", "storage", "streamsClassic", "streamsWired", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityHigh", "tableDensityExpanded", "tableDensityLow", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "thermometer", "thumbDown", "thumbUp", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "refreshTime", "timeslider", "training", "transitionBottomIn", "transitionBottomOut", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "unarchive", "vector", "vectorSquare", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "chartMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "warningFill", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workflowsApp", "workflow", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
291
334
  onClose: _propTypes.default.func,
335
+ /**
336
+ * Duration in milliseconds that drives a countdown animation on the toast's decor bar.
337
+ * When not set the bar is static at full width.
338
+ */
339
+ animationMs: _propTypes.default.number,
340
+ /**
341
+ * Props for primary and secondary actions within the toast.
342
+ */
343
+ actionProps: _propTypes.default.shape({
344
+ primary: _propTypes.default.any,
345
+ secondary: _propTypes.default.shape({
346
+ href: _propTypes.default.string,
347
+ onClick: _propTypes.default.func,
348
+ /**
349
+ * Force disables the button and changes the icon to a loading spinner
350
+ */
351
+ /**
352
+ * Force disables the button and changes the icon to a loading spinner
353
+ */
354
+ isLoading: _propTypes.default.bool,
355
+ target: _propTypes.default.string,
356
+ rel: _propTypes.default.string,
357
+ type: _propTypes.default.any,
358
+ buttonRef: _propTypes.default.any,
359
+ /**
360
+ * Object of props passed to the `<span>` wrapping the button's content
361
+ */
362
+ /**
363
+ * Object of props passed to the `<span>` wrapping the button's content
364
+ */
365
+ contentProps: _propTypes.default.shape({
366
+ className: _propTypes.default.string,
367
+ "aria-label": _propTypes.default.string,
368
+ "data-test-subj": _propTypes.default.string,
369
+ css: _propTypes.default.any
370
+ }),
371
+ /**
372
+ * Any `type` accepted by EuiIcon
373
+ */
374
+ iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "addToDashboard", "advancedSettingsApp", "agentApp", "aggregate", "alignBottom", "alignBottomLeft", "alignBottomRight", "alignCenterHorizontal", "alignCenterVertical", "alignLeft", "alignRight", "alignTop", "alignTopLeft", "alignTopRight", "alert", "analyzeEvent", "annotation", "anomalyChart", "chartAnomaly", "anomalySwimLane", "apmApp", "apmTrace", "chartWaterfall", "appSearchApp", "apps", "arrowDown", "chevronSingleDown", "arrowLeft", "chevronSingleLeft", "arrowRight", "chevronSingleRight", "arrowUp", "chevronSingleUp", "arrowStart", "chevronLimitLeft", "arrowEnd", "chevronLimitRight", "article", "asterisk", "at", "archive", "axisX", "axisYLeft", "axisYRight", "auditbeatApp", "backgroundTask", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "briefcase", "branchUser", "broom", "brush", "bug", "bulb", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "chartChangePoint", "chartArea", "chartAreaStack", "chartBarHorizontal", "chartBarHorizontalStack", "chartBarVertical", "chartBarVerticalStack", "chartGauge", "chartHeatmap", "chartLine", "chartPie", "chartTagCloud", "chartThreshold", "check", "checkCircle", "checkInCircleFilled", "checkCircleFill", "cheer", "popper", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "clockControl", "cloud", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "paintBucket", "commandLine", "comment", "compare", "compute", "processor", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "contrastFill", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "crossProjectSearch", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crossCircle", "crosshair", "crosshairs", "currency", "money", "cut", "scissors", "dashboardApp", "dashedCircle", "dataVisualizer", "database", "desktop", "display", "devToolsApp", "diff", "discoverApp", "distributeHorizontal", "distributeVertical", "download", "drag", "dragHorizontal", "dragVertical", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "chevronDoubleLeft", "doubleArrowRight", "chevronDoubleRight", "ellipsis", "editorAlignCenter", "textAlignCenter", "editorAlignLeft", "textAlignLeft", "editorAlignRight", "textAlignRight", "editorBold", "textBold", "editorChecklist", "listCheck", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "textHeading", "editorItalic", "textItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "listNumber", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "redo", "editorStrike", "textStrike", "editorTable", "table", "editorUnderline", "textUnderline", "editorUndo", "undo", "editorUnorderedList", "listBullet", "email", "mail", "empty", "emsApp", "endpoint", "eql", "query", "eraser", "error", "errorFilled", "errorFill", "esqlVis", "exit", "logOut", "expand", "maximize", "expandMini", "export", "exportAction", "upload", "external", "eye", "eyeClosed", "eyeSlash", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "tableInfo", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folder", "folderClosed", "folderClose", "folderCheck", "folderExclamation", "folderOpen", "folderOpened", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "hourglass", "if", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "mapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "tableTime", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "queryField", "kqlFunction", "kqlOperand", "queryOperand", "kqlSelector", "querySelector", "kqlValue", "queryValue", "kubernetesNode", "kubernetesPod", "launch", "rocket", "layers", "lensApp", "lettering", "text", "lineBreak", "lineBreakSlash", "lineDash", "lineDashed", "lineDot", "lineDotted", "lineSolid", "link", "linkSlash", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "pattern", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "queue", "machineLearningApp", "magnet", "magnify", "magnifyExclamation", "magnifyMinus", "magnifyPlus", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "map", "mapMarker", "waypoint", "megaphone", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusCircle", "minusInCircle", "minusInCircleFilled", "minusInSquare", "minusSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "vectorTriangle", "notebookApp", "number", "offline", "wifiSlash", "online", "wifi", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFill", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusCircle", "plusInCircle", "plusInCircleFilled", "plusInSquare", "plusSquare", "popout", "presentation", "productRobot", "productAgent", "productCloudInfra", "productDashboard", "productDiscover", "productML", "productStreamsClassic", "productStreamsWired", "push", "send", "question", "quote", "radar", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "return", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "server", "sessionViewer", "shard", "share", "significantEvents", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "star", "starEmpty", "starEmptySpace", "starFill", "starFilled", "starFillSpace", "starFilledSpace", "starMinusEmpty", "starMinusFill", "starMinusFilled", "starPlusEmpty", "starPlusFill", "starPlusFilled", "stats", "stop", "stopFill", "stopFilled", "stopSlash", "storage", "streamsClassic", "streamsWired", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityHigh", "tableDensityExpanded", "tableDensityLow", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "thermometer", "thumbDown", "thumbUp", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "refreshTime", "timeslider", "training", "transitionBottomIn", "transitionBottomOut", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "unarchive", "vector", "vectorSquare", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "chartMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "warningFill", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workflowsApp", "workflow", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
375
+ /**
376
+ * Can only be one side `left` or `right`
377
+ */
378
+ iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
379
+ /**
380
+ * Object of props passed to the `<span>` wrapping the content's text/children only (not icon)
381
+ *
382
+ * This span wrapper can be removed by passing `textProps={false}`.
383
+ */
384
+ textProps: _propTypes.default.oneOfType([_propTypes.default.shape({
385
+ className: _propTypes.default.string,
386
+ "aria-label": _propTypes.default.string,
387
+ "data-test-subj": _propTypes.default.string,
388
+ css: _propTypes.default.any,
389
+ ref: _propTypes.default.any,
390
+ "data-text": _propTypes.default.string
391
+ }).isRequired, _propTypes.default.oneOf([false])]),
392
+ iconSize: _propTypes.default.any,
393
+ /**
394
+ * Controls the disabled behavior via the native `disabled` attribute.
395
+ */
396
+ isDisabled: _propTypes.default.bool,
397
+ className: _propTypes.default.string,
398
+ "aria-label": _propTypes.default.string,
399
+ "data-test-subj": _propTypes.default.string,
400
+ css: _propTypes.default.any,
401
+ /**
402
+ * NOTE: Beta feature, may be changed or removed in the future
403
+ *
404
+ * Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
405
+ * This results in a semantically disabled button without the default browser handling of the disabled state.
406
+ *
407
+ * Use e.g. when a disabled button should have a tooltip.
408
+ */
409
+ hasAriaDisabled: _propTypes.default.bool
410
+ })
411
+ }),
292
412
  className: _propTypes.default.string,
293
413
  "aria-label": _propTypes.default.string,
294
414
  "data-test-subj": _propTypes.default.string,
@@ -321,6 +441,12 @@ EuiGlobalToastList.propTypes = {
321
441
  * @default log
322
442
  */
323
443
  role: _propTypes.default.any,
444
+ /**
445
+ * Renders a notification badge indicating the amount of toasts in the list.
446
+ *
447
+ * @default false
448
+ */
449
+ showNotificationBadge: _propTypes.default.bool,
324
450
  className: _propTypes.default.string,
325
451
  "aria-label": _propTypes.default.string,
326
452
  "data-test-subj": _propTypes.default.string,
@@ -8,33 +8,56 @@ exports.euiGlobalToastListStyles = exports.euiGlobalToastListItemStyles = void 0
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _global_styling = require("../../global_styling");
11
- var _templateObject;
12
- /*
11
+ var _templateObject, _templateObject2;
12
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /*
13
13
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
14
14
  * or more contributor license agreements. Licensed under the Elastic License
15
15
  * 2.0 and the Server Side Public License, v 1; you may not use this file except
16
16
  * in compliance with, at your election, the Elastic License 2.0 or the Server
17
17
  * Side Public License, v 1.
18
18
  */
19
+ var _ref = process.env.NODE_ENV === "production" ? {
20
+ name: "ox3d1t-hasFadeOut",
21
+ styles: "opacity:0;label:hasFadeOut;"
22
+ } : {
23
+ name: "ox3d1t-hasFadeOut",
24
+ styles: "opacity:0;label:hasFadeOut;",
25
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
26
+ };
27
+ var _ref2 = process.env.NODE_ENV === "production" ? {
28
+ name: "19mjubd-content",
29
+ styles: "position:relative;label:content;"
30
+ } : {
31
+ name: "19mjubd-content",
32
+ styles: "position:relative;label:content;",
33
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
34
+ };
19
35
  var euiGlobalToastListStyles = exports.euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
20
36
  var euiTheme = euiThemeContext.euiTheme;
21
- var euiToastWidth = euiTheme.base * 25;
37
+ var euiToastWidth = euiTheme.base * 27.5; // 440px -> results in 360px toast width
38
+
39
+ var showNotificationBadge = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n from { opacity: 0; }\n to { opacity: 1; }\n "])));
22
40
  return {
23
41
  /**
24
42
  * 1. Allow list to expand as items are added, but cap it at the screen height.
25
43
  * 2. Allow some padding for shadow
26
44
  */
27
45
  // Base
28
- euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth, "px")), (0, _global_styling.logicalCSS)('max-height', '100vh'), (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
46
+ euiGlobalToastList: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiScrollBarStyles)(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", (0, _global_styling.logicalCSS)('bottom', 0), " ", (0, _global_styling.logicalCSS)('width', "".concat(euiToastWidth, "px")), (0, _global_styling.logicalCSS)('max-height', '100vh'), (0, _global_styling.logicalCSSWithFallback)('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", (0, _global_styling.logicalSizeCSS)(0, 0), ";}&:hover .euiToastDecor::before,&:focus-within .euiToastDecor::before{animation-play-state:paused;}&:not(:empty){", (0, _global_styling.logicalCSS)('padding-left', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-vertical', euiTheme.size.base), ";}", (0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), " ", (0, _global_styling.logicalCSS)('width', '100%'), ";}};label:euiGlobalToastList;"),
47
+ content: _ref2,
48
+ notificationBadge: {
49
+ notificationBadge: /*#__PURE__*/(0, _react.css)("position:absolute;inset-block-start:-", euiTheme.size.s, ";inset-inline-start:-", euiTheme.size.s, ";z-index:", Number(euiTheme.levels.content) + 1, ";", _global_styling.euiCanAnimate, "{animation:", euiTheme.animation.normal, " ", showNotificationBadge, " ", euiTheme.animation.resistance, ";transition:opacity ", euiTheme.animation.fast, ";};label:notificationBadge;"),
50
+ hasFadeOut: _ref
51
+ },
29
52
  // Variants
30
53
  right: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('right', 0), ";", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('padding-left', "".concat(euiTheme.base * 4, "px")), ";}};label:right;"),
31
54
  left: /*#__PURE__*/(0, _react.css)("&:not(:empty){", (0, _global_styling.logicalCSS)('left', 0), ";", (0, _global_styling.euiMinBreakpoint)(euiThemeContext, 'm'), "{", (0, _global_styling.logicalCSS)('padding-right', "".concat(euiTheme.base * 4, "px")), ";}};label:left;"),
32
55
  euiGlobalToastListDismissButton: /*#__PURE__*/(0, _react.css)("position:sticky;", (0, _global_styling.logicalCSS)('bottom', '0%'), ";;label:euiGlobalToastListDismissButton;")
33
56
  };
34
57
  };
35
- var euiGlobalToastListItemStyles = exports.euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref) {
36
- var euiTheme = _ref.euiTheme;
37
- var euiShowToast = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n from {\n transform: translateY(", ") scale(.9);\n opacity: 0;\n }\n\n to {\n transform: translateY(0) scale(1);\n opacity: 1;\n }\n"])), euiTheme.size.l);
58
+ var euiGlobalToastListItemStyles = exports.euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref3) {
59
+ var euiTheme = _ref3.euiTheme;
60
+ var euiShowToast = (0, _react.keyframes)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n from {\n transform: translateY(", ") scale(.9);\n opacity: 0;\n }\n\n to {\n transform: translateY(0) scale(1);\n opacity: 1;\n }\n"])), euiTheme.size.l);
38
61
  return {
39
62
  // Base
40
63
  euiGlobalToastListItem: /*#__PURE__*/(0, _react.css)("flex-shrink:0;", (0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.base), " animation:", euiTheme.animation.normal, " ", euiShowToast, " ", euiTheme.animation.resistance, ";opacity:1;&:first-child{", (0, _global_styling.logicalCSS)('margin-top', 'auto'), ";}&:last-child{", (0, _global_styling.logicalCSS)('margin-bottom', 0), ";};label:euiGlobalToastListItem;"),