@elastic/eui 116.3.0 → 116.3.1-snapshot.1782218964187

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 (218) hide show
  1. package/es/components/avatar/avatar.js +4 -0
  2. package/es/components/avatar/avatar.styles.js +16 -16
  3. package/es/components/banner/banner.js +1 -2
  4. package/es/components/banner/banner.styles.js +1 -1
  5. package/es/components/basic_table/basic_table.js +35 -5
  6. package/es/components/basic_table/basic_table.styles.js +19 -1
  7. package/es/components/basic_table/in_memory_table.js +17 -0
  8. package/es/components/basic_table/index.js +2 -1
  9. package/es/components/basic_table/pagination_bar.js +19 -4
  10. package/es/components/basic_table/pagination_bar.styles.js +21 -0
  11. package/es/components/basic_table/panel.styles.js +14 -0
  12. package/es/components/basic_table/use_panel_props.js +28 -0
  13. package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
  14. package/es/components/flyout/flyout.component.js +10 -6
  15. package/es/components/flyout/flyout_menu.js +122 -19
  16. package/es/components/flyout/flyout_menu.styles.js +2 -1
  17. package/es/components/flyout/manager/actions.js +20 -0
  18. package/es/components/flyout/manager/flyout_child.js +23 -1
  19. package/es/components/flyout/manager/flyout_managed.js +65 -19
  20. package/es/components/flyout/manager/hooks.js +1 -1
  21. package/es/components/flyout/manager/index.js +2 -2
  22. package/es/components/flyout/manager/reducer.js +32 -8
  23. package/es/components/flyout/manager/selectors.js +8 -2
  24. package/es/components/flyout/manager/store.js +35 -2
  25. package/es/components/flyout/use_flyout_menu.js +2 -2
  26. package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
  27. package/es/components/notification_icon/assets/info_fill.js +34 -0
  28. package/es/components/notification_icon/assets/warning_static.js +40 -0
  29. package/es/components/notification_icon/notification_icon.js +87 -0
  30. package/es/components/notification_icon/notification_icon.styles.js +22 -0
  31. package/es/components/table/mobile/table_sort_mobile.js +64 -103
  32. package/es/components/table/store/use_unique_column_id.js +25 -0
  33. package/es/components/table/table_header_cell.js +7 -8
  34. package/es/components/table/table_header_cell_checkbox.js +5 -6
  35. package/es/components/toast/global_toast_list.js +132 -6
  36. package/es/components/toast/global_toast_list.styles.js +31 -7
  37. package/es/components/toast/toast.js +242 -47
  38. package/es/components/toast/toast.styles.js +35 -47
  39. package/es/components/toast/toast_action.js +34 -0
  40. package/es/components/toast/types.js +9 -0
  41. package/es/components/tool_tip/tool_tip.js +61 -30
  42. package/es/components/tool_tip/tool_tip_anchor.js +5 -5
  43. package/es/components/tool_tip/tool_tip_manager.js +27 -2
  44. package/eui.d.ts +811 -552
  45. package/i18ntokens.json +981 -927
  46. package/lib/components/avatar/avatar.js +4 -0
  47. package/lib/components/avatar/avatar.styles.js +16 -16
  48. package/lib/components/banner/banner.js +1 -2
  49. package/lib/components/banner/banner.styles.js +1 -1
  50. package/lib/components/basic_table/basic_table.js +34 -4
  51. package/lib/components/basic_table/basic_table.styles.js +19 -1
  52. package/lib/components/basic_table/in_memory_table.js +17 -0
  53. package/lib/components/basic_table/index.js +8 -1
  54. package/lib/components/basic_table/pagination_bar.js +19 -4
  55. package/lib/components/basic_table/pagination_bar.styles.js +26 -0
  56. package/lib/components/basic_table/panel.styles.js +20 -0
  57. package/lib/components/basic_table/use_panel_props.js +33 -0
  58. package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
  59. package/lib/components/flyout/flyout.component.js +10 -6
  60. package/lib/components/flyout/flyout_menu.js +120 -19
  61. package/lib/components/flyout/flyout_menu.styles.js +2 -1
  62. package/lib/components/flyout/manager/actions.js +21 -1
  63. package/lib/components/flyout/manager/flyout_child.js +23 -1
  64. package/lib/components/flyout/manager/flyout_managed.js +41 -17
  65. package/lib/components/flyout/manager/hooks.js +6 -0
  66. package/lib/components/flyout/manager/index.js +12 -0
  67. package/lib/components/flyout/manager/reducer.js +31 -7
  68. package/lib/components/flyout/manager/selectors.js +9 -3
  69. package/lib/components/flyout/manager/store.js +34 -1
  70. package/lib/components/flyout/use_flyout_menu.js +2 -2
  71. package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
  72. package/lib/components/notification_icon/assets/info_fill.js +41 -0
  73. package/lib/components/notification_icon/assets/warning_static.js +47 -0
  74. package/lib/components/notification_icon/notification_icon.js +93 -0
  75. package/lib/components/notification_icon/notification_icon.styles.js +28 -0
  76. package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  77. package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  78. package/lib/components/table/mobile/table_sort_mobile.js +71 -108
  79. package/lib/components/table/store/use_unique_column_id.js +34 -0
  80. package/lib/components/table/table_header_cell.js +7 -8
  81. package/lib/components/table/table_header_cell_checkbox.js +5 -6
  82. package/lib/components/toast/global_toast_list.js +132 -6
  83. package/lib/components/toast/global_toast_list.styles.js +31 -8
  84. package/lib/components/toast/toast.js +244 -47
  85. package/lib/components/toast/toast.styles.js +32 -45
  86. package/lib/components/toast/toast_action.js +40 -0
  87. package/lib/components/toast/types.js +15 -0
  88. package/lib/components/tool_tip/tool_tip.js +59 -29
  89. package/lib/components/tool_tip/tool_tip_anchor.js +5 -5
  90. package/lib/components/tool_tip/tool_tip_manager.js +27 -2
  91. package/optimize/es/components/avatar/avatar.js +4 -0
  92. package/optimize/es/components/avatar/avatar.styles.js +16 -16
  93. package/optimize/es/components/banner/banner.js +1 -2
  94. package/optimize/es/components/banner/banner.styles.js +1 -1
  95. package/optimize/es/components/basic_table/basic_table.js +18 -5
  96. package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
  97. package/optimize/es/components/basic_table/index.js +2 -1
  98. package/optimize/es/components/basic_table/pagination_bar.js +19 -4
  99. package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
  100. package/optimize/es/components/basic_table/panel.styles.js +14 -0
  101. package/optimize/es/components/basic_table/use_panel_props.js +28 -0
  102. package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
  103. package/optimize/es/components/flyout/flyout.component.js +10 -6
  104. package/optimize/es/components/flyout/flyout_menu.js +99 -18
  105. package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
  106. package/optimize/es/components/flyout/manager/actions.js +20 -0
  107. package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
  108. package/optimize/es/components/flyout/manager/hooks.js +1 -1
  109. package/optimize/es/components/flyout/manager/index.js +2 -2
  110. package/optimize/es/components/flyout/manager/reducer.js +32 -8
  111. package/optimize/es/components/flyout/manager/selectors.js +8 -2
  112. package/optimize/es/components/flyout/manager/store.js +35 -2
  113. package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
  114. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
  115. package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
  116. package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
  117. package/optimize/es/components/notification_icon/notification_icon.js +77 -0
  118. package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
  119. package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
  120. package/optimize/es/components/table/store/use_unique_column_id.js +25 -0
  121. package/optimize/es/components/table/table_header_cell.js +7 -8
  122. package/optimize/es/components/table/table_header_cell_checkbox.js +5 -6
  123. package/optimize/es/components/toast/global_toast_list.js +31 -6
  124. package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
  125. package/optimize/es/components/toast/toast.js +143 -47
  126. package/optimize/es/components/toast/toast.styles.js +35 -47
  127. package/optimize/es/components/toast/toast_action.js +33 -0
  128. package/optimize/es/components/toast/types.js +9 -0
  129. package/optimize/es/components/tool_tip/tool_tip.js +58 -30
  130. package/optimize/es/components/tool_tip/tool_tip_anchor.js +5 -5
  131. package/optimize/es/components/tool_tip/tool_tip_manager.js +27 -2
  132. package/optimize/lib/components/avatar/avatar.js +4 -0
  133. package/optimize/lib/components/avatar/avatar.styles.js +16 -16
  134. package/optimize/lib/components/banner/banner.js +1 -2
  135. package/optimize/lib/components/banner/banner.styles.js +1 -1
  136. package/optimize/lib/components/basic_table/basic_table.js +17 -4
  137. package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
  138. package/optimize/lib/components/basic_table/index.js +8 -1
  139. package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
  140. package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
  141. package/optimize/lib/components/basic_table/panel.styles.js +20 -0
  142. package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
  143. package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
  144. package/optimize/lib/components/flyout/flyout.component.js +10 -6
  145. package/optimize/lib/components/flyout/flyout_menu.js +98 -18
  146. package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
  147. package/optimize/lib/components/flyout/manager/actions.js +21 -1
  148. package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
  149. package/optimize/lib/components/flyout/manager/hooks.js +6 -0
  150. package/optimize/lib/components/flyout/manager/index.js +12 -0
  151. package/optimize/lib/components/flyout/manager/reducer.js +31 -7
  152. package/optimize/lib/components/flyout/manager/selectors.js +9 -3
  153. package/optimize/lib/components/flyout/manager/store.js +34 -1
  154. package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
  155. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
  156. package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
  157. package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
  158. package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
  159. package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
  160. package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  161. package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  162. package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
  163. package/optimize/lib/components/table/store/use_unique_column_id.js +34 -0
  164. package/optimize/lib/components/table/table_header_cell.js +7 -8
  165. package/optimize/lib/components/table/table_header_cell_checkbox.js +5 -6
  166. package/optimize/lib/components/toast/global_toast_list.js +31 -6
  167. package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
  168. package/optimize/lib/components/toast/toast.js +146 -47
  169. package/optimize/lib/components/toast/toast.styles.js +33 -45
  170. package/optimize/lib/components/toast/toast_action.js +39 -0
  171. package/optimize/lib/components/toast/types.js +15 -0
  172. package/optimize/lib/components/tool_tip/tool_tip.js +57 -29
  173. package/optimize/lib/components/tool_tip/tool_tip_anchor.js +5 -5
  174. package/optimize/lib/components/tool_tip/tool_tip_manager.js +27 -2
  175. package/package.json +9 -6
  176. package/test-env/components/avatar/avatar.js +4 -0
  177. package/test-env/components/avatar/avatar.styles.js +16 -16
  178. package/test-env/components/banner/banner.js +1 -2
  179. package/test-env/components/banner/banner.styles.js +1 -1
  180. package/test-env/components/basic_table/basic_table.js +34 -4
  181. package/test-env/components/basic_table/basic_table.styles.js +19 -1
  182. package/test-env/components/basic_table/in_memory_table.js +17 -0
  183. package/test-env/components/basic_table/index.js +8 -1
  184. package/test-env/components/basic_table/pagination_bar.js +19 -4
  185. package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
  186. package/test-env/components/basic_table/panel.styles.js +20 -0
  187. package/test-env/components/basic_table/use_panel_props.js +33 -0
  188. package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
  189. package/test-env/components/flyout/flyout.component.js +10 -6
  190. package/test-env/components/flyout/flyout_menu.js +121 -19
  191. package/test-env/components/flyout/flyout_menu.styles.js +2 -1
  192. package/test-env/components/flyout/manager/actions.js +21 -1
  193. package/test-env/components/flyout/manager/flyout_child.js +23 -1
  194. package/test-env/components/flyout/manager/flyout_managed.js +41 -17
  195. package/test-env/components/flyout/manager/hooks.js +6 -0
  196. package/test-env/components/flyout/manager/index.js +12 -0
  197. package/test-env/components/flyout/manager/reducer.js +31 -7
  198. package/test-env/components/flyout/manager/selectors.js +9 -3
  199. package/test-env/components/flyout/manager/store.js +34 -1
  200. package/test-env/components/flyout/use_flyout_menu.js +2 -2
  201. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
  202. package/test-env/components/notification_icon/assets/info_fill.js +41 -0
  203. package/test-env/components/notification_icon/assets/warning_static.js +47 -0
  204. package/test-env/components/notification_icon/notification_icon.js +46 -0
  205. package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
  206. package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
  207. package/test-env/components/table/store/use_unique_column_id.js +34 -0
  208. package/test-env/components/table/table_header_cell.js +7 -8
  209. package/test-env/components/table/table_header_cell_checkbox.js +5 -6
  210. package/test-env/components/toast/global_toast_list.js +132 -6
  211. package/test-env/components/toast/global_toast_list.styles.js +30 -7
  212. package/test-env/components/toast/toast.js +242 -47
  213. package/test-env/components/toast/toast.styles.js +33 -45
  214. package/test-env/components/toast/toast_action.js +39 -0
  215. package/test-env/components/toast/types.js +15 -0
  216. package/test-env/components/tool_tip/tool_tip.js +57 -29
  217. package/test-env/components/tool_tip/tool_tip_anchor.js +5 -5
  218. package/test-env/components/tool_tip/tool_tip_manager.js +27 -2
