@elastic/eui 66.0.0 → 67.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 (196) hide show
  1. package/dist/eui_theme_dark.css +0 -247
  2. package/dist/eui_theme_dark.json +0 -6
  3. package/dist/eui_theme_dark.json.d.ts +0 -6
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -247
  6. package/dist/eui_theme_light.json +0 -6
  7. package/dist/eui_theme_light.json.d.ts +0 -6
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/button/button_display/_button_display.js +10 -1
  10. package/es/components/button/button_empty/button_empty.js +10 -1
  11. package/es/components/collapsible_nav/collapsible_nav.js +0 -5
  12. package/es/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  13. package/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -2
  14. package/es/components/expression/expression.js +12 -2
  15. package/es/components/header/header_links/header_link.js +10 -1
  16. package/es/components/image/image.js +6 -1
  17. package/es/components/image/image_fullscreen_wrapper.js +2 -3
  18. package/es/components/notification/notification_event.js +24 -5
  19. package/es/components/overlay_mask/overlay_mask.js +27 -65
  20. package/es/components/overlay_mask/overlay_mask.styles.js +28 -0
  21. package/es/components/page/page_content/page_content.js +1 -2
  22. package/es/components/page/page_content/page_content_body.js +1 -2
  23. package/es/components/page/page_content/page_content_header.js +1 -2
  24. package/es/components/page/page_content/page_content_header_section.js +1 -2
  25. package/es/components/page/page_section/page_section.js +15 -3
  26. package/es/components/page/page_side_bar/page_side_bar.js +1 -2
  27. package/es/components/page/page_template.js +3 -1
  28. package/es/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  29. package/es/components/page_template/page_template.js +18 -2
  30. package/es/components/pagination/pagination.js +17 -4
  31. package/es/components/pagination/pagination.styles.js +31 -0
  32. package/es/components/pagination/pagination_button.js +17 -5
  33. package/es/components/pagination/pagination_button.styles.js +30 -0
  34. package/es/components/pagination/pagination_button_arrow.js +5 -0
  35. package/es/components/progress/progress.js +6 -1
  36. package/es/components/provider/cache/cache_provider.js +3 -9
  37. package/es/components/provider/provider.js +25 -2
  38. package/es/components/resizable_container/resizable_panel.js +6 -1
  39. package/es/components/side_nav/side_nav.js +5 -0
  40. package/es/components/suggest/suggest.js +10 -1
  41. package/es/components/tool_tip/tool_tip.js +42 -66
  42. package/es/components/tool_tip/tool_tip.styles.js +107 -0
  43. package/es/components/tool_tip/tool_tip_anchor.js +73 -0
  44. package/es/components/tool_tip/tool_tip_arrow.js +20 -0
  45. package/es/components/tool_tip/tool_tip_popover.js +48 -101
  46. package/es/global_styling/index.js +2 -1
  47. package/es/global_styling/utility/animations.js +13 -0
  48. package/eui.d.ts +128 -51
  49. package/i18ntokens.json +54 -54
  50. package/lib/components/button/button_display/_button_display.js +10 -1
  51. package/lib/components/button/button_empty/button_empty.js +10 -1
  52. package/lib/components/collapsible_nav/collapsible_nav.js +0 -5
  53. package/lib/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  54. package/lib/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  55. package/lib/components/expression/expression.js +12 -2
  56. package/lib/components/header/header_links/header_link.js +10 -1
  57. package/lib/components/image/image.js +6 -1
  58. package/lib/components/image/image_fullscreen_wrapper.js +2 -3
  59. package/lib/components/notification/notification_event.js +27 -8
  60. package/lib/components/overlay_mask/overlay_mask.js +27 -65
  61. package/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
  62. package/lib/components/page/page_content/page_content.js +1 -2
  63. package/lib/components/page/page_content/page_content_body.js +1 -2
  64. package/lib/components/page/page_content/page_content_header.js +1 -2
  65. package/lib/components/page/page_content/page_content_header_section.js +1 -2
  66. package/lib/components/page/page_section/page_section.js +15 -3
  67. package/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  68. package/lib/components/page/page_template.js +3 -1
  69. package/lib/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  70. package/lib/components/page_template/page_template.js +18 -2
  71. package/lib/components/pagination/pagination.js +18 -3
  72. package/lib/components/pagination/pagination.styles.js +34 -0
  73. package/lib/components/pagination/pagination_button.js +9 -4
  74. package/lib/components/pagination/pagination_button.styles.js +45 -0
  75. package/lib/components/pagination/pagination_button_arrow.js +7 -0
  76. package/lib/components/progress/progress.js +6 -1
  77. package/lib/components/provider/cache/cache_provider.js +3 -11
  78. package/lib/components/provider/provider.js +31 -6
  79. package/lib/components/resizable_container/resizable_panel.js +6 -1
  80. package/lib/components/side_nav/side_nav.js +5 -0
  81. package/lib/components/suggest/suggest.js +10 -1
  82. package/lib/components/tool_tip/tool_tip.js +43 -64
  83. package/lib/components/tool_tip/tool_tip.styles.js +123 -0
  84. package/lib/components/tool_tip/tool_tip_anchor.js +87 -0
  85. package/lib/components/tool_tip/tool_tip_arrow.js +28 -0
  86. package/lib/components/tool_tip/tool_tip_popover.js +49 -98
  87. package/lib/global_styling/index.js +13 -0
  88. package/lib/global_styling/utility/animations.js +15 -0
  89. package/optimize/es/components/date_picker/super_date_picker/date_popover/date_popover_button.js +0 -1
  90. package/optimize/es/components/image/image_fullscreen_wrapper.js +2 -3
  91. package/optimize/es/components/notification/notification_event.js +10 -4
  92. package/optimize/es/components/overlay_mask/overlay_mask.js +27 -60
  93. package/optimize/es/components/overlay_mask/overlay_mask.styles.js +28 -0
  94. package/optimize/es/components/page/page_content/page_content.js +1 -2
  95. package/optimize/es/components/page/page_content/page_content_body.js +1 -2
  96. package/optimize/es/components/page/page_content/page_content_header.js +1 -2
  97. package/optimize/es/components/page/page_content/page_content_header_section.js +1 -2
  98. package/optimize/es/components/page/page_section/page_section.js +4 -2
  99. package/optimize/es/components/page/page_side_bar/page_side_bar.js +1 -2
  100. package/optimize/es/components/page/page_template.js +3 -1
  101. package/optimize/es/components/pagination/pagination.js +17 -4
  102. package/optimize/es/components/pagination/pagination.styles.js +31 -0
  103. package/optimize/es/components/pagination/pagination_button.js +7 -4
  104. package/optimize/es/components/pagination/pagination_button.styles.js +30 -0
  105. package/optimize/es/components/pagination/pagination_button_arrow.js +5 -0
  106. package/optimize/es/components/provider/cache/cache_provider.js +3 -9
  107. package/optimize/es/components/provider/provider.js +25 -2
  108. package/optimize/es/components/suggest/suggest.js +4 -1
  109. package/optimize/es/components/tool_tip/tool_tip.js +42 -66
  110. package/optimize/es/components/tool_tip/tool_tip.styles.js +107 -0
  111. package/optimize/es/components/tool_tip/tool_tip_anchor.js +60 -0
  112. package/optimize/es/components/tool_tip/tool_tip_arrow.js +20 -0
  113. package/optimize/es/components/tool_tip/tool_tip_popover.js +46 -87
  114. package/optimize/es/global_styling/index.js +2 -1
  115. package/optimize/es/global_styling/utility/animations.js +13 -0
  116. package/optimize/lib/components/image/image_fullscreen_wrapper.js +2 -3
  117. package/optimize/lib/components/notification/notification_event.js +11 -11
  118. package/optimize/lib/components/overlay_mask/overlay_mask.js +27 -59
  119. package/optimize/lib/components/overlay_mask/overlay_mask.styles.js +34 -0
  120. package/optimize/lib/components/page/page_content/page_content.js +1 -2
  121. package/optimize/lib/components/page/page_content/page_content_body.js +1 -2
  122. package/optimize/lib/components/page/page_content/page_content_header.js +1 -2
  123. package/optimize/lib/components/page/page_content/page_content_header_section.js +1 -2
  124. package/optimize/lib/components/page/page_section/page_section.js +4 -2
  125. package/optimize/lib/components/page/page_side_bar/page_side_bar.js +1 -2
  126. package/optimize/lib/components/page/page_template.js +3 -1
  127. package/optimize/lib/components/pagination/pagination.js +18 -3
  128. package/optimize/lib/components/pagination/pagination.styles.js +34 -0
  129. package/optimize/lib/components/pagination/pagination_button.js +9 -4
  130. package/optimize/lib/components/pagination/pagination_button.styles.js +45 -0
  131. package/optimize/lib/components/pagination/pagination_button_arrow.js +7 -0
  132. package/optimize/lib/components/provider/cache/cache_provider.js +3 -11
  133. package/optimize/lib/components/provider/provider.js +31 -6
  134. package/optimize/lib/components/suggest/suggest.js +4 -1
  135. package/optimize/lib/components/tool_tip/tool_tip.js +42 -64
  136. package/optimize/lib/components/tool_tip/tool_tip.styles.js +125 -0
  137. package/optimize/lib/components/tool_tip/tool_tip_anchor.js +75 -0
  138. package/optimize/lib/components/tool_tip/tool_tip_arrow.js +35 -0
  139. package/optimize/lib/components/tool_tip/tool_tip_popover.js +47 -88
  140. package/optimize/lib/global_styling/index.js +13 -0
  141. package/optimize/lib/global_styling/utility/animations.js +17 -0
  142. package/package.json +2 -2
  143. package/src/components/index.scss +0 -4
  144. package/src/global_styling/mixins/_tool_tip.scss +3 -6
  145. package/src/themes/amsterdam/overrides/_index.scss +0 -2
  146. package/test-env/components/button/button_display/_button_display.js +10 -1
  147. package/test-env/components/button/button_empty/button_empty.js +10 -1
  148. package/test-env/components/collapsible_nav/collapsible_nav.js +0 -5
  149. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +6 -1
  150. package/test-env/components/date_picker/super_date_picker/date_popover/date_popover_button.js +6 -1
  151. package/test-env/components/expression/expression.js +12 -2
  152. package/test-env/components/header/header_links/header_link.js +10 -1
  153. package/test-env/components/image/image.js +6 -1
  154. package/test-env/components/image/image_fullscreen_wrapper.js +2 -3
  155. package/test-env/components/notification/notification_event.js +24 -15
  156. package/test-env/components/overlay_mask/overlay_mask.js +27 -64
  157. package/test-env/components/overlay_mask/overlay_mask.styles.js +34 -0
  158. package/test-env/components/page/page_content/page_content.js +1 -2
  159. package/test-env/components/page/page_content/page_content_body.js +1 -2
  160. package/test-env/components/page/page_content/page_content_header.js +1 -2
  161. package/test-env/components/page/page_content/page_content_header_section.js +1 -2
  162. package/test-env/components/page/page_section/page_section.js +15 -3
  163. package/test-env/components/page/page_side_bar/page_side_bar.js +1 -2
  164. package/test-env/components/page/page_template.js +3 -1
  165. package/test-env/components/page_template/empty_prompt/page_empty_prompt.js +11 -1
  166. package/test-env/components/page_template/page_template.js +18 -2
  167. package/test-env/components/pagination/pagination.js +18 -3
  168. package/test-env/components/pagination/pagination.styles.js +34 -0
  169. package/test-env/components/pagination/pagination_button.js +9 -4
  170. package/test-env/components/pagination/pagination_button.styles.js +45 -0
  171. package/test-env/components/pagination/pagination_button_arrow.js +7 -0
  172. package/test-env/components/progress/progress.js +6 -1
  173. package/test-env/components/provider/cache/cache_provider.js +3 -11
  174. package/test-env/components/provider/provider.js +31 -6
  175. package/test-env/components/resizable_container/resizable_panel.js +6 -1
  176. package/test-env/components/side_nav/side_nav.js +5 -0
  177. package/test-env/components/suggest/suggest.js +10 -1
  178. package/test-env/components/tool_tip/tool_tip.js +42 -64
  179. package/test-env/components/tool_tip/tool_tip.styles.js +125 -0
  180. package/test-env/components/tool_tip/tool_tip_anchor.js +84 -0
  181. package/test-env/components/tool_tip/tool_tip_arrow.js +35 -0
  182. package/test-env/components/tool_tip/tool_tip_popover.js +49 -89
  183. package/test-env/global_styling/index.js +13 -0
  184. package/test-env/global_styling/utility/animations.js +17 -0
  185. package/src/components/call_out/_index.scss +0 -3
  186. package/src/components/call_out/_mixins.scss +0 -23
  187. package/src/components/call_out/_variables.scss +0 -7
  188. package/src/components/overlay_mask/_index.scss +0 -1
  189. package/src/components/overlay_mask/_overlay_mask.scss +0 -33
  190. package/src/components/pagination/_index.scss +0 -2
  191. package/src/components/pagination/_pagination.scss +0 -30
  192. package/src/components/pagination/_pagination_button.scss +0 -37
  193. package/src/components/tool_tip/_index.scss +0 -1
  194. package/src/components/tool_tip/_tool_tip.scss +0 -121
  195. package/src/themes/amsterdam/overrides/_overlay_mask.scss +0 -3
  196. package/src/themes/amsterdam/overrides/_tooltip.scss +0 -7
