@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,15 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.PADDING_SIZES = exports.EuiEmptyPrompt = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
- var _react = _interopRequireDefault(require("react"));
11
+ var _react = _interopRequireWildcard(require("react"));
11
12
  var _classnames = _interopRequireDefault(require("classnames"));
12
- var _common = require("../common");
13
+ var _services = require("../../services");
13
14
  var _title = require("../title");
14
15
  var _flex = require("../flex");
15
16
  var _spacer = require("../spacer");
@@ -17,6 +18,7 @@ var _icon = require("../icon");
17
18
  var _named_colors = require("../icon/named_colors");
18
19
  var _text = require("../text");
19
20
  var _panel = require("../panel/panel");
21
+ var _empty_prompt = require("./empty_prompt.styles");
20
22
  var _react2 = require("@emotion/react");
21
23
  var _excluded = ["icon", "iconType", "iconColor", "title", "titleSize", "paddingSize", "body", "actions", "className", "layout", "hasBorder", "color", "footer"];
22
24
  /*
@@ -26,15 +28,9 @@ var _excluded = ["icon", "iconType", "iconColor", "title", "titleSize", "padding
26
28
  * in compliance with, at your election, the Elastic License 2.0 or the Server
27
29
  * Side Public License, v 1.
28
30
  */
29
- 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; }
30
- 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) { (0, _defineProperty2.default)(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; }
31
- var paddingSizeToClassNameMap = {
32
- none: null,
33
- s: 'euiEmptyPrompt--paddingSmall',
34
- m: 'euiEmptyPrompt--paddingMedium',
35
- l: 'euiEmptyPrompt--paddingLarge'
36
- };
37
- var PADDING_SIZES = (0, _common.keysOf)(paddingSizeToClassNameMap);
31
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
32
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
33
+ var PADDING_SIZES = ['none', 's', 'm', 'l'];
38
34
  exports.PADDING_SIZES = PADDING_SIZES;
39
35
  var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
40
36
  var icon = _ref.icon,
@@ -55,41 +51,41 @@ var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
55
51
  color = _ref$color === void 0 ? 'transparent' : _ref$color,
56
52
  footer = _ref.footer,
57
53
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
58
- var isVerticalLayout = layout === 'vertical';
54
+ var classes = (0, _classnames.default)('euiEmptyPrompt', className);
55
+ var euiTheme = (0, _services.useEuiTheme)();
56
+ var styles = (0, _react.useMemo)(function () {
57
+ return (0, _empty_prompt.euiEmptyPromptStyles)(euiTheme);
58
+ }, [euiTheme]);
59
+ var cssStyles = [styles.euiEmptyPrompt, styles[layout]];
60
+ var mainStyles = [styles.main.euiEmptyPrompt__main, styles.main[layout], styles.main[paddingSize], layout === 'horizontal' && styles.main.horizontalPadding[paddingSize]];
61
+ var contentStyles = [styles.content.euiEmptyPrompt__content, styles.content[layout]];
62
+
59
63
  // Default the iconColor to `subdued`,
60
64
  // otherwise try to match the iconColor with the panel color unless iconColor is specified
61
65
  var iconColor = _iconColor !== null && _iconColor !== void 0 ? _iconColor : (0, _named_colors.isNamedColor)(color) ? color : 'subdued';
62
- var iconNode = iconType ? (0, _react2.jsx)(_icon.EuiIcon, {
63
- type: iconType,
64
- size: "xxl",
65
- color: iconColor
66
- }) : icon;
67
- var titleNode;
68
- var bodyNode;
69
- if (body || title) {
70
- if (title) {
71
- titleNode = (0, _react2.jsx)(_title.EuiTitle, {
72
- size: titleSize
73
- }, title);
74
- }
75
- if (body) {
76
- bodyNode = (0, _react2.jsx)(_react.default.Fragment, null, title && (0, _react2.jsx)(_spacer.EuiSpacer, {
77
- size: "m"
78
- }), (0, _react2.jsx)(_text.EuiText, {
79
- color: "subdued"
80
- }, body));
81
- }
82
- }
83
- var actionsNode;
84
- if (actions) {
85
- var actionsRow;
66
+ var iconNode = (0, _react.useMemo)(function () {
67
+ if (!iconType && !icon) return null;
68
+ var iconStyles = [styles.icon.euiEmptyPrompt__icon, styles.icon[layout]];
69
+ return (0, _react2.jsx)("div", {
70
+ className: "euiEmptyPrompt__icon",
71
+ css: iconStyles
72
+ }, iconType ? (0, _react2.jsx)(_icon.EuiIcon, {
73
+ type: iconType,
74
+ size: "xxl",
75
+ color: iconColor
76
+ }) : icon);
77
+ }, [icon, iconType, iconColor, layout, styles.icon]);
78
+ var actionsNode = (0, _react.useMemo)(function () {
79
+ if (!actions) return null;
86
80
  if (Array.isArray(actions)) {
87
- actionsRow = (0, _react2.jsx)(_flex.EuiFlexGroup, {
81
+ var actionStyles = [styles.actions.euiEmptyPrompt__actions, styles.actions[layout]];
82
+ return (0, _react2.jsx)(_flex.EuiFlexGroup, {
88
83
  className: "euiEmptyPrompt__actions",
84
+ css: actionStyles,
89
85
  gutterSize: "m",
90
86
  alignItems: "center",
91
87
  justifyContent: "center",
92
- direction: isVerticalLayout ? 'column' : 'row'
88
+ direction: layout === 'vertical' ? 'column' : 'row'
93
89
  }, actions.map(function (action, index) {
94
90
  return (0, _react2.jsx)(_flex.EuiFlexItem, {
95
91
  key: index,
@@ -97,31 +93,38 @@ var EuiEmptyPrompt = function EuiEmptyPrompt(_ref) {
97
93
  }, action);
98
94
  }));
99
95
  } else {
100
- actionsRow = actions;
96
+ return actions;
101
97
  }
102
- actionsNode = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_spacer.EuiSpacer, {
103
- size: "l"
104
- }), actionsRow);
105
- }
106
- var contentNodes = (0, _react2.jsx)(_react.default.Fragment, null, titleNode, bodyNode, actionsNode);
107
- var classes = (0, _classnames.default)('euiEmptyPrompt', ["euiEmptyPrompt--".concat(layout)], paddingSizeToClassNameMap[paddingSize], className);
108
- var panelProps = _objectSpread({
98
+ }, [actions, layout, styles.actions]);
99
+ var footerNode = (0, _react.useMemo)(function () {
100
+ if (!footer) return null;
101
+ var footerStyles = [styles.footer.euiEmptyPrompt__footer, styles.footer[paddingSize], styles.footer[color], color === 'transparent' && !hasBorder && styles.footer.roundedBorders];
102
+ return (0, _react2.jsx)("div", {
103
+ className: "euiEmptyPrompt__footer",
104
+ css: footerStyles
105
+ }, footer);
106
+ }, [footer, paddingSize, color, hasBorder, styles.footer]);
107
+ return (0, _react2.jsx)(_panel.EuiPanel, (0, _extends2.default)({
108
+ css: cssStyles,
109
109
  className: classes,
110
110
  color: color,
111
- paddingSize: 'none',
112
- hasBorder: hasBorder,
113
- grow: false
114
- }, rest);
115
- return (0, _react2.jsx)(_panel.EuiPanel, panelProps, (0, _react2.jsx)("div", {
116
- className: "euiEmptyPrompt__main"
117
- }, iconNode && (0, _react2.jsx)("div", {
118
- className: "euiEmptyPrompt__icon"
119
- }, iconNode), (0, _react2.jsx)("div", {
120
- className: "euiEmptyPrompt__content"
121
- }, (0, _react2.jsx)("div", {
122
- className: "euiEmptyPrompt__contentInner"
123
- }, contentNodes))), footer && (0, _react2.jsx)("div", {
124
- className: "euiEmptyPrompt__footer"
125
- }, footer));
111
+ paddingSize: "none",
112
+ grow: false,
113
+ hasBorder: hasBorder
114
+ }, rest), (0, _react2.jsx)("div", {
115
+ className: "euiEmptyPrompt__main",
116
+ css: mainStyles
117
+ }, iconNode, (0, _react2.jsx)("div", {
118
+ className: "euiEmptyPrompt__content",
119
+ css: contentStyles
120
+ }, title && (0, _react2.jsx)(_title.EuiTitle, {
121
+ size: titleSize
122
+ }, title), title && body && (0, _react2.jsx)(_spacer.EuiSpacer, {
123
+ size: "m"
124
+ }), body && (0, _react2.jsx)(_text.EuiText, {
125
+ color: "subdued"
126
+ }, body), actionsNode && (body || title) && (0, _react2.jsx)(_spacer.EuiSpacer, {
127
+ size: "l"
128
+ }), actionsNode)), footerNode);
126
129
  };
127
130
  exports.EuiEmptyPrompt = EuiEmptyPrompt;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.euiEmptyPromptStyles = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _react = require("@emotion/react");
10
+ var _global_styling = require("../../global_styling");
11
+ 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; }
12
+ 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) { (0, _defineProperty2.default)(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; }
13
+ 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)."; } /*
14
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
15
+ * or more contributor license agreements. Licensed under the Elastic License
16
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
17
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
18
+ * Side Public License, v 1.
19
+ */
20
+ var _ref = process.env.NODE_ENV === "production" ? {
21
+ name: "x4698b-roundedBorders",
22
+ styles: "border-radius:inherit;label:roundedBorders;"
23
+ } : {
24
+ name: "x4698b-roundedBorders",
25
+ styles: "border-radius:inherit;label:roundedBorders;",
26
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
27
+ };
28
+ var _ref2 = process.env.NODE_ENV === "production" ? {
29
+ name: "zv101j-euiEmptyPrompt__footer",
30
+ styles: "border-end-end-radius:inherit;border-end-start-radius:inherit;label:euiEmptyPrompt__footer;"
31
+ } : {
32
+ name: "zv101j-euiEmptyPrompt__footer",
33
+ styles: "border-end-end-radius:inherit;border-end-start-radius:inherit;label:euiEmptyPrompt__footer;",
34
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
35
+ };
36
+ var _ref3 = process.env.NODE_ENV === "production" ? {
37
+ name: "1rdinfv-vertical",
38
+ styles: "margin:auto;label:vertical;"
39
+ } : {
40
+ name: "1rdinfv-vertical",
41
+ styles: "margin:auto;label:vertical;",
42
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
43
+ };
44
+ var _ref4 = process.env.NODE_ENV === "production" ? {
45
+ name: "1w25ahh-vertical",
46
+ styles: "justify-content:center;label:vertical;"
47
+ } : {
48
+ name: "1w25ahh-vertical",
49
+ styles: "justify-content:center;label:vertical;",
50
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
51
+ };
52
+ var _ref5 = process.env.NODE_ENV === "production" ? {
53
+ name: "1o9qvqj-euiEmptyPrompt__main",
54
+ styles: "display:flex;flex-direction:column;label:euiEmptyPrompt__main;"
55
+ } : {
56
+ name: "1o9qvqj-euiEmptyPrompt__main",
57
+ styles: "display:flex;flex-direction:column;label:euiEmptyPrompt__main;",
58
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
59
+ };
60
+ var euiEmptyPromptStyles = function euiEmptyPromptStyles(euiThemeContext) {
61
+ var euiTheme = euiThemeContext.euiTheme;
62
+ var iconMaxWidth = (0, _global_styling.mathWithUnits)(euiTheme.size.l, function (x) {
63
+ return x * 15;
64
+ });
65
+ var generatePaddingStyles = function generatePaddingStyles() {
66
+ var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'padding';
67
+ return {
68
+ none: null,
69
+ s: /*#__PURE__*/(0, _react.css)(property, ":", (0, _global_styling.euiPaddingSize)(euiThemeContext, 's'), ";;label:s;"),
70
+ m: /*#__PURE__*/(0, _react.css)(property, ":", (0, _global_styling.euiPaddingSize)(euiThemeContext, 'm'), ";;label:m;"),
71
+ l: /*#__PURE__*/(0, _react.css)(property, ":", (0, _global_styling.euiPaddingSize)(euiThemeContext, 'l'), ";;label:l;")
72
+ };
73
+ };
74
+ var generateFooterBorder = function generateFooterBorder(color) {
75
+ return "".concat(euiTheme.border.width.thin, " solid ").concat((0, _global_styling.euiBorderColor)(euiThemeContext, color));
76
+ };
77
+ return {
78
+ euiEmptyPrompt: /*#__PURE__*/(0, _react.css)("text-align:center;margin:auto;", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['l', 'xl']), "{", (0, _global_styling.logicalCSS)('max-width', 'max-content'), ";};label:euiEmptyPrompt;"),
79
+ vertical: /*#__PURE__*/(0, _react.css)(";label:vertical;"),
80
+ horizontal: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['l', 'xl']), "{justify-content:flex-start;text-align:start;};label:horizontal;"),
81
+ main: _objectSpread(_objectSpread({
82
+ euiEmptyPrompt__main: _ref5,
83
+ vertical: _ref4,
84
+ horizontal: /*#__PURE__*/(0, _react.css)("align-items:center;", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['l', 'xl']), "{flex-direction:row-reverse;};label:horizontal;")
85
+ }, generatePaddingStyles()), {}, {
86
+ horizontalPadding: generatePaddingStyles('gap')
87
+ }),
88
+ content: {
89
+ euiEmptyPrompt__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', '36em'), ";;label:euiEmptyPrompt__content;"),
90
+ vertical: _ref3,
91
+ horizontal: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['l', 'xl']), "{padding-block:", euiTheme.size.l, ";padding-inline:0;};label:horizontal;")
92
+ },
93
+ icon: {
94
+ euiEmptyPrompt__icon: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('max-width', iconMaxWidth), " margin:auto;&>*{flex-shrink:1;", (0, _global_styling.logicalCSS)('max-width', '100%'), ";};label:euiEmptyPrompt__icon;"),
95
+ vertical: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-bottom', euiTheme.size.base), ";;label:vertical;"),
96
+ horizontal: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['l', 'xl']), "{", (0, _global_styling.logicalCSS)('min-width', '40%'), " ", (0, _global_styling.logicalCSS)('max-width', '50%'), "&&>*{", (0, _global_styling.logicalCSS)('max-width', iconMaxWidth), ";}};label:horizontal;")
97
+ },
98
+ actions: {
99
+ euiEmptyPrompt__actions: /*#__PURE__*/(0, _react.css)(";label:euiEmptyPrompt__actions;"),
100
+ vertical: /*#__PURE__*/(0, _react.css)(";label:vertical;"),
101
+ horizontal: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['l', 'xl']), "{justify-content:flex-start;};label:horizontal;")
102
+ },
103
+ footer: _objectSpread({
104
+ euiEmptyPrompt__footer: _ref2,
105
+ roundedBorders: _ref,
106
+ // Colors
107
+ transparent: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.body, ";;label:transparent;"),
108
+ plain: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.body, ";;label:plain;"),
109
+ subdued: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', generateFooterBorder('subdued')), ";;label:subdued;"),
110
+ primary: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', generateFooterBorder('primary')), ";;label:primary;"),
111
+ accent: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', generateFooterBorder('accent')), ";;label:accent;"),
112
+ danger: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', generateFooterBorder('danger')), ";;label:danger;"),
113
+ warning: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', generateFooterBorder('warning')), ";;label:warning;"),
114
+ success: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('border-top', generateFooterBorder('success')), ";;label:success;")
115
+ }, generatePaddingStyles())
116
+ };
117
+ };
118
+ exports.euiEmptyPromptStyles = euiEmptyPromptStyles;
@@ -36,7 +36,7 @@ var _popover_arrow = require("./popover_arrow");
36
36
  var _popover2 = require("./popover.styles");