@@ -1,5 +1,6 @@
1
- var _templateObject;
1
+ var _templateObject, _templateObject2;
2
2
  function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
3
+ 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)."; }
3
4
  /*
4
5
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
6
  * or more contributor license agreements. Licensed under the Elastic License
@@ -9,26 +10,49 @@ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.fre
9
10
  */
10
11
 
11
12
  import { css, keyframes } from '@emotion/react';
12
- import { euiMaxBreakpoint, euiMinBreakpoint, euiScrollBarStyles, logicalCSS, logicalCSSWithFallback, logicalSizeCSS } from '../../global_styling';
13
+ import { euiCanAnimate, euiMaxBreakpoint, euiMinBreakpoint, euiScrollBarStyles, logicalCSS, logicalCSSWithFallback, logicalSizeCSS } from '../../global_styling';
14
+ var _ref = process.env.NODE_ENV === "production" ? {
15
+ name: "ox3d1t-hasFadeOut",
16
+ styles: "opacity:0;label:hasFadeOut;"
17
+ } : {
18
+ name: "ox3d1t-hasFadeOut",
19
+ styles: "opacity:0;label:hasFadeOut;",
20
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
21
+ };
22
+ var _ref2 = process.env.NODE_ENV === "production" ? {
23
+ name: "19mjubd-content",
24
+ styles: "position:relative;label:content;"
25
+ } : {
26
+ name: "19mjubd-content",
27
+ styles: "position:relative;label:content;",
28
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
+ };
13
30
  export var euiGlobalToastListStyles = function euiGlobalToastListStyles(euiThemeContext) {
14
31
  var euiTheme = euiThemeContext.euiTheme;
15
- var euiToastWidth = euiTheme.base * 25;
32
+ var euiToastWidth = euiTheme.base * 27.5; // 440px -> results in 360px toast width
33
+
34
+ var showNotificationBadge = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from { opacity: 0; }\n to { opacity: 1; }\n "])));
16
35
  return {
17
36
  /**
18
37
  * 1. Allow list to expand as items are added, but cap it at the screen height.
19
38
  * 2. Allow some padding for shadow
20
39
  */
21
40
  // Base
22
- euiGlobalToastList: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", logicalCSS('bottom', 0), " ", logicalCSS('width', "".concat(euiToastWidth, "px")), logicalCSS('max-height', '100vh'), logicalCSSWithFallback('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", logicalSizeCSS(0, 0), ";}&:not(:empty){", logicalCSS('padding-left', euiTheme.size.base), " ", logicalCSS('padding-right', euiTheme.size.base), " ", logicalCSS('padding-vertical', euiTheme.size.base), ";}", euiMaxBreakpoint(euiThemeContext, 'm'), "{&:not(:empty){", logicalCSS('left', 0), " ", logicalCSS('width', '100%'), ";}};label:euiGlobalToastList;"),
41
+ euiGlobalToastList: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), " display:flex;flex-direction:column;align-items:stretch;position:fixed;z-index:", euiTheme.levels.toast, ";", logicalCSS('bottom', 0), " ", logicalCSS('width', "".concat(euiToastWidth, "px")), logicalCSS('max-height', '100vh'), logicalCSSWithFallback('overflow-y', 'auto'), "scrollbar-width:none;&::-webkit-scrollbar{", logicalSizeCSS(0, 0), ";}&:hover .euiToastDecor::before,&:focus-within .euiToastDecor::before{animation-play-state:paused;}&:not(:empty){", logicalCSS('padding-left', euiTheme.size.base), " ", logicalCSS('padding-right', euiTheme.size.base), " ", logicalCSS('padding-vertical', euiTheme.size.base), ";}", euiMaxBreakpoint(euiThemeContext, 'm'), "{&:not(:empty){", logicalCSS('left', 0), " ", logicalCSS('width', '100%'), ";}};label:euiGlobalToastList;"),
42
+ content: _ref2,
43
+ notificationBadge: {
44
+ notificationBadge: /*#__PURE__*/css("position:absolute;inset-block-start:-", euiTheme.size.s, ";inset-inline-start:-", euiTheme.size.s, ";z-index:", Number(euiTheme.levels.content) + 1, ";", euiCanAnimate, "{animation:", euiTheme.animation.normal, " ", showNotificationBadge, " ", euiTheme.animation.resistance, ";transition:opacity ", euiTheme.animation.fast, ";};label:notificationBadge;"),
45
+ hasFadeOut: _ref
46
+ },
23
47
  // Variants