@@ -158,7 +158,16 @@ EuiButtonDisplay.propTypes = {
158
158
  /**
159
159
  * Object of props passed to the <span/> wrapping the button's content
160
160
  */
161
- contentProps: PropTypes.any,
161
+
162
+ /**
163
+ * Object of props passed to the <span/> wrapping the button's content
164
+ */
165
+ contentProps: PropTypes.shape({
166
+ className: PropTypes.string,
167
+ "aria-label": PropTypes.string,
168
+ "data-test-subj": PropTypes.string,
169
+ css: PropTypes.any
170
+ }),
162
171
  style: PropTypes.any,
163
172
 
164
173
  /**
@@ -198,7 +198,16 @@ EuiButtonEmpty.propTypes = {
198
198
  /**
199
199
  * Object of props passed to the <span/> wrapping the button's content
200
200
  */
201
- contentProps: PropTypes.any,
201
+
202
+ /**
203
+ * Object of props passed to the <span/> wrapping the button's content
204
+ */
205
+ contentProps: PropTypes.shape({
206
+ className: PropTypes.string,
207
+ "aria-label": PropTypes.string,
208
+ "data-test-subj": PropTypes.string,
209
+ css: PropTypes.any
210
+ }),
202
211
 
203
212
  /**
204
213
  * Any `type` accepted by EuiIcon
@@ -186,11 +186,6 @@ EuiCollapsibleNav.propTypes = {
186
186
  "data-test-subj": PropTypes.string,
187
187
  css: PropTypes.any,
188
188
 
189
- /**
190
- * Function that applies to clicking the mask itself and not the children
191
- */
192
- onClick: PropTypes.func,
193
-
194
189
  /**
195
190
  * ReactNode to render as this component's content
196
191
  */
@@ -203,7 +203,12 @@ EuiAutoRefreshButton.propTypes = {
203
203
  /**
204
204
  * Object of props passed to the <span/> wrapping the button's content
205
205
  */
206
- contentProps: PropTypes.any,
206
+ contentProps: PropTypes.shape({
207
+ className: PropTypes.string,
208
+ "aria-label": PropTypes.string,
209
+ "data-test-subj": PropTypes.string,
210
+ css: PropTypes.any
211
+ }),
207
212
 
208
213
  /**
209
214
  * Object of props passed to the <span/> wrapping the content's text (only if the children is a `string`)
@@ -16,7 +16,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
16
16
  import React from 'react';
17
17
  import PropTypes from "prop-types";
18
18
  import classNames from 'classnames';
19
- // eslint-disable-line import/named
20
19
  import { useEuiI18n } from '../../../i18n';
21
20
  import { EuiPopover } from '../../../popover';
22
21
  import { useFormatTimeString } from '../pretty_duration';
@@ -93,7 +92,12 @@ export var EuiDatePopoverButton = function EuiDatePopoverButton(props) {
93
92
  };
94
93
  EuiDatePopoverButton.propTypes = {
95
94
  className: PropTypes.string,
96
- buttonProps: PropTypes.any,
95
+ buttonProps: PropTypes.shape({
96
+ className: PropTypes.string,
97
+ "aria-label": PropTypes.string,
98
+ "data-test-subj": PropTypes.string,
99
+ css: PropTypes.any
100
+ }),
97
101
  dateFormat: PropTypes.string.isRequired,
98
102
  isDisabled: PropTypes.bool,
99
103
  isInvalid: PropTypes.bool,
@@ -99,7 +99,12 @@ EuiExpression.propTypes = {
99
99
  * First part of the expression
100
100
  */
101
101
  description: PropTypes.node.isRequired,
102
- descriptionProps: PropTypes.any,
102
+ descriptionProps: PropTypes.shape({
103
+ className: PropTypes.string,
104
+ "aria-label": PropTypes.string,
105
+ "data-test-subj": PropTypes.string,
106
+ css: PropTypes.any
107
+ }),
103
108
 
104
109
  /**
105
110
  * Second part of the expression
@@ -109,7 +114,12 @@ EuiExpression.propTypes = {
109
114
  * Second part of the expression
110
115
  */
111
116
  value: PropTypes.node,
112
- valueProps: PropTypes.any,
117
+ valueProps: PropTypes.shape({
118
+ className: PropTypes.string,
119
+ "aria-label": PropTypes.string,
120
+ "data-test-subj": PropTypes.string,
121
+ css: PropTypes.any
122
+ }),
113
123
 
114
124
  /**
115
125
  * Color of the `description`
@@ -100,7 +100,16 @@ EuiHeaderLink.propTypes = {
100
100
  /**
101
101
  * Object of props passed to the <span/> wrapping the button's content
102
102
  */
103
- contentProps: PropTypes.any,
103
+
104
+ /**
105
+ * Object of props passed to the <span/> wrapping the button's content
106
+ */
107
+ contentProps: PropTypes.shape({
108
+ className: PropTypes.string,
109
+ "aria-label": PropTypes.string,
110
+ "data-test-subj": PropTypes.string,
111
+ css: PropTypes.any
112
+ }),
104
113
 
105
114
  /**
106
115
  * Any `type` accepted by EuiIcon
@@ -166,5 +166,10 @@ EuiImage.propTypes = {
166
166
  /**
167
167
  * Props to add to the wrapping figure element
168
168
  */
169
- wrapperProps: PropTypes.any
169
+ wrapperProps: PropTypes.shape({
170
+ className: PropTypes.string,
171
+ "aria-label": PropTypes.string,
172
+ "data-test-subj": PropTypes.string,
173
+ css: PropTypes.any
174
+ })
170
175
  };
@@ -66,10 +66,9 @@ export var EuiImageFullScreenWrapper = function EuiImageFullScreenWrapper(_ref)
66
66
  var iconStyles = euiImageButtonIconStyles(euiTheme);
67
67
  var cssIconStyles = [iconStyles.euiImageButton__icon, iconStyles.closeFullScreen];
68
68
  return ___EmotionJSX(EuiOverlayMask, {
69
- "data-test-subj": "fullScreenOverlayMask",
70
- onClick: closeFullScreen
69
+ "data-test-subj": "fullScreenOverlayMask"
71
70
  }, ___EmotionJSX(EuiFocusTrap, {
72
- clickOutsideDisables: true
71
+ onClickOutside: closeFullScreen
73
72
  }, ___EmotionJSX(React.Fragment, null, ___EmotionJSX("figure", _extends({
74
73
  "aria-label": optionalCaptionText
75
74
  }, wrapperProps, {
@@ -1,5 +1,11 @@
1
+ var _excluded = ["id", "type", "severity", "badgeColor", "iconType", "iconAriaLabel", "time", "title", "isRead", "primaryAction", "primaryActionProps", "messages", "onRead", "onOpenContextMenu", "onClickTitle", "onClickPrimaryAction", "headingLevel", "className"];
2
+
1
3
  function _extends() { _extends = Object.assign || 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); }
2
4
 
5
+ 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; }
6
+
7
+ 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; }
8
+
3
9
  /*
4
10
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
11
  * or more contributor license agreements. Licensed under the Elastic License
@@ -36,9 +42,13 @@ export var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
36
42
  onClickTitle = _ref.onClickTitle,
37
43
  onClickPrimaryAction = _ref.onClickPrimaryAction,
38
44
  _ref$headingLevel = _ref.headingLevel,
39
- headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel;
45
+ headingLevel = _ref$headingLevel === void 0 ? 'h2' : _ref$headingLevel,
46
+ className = _ref.className,
47
+ rest = _objectWithoutProperties(_ref, _excluded);
48
+
40
49
  var classes = classNames('euiNotificationEvent', {
41
- 'euiNotificationEvent--withReadState': typeof isRead === 'boolean'
50
+ 'euiNotificationEvent--withReadState': typeof isRead === 'boolean',
51
+ className: className
42
52
  });
43
53
  var classesTitle = classNames('euiNotificationEvent__title', {
44
54
  'euiNotificationEvent__title--isRead': isRead
@@ -49,11 +59,11 @@ export var EuiNotificationEvent = function EuiNotificationEvent(_ref) {
49
59
  className: classesTitle,
50
60
  'data-test-subj': "".concat(id, "-notificationEventTitle")
51
61
  };
52
- return ___EmotionJSX("article", {
62
+ return ___EmotionJSX("article", _extends({
53
63
  "aria-labelledby": randomHeadingId,
54
64
  className: classes,
55
65
  key: id
56
- }, typeof isRead === 'boolean' && ___EmotionJSX("div", {
66
+ }, rest), typeof isRead === 'boolean' && ___EmotionJSX("div", {
57
67
  className: "euiNotificationEvent__readButton"
58
68
  }, !!onRead ? ___EmotionJSX(EuiNotificationEventReadButton, {
59
69
  isRead: isRead,
@@ -244,7 +254,16 @@ EuiNotificationEvent.propTypes = {
244
254
  /**
245
255
  * Object of props passed to the <span/> wrapping the button's content
246
256
  */
247
- contentProps: PropTypes.any,
257
+
258
+ /**
259
+ * Object of props passed to the <span/> wrapping the button's content
260
+ */
261
+ contentProps: PropTypes.shape({
262
+ className: PropTypes.string,
263
+ "aria-label": PropTypes.string,
264
+ "data-test-subj": PropTypes.string,
265
+ css: PropTypes.any
266
+ }),
248
267
 
249
268
  /**
250
269
  * Any `type` accepted by EuiIcon
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "children", "onClick", "headerZindexLocation", "maskRef", "css"];
1
+ var _excluded = ["className", "children", "headerZindexLocation", "maskRef", "css"];
2
2
 
3
3
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
4
 
@@ -28,90 +28,57 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
28
28
  * NOTE: We can't test this component because Enzyme doesn't support rendering
29
29
  * into portals.
30
30
  */
31
- import React, { useEffect, useRef, useState } from 'react';
31
+ import React, { useEffect, useState } from 'react';
32
32
  import PropTypes from "prop-types";
33
- import { createPortal } from 'react-dom';
34
33
  import classNames from 'classnames';
34
+ import { Global } from '@emotion/react';
35
35
  import { keysOf } from '../common';
36
- import { useCombinedRefs } from '../../services';
36
+ import { useCombinedRefs, useEuiTheme } from '../../services';
37
+ import { EuiPortal } from '../portal';
38
+ import { euiOverlayMaskStyles, euiOverlayMaskBodyStyles } from './overlay_mask.styles';
37
39
  import { jsx as ___EmotionJSX } from "@emotion/react";
38
40
  export var EuiOverlayMask = function EuiOverlayMask(_ref) {
39
41
  var className = _ref.className,
40
42
  children = _ref.children,
41
- onClick = _ref.onClick,
42
43
  _ref$headerZindexLoca = _ref.headerZindexLocation,
43
44
  headerZindexLocation = _ref$headerZindexLoca === void 0 ? 'above' : _ref$headerZindexLoca,
44
45
  maskRef = _ref.maskRef,
45
46
  css = _ref.css,
46
47
  rest = _objectWithoutProperties(_ref, _excluded);
47
48
 
48
- var overlayMaskNode = useRef();
49
- var combinedMaskRef = useCombinedRefs([overlayMaskNode, maskRef]);
50
-
51
- var _useState = useState(false),
49
+ var _useState = useState(null),
52
50
  _useState2 = _slicedToArray(_useState, 2),
53
- isPortalTargetReady = _useState2[0],
54
- setIsPortalTargetReady = _useState2[1];
55
-
56
- useEffect(function () {
57
- document.body.classList.add('euiBody-hasOverlayMask');
58
- return function () {
59
- document.body.classList.remove('euiBody-hasOverlayMask');
60
- };
61
- }, []);
62
- useEffect(function () {
63
- if (typeof document !== 'undefined') {
64
- combinedMaskRef(document.createElement('div'));
65
- }
66
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
67
-
68
- useEffect(function () {
69
- var portalTarget = overlayMaskNode.current;
70
-
71
- if (portalTarget) {
72
- document.body.appendChild(portalTarget);
73
- }
51
+ overlayMaskNode = _useState2[0],
52
+ setOverlayMaskNode = _useState2[1];
74
53
 
75
- setIsPortalTargetReady(true);
76
- return function () {
77
- if (portalTarget) {
78
- document.body.removeChild(portalTarget);
79
- }
80
- };
81
- }, []);
54
+ var combinedMaskRef = useCombinedRefs([setOverlayMaskNode, maskRef]);
55
+ var euiTheme = useEuiTheme();
56
+ var styles = euiOverlayMaskStyles(euiTheme);
57
+ var cssStyles = [styles.euiOverlayMask, styles["".concat(headerZindexLocation, "Header")]];
82
58
  useEffect(function () {
83
- if (!overlayMaskNode.current) return;
59
+ if (!overlayMaskNode) return;
84
60
  keysOf(rest).forEach(function (key) {
85
61
  if (typeof rest[key] !== 'string') {
86
62
  throw new Error("Unhandled property type. EuiOverlayMask property ".concat(key, " is not a string."));
87
63
  }
88
64
 
89
- if (overlayMaskNode.current) {
90
- overlayMaskNode.current.setAttribute(key, rest[key]);
65
+ if (overlayMaskNode) {
66
+ overlayMaskNode.setAttribute(key, rest[key]);
91
67
  }
92
68
  });
93
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
69
+ }, [overlayMaskNode]); // eslint-disable-line react-hooks/exhaustive-deps
94
70
 
95
71
  useEffect(function () {
96
- if (!overlayMaskNode.current) return;
97
- overlayMaskNode.current.className = classNames('euiOverlayMask', "euiOverlayMask--".concat(headerZindexLocation, "Header"), className);
98
- }, [className, headerZindexLocation]);
99
- useEffect(function () {
100
- var portalTarget = overlayMaskNode.current;
101
- if (!portalTarget || !onClick) return;
102
-
103
- var listener = function listener(e) {
104
- if (e.target === portalTarget) {
105
- onClick();
106
- }
107
- };
108
-
109
- portalTarget.addEventListener('click', listener);
110
- return function () {
111
- portalTarget.removeEventListener('click', listener);
112
- };
113
- }, [onClick]);
114
- return isPortalTargetReady ? ___EmotionJSX(React.Fragment, null, /*#__PURE__*/createPortal(children, overlayMaskNode.current)) : null;
72
+ if (!overlayMaskNode) return;
73
+ overlayMaskNode.className = classNames('euiOverlayMask', className);
74
+ }, [overlayMaskNode, className]);
75
+ return ___EmotionJSX(EuiPortal, {
76
+ portalRef: combinedMaskRef
77
+ }, ___EmotionJSX(Global, {
78
+ styles: euiOverlayMaskBodyStyles
79
+ }), ___EmotionJSX(Global, {
80
+ styles: cssStyles
81
+ }), children);
115
82
  };
116
83
  EuiOverlayMask.propTypes = {
117
84
  className: PropTypes.string,
@@ -119,11 +86,6 @@ EuiOverlayMask.propTypes = {
119
86
  "data-test-subj": PropTypes.string,
120
87
  css: PropTypes.any,
121
88
 
122
- /**
123
- * Function that applies to clicking the mask itself and not the children
124
- */
125
- onClick: PropTypes.func,
126
-
127
89
  /**
128
90
  * ReactNode to render as this component's content
129
91
  */
@@ -0,0 +1,28 @@
1
+ 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)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS, euiAnimFadeIn } from '../../global_styling';
12
+ import { transparentize } from '../../services';
13
+ export var euiOverlayMaskStyles = function euiOverlayMaskStyles(_ref) {
14
+ var euiTheme = _ref.euiTheme;
15
+ return {
16
+ euiOverlayMask: /*#__PURE__*/css(".euiOverlayMask{position:fixed;", logicalCSS('top', 0), " ", logicalCSS('left', 0), " ", logicalCSS('right', 0), " ", logicalCSS('bottom', 0), " display:flex;align-items:center;justify-content:center;", logicalCSS('padding-bottom', '10vh'), ";animation:", euiAnimFadeIn, " ", euiTheme.animation.fast, " ease-in;background:", transparentize(euiTheme.colors.ink, 0.5), ";};label:euiOverlayMask;"),
17
+ aboveHeader: /*#__PURE__*/css(".euiOverlayMask{z-index:", euiTheme.levels.mask, ";};label:aboveHeader;"),
18
+ belowHeader: /*#__PURE__*/css(".euiOverlayMask{z-index:", euiTheme.levels.maskBelowHeader, ";", logicalCSS('top', "".concat(euiTheme.base * 3, "px")), ";};label:belowHeader;")
19
+ };
20
+ };
21
+ export var euiOverlayMaskBodyStyles = process.env.NODE_ENV === "production" ? {
22
+ name: "131160-euiOverlayMaskBodyStyles",
23
+ styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;"
24
+ } : {
25
+ name: "131160-euiOverlayMaskBodyStyles",
26
+ styles: "body{overflow:hidden;};label:euiOverlayMaskBodyStyles;",
27
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
28
+ };
@@ -26,8 +26,7 @@ var horizontalPositionToClassNameMap = {
26
26
  };
27
27
 
28
28
  /**
29
- * **DEPRECATED**
30
- * Use EuiPageSection instead
29
+ * @deprecated Use EuiPageSection instead
31
30
  */
32
31
  export var EuiPageContent_Deprecated = function EuiPageContent_Deprecated(_ref) {
33
32
  var verticalPosition = _ref.verticalPosition,
@@ -30,8 +30,7 @@ var paddingSizeToClassNameMap = {
30
30
  export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
31
31
 
32
32
  /**
33
- * **DEPRECATED**
34
- * Use EuiPageSection instead
33
+ * @deprecated Use EuiPageSection instead
35
34
  */
36
35
  export var EuiPageContentBody_Deprecated = function EuiPageContentBody_Deprecated(_ref) {
37
36
  var children = _ref.children,
@@ -19,8 +19,7 @@ import classNames from 'classnames';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
20
 
21
21
  /**
22
- * **DEPRECATED**
23
- * Use EuiPageHeader instead
22
+ * @deprecated Use EuiPageHeader instead
24
23
  */
25
24
  export var EuiPageContentHeader_Deprecated = function EuiPageContentHeader_Deprecated(_ref) {
26
25
  var children = _ref.children,
@@ -19,8 +19,7 @@ import classNames from 'classnames';
19
19
  import { jsx as ___EmotionJSX } from "@emotion/react";
20
20
 
21
21
  /**
22
- * **DEPRECATED**
23
- * Use EuiPageHeader instead
22
+ * @deprecated Use EuiPageHeader instead
24
23
  */
25
24
  export var EuiPageContentHeaderSection_Deprecated = function EuiPageContentHeaderSection_Deprecated(_ref) {
26
25
  var children = _ref.children,
@@ -1,4 +1,4 @@
1
- var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps"];
1
+ var _excluded = ["children", "alignment", "restrictWidth", "bottomBorder", "paddingSize", "color", "grow", "contentProps", "component"];
2
2
 
3
3
  function _extends() { _extends = Object.assign || 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); }
4
4
 
@@ -34,6 +34,8 @@ export var EuiPageSection = function EuiPageSection(_ref) {
34
34
  _ref$grow = _ref.grow,
35
35
  grow = _ref$grow === void 0 ? false : _ref$grow,
36
36
  contentProps = _ref.contentProps,
37
+ _ref$component = _ref.component,
38
+ Component = _ref$component === void 0 ? 'section' : _ref$component,
37
39
  rest = _objectWithoutProperties(_ref, _excluded);
38
40
 
39
41
  // Set max-width as a style prop
@@ -46,7 +48,7 @@ export var EuiPageSection = function EuiPageSection(_ref) {
46
48
  var cssStyles = [styles.euiPageSection, grow && styles.grow, inlinePadding[paddingSize], bottomBorder === 'extended' && styles.border, alignment && styles[alignment], colors[color]];
47
49
  var contentStyles = euiPageSectionContentStyles();
48
50
  var cssContentStyles = [contentStyles.euiPageSection__content, blockPadding[paddingSize], bottomBorder === true && styles.border, alignment.toLowerCase().includes('center') && contentStyles.center, restrictWidth && contentStyles.restrictWidth];
49
- return ___EmotionJSX("div", _extends({
51
+ return ___EmotionJSX(Component, _extends({
50
52
  css: cssStyles
51
53
  }, rest), ___EmotionJSX("div", _extends({
52
54
  css: cssContentStyles
@@ -99,5 +101,15 @@ EuiPageSection.propTypes = {
99
101
  /**
100
102
  * Passed down to the div wrapper of the section contents
101
103
  */
102
- contentProps: PropTypes.any
104
+ contentProps: PropTypes.shape({
105
+ className: PropTypes.string,
106
+ "aria-label": PropTypes.string,
107
+ "data-test-subj": PropTypes.string,
108
+ css: PropTypes.any
109
+ }),
110
+
111
+ /**
112
+ * Sets which HTML element to render.
113
+ */
114
+ component: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.elementType.isRequired])
103
115
  };
@@ -27,8 +27,7 @@ var paddingSizeToClassNameMap = {
27
27
  export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
28
28
 
29
29
  /**
30
- * **DEPRECATED**
31
- * Use the new EuiPageSidebar instead
30
+ * @deprecated Use the new EuiPageSidebar in page/page_sidebar instead
32
31
  */
33
32
  export var EuiPageSideBar_Deprecated = function EuiPageSideBar_Deprecated(_ref) {
34
33
  var children = _ref.children,
@@ -38,7 +38,9 @@ export var TEMPLATES = ['default', 'centeredBody', 'centeredContent', 'empty'];
38
38
  /**
39
39
  * This component has been deprecated in favor of the new
40
40
  * namespaced version. You can still import this component
41
- * for a period of time by importing `as EuiPageTemplate`.
41
+ * until August 2023 by importing `as EuiPageTemplate`.
42
+ *
43
+ * @deprecated use EuiPageTemplate from page_template/page_template instead
42
44
  */
43
45
  export var EuiPageTemplate_Deprecated = function EuiPageTemplate_Deprecated(_ref) {
44
46
  var _pageBodyProps2;
@@ -103,6 +103,16 @@ _EuiPageEmptyPrompt.propTypes = {
103
103
  /**
104
104
  * Passed down to the div wrapper of the section contents
105
105
  */
106
- contentProps: PropTypes.any,
106
+ contentProps: PropTypes.shape({
107
+ className: PropTypes.string,
108
+ "aria-label": PropTypes.string,
109
+ "data-test-subj": PropTypes.string,
110
+ css: PropTypes.any
111
+ }),
112
+
113
+ /**
114
+ * Sets which HTML element to render.
115
+ */
116
+ component: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.elementType.isRequired]),
107
117
  panelled: PropTypes.bool
108
118
  };
@@ -299,7 +299,17 @@ _EuiPageSection.propTypes = {
299
299
  /**
300
300
  * Passed down to the div wrapper of the section contents
301
301
  */
302
- contentProps: PropTypes.any
302
+ contentProps: PropTypes.shape({
303
+ className: PropTypes.string,
304
+ "aria-label": PropTypes.string,
305
+ "data-test-subj": PropTypes.string,
306
+ css: PropTypes.any
307
+ }),
308
+
309
+ /**
310
+ * Sets which HTML element to render.
311
+ */
312
+ component: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.elementType.isRequired])
303
313
  };
304
314
 
305
315
  var _EuiPageHeader = function _EuiPageHeader(props) {
@@ -348,7 +358,13 @@ _EuiPageEmptyPrompt.propTypes = {
348
358
  paddingSize: PropTypes.any,
349
359
  alignment: PropTypes.any,
350
360
  grow: PropTypes.bool,
351
- contentProps: PropTypes.any,
361
+ contentProps: PropTypes.shape({
362
+ className: PropTypes.string,
363
+ "aria-label": PropTypes.string,
364
+ "data-test-subj": PropTypes.string,
365
+ css: PropTypes.any
366
+ }),
367
+ component: PropTypes.oneOfType([PropTypes.any.isRequired, PropTypes.elementType.isRequired]),
352
368
  panelled: PropTypes.bool
353
369
  };
354
370
 
@@ -26,8 +26,10 @@ import { EuiPaginationButton } from './pagination_button';
26
26
  import { EuiI18n, useEuiI18n } from '../i18n';
27
27
  import { EuiText } from '../text';
28
28
  import { EuiPaginationButtonArrow } from './pagination_button_arrow';
29
- import { useIsWithinBreakpoints } from '../../services';
29
+ import { useIsWithinBreakpoints, useEuiTheme } from '../../services';
30
30
  import { EuiScreenReaderOnly } from '../accessibility';
31
+ import { euiPaginationStyles } from './pagination.styles';
32
+ import { euiPaginationButtonStyles } from './pagination_button.styles';
31
33
  import { jsx as ___EmotionJSX } from "@emotion/react";
32
34
  var MAX_VISIBLE_PAGES = 5;
33
35
  var NUMBER_SURROUNDING_PAGES = Math.floor(MAX_VISIBLE_PAGES * 0.5);
@@ -45,7 +47,13 @@ export var EuiPagination = function EuiPagination(_ref) {
45
47
  responsive = _ref$responsive === void 0 ? ['xs', 's'] : _ref$responsive,
46
48
  rest = _objectWithoutProperties(_ref, _excluded);
47
49
 
48
- var isResponsive = useIsWithinBreakpoints(responsive, !!responsive); // Force to `compressed` version if specified or within the responsive breakpoints
50
+ var isResponsive = useIsWithinBreakpoints(responsive, !!responsive);
51
+ var euiTheme = useEuiTheme();
52
+ var paginationStyles = euiPaginationStyles(euiTheme);
53
+
54
+ var _euiPaginationButtonS = euiPaginationButtonStyles(euiTheme),
55
+ isPlaceholder = _euiPaginationButtonS.isPlaceholder; // Force to `compressed` version if specified or within the responsive breakpoints
56
+
49
57
 
50
58
  var compressed = _compressed || isResponsive;
51
59
 
@@ -114,6 +122,7 @@ export var EuiPagination = function EuiPagination(_ref) {
114
122
  if (compressed) {
115
123
  centerPageCount = ___EmotionJSX(EuiText, {
116
124
  size: "s",
125
+ css: paginationStyles.euiPagination__compressedText,
117
126
  className: "euiPagination__compressedText"
118
127
  }, ___EmotionJSX(EuiI18n, {
119
128
  token: "euiPagination.pageOfTotalCompressed",
@@ -154,7 +163,8 @@ export var EuiPagination = function EuiPagination(_ref) {
154
163
  }, function (firstRangeAriaLabel) {
155
164
  return ___EmotionJSX("li", {
156
165
  "aria-label": firstRangeAriaLabel,
157
- className: "euiPaginationButton-isPlaceholder euiPagination__item"
166
+ className: "euiPagination__item",
167
+ css: isPlaceholder
158
168
  }, "\u2026");
159
169
  }));
160
170
  } else if (firstPageInRange === 2) {
@@ -185,7 +195,8 @@ export var EuiPagination = function EuiPagination(_ref) {
185
195
  }, function (lastRangeAriaLabel) {
186
196
  return ___EmotionJSX("li", {
187
197
  "aria-label": lastRangeAriaLabel,
188
- className: "euiPaginationButton-isPlaceholder euiPagination__item"
198
+ className: "euiPagination__item",
199
+ css: isPlaceholder
189
200
  }, "\u2026");
190
201
  }));
191
202
  }
@@ -205,6 +216,7 @@ export var EuiPagination = function EuiPagination(_ref) {
205
216
  });
206
217
 
207
218
  centerPageCount = ___EmotionJSX("ul", _extends({}, accessibleName, {
219
+ css: paginationStyles.euiPagination__list,
208
220
  className: "euiPagination__list"
209
221
  }), firstPageButtons, selectablePages, lastPageButtons);
210
222
  }
@@ -229,6 +241,7 @@ export var EuiPagination = function EuiPagination(_ref) {
229
241
 
230
242
  var accessiblePageCount = "".concat(accessiblePageString(), " ").concat(ofLabel, " ").concat(accessibleCollectionString);
231
243
  return ___EmotionJSX("nav", _extends({
244
+ css: [paginationStyles.euiPagination, ";label:EuiPagination;"],
232
245
  className: classes
233
246
  }, rest), ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", {
234
247
  "aria-atomic": "true",
@@ -0,0 +1,31 @@
1
+ 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)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { logicalCSS, logicalCSSWithFallback, euiScrollBarStyles } from '../../global_styling';
12
+
13
+ var _ref = process.env.NODE_ENV === "production" ? {
14
+ name: "1dbd2rc-euiPagination__list",
15
+ styles: "display:flex;align-items:baseline;label:euiPagination__list;"
16
+ } : {
17
+ name: "1dbd2rc-euiPagination__list",
18
+ styles: "display:flex;align-items:baseline;label:euiPagination__list;",
19
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
+ };
21
+
22
+ export var euiPaginationStyles = function euiPaginationStyles(euiThemeContext) {
23
+ var euiTheme = euiThemeContext.euiTheme;
24
+ return {
25
+ // Base
26
+ euiPagination: /*#__PURE__*/css(euiScrollBarStyles(euiThemeContext), ";display:flex;align-items:center;", logicalCSSWithFallback('overflow-y', 'hidden'), ";", logicalCSSWithFallback('overflow-x', 'auto'), ";;label:euiPagination;"),
27
+ // Elements
28
+ euiPagination__compressedText: /*#__PURE__*/css("display:inline-flex;align-items:center;line-height:1!important;>span{", logicalCSS('margin-horizontal', euiTheme.size.s), ";font-weight:", euiTheme.font.weight.semiBold, ";&:first-of-type{color:", euiTheme.colors.primaryText, ";}};label:euiPagination__compressedText;"),
29
+ euiPagination__list: _ref
30
+ };
31
+ };