37
37
  var _popover_panel = require("./popover_panel");
38
38
  var _react2 = require("@emotion/react");
39
- 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"];
39
+ 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"];
40
40
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
41
41
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
42
  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; }
@@ -273,7 +273,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
273
273
  });
274
274
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "popoverRef", function (node) {
275
275
  _this.button = node;
276
- (0, _useCombinedRefs.setMultipleRefs)([_this.props.popoverRef, _this.props.buttonRef], node);
276
+ (0, _useCombinedRefs.setMultipleRefs)([_this.props.popoverRef], node);
277
277
  });
278
278
  _this.state = {
279
279
  prevProps: {
@@ -354,10 +354,8 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
354
354
  var _panelProps$tabIndex,
355
355
  _this4 = this;
356
356
  var _this$props = this.props,
357
- anchorClassName = _this$props.anchorClassName,
358
357
  anchorPosition = _this$props.anchorPosition,
359
358
  button = _this$props.button,
360
- buttonRef = _this$props.buttonRef,
361
359
  insert = _this$props.insert,
362
360
  isOpen = _this$props.isOpen,
363
361
  ownFocus = _this$props.ownFocus,
@@ -397,7 +395,7 @@ var EuiPopover = /*#__PURE__*/function (_Component) {
397
395
  }];
398
396
  var classes = (0, _classnames.default)('euiPopover', {
399
397
  'euiPopover-isOpen': this.state.isOpening
400
- }, className, anchorClassName);
398
+ }, className);
401
399
  var showArrow = hasArrow && !attachToAnchor;
