@elastic/eui 92.2.0 → 93.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 (157) hide show
  1. package/dist/eui_theme_dark.css +0 -200
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -200
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/basic_table/basic_table.js +0 -9
  6. package/es/components/basic_table/in_memory_table.js +0 -10
  7. package/es/components/beacon/beacon.js +9 -6
  8. package/es/components/breadcrumbs/breadcrumb.js +0 -10
  9. package/es/components/breadcrumbs/breadcrumbs.js +0 -10
  10. package/es/components/code/code.js +2 -2
  11. package/es/components/code/code.styles.js +2 -4
  12. package/es/components/code/code_block.js +5 -3
  13. package/es/components/code/code_block.styles.js +4 -7
  14. package/es/components/code/code_block_controls.js +2 -2
  15. package/es/components/code/code_block_controls.styles.js +2 -4
  16. package/es/components/code/code_block_full_screen.js +2 -2
  17. package/es/components/code/code_syntax.styles.js +39 -34
  18. package/es/components/comment_list/comment_event.js +3 -2
  19. package/es/components/comment_list/comment_event.styles.js +2 -18
  20. package/es/components/context_menu/context_menu.js +2 -6
  21. package/es/components/context_menu/context_menu_item.js +2 -14
  22. package/es/components/empty_prompt/empty_prompt.js +62 -65
  23. package/es/components/empty_prompt/empty_prompt.styles.js +115 -0
  24. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +0 -10
  25. package/es/components/header/header_links/header_links.js +0 -10
  26. package/es/components/page/page_header/page_header_content.js +0 -10
  27. package/es/components/popover/popover.js +3 -15
  28. package/es/components/search_bar/search_bar.js +36 -32
  29. package/es/components/search_bar/search_bar.styles.js +22 -0
  30. package/es/components/text_truncate/text_truncate.js +4 -1
  31. package/es/components/tour/_tour_footer.js +97 -0
  32. package/es/components/tour/_tour_footer.styles.js +23 -0
  33. package/es/components/tour/_tour_header.js +37 -0
  34. package/es/components/tour/_tour_header.styles.js +20 -0
  35. package/es/components/tour/tour.styles.js +5 -28
  36. package/es/components/tour/tour_step.js +45 -130
  37. package/es/global_styling/mixins/_color.js +46 -13
  38. package/eui.d.ts +125 -66
  39. package/i18ntokens.json +94 -148
  40. package/lib/components/basic_table/basic_table.js +0 -9
  41. package/lib/components/basic_table/in_memory_table.js +0 -10
  42. package/lib/components/beacon/beacon.js +11 -6
  43. package/lib/components/breadcrumbs/breadcrumb.js +0 -10
  44. package/lib/components/code/code.js +2 -2
  45. package/lib/components/code/code.styles.js +2 -4
  46. package/lib/components/code/code_block.js +5 -3
  47. package/lib/components/code/code_block.styles.js +4 -7
  48. package/lib/components/code/code_block_controls.js +2 -2
  49. package/lib/components/code/code_block_controls.styles.js +2 -4
  50. package/lib/components/code/code_block_full_screen.js +2 -2
  51. package/lib/components/code/code_syntax.styles.js +40 -36
  52. package/lib/components/comment_list/comment_event.js +2 -1
  53. package/lib/components/comment_list/comment_event.styles.js +3 -20
  54. package/lib/components/context_menu/context_menu.js +2 -6
  55. package/lib/components/context_menu/context_menu_item.js +2 -14
  56. package/lib/components/empty_prompt/empty_prompt.js +64 -64
  57. package/lib/components/empty_prompt/empty_prompt.styles.js +120 -0
  58. package/lib/components/popover/popover.js +3 -15
  59. package/lib/components/search_bar/search_bar.js +37 -33
  60. package/lib/components/search_bar/search_bar.styles.js +30 -0
  61. package/lib/components/text_truncate/text_truncate.js +4 -1
  62. package/lib/components/tour/_tour_footer.js +105 -0
  63. package/lib/components/tour/_tour_footer.styles.js +31 -0
  64. package/lib/components/tour/_tour_header.js +48 -0
  65. package/lib/components/tour/_tour_header.styles.js +27 -0
  66. package/lib/components/tour/tour.styles.js +7 -32
  67. package/lib/components/tour/tour_step.js +42 -117
  68. package/lib/global_styling/mixins/_color.js +50 -15
  69. package/optimize/es/components/basic_table/basic_table.js +0 -9
  70. package/optimize/es/components/basic_table/in_memory_table.js +0 -10
  71. package/optimize/es/components/beacon/beacon.js +9 -6
  72. package/optimize/es/components/code/code.js +2 -2
  73. package/optimize/es/components/code/code.styles.js +2 -4
  74. package/optimize/es/components/code/code_block.js +5 -3
  75. package/optimize/es/components/code/code_block.styles.js +4 -7
  76. package/optimize/es/components/code/code_block_controls.js +2 -2
  77. package/optimize/es/components/code/code_block_controls.styles.js +2 -4
  78. package/optimize/es/components/code/code_block_full_screen.js +2 -2
  79. package/optimize/es/components/code/code_syntax.styles.js +39 -34
  80. package/optimize/es/components/comment_list/comment_event.js +3 -2
  81. package/optimize/es/components/comment_list/comment_event.styles.js +2 -18
  82. package/optimize/es/components/context_menu/context_menu.js +2 -6
  83. package/optimize/es/components/context_menu/context_menu_item.js +2 -6
  84. package/optimize/es/components/empty_prompt/empty_prompt.js +62 -62
  85. package/optimize/es/components/empty_prompt/empty_prompt.styles.js +112 -0
  86. package/optimize/es/components/popover/popover.js +3 -5
  87. package/optimize/es/components/search_bar/search_bar.js +36 -32
  88. package/optimize/es/components/search_bar/search_bar.styles.js +22 -0
  89. package/optimize/es/components/text_truncate/text_truncate.js +4 -1
  90. package/optimize/es/components/tour/_tour_footer.js +89 -0
  91. package/optimize/es/components/tour/_tour_footer.styles.js +23 -0
  92. package/optimize/es/components/tour/_tour_header.js +33 -0
  93. package/optimize/es/components/tour/_tour_header.styles.js +20 -0
  94. package/optimize/es/components/tour/tour.styles.js +5 -28
  95. package/optimize/es/components/tour/tour_step.js +45 -113
  96. package/optimize/es/global_styling/mixins/_color.js +46 -13
  97. package/optimize/lib/components/basic_table/basic_table.js +0 -9
  98. package/optimize/lib/components/basic_table/in_memory_table.js +0 -10
  99. package/optimize/lib/components/beacon/beacon.js +12 -6
  100. package/optimize/lib/components/code/code.js +2 -2
  101. package/optimize/lib/components/code/code.styles.js +2 -4
  102. package/optimize/lib/components/code/code_block.js +5 -3
  103. package/optimize/lib/components/code/code_block.styles.js +4 -7
  104. package/optimize/lib/components/code/code_block_controls.js +2 -2
  105. package/optimize/lib/components/code/code_block_controls.styles.js +2 -4
  106. package/optimize/lib/components/code/code_block_full_screen.js +2 -2
  107. package/optimize/lib/components/code/code_syntax.styles.js +40 -36
  108. package/optimize/lib/components/comment_list/comment_event.js +2 -1
  109. package/optimize/lib/components/comment_list/comment_event.styles.js +3 -20
  110. package/optimize/lib/components/context_menu/context_menu.js +2 -6
  111. package/optimize/lib/components/context_menu/context_menu_item.js +2 -6
  112. package/optimize/lib/components/empty_prompt/empty_prompt.js +65 -62
  113. package/optimize/lib/components/empty_prompt/empty_prompt.styles.js +118 -0
  114. package/optimize/lib/components/popover/popover.js +3 -5
  115. package/optimize/lib/components/search_bar/search_bar.js +37 -33
  116. package/optimize/lib/components/search_bar/search_bar.styles.js +30 -0
  117. package/optimize/lib/components/text_truncate/text_truncate.js +4 -1
  118. package/optimize/lib/components/tour/_tour_footer.js +100 -0
  119. package/optimize/lib/components/tour/_tour_footer.styles.js +31 -0
  120. package/optimize/lib/components/tour/_tour_header.js +43 -0
  121. package/optimize/lib/components/tour/_tour_header.styles.js +27 -0
  122. package/optimize/lib/components/tour/tour.styles.js +7 -32
  123. package/optimize/lib/components/tour/tour_step.js +42 -110
  124. package/optimize/lib/global_styling/mixins/_color.js +50 -15
  125. package/package.json +1 -1
  126. package/src/components/index.scss +0 -2
  127. package/test-env/components/basic_table/basic_table.js +0 -9
  128. package/test-env/components/basic_table/in_memory_table.js +0 -10
  129. package/test-env/components/beacon/beacon.js +12 -6
  130. package/test-env/components/breadcrumbs/breadcrumb.js +0 -10
  131. package/test-env/components/code/code.styles.js +2 -4
  132. package/test-env/components/code/code_block.styles.js +4 -7
  133. package/test-env/components/code/code_block_controls.js +2 -2
  134. package/test-env/components/code/code_block_controls.styles.js +2 -4
  135. package/test-env/components/code/code_block_full_screen.js +2 -2
  136. package/test-env/components/code/code_syntax.styles.js +40 -36
  137. package/test-env/components/comment_list/comment_event.js +2 -1
  138. package/test-env/components/comment_list/comment_event.styles.js +3 -20
  139. package/test-env/components/context_menu/context_menu.js +2 -6
  140. package/test-env/components/context_menu/context_menu_item.js +2 -14
  141. package/test-env/components/empty_prompt/empty_prompt.js +65 -62
  142. package/test-env/components/empty_prompt/empty_prompt.styles.js +118 -0
  143. package/test-env/components/popover/popover.js +3 -15
  144. package/test-env/components/search_bar/search_bar.js +37 -33
  145. package/test-env/components/search_bar/search_bar.styles.js +30 -0
  146. package/test-env/components/text_truncate/text_truncate.js +4 -1
  147. package/test-env/components/tour/_tour_footer.js +100 -0
  148. package/test-env/components/tour/_tour_footer.styles.js +31 -0
  149. package/test-env/components/tour/_tour_header.js +48 -0
  150. package/test-env/components/tour/_tour_header.styles.js +27 -0
  151. package/test-env/components/tour/tour.styles.js +7 -32
  152. package/test-env/components/tour/tour_step.js +42 -114
  153. package/test-env/global_styling/mixins/_color.js +50 -15
  154. package/src/components/empty_prompt/_empty_prompt.scss +0 -128
  155. package/src/components/empty_prompt/_index.scss +0 -1
  156. package/src/components/search_bar/_index.scss +0 -1
  157. package/src/components/search_bar/_search_bar.scss +0 -10