24
48
  right: /*#__PURE__*/css("&:not(:empty){", logicalCSS('right', 0), ";", euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('padding-left', "".concat(euiTheme.base * 4, "px")), ";}};label:right;"),
25
49
  left: /*#__PURE__*/css("&:not(:empty){", logicalCSS('left', 0), ";", euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('padding-right', "".concat(euiTheme.base * 4, "px")), ";}};label:left;"),
26
50
  euiGlobalToastListDismissButton: /*#__PURE__*/css("position:sticky;", logicalCSS('bottom', '0%'), ";;label:euiGlobalToastListDismissButton;")
27
51
  };
28
52
  };
29
- export var euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref) {
30
- var euiTheme = _ref.euiTheme;
31
- var euiShowToast = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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);
53
+ export var euiGlobalToastListItemStyles = function euiGlobalToastListItemStyles(_ref3) {
54
+ var euiTheme = _ref3.euiTheme;
55
+ var euiShowToast = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\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);
32
56
  return {
33
57
  // Base
34
58
  euiGlobalToastListItem: /*#__PURE__*/css("flex-shrink:0;", logicalCSS('margin-bottom', euiTheme.size.base), " animation:", euiTheme.animation.normal, " ", euiShowToast, " ", euiTheme.animation.resistance, ";opacity:1;&:first-child{", logicalCSS('margin-top', 'auto'), ";}&:last-child{", logicalCSS('margin-bottom', 0), ";};label:euiGlobalToastListItem;"),
@@ -1,5 +1,11 @@
1
- var _excluded = ["title", "color", "iconType", "onClose", "children", "className"];
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["title", "text", "color", "iconType", "children", "className", "actionProps", "style", "onClose", "animationMs"];
2
3
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
3
9
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
10
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
5
11
  /*
@@ -10,77 +16,266 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
10
16
  * Side Public License, v 1.
11
17
  */
12
18
 
13
- import React from 'react';
19
+ import React, { useMemo } from 'react';
14
20
  import PropTypes from "prop-types";
15
21
  import classNames from 'classnames';
16
- import { useEuiMemoizedStyles } from '../../services';
22
+ import { getTokenName } from '@elastic/eui-theme-common';
23
+ import { useEuiMemoizedStyles, useEuiTheme } from '../../services';
17
24
  import { EuiScreenReaderOnly } from '../accessibility';
18
25
  import { EuiButtonIcon } from '../button';
19
26
  import { EuiI18n } from '../i18n';
20
27
  import { EuiIcon } from '../icon';
21
28
  import { EuiText } from '../text';
22
29
  import { euiToastStyles, euiToastHeaderStyles } from './toast.styles';
30
+ import { EuiNotificationIcon } from '../notification_icon/notification_icon';
31
+ import { euiNotificationIconStyles } from '../notification_icon/notification_icon.styles';
32
+ import { EuiToastAction } from './toast_action';
33
+ import { EuiTitle } from '../title';
23
34
  import { jsx as ___EmotionJSX } from "@emotion/react";
24
- export var COLORS = ['primary', 'success', 'warning', 'danger'];
35
+ export var COLOR_TO_NOTIFICATION_ICON_MAP = {
36
+ primary: 'info',
37
+ success: 'success',
38
+ warning: 'warning',
39
+ danger: 'error'
40
+ };
25
41
  export var EuiToast = function EuiToast(_ref) {
26
42
  var title = _ref.title,
27
- color = _ref.color,
43
+ text = _ref.text,
44
+ _ref$color = _ref.color,
45
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
28
46
  iconType = _ref.iconType,
29
- onClose = _ref.onClose,
30
47
  children = _ref.children,
31
48
  className = _ref.className,
49
+ actionProps = _ref.actionProps,
50
+ style = _ref.style,
51
+ onClose = _ref.onClose,
52
+ animationMs = _ref.animationMs,
32
53
  rest = _objectWithoutProperties(_ref, _excluded);
33
- var baseStyles = useEuiMemoizedStyles(euiToastStyles);
34
- var baseCss = [baseStyles.euiToast, color && baseStyles.colors[color]];
54
+ var _useEuiTheme = useEuiTheme(),
55
+ euiTheme = _useEuiTheme.euiTheme;
56
+ var styles = useEuiMemoizedStyles(euiToastStyles);
57
+ var iconStyles = useEuiMemoizedStyles(euiNotificationIconStyles);
35
58
  var headerStyles = useEuiMemoizedStyles(euiToastHeaderStyles);
36
- var headerCss = [headerStyles.euiToastHeader, children && headerStyles.withBody];
37
- var classes = classNames('euiToast', className);
59
+ var cssStyles = [styles.euiToast];
60
+ var decorCssStyles = [styles.decor, animationMs && styles.hasAnimation];
61
+ var classes = classNames('euiToast', className, _defineProperty({}, "euiToast--".concat(color), color));
62
+ var highlightColorToken = getTokenName('borderStrong', color);
63
+ var typeColor = euiTheme.colors[highlightColorToken];
64
+ var backgroundLightToken = getTokenName('backgroundLight', color);
65
+ var backgroundLightColor = euiTheme.colors[backgroundLightToken];
66
+ var cssVariables = useMemo(function () {
67
+ return _objectSpread({
68
+ '--euiToastTypeColor': typeColor,
69
+ '--euiToastTypeBackgroundColor': backgroundLightColor
70
+ }, animationMs && {
71
+ '--euiToastAnimationMs': "".concat(animationMs, "ms")
72
+ });
73
+ }, [typeColor, backgroundLightColor, animationMs]);
74
+ var dismissButton = useMemo(function () {
75
+ if (!onClose) return;
76
+ return ___EmotionJSX(EuiI18n, {
77
+ token: "euiToast.dismissToast",
78
+ default: "Dismiss toast"
79
+ }, function (dismissToast) {
80
+ return ___EmotionJSX(EuiButtonIcon, {
81
+ css: styles.dismissButton,
82
+ iconType: "cross",
83
+ color: "text",
84
+ size: "xs",
85
+ "aria-label": dismissToast,
86
+ onClick: onClose,
87
+ "data-test-subj": "toastCloseButton"
88
+ });
89
+ });
90
+ }, [onClose, styles]);
91
+ var header = useMemo(function () {
92
+ if (!title) return;
93
+ var headerCssStyles = [headerStyles.euiToastHeader, onClose && headerStyles.hasDismissButton];
94
+ return ___EmotionJSX(EuiTitle, {
95
+ size: "xs",
96
+ css: headerCssStyles,
97
+ "data-test-subj": "euiToastHeader__title"
98
+ }, ___EmotionJSX("p", null, title));
99
+ }, [title, headerStyles, onClose]);
100
+ var icon = useMemo(function () {
101
+ if (!iconType) {
102
+ var _COLOR_TO_NOTIFICATIO;
103
+ var defaultIconType = (_COLOR_TO_NOTIFICATIO = COLOR_TO_NOTIFICATION_ICON_MAP[color]) !== null && _COLOR_TO_NOTIFICATIO !== void 0 ? _COLOR_TO_NOTIFICATIO : 'info';
104
+ return ___EmotionJSX(EuiNotificationIcon, {
105
+ css: styles.icon,
106
+ type: defaultIconType,
107
+ size: "l"
108
+ });
109
+ }
110
+ return ___EmotionJSX(EuiIcon, {
111
+ css: [styles.icon, iconStyles.size.l, ";label:icon;"],
112
+ type: iconType,
113
+ size: "l",
114
+ "aria-hidden": "true",
115
+ color: typeColor
116
+ });
117
+ }, [iconType, color, typeColor, styles, iconStyles]);
118
+ var optionalChildren = useMemo(function () {
119
+ if (!text && !children) return null;
120
+ return ___EmotionJSX("div", {
121
+ css: styles.text,
122
+ "data-test-subj": "euiToastBody"
123
+ }, text && ___EmotionJSX(EuiText, {
124
+ size: "s",
125
+ color: "default",
126
+ className: "euiToast__text",
127
+ "data-test-subj": "euiToastText"
128
+ }, text), children && ___EmotionJSX(EuiText, {
129
+ className: "euiToast__additionalContent",
130
+ size: "s",
131
+ color: "default",
132
+ "data-test-subj": "euiToastAdditionalContent"
133
+ }, children));
134
+ }, [text, children, styles]);
135
+ var actionControls = useMemo(function () {
136
+ var actionPrimaryProps = _objectSpread(_objectSpread({}, actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary), {}, {
137
+ color: color
138
+ });
139
+ var actionSecondaryProps = _objectSpread(_objectSpread({}, actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary), {}, {
140
+ color: color
141
+ });
142
+ var hasActionPrimary = Boolean(actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary);
143
+ var hasActionSecondary = Boolean(actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary);
144
+ if (!hasActionPrimary && !hasActionSecondary) return null;
145
+ var actionPrimary = hasActionPrimary && ___EmotionJSX(EuiToastAction, _extends({
146
+ actionType: "primary"
147
+ }, actionPrimaryProps));
148
+ var actionSecondary = hasActionSecondary && ___EmotionJSX(EuiToastAction, _extends({
149
+ actionType: "secondary"
150
+ }, actionSecondaryProps));
151
+ return ___EmotionJSX("div", {
152
+ css: styles.actions
153
+ }, actionPrimary, actionSecondary);
154
+ }, [actionProps, color, styles]);
38
155
  return ___EmotionJSX("div", _extends({
39
- css: baseCss,
40
- className: classes
41
- }, rest), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", null, ___EmotionJSX(EuiI18n, {
156
+ css: cssStyles,
157
+ className: classes,
158
+ style: _objectSpread(_objectSpread({}, cssVariables), style)
159
+ }, rest), ___EmotionJSX("div", {
160
+ className: "euiToastDecor",
161
+ css: decorCssStyles,
162
+ role: "presentation"
163
+ }), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", null, ___EmotionJSX(EuiI18n, {
42
164
  token: "euiToast.newNotification",
43
165
  default: "A new notification appears"
44
- }))), ___EmotionJSX(EuiI18n, {
45
- token: "euiToast.notification",
46
- default: "Notification"
47
- }, function (notification) {
48
- return ___EmotionJSX("div", {
49
- css: headerCss,
50
- "aria-label": notification,
51
- "data-test-subj": "euiToastHeader"
52
- }, iconType && ___EmotionJSX(EuiIcon, {
53
- css: headerStyles.euiToastHeader__icon,
54
- type: iconType,
55
- size: "m",
56
- "aria-hidden": "true"
57
- }), ___EmotionJSX("span", {
58
- css: headerStyles.euiToastHeader__title,
59
- "data-test-subj": "euiToastHeader__title"
60
- }, title));
61
- }), onClose && ___EmotionJSX(EuiI18n, {
62
- token: "euiToast.dismissToast",
63
- default: "Dismiss toast"
64
- }, function (dismissToast) {
65
- return ___EmotionJSX(EuiButtonIcon, {
66
- css: baseStyles.euiToast__closeButton,
67
- iconType: "cross",
68
- color: "text",
69
- size: "xs",
70
- "aria-label": dismissToast,
71
- onClick: onClose,
72
- "data-test-subj": "toastCloseButton"
73
- });
74
- }), children && ___EmotionJSX(EuiText, {
75
- size: "s",
76
- "data-test-subj": "euiToastBody"
77
- }, children));
166
+ }))), ___EmotionJSX("div", {
167
+ css: styles.wrapper
168
+ }, ___EmotionJSX("div", {
169
+ css: styles.body
170
+ }, icon, ___EmotionJSX("div", {
171
+ css: styles.content
172
+ },
173
+ // Note: the DOM position of the dismiss button matters to screen reader users.
174
+ // We generally want them to have some context of _what_ they're dismissing,
175
+ // instead of navigating to the dismiss button first before the content
176
+ header && optionalChildren ? ___EmotionJSX(React.Fragment, null, header, dismissButton, optionalChildren) : ___EmotionJSX(React.Fragment, null, header || optionalChildren, dismissButton))), actionControls));
78
177
  };
