@elastic/eui 92.2.1 → 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.
- package/dist/eui_theme_dark.css +0 -200
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -200
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +0 -9
- package/es/components/basic_table/in_memory_table.js +0 -10
- package/es/components/beacon/beacon.js +9 -6
- package/es/components/breadcrumbs/breadcrumb.js +0 -10
- package/es/components/breadcrumbs/breadcrumbs.js +0 -10
- package/es/components/code/code.js +2 -2
- package/es/components/code/code.styles.js +2 -4
- package/es/components/code/code_block.js +5 -3
- package/es/components/code/code_block.styles.js +4 -7
- package/es/components/code/code_block_controls.js +2 -2
- package/es/components/code/code_block_controls.styles.js +2 -4
- package/es/components/code/code_block_full_screen.js +2 -2
- package/es/components/code/code_syntax.styles.js +39 -34
- package/es/components/comment_list/comment_event.js +3 -2
- package/es/components/comment_list/comment_event.styles.js +2 -18
- package/es/components/context_menu/context_menu.js +2 -6
- package/es/components/context_menu/context_menu_item.js +2 -14
- package/es/components/empty_prompt/empty_prompt.js +62 -65
- package/es/components/empty_prompt/empty_prompt.styles.js +115 -0
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +0 -10
- package/es/components/header/header_links/header_links.js +0 -10
- package/es/components/page/page_header/page_header_content.js +0 -10
- package/es/components/popover/popover.js +3 -15
- package/es/components/search_bar/search_bar.js +36 -32
- package/es/components/search_bar/search_bar.styles.js +22 -0
- package/es/components/text_truncate/text_truncate.js +4 -1
- package/es/components/tour/_tour_footer.js +97 -0
- package/es/components/tour/_tour_footer.styles.js +23 -0
- package/es/components/tour/_tour_header.js +37 -0
- package/es/components/tour/_tour_header.styles.js +20 -0
- package/es/components/tour/tour.styles.js +5 -28
- package/es/components/tour/tour_step.js +45 -130
- package/es/global_styling/mixins/_color.js +46 -13
- package/eui.d.ts +125 -63
- package/i18ntokens.json +94 -94
- package/lib/components/basic_table/basic_table.js +0 -9
- package/lib/components/basic_table/in_memory_table.js +0 -10
- package/lib/components/beacon/beacon.js +11 -6
- package/lib/components/breadcrumbs/breadcrumb.js +0 -10
- package/lib/components/code/code.js +2 -2
- package/lib/components/code/code.styles.js +2 -4
- package/lib/components/code/code_block.js +5 -3
- package/lib/components/code/code_block.styles.js +4 -7
- package/lib/components/code/code_block_controls.js +2 -2
- package/lib/components/code/code_block_controls.styles.js +2 -4
- package/lib/components/code/code_block_full_screen.js +2 -2
- package/lib/components/code/code_syntax.styles.js +40 -36
- package/lib/components/comment_list/comment_event.js +2 -1
- package/lib/components/comment_list/comment_event.styles.js +3 -20
- package/lib/components/context_menu/context_menu.js +2 -6
- package/lib/components/context_menu/context_menu_item.js +2 -14
- package/lib/components/empty_prompt/empty_prompt.js +64 -64
- package/lib/components/empty_prompt/empty_prompt.styles.js +120 -0
- package/lib/components/popover/popover.js +3 -15
- package/lib/components/search_bar/search_bar.js +37 -33
- package/lib/components/search_bar/search_bar.styles.js +30 -0
- package/lib/components/text_truncate/text_truncate.js +4 -1
- package/lib/components/tour/_tour_footer.js +105 -0
- package/lib/components/tour/_tour_footer.styles.js +31 -0
- package/lib/components/tour/_tour_header.js +48 -0
- package/lib/components/tour/_tour_header.styles.js +27 -0
- package/lib/components/tour/tour.styles.js +7 -32
- package/lib/components/tour/tour_step.js +42 -117
- package/lib/global_styling/mixins/_color.js +50 -15
- package/optimize/es/components/basic_table/basic_table.js +0 -9
- package/optimize/es/components/basic_table/in_memory_table.js +0 -10
- package/optimize/es/components/beacon/beacon.js +9 -6
- package/optimize/es/components/code/code.js +2 -2
- package/optimize/es/components/code/code.styles.js +2 -4
- package/optimize/es/components/code/code_block.js +5 -3
- package/optimize/es/components/code/code_block.styles.js +4 -7
- package/optimize/es/components/code/code_block_controls.js +2 -2
- package/optimize/es/components/code/code_block_controls.styles.js +2 -4
- package/optimize/es/components/code/code_block_full_screen.js +2 -2
- package/optimize/es/components/code/code_syntax.styles.js +39 -34
- package/optimize/es/components/comment_list/comment_event.js +3 -2
- package/optimize/es/components/comment_list/comment_event.styles.js +2 -18
- package/optimize/es/components/context_menu/context_menu.js +2 -6
- package/optimize/es/components/context_menu/context_menu_item.js +2 -6
- package/optimize/es/components/empty_prompt/empty_prompt.js +62 -62
- package/optimize/es/components/empty_prompt/empty_prompt.styles.js +112 -0
- package/optimize/es/components/popover/popover.js +3 -5
- package/optimize/es/components/search_bar/search_bar.js +36 -32
- package/optimize/es/components/search_bar/search_bar.styles.js +22 -0
- package/optimize/es/components/text_truncate/text_truncate.js +4 -1
- package/optimize/es/components/tour/_tour_footer.js +89 -0
- package/optimize/es/components/tour/_tour_footer.styles.js +23 -0
- package/optimize/es/components/tour/_tour_header.js +33 -0
- package/optimize/es/components/tour/_tour_header.styles.js +20 -0
- package/optimize/es/components/tour/tour.styles.js +5 -28
- package/optimize/es/components/tour/tour_step.js +45 -113
- package/optimize/es/global_styling/mixins/_color.js +46 -13
- package/optimize/lib/components/basic_table/basic_table.js +0 -9
- package/optimize/lib/components/basic_table/in_memory_table.js +0 -10
- package/optimize/lib/components/beacon/beacon.js +12 -6
- package/optimize/lib/components/code/code.js +2 -2
- package/optimize/lib/components/code/code.styles.js +2 -4
- package/optimize/lib/components/code/code_block.js +5 -3
- package/optimize/lib/components/code/code_block.styles.js +4 -7
- package/optimize/lib/components/code/code_block_controls.js +2 -2
- package/optimize/lib/components/code/code_block_controls.styles.js +2 -4
- package/optimize/lib/components/code/code_block_full_screen.js +2 -2
- package/optimize/lib/components/code/code_syntax.styles.js +40 -36
- package/optimize/lib/components/comment_list/comment_event.js +2 -1
- package/optimize/lib/components/comment_list/comment_event.styles.js +3 -20
- package/optimize/lib/components/context_menu/context_menu.js +2 -6
- package/optimize/lib/components/context_menu/context_menu_item.js +2 -6
- package/optimize/lib/components/empty_prompt/empty_prompt.js +65 -62
- package/optimize/lib/components/empty_prompt/empty_prompt.styles.js +118 -0
- package/optimize/lib/components/popover/popover.js +3 -5
- package/optimize/lib/components/search_bar/search_bar.js +37 -33
- package/optimize/lib/components/search_bar/search_bar.styles.js +30 -0
- package/optimize/lib/components/text_truncate/text_truncate.js +4 -1
- package/optimize/lib/components/tour/_tour_footer.js +100 -0
- package/optimize/lib/components/tour/_tour_footer.styles.js +31 -0
- package/optimize/lib/components/tour/_tour_header.js +43 -0
- package/optimize/lib/components/tour/_tour_header.styles.js +27 -0
- package/optimize/lib/components/tour/tour.styles.js +7 -32
- package/optimize/lib/components/tour/tour_step.js +42 -110
- package/optimize/lib/global_styling/mixins/_color.js +50 -15
- package/package.json +1 -1
- package/src/components/index.scss +0 -2
- package/test-env/components/basic_table/basic_table.js +0 -9
- package/test-env/components/basic_table/in_memory_table.js +0 -10
- package/test-env/components/beacon/beacon.js +12 -6
- package/test-env/components/breadcrumbs/breadcrumb.js +0 -10
- package/test-env/components/code/code.styles.js +2 -4
- package/test-env/components/code/code_block.styles.js +4 -7
- package/test-env/components/code/code_block_controls.js +2 -2
- package/test-env/components/code/code_block_controls.styles.js +2 -4
- package/test-env/components/code/code_block_full_screen.js +2 -2
- package/test-env/components/code/code_syntax.styles.js +40 -36
- package/test-env/components/comment_list/comment_event.js +2 -1
- package/test-env/components/comment_list/comment_event.styles.js +3 -20
- package/test-env/components/context_menu/context_menu.js +2 -6
- package/test-env/components/context_menu/context_menu_item.js +2 -14
- package/test-env/components/empty_prompt/empty_prompt.js +65 -62
- package/test-env/components/empty_prompt/empty_prompt.styles.js +118 -0
- package/test-env/components/popover/popover.js +3 -15
- package/test-env/components/search_bar/search_bar.js +37 -33
- package/test-env/components/search_bar/search_bar.styles.js +30 -0
- package/test-env/components/text_truncate/text_truncate.js +4 -1
- package/test-env/components/tour/_tour_footer.js +100 -0
- package/test-env/components/tour/_tour_footer.styles.js +31 -0
- package/test-env/components/tour/_tour_header.js +48 -0
- package/test-env/components/tour/_tour_header.styles.js +27 -0
- package/test-env/components/tour/tour.styles.js +7 -32
- package/test-env/components/tour/tour_step.js +42 -114
- package/test-env/global_styling/mixins/_color.js +50 -15
- package/src/components/empty_prompt/_empty_prompt.scss +0 -128
- package/src/components/empty_prompt/_index.scss +0 -1
- package/src/components/search_bar/_index.scss +0 -1
- package/src/components/search_bar/_search_bar.scss +0 -10
|
@@ -9,7 +9,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
9
9
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
10
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
11
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
12
|
-
var _excluded = ["
|
|
12
|
+
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"];
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
15
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -262,7 +262,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
262
262
|
});
|
|
263
263
|
_defineProperty(_assertThisInitialized(_this), "popoverRef", function (node) {
|
|
264
264
|
_this.button = node;
|
|
265
|
-
setMultipleRefs([_this.props.popoverRef
|
|
265
|
+
setMultipleRefs([_this.props.popoverRef], node);
|
|
266
266
|
});
|
|
267
267
|
_this.state = {
|
|
268
268
|
prevProps: {
|
|
@@ -343,10 +343,8 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
343
343
|
var _panelProps$tabIndex,
|
|
344
344
|
_this4 = this;
|
|
345
345
|
var _this$props = this.props,
|
|
346
|
-
anchorClassName = _this$props.anchorClassName,
|
|
347
346
|
anchorPosition = _this$props.anchorPosition,
|
|
348
347
|
button = _this$props.button,
|
|
349
|
-
buttonRef = _this$props.buttonRef,
|
|
350
348
|
insert = _this$props.insert,
|
|
351
349
|
isOpen = _this$props.isOpen,
|
|
352
350
|
ownFocus = _this$props.ownFocus,
|
|
@@ -386,7 +384,7 @@ export var EuiPopover = /*#__PURE__*/function (_Component) {
|
|
|
386
384
|
}];
|
|
387
385
|
var classes = classNames('euiPopover', {
|
|
388
386
|
'euiPopover-isOpen': this.state.isOpening
|
|
389
|
-
}, className
|
|
387
|
+
}, className);
|
|
390
388
|
var showArrow = hasArrow && !attachToAnchor;
|
|
391
389
|
var panel;
|
|
392
390
|
if (!this.state.suppressingPopover && (isOpen || this.state.isClosing)) {
|
|
@@ -22,12 +22,13 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import React, { Component } from 'react';
|
|
25
|
-
import { htmlIdGenerator } from '../../services
|
|
25
|
+
import { RenderWithEuiTheme, htmlIdGenerator } from '../../services';
|
|
26
26
|
import { isString } from '../../services/predicate';
|
|
27
27
|
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
28
28
|
import { EuiSearchBox } from './search_box';
|
|
29
29
|
import { EuiSearchBarFilters } from './search_filters';
|
|
30
30
|
import { Query } from './query';
|
|
31
|
+
import { euiSearchBar__searchHolder, euiSearchBar__filtersHolder } from './search_bar.styles';
|
|
31
32
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
32
33
|
export { Query, AST as Ast } from './query';
|
|
33
34
|
var parseQuery = function parseQuery(query, props) {
|
|
@@ -178,39 +179,42 @@ export var EuiSearchBar = /*#__PURE__*/function (_Component) {
|
|
|
178
179
|
toolsRight = _this$props.toolsRight,
|
|
179
180
|
hint = _this$props.hint;
|
|
180
181
|
var toolsLeftEl = this.renderTools(toolsLeft);
|
|
181
|
-
var filtersBar = !filters ? undefined : ___EmotionJSX(EuiFlexItem, {
|
|
182
|
-
className: "euiSearchBar__filtersHolder",
|
|
183
|
-
grow: false
|
|
184
|
-
}, ___EmotionJSX(EuiSearchBarFilters, {
|
|
185
|
-
filters: filters,
|
|
186
|
-
query: query,
|
|
187
|
-
onChange: this.onFiltersChange
|
|
188
|
-
}));
|
|
189
182
|
var toolsRightEl = this.renderTools(toolsRight);
|
|
190
183
|
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;
|
|
191
|
-
return ___EmotionJSX(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
184
|
+
return ___EmotionJSX(RenderWithEuiTheme, null, function (euiTheme) {
|
|
185
|
+
return ___EmotionJSX(EuiFlexGroup, {
|
|
186
|
+
gutterSize: "m",
|
|
187
|
+
alignItems: "center",
|
|
188
|
+
wrap: true
|
|
189
|
+
}, toolsLeftEl, ___EmotionJSX(EuiFlexItem, {
|
|
190
|
+
className: "euiSearchBar__searchHolder",
|
|
191
|
+
css: euiSearchBar__searchHolder(euiTheme),
|
|
192
|
+
grow: true
|
|
193
|
+
}, ___EmotionJSX(EuiSearchBox, _extends({}, box, {
|
|
194
|
+
query: queryText,
|
|
195
|
+
onSearch: _this2.onSearch,
|
|
196
|
+
isInvalid: error != null,
|
|
197
|
+
title: error ? error.message : undefined,
|
|
198
|
+
"aria-describedby": isHintVisible ? "".concat(_this2.hintId) : undefined,
|
|
199
|
+
hint: hint ? _objectSpread({
|
|
200
|
+
isVisible: isHintVisible,
|
|
201
|
+
setIsVisible: function setIsVisible(isVisible) {
|
|
202
|
+
_this2.setState({
|
|
203
|
+
isHintVisible: isVisible
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
id: _this2.hintId
|
|
207
|
+
}, hint) : undefined
|
|
208
|
+
}))), filters && ___EmotionJSX(EuiFlexItem, {
|
|
209
|
+
className: "euiSearchBar__filtersHolder",
|
|
210
|
+
css: euiSearchBar__filtersHolder(euiTheme),
|
|
211
|
+
grow: false
|
|
212
|
+
}, ___EmotionJSX(EuiSearchBarFilters, {
|
|
213
|
+
filters: filters,
|
|
214
|
+
query: query,
|
|
215
|
+
onChange: _this2.onFiltersChange
|
|
216
|
+
})), toolsRightEl);
|
|
217
|
+
});
|
|
214
218
|
}
|
|
215
219
|
}], [{
|
|
216
220
|
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
|
+
};
|
|
@@ -59,9 +59,12 @@ var EuiTextTruncateWithWidth = function EuiTextTruncateWithWidth(_ref2) {
|
|
|
59
59
|
setReady = _useState4[1];
|
|
60
60
|
useEffect(function () {
|
|
61
61
|
if (calculationDelayMs) {
|
|
62
|
-
setTimeout(function () {
|
|
62
|
+
var timerId = setTimeout(function () {
|
|
63
63
|
return setReady(true);
|
|
64
64
|
}, calculationDelayMs);
|
|
65
|
+
return function () {
|
|
66
|
+
return clearTimeout(timerId);
|
|
67
|
+
};
|
|
65
68
|
}
|
|
66
69
|
}, [calculationDelayMs]);
|
|
67
70
|
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
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
|
+
|
|
11
|
+
import React, { useMemo, memo } from 'react';
|
|
12
|
+
import { useEuiTheme } from '../../services';
|
|
13
|
+
import { EuiI18n } from '../i18n';
|
|
14
|
+
import { EuiPopoverFooter } from '../popover';
|
|
15
|
+
import { EuiButtonEmpty } from '../button';
|
|
16
|
+
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
17
|
+
import { EuiTourStepIndicator } from './tour_step_indicator';
|
|
18
|
+
import { euiTourFooterStyles } from './_tour_footer.styles';
|
|
19
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
|
+
export var EuiTourFooter = /*#__PURE__*/memo(function (_ref) {
|
|
21
|
+
var footerAction = _ref.footerAction,
|
|
22
|
+
step = _ref.step,
|
|
23
|
+
stepsTotal = _ref.stepsTotal,
|
|
24
|
+
onFinish = _ref.onFinish;
|
|
25
|
+
var euiTheme = useEuiTheme();
|
|
26
|
+
var footerStyles = euiTourFooterStyles(euiTheme);
|
|
27
|
+
var customFooterAction = useMemo(function () {
|
|
28
|
+
if (!footerAction) return null;
|
|
29
|
+
return Array.isArray(footerAction) ? ___EmotionJSX(EuiFlexGroup, {
|
|
30
|
+
gutterSize: "s",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
justifyContent: "flexEnd",
|
|
33
|
+
responsive: false,
|
|
34
|
+
wrap: true
|
|
35
|
+
}, footerAction.map(function (action, index) {
|
|
36
|
+
return ___EmotionJSX(EuiFlexItem, {
|
|
37
|
+
key: index,
|
|
38
|
+
grow: false
|
|
39
|
+
}, action);
|
|
40
|
+
})) : ___EmotionJSX(EuiFlexItem, {
|
|
41
|
+
grow: false
|
|
42
|
+
}, footerAction);
|
|
43
|
+
}, [footerAction]);
|
|
44
|
+
var indicators = useMemo(function () {
|
|
45
|
+
if (stepsTotal <= 1) return null;
|
|
46
|
+
return ___EmotionJSX(EuiFlexItem, {
|
|
47
|
+
grow: false
|
|
48
|
+
}, ___EmotionJSX("ul", {
|
|
49
|
+
className: "euiTourFooter__stepList"
|
|
50
|
+
}, _toConsumableArray(Array(stepsTotal).keys()).map(function (_, i) {
|
|
51
|
+
var status = 'complete';
|
|
52
|
+
if (step === i + 1) {
|
|
53
|
+
status = 'active';
|
|
54
|
+
} else if (step <= i) {
|
|
55
|
+
status = 'incomplete';
|
|
56
|
+
}
|
|
57
|
+
return ___EmotionJSX(EuiTourStepIndicator, {
|
|
58
|
+
key: i,
|
|
59
|
+
number: i + 1,
|
|
60
|
+
status: status
|
|
61
|
+
});
|
|
62
|
+
})));
|
|
63
|
+
}, [step, stepsTotal]);
|
|
64
|
+
return ___EmotionJSX(EuiPopoverFooter, {
|
|
65
|
+
css: footerStyles.euiTourFooter,
|
|
66
|
+
className: "euiTourFooter"
|
|
67
|
+
}, ___EmotionJSX(EuiFlexGroup, {
|
|
68
|
+
responsive: false,
|
|
69
|
+
justifyContent: stepsTotal > 1 ? 'spaceBetween' : 'flexEnd',
|
|
70
|
+
alignItems: "center"
|
|
71
|
+
}, indicators, footerAction ? customFooterAction : ___EmotionJSX(EuiFlexItem, {
|
|
72
|
+
grow: false
|
|
73
|
+
}, ___EmotionJSX(EuiI18n, {
|
|
74
|
+
tokens: ['euiTourFooter.endTour', 'euiTourFooter.skipTour', 'euiTourFooter.closeTour'],
|
|
75
|
+
defaults: ['End tour', 'Skip tour', 'Close tour']
|
|
76
|
+
}, function (_ref2) {
|
|
77
|
+
var _ref3 = _slicedToArray(_ref2, 3),
|
|
78
|
+
endTour = _ref3[0],
|
|
79
|
+
skipTour = _ref3[1],
|
|
80
|
+
closeTour = _ref3[2];
|
|
81
|
+
return ___EmotionJSX(EuiButtonEmpty, {
|
|
82
|
+
onClick: onFinish,
|
|
83
|
+
color: "text",
|
|
84
|
+
flush: "right",
|
|
85
|
+
size: "xs"
|
|
86
|
+
}, stepsTotal > 1 ? stepsTotal === step ? endTour : skipTour : closeTour);
|
|
87
|
+
}))));
|
|
88
|
+
});
|
|
89
|
+
EuiTourFooter.displayName = '_EuiTourFooter';
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { shade, tint } from '../../services';
|
|
11
|
+
import { logicalCSS } from '../../global_styling';
|
|
12
|
+
export var _tourFooterBgColor = function _tourFooterBgColor(_ref) {
|
|
13
|
+
var colorMode = _ref.colorMode,
|
|
14
|
+
euiTheme = _ref.euiTheme;
|
|
15
|
+
return colorMode === 'DARK' ? shade(euiTheme.colors.lightestShade, 0.45) : tint(euiTheme.colors.lightestShade, 0.5);
|
|
16
|
+
};
|
|
17
|
+
export var euiTourFooterStyles = function euiTourFooterStyles(euiThemeContext) {
|
|
18
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
19
|
+
return {
|
|
20
|
+
// Base
|
|
21
|
+
euiTourFooter: /*#__PURE__*/css("background-color:", _tourFooterBgColor(euiThemeContext), ";", logicalCSS('border-bottom-left-radius', euiTheme.border.radius.medium), " ", logicalCSS('border-bottom-right-radius', euiTheme.border.radius.medium), ";;label:euiTourFooter;")
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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 React, { memo } from 'react';
|
|
10
|
+
import { useEuiTheme } from '../../services';
|
|
11
|
+
import { EuiPopoverTitle } from '../popover';
|
|
12
|
+
import { EuiTitle } from '../title';
|
|
13
|
+
import { euiTourHeaderStyles } from './_tour_header.styles';
|
|
14
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
15
|
+
export var EuiTourHeader = /*#__PURE__*/memo(function (_ref) {
|
|
16
|
+
var id = _ref.id,
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
subtitle = _ref.subtitle;
|
|
19
|
+
var euiTheme = useEuiTheme();
|
|
20
|
+
var headerStyles = euiTourHeaderStyles(euiTheme);
|
|
21
|
+
return ___EmotionJSX(EuiPopoverTitle, {
|
|
22
|
+
css: headerStyles.euiTourHeader,
|
|
23
|
+
className: "euiTourHeader",
|
|
24
|
+
id: id
|
|
25
|
+
}, subtitle && ___EmotionJSX(EuiTitle, {
|
|
26
|
+
css: headerStyles.euiTourHeader__subtitle,
|
|
27
|
+
size: "xxxs"
|
|
28
|
+
}, ___EmotionJSX("h2", null, subtitle)), ___EmotionJSX(EuiTitle, {
|
|
29
|
+
css: headerStyles.euiTourHeader__title,
|
|
30
|
+
size: "xxs"
|
|
31
|
+
}, subtitle ? ___EmotionJSX("h3", null, title) : ___EmotionJSX("h2", null, title)));
|
|
32
|
+
});
|
|
33
|
+
EuiTourHeader.displayName = '_EuiTourHeader';
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { logicalCSS } from '../../global_styling';
|
|
11
|
+
export var euiTourHeaderStyles = function euiTourHeaderStyles(_ref) {
|
|
12
|
+
var euiTheme = _ref.euiTheme;
|
|
13
|
+
return {
|
|
14
|
+
// Base
|
|
15
|
+
euiTourHeader: /*#__PURE__*/css(logicalCSS('border-bottom', 'none'), logicalCSS('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
|
|
16
|
+
// Elements
|
|
17
|
+
euiTourHeader__title: /*#__PURE__*/css(logicalCSS('margin-top', 0), ";;label:euiTourHeader__title;"),
|
|
18
|
+
euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -7,23 +7,18 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
|
-
import { shade, tint, COLOR_MODES_STANDARD } from '../../services';
|
|
11
10
|
import { logicalCSS, mathWithUnits, euiCanAnimate } from '../../global_styling';
|
|
12
11
|
import { openAnimationTiming } from '../popover/popover_panel/_popover_panel.styles';
|
|
13
12
|
import { popoverArrowSize } from '../popover/popover_arrow/_popover_arrow.styles';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
export var euiTourStyles = function euiTourStyles(_ref) {
|
|
18
|
-
var euiTheme = _ref.euiTheme,
|
|
19
|
-
colorMode = _ref.colorMode;
|
|
13
|
+
import { _tourFooterBgColor } from './_tour_footer.styles';
|
|
14
|
+
export var euiTourStyles = function euiTourStyles(euiThemeContext) {
|
|
20
15
|
return {
|
|
21
16
|
// Targets EuiPopoverPanel
|
|
22
|
-
euiTour: /*#__PURE__*/css("[data-popover-arrow='top']::before{", logicalCSS('border-top-color',
|
|
17
|
+
euiTour: /*#__PURE__*/css("[data-popover-arrow='top']::before{", logicalCSS('border-top-color', _tourFooterBgColor(euiThemeContext)), ";};label:euiTour;")
|
|
23
18
|
};
|
|
24
19
|
};
|
|
25
|
-
export var euiTourBeaconStyles = function euiTourBeaconStyles(
|
|
26
|
-
var euiTheme =
|
|
20
|
+
export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref) {
|
|
21
|
+
var euiTheme = _ref.euiTheme;
|
|
27
22
|
var arrowSize = euiTheme.size[popoverArrowSize];
|
|
28
23
|
var arrowHalfSize = mathWithUnits(arrowSize, function (x) {
|
|
29
24
|
return x / 2;
|
|
@@ -41,22 +36,4 @@ export var euiTourBeaconStyles = function euiTourBeaconStyles(_ref2) {
|
|
|
41
36
|
top: /*#__PURE__*/css(logicalCSS('top', arrowSize), " ", logicalCSS('left', arrowHalfSize), ";;label:top;"),
|
|
42
37
|
bottom: /*#__PURE__*/css(logicalCSS('top', arrowOffset), " ", logicalCSS('left', arrowHalfSize), ";;label:bottom;")
|
|
43
38
|
};
|
|
44
|
-
};
|
|
45
|
-
export var euiTourHeaderStyles = function euiTourHeaderStyles(_ref3) {
|
|
46
|
-
var euiTheme = _ref3.euiTheme;
|
|
47
|
-
return {
|
|
48
|
-
// Base
|
|
49
|
-
euiTourHeader: /*#__PURE__*/css(logicalCSS('border-bottom', 'none'), logicalCSS('margin-bottom', euiTheme.size.s), ";;label:euiTourHeader;"),
|
|
50
|
-
// Elements
|
|
51
|
-
euiTourHeader__title: /*#__PURE__*/css(logicalCSS('margin-top', 0), ";;label:euiTourHeader__title;"),
|
|
52
|
-
euiTourHeader__subtitle: /*#__PURE__*/css("color:", euiTheme.colors.subduedText, ";padding-block-end:", euiTheme.size.xs, ";;label:euiTourHeader__subtitle;")
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export var euiTourFooterStyles = function euiTourFooterStyles(_ref4) {
|
|
56
|
-
var euiTheme = _ref4.euiTheme,
|
|
57
|
-
colorMode = _ref4.colorMode;
|
|
58
|
-
return {
|
|
59
|
-
// Base
|
|
60
|
-
euiTourFooter: /*#__PURE__*/css("background-color:", backgroundColor(euiTheme.colors.lightestShade, colorMode), ";", logicalCSS('border-bottom-left-radius', euiTheme.border.radius.medium), " ", logicalCSS('border-bottom-right-radius', euiTheme.border.radius.medium), ";;label:euiTourFooter;")
|
|
61
|
-
};
|
|
62
39
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "
|
|
5
|
+
var _excluded = ["anchorPosition", "anchor", "children", "className", "css", "closePopover", "content", "isStepOpen", "minWidth", "maxWidth", "onFinish", "step", "stepsTotal", "subtitle", "title", "decoration", "footerAction", "panelProps", "panelClassName"];
|
|
7
6
|
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; }
|
|
8
7
|
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; }
|
|
9
8
|
/*
|
|
@@ -14,17 +13,15 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
14
13
|
* Side Public License, v 1.
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
|
-
import React, { useEffect, useState } from 'react';
|
|
16
|
+
import React, { useEffect, useState, useMemo, useCallback } from 'react';
|
|
18
17
|
import classNames from 'classnames';
|
|
18
|
+
import { logicalStyles } from '../../global_styling';
|
|
19
19
|
import { EuiBeacon } from '../beacon';
|
|
20
|
-
import {
|
|
21
|
-
import { EuiFlexGroup, EuiFlexItem } from '../flex';
|
|
22
|
-
import { EuiI18n } from '../i18n';
|
|
23
|
-
import { EuiPopover, EuiPopoverFooter, EuiPopoverTitle, EuiWrappingPopover } from '../popover';
|
|
24
|
-
import { EuiTitle } from '../title';
|
|
25
|
-
import { EuiTourStepIndicator } from './tour_step_indicator';
|
|
20
|
+
import { EuiPopover, EuiWrappingPopover } from '../popover';
|
|
26
21
|
import { useGeneratedHtmlId, findElementBySelectorOrRef, useEuiTheme } from '../../services';
|
|
27
|
-
import {
|
|
22
|
+
import { EuiTourHeader } from './_tour_header';
|
|
23
|
+
import { EuiTourFooter } from './_tour_footer';
|
|
24
|
+
import { euiTourStyles, euiTourBeaconStyles } from './tour.styles';
|
|
28
25
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
29
26
|
export var EuiTourStep = function EuiTourStep(_ref) {
|
|
30
27
|
var _ref$anchorPosition = _ref.anchorPosition,
|
|
@@ -46,17 +43,17 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
46
43
|
_ref$step = _ref.step,
|
|
47
44
|
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
48
45
|
stepsTotal = _ref.stepsTotal,
|
|
49
|
-
style = _ref.style,
|
|
50
46
|
subtitle = _ref.subtitle,
|
|
51
47
|
title = _ref.title,
|
|
52
48
|
_ref$decoration = _ref.decoration,
|
|
53
49
|
decoration = _ref$decoration === void 0 ? 'beacon' : _ref$decoration,
|
|
54
50
|
footerAction = _ref.footerAction,
|
|
55
51
|
panelProps = _ref.panelProps,
|
|
52
|
+
panelClassName = _ref.panelClassName,
|
|
56
53
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
57
54
|
var titleId = useGeneratedHtmlId();
|
|
58
55
|
if (step === 0) {
|
|
59
|
-
console.warn('EuiTourStep `step` should 1-based indexing. Please update to eliminate 0 indexes.');
|
|
56
|
+
console.warn('EuiTourStep `step` should use 1-based indexing. Please update to eliminate 0 indexes.');
|
|
60
57
|
}
|
|
61
58
|
var _useState = useState(null),
|
|
62
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -66,11 +63,10 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
66
63
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
67
64
|
popoverPosition = _useState4[0],
|
|
68
65
|
setPopoverPosition = _useState4[1];
|
|
69
|
-
var onPositionChange = function
|
|
66
|
+
var onPositionChange = useCallback(function (position) {
|
|
70
67
|
setPopoverPosition(position);
|
|
71
|
-
};
|
|
68
|
+
}, []);
|
|
72
69
|
useEffect(function () {
|
|
73
|
-
var timeout;
|
|
74
70
|
if (anchor) {
|
|
75
71
|
// Wait until next tick to find anchor node in case it's not already
|
|
76
72
|
// in DOM requestAnimationFrame isn't used here because we don't need to
|
|
@@ -78,124 +74,60 @@ export var EuiTourStep = function EuiTourStep(_ref) {
|
|
|
78
74
|
// needs to go through a react DOM rerender which may take more than
|
|
79
75
|
// 1 frame (16ms) of time.
|
|
80
76
|
// TODO: It would be ideal to have some kind of intersection observer here instead
|
|
81
|
-
timeout = window.setTimeout(function () {
|
|
77
|
+
var timeout = window.setTimeout(function () {
|
|
82
78
|
setAnchorNode(findElementBySelectorOrRef(anchor));
|
|
83
79
|
});
|
|
80
|
+
return function () {
|
|
81
|
+
return window.clearTimeout(timeout);
|
|
82
|
+
};
|
|
84
83
|
}
|
|
85
|
-
return function () {
|
|
86
|
-
timeout && window.clearTimeout(timeout);
|
|
87
|
-
};
|
|
88
84
|
}, [anchor]);
|
|
89
|
-
var
|
|
85
|
+
var anchorClasses = classNames('euiTourAnchor', className);
|
|
86
|
+
var popoverClasses = classNames('euiTour', panelClassName);
|
|
90
87
|
var euiTheme = useEuiTheme();
|
|
91
88
|
var tourStyles = euiTourStyles(euiTheme);
|
|
92
|
-
var headerStyles = euiTourHeaderStyles(euiTheme);
|
|
93
|
-
var footerStyles = euiTourFooterStyles(euiTheme);
|
|
94
89
|
var beaconStyles = euiTourBeaconStyles(euiTheme);
|
|
95
90
|
var beaconCss = [beaconStyles.euiTourBeacon, isStepOpen && beaconStyles.isOpen, popoverPosition && beaconStyles[popoverPosition]];
|
|
96
|
-
var finishButtonProps = {
|
|
97
|
-
color: 'text',
|
|
98
|
-
flush: 'right',
|
|
99
|
-
size: 'xs'
|
|
100
|
-
};
|
|
101
|
-
var optionalFooterAction = Array.isArray(footerAction) ? ___EmotionJSX(EuiFlexGroup, {
|
|
102
|
-
gutterSize: "s",
|
|
103
|
-
alignItems: "center",
|
|
104
|
-
justifyContent: "flexEnd",
|
|
105
|
-
responsive: false,
|
|
106
|
-
wrap: true
|
|
107
|
-
}, footerAction.map(function (action, index) {
|
|
108
|
-
return ___EmotionJSX(EuiFlexItem, {
|
|
109
|
-
key: index,
|
|
110
|
-
grow: false
|
|
111
|
-
}, action);
|
|
112
|
-
})) : ___EmotionJSX(EuiFlexItem, {
|
|
113
|
-
grow: false
|
|
114
|
-
}, footerAction);
|
|
115
|
-
var footer = ___EmotionJSX(EuiFlexGroup, {
|
|
116
|
-
responsive: false,
|
|
117
|
-
justifyContent: stepsTotal > 1 ? 'spaceBetween' : 'flexEnd',
|
|
118
|
-
alignItems: "center"
|
|
119
|
-
}, stepsTotal > 1 && ___EmotionJSX(EuiFlexItem, {
|
|
120
|
-
grow: false
|
|
121
|
-
}, ___EmotionJSX("ul", {
|
|
122
|
-
className: "euiTourFooter__stepList"
|
|
123
|
-
}, _toConsumableArray(Array(stepsTotal).keys()).map(function (_, i) {
|
|
124
|
-
var status = 'complete';
|
|
125
|
-
if (step === i + 1) {
|
|
126
|
-
status = 'active';
|
|
127
|
-
} else if (step <= i) {
|
|
128
|
-
status = 'incomplete';
|
|
129
|
-
}
|
|
130
|
-
return ___EmotionJSX(EuiTourStepIndicator, {
|
|
131
|
-
key: i,
|
|
132
|
-
number: i + 1,
|
|
133
|
-
status: status
|
|
134
|
-
});
|
|
135
|
-
}))), footerAction ? optionalFooterAction : ___EmotionJSX(EuiFlexItem, {
|
|
136
|
-
grow: false
|
|
137
|
-
}, ___EmotionJSX(EuiI18n, {
|
|
138
|
-
tokens: ['euiTourStep.endTour', 'euiTourStep.skipTour', 'euiTourStep.closeTour'],
|
|
139
|
-
defaults: ['End tour', 'Skip tour', 'Close tour']
|
|
140
|
-
}, function (_ref2) {
|
|
141
|
-
var _ref3 = _slicedToArray(_ref2, 3),
|
|
142
|
-
endTour = _ref3[0],
|
|
143
|
-
skipTour = _ref3[1],
|
|
144
|
-
closeTour = _ref3[2];
|
|
145
|
-
var content = closeTour;
|
|
146
|
-
if (stepsTotal > 1) {
|
|
147
|
-
content = stepsTotal === step ? endTour : skipTour;
|
|
148
|
-
}
|
|
149
|
-
return ___EmotionJSX(EuiButtonEmpty, _extends({
|
|
150
|
-
onClick: onFinish
|
|
151
|
-
}, finishButtonProps), content);
|
|
152
|
-
})));
|
|
153
91
|
var hasBeacon = decoration === 'beacon';
|
|
154
|
-
var
|
|
92
|
+
var widthStyles = useMemo(function () {
|
|
93
|
+
return logicalStyles({
|
|
94
|
+
minWidth: minWidth,
|
|
95
|
+
maxWidth: maxWidth
|
|
96
|
+
});
|
|
97
|
+
}, [minWidth, maxWidth]);
|
|
98
|
+
var noAnchor = !anchor && children;
|
|
99
|
+
var PopoverComponent = noAnchor ? EuiPopover : EuiWrappingPopover;
|
|
100
|
+
var button = noAnchor ? children : anchorNode;
|
|
101
|
+
return button ? ___EmotionJSX(PopoverComponent, _extends({
|
|
102
|
+
button: button,
|
|
103
|
+
className: anchorClasses,
|
|
155
104
|
anchorPosition: anchorPosition,
|
|
156
105
|
closePopover: closePopover,
|
|
157
106
|
isOpen: isStepOpen,
|
|
158
107
|
ownFocus: false,
|
|
159
|
-
panelClassName:
|
|
160
|
-
panelStyle: style,
|
|
108
|
+
panelClassName: popoverClasses,
|
|
161
109
|
panelProps: _objectSpread(_objectSpread({}, panelProps), {}, {
|
|
162
110
|
css: [tourStyles.euiTour, css, panelProps === null || panelProps === void 0 ? void 0 : panelProps.css]
|
|
163
111
|
}),
|
|
164
112
|
offset: hasBeacon ? 10 : 0,
|
|
165
|
-
|
|
113
|
+
"aria-labelledby": titleId,
|
|
166
114
|
arrowChildren: hasBeacon && ___EmotionJSX(EuiBeacon, {
|
|
167
115
|
css: beaconCss,
|
|
168
116
|
className: "euiTour__beacon"
|
|
169
117
|
}),
|
|
170
118
|
onPositionChange: onPositionChange
|
|
171
|
-
}, rest)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}, ___EmotionJSX(
|
|
178
|
-
css: headerStyles.euiTourHeader,
|
|
179
|
-
className: "euiTourHeader",
|
|
180
|
-
id: titleId
|
|
181
|
-
}, subtitle && ___EmotionJSX(EuiTitle, {
|
|
182
|
-
css: headerStyles.euiTourHeader__subtitle,
|
|
183
|
-
size: "xxxs"
|
|
184
|
-
}, ___EmotionJSX("h2", null, subtitle)), ___EmotionJSX(EuiTitle, {
|
|
185
|
-
css: headerStyles.euiTourHeader__title,
|
|
186
|
-
size: "xxs"
|
|
187
|
-
}, subtitle ? ___EmotionJSX("h3", null, title) : ___EmotionJSX("h2", null, title))), ___EmotionJSX("div", {
|
|
119
|
+
}, rest), ___EmotionJSX("div", {
|
|
120
|
+
style: widthStyles
|
|
121
|
+
}, ___EmotionJSX(EuiTourHeader, {
|
|
122
|
+
id: titleId,
|
|
123
|
+
title: title,
|
|
124
|
+
subtitle: subtitle
|
|
125
|
+
}), ___EmotionJSX("div", {
|
|
188
126
|
className: "euiTour__content"
|
|
189
|
-
}, content), ___EmotionJSX(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
button: children
|
|
196
|
-
}, popoverProps), layout);
|
|
197
|
-
}
|
|
198
|
-
return anchorNode ? ___EmotionJSX(EuiWrappingPopover, _extends({
|
|
199
|
-
button: anchorNode
|
|
200
|
-
}, popoverProps), layout) : null;
|
|
127
|
+
}, content), ___EmotionJSX(EuiTourFooter, {
|
|
128
|
+
footerAction: footerAction,
|
|
129
|
+
step: step,
|
|
130
|
+
stepsTotal: stepsTotal,
|
|
131
|
+
onFinish: onFinish
|
|
132
|
+
}))) : null;
|
|
201
133
|
};
|