@@ -1,10 +1,5 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
1
  var _excluded = ["icon", "iconType", "iconColor", "title", "titleSize", "paddingSize", "body", "actions", "className", "layout", "hasBorder", "color", "footer"];
3
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
5
  /*
@@ -15,10 +10,10 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
15
10
  * Side Public License, v 1.
16
11
  */
17
12
 
18
- import React from 'react';
13
+ import React, { useMemo } from 'react';
19
14
  import PropTypes from "prop-types";
20
15
  import classNames from 'classnames';
21
- import { keysOf } from '../common';
16
+ import { useEuiTheme } from '../../services';
22
17
  import { EuiTitle } from '../title';
23
18
  import { EuiFlexGroup, EuiFlexItem } from '../flex';
24
19
  import { EuiSpacer } from '../spacer';
@@ -26,14 +21,9 @@ import { EuiIcon } from '../icon';
26
21
  import { isNamedColor } from '../icon/named_colors';
27
22
  import { EuiText } from '../text';
28
23
  import { EuiPanel } from '../panel/panel';
24
+ import { euiEmptyPromptStyles } from './empty_prompt.styles';
29
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
30
- var paddingSizeToClassNameMap = {
31
- none: null,
32
- s: 'euiEmptyPrompt--paddingSmall',
33
- m: 'euiEmptyPrompt--paddingMedium',
34
- l: 'euiEmptyPrompt--paddingLarge'
35
- };
36
- export var PADDING_SIZES = keysOf(paddingSizeToClassNameMap);
26
+ export var PADDING_SIZES = ['none', 's', 'm', 'l'];
37
27
  export var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