79
178
  EuiToast.propTypes = {
179
+ /**
180
+ * Title of the toast. Should be used with text only. Do not pass complex content or custom components.
181
+ * Ensure to always pass a title. It's currently marked as optional for backwards compatibility.
182
+ * In a future major release, this will be required.
183
+ */
80
184
  title: PropTypes.node,
185
+ /**
186
+ * Main component text. Accepts text, text block elements such as `<p>`, and inline elements such as `<span>`, `<strong>`, `<em>` or `<EuiLink>`.
187
+ * Avoid passing complex layouts or custom components. Use `children` instead.
188
+ */
189
+ text: PropTypes.node,
190
+ /**
191
+ * Can be used for additional, non-inline content. Use sparingly, as toasts are not meant to have complex content.
192
+ * Where possible, use `text` and `actionProps` instead to display text and actions.
193
+ */
194
+ children: PropTypes.node,
81
195
  color: PropTypes.any,
196
+ /**
197
+ * Defines a custom icon to be displayed.
198
+ * When no `iconType` is set, a default icon will be used based on the `color` of the toast.
199
+ */
82
200
  iconType: PropTypes.oneOfType([PropTypes.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.string.isRequired, PropTypes.elementType.isRequired]),
83
201
  onClose: PropTypes.func,
202
+ /**
203
+ * Duration in milliseconds that drives a countdown animation on the toast's decor bar.
204
+ * When not set the bar is static at full width.
205
+ */
206
+ animationMs: PropTypes.number,
207
+ /**
208
+ * Props for primary and secondary actions within the toast.
209
+ */
210
+ actionProps: PropTypes.shape({
211
+ primary: PropTypes.any,
212
+ secondary: PropTypes.shape({
213
+ href: PropTypes.string,
214
+ onClick: PropTypes.func,
215
+ /**
216
+ * Force disables the button and changes the icon to a loading spinner
217
+ */
218
+ /**
219
+ * Force disables the button and changes the icon to a loading spinner
220
+ */
221
+ isLoading: PropTypes.bool,
222
+ target: PropTypes.string,
223
+ rel: PropTypes.string,
224
+ type: PropTypes.any,
225
+ buttonRef: PropTypes.any,
226
+ /**
227
+ * Object of props passed to the `<span>` wrapping the button's content
228
+ */
229
+ /**
230
+ * Object of props passed to the `<span>` wrapping the button's content
231
+ */
232
+ contentProps: PropTypes.shape({
233
+ className: PropTypes.string,
234
+ "aria-label": PropTypes.string,
235
+ "data-test-subj": PropTypes.string,
236
+ css: PropTypes.any
237
+ }),
238
+ /**
239
+ * Any `type` accepted by EuiIcon
240
+ */
241
+ iconType: PropTypes.oneOfType([PropTypes.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.string.isRequired, PropTypes.elementType.isRequired]),
242
+ /**
243
+ * Can only be one side `left` or `right`
244
+ */
245
+ iconSide: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.oneOf([undefined])]),
246
+ /**
247
+ * Object of props passed to the `<span>` wrapping the content's text/children only (not icon)
248
+ *
249
+ * This span wrapper can be removed by passing `textProps={false}`.
250
+ */
251
+ textProps: PropTypes.oneOfType([PropTypes.shape({
252
+ className: PropTypes.string,
253
+ "aria-label": PropTypes.string,
254
+ "data-test-subj": PropTypes.string,
255
+ css: PropTypes.any,
256
+ ref: PropTypes.any,
257
+ "data-text": PropTypes.string
258
+ }).isRequired, PropTypes.oneOf([false])]),
259
+ iconSize: PropTypes.any,
260
+ /**
261
+ * Controls the disabled behavior via the native `disabled` attribute.
262
+ */
263
+ isDisabled: PropTypes.bool,
264
+ className: PropTypes.string,
265
+ "aria-label": PropTypes.string,
266
+ "data-test-subj": PropTypes.string,
267
+ css: PropTypes.any,
268
+ /**
269
+ * NOTE: Beta feature, may be changed or removed in the future
270
+ *
271
+ * Changes the native `disabled` attribute to `aria-disabled` to preserve focusability.
272
+ * This results in a semantically disabled button without the default browser handling of the disabled state.
273
+ *
274
+ * Use e.g. when a disabled button should have a tooltip.
275
+ */
276
+ hasAriaDisabled: PropTypes.bool
277
+ })
278
+ }),
84
279
  className: PropTypes.string,