402
400
  var panel;
403
401
  if (!this.state.suppressingPopover && (isOpen || this.state.isClosing)) {
@@ -29,12 +29,13 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
29
29
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
30
30
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
31
31
  var _react = _interopRequireWildcard(require("react"));
32
- var _accessibility = require("../../services/accessibility");
32
+ var _services = require("../../services");
33
33
  var _predicate = require("../../services/predicate");
34
34
  var _flex = require("../flex");
35
35
  var _search_box = require("./search_box");
36
36
  var _search_filters = require("./search_filters");
37
37
  var _query2 = require("./query");
38
+ var _search_bar = require("./search_bar.styles");
38
39
  var _react2 = require("@emotion/react");
39
40
  var _excluded = ["schema"];
40
41
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -71,7 +72,7 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
71
72
  var _this;
72
73
  (0, _classCallCheck2.default)(this, EuiSearchBar);
73
74
  _this = _super.call(this, props);
74
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hintId", (0, _accessibility.htmlIdGenerator)('__hint')());
75
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hintId", (0, _services.htmlIdGenerator)('__hint')());
75
76
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onSearch", function (queryText) {
76
77
  try {
77
78
  var query = parseQuery(queryText, _this.props);
@@ -197,39 +198,42 @@ var EuiSearchBar = /*#__PURE__*/function (_Component) {
197
198
  toolsRight = _this$props.toolsRight,
198
199
  hint = _this$props.hint;
199
200
  var toolsLeftEl = this.renderTools(toolsLeft);
200
- var filtersBar = !filters ? undefined : (0, _react2.jsx)(_flex.EuiFlexItem, {
201
- className: "euiSearchBar__filtersHolder",
202
- grow: false
203
- }, (0, _react2.jsx)(_search_filters.EuiSearchBarFilters, {
204
- filters: filters,
205
- query: query,
206
- onChange: this.onFiltersChange
207
- }));
208
201
  var toolsRightEl = this.renderTools(toolsRight);
209
202
  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;
210
- return (0, _react2.jsx)(_flex.EuiFlexGroup, {
211
- gutterSize: "m",
212
- alignItems: "center",
213
- wrap: true
214
- }, toolsLeftEl, (0, _react2.jsx)(_flex.EuiFlexItem, {
215
- className: "euiSearchBar__searchHolder",
216
- grow: true
217
- }, (0, _react2.jsx)(_search_box.EuiSearchBox, (0, _extends2.default)({}, box, {
218
- query: queryText,
219
- onSearch: this.onSearch,
220
- isInvalid: error != null,
221
- title: error ? error.message : undefined,
222
- "aria-describedby": isHintVisible ? "".concat(this.hintId) : undefined,
223
- hint: hint ? _objectSpread({
224
- isVisible: isHintVisible,
225
- setIsVisible: function setIsVisible(isVisible) {
226
- _this2.setState({
227
- isHintVisible: isVisible
228
- });
229
- },
230
- id: this.hintId
231
- }, hint) : undefined
232
- }))), filtersBar, toolsRightEl);
203
+ return (0, _react2.jsx)(_services.RenderWithEuiTheme, null, function (euiTheme) {
204
+ return (0, _react2.jsx)(_flex.EuiFlexGroup, {
205
+ gutterSize: "m",
206
+ alignItems: "center",
207
+ wrap: true
208
+ }, toolsLeftEl, (0, _react2.jsx)(_flex.EuiFlexItem, {
209
+ className: "euiSearchBar__searchHolder",
210
+ css: (0, _search_bar.euiSearchBar__searchHolder)(euiTheme),
211
+ grow: true
212
+ }, (0, _react2.jsx)(_search_box.EuiSearchBox, (0, _extends2.default)({}, box, {
213
+ query: queryText,
214
+ onSearch: _this2.onSearch,
215
+ isInvalid: error != null,
216
+ title: error ? error.message : undefined,
217
+ "aria-describedby": isHintVisible ? "".concat(_this2.hintId) : undefined,
218
+ hint: hint ? _objectSpread({
219
+ isVisible: isHintVisible,
220
+ setIsVisible: function setIsVisible(isVisible) {
221
+ _this2.setState({
222
+ isHintVisible: isVisible
223
+ });
224
+ },
225
+ id: _this2.hintId
226
+ }, hint) : undefined
227
+ }))), filters && (0, _react2.jsx)(_flex.EuiFlexItem, {
228
+ className: "euiSearchBar__filtersHolder",
229
+ css: (0, _search_bar.euiSearchBar__filtersHolder)(euiTheme),
230
+ grow: false
231
+ }, (0, _react2.jsx)(_search_filters.EuiSearchBarFilters, {
232
+ filters: filters,
233
+ query: query,
234
+ onChange: _this2.onFiltersChange
235
+ })), toolsRightEl);
236
+ });
233
237
  }
234
238
  }], [{
235
239
  key: "getDerivedStateFromProps",
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiSearchBar__searchHolder = exports.euiSearchBar__filtersHolder = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _global_styling = require("../../global_styling");
9
+ var _form = require("../form/form.styles");
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+
18
+ var euiSearchBar__searchHolder = function euiSearchBar__searchHolder(euiThemeContext) {
19
+ var _euiFormVariables = (0, _form.euiFormVariables)(euiThemeContext),
20
+ maxWidth = _euiFormVariables.maxWidth;
21
+ return /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('min-width', (0, _global_styling.mathWithUnits)(maxWidth, function (x) {
22
+ return x / 2;
23
+ })), ";;label:euiSearchBar__searchHolder;");
24
+ };
25
+ exports.euiSearchBar__searchHolder = euiSearchBar__searchHolder;
26
+ var euiSearchBar__filtersHolder = function euiSearchBar__filtersHolder(euiThemeContext) {
27
+ var euiTheme = euiThemeContext.euiTheme;
28
+ return /*#__PURE__*/(0, _react.css)((0, _global_styling.euiBreakpoint)(euiThemeContext, ['m', 'l', 'xl']), "{", (0, _global_styling.logicalCSS)('max-width', "calc(100% - ".concat(euiTheme.size.base, ")")), ";};label:euiSearchBar__filtersHolder;");
29
+ };
30
+ exports.euiSearchBar__filtersHolder = euiSearchBar__filtersHolder;
@@ -69,9 +69,12 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
69
69
  setReady = _useState4[1];
70
70
  (0, _react.useEffect)(function () {
71
71
  if (calculationDelayMs) {
72
- setTimeout(function () {
72
+ var timerId = setTimeout(function () {
73
73
  return setReady(true);
74
74
  }, calculationDelayMs);
75
+ return function () {
76
+ return clearTimeout(timerId);
77
+ };
75
78
  }
76
79
  }, [calculationDelayMs]);
77
80
 
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.EuiTourFooter = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var _services = require("../../services");
13
+ var _i18n = require("../i18n");
14
+ var _popover = require("../popover");
15
+ var _button = require("../button");
16
+ var _flex = require("../flex");
17
+ var _tour_step_indicator = require("./tour_step_indicator");
18
+ var _tour_footer = require("./_tour_footer.styles");
19
+ var _react2 = require("@emotion/react");
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
+ /*
23
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
24
+ * or more contributor license agreements. Licensed under the Elastic License
25
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
26
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
27
+ * Side Public License, v 1.
28
+ */
29
+
30
+ var EuiTourFooter = /*#__PURE__*/(0, _react.memo)(function (_ref) {
31
+ var footerAction = _ref.footerAction,
32
+ step = _ref.step,
33
+ stepsTotal = _ref.stepsTotal,
34
+ onFinish = _ref.onFinish;
35
+ var euiTheme = (0, _services.useEuiTheme)();
36
+ var footerStyles = (0, _tour_footer.euiTourFooterStyles)(euiTheme);
37
+ var customFooterAction = (0, _react.useMemo)(function () {
38
+ if (!footerAction) return null;
39
+ return Array.isArray(footerAction) ? (0, _react2.jsx)(_flex.EuiFlexGroup, {
40
+ gutterSize: "s",
41
+ alignItems: "center",
42
+ justifyContent: "flexEnd",
43
+ responsive: false,
44
+ wrap: true
45
+ }, footerAction.map(function (action, index) {
46
+ return (0, _react2.jsx)(_flex.EuiFlexItem, {
47
+ key: index,
48
+ grow: false
49
+ }, action);
50
+ })) : (0, _react2.jsx)(_flex.EuiFlexItem, {
51
+ grow: false
52
+ }, footerAction);
53
+ }, [footerAction]);
54
+ var indicators = (0, _react.useMemo)(function () {
55
+ if (stepsTotal <= 1) return null;
56
+ return (0, _react2.jsx)(_flex.EuiFlexItem, {
57
+ grow: false
58
+ }, (0, _react2.jsx)("ul", {
59
+ className: "euiTourFooter__stepList"
60
+ }, (0, _toConsumableArray2.default)(Array(stepsTotal).keys()).map(function (_, i) {
61
+ var status = 'complete';
62
+ if (step === i + 1) {
63
+ status = 'active';
64
+ } else if (step <= i) {
65
+ status = 'incomplete';
66
+ }
67
+ return (0, _react2.jsx)(_tour_step_indicator.EuiTourStepIndicator, {
68
+ key: i,
69
+ number: i + 1,
70
+ status: status
71
+ });
72
+ })));
73
+ }, [step, stepsTotal]);
74
+ return (0, _react2.jsx)(_popover.EuiPopoverFooter, {
75
+ css: footerStyles.euiTourFooter,
76
+ className: "euiTourFooter"
77
+ }, (0, _react2.jsx)(_flex.EuiFlexGroup, {
78
+ responsive: false,
79
+ justifyContent: stepsTotal > 1 ? 'spaceBetween' : 'flexEnd',
80
+ alignItems: "center"
81
+ }, indicators, footerAction ? customFooterAction : (0, _react2.jsx)(_flex.EuiFlexItem, {
82
+ grow: false
83
+ }, (0, _react2.jsx)(_i18n.EuiI18n, {
84
+ tokens: ['euiTourFooter.endTour', 'euiTourFooter.skipTour', 'euiTourFooter.closeTour'],
85
+ defaults: ['End tour', 'Skip tour', 'Close tour']
86
+ }, function (_ref2) {
87
+ var _ref3 = (0, _slicedToArray2.default)(_ref2, 3),
88
+ endTour = _ref3[0],
89
+ skipTour = _ref3[1],
90
+ closeTour = _ref3[2];
91
+ return (0, _react2.jsx)(_button.EuiButtonEmpty, {
92
+ onClick: onFinish,
93
+ color: "text",
94
+ flush: "right",
95
+ size: "xs"
96
+ }, stepsTotal > 1 ? stepsTotal === step ? endTour : skipTour : closeTour);
97
+ }))));
98
+ });
99
+ exports.EuiTourFooter = EuiTourFooter;
100
+ EuiTourFooter.displayName = '_EuiTourFooter';
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiTourFooterStyles = exports._tourFooterBgColor = void 0;
7
+ var _react = require("@emotion/react");
8
+ var _services = require("../../services");
9
+ var _global_styling = require("../../global_styling");
10
+ /*
11
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
+ * or more contributor license agreements. Licensed under the Elastic License
13
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
14
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
15
+ * Side Public License, v 1.
16
+ */
17
+
18
+ var _tourFooterBgColor = function _tourFooterBgColor(_ref) {
19
+ var colorMode = _ref.colorMode,
20
+ euiTheme = _ref.euiTheme;
21
+ return colorMode === 'DARK' ? (0, _services.shade)(euiTheme.colors.lightestShade, 0.45) : (0, _services.tint)(euiTheme.colors.lightestShade, 0.5);
22
+ };
23
+ exports._tourFooterBgColor = _tourFooterBgColor;
24
+ var euiTourFooterStyles = function euiTourFooterStyles(euiThemeContext) {
25
+ var euiTheme = euiThemeContext.euiTheme;
26
+ return {
27
+ // Base
28
+ euiTourFooter: /*#__PURE__*/(0, _react.css)("background-color:", _tourFooterBgColor(euiThemeContext), ";", (0, _global_styling.logicalCSS)('border-bottom-left-radius', euiTheme.border.radius.medium), " ", (0, _global_styling.logicalCSS)('border-bottom-right-radius', euiTheme.border.radius.medium), ";;label:euiTourFooter;")
29
+ };
30
+ };
31
+ exports.euiTourFooterStyles = euiTourFooterStyles;