38
28
  var icon = _ref.icon,
39
29
  iconType = _ref.iconType,
@@ -53,41 +43,41 @@ export var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
53
43
  color = _ref$color === void 0 ? 'transparent' : _ref$color,
54
44
  footer = _ref.footer,
55
45
  rest = _objectWithoutProperties(_ref, _excluded);
56
- var isVerticalLayout = layout === 'vertical';
46
+ var classes = classNames('euiEmptyPrompt', className);
47
+ var euiTheme = useEuiTheme();
48
+ var styles = useMemo(function () {
49
+ return euiEmptyPromptStyles(euiTheme);
50
+ }, [euiTheme]);
51
+ var cssStyles = [styles.euiEmptyPrompt, styles[layout]];
52
+ var mainStyles = [styles.main.euiEmptyPrompt__main, styles.main[layout], styles.main[paddingSize], layout === 'horizontal' && styles.main.horizontalPadding[paddingSize]];
53
+ var contentStyles = [styles.content.euiEmptyPrompt__content, styles.content[layout]];
54
+
57
55
  // Default the iconColor to `subdued`,
58
56
  // otherwise try to match the iconColor with the panel color unless iconColor is specified
59
57
  var iconColor = _iconColor !== null && _iconColor !== void 0 ? _iconColor : isNamedColor(color) ? color : 'subdued';