85
280
  "aria-label": PropTypes.string,
86
281
  "data-test-subj": PropTypes.string,
@@ -1,3 +1,5 @@
1
+ var _templateObject;
2
+ function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
1
3
  /*
2
4
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
5
  * or more contributor license agreements. Licensed under the Elastic License
@@ -6,65 +8,51 @@
6
8
  * Side Public License, v 1.
7
9
  */
8
10
 
9
- import { css } from '@emotion/react';
10
- import { euiShadowLarge, mathWithUnits } from '@elastic/eui-theme-common';
11
+ import { css, keyframes } from '@emotion/react';
12
+ import { euiCanAnimate, euiShadowLarge, mathWithUnits } from '@elastic/eui-theme-common';
11
13
  import { euiTextBreakWord, logicalCSS } from '../../global_styling';
12
- import { highContrastModeStyles, preventForcedColors } from '../../global_styling/functions/high_contrast';
14
+ import { preventForcedColors } from '../../global_styling/functions/high_contrast';
13
15
  import { euiTitle } from '../title/title.styles';
14
16
  import { euiPanelBorderStyles } from '../panel/panel.styles';
17
+ var TEXT_MAX_WIDTH = 1200;
18
+ var CONTAINER_NAME = 'euiToast';
19
+ var CQC_BREAKPOINT_NARROWEST = '(max-width: 320px)';
20
+ var euiToastAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n transform: scaleX(1);\n }\n to {\n transform: scaleX(0);\n }\n"])));
15
21
  export var euiToastStyles = function euiToastStyles(euiThemeContext) {
16
- var euiTheme = euiThemeContext.euiTheme,
17
- highContrastMode = euiThemeContext.highContrastMode;
18
- var highlightStyles = function highlightStyles(color, width) {
19
- return "\n &:before {\n content: '';\n position: absolute;\n /* ensure highlight border is on top of panel border */\n z-index: 1;\n inset: 0;\n border-radius: inherit;\n ".concat(logicalCSS('border-top', "".concat(width, " solid ").concat(color)), "\n pointer-events: none;\n }\n ");
20
- };
22
+ var euiTheme = euiThemeContext.euiTheme;
23
+ var highlightSize = mathWithUnits([euiTheme.border.width.thin, euiTheme.border.width.thick], function (x, y) {
24
+ return x + y;
25
+ });
26
+ var paddingTop = mathWithUnits([euiTheme.size.base, highlightSize], function (x, y) {
27
+ return x + y;
28
+ });
29
+ var offsetTop = mathWithUnits([euiTheme.size.s, highlightSize], function (x, y) {
30
+ return x + y;
31
+ });
21
32
  return {
22
33
  // Base
23
- euiToast: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";", euiShadowLarge(euiThemeContext, {
34
+ euiToast: /*#__PURE__*/css("container-type:inline-size;container-name:", CONTAINER_NAME, ";position:relative;overflow:hidden;border-radius:", euiTheme.border.radius.medium, ";", euiShadowLarge(euiThemeContext, {
24
35
  borderAllInHighContrastMode: true
25
- }), " position:relative;", logicalCSS('padding-horizontal', euiTheme.size.base), " ", logicalCSS('padding-vertical', euiTheme.size.base), " background-color:", euiTheme.colors.emptyShade, ";", logicalCSS('width', '100%'), " ", euiTextBreakWord(), euiPanelBorderStyles(euiThemeContext), " &:hover,&:focus{[class*='euiToast__closeButton']{opacity:1;}};label:euiToast;"),
26
- // Elements
27
- euiToast__closeButton: /*#__PURE__*/css("position:absolute;", logicalCSS('top', euiTheme.size.base), " ", logicalCSS('right', euiTheme.size.base), ";;label:euiToast__closeButton;"),
28
- // Variants
29
- colors: {
30
- _getStyles: function _getStyles(color) {
31
- // Increase color/border thickness for all high contrast modes
32
- var borderWidth = highContrastMode ? mathWithUnits(euiTheme.border.width.thick, function (x) {
33
- return x * 2;
34
- }) : euiTheme.border.width.thick;
35
- return highContrastModeStyles(euiThemeContext, {
36
- none: highlightStyles(color, borderWidth),
37
- preferred: "\n ".concat(highlightStyles(color, borderWidth), "\n \n &::before {\n ").concat(logicalCSS('width', "calc(100% + ".concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
38
- return x * 2;
39
- }), ")")), "\n ").concat(logicalCSS('margin-top', "-".concat(euiTheme.border.width.thin)), "\n ").concat(logicalCSS('margin-left', "-".concat(euiTheme.border.width.thin)), "\n }\n "),
40
- // Windows high contrast mode ignores/overrides border colors, which have semantic meaning here. To get around this, we'll use a pseudo element that ignores forced colors
41
- forced: "\n overflow: hidden;\n\n &::before {\n content: '';\n position: absolute;\n ".concat(logicalCSS('top', 0), "\n ").concat(logicalCSS('horizontal', 0), "\n ").concat(logicalCSS('height', borderWidth), "\n background-color: ").concat(color, ";\n ").concat(preventForcedColors(euiThemeContext), "\n pointer-events: none;\n }\n ")
42
- });
43
- },
44
- get primary() {
45
- return /*#__PURE__*/css(this._getStyles(euiTheme.colors.primary), ";label:primary;");
46
- },
47
- get success() {
48
- return /*#__PURE__*/css(this._getStyles(euiTheme.colors.success), ";label:success;");
49
- },
50
- get warning() {
51
- return /*#__PURE__*/css(this._getStyles(euiTheme.colors.warning), ";label:warning;");
52
- },
53
- get danger() {
54
- return /*#__PURE__*/css(this._getStyles(euiTheme.colors.danger), ";label:danger;");
55
- }
56
- }
36
+ }), " ", logicalCSS('padding-top', paddingTop), " ", logicalCSS('padding-bottom', euiTheme.size.base), " ", logicalCSS('padding-horizontal', euiTheme.size.base), " background-color:", euiTheme.colors.backgroundBasePlain, ";", logicalCSS('width', '100%'), " ", euiTextBreakWord(), euiPanelBorderStyles(euiThemeContext), ";;label:euiToast;"),
37
+ decor: /*#__PURE__*/css("position:absolute;inset-block-start:0;inset-inline:0;", logicalCSS('height', highlightSize), " background-color:var(--euiToastTypeBackgroundColor);", preventForcedColors(euiThemeContext), " &::before{content:'';position:absolute;z-index:", euiTheme.levels.content, ";inset-block-start:0;inset-inline:0;", logicalCSS('height', '100%'), " background-color:var(--euiToastTypeColor);pointer-events:none;", preventForcedColors(euiThemeContext), " transform-origin:left center;[dir='rtl'] &{transform-origin:right center;}};label:decor;"),
38
+ // handles content + actions layout
39
+ wrapper: /*#__PURE__*/css("display:flex;flex-direction:column;gap:", euiTheme.size.m, ";inline-size:100%;;label:wrapper;"),
40
+ // handles icon + text layout
41
+ body: /*#__PURE__*/css("display:flex;flex-direction:row;align-self:center;gap:", euiTheme.size.m, ";inline-size:100%;;label:body;"),
42
+ // handles text layout
43
+ content: /*#__PURE__*/css("display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";align-self:center;inline-size:100%;max-inline-size:", TEXT_MAX_WIDTH, "px;.euiToast__text+.euiToast__additionalContent{", logicalCSS('margin-top', euiTheme.size.s), ";};label:content;"),
44
+ text: /*#__PURE__*/css("display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";;label:text;"),
45
+ icon: /*#__PURE__*/css("grid-area:icon;position:relative;", logicalCSS('margin-vertical', euiTheme.size.xxs), ";;label:icon;"),
46
+ actions: /*#__PURE__*/css("grid-area:actions;display:flex;gap:", euiTheme.size.s, ";", logicalCSS('margin-left', euiTheme.size.xl), "@container ", CONTAINER_NAME, " ", CQC_BREAKPOINT_NARROWEST, "{flex-wrap:wrap;>*{inline-size:100%;}};label:actions;"),
47
+ dismissButton: /*#__PURE__*/css("position:absolute;", logicalCSS('top', offsetTop), ";", logicalCSS('right', euiTheme.size.s), ";;label:dismissButton;"),
48
+ hasAnimation: /*#__PURE__*/css("&::before{", euiCanAnimate, "{animation:", euiToastAnimation, " var(--euiToastAnimationMs) linear forwards;}};label:hasAnimation;")
57
49
  };
58
50
  };
