@elastic/eui 91.3.1 → 92.0.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 (160) hide show
  1. package/dist/eui_charts_theme.js.map +1 -1
  2. package/dist/eui_theme_dark.css +0 -513
  3. package/dist/eui_theme_dark.min.css +1 -1
  4. package/dist/eui_theme_light.css +0 -513
  5. package/dist/eui_theme_light.min.css +1 -1
  6. package/es/components/basic_table/basic_table.js +5 -5
  7. package/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  8. package/es/components/filter_group/filter_button.js +20 -13
  9. package/es/components/filter_group/filter_button.styles.js +11 -20
  10. package/es/components/flyout/flyout.js +4 -4
  11. package/es/components/flyout/flyout_resizable.js +127 -0
  12. package/es/components/flyout/flyout_resizable.styles.js +27 -0
  13. package/es/components/flyout/index.js +2 -1
  14. package/es/components/form/range/dual_range.js +15 -66
  15. package/es/components/form/range/range.js +6 -5
  16. package/es/components/form/range/range_slider.js +28 -22
  17. package/es/components/form/text_area/text_area.js +39 -3
  18. package/es/components/index.js +0 -2
  19. package/es/components/markdown_editor/markdown_editor.js +12 -13
  20. package/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  21. package/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  22. package/es/components/selectable/selectable_templates/selectable_template_sitewide.js +5 -0
  23. package/es/components/tree_view/tree_view.js +23 -25
  24. package/es/utils/prop_types/is.js +2 -2
  25. package/eui.d.ts +825 -1141
  26. package/i18ntokens.json +68 -338
  27. package/lib/components/basic_table/basic_table.js +5 -5
  28. package/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  29. package/lib/components/filter_group/filter_button.js +20 -13
  30. package/lib/components/filter_group/filter_button.styles.js +11 -20
  31. package/lib/components/flyout/flyout.js +4 -4
  32. package/lib/components/flyout/flyout_resizable.js +136 -0
  33. package/lib/components/flyout/flyout_resizable.styles.js +32 -0
  34. package/lib/components/flyout/index.js +8 -1
  35. package/lib/components/form/range/dual_range.js +15 -66
  36. package/lib/components/form/range/range.js +6 -5
  37. package/lib/components/form/range/range_slider.js +27 -21
  38. package/lib/components/form/text_area/text_area.js +42 -3
  39. package/lib/components/index.js +0 -22
  40. package/lib/components/markdown_editor/markdown_editor.js +12 -13
  41. package/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  42. package/lib/components/pagination/pagination_button.js +79 -2
  43. package/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  44. package/lib/components/tree_view/tree_view.js +23 -25
  45. package/lib/utils/prop_types/is.js +2 -2
  46. package/optimize/es/components/basic_table/basic_table.js +5 -5
  47. package/optimize/es/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  48. package/optimize/es/components/filter_group/filter_button.js +20 -13
  49. package/optimize/es/components/filter_group/filter_button.styles.js +11 -20
  50. package/optimize/es/components/flyout/flyout.js +4 -4
  51. package/optimize/es/components/flyout/flyout_resizable.js +121 -0
  52. package/optimize/es/components/flyout/flyout_resizable.styles.js +27 -0
  53. package/optimize/es/components/flyout/index.js +2 -1
  54. package/optimize/es/components/form/range/dual_range.js +15 -66
  55. package/optimize/es/components/form/range/range.js +6 -5
  56. package/optimize/es/components/form/range/range_slider.js +26 -21
  57. package/optimize/es/components/form/text_area/text_area.js +29 -3
  58. package/optimize/es/components/index.js +0 -2
  59. package/optimize/es/components/markdown_editor/markdown_editor.js +12 -13
  60. package/optimize/es/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  61. package/optimize/es/components/selectable/selectable_list/selectable_list_item.js +1 -1
  62. package/optimize/es/components/tree_view/tree_view.js +23 -25
  63. package/optimize/es/utils/prop_types/is.js +2 -2
  64. package/optimize/lib/components/basic_table/basic_table.js +5 -5
  65. package/optimize/lib/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  66. package/optimize/lib/components/filter_group/filter_button.js +20 -13
  67. package/optimize/lib/components/filter_group/filter_button.styles.js +11 -20
  68. package/optimize/lib/components/flyout/flyout.js +4 -4
  69. package/optimize/lib/components/flyout/flyout_resizable.js +131 -0
  70. package/optimize/lib/components/flyout/flyout_resizable.styles.js +32 -0
  71. package/optimize/lib/components/flyout/index.js +8 -1
  72. package/optimize/lib/components/form/range/dual_range.js +15 -66
  73. package/optimize/lib/components/form/range/range.js +6 -5
  74. package/optimize/lib/components/form/range/range_slider.js +26 -21
  75. package/optimize/lib/components/form/text_area/text_area.js +32 -3
  76. package/optimize/lib/components/index.js +0 -22
  77. package/optimize/lib/components/markdown_editor/markdown_editor.js +12 -13
  78. package/optimize/lib/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  79. package/optimize/lib/components/selectable/selectable_list/selectable_list_item.js +1 -1
  80. package/optimize/lib/components/tree_view/tree_view.js +23 -25
  81. package/optimize/lib/utils/prop_types/is.js +2 -2
  82. package/package.json +2 -2
  83. package/src/components/index.scss +0 -2
  84. package/test-env/components/basic_table/basic_table.js +5 -5
  85. package/test-env/components/drag_and_drop/drag_and_drop.a11y.js +1 -1
  86. package/test-env/components/filter_group/filter_button.js +20 -13
  87. package/test-env/components/filter_group/filter_button.styles.js +11 -20
  88. package/test-env/components/flyout/flyout_resizable.js +131 -0
  89. package/test-env/components/flyout/flyout_resizable.styles.js +32 -0
  90. package/test-env/components/flyout/index.js +8 -1
  91. package/test-env/components/form/range/dual_range.js +15 -66
  92. package/test-env/components/form/range/range.js +6 -5
  93. package/test-env/components/form/range/range_slider.js +27 -21
  94. package/test-env/components/form/text_area/text_area.js +42 -3
  95. package/test-env/components/index.js +0 -22
  96. package/test-env/components/markdown_editor/markdown_editor.js +12 -13
  97. package/test-env/components/page_template/bottom_bar/page_bottom_bar.js +1 -1
  98. package/test-env/components/pagination/pagination_button.js +79 -2
  99. package/test-env/components/selectable/selectable_list/selectable_list_item.js +1 -1
  100. package/test-env/components/tree_view/tree_view.js +23 -25
  101. package/test-env/utils/prop_types/is.js +2 -2
  102. package/es/components/control_bar/control_bar.a11y.js +0 -133
  103. package/es/components/control_bar/control_bar.js +0 -609
  104. package/es/components/control_bar/index.js +0 -9
  105. package/es/components/notification/index.js +0 -9
  106. package/es/components/notification/notification_event.a11y.js +0 -104
  107. package/es/components/notification/notification_event.js +0 -288
  108. package/es/components/notification/notification_event_messages.js +0 -79
  109. package/es/components/notification/notification_event_meta.js +0 -148
  110. package/es/components/notification/notification_event_read_button.js +0 -86
  111. package/es/components/notification/notification_event_read_icon.js +0 -77
  112. package/lib/components/control_bar/control_bar.a11y.js +0 -134
  113. package/lib/components/control_bar/control_bar.js +0 -441
  114. package/lib/components/control_bar/index.js +0 -12
  115. package/lib/components/notification/index.js +0 -12
  116. package/lib/components/notification/notification_event.a11y.js +0 -105
  117. package/lib/components/notification/notification_event.js +0 -297
  118. package/lib/components/notification/notification_event_messages.js +0 -88
  119. package/lib/components/notification/notification_event_meta.js +0 -157
  120. package/lib/components/notification/notification_event_read_button.js +0 -93
  121. package/lib/components/notification/notification_event_read_icon.js +0 -64
  122. package/optimize/es/components/control_bar/control_bar.a11y.js +0 -128
  123. package/optimize/es/components/control_bar/control_bar.js +0 -308
  124. package/optimize/es/components/control_bar/index.js +0 -9
  125. package/optimize/es/components/notification/index.js +0 -9
  126. package/optimize/es/components/notification/notification_event.a11y.js +0 -99
  127. package/optimize/es/components/notification/notification_event.js +0 -114
  128. package/optimize/es/components/notification/notification_event_messages.js +0 -63
  129. package/optimize/es/components/notification/notification_event_meta.js +0 -106
  130. package/optimize/es/components/notification/notification_event_read_button.js +0 -44
  131. package/optimize/es/components/notification/notification_event_read_icon.js +0 -44
  132. package/optimize/lib/components/control_bar/control_bar.a11y.js +0 -134
  133. package/optimize/lib/components/control_bar/control_bar.js +0 -301
  134. package/optimize/lib/components/control_bar/index.js +0 -12
  135. package/optimize/lib/components/notification/index.js +0 -12
  136. package/optimize/lib/components/notification/notification_event.a11y.js +0 -105
  137. package/optimize/lib/components/notification/notification_event.js +0 -123
  138. package/optimize/lib/components/notification/notification_event_messages.js +0 -74
  139. package/optimize/lib/components/notification/notification_event_meta.js +0 -117
  140. package/optimize/lib/components/notification/notification_event_read_button.js +0 -51
  141. package/optimize/lib/components/notification/notification_event_read_icon.js +0 -51
  142. package/src/components/control_bar/_control_bar.scss +0 -232
  143. package/src/components/control_bar/_index.scss +0 -2
  144. package/src/components/control_bar/_variables.scss +0 -12
  145. package/src/components/notification/_index.scss +0 -5
  146. package/src/components/notification/_notification_event.scss +0 -40
  147. package/src/components/notification/_notification_event_messages.scss +0 -17
  148. package/src/components/notification/_notification_event_meta.scss +0 -44
  149. package/src/components/notification/_notification_event_read_button.scss +0 -5
  150. package/src/components/notification/_notification_event_read_icon.scss +0 -12
  151. package/test-env/components/control_bar/control_bar.a11y.js +0 -134
  152. package/test-env/components/control_bar/control_bar.js +0 -436
  153. package/test-env/components/control_bar/index.js +0 -12
  154. package/test-env/components/notification/index.js +0 -12
  155. package/test-env/components/notification/notification_event.a11y.js +0 -105
  156. package/test-env/components/notification/notification_event.js +0 -296
  157. package/test-env/components/notification/notification_event_messages.js +0 -85
  158. package/test-env/components/notification/notification_event_meta.js +0 -154
  159. package/test-env/components/notification/notification_event_read_button.js +0 -92
  160. package/test-env/components/notification/notification_event_read_icon.js +0 -63
