@elastic/eui 74.1.0 → 75.1.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 -323
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +0 -323
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/code/code_block.js +5 -3
- package/es/components/code/code_block_annotations.js +94 -0
- package/es/components/code/code_block_annotations.style.js +18 -0
- package/es/components/code/code_block_full_screen.js +9 -3
- package/es/components/code/code_block_line.styles.js +3 -2
- package/es/components/code/utils.js +53 -13
- package/es/components/collapsible_nav/collapsible_nav.js +10 -11
- package/es/components/flyout/flyout.js +88 -24
- package/es/components/form/range/range_track.js +1 -1
- package/es/components/header/header.js +3 -1
- package/es/components/icon/assets/app_agent.js +2 -10
- package/es/components/icon/assets/app_fleet.js +10 -2
- package/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/es/components/selectable/selectable_list/selectable_list.js +19 -5
- package/es/components/steps/step.js +19 -12
- package/es/components/steps/step.styles.js +73 -0
- package/es/components/steps/step_horizontal.js +55 -42
- package/es/components/steps/step_horizontal.styles.js +55 -0
- package/es/components/steps/step_number.js +82 -73
- package/es/components/steps/step_number.styles.js +76 -0
- package/es/components/steps/steps_horizontal.js +11 -7
- package/es/components/steps/steps_horizontal.styles.js +35 -0
- package/es/components/steps/sub_steps.js +7 -1
- package/es/components/steps/sub_steps.styles.js +14 -0
- package/es/components/tour/tour_step_indicator.js +0 -3
- package/es/global_styling/utility/animations.js +4 -3
- package/eui.d.ts +130 -16
- package/i18ntokens.json +76 -12
- package/lib/components/code/code_block.js +5 -3
- package/lib/components/code/code_block_annotations.js +113 -0
- package/lib/components/code/code_block_annotations.style.js +29 -0
- package/lib/components/code/code_block_full_screen.js +9 -3
- package/lib/components/code/code_block_line.styles.js +3 -2
- package/lib/components/code/utils.js +54 -13
- package/lib/components/collapsible_nav/collapsible_nav.js +10 -11
- package/lib/components/flyout/flyout.js +85 -22
- package/lib/components/form/range/range_track.js +1 -1
- package/lib/components/header/header.js +3 -1
- package/lib/components/icon/assets/app_agent.js +2 -10
- package/lib/components/icon/assets/app_fleet.js +10 -2
- package/lib/components/icon/svgs/app_agent.svg +2 -4
- package/lib/components/icon/svgs/app_fleet.svg +4 -2
- package/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/lib/components/selectable/selectable_list/selectable_list.js +19 -5
- package/lib/components/steps/step.js +21 -12
- package/lib/components/steps/step.styles.js +93 -0
- package/lib/components/steps/step_horizontal.js +56 -41
- package/lib/components/steps/step_horizontal.styles.js +66 -0
- package/lib/components/steps/step_number.js +86 -75
- package/lib/components/steps/step_number.styles.js +84 -0
- package/lib/components/steps/steps_horizontal.js +12 -7
- package/lib/components/steps/steps_horizontal.styles.js +38 -0
- package/lib/components/steps/sub_steps.js +9 -1
- package/lib/components/steps/sub_steps.styles.js +24 -0
- package/lib/components/tour/tour_step_indicator.js +0 -3
- package/lib/global_styling/utility/animations.js +6 -4
- package/optimize/es/components/code/code_block_annotations.js +79 -0
- package/optimize/es/components/code/code_block_annotations.style.js +18 -0
- package/optimize/es/components/code/code_block_full_screen.js +9 -3
- package/optimize/es/components/code/code_block_line.styles.js +3 -2
- package/optimize/es/components/code/utils.js +53 -13
- package/optimize/es/components/collapsible_nav/collapsible_nav.js +1 -4
- package/optimize/es/components/flyout/flyout.js +81 -24
- package/optimize/es/components/form/range/range_track.js +1 -1
- package/optimize/es/components/header/header.js +3 -1
- package/optimize/es/components/icon/assets/app_agent.js +2 -10
- package/optimize/es/components/icon/assets/app_fleet.js +10 -2
- package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/optimize/es/components/selectable/selectable_list/selectable_list.js +19 -5
- package/optimize/es/components/steps/step.js +19 -12
- package/optimize/es/components/steps/step.styles.js +73 -0
- package/optimize/es/components/steps/step_horizontal.js +54 -41
- package/optimize/es/components/steps/step_horizontal.styles.js +55 -0
- package/optimize/es/components/steps/step_number.js +82 -73
- package/optimize/es/components/steps/step_number.styles.js +76 -0
- package/optimize/es/components/steps/steps_horizontal.js +11 -7
- package/optimize/es/components/steps/steps_horizontal.styles.js +35 -0
- package/optimize/es/components/steps/sub_steps.js +7 -1
- package/optimize/es/components/steps/sub_steps.styles.js +14 -0
- package/optimize/es/components/tour/tour_step_indicator.js +0 -3
- package/optimize/es/global_styling/utility/animations.js +4 -3
- package/optimize/lib/components/code/code_block_annotations.js +105 -0
- package/optimize/lib/components/code/code_block_annotations.style.js +29 -0
- package/optimize/lib/components/code/code_block_full_screen.js +9 -3
- package/optimize/lib/components/code/code_block_line.styles.js +3 -2
- package/optimize/lib/components/code/utils.js +54 -13
- package/optimize/lib/components/collapsible_nav/collapsible_nav.js +1 -4
- package/optimize/lib/components/flyout/flyout.js +80 -22
- package/optimize/lib/components/form/range/range_track.js +1 -1
- package/optimize/lib/components/header/header.js +3 -1
- package/optimize/lib/components/icon/assets/app_agent.js +2 -10
- package/optimize/lib/components/icon/assets/app_fleet.js +10 -2
- package/optimize/lib/components/icon/svgs/app_agent.svg +2 -4
- package/optimize/lib/components/icon/svgs/app_fleet.svg +4 -2
- package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/optimize/lib/components/selectable/selectable_list/selectable_list.js +16 -5
- package/optimize/lib/components/steps/step.js +21 -12
- package/optimize/lib/components/steps/step.styles.js +93 -0
- package/optimize/lib/components/steps/step_horizontal.js +55 -40
- package/optimize/lib/components/steps/step_horizontal.styles.js +66 -0
- package/optimize/lib/components/steps/step_number.js +86 -75
- package/optimize/lib/components/steps/step_number.styles.js +84 -0
- package/optimize/lib/components/steps/steps_horizontal.js +12 -7
- package/optimize/lib/components/steps/steps_horizontal.styles.js +38 -0
- package/optimize/lib/components/steps/sub_steps.js +9 -1
- package/optimize/lib/components/steps/sub_steps.styles.js +24 -0
- package/optimize/lib/components/tour/tour_step_indicator.js +0 -3
- package/optimize/lib/global_styling/utility/animations.js +6 -4
- package/package.json +3 -3
- package/src/components/index.scss +0 -1
- package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
- package/src/themes/amsterdam/overrides/_index.scss +0 -1
- package/test-env/components/code/code_block_annotations.js +110 -0
- package/test-env/components/code/code_block_annotations.style.js +29 -0
- package/test-env/components/code/code_block_full_screen.js +9 -3
- package/test-env/components/code/code_block_line.styles.js +3 -2
- package/test-env/components/code/utils.js +54 -13
- package/test-env/components/collapsible_nav/collapsible_nav.js +10 -11
- package/test-env/components/form/range/range_track.js +1 -1
- package/test-env/components/header/header.js +3 -1
- package/test-env/components/icon/assets/app_agent.js +2 -10
- package/test-env/components/icon/assets/app_fleet.js +10 -2
- package/test-env/components/search_bar/filters/field_value_selection_filter.js +6 -10
- package/test-env/components/selectable/selectable_list/selectable_list.js +16 -5
- package/test-env/components/steps/step.js +21 -12
- package/test-env/components/steps/step.styles.js +93 -0
- package/test-env/components/steps/step_horizontal.js +56 -41
- package/test-env/components/steps/step_horizontal.styles.js +66 -0
- package/test-env/components/steps/step_number.js +86 -75
- package/test-env/components/steps/step_number.styles.js +84 -0
- package/test-env/components/steps/steps_horizontal.js +12 -7
- package/test-env/components/steps/steps_horizontal.styles.js +38 -0
- package/test-env/components/steps/sub_steps.js +9 -1
- package/test-env/components/steps/sub_steps.styles.js +24 -0
- package/test-env/components/tour/tour_step_indicator.js +0 -3
- package/test-env/global_styling/utility/animations.js +6 -4
- package/src/components/steps/_index.scss +0 -7
- package/src/components/steps/_mixins.scss +0 -12
- package/src/components/steps/_step_number.scss +0 -52
- package/src/components/steps/_steps.scss +0 -57
- package/src/components/steps/_steps_horizontal.scss +0 -135
- package/src/components/steps/_sub_steps.scss +0 -15
- package/src/components/steps/_variables.scss +0 -11
- package/src/themes/amsterdam/global_styling/variables/_steps.scss +0 -8
- package/src/themes/amsterdam/overrides/_steps.scss +0 -101
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
4
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "
|
|
6
|
+
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap"];
|
|
6
7
|
|
|
7
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
8
9
|
|
|
@@ -15,9 +16,9 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
15
16
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
17
|
* Side Public License, v 1.
|
|
17
18
|
*/
|
|
18
|
-
import React, { useEffect, useRef, useState, forwardRef
|
|
19
|
+
import React, { useEffect, useRef, useState, forwardRef } from 'react';
|
|
19
20
|
import classnames from 'classnames';
|
|
20
|
-
import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme } from '../../services';
|
|
21
|
+
import { keys, EuiWindowEvent, useCombinedRefs, useIsWithinMinBreakpoint, useEuiTheme, useGeneratedHtmlId } from '../../services';
|
|
21
22
|
import { logicalStyle } from '../../global_styling';
|
|
22
23
|
import { EuiFocusTrap } from '../focus_trap';
|
|
23
24
|
import { EuiOverlayMask } from '../overlay_mask';
|
|
@@ -25,6 +26,7 @@ import { EuiButtonIcon } from '../button';
|
|
|
25
26
|
import { EuiI18n } from '../i18n';
|
|
26
27
|
import { useResizeObserver } from '../observer/resize_observer';
|
|
27
28
|
import { EuiPortal } from '../portal';
|
|
29
|
+
import { EuiScreenReaderOnly } from '../accessibility';
|
|
28
30
|
import { euiFlyoutStyles, euiFlyoutCloseButtonStyles } from './flyout.styles';
|
|
29
31
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
30
32
|
export var TYPES = ['push', 'overlay'];
|
|
@@ -48,7 +50,6 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
48
50
|
_ref$hideCloseButton = _ref.hideCloseButton,
|
|
49
51
|
hideCloseButton = _ref$hideCloseButton === void 0 ? false : _ref$hideCloseButton,
|
|
50
52
|
closeButtonProps = _ref.closeButtonProps,
|
|
51
|
-
closeButtonAriaLabel = _ref.closeButtonAriaLabel,
|
|
52
53
|
_ref$closeButtonPosit = _ref.closeButtonPosition,
|
|
53
54
|
closeButtonPosition = _ref$closeButtonPosit === void 0 ? 'inside' : _ref$closeButtonPosit,
|
|
54
55
|
onClose = _ref.onClose,
|
|
@@ -67,11 +68,12 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
67
68
|
_ref$type = _ref.type,
|
|
68
69
|
type = _ref$type === void 0 ? 'overlay' : _ref$type,
|
|
69
70
|
outsideClickCloses = _ref.outsideClickCloses,
|
|
70
|
-
_ref$role = _ref.role,
|
|
71
|
-
role = _ref$role === void 0 ? 'dialog' : _ref$role,
|
|
72
71
|
_ref$pushMinBreakpoin = _ref.pushMinBreakpoint,
|
|
73
72
|
pushMinBreakpoint = _ref$pushMinBreakpoin === void 0 ? 'l' : _ref$pushMinBreakpoin,
|
|
74
|
-
focusTrapProps = _ref.focusTrapProps,
|
|
73
|
+
_ref$focusTrapProps = _ref.focusTrapProps,
|
|
74
|
+
_focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
|
|
75
|
+
_ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
|
|
76
|
+
includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
|
|
75
77
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
76
78
|
|
|
77
79
|
var Element = as || defaultElement;
|
|
@@ -164,7 +166,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
164
166
|
display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
|
|
165
167
|
iconType: "cross",
|
|
166
168
|
color: "text",
|
|
167
|
-
"aria-label":
|
|
169
|
+
"aria-label": closeAriaLabel,
|
|
168
170
|
"data-test-subj": "euiFlyoutCloseButton"
|
|
169
171
|
}, closeButtonProps, {
|
|
170
172
|
className: closeButtonClasses,
|
|
@@ -177,24 +179,61 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
177
179
|
}));
|
|
178
180
|
});
|
|
179
181
|
}
|
|
182
|
+
/*
|
|
183
|
+
* If not disabled, automatically add fixed EuiHeaders as shards
|
|
184
|
+
* to EuiFlyout focus traps, to prevent focus fighting
|
|
185
|
+
*/
|
|
180
186
|
|
|
181
|
-
var hasOverlayMask = ownFocus && !isPushed;
|
|
182
187
|
|
|
183
|
-
var
|
|
184
|
-
// Do not close the flyout for any external click
|
|
185
|
-
if (outsideClickCloses === false) return undefined;
|
|
188
|
+
var flyoutToggle = useRef(document.activeElement);
|
|
186
189
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
var _useState3 = useState([]),
|
|
191
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
192
|
+
fixedHeaders = _useState4[0],
|
|
193
|
+
setFixedHeaders = _useState4[1];
|
|
194
|
+
|
|
195
|
+
useEffect(function () {
|
|
196
|
+
if (includeFixedHeadersInFocusTrap) {
|
|
197
|
+
var fixedHeaderEls = document.querySelectorAll('.euiHeader[data-fixed-header]');
|
|
198
|
+
setFixedHeaders(Array.from(fixedHeaderEls)); // Flyouts that are toggled from fixed headers do not have working
|
|
199
|
+
// focus trap autoFocus, so we need to focus the flyout wrapper ourselves
|
|
200
|
+
|
|
201
|
+
fixedHeaderEls.forEach(function (header) {
|
|
202
|
+
if (header.contains(flyoutToggle.current)) {
|
|
203
|
+
resizeRef === null || resizeRef === void 0 ? void 0 : resizeRef.focus();
|
|
204
|
+
}
|
|
205
|
+
});
|
|
190
206
|
} else {
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
207
|
+
// Clear existing headers if necessary, e.g. switching to `false`
|
|
208
|
+
setFixedHeaders(function (headers) {
|
|
209
|
+
return headers.length ? [] : headers;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}, [includeFixedHeadersInFocusTrap, resizeRef]);
|
|
194
213
|
|
|
214
|
+
var focusTrapProps = _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
|
|
215
|
+
shards: [].concat(_toConsumableArray(fixedHeaders), _toConsumableArray(_focusTrapProps.shards || []))
|
|
216
|
+
});
|
|
217
|
+
/*
|
|
218
|
+
* Provide meaningful screen reader instructions/details
|
|
219
|
+
*/
|
|
195
220
|
|
|
196
|
-
|
|
197
|
-
|
|
221
|
+
|
|
222
|
+
var hasOverlayMask = ownFocus && !isPushed;
|
|
223
|
+
var descriptionId = useGeneratedHtmlId();
|
|
224
|
+
|
|
225
|
+
var screenReaderDescription = ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("p", {
|
|
226
|
+
id: descriptionId
|
|
227
|
+
}, hasOverlayMask ? ___EmotionJSX(EuiI18n, {
|
|
228
|
+
token: "euiFlyout.screenReaderModalDialog",
|
|
229
|
+
default: "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close."
|
|
230
|
+
}) : ___EmotionJSX(EuiI18n, {
|
|
231
|
+
token: "euiFlyout.screenReaderNonModalDialog",
|
|
232
|
+
default: "You are in a non-modal dialog. To close the dialog, press Escape."
|
|
233
|
+
}), ' ', fixedHeaders.length > 0 && ___EmotionJSX(EuiI18n, {
|
|
234
|
+
token: "euiFlyout.screenReaderFixedHeaders",
|
|
235
|
+
default: "You can still continue tabbing through the page headers in addition to the dialog."
|
|
236
|
+
})));
|
|
198
237
|
/*
|
|
199
238
|
* Trap focus even when `ownFocus={false}`, otherwise closing
|
|
200
239
|
* the flyout won't return focus to the originating button.
|
|
@@ -209,6 +248,22 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
209
248
|
*/
|
|
210
249
|
|
|
211
250
|
|
|
251
|
+
var onClickOutside = function onClickOutside(event) {
|
|
252
|
+
// Do not close the flyout for any external click
|
|
253
|
+
if (outsideClickCloses === false) return undefined;
|
|
254
|
+
|
|
255
|
+
if (hasOverlayMask) {
|
|
256
|
+
// The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
|
|
257
|
+
if (event.target === maskRef.current) return onClose(event);
|
|
258
|
+
} else {
|
|
259
|
+
// No overlay mask is present, so any outside clicks should close the flyout
|
|
260
|
+
if (outsideClickCloses === true) return onClose(event);
|
|
261
|
+
} // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
return undefined;
|
|
265
|
+
};
|
|
266
|
+
|
|
212
267
|
var flyout = ___EmotionJSX(EuiFocusTrap, _extends({
|
|
213
268
|
disabled: isPushed,
|
|
214
269
|
clickOutsideDisables: !ownFocus,
|
|
@@ -216,12 +271,14 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
216
271
|
}, focusTrapProps), ___EmotionJSX(Element, _extends({
|
|
217
272
|
css: cssStyles
|
|
218
273
|
}, rest, {
|
|
219
|
-
role:
|
|
274
|
+
role: "dialog",
|
|
220
275
|
className: classes,
|
|
221
|
-
tabIndex:
|
|
276
|
+
tabIndex: 0,
|
|
277
|
+
"data-autofocus": true,
|
|
278
|
+
"aria-describedby": !isPushed ? descriptionId : undefined,
|
|
222
279
|
style: newStyle,
|
|
223
280
|
ref: setRef
|
|
224
|
-
}), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
281
|
+
}), !isPushed && screenReaderDescription, closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
225
282
|
|
|
226
283
|
|
|
227
284
|
var mergedMaskProps = _objectSpread(_objectSpread({}, maskProps), {}, {
|
|
@@ -237,7 +294,7 @@ export var EuiFlyout = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
237
294
|
flyout = ___EmotionJSX(EuiPortal, null, flyout);
|
|
238
295
|
}
|
|
239
296
|
|
|
240
|
-
return ___EmotionJSX(Fragment, null, ___EmotionJSX(EuiWindowEvent, {
|
|
297
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiWindowEvent, {
|
|
241
298
|
event: "keydown",
|
|
242
299
|
handler: onKeyDown
|
|
243
300
|
}), flyout);
|
|
@@ -85,7 +85,7 @@ export var EuiRangeTrack = function EuiRangeTrack(_ref) {
|
|
|
85
85
|
}, [showTicks, ticks, min, max, tickInterval, step]);
|
|
86
86
|
var euiTheme = useEuiTheme();
|
|
87
87
|
var styles = euiRangeTrackStyles(euiTheme);
|
|
88
|
-
var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, (tickSequence || ticks) && styles.hasTicks];
|
|
88
|
+
var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, showTicks && (tickSequence || ticks) && styles.hasTicks];
|
|
89
89
|
|
|
90
90
|
var _useState = useState(0),
|
|
91
91
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -87,6 +87,8 @@ export var EuiHeader = function EuiHeader(_ref) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
return ___EmotionJSX("div", _extends({
|
|
90
|
-
className: classes
|
|
90
|
+
className: classes,
|
|
91
|
+
"data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
|
|
92
|
+
|
|
91
93
|
}, rest), contents);
|
|
92
94
|
};
|
|
@@ -27,18 +27,10 @@ var EuiIconAppAgent = function EuiIconAppAgent(_ref) {
|
|
|
27
27
|
}, props), title ? ___EmotionJSX("title", {
|
|
28
28
|
id: titleId
|
|
29
29
|
}, title) : null, ___EmotionJSX("path", {
|
|
30
|
-
|
|
31
|
-
d: "M21 2.82L16 .038 11 2.82v2.289l5-2.782 5 2.782v-2.29z"
|
|
32
|
-
}), ___EmotionJSX("path", {
|
|
33
|
-
className: "euiIcon__fillSecondary",
|
|
34
|
-
d: "M21 7.282L16 4.5l-5 2.782V9.57l5-2.781 5 2.781V7.282z"
|
|
35
|
-
}), ___EmotionJSX("path", {
|
|
36
|
-
d: "M7 5.045L2 7.827v15.577l14 7.788 14-7.788V7.827l-5-2.782v2.289l3 1.669v13.225l-12 6.676-12-6.676V9.003l3-1.669V5.045z"
|
|
30
|
+
d: "M2.996 18.636L0 20.434v6.132l6 3.6 5-3 5 3 5-3 5 3 6-3.6v-6.132l-5-3v-5l-5-3v-5l-6-3.6-6 3.6v2.832l2 .033V5.566l4-2.4 4 2.4v3.868l-1.996 1.197 1 1.733L21 11.166l4 2.4v3.868l-4 2.4-2.257-1.354-.971 1.75L20 21.565v3.868l-4 2.4-4-2.4v-1.7l-2-.033v1.733l-4 2.4-4-2.4v-3.868l1.996-1.197-1-1.733zM22 25.434v-3.868l4-2.4 4 2.4v3.868l-4 2.4-4-2.4z"
|
|
37
31
|
}), ___EmotionJSX("path", {
|
|
38
32
|
className: "euiIcon__fillSecondary",
|
|
39
|
-
|
|
40
|
-
clipRule: "evenodd",
|
|
41
|
-
d: "M22 12.5L16 9l-6 3.5v7l6 3.5 6-3.5v-7zm-9.974 1.205L16 11.387l3.974 2.318v4.59L16 20.613l-3.974-2.318v-4.59z"
|
|
33
|
+
d: "M11 22.166l-6-3.6v-6.132l6-3.6 6 3.6v6.132l-6 3.6zm4-4.732v-3.868l-4-2.4-4 2.4v3.868l4 2.4 4-2.4z"
|
|
42
34
|
}));
|
|
43
35
|
};
|
|
44
36
|
|
|
@@ -27,10 +27,18 @@ var EuiIconAppFleet = function EuiIconAppFleet(_ref) {
|
|
|
27
27
|
}, props), title ? ___EmotionJSX("title", {
|
|
28
28
|
id: titleId
|
|
29
29
|
}, title) : null, ___EmotionJSX("path", {
|
|
30
|
-
|
|
30
|
+
className: "euiIcon__fillSecondary",
|
|
31
|
+
d: "M21 2.82L16 .038 11 2.82v2.289l5-2.782 5 2.782v-2.29z"
|
|
32
|
+
}), ___EmotionJSX("path", {
|
|
33
|
+
className: "euiIcon__fillSecondary",
|
|
34
|
+
d: "M21 7.282L16 4.5l-5 2.782V9.57l5-2.781 5 2.781V7.282z"
|
|
35
|
+
}), ___EmotionJSX("path", {
|
|
36
|
+
d: "M7 5.045L2 7.827v15.577l14 7.788 14-7.788V7.827l-5-2.782v2.289l3 1.669v13.225l-12 6.676-12-6.676V9.003l3-1.669V5.045z"
|
|
31
37
|
}), ___EmotionJSX("path", {
|
|
32
38
|
className: "euiIcon__fillSecondary",
|
|
33
|
-
|
|
39
|
+
fillRule: "evenodd",
|
|
40
|
+
clipRule: "evenodd",
|
|
41
|
+
d: "M22 12.5L16 9l-6 3.5v7l6 3.5 6-3.5v-7zm-9.974 1.205L16 11.387l3.974 2.318v4.59L16 20.613l-3.974-2.318v-4.59z"
|
|
34
42
|
}));
|
|
35
43
|
};
|
|
36
44
|
|
|
@@ -251,16 +251,16 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
251
251
|
if (!multiSelect && autoClose) {
|
|
252
252
|
this.closePopover();
|
|
253
253
|
|
|
254
|
-
var _query = checked ? this.props.query.removeSimpleFieldClauses(field)
|
|
254
|
+
var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
|
|
255
255
|
|
|
256
256
|
this.props.onChange(_query);
|
|
257
257
|
} else {
|
|
258
258
|
if (multiSelect === 'or') {
|
|
259
|
-
var _query2 = checked ? this.props.query.
|
|
259
|
+
var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
|
|
260
260
|
|
|
261
261
|
this.props.onChange(_query2);
|
|
262
262
|
} else {
|
|
263
|
-
var _query3 = checked ? this.props.query.
|
|
263
|
+
var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
|
|
264
264
|
|
|
265
265
|
this.props.onChange(_query3);
|
|
266
266
|
}
|
|
@@ -370,13 +370,9 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
370
370
|
listProps: {
|
|
371
371
|
isVirtualized: isOverSearchThreshold || false
|
|
372
372
|
},
|
|
373
|
-
onChange: function onChange(options) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
if (diff) {
|
|
379
|
-
_this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
|
|
373
|
+
onChange: function onChange(options, event, changedOption) {
|
|
374
|
+
if (changedOption.data) {
|
|
375
|
+
_this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
|
|
380
376
|
}
|
|
381
377
|
}
|
|
382
378
|
}, searchProps), function (list, search) {
|
|
@@ -99,6 +99,22 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
+
_defineProperty(_assertThisInitialized(_this), "ariaSetSize", 0);
|
|
103
|
+
|
|
104
|
+
_defineProperty(_assertThisInitialized(_this), "ariaPosInSetMap", {});
|
|
105
|
+
|
|
106
|
+
_defineProperty(_assertThisInitialized(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
107
|
+
_this.ariaPosInSetMap = {};
|
|
108
|
+
var latestAriaPosIndex = 0;
|
|
109
|
+
optionArray.forEach(function (option, index) {
|
|
110
|
+
if (!option.isGroupLabel) {
|
|
111
|
+
latestAriaPosIndex++;
|
|
112
|
+
_this.ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
_this.ariaSetSize = latestAriaPosIndex;
|
|
116
|
+
});
|
|
117
|
+
|
|
102
118
|
_defineProperty(_assertThisInitialized(_this), "ListRow", /*#__PURE__*/memo(function (_ref) {
|
|
103
119
|
var data = _ref.data,
|
|
104
120
|
index = _ref.index,
|
|
@@ -142,9 +158,6 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
142
158
|
}, optionRest), prepend, label, append);
|
|
143
159
|
}
|
|
144
160
|
|
|
145
|
-
var labelCount = data.filter(function (option) {
|
|
146
|
-
return option.isGroupLabel;
|
|
147
|
-
}).length;
|
|
148
161
|
var id = makeOptionId(index);
|
|
149
162
|
return ___EmotionJSX(EuiSelectableListItem, _extends({
|
|
150
163
|
key: id,
|
|
@@ -165,8 +178,8 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
165
178
|
disabled: disabled,
|
|
166
179
|
prepend: prepend,
|
|
167
180
|
append: append,
|
|
168
|
-
"aria-posinset": index
|
|
169
|
-
"aria-setsize":
|
|
181
|
+
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
182
|
+
"aria-setsize": _this.ariaSetSize,
|
|
170
183
|
onFocusBadge: onFocusBadge,
|
|
171
184
|
allowExclusions: allowExclusions,
|
|
172
185
|
showIcons: showIcons,
|
|
@@ -323,6 +336,7 @@ export var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
323
336
|
rest = _objectWithoutProperties(_this$props7, _excluded3);
|
|
324
337
|
|
|
325
338
|
var optionArray = visibleOptions || options;
|
|
339
|
+
this.calculateAriaSetAttrs(optionArray);
|
|
326
340
|
var heightIsFull = forcedHeight === 'full';
|
|
327
341
|
var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
|
|
328
342
|
|
|
@@ -13,6 +13,8 @@ import classNames from 'classnames';
|
|
|
13
13
|
import React, { createElement } from 'react';
|
|
14
14
|
import { EuiTitle } from '../title';
|
|
15
15
|
import { EuiStepNumber } from './step_number';
|
|
16
|
+
import { useEuiTheme } from '../../services';
|
|
17
|
+
import { euiStepStyles, euiStepContentStyles, euiStepTitleStyles } from './step.styles';
|
|
16
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
19
|
export var EuiStep = function EuiStep(_ref) {
|
|
18
20
|
var className = _ref.className,
|
|
@@ -27,26 +29,31 @@ export var EuiStep = function EuiStep(_ref) {
|
|
|
27
29
|
status = _ref.status,
|
|
28
30
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
29
31
|
|
|
30
|
-
var classes = classNames('euiStep',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
var classes = classNames('euiStep', className);
|
|
33
|
+
var euiTheme = useEuiTheme();
|
|
34
|
+
var styles = euiStepStyles(euiTheme);
|
|
35
|
+
var cssStyles = [styles.euiStep, styles[titleSize]];
|
|
36
|
+
var contentStyles = euiStepContentStyles(euiTheme);
|
|
37
|
+
var cssContentStyles = [contentStyles.euiStep__content, contentStyles[titleSize]];
|
|
38
|
+
var titleStyles = euiStepTitleStyles(euiTheme);
|
|
39
|
+
var cssStepTitleStyles = [titleStyles.euiStep__title, status === 'disabled' && titleStyles.isDisabled, titleStyles[titleSize]];
|
|
40
|
+
var cssTitleWrapperStyles = titleStyles.euiStep__titleWrapper;
|
|
37
41
|
return ___EmotionJSX("div", _extends({
|
|
38
|
-
className: classes
|
|
42
|
+
className: classes,
|
|
43
|
+
css: cssStyles
|
|
39
44
|
}, rest), ___EmotionJSX("div", {
|
|
40
|
-
className: "euiStep__titleWrapper"
|
|
45
|
+
className: "euiStep__titleWrapper",
|
|
46
|
+
css: cssTitleWrapperStyles
|
|
41
47
|
}, ___EmotionJSX(EuiStepNumber, {
|
|
42
|
-
className: numberClasses,
|
|
43
48
|
number: step,
|
|
44
49
|
status: status,
|
|
45
50
|
titleSize: titleSize
|
|
46
51
|
}), ___EmotionJSX(EuiTitle, {
|
|
47
52
|
size: titleSize,
|
|
48
|
-
className: "euiStep__title"
|
|
53
|
+
className: "euiStep__title",
|
|
54
|
+
css: cssStepTitleStyles
|
|
49
55
|
}, /*#__PURE__*/createElement(headingElement, null, title))), ___EmotionJSX("div", {
|
|
50
|
-
className: "euiStep__content"
|
|
56
|
+
className: "euiStep__content",
|
|
57
|
+
css: cssContentStyles
|
|
51
58
|
}, children));
|
|
52
59
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
import { css } from '@emotion/react';
|
|
9
|
+
import { mathWithUnits, logicalCSS } from '../../global_styling';
|
|
10
|
+
export var euiStepVariables = function euiStepVariables(euiTheme) {
|
|
11
|
+
return {
|
|
12
|
+
numberSize: euiTheme.size.xl,
|
|
13
|
+
numberXSSize: euiTheme.size.l,
|
|
14
|
+
numberMargin: euiTheme.size.base
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export var euiStepStyles = function euiStepStyles(euiThemeContext) {
|
|
18
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
19
|
+
var euiStep = euiStepVariables(euiTheme); // the vertical line is centered on the number, so we need to offset the line
|
|
20
|
+
// by half of the number size & half of the line size to center it
|
|
21
|
+
|
|
22
|
+
var lineStartPosition = mathWithUnits([euiStep.numberSize, euiTheme.border.width.thick], function (x, y) {
|
|
23
|
+
return x / 2 - y / 2;
|
|
24
|
+
});
|
|
25
|
+
var lineEndPosition = mathWithUnits([euiStep.numberSize, euiTheme.border.width.thick], function (x, y) {
|
|
26
|
+
return x / 2 + y / 2;
|
|
27
|
+
});
|
|
28
|
+
var lineGradient = "linear-gradient(to right,\n transparent 0,\n transparent ".concat(lineStartPosition, ",\n ").concat(euiTheme.border.color, " ").concat(lineStartPosition, ",\n ").concat(euiTheme.border.color, " ").concat(lineEndPosition, ",\n transparent ").concat(lineEndPosition, ",\n transparent 100%)");
|
|
29
|
+
return {
|
|
30
|
+
euiStep: /*#__PURE__*/css("&:not(:last-of-type){background-image:", lineGradient, ";background-repeat:no-repeat;};label:euiStep;"),
|
|
31
|
+
// Sizes
|
|
32
|
+
m: /*#__PURE__*/css("&:not(:last-of-type){background-position:left ", euiTheme.size.xl, ";};label:m;"),
|
|
33
|
+
s: /*#__PURE__*/css("&:not(:last-of-type){background-position:left ", euiTheme.size.xl, ";};label:s;"),
|
|
34
|
+
xs: /*#__PURE__*/css("&:not(:last-of-type){background-position:-", euiTheme.size.xs, " ", euiTheme.size.l, ";};label:xs;")
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export var euiStepContentStyles = function euiStepContentStyles(euiThemeContext) {
|
|
38
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
39
|
+
var euiStep = euiStepVariables(euiTheme);
|
|
40
|
+
var styles = {
|
|
41
|
+
euiStep__content: /*#__PURE__*/css(logicalCSS('margin-top', euiTheme.size.s), " ", logicalCSS('padding-top', euiTheme.size.base), " ", logicalCSS('padding-bottom', mathWithUnits([euiTheme.size.xl, euiTheme.size.s], function (x, y) {
|
|
42
|
+
return x + y;
|
|
43
|
+
})), " ", logicalCSS('padding-right', euiTheme.size.base), ";;label:euiStep__content;"),
|
|
44
|
+
// Sizes
|
|
45
|
+
m: /*#__PURE__*/css(logicalCSS('padding-left', mathWithUnits([euiStep.numberSize, euiStep.numberMargin], function (x, y) {
|
|
46
|
+
return x / 2 + y;
|
|
47
|
+
})), logicalCSS('margin-left', mathWithUnits(euiStep.numberSize, function (x) {
|
|
48
|
+
return x / 2;
|
|
49
|
+
})), ";;label:m;"),
|
|
50
|
+
s: /*#__PURE__*/css(";label:s;"),
|
|
51
|
+
// s is the same as m, so we'll programmatically duplicate it below
|
|
52
|
+
xs: /*#__PURE__*/css(logicalCSS('padding-left', mathWithUnits([euiStep.numberXSSize, euiStep.numberMargin], function (x, y) {
|
|
53
|
+
return x / 2 + y;
|
|
54
|
+
})), logicalCSS('margin-left', mathWithUnits(euiStep.numberXSSize, function (x) {
|
|
55
|
+
return x / 2;
|
|
56
|
+
})), ";;label:xs;")
|
|
57
|
+
};
|
|
58
|
+
styles.s = styles.m;
|
|
59
|
+
return styles;
|
|
60
|
+
};
|
|
61
|
+
export var euiStepTitleStyles = function euiStepTitleStyles(euiThemeContext) {
|
|
62
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
63
|
+
var euiStep = euiStepVariables(euiTheme);
|
|
64
|
+
return {
|
|
65
|
+
euiStep__titleWrapper: /*#__PURE__*/css("display:flex;gap:", euiStep.numberMargin, ";;label:euiStep__titleWrapper;"),
|
|
66
|
+
euiStep__title: /*#__PURE__*/css(";label:euiStep__title;"),
|
|
67
|
+
isDisabled: /*#__PURE__*/css("color:", euiTheme.colors.disabledText, ";;label:isDisabled;"),
|
|
68
|
+
// Sizes
|
|
69
|
+
m: /*#__PURE__*/css(";label:m;"),
|
|
70
|
+
s: /*#__PURE__*/css(logicalCSS('padding-top', euiTheme.size.xs), ";;label:s;"),
|
|
71
|
+
xs: /*#__PURE__*/css(";label:xs;")
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -12,7 +12,9 @@ var _excluded = ["className", "step", "title", "onClick", "disabled", "status"];
|
|
|
12
12
|
import classNames from 'classnames';
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { EuiStepNumber } from './step_number';
|
|
15
|
-
import { useI18nCompleteStep, useI18nCurrentStep, useI18nDisabledStep, useI18nIncompleteStep, useI18nStep, useI18nWarningStep } from './step_strings';
|
|
15
|
+
import { useI18nCompleteStep, useI18nCurrentStep, useI18nDisabledStep, useI18nIncompleteStep, useI18nStep, useI18nWarningStep, useI18nErrorsStep, useI18nLoadingStep } from './step_strings';
|
|
16
|
+
import { useEuiTheme } from '../../services';
|
|
17
|
+
import { euiStepHorizontalStyles, euiStepHorizontalNumberStyles, euiStepHorizontalTitleStyles } from './step_horizontal.styles';
|
|
16
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
17
19
|
export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
18
20
|
var className = _ref.className,
|
|
@@ -25,43 +27,50 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
25
27
|
status = _ref$status === void 0 ? 'incomplete' : _ref$status,
|
|
26
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
29
|
|
|
28
|
-
var buttonTitle = useI18nStep({
|
|
29
|
-
number: step,
|
|
30
|
-
title: title
|
|
31
|
-
});
|
|
32
|
-
var completeTitle = useI18nCompleteStep({
|
|
33
|
-
number: step,
|
|
34
|
-
title: title
|
|
35
|
-
});
|
|
36
|
-
var disabledTitle = useI18nDisabledStep({
|
|
37
|
-
number: step,
|
|
38
|
-
title: title
|
|
39
|
-
});
|
|
40
|
-
var incompleteTitle = useI18nIncompleteStep({
|
|
41
|
-
number: step,
|
|
42
|
-
title: title
|
|
43
|
-
});
|
|
44
|
-
var warningTitle = useI18nWarningStep({
|
|
45
|
-
number: step,
|
|
46
|
-
title: title
|
|
47
|
-
});
|
|
48
|
-
var currentTitle = useI18nCurrentStep({
|
|
49
|
-
number: step,
|
|
50
|
-
title: title
|
|
51
|
-
});
|
|
52
30
|
if (disabled) status = 'disabled';
|
|
53
|
-
var classes = classNames('euiStepHorizontal', className
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
31
|
+
var classes = classNames('euiStepHorizontal', className);
|
|
32
|
+
var euiTheme = useEuiTheme();
|
|
33
|
+
var styles = euiStepHorizontalStyles(euiTheme);
|
|
34
|
+
var cssStyles = [styles.euiStepHorizontal, status === 'disabled' ? styles.disabled : styles.enabled];
|
|
35
|
+
var numberStyles = euiStepHorizontalNumberStyles(euiTheme);
|
|
36
|
+
var cssNumberStyles = [numberStyles.euiStepHorizontal__number];
|
|
37
|
+
var titleStyles = euiStepHorizontalTitleStyles(euiTheme);
|
|
38
|
+
var cssTitleStyles = [titleStyles.euiStepHorizontal__title, status === 'disabled' && titleStyles.disabled];
|
|
39
|
+
var titleAttrsMap = {
|
|
40
|
+
step: useI18nStep({
|
|
41
|
+
number: step,
|
|
42
|
+
title: title
|
|
43
|
+
}),
|
|
44
|
+
current: useI18nCurrentStep({
|
|
45
|
+
number: step,
|
|
46
|
+
title: title
|
|
47
|
+
}),
|
|
48
|
+
disabled: useI18nDisabledStep({
|
|
49
|
+
number: step,
|
|
50
|
+
title: title
|
|
51
|
+
}),
|
|
52
|
+
incomplete: useI18nIncompleteStep({
|
|
53
|
+
number: step,
|
|
54
|
+
title: title
|
|
55
|
+
}),
|
|
56
|
+
complete: useI18nCompleteStep({
|
|
57
|
+
number: step,
|
|
58
|
+
title: title
|
|
59
|
+
}),
|
|
60
|
+
warning: useI18nWarningStep({
|
|
61
|
+
number: step,
|
|
62
|
+
title: title
|
|
63
|
+
}),
|
|
64
|
+
danger: useI18nErrorsStep({
|
|
65
|
+
number: step,
|
|
66
|
+
title: title
|
|
67
|
+
}),
|
|
68
|
+
loading: useI18nLoadingStep({
|
|
69
|
+
number: step,
|
|
70
|
+
title: title
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
var titleAttr = titleAttrsMap[status || 'step'];
|
|
65
74
|
|
|
66
75
|
var onStepClick = function onStepClick(event) {
|
|
67
76
|
if (!disabled) onClick(event);
|
|
@@ -69,14 +78,18 @@ export var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
69
78
|
|
|
70
79
|
return ___EmotionJSX("button", _extends({
|
|
71
80
|
className: classes,
|
|
72
|
-
title:
|
|
81
|
+
title: titleAttr,
|
|
73
82
|
onClick: onStepClick,
|
|
74
|
-
disabled: disabled
|
|
83
|
+
disabled: disabled,
|
|
84
|
+
css: cssStyles,
|
|
85
|
+
"data-step-status": status
|
|
75
86
|
}, rest), ___EmotionJSX(EuiStepNumber, {
|
|
76
87
|
className: "euiStepHorizontal__number",
|
|
77
88
|
status: status,
|
|
78
|
-
number: step
|
|
89
|
+
number: step,
|
|
90
|
+
css: cssNumberStyles
|
|
79
91
|
}), ___EmotionJSX("span", {
|
|
80
|
-
className: "euiStepHorizontal__title"
|
|
92
|
+
className: "euiStepHorizontal__title",
|
|
93
|
+
css: cssTitleStyles
|
|
81
94
|
}, title));
|
|
82
95
|
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
5
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
6
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
7
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
8
|
+
* Side Public License, v 1.
|
|
9
|
+
*/
|
|
10
|
+
import { css } from '@emotion/react';
|
|
11
|
+
import { euiBreakpoint, logicalShorthandCSS, euiFocusRing, euiCanAnimate, mathWithUnits } from '../../global_styling/';
|
|
12
|
+
import { euiTitle } from '../title/title.styles';
|
|
13
|
+
import { euiStepVariables } from './step.styles';
|
|
14
|
+
|
|
15
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
16
|
+
name: "b86pnw-disabled",
|
|
17
|
+
styles: "cursor:not-allowed;label:disabled;"
|
|
18
|
+
} : {
|
|
19
|
+
name: "b86pnw-disabled",
|
|
20
|
+
styles: "cursor:not-allowed;label:disabled;",
|
|
21
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export var euiStepHorizontalStyles = function euiStepHorizontalStyles(euiThemeContext) {
|
|
25
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
26
|
+
var euiStep = euiStepVariables(euiTheme);
|
|
27
|
+
/**
|
|
28
|
+
* 1. Ensure the connecting lines stays behind the number
|
|
29
|
+
* 2. Make the content of each step align to the top, even if the steps are of varying heights,
|
|
30
|
+
* e.g. due to some of their titles wrapping to multiple lines
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
euiStepHorizontal: /*#__PURE__*/css(logicalShorthandCSS('padding', "".concat(euiTheme.size.l, " ").concat(euiTheme.size.base, " ").concat(euiTheme.size.base)), " display:flex;flex-direction:column;align-items:center;justify-content:flex-start;cursor:pointer;position:relative;inline-size:100%;&::before,&::after{content:'';position:absolute;background-color:", euiTheme.border.color, ";block-size:", euiTheme.border.width.thick, ";inline-size:calc(50% - (", euiStep.numberSize, " / 2));inset-block-start:", mathWithUnits([euiTheme.size.l, euiStep.numberSize], function (x, y) {
|
|
35
|
+
return x + y / 2;
|
|
36
|
+
}), ";z-index:", euiTheme.levels.content, ";}&::before{inset-inline-start:0;}&::after{inset-inline-end:0;};label:euiStepHorizontal;"),
|
|
37
|
+
// Note: these selectors must be nested because focus/hover state
|
|
38
|
+
// is on the parent container, but affects specific children
|
|
39
|
+
enabled: /*#__PURE__*/css("&:focus,&:hover{.euiStepHorizontal__title{text-decoration:underline;}}&:focus{outline:none;.euiStepHorizontal__number{", euiFocusRing(euiThemeContext), ";}.euiStepHorizontal__number:not(:focus-visible){outline:", euiTheme.focus.width, " solid ", euiTheme.colors.darkestShade, ";}};label:enabled;"),
|
|
40
|
+
disabled: _ref
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export var euiStepHorizontalNumberStyles = function euiStepHorizontalNumberStyles(euiThemeContext) {
|
|
44
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
45
|
+
return {
|
|
46
|
+
euiStepHorizontal__number: /*#__PURE__*/css("position:relative;z-index:", Number(euiTheme.levels.content) + 1, ";", euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in-out;};label:euiStepHorizontal__number;")
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export var euiStepHorizontalTitleStyles = function euiStepHorizontalTitleStyles(euiThemeContext) {
|
|
50
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
51
|
+
return {
|
|
52
|
+
euiStepHorizontal__title: /*#__PURE__*/css(euiTitle(euiThemeContext, 'xs'), ";margin-block-start:", euiTheme.size.s, ";font-weight:", euiTheme.font.weight.bold, ";text-align:center;", euiBreakpoint(euiThemeContext, ['xs', 's']), "{display:none;};label:euiStepHorizontal__title;"),
|
|
53
|
+
disabled: /*#__PURE__*/css("color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
54
|
+
};
|
|
55
|
+
};
|