59
51
  export var euiToastHeaderStyles = function euiToastHeaderStyles(euiThemeContext) {
60
52
  var euiTheme = euiThemeContext.euiTheme;
61
53
  return {
62
54
  // Base
63
- euiToastHeader: /*#__PURE__*/css("display:flex;align-items:baseline;", logicalCSS('padding-right', euiTheme.size.l), ">*+*{", logicalCSS('margin-left', euiTheme.size.s), ";};label:euiToastHeader;"),
64
- // Elements
65
- euiToastHeader__icon: /*#__PURE__*/css("flex:0 0 auto;fill:", euiTheme.colors.textHeading, ";transform:translateY(2px);;label:euiToastHeader__icon;"),
66
- euiToastHeader__title: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xs'), " font-weight:", euiTheme.font.weight.bold, ";;label:euiToastHeader__title;"),
67
- // Variants
68
- withBody: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.s), ";;label:withBody;")
55
+ euiToastHeader: /*#__PURE__*/css("display:flex;align-items:baseline;", euiTitle(euiThemeContext, 'xs'), " font-weight:", euiTheme.font.weight.bold, ";;label:euiToastHeader;"),
56
+ hasDismissButton: /*#__PURE__*/css("padding-inline-end:", euiTheme.size.l, ";;label:hasDismissButton;")
69
57
  };
70
58
  };
@@ -0,0 +1,34 @@
1
+ var _excluded = ["children", "actionType", "color"];
2
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
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 from 'react';
14
+ import { EuiButton, EuiButtonEmpty } from '../button';
15
+ import { jsx as ___EmotionJSX } from "@emotion/react";
16
+ export var EuiToastAction = function EuiToastAction(_ref) {
17
+ var children = _ref.children,
18
+ _ref$actionType = _ref.actionType,
19
+ actionType = _ref$actionType === void 0 ? 'primary' : _ref$actionType,
20
+ _ref$color = _ref.color,
21
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
22
+ rest = _objectWithoutProperties(_ref, _excluded);
23
+ if (actionType === 'primary') {
24
+ return ___EmotionJSX(EuiButton, _extends({
25
+ size: "s",
26
+ color: color
27
+ }, rest), children);
28
+ } else {
29
+ return ___EmotionJSX(EuiButtonEmpty, _extends({
30
+ size: "s",
31
+ color: color
32
+ }, rest), children);
33
+ }
34
+ };
@@ -0,0 +1,9 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ export var COLORS = ['primary', 'success', 'warning', 'danger'];