@@ -1,104 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- 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."); }
3
- 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); }
4
- 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; }
5
- 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; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
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
- /// <reference types="cypress" />
16
- /// <reference types="cypress-real-events" />
17
- /// <reference types="../../../cypress/support" />
18
-
19
- import React, { useState } from 'react';
20
- import { EuiContextMenuItem } from '../context_menu';
21
- import { EuiNotificationEvent } from './notification_event';
22
- import { EuiPanel } from '../panel';
23
- import { jsx as ___EmotionJSX } from "@emotion/react";
24
- var NotificationEvent = function NotificationEvent() {
25
- var _useState = useState(false),
26
- _useState2 = _slicedToArray(_useState, 2),
27
- isRead = _useState2[0],
28
- setIsRead = _useState2[1];
29
- var onRead = function onRead(id, isRead) {
30
- setIsRead(!isRead);
31
- };
32
- var onOpenContextMenu = function onOpenContextMenu(id) {
33
- return [___EmotionJSX(EuiContextMenuItem, {
34
- key: "contextMenuItemA",
35
- onClick: function onClick() {
36
- return onRead(id, isRead);
37
- }
38
- }, isRead ? 'Mark as unread' : 'Mark as read'), ___EmotionJSX(EuiContextMenuItem, {
39
- key: "contextMenuItemB",
40
- onClick: function onClick() {}
41
- }, "View messages like this"), ___EmotionJSX(EuiContextMenuItem, {
42
- key: "contextMenuItemC",
43
- onClick: function onClick() {}
44
- }, "Don\u2019t notify me about this")];
45
- };
46
- return ___EmotionJSX(EuiPanel, {
47
- paddingSize: "none",
48
- hasShadow: true,
49
- style: {
50
- maxWidth: '540px'
51
- }
52
- }, ___EmotionJSX(EuiNotificationEvent, {
53
- id: "cy-eui-notification-1",
54
- type: "Report",
55
- iconType: "logoKibana",
56
- iconAriaLabel: "Kibana",
57
- time: "1 min ago",
58
- title: "[Error Monitoring Report] is generated",
59
- primaryAction: "Download",
60
- primaryActionProps: {
61
- iconType: 'download'
62
- },
63
- messages: ['The reported was generated at 17:12:16 GMT+4'],
64
- isRead: isRead,
65
- onRead: onRead,
66
- onOpenContextMenu: onOpenContextMenu,
67
- onClickPrimaryAction: function onClickPrimaryAction() {},
68
- onClickTitle: function onClickTitle() {}
69
- }));
70
- };
71
- describe('EuiNotificationEvent', function () {
72
- beforeEach(function () {
73
- cy.viewport(1024, 768); // medium breakpoint
74
- cy.realMount(___EmotionJSX(NotificationEvent, null));
75
- cy.get('article.euiNotificationEvent').should('exist');
76
- });
77
- describe('Automated accessibility check', function () {
78
- it('has zero violations on first render', function () {
79
- cy.checkAxe();
80
- });
81
- it('has zero violations when popover is open', function () {
82
- cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').realClick();
83
- cy.get('div.euiPopover__panel').should('exist');
84
- cy.checkAxe();
85
- });
86
- it('has zero violations after the Mark as read button is clicked', function () {
87
- cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').realClick();
88
- cy.get('div.euiPopover__panel').should('exist');
89
- cy.get('div.euiPopover__panel button').first().realClick();
90
- cy.checkAxe();
91
- });
92
- });
93
- describe('Keyboard accessibility', function () {
94
- it('has zero violations when the popover is opened by keyboard', function () {
95
- cy.get('button[data-test-subj="cy-eui-notification-1-notificationEventMetaButton"]').focus();
96
- cy.realPress('Enter');
97
- cy.get('div.euiPopover__panel').should('exist');
98
- cy.checkAxe();
99
- cy.realPress('Escape');
100
- cy.get('div.euiPopover__panel').should('not.exist');
101
- cy.checkAxe();
102
- });
103
- });
104
- });
@@ -1,288 +0,0 @@
1
- var _excluded = ["id", "type", "severity", "badgeColor", "iconType", "iconAriaLabel", "time", "title", "isRead", "primaryAction", "primaryActionProps", "messages", "onRead", "onOpenContextMenu", "onClickTitle", "onClickPrimaryAction", "headingLevel", "className"];
2
- 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); }
3
- 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; }
4
- 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; }
5
- /*
6
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
7
- * or more contributor license agreements. Licensed under the Elastic License
8
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
9
- * in compliance with, at your election, the Elastic License 2.0 or the Server
10
- * Side Public License, v 1.
11
- */
12
-
13
- import React, { createElement } from 'react';
14
- import PropTypes from "prop-types";
15
- import classNames from 'classnames';
16
- import { EuiNotificationEventMeta } from './notification_event_meta';
17
- import { EuiNotificationEventMessages } from './notification_event_messages';
18
- import { EuiNotificationEventReadButton } from './notification_event_read_button';
19
- import { EuiButtonEmpty } from '../button';
20
- import { EuiLink } from '../link';
21
- import { useGeneratedHtmlId } from '../../services';
22
- import { EuiNotificationEventReadIcon } from './notification_event_read_icon';
23
-
24
- /**
25
- * @deprecated
26
- */
27
- import { jsx as ___EmotionJSX } from "@emotion/react";
28
- /**
29
- * @deprecated - EuiNotificationEvent is scheduled for deprecation due to low internal usage and high
30
- * maintenance requirements. If necessary, we recommend copying this component into your own application.
31
- *
32
- * The component will be permanently removed in December 2023.
33
- */
34
- export var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
35
- var id = _ref.id,
36
- type = _ref.type,
37
- severity = _ref.severity,
38
- badgeColor = _ref.badgeColor,
39
- iconType = _ref.iconType,
40
- iconAriaLabel = _ref.iconAriaLabel,
41
- time = _ref.time,
42
- title = _ref.title,
43
- isRead = _ref.isRead,
44
- primaryAction = _ref.primaryAction,
45
- primaryActionProps = _ref.primaryActionProps,
46
- messages = _ref.messages,
47
- onRead = _ref.onRead,
48
- onOpenContextMenu = _ref.onOpenContextMenu,
49
- onClickTitle = _ref.onClickTitle,
50
- onClickPrimaryAction = _ref.onClickPrimaryAction,
51
- _ref$headingLevel = _ref.headingLevel,
52
- headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
53
- className = _ref.className,
54
- rest = _objectWithoutProperties(_ref, _excluded);
55
- var classes = classNames('euiNotificationEvent', {
56
- 'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
57
- }, className);
58
- var classesTitle = classNames('euiNotificationEvent__title', {
59
- 'euiNotificationEvent__title--isRead': isRead
60
- });
61
- var randomHeadingId = useGeneratedHtmlId();
62
- var titleProps = {
63
- id: randomHeadingId,
64
- className: classesTitle,
65
- 'data-test-subj': "".concat(id, "-notificationEventTitle")
66
- };
67
- return ___EmotionJSX("article", _extends({
68
- "aria-labelledby": randomHeadingId,
69
- className: classes,
70
- key: id
71
- }, rest), typeof isRead === 'boolean' && ___EmotionJSX("div", {
72
- className: "euiNotificationEvent__readButton"
73
- }, !!onRead ? ___EmotionJSX(EuiNotificationEventReadButton, {
74
- isRead: isRead,
75
- onClick: function onClick() {
76
- return onRead(id, isRead);
77
- },
78
- eventName: title,
79
- id: id
80
- }) : ___EmotionJSX(EuiNotificationEventReadIcon, {
81
- id: id,
82
- isRead: isRead,
83
- eventName: title
84
- })), ___EmotionJSX("div", {
85
- className: "euiNotificationEvent__content"
86
- }, ___EmotionJSX(EuiNotificationEventMeta, {
87
- id: id,
88
- type: type,
89
- severity: severity,
90
- badgeColor: badgeColor,
91
- iconType: iconType,
92
- iconAriaLabel: iconAriaLabel,
93
- time: time,
94
- onOpenContextMenu: onOpenContextMenu ? function () {
95
- return onOpenContextMenu(id);
96
- } : undefined,
97
- eventName: title
98
- }), onClickTitle ? ___EmotionJSX(EuiLink, _extends({
99
- onClick: function onClick() {
100
- return onClickTitle(id);
101
- }
102
- }, titleProps), /*#__PURE__*/createElement(headingLevel, null, title)) : /*#__PURE__*/createElement(headingLevel, titleProps, title), ___EmotionJSX(EuiNotificationEventMessages, {
103
- messages: messages,
104
- eventName: title
105
- }), onClickPrimaryAction && primaryAction && ___EmotionJSX("div", {
106
- className: "euiNotificationEvent__primaryAction"
107
- }, ___EmotionJSX(EuiButtonEmpty, _extends({
108
- flush: "left",
109
- size: "s"
110
- }, primaryActionProps, {
111
- onClick: function onClick() {
112
- return onClickPrimaryAction === null || onClickPrimaryAction === void 0 ? void 0 : onClickPrimaryAction(id);
113
- },
114
- "data-test-subj": "".concat(id, "-notificationEventPrimaryAction")
115
- }), primaryAction))));
116
- };
117
- EuiNotificationEvent.propTypes = {
118
- /**
119
- * Type of event (e.g. "Alert", "Cloud", etc..). Shows inside a badge.
120
- */
121
- type: PropTypes.string.isRequired,
122
- /**
123
- * Type of severity (e.g. "Critical", "Warning", etc..). Shows as a text after the `type` following the format "Alert: Critical".
124
- */
125
- severity: PropTypes.string,
126
- /**
127
- * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
128
- */
129
- badgeColor: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.string.isRequired]),
130
- /**
131
- * The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
132
- */
133
- iconType: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "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", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "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", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
134
- /**
135
- * Specify an `aria-label` for the icon.
136
- * If no `aria-label` is passed we assume the icon is purely decorative.
137
- */
138
- iconAriaLabel: PropTypes.string,
139
- /**
140
- * Indicates when the event was received.
141
- */
142
- time: PropTypes.node.isRequired,
143
- "aria-label": PropTypes.string,
144
- "aria-labelledby": PropTypes.string,
145
- /**
146
- * Size of the icon only.
147
- * This will not affect the overall size of the button
148
- */
149
- iconSize: PropTypes.any,
150
- /**
151
- * Sets the display style for matching other EuiButton types.
152
- * `base` is equivalent to a typical EuiButton
153
- * `fill` is equivalent to a filled EuiButton
154
- * `empty` (default) is equivalent to an EuiButtonEmpty
155
- */
156
- display: PropTypes.any,
157
- /**
158
- * Disables the button and changes the icon to a loading spinner
159
- */
160
- isLoading: PropTypes.bool,
161
- className: PropTypes.string,
162
- "data-test-subj": PropTypes.string,
163
- css: PropTypes.any,
164
- /**
165
- * A unique identifier
166
- */
167
- id: PropTypes.string.isRequired,
168
- /**
169
- * The title of the event.
170
- */
171
- title: PropTypes.string.isRequired,
172
- /**
173
- * The heading level of the title.
174
- */
175
- headingLevel: PropTypes.oneOf(["h2", "h3", "h4", "h5", "h6"]),
176
- /**
177
- * Returns the `id` and applies an `onClick` handler to the title.
178
- */
179
- onClickTitle: PropTypes.func,
180
- /**
181
- * The label of the primary action
182
- */
183
- primaryAction: PropTypes.string,
184
- /**
185
- * Apply more props to the `primaryAction` button. See #EuiPrimaryActionProps.
186
- */
187
- primaryActionProps: PropTypes.shape({
188
- href: PropTypes.string,
189
- onClick: PropTypes.func,
190
- /**
191
- * Any of the named color palette options.
192
- */
193
- color: PropTypes.any,
194
- size: PropTypes.any,
195
- /**
196
- * Ensure the text of the button sits flush to the left, right, or both sides of its container
197
- */
198
- /**
199
- * Ensure the text of the button sits flush to the left, right, or both sides of its container
200
- */
201
- flush: PropTypes.any,
202
- /**
203
- * `disabled` is also allowed
204
- */
205
- /**
206
- * `disabled` is also allowed
207
- */
208
- isDisabled: PropTypes.bool,
209
- /**
210
- * Force disables the button and changes the icon to a loading spinner
211
- */
212
- /**
213
- * Force disables the button and changes the icon to a loading spinner
214
- */
215
- isLoading: PropTypes.bool,
216
- /**
217
- * Applies the boolean state as the `aria-pressed` property to create a toggle button.
218
- * *Only use when the readable text does not change between states.*
219
- */
220
- /**
221
- * Applies the boolean state as the `aria-pressed` property to create a toggle button.
222
- * *Only use when the readable text does not change between states.*
223
- */
224
- isSelected: PropTypes.bool,
225
- target: PropTypes.string,
226
- rel: PropTypes.string,
227
- type: PropTypes.oneOf(["button", "submit"]),
228
- buttonRef: PropTypes.any,
229
- /**
230
- * Object of props passed to the `<span>` wrapping the button's content
231
- */
232
- /**
233
- * Object of props passed to the `<span>` wrapping the button's content
234
- */
235
- contentProps: PropTypes.shape({
236
- className: PropTypes.string,
237
- "aria-label": PropTypes.string,
238
- "data-test-subj": PropTypes.string,
239
- css: PropTypes.any
240
- }),
241
- /**
242
- * Any `type` accepted by EuiIcon
243
- */
244
- iconType: PropTypes.oneOfType([PropTypes.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "check", "checkInCircleFilled", "cheer", "classificationJob", "clock", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "codeApp", "color", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "esqlVis", "exit", "expand", "expandMini", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "iInCircle", "image", "importAction", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "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", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "mobile", "monitoringApp", "moon", "namespace", "nested", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plus", "plusInCircle", "plusInCircleFilled", "popout", "push", "questionInCircle", "quote", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "alert", "watchesApp", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "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", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, PropTypes.string.isRequired, PropTypes.elementType.isRequired]),
245
- /**
246
- * Can only be one side `left` or `right`
247
- */
248
- iconSide: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([undefined])]),
249
- /**
250
- * Object of props passed to the `<span>` wrapping the content's text/children only (not icon)
251
- *
252
- * This span wrapper can be removed by passing `textProps={false}`.
253
- */
254
- textProps: PropTypes.oneOfType([PropTypes.shape({
255
- className: PropTypes.string,
256
- "aria-label": PropTypes.string,
257
- "data-test-subj": PropTypes.string,
258
- css: PropTypes.any,
259
- ref: PropTypes.any,
260
- "data-text": PropTypes.string
261
- }).isRequired, PropTypes.oneOf([false])]),
262
- iconSize: PropTypes.any,
263
- className: PropTypes.string,
264
- "aria-label": PropTypes.string,
265
- "data-test-subj": PropTypes.string,
266
- css: PropTypes.any
267
- }),
268
- /**
269
- * Returns the `id` and applies an `onClick` handler to the `primaryAction`.
270
- */
271
- onClickPrimaryAction: PropTypes.func,
272
- /**
273
- * Notification messages as an array of strings. More than one message wraps in an accordion.
274
- */
275
- messages: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
276
- /**
277
- * Shows an indicator of the read state of the event. Leave as `undefined` to hide the indicator.
278
- */
279
- isRead: PropTypes.oneOfType([PropTypes.bool.isRequired, PropTypes.oneOf([undefined])]),
280
- /**
281
- * Returns the `id` and `isRead` state. Applies an `onClick` handler to the `read` indicator.
282
- */
283
- onRead: PropTypes.func,
284
- /**
285
- * Provided the `id` of the event must return an array of #EuiContextMenuItem elements.
286
- */
287
- onOpenContextMenu: PropTypes.func
288
- };
@@ -1,79 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- 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."); }
3
- 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); }
4
- 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; }
5
- 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; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
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
- import React, { useState } from 'react';
16
- import PropTypes from "prop-types";
17
- import { EuiAccordion } from '../accordion';
18
- import { useGeneratedHtmlId } from '../../services';
19
- import { useEuiI18n } from '../i18n';
20
- import { EuiText } from '../text';
21
- import { jsx as ___EmotionJSX } from "@emotion/react";
22
- export var EuiNotificationEventMessages = function EuiNotificationEventMessages(_ref) {
23
- var messages = _ref.messages,
24
- eventName = _ref.eventName;
25
- var _useState = useState(false),
26
- _useState2 = _slicedToArray(_useState, 2),
27
- isOpen = _useState2[0],
28
- setIsOpen = _useState2[1];
29
- var messagesLength = messages.length;
30
- var accordionId = useGeneratedHtmlId({
31
- prefix: 'euiNotificationEventMessagesAccordion'
32
- });
33
- var accordionButtonText = useEuiI18n('euiNotificationEventMessages.accordionButtonText', '+ {messagesLength} more', {
34
- messagesLength: messagesLength - 1
35
- });
36
- var accordionAriaLabelButtonText = useEuiI18n('euiNotificationEventMessages.accordionAriaLabelButtonText', '+ {messagesLength} messages for {eventName}', {
37
- messagesLength: messagesLength - 1,
38
- eventName: eventName
39
- });
40
- var accordionHideText = useEuiI18n('euiNotificationEventMessages.accordionHideText', 'hide');
41
- var buttonContentText = isOpen ? "".concat(accordionButtonText, " (").concat(accordionHideText, ")") : accordionButtonText;
42
- return ___EmotionJSX("div", {
43
- className: "euiNotificationEventMessages"
44
- }, messages && messagesLength === 1 ? ___EmotionJSX(EuiText, {
45
- size: "s",
46
- color: "subdued"
47
- }, ___EmotionJSX("p", null, messages)) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiText, {
48
- size: "s",
49
- color: "subdued"
50
- }, ___EmotionJSX("p", null, messages[0])), ___EmotionJSX(EuiAccordion, {
51
- onToggle: setIsOpen,
52
- buttonProps: {
53
- 'aria-label': accordionAriaLabelButtonText
54
- },
55
- id: accordionId,
56
- className: "euiNotificationEventMessages__accordion",
57
- buttonContent: buttonContentText,
58
- buttonClassName: "euiNotificationEventMessages__accordionButton",
59
- arrowDisplay: "none"
60
- }, ___EmotionJSX("div", {
61
- className: "euiNotificationEventMessages__accordionContent"
62
- }, messages.map(function (notification, index) {
63
- return ___EmotionJSX(EuiText, {
64
- size: "s",
65
- key: index,
66
- color: "subdued"
67
- }, ___EmotionJSX("p", null, notification));
68
- }).slice(1)))));
69
- };
70
- EuiNotificationEventMessages.propTypes = {
71
- /*
72
- * An array of strings that get individually wrapped in `<p>` tags
73
- */
74
- messages: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired,
75
- /**
76
- * A unique, human-friendly name for the event to be used in aria attributes (e.g. "alert-critical-01", "cloud-no-severity-12", etc..).
77
- */
78
- eventName: PropTypes.string.isRequired
79
- };