60
- var iconNode = iconType ? ___EmotionJSX(EuiIcon, {
61
- type: iconType,
62
- size: "xxl",
63
- color: iconColor
64
- }) : icon;
65
- var titleNode;
66
- var bodyNode;
67
- if (body || title) {
68
- if (title) {
69
- titleNode = ___EmotionJSX(EuiTitle, {
70
- size: titleSize
71
- }, title);
72
- }
73
- if (body) {
74
- bodyNode = ___EmotionJSX(React.Fragment, null, title && ___EmotionJSX(EuiSpacer, {
75
- size: "m"
76
- }), ___EmotionJSX(EuiText, {
77
- color: "subdued"
78
- }, body));
79
- }
80
- }
81
- var actionsNode;
82
- if (actions) {
83
- var actionsRow;
58
+ var iconNode = useMemo(function () {
59
+ if (!iconType && !icon) return null;
60
+ var iconStyles = [styles.icon.euiEmptyPrompt__icon, styles.icon[layout]];
61
+ return ___EmotionJSX("div", {
62
+ className: "euiEmptyPrompt__icon",
63
+ css: iconStyles
64
+ }, iconType ? ___EmotionJSX(EuiIcon, {
65
+ type: iconType,
66
+ size: "xxl",
67
+ color: iconColor
68
+ }) : icon);
69
+ }, [icon, iconType, iconColor, layout, styles.icon]);
70
+ var actionsNode = useMemo(function () {
71
+ if (!actions) return null;
84
72
  if (Array.isArray(actions)) {
85
- actionsRow = ___EmotionJSX(EuiFlexGroup, {
73
+ var actionStyles = [styles.actions.euiEmptyPrompt__actions, styles.actions[layout]];
74
+ return ___EmotionJSX(EuiFlexGroup, {
86
75
  className: "euiEmptyPrompt__actions",
76
+ css: actionStyles,
87
77
  gutterSize: "m",
88
78
  alignItems: "center",
89
79
  justifyContent: "center",
90
- direction: isVerticalLayout ? 'column' : 'row'
80
+ direction: layout === 'vertical' ? 'column' : 'row'
91
81
  }, actions.map(function (action, index) {
92
82
  return ___EmotionJSX(EuiFlexItem, {
93
83
  key: index,
@@ -95,32 +85,39 @@ export var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
95
85
  }, action);
96
86
  }));
97
87
  } else {
98
- actionsRow = actions;
88
+ return actions;
99
89
  }
100
- actionsNode = ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiSpacer, {
101
- size: "l"
102
- }), actionsRow);
103
- }
104
- var contentNodes = ___EmotionJSX(React.Fragment, null, titleNode, bodyNode, actionsNode);
105
- var classes = classNames('euiEmptyPrompt', ["euiEmptyPrompt--".concat(layout)], paddingSizeToClassNameMap[paddingSize], className);
106
- var panelProps = _objectSpread({
90
+ }, [actions, layout, styles.actions]);
91
+ var footerNode = useMemo(function () {
92
+ if (!footer) return null;
93
+ var footerStyles = [styles.footer.euiEmptyPrompt__footer, styles.footer[paddingSize], styles.footer[color], color === 'transparent' && !hasBorder && styles.footer.roundedBorders];
94
+ return ___EmotionJSX("div", {
95
+ className: "euiEmptyPrompt__footer",
96
+ css: footerStyles
97
+ }, footer);
98
+ }, [footer, paddingSize, color, hasBorder, styles.footer]);
99
+ return ___EmotionJSX(EuiPanel, _extends({
100
+ css: cssStyles,
107
101
  className: classes,
108
102
  color: color,
109
- paddingSize: 'none',
110
- hasBorder: hasBorder,
111
- grow: false
112
- }, rest);
113
- return ___EmotionJSX(EuiPanel, panelProps, ___EmotionJSX("div", {
114
- className: "euiEmptyPrompt__main"
115
- }, iconNode && ___EmotionJSX("div", {
116
- className: "euiEmptyPrompt__icon"
117
- }, iconNode), ___EmotionJSX("div", {
118
- className: "euiEmptyPrompt__content"
119
- }, ___EmotionJSX("div", {
120
- className: "euiEmptyPrompt__contentInner"
121
- }, contentNodes))), footer && ___EmotionJSX("div", {
122
- className: "euiEmptyPrompt__footer"
123
- }, footer));
103
+ paddingSize: "none",
104
+ grow: false,
105
+ hasBorder: hasBorder
106
+ }, rest), ___EmotionJSX("div", {
107
+ className: "euiEmptyPrompt__main",
108
+ css: mainStyles
109
+ }, iconNode, ___EmotionJSX("div", {
110
+ className: "euiEmptyPrompt__content",
111
+ css: contentStyles
112
+ }, title && ___EmotionJSX(EuiTitle, {
113
+ size: titleSize
114
+ }, title), title && body && ___EmotionJSX(EuiSpacer, {
115
+ size: "m"
116
+ }), body && ___EmotionJSX(EuiText, {
117
+ color: "subdued"
118
+ }, body), actionsNode && (body || title) && ___EmotionJSX(EuiSpacer, {
119
+ size: "l"
120
+ }), actionsNode)), footerNode);
124
121
  };
125
122
  EuiEmptyPrompt.propTypes = {
126
123
  className: PropTypes.string,
@@ -0,0 +1,115 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ 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)."; }
8
+ /*
9
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
10
+ * or more contributor license agreements. Licensed under the Elastic License
11
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
12
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
13
+ * Side Public License, v 1.
14
+ */
15
+
16
+ import { css } from '@emotion/react';
17
+ import { euiBreakpoint, euiPaddingSize, euiBorderColor, logicalCSS, mathWithUnits } from '../../global_styling';
18
+ var _ref = process.env.NODE_ENV === "production" ? {
19
+ name: "x4698b-roundedBorders",
20
+ styles: "border-radius:inherit;label:roundedBorders;"
21
+ } : {
22
+ name: "x4698b-roundedBorders",
23
+ styles: "border-radius:inherit;label:roundedBorders;",
24
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
25
+ };
26
+ var _ref2 = process.env.NODE_ENV === "production" ? {
27
+ name: "zv101j-euiEmptyPrompt__footer",
28
+ styles: "border-end-end-radius:inherit;border-end-start-radius:inherit;label:euiEmptyPrompt__footer;"
29
+ } : {
30
+ name: "zv101j-euiEmptyPrompt__footer",
31
+ styles: "border-end-end-radius:inherit;border-end-start-radius:inherit;label:euiEmptyPrompt__footer;",
32
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
+ };
34
+ var _ref3 = process.env.NODE_ENV === "production" ? {
35
+ name: "1rdinfv-vertical",
36
+ styles: "margin:auto;label:vertical;"
37
+ } : {
38
+ name: "1rdinfv-vertical",
39
+ styles: "margin:auto;label:vertical;",
40
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
41
+ };
42
+ var _ref4 = process.env.NODE_ENV === "production" ? {
43
+ name: "1w25ahh-vertical",
44
+ styles: "justify-content:center;label:vertical;"
45
+ } : {
46
+ name: "1w25ahh-vertical",
47
+ styles: "justify-content:center;label:vertical;",
48
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
49
+ };
50
+ var _ref5 = process.env.NODE_ENV === "production" ? {
51
+ name: "1o9qvqj-euiEmptyPrompt__main",
52
+ styles: "display:flex;flex-direction:column;label:euiEmptyPrompt__main;"
53
+ } : {
54
+ name: "1o9qvqj-euiEmptyPrompt__main",
55
+ styles: "display:flex;flex-direction:column;label:euiEmptyPrompt__main;",
56
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
57
+ };
58
+ export var euiEmptyPromptStyles = function euiEmptyPromptStyles(euiThemeContext) {
59
+ var euiTheme = euiThemeContext.euiTheme;
60
+ var iconMaxWidth = mathWithUnits(euiTheme.size.l, function (x) {
61
+ return x * 15;
62
+ });
63
+ var generatePaddingStyles = function generatePaddingStyles() {
64
+ var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'padding';
65
+ return {
66
+ none: null,
67
+ s: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 's'), ";;label:s;"),
68
+ m: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'm'), ";;label:m;"),
69
+ l: /*#__PURE__*/css(property, ":", euiPaddingSize(euiThemeContext, 'l'), ";;label:l;")
70
+ };
71
+ };
72
+ var generateFooterBorder = function generateFooterBorder(color) {
73
+ return "".concat(euiTheme.border.width.thin, " solid ").concat(euiBorderColor(euiThemeContext, color));
74
+ };
75
+ return {
76
+ euiEmptyPrompt: /*#__PURE__*/css("text-align:center;margin:auto;", euiBreakpoint(euiThemeContext, ['l', 'xl']), "{", logicalCSS('max-width', 'max-content'), ";};label:euiEmptyPrompt;"),
77
+ vertical: /*#__PURE__*/css(";label:vertical;"),
78
+ horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{justify-content:flex-start;text-align:start;};label:horizontal;"),
79
+ main: _objectSpread(_objectSpread({
80
+ euiEmptyPrompt__main: _ref5,
81
+ vertical: _ref4,
82
+ horizontal: /*#__PURE__*/css("align-items:center;", euiBreakpoint(euiThemeContext, ['l', 'xl']), "{flex-direction:row-reverse;};label:horizontal;")
83
+ }, generatePaddingStyles()), {}, {
84
+ horizontalPadding: generatePaddingStyles('gap')
85
+ }),
86
+ content: {
87
+ euiEmptyPrompt__content: /*#__PURE__*/css(logicalCSS('max-width', '36em'), ";;label:euiEmptyPrompt__content;"),
88
+ vertical: _ref3,
89
+ horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{padding-block:", euiTheme.size.l, ";padding-inline:0;};label:horizontal;")
90
+ },
91
+ icon: {
92
+ euiEmptyPrompt__icon: /*#__PURE__*/css(logicalCSS('max-width', iconMaxWidth), " margin:auto;&>*{flex-shrink:1;", logicalCSS('max-width', '100%'), ";};label:euiEmptyPrompt__icon;"),
93
+ vertical: /*#__PURE__*/css(logicalCSS('margin-bottom', euiTheme.size.base), ";;label:vertical;"),
94
+ horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{", logicalCSS('min-width', '40%'), " ", logicalCSS('max-width', '50%'), "&&>*{", logicalCSS('max-width', iconMaxWidth), ";}};label:horizontal;")
95
+ },
96
+ actions: {
97
+ euiEmptyPrompt__actions: /*#__PURE__*/css(";label:euiEmptyPrompt__actions;"),
98
+ vertical: /*#__PURE__*/css(";label:vertical;"),
99
+ horizontal: /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['l', 'xl']), "{justify-content:flex-start;};label:horizontal;")
100
+ },
101
+ footer: _objectSpread({
102
+ euiEmptyPrompt__footer: _ref2,
103
+ roundedBorders: _ref,
104
+ // Colors
105
+ transparent: /*#__PURE__*/css("background-color:", euiTheme.colors.body, ";;label:transparent;"),
106
+ plain: /*#__PURE__*/css("background-color:", euiTheme.colors.body, ";;label:plain;"),
107
+ subdued: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('subdued')), ";;label:subdued;"),
108
+ primary: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('primary')), ";;label:primary;"),
109
+ accent: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('accent')), ";;label:accent;"),
110
+ danger: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('danger')), ";;label:danger;"),
111
+ warning: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('warning')), ";;label:warning;"),
112
+ success: /*#__PURE__*/css(logicalCSS('border-top', generateFooterBorder('success')), ";;label:success;")
113
+ }, generatePaddingStyles())
114
+ };
115
+ };
@@ -99,12 +99,6 @@ EuiHeaderBreadcrumbs.propTypes = {
99
99
  * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
100
100
  */
101
101
  popoverProps: PropTypes.shape({
102
- /**
103
- * Class name passed to the direct parent of the button
104
- *
105
- * @deprecated Use `className` instead
106
- */
107
- anchorClassName: PropTypes.string,
108
102
  /**
109
103
  * Alignment of the popover and arrow relative to the button
110
104
  */
@@ -114,10 +108,6 @@ EuiHeaderBreadcrumbs.propTypes = {
114
108
  * Intended for use with inputs as anchors, e.g. EuiInputPopover
115
109
  */
116
110
  attachToAnchor: PropTypes.bool,
117
- /**
118
- * @deprecated Use `popoverRef` instead
119
- */
120
- buttonRef: PropTypes.any,
121
111
  /**
122
112
  * Restrict the popover's position within this element
123
113
  */
@@ -130,12 +130,6 @@ EuiHeaderLinks.propTypes = {
130
130
  * Extend the functionality of the EuiPopover
131
131
  */
132
132
  popoverProps: PropTypes.shape({
133
- /**
134
- * Class name passed to the direct parent of the button
135
- *
136
- * @deprecated Use `className` instead
137
- */
138
- anchorClassName: PropTypes.string,
139
133
  /**
140
134
  * Alignment of the popover and arrow relative to the button
141
135
  */
@@ -145,10 +139,6 @@ EuiHeaderLinks.propTypes = {
145
139
  * Intended for use with inputs as anchors, e.g. EuiInputPopover
146
140
  */
147
141
  attachToAnchor: PropTypes.bool,
148
- /**
149
- * @deprecated Use `popoverRef` instead
150
- */
151
- buttonRef: PropTypes.any,
152
142
  /**
153
143
  * Restrict the popover's position within this element
154
144
  */
@@ -311,12 +311,6 @@ EuiPageHeaderContent.propTypes = {
311
311
  * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
312
312
  */
313
313
  popoverProps: PropTypes.shape({
314
- /**
315
- * Class name passed to the direct parent of the button
316
- *
317
- * @deprecated Use `className` instead
318
- */
319
- anchorClassName: PropTypes.string,
320
314
  /**
321
315
  * Alignment of the popover and arrow relative to the button
322
316
  */
@@ -326,10 +320,6 @@ EuiPageHeaderContent.propTypes = {
326
320
  * Intended for use with inputs as anchors, e.g. EuiInputPopover
327
321
  */
328
322
  attachToAnchor: PropTypes.bool,
329
- /**
330
- * @deprecated Use `popoverRef` instead
331
- */
332
- buttonRef: PropTypes.any,
333
323
  /**
334
324
  * Restrict the popover's position within this element
335
325
  */
@@ -1,5 +1,5 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- var _excluded = ["anchorClassName", "anchorPosition", "button", "buttonRef", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "repositionToCrossAxis", "hasDragDrop", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
2
+ var _excluded = ["anchorPosition", "button", "insert", "isOpen", "ownFocus", "children", "className", "closePopover", "panelClassName", "panelPaddingSize", "panelProps", "panelRef", "panelStyle", "popoverScreenReaderText", "popoverRef", "hasArrow", "arrowChildren", "repositionOnScroll", "repositionToCrossAxis", "hasDragDrop", "zIndex", "attachToAnchor", "display", "offset", "onPositionChange", "buffer", "aria-label", "aria-labelledby", "container", "focusTrapProps", "initialFocus", "tabIndex"];
3
3
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
4
  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; }
5
5
  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; }
@@ -277,7 +277,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
277
277
  });
278
278
  _defineProperty(_assertThisInitialized(_this), "popoverRef", function (node) {
279
279
  _this.button = node;
280
- setMultipleRefs([_this.props.popoverRef, _this.props.buttonRef], node);
280
+ setMultipleRefs([_this.props.popoverRef], node);
281
281
  });
282
282
  _this.state = {
283
283
  prevProps: {
@@ -358,10 +358,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
358
358
  var _panelProps$tabIndex,
359
359
  _this4 = this;
360
360
  var _this$props = this.props,
361
- anchorClassName = _this$props.anchorClassName,
362
361
  anchorPosition = _this$props.anchorPosition,
363
362
  button = _this$props.button,
364
- buttonRef = _this$props.buttonRef,
365
363
  insert = _this$props.insert,
366
364
  isOpen = _this$props.isOpen,
367
365
  ownFocus = _this$props.ownFocus,
@@ -401,7 +399,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
401
399
  }];
402
400
  var classes = classNames('euiPopover', {
403
401
  'euiPopover-isOpen': this.state.isOpening
404
- }, className, anchorClassName);
402
+ }, className);
405
403
  var showArrow = hasArrow && !attachToAnchor;
406
404
  var panel;
407
405
  if (!this.state.suppressingPopover && (isOpen || this.state.isClosing)) {
@@ -538,12 +536,6 @@ _defineProperty(EuiPopover, "defaultProps", {
538
536
  display: 'inline-block'
539
537
  });
540
538
  EuiPopover.propTypes = {
541
- /**
542
- * Class name passed to the direct parent of the button
543
- *
544
- * @deprecated Use `className` instead
545
- */
546
- anchorClassName: PropTypes.string,
547
539
  /**
548
540
  * Alignment of the popover and arrow relative to the button
549
541
  */
@@ -557,10 +549,6 @@ EuiPopover.propTypes = {
557
549
  * Triggering element for which to align the popover to
558
550
  */
559
551
  button: PropTypes.any.isRequired,
560
- /**
561
- * @deprecated Use `popoverRef` instead
562
- */
563
- buttonRef: PropTypes.any,
564
552
  /**
565
553
  * Callback to handle hiding of the popover
566
554
  */
@@ -28,12 +28,13 @@ import PropTypes from "prop-types";
28
28
  */
29
29
 
30
30
  import React, { Component } from 'react';
31
- import { htmlIdGenerator } from '../../services/accessibility';
31
+ import { RenderWithEuiTheme, htmlIdGenerator } from '../../services';
32
32
  import { isString } from '../../services/predicate';
33
33
  import { EuiFlexGroup, EuiFlexItem } from '../flex';
34
34
  import { EuiSearchBox } from './search_box';
35
35
  import { EuiSearchBarFilters } from './search_filters';
36
36
  import { Query } from './query';
37
+ import { euiSearchBar__searchHolder, euiSearchBar__filtersHolder } from './search_bar.styles';
37
38
  import { jsx as ___EmotionJSX } from "@emotion/react";
38
39
  export { Query, AST as Ast } from './query';
39
40
  var parseQuery = function parseQuery(query, props) {
@@ -184,39 +185,42 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
184
185
  toolsRight = _this$props.toolsRight,
185
186
  hint = _this$props.hint;
186
187
  var toolsLeftEl = this.renderTools(toolsLeft);
187
- var filtersBar = !filters ? undefined : ___EmotionJSX(EuiFlexItem, {
188
- className: "euiSearchBar__filtersHolder",
189
- grow: false
190
- }, ___EmotionJSX(EuiSearchBarFilters, {
191
- filters: filters,
192
- query: query,
193
- onChange: this.onFiltersChange
194
- }));
195
188
  var toolsRightEl = this.renderTools(toolsRight);
196
189
  var isHintVisible = (_hint$popoverProps$is = hint === null || hint === void 0 ? void 0 : (_hint$popoverProps = hint.popoverProps) === null || _hint$popoverProps === void 0 ? void 0 : _hint$popoverProps.isOpen) !== null && _hint$popoverProps$is !== void 0 ? _hint$popoverProps$is : isHintVisibleState;
197
- return ___EmotionJSX(EuiFlexGroup, {
198
- gutterSize: "m",
199
- alignItems: "center",
200
- wrap: true
201
- }, toolsLeftEl, ___EmotionJSX(EuiFlexItem, {
202
- className: "euiSearchBar__searchHolder",
203
- grow: true
204
- }, ___EmotionJSX(EuiSearchBox, _extends({}, box, {
205
- query: queryText,
206
- onSearch: this.onSearch,
207
- isInvalid: error != null,
208
- title: error ? error.message : undefined,
209
- "aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
210
- hint: hint ? _objectSpread({
211
- isVisible: isHintVisible,
212
- setIsVisible: function setIsVisible(isVisible) {
213
- _this2.setState({
214
- isHintVisible: isVisible
215
- });
216
- },
217
- id: this.hintId
218
- }, hint) : undefined
219
- }))), filtersBar, toolsRightEl);
190
+ return ___EmotionJSX(RenderWithEuiTheme, null, function (euiTheme) {
191
+ return ___EmotionJSX(EuiFlexGroup, {
192
+ gutterSize: "m",
193
+ alignItems: "center",
194
+ wrap: true
195
+ }, toolsLeftEl, ___EmotionJSX(EuiFlexItem, {
196
+ className: "euiSearchBar__searchHolder",
197
+ css: euiSearchBar__searchHolder(euiTheme),
198
+ grow: true
199
+ }, ___EmotionJSX(EuiSearchBox, _extends({}, box, {
200
+ query: queryText,
201
+ onSearch: _this2.onSearch,
202
+ isInvalid: error != null,
203
+ title: error ? error.message : undefined,
204
+ "aria-describedby": isHintVisible ? "".concat(_this2.hintId) : undefined,
205
+ hint: hint ? _objectSpread({
206
+ isVisible: isHintVisible,
207
+ setIsVisible: function setIsVisible(isVisible) {
208
+ _this2.setState({
209
+ isHintVisible: isVisible
210
+ });
211
+ },
212
+ id: _this2.hintId
213
+ }, hint) : undefined
214
+ }))), filters && ___EmotionJSX(EuiFlexItem, {
215
+ className: "euiSearchBar__filtersHolder",
216
+ css: euiSearchBar__filtersHolder(euiTheme),
217
+ grow: false
218
+ }, ___EmotionJSX(EuiSearchBarFilters, {
219
+ filters: filters,
220
+ query: query,
221
+ onChange: _this2.onFiltersChange
222
+ })), toolsRightEl);
223
+ });
220
224
  }
221
225
  }], [{
222
226
  key: "getDerivedStateFromProps",
@@ -0,0 +1,22 @@
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
+ import { css } from '@emotion/react';
10
+ import { euiBreakpoint, logicalCSS, mathWithUnits } from '../../global_styling';
11
+ import { euiFormVariables } from '../form/form.styles';
12
+ export var euiSearchBar__searchHolder = function euiSearchBar__searchHolder(euiThemeContext) {
13
+ var _euiFormVariables = euiFormVariables(euiThemeContext),
14
+ maxWidth = _euiFormVariables.maxWidth;
15
+ return /*#__PURE__*/css(logicalCSS('min-width', mathWithUnits(maxWidth, function (x) {
16
+ return x / 2;
17
+ })), ";;label:euiSearchBar__searchHolder;");
18
+ };
19
+ export var euiSearchBar__filtersHolder = function euiSearchBar__filtersHolder(euiThemeContext) {
20
+ var euiTheme = euiThemeContext.euiTheme;
21
+ return /*#__PURE__*/css(euiBreakpoint(euiThemeContext, ['m', 'l', 'xl']), "{", logicalCSS('max-width', "calc(100% - ".concat(euiTheme.size.base, ")")), ";};label:euiSearchBar__filtersHolder;");
22
+ };
@@ -135,9 +135,12 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
135
135
  setReady = _useState4[1];
136
136
  useEffect(function () {
137
137
  if (calculationDelayMs) {
138
- setTimeout(function () {
138
+ var timerId = setTimeout(function () {
139
139
  return setReady(true);
140
140
  }, calculationDelayMs);
141
+ return function () {
142
+ return clearTimeout(timerId);
143
+ };
141
144
  }
142
145
  }, [calculationDelayMs]);
143
146