@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
|
@@ -17,6 +17,8 @@ var _refractor = require("refractor");
|
|
|
17
17
|
|
|
18
18
|
var _css = require("@emotion/css");
|
|
19
19
|
|
|
20
|
+
var _code_block_annotations = require("./code_block_annotations");
|
|
21
|
+
|
|
20
22
|
var _code_block_line = require("./code_block_line.styles");
|
|
21
23
|
|
|
22
24
|
var _react2 = require("@emotion/react");
|
|
@@ -68,7 +70,15 @@ var nodeToHtml = function nodeToHtml(node, idx, nodes) {
|
|
|
68
70
|
key: key,
|
|
69
71
|
className: (0, _css.cx)(properties.className)
|
|
70
72
|
}), children && children.map(function (el, i) {
|
|
71
|
-
return
|
|
73
|
+
return (// @ts-ignore - using a custom type here to handle JSX annotations
|
|
74
|
+
el.type === 'annotation' ? // @ts-ignore - custom keys are passed by annotationElement below
|
|
75
|
+
(0, _react2.jsx)(_code_block_annotations.EuiCodeBlockAnnotation, {
|
|
76
|
+
lineNumber: el.lineNumber,
|
|
77
|
+
children: el.annotation,
|
|
78
|
+
key: i
|
|
79
|
+
}) // prettier-ignore
|
|
80
|
+
: nodeToHtml(el, i, nodes, depth + 1)
|
|
81
|
+
);
|
|
72
82
|
}));
|
|
73
83
|
}
|
|
74
84
|
|
|
@@ -176,31 +186,61 @@ function wrapLines(nodes, options, euiTheme) {
|
|
|
176
186
|
var lineStyles = (0, _css.cx)([styles.euiCodeBlock__line, options.showLineNumbers && styles.hasLineNumbers]);
|
|
177
187
|
|
|
178
188
|
if (options.showLineNumbers) {
|
|
179
|
-
var _properties;
|
|
189
|
+
var _properties, _options$annotations;
|
|
180
190
|
|
|
181
191
|
var lineNumber = i + 1;
|
|
182
192
|
var digits = grouped.length.toString().length;
|
|
183
|
-
var width = digits * CHAR_SIZE;
|
|
193
|
+
var width = digits * CHAR_SIZE; // Line text element and highlights
|
|
194
|
+
|
|
184
195
|
var highlights = options.highlight ? parseLineRanges(options.highlight) : [];
|
|
185
196
|
var lineTextStyles = (0, _css.cx)([styles.lineText.euiCodeBlock__lineText, highlights.includes(lineNumber) && styles.lineText.isHighlighted]);
|
|
186
|
-
var
|
|
187
|
-
|
|
197
|
+
var lineTextElement = {
|
|
198
|
+
type: 'element',
|
|
199
|
+
tagName: 'span',
|
|
200
|
+
properties: {
|
|
201
|
+
className: ['euiCodeBlock__lineText', lineTextStyles]
|
|
202
|
+
},
|
|
203
|
+
children: node
|
|
204
|
+
}; // Line number column/wrapper
|
|
205
|
+
|
|
206
|
+
var lineNumberWrapperStyles = (0, _css.cx)(styles.lineNumber.euiCodeBlock__lineNumberWrapper);
|
|
207
|
+
var lineNumberWrapperElement = {
|
|
188
208
|
type: 'element',
|
|
189
209
|
tagName: 'span',
|
|
190
210
|
properties: (_properties = {
|
|
191
211
|
style: {
|
|
192
212
|
inlineSize: width
|
|
193
213
|
}
|
|
194
|
-
}, (0, _defineProperty2.default)(_properties, 'data-line-number', lineNumber), (0, _defineProperty2.default)(_properties,
|
|
214
|
+
}, (0, _defineProperty2.default)(_properties, 'data-line-number', lineNumber), (0, _defineProperty2.default)(_properties, "className", ['euiCodeBlock__lineNumber', lineNumberWrapperStyles]), _properties),
|
|
195
215
|
children: []
|
|
196
|
-
}
|
|
216
|
+
}; // Line number element
|
|
217
|
+
|
|
218
|
+
var lineNumberStyles = (0, _css.cx)(styles.lineNumber.euiCodeBlock__lineNumber);
|
|
219
|
+
var lineNumberElement = {
|
|
197
220
|
type: 'element',
|
|
198
221
|
tagName: 'span',
|
|
199
|
-
properties: {
|
|
200
|
-
className: [
|
|
201
|
-
},
|
|
202
|
-
children:
|
|
203
|
-
|
|
222
|
+
properties: (0, _defineProperty2.default)({
|
|
223
|
+
className: [lineNumberStyles]
|
|
224
|
+
}, 'aria-hidden', true),
|
|
225
|
+
children: [{
|
|
226
|
+
type: 'text',
|
|
227
|
+
value: String(lineNumber)
|
|
228
|
+
}]
|
|
229
|
+
};
|
|
230
|
+
lineNumberWrapperElement.children.push(lineNumberElement); // Annotation element
|
|
231
|
+
|
|
232
|
+
var hasAnnotation = (_options$annotations = options.annotations) === null || _options$annotations === void 0 ? void 0 : _options$annotations.hasOwnProperty(lineNumber);
|
|
233
|
+
|
|
234
|
+
if (hasAnnotation) {
|
|
235
|
+
var annotationElement = {
|
|
236
|
+
type: 'annotation',
|
|
237
|
+
annotation: options.annotations[lineNumber],
|
|
238
|
+
lineNumber: lineNumber
|
|
239
|
+
};
|
|
240
|
+
lineNumberWrapperElement.children.push(annotationElement);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
children = [lineNumberWrapperElement, lineTextElement];
|
|
204
244
|
}
|
|
205
245
|
|
|
206
246
|
wrapped.push({
|
|
@@ -220,7 +260,8 @@ var highlightByLine = function highlightByLine(children, language, data, euiThem
|
|
|
220
260
|
lineNumber: data.start
|
|
221
261
|
}), {
|
|
222
262
|
showLineNumbers: data.show,
|
|
223
|
-
highlight: data.highlight
|
|
263
|
+
highlight: data.highlight,
|
|
264
|
+
annotations: data.annotations
|
|
224
265
|
}, euiTheme);
|
|
225
266
|
};
|
|
226
267
|
|
|
@@ -27,7 +27,7 @@ var _flyout = require("../flyout");
|
|
|
27
27
|
|
|
28
28
|
var _react2 = require("@emotion/react");
|
|
29
29
|
|
|
30
|
-
var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "
|
|
30
|
+
var _excluded = ["id", "children", "className", "isDocked", "isOpen", "button", "showButtonIfDocked", "dockedBreakpoint", "as", "size", "side", "ownFocus", "outsideClickCloses", "closeButtonPosition", "paddingSize", "focusTrapProps"];
|
|
31
31
|
|
|
32
32
|
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); }
|
|
33
33
|
|
|
@@ -56,8 +56,6 @@ var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
|
|
|
56
56
|
size = _ref$size === void 0 ? 320 : _ref$size,
|
|
57
57
|
_ref$side = _ref.side,
|
|
58
58
|
side = _ref$side === void 0 ? 'left' : _ref$side,
|
|
59
|
-
_ref$role = _ref.role,
|
|
60
|
-
role = _ref$role === void 0 ? null : _ref$role,
|
|
61
59
|
_ref$ownFocus = _ref.ownFocus,
|
|
62
60
|
ownFocus = _ref$ownFocus === void 0 ? true : _ref$ownFocus,
|
|
63
61
|
_ref$outsideClickClos = _ref.outsideClickCloses,
|
|
@@ -106,7 +104,6 @@ var EuiCollapsibleNav = function EuiCollapsibleNav(_ref) {
|
|
|
106
104
|
as: as,
|
|
107
105
|
size: size,
|
|
108
106
|
side: side,
|
|
109
|
-
role: role,
|
|
110
107
|
ownFocus: ownFocus,
|
|
111
108
|
outsideClickCloses: outsideClickCloses,
|
|
112
109
|
closeButtonPosition: closeButtonPosition,
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.TYPES = exports.SIZES = exports.SIDES = exports.PADDING_SIZES = exports.EuiFlyout = void 0;
|
|
11
11
|
|
|
12
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
+
|
|
12
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
15
|
|
|
14
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -37,11 +39,13 @@ var _resize_observer = require("../observer/resize_observer");
|
|
|
37
39
|
|
|
38
40
|
var _portal = require("../portal");
|
|
39
41
|
|
|
42
|
+
var _accessibility = require("../accessibility");
|
|
43
|
+
|
|
40
44
|
var _flyout = require("./flyout.styles");
|
|
41
45
|
|
|
42
46
|
var _react2 = require("@emotion/react");
|
|
43
47
|
|
|
44
|
-
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "
|
|
48
|
+
var _excluded = ["className", "children", "as", "hideCloseButton", "closeButtonProps", "closeButtonPosition", "onClose", "ownFocus", "side", "size", "paddingSize", "maxWidth", "style", "maskProps", "type", "outsideClickCloses", "pushMinBreakpoint", "focusTrapProps", "includeFixedHeadersInFocusTrap"];
|
|
45
49
|
|
|
46
50
|
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); }
|
|
47
51
|
|
|
@@ -76,7 +80,6 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
76
80
|
_ref$hideCloseButton = _ref.hideCloseButton,
|
|
77
81
|
hideCloseButton = _ref$hideCloseButton === void 0 ? false : _ref$hideCloseButton,
|
|
78
82
|
closeButtonProps = _ref.closeButtonProps,
|
|
79
|
-
closeButtonAriaLabel = _ref.closeButtonAriaLabel,
|
|
80
83
|
_ref$closeButtonPosit = _ref.closeButtonPosition,
|
|
81
84
|
closeButtonPosition = _ref$closeButtonPosit === void 0 ? 'inside' : _ref$closeButtonPosit,
|
|
82
85
|
onClose = _ref.onClose,
|
|
@@ -95,12 +98,14 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
95
98
|
_ref$type = _ref.type,
|
|
96
99
|
type = _ref$type === void 0 ? 'overlay' : _ref$type,
|
|
97
100
|
outsideClickCloses = _ref.outsideClickCloses,
|
|
98
|
-
_ref$role = _ref.role,
|
|
99
|
-
role = _ref$role === void 0 ? 'dialog' : _ref$role,
|
|
100
101
|
_ref$pushMinBreakpoin = _ref.pushMinBreakpoint,
|
|
101
102
|
pushMinBreakpoint = _ref$pushMinBreakpoin === void 0 ? 'l' : _ref$pushMinBreakpoin,
|
|
102
|
-
focusTrapProps = _ref.focusTrapProps,
|
|
103
|
+
_ref$focusTrapProps = _ref.focusTrapProps,
|
|
104
|
+
_focusTrapProps = _ref$focusTrapProps === void 0 ? {} : _ref$focusTrapProps,
|
|
105
|
+
_ref$includeFixedHead = _ref.includeFixedHeadersInFocusTrap,
|
|
106
|
+
includeFixedHeadersInFocusTrap = _ref$includeFixedHead === void 0 ? true : _ref$includeFixedHead,
|
|
103
107
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
108
|
+
|
|
104
109
|
var Element = as || defaultElement;
|
|
105
110
|
var maskRef = (0, _react.useRef)(null);
|
|
106
111
|
var windowIsLargeEnoughToPush = (0, _services.useIsWithinMinBreakpoint)(pushMinBreakpoint);
|
|
@@ -191,7 +196,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
191
196
|
display: closeButtonPosition === 'outside' ? 'fill' : 'empty',
|
|
192
197
|
iconType: "cross",
|
|
193
198
|
color: "text",
|
|
194
|
-
"aria-label":
|
|
199
|
+
"aria-label": closeAriaLabel,
|
|
195
200
|
"data-test-subj": "euiFlyoutCloseButton"
|
|
196
201
|
}, closeButtonProps, {
|
|
197
202
|
className: closeButtonClasses,
|
|
@@ -204,24 +209,60 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
204
209
|
}));
|
|
205
210
|
});
|
|
206
211
|
}
|
|
212
|
+
/*
|
|
213
|
+
* If not disabled, automatically add fixed EuiHeaders as shards
|
|
214
|
+
* to EuiFlyout focus traps, to prevent focus fighting
|
|
215
|
+
*/
|
|
207
216
|
|
|
208
|
-
var hasOverlayMask = ownFocus && !isPushed;
|
|
209
217
|
|
|
210
|
-
var
|
|
211
|
-
// Do not close the flyout for any external click
|
|
212
|
-
if (outsideClickCloses === false) return undefined;
|
|
218
|
+
var flyoutToggle = (0, _react.useRef)(document.activeElement);
|
|
213
219
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
var _useState3 = (0, _react.useState)([]),
|
|
221
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
222
|
+
fixedHeaders = _useState4[0],
|
|
223
|
+
setFixedHeaders = _useState4[1];
|
|
224
|
+
|
|
225
|
+
(0, _react.useEffect)(function () {
|
|
226
|
+
if (includeFixedHeadersInFocusTrap) {
|
|
227
|
+
var fixedHeaderEls = document.querySelectorAll('.euiHeader[data-fixed-header]');
|
|
228
|
+
setFixedHeaders(Array.from(fixedHeaderEls)); // Flyouts that are toggled from fixed headers do not have working
|
|
229
|
+
// focus trap autoFocus, so we need to focus the flyout wrapper ourselves
|
|
230
|
+
|
|
231
|
+
fixedHeaderEls.forEach(function (header) {
|
|
232
|
+
if (header.contains(flyoutToggle.current)) {
|
|
233
|
+
resizeRef === null || resizeRef === void 0 ? void 0 : resizeRef.focus();
|
|
234
|
+
}
|
|
235
|
+
});
|
|
217
236
|
} else {
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
|
|
237
|
+
// Clear existing headers if necessary, e.g. switching to `false`
|
|
238
|
+
setFixedHeaders(function (headers) {
|
|
239
|
+
return headers.length ? [] : headers;
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}, [includeFixedHeadersInFocusTrap, resizeRef]);
|
|
221
243
|
|
|
244
|
+
var focusTrapProps = _objectSpread(_objectSpread({}, _focusTrapProps), {}, {
|
|
245
|
+
shards: [].concat((0, _toConsumableArray2.default)(fixedHeaders), (0, _toConsumableArray2.default)(_focusTrapProps.shards || []))
|
|
246
|
+
});
|
|
247
|
+
/*
|
|
248
|
+
* Provide meaningful screen reader instructions/details
|
|
249
|
+
*/
|
|
222
250
|
|
|
223
|
-
|
|
224
|
-
|
|
251
|
+
|
|
252
|
+
var hasOverlayMask = ownFocus && !isPushed;
|
|
253
|
+
var descriptionId = (0, _services.useGeneratedHtmlId)();
|
|
254
|
+
var screenReaderDescription = (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("p", {
|
|
255
|
+
id: descriptionId
|
|
256
|
+
}, hasOverlayMask ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
257
|
+
token: "euiFlyout.screenReaderModalDialog",
|
|
258
|
+
default: "You are in a modal dialog. Press Escape or tap/click outside the dialog on the shadowed overlay to close."
|
|
259
|
+
}) : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
260
|
+
token: "euiFlyout.screenReaderNonModalDialog",
|
|
261
|
+
default: "You are in a non-modal dialog. To close the dialog, press Escape."
|
|
262
|
+
}), ' ', fixedHeaders.length > 0 && (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
263
|
+
token: "euiFlyout.screenReaderFixedHeaders",
|
|
264
|
+
default: "You can still continue tabbing through the page headers in addition to the dialog."
|
|
265
|
+
})));
|
|
225
266
|
/*
|
|
226
267
|
* Trap focus even when `ownFocus={false}`, otherwise closing
|
|
227
268
|
* the flyout won't return focus to the originating button.
|
|
@@ -235,6 +276,21 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
235
276
|
* (both mousedown and mouseup) the overlay mask.
|
|
236
277
|
*/
|
|
237
278
|
|
|
279
|
+
var onClickOutside = function onClickOutside(event) {
|
|
280
|
+
// Do not close the flyout for any external click
|
|
281
|
+
if (outsideClickCloses === false) return undefined;
|
|
282
|
+
|
|
283
|
+
if (hasOverlayMask) {
|
|
284
|
+
// The overlay mask is present, so only clicks on the mask should close the flyout, regardless of outsideClickCloses
|
|
285
|
+
if (event.target === maskRef.current) return onClose(event);
|
|
286
|
+
} else {
|
|
287
|
+
// No overlay mask is present, so any outside clicks should close the flyout
|
|
288
|
+
if (outsideClickCloses === true) return onClose(event);
|
|
289
|
+
} // Otherwise if ownFocus is false and outsideClickCloses is undefined, outside clicks should not close the flyout
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
return undefined;
|
|
293
|
+
};
|
|
238
294
|
|
|
239
295
|
var flyout = (0, _react2.jsx)(_focus_trap.EuiFocusTrap, (0, _extends2.default)({
|
|
240
296
|
disabled: isPushed,
|
|
@@ -243,12 +299,14 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
243
299
|
}, focusTrapProps), (0, _react2.jsx)(Element, (0, _extends2.default)({
|
|
244
300
|
css: cssStyles
|
|
245
301
|
}, rest, {
|
|
246
|
-
role:
|
|
302
|
+
role: "dialog",
|
|
247
303
|
className: classes,
|
|
248
|
-
tabIndex:
|
|
304
|
+
tabIndex: 0,
|
|
305
|
+
"data-autofocus": true,
|
|
306
|
+
"aria-describedby": !isPushed ? descriptionId : undefined,
|
|
249
307
|
style: newStyle,
|
|
250
308
|
ref: setRef
|
|
251
|
-
}), closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
309
|
+
}), !isPushed && screenReaderDescription, closeButton, children)); // If ownFocus is set, wrap with an overlay and allow the user to click it to close it.
|
|
252
310
|
|
|
253
311
|
var mergedMaskProps = _objectSpread(_objectSpread({}, maskProps), {}, {
|
|
254
312
|
maskRef: (0, _services.useCombinedRefs)([maskProps === null || maskProps === void 0 ? void 0 : maskProps.maskRef, maskRef])
|
|
@@ -263,7 +321,7 @@ var EuiFlyout = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
263
321
|
flyout = (0, _react2.jsx)(_portal.EuiPortal, null, flyout);
|
|
264
322
|
}
|
|
265
323
|
|
|
266
|
-
return (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_services.EuiWindowEvent, {
|
|
324
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_services.EuiWindowEvent, {
|
|
267
325
|
event: "keydown",
|
|
268
326
|
handler: onKeyDown
|
|
269
327
|
}), flyout);
|
|
@@ -103,7 +103,7 @@ var EuiRangeTrack = function EuiRangeTrack(_ref) {
|
|
|
103
103
|
}, [showTicks, ticks, min, max, tickInterval, step]);
|
|
104
104
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
105
105
|
var styles = (0, _range_track.euiRangeTrackStyles)(euiTheme);
|
|
106
|
-
var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, (tickSequence || ticks) && styles.hasTicks];
|
|
106
|
+
var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, showTicks && (tickSequence || ticks) && styles.hasTicks];
|
|
107
107
|
|
|
108
108
|
var _useState = (0, _react.useState)(0),
|
|
109
109
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -101,7 +101,9 @@ var EuiHeader = function EuiHeader(_ref) {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
104
|
-
className: classes
|
|
104
|
+
className: classes,
|
|
105
|
+
"data-fixed-header": position === 'fixed' || undefined // Used by EuiFlyouts as a query selector
|
|
106
|
+
|
|
105
107
|
}, rest), contents);
|
|
106
108
|
};
|
|
107
109
|
|
|
@@ -36,18 +36,10 @@ var EuiIconAppAgent = function EuiIconAppAgent(_ref) {
|
|
|
36
36
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
37
37
|
id: titleId
|
|
38
38
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
39
|
-
|
|
40
|
-
d: "M21 2.82L16 .038 11 2.82v2.289l5-2.782 5 2.782v-2.29z"
|
|
41
|
-
}), (0, _react2.jsx)("path", {
|
|
42
|
-
className: "euiIcon__fillSecondary",
|
|
43
|
-
d: "M21 7.282L16 4.5l-5 2.782V9.57l5-2.781 5 2.781V7.282z"
|
|
44
|
-
}), (0, _react2.jsx)("path", {
|
|
45
|
-
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"
|
|
39
|
+
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"
|
|
46
40
|
}), (0, _react2.jsx)("path", {
|
|
47
41
|
className: "euiIcon__fillSecondary",
|
|
48
|
-
|
|
49
|
-
clipRule: "evenodd",
|
|
50
|
-
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"
|
|
42
|
+
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"
|
|
51
43
|
}));
|
|
52
44
|
};
|
|
53
45
|
|
|
@@ -36,10 +36,18 @@ var EuiIconAppFleet = function EuiIconAppFleet(_ref) {
|
|
|
36
36
|
}, props), title ? (0, _react2.jsx)("title", {
|
|
37
37
|
id: titleId
|
|
38
38
|
}, title) : null, (0, _react2.jsx)("path", {
|
|
39
|
-
|
|
39
|
+
className: "euiIcon__fillSecondary",
|
|
40
|
+
d: "M21 2.82L16 .038 11 2.82v2.289l5-2.782 5 2.782v-2.29z"
|
|
41
|
+
}), (0, _react2.jsx)("path", {
|
|
42
|
+
className: "euiIcon__fillSecondary",
|
|
43
|
+
d: "M21 7.282L16 4.5l-5 2.782V9.57l5-2.781 5 2.781V7.282z"
|
|
44
|
+
}), (0, _react2.jsx)("path", {
|
|
45
|
+
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"
|
|
40
46
|
}), (0, _react2.jsx)("path", {
|
|
41
47
|
className: "euiIcon__fillSecondary",
|
|
42
|
-
|
|
48
|
+
fillRule: "evenodd",
|
|
49
|
+
clipRule: "evenodd",
|
|
50
|
+
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"
|
|
43
51
|
}));
|
|
44
52
|
};
|
|
45
53
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
3
|
-
<path class="euiIcon__fillSecondary" d="
|
|
4
|
-
<path d="M7 5.04535L2 7.82695V23.4039L16 31.1923L30 23.4039V7.82695L25 5.04536V7.33402L28 9.00297V22.2278L16 28.9037L4 22.2279V9.00297L7 7.33401V5.04535Z" />
|
|
5
|
-
<path class="euiIcon__fillSecondary" fill-rule="evenodd" clip-rule="evenodd" d="M22 12.5L16 9L10 12.5V19.5L16 23L22 19.5V12.5ZM12.026 13.7053L16 11.3871L19.974 13.7053V18.2947L16 20.6129L12.026 18.2947V13.7053Z" />
|
|
2
|
+
<path d="M2.99581 18.6363L0 20.4337V26.5661L6 30.1661L11 27.1661L16 30.1661L21 27.1661L26 30.1661L32 26.5661V20.4337L27 17.4337V12.4337L22 9.43374V4.43374L16 0.83374L10 4.43374V7.26581L12 7.29946V5.56612L16 3.16612L20 5.56612V9.43374L18.0041 10.6313L19.0042 12.3636L21 11.1661L25 13.5661V17.4337L21 19.8337L18.7433 18.4797L17.772 20.2293L20 21.5661V25.4337L16 27.8337L12 25.4337V23.7342L10 23.7006V25.4337L6 27.8337L2 25.4337L2 21.5661L3.99595 20.3686L2.99581 18.6363ZM22 25.4337V21.5661L26 19.1661L30 21.5661V25.4337L26 27.8337L22 25.4337Z" />
|
|
3
|
+
<path class="euiIcon__fillSecondary" d="M11 22.1662L5 18.5662L5 12.4338L11 8.83382L17 12.4338L17 18.5662L11 22.1662ZM15 17.4338L15 13.5662L11 11.1662L7 13.5662L7 17.4338L11 19.8338L15 17.4338Z" />
|
|
6
4
|
</svg>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="
|
|
3
|
-
<path class="euiIcon__fillSecondary" d="
|
|
2
|
+
<path class="euiIcon__fillSecondary" d="M21 2.81994L16 0.0383301L11 2.81991V5.10857L16 2.32699L21 5.1086V2.81994Z" />
|
|
3
|
+
<path class="euiIcon__fillSecondary" d="M21 7.28161L16 4.5L11 7.28158V9.57024L16 6.78866L21 9.57027V7.28161Z" />
|
|
4
|
+
<path d="M7 5.04535L2 7.82695V23.4039L16 31.1923L30 23.4039V7.82695L25 5.04536V7.33402L28 9.00297V22.2278L16 28.9037L4 22.2279V9.00297L7 7.33401V5.04535Z" />
|
|
5
|
+
<path class="euiIcon__fillSecondary" fill-rule="evenodd" clip-rule="evenodd" d="M22 12.5L16 9L10 12.5V19.5L16 23L22 19.5V12.5ZM12.026 13.7053L16 11.3871L19.974 13.7053V18.2947L16 20.6129L12.026 18.2947V13.7053Z" />
|
|
4
6
|
</svg>
|
|
@@ -273,16 +273,16 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
273
273
|
if (!multiSelect && autoClose) {
|
|
274
274
|
this.closePopover();
|
|
275
275
|
|
|
276
|
-
var _query = checked ? this.props.query.removeSimpleFieldClauses(field)
|
|
276
|
+
var _query = checked ? this.props.query.removeSimpleFieldClauses(field).addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldClauses(field);
|
|
277
277
|
|
|
278
278
|
this.props.onChange(_query);
|
|
279
279
|
} else {
|
|
280
280
|
if (multiSelect === 'or') {
|
|
281
|
-
var _query2 = checked ? this.props.query.
|
|
281
|
+
var _query2 = checked ? this.props.query.addOrFieldValue(field, value, true, operator) : this.props.query.removeOrFieldValue(field, value);
|
|
282
282
|
|
|
283
283
|
this.props.onChange(_query2);
|
|
284
284
|
} else {
|
|
285
|
-
var _query3 = checked ? this.props.query.
|
|
285
|
+
var _query3 = checked ? this.props.query.addSimpleFieldValue(field, value, true, operator) : this.props.query.removeSimpleFieldValue(field, value);
|
|
286
286
|
|
|
287
287
|
this.props.onChange(_query3);
|
|
288
288
|
}
|
|
@@ -390,13 +390,9 @@ var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
|
|
|
390
390
|
listProps: {
|
|
391
391
|
isVirtualized: isOverSearchThreshold || false
|
|
392
392
|
},
|
|
393
|
-
onChange: function onChange(options) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
if (diff) {
|
|
399
|
-
_this5.onOptionClick(diff.data.optionField, diff.data.value, diff.checked);
|
|
393
|
+
onChange: function onChange(options, event, changedOption) {
|
|
394
|
+
if (changedOption.data) {
|
|
395
|
+
_this5.onOptionClick(changedOption.data.optionField, changedOption.data.value, changedOption.checked);
|
|
400
396
|
}
|
|
401
397
|
}
|
|
402
398
|
}, searchProps), function (list, search) {
|
|
@@ -116,6 +116,19 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ariaSetSize", 0);
|
|
120
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ariaPosInSetMap", {});
|
|
121
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "calculateAriaSetAttrs", function (optionArray) {
|
|
122
|
+
_this.ariaPosInSetMap = {};
|
|
123
|
+
var latestAriaPosIndex = 0;
|
|
124
|
+
optionArray.forEach(function (option, index) {
|
|
125
|
+
if (!option.isGroupLabel) {
|
|
126
|
+
latestAriaPosIndex++;
|
|
127
|
+
_this.ariaPosInSetMap[index] = latestAriaPosIndex;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
_this.ariaSetSize = latestAriaPosIndex;
|
|
131
|
+
});
|
|
119
132
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "ListRow", /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
120
133
|
var data = _ref.data,
|
|
121
134
|
index = _ref.index,
|
|
@@ -158,9 +171,6 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
158
171
|
}, optionRest), prepend, label, append);
|
|
159
172
|
}
|
|
160
173
|
|
|
161
|
-
var labelCount = data.filter(function (option) {
|
|
162
|
-
return option.isGroupLabel;
|
|
163
|
-
}).length;
|
|
164
174
|
var id = makeOptionId(index);
|
|
165
175
|
return (0, _react2.jsx)(_selectable_list_item.EuiSelectableListItem, (0, _extends2.default)({
|
|
166
176
|
key: id,
|
|
@@ -181,8 +191,8 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
181
191
|
disabled: disabled,
|
|
182
192
|
prepend: prepend,
|
|
183
193
|
append: append,
|
|
184
|
-
"aria-posinset": index
|
|
185
|
-
"aria-setsize":
|
|
194
|
+
"aria-posinset": _this.ariaPosInSetMap[index],
|
|
195
|
+
"aria-setsize": _this.ariaSetSize,
|
|
186
196
|
onFocusBadge: onFocusBadge,
|
|
187
197
|
allowExclusions: allowExclusions,
|
|
188
198
|
showIcons: showIcons,
|
|
@@ -333,6 +343,7 @@ var EuiSelectableList = /*#__PURE__*/function (_Component) {
|
|
|
333
343
|
textWrap = _this$props7.textWrap,
|
|
334
344
|
rest = (0, _objectWithoutProperties2.default)(_this$props7, _excluded3);
|
|
335
345
|
var optionArray = visibleOptions || options;
|
|
346
|
+
this.calculateAriaSetAttrs(optionArray);
|
|
336
347
|
var heightIsFull = forcedHeight === 'full';
|
|
337
348
|
var calculatedHeight = heightIsFull ? false : forcedHeight; // If calculatedHeight is still undefined, then calculate it
|
|
338
349
|
|
|
@@ -21,6 +21,10 @@ var _title = require("../title");
|
|
|
21
21
|
|
|
22
22
|
var _step_number = require("./step_number");
|
|
23
23
|
|
|
24
|
+
var _services = require("../../services");
|
|
25
|
+
|
|
26
|
+
var _step = require("./step.styles");
|
|
27
|
+
|
|
24
28
|
var _react2 = require("@emotion/react");
|
|
25
29
|
|
|
26
30
|
var _excluded = ["className", "children", "headingElement", "step", "title", "titleSize", "status"];
|
|
@@ -41,27 +45,32 @@ var EuiStep = function EuiStep(_ref) {
|
|
|
41
45
|
titleSize = _ref$titleSize === void 0 ? 's' : _ref$titleSize,
|
|
42
46
|
status = _ref.status,
|
|
43
47
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
44
|
-
var classes = (0, _classnames.default)('euiStep',
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
var classes = (0, _classnames.default)('euiStep', className);
|
|
49
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
50
|
+
var styles = (0, _step.euiStepStyles)(euiTheme);
|
|
51
|
+
var cssStyles = [styles.euiStep, styles[titleSize]];
|
|
52
|
+
var contentStyles = (0, _step.euiStepContentStyles)(euiTheme);
|
|
53
|
+
var cssContentStyles = [contentStyles.euiStep__content, contentStyles[titleSize]];
|
|
54
|
+
var titleStyles = (0, _step.euiStepTitleStyles)(euiTheme);
|
|
55
|
+
var cssStepTitleStyles = [titleStyles.euiStep__title, status === 'disabled' && titleStyles.isDisabled, titleStyles[titleSize]];
|
|
56
|
+
var cssTitleWrapperStyles = titleStyles.euiStep__titleWrapper;
|
|
51
57
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
52
|
-
className: classes
|
|
58
|
+
className: classes,
|
|
59
|
+
css: cssStyles
|
|
53
60
|
}, rest), (0, _react2.jsx)("div", {
|
|
54
|
-
className: "euiStep__titleWrapper"
|
|
61
|
+
className: "euiStep__titleWrapper",
|
|
62
|
+
css: cssTitleWrapperStyles
|
|
55
63
|
}, (0, _react2.jsx)(_step_number.EuiStepNumber, {
|
|
56
|
-
className: numberClasses,
|
|
57
64
|
number: step,
|
|
58
65
|
status: status,
|
|
59
66
|
titleSize: titleSize
|
|
60
67
|
}), (0, _react2.jsx)(_title.EuiTitle, {
|
|
61
68
|
size: titleSize,
|
|
62
|
-
className: "euiStep__title"
|
|
69
|
+
className: "euiStep__title",
|
|
70
|
+
css: cssStepTitleStyles
|
|
63
71
|
}, /*#__PURE__*/(0, _react.createElement)(headingElement, null, title))), (0, _react2.jsx)("div", {
|
|
64
|
-
className: "euiStep__content"
|
|
72
|
+
className: "euiStep__content",
|
|
73
|
+
css: cssContentStyles
|
|
65
74
|
}, children));
|
|
66
75
|
};
|
|
67
76
|
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiStepVariables = exports.euiStepTitleStyles = exports.euiStepStyles = exports.euiStepContentStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
14
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
15
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
16
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
17
|
+
* Side Public License, v 1.
|
|
18
|
+
*/
|
|
19
|
+
var euiStepVariables = function euiStepVariables(euiTheme) {
|
|
20
|
+
return {
|
|
21
|
+
numberSize: euiTheme.size.xl,
|
|
22
|
+
numberXSSize: euiTheme.size.l,
|
|
23
|
+
numberMargin: euiTheme.size.base
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.euiStepVariables = euiStepVariables;
|
|
28
|
+
|
|
29
|
+
var euiStepStyles = function euiStepStyles(euiThemeContext) {
|
|
30
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
31
|
+
var euiStep = euiStepVariables(euiTheme); // the vertical line is centered on the number, so we need to offset the line
|
|
32
|
+
// by half of the number size & half of the line size to center it
|
|
33
|
+
|
|
34
|
+
var lineStartPosition = (0, _global_styling.mathWithUnits)([euiStep.numberSize, euiTheme.border.width.thick], function (x, y) {
|
|
35
|
+
return x / 2 - y / 2;
|
|
36
|
+
});
|
|
37
|
+
var lineEndPosition = (0, _global_styling.mathWithUnits)([euiStep.numberSize, euiTheme.border.width.thick], function (x, y) {
|
|
38
|
+
return x / 2 + y / 2;
|
|
39
|
+
});
|
|
40
|
+
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%)");
|
|
41
|
+
return {
|
|
42
|
+
euiStep: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-image:", lineGradient, ";background-repeat:no-repeat;};label:euiStep;"),
|
|
43
|
+
// Sizes
|
|
44
|
+
m: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-position:left ", euiTheme.size.xl, ";};label:m;"),
|
|
45
|
+
s: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-position:left ", euiTheme.size.xl, ";};label:s;"),
|
|
46
|
+
xs: /*#__PURE__*/(0, _react.css)("&:not(:last-of-type){background-position:-", euiTheme.size.xs, " ", euiTheme.size.l, ";};label:xs;")
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.euiStepStyles = euiStepStyles;
|
|
51
|
+
|
|
52
|
+
var euiStepContentStyles = function euiStepContentStyles(euiThemeContext) {
|
|
53
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
54
|
+
var euiStep = euiStepVariables(euiTheme);
|
|
55
|
+
var styles = {
|
|
56
|
+
euiStep__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-top', euiTheme.size.s), " ", (0, _global_styling.logicalCSS)('padding-top', euiTheme.size.base), " ", (0, _global_styling.logicalCSS)('padding-bottom', (0, _global_styling.mathWithUnits)([euiTheme.size.xl, euiTheme.size.s], function (x, y) {
|
|
57
|
+
return x + y;
|
|
58
|
+
})), " ", (0, _global_styling.logicalCSS)('padding-right', euiTheme.size.base), ";;label:euiStep__content;"),
|
|
59
|
+
// Sizes
|
|
60
|
+
m: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', (0, _global_styling.mathWithUnits)([euiStep.numberSize, euiStep.numberMargin], function (x, y) {
|
|
61
|
+
return x / 2 + y;
|
|
62
|
+
})), (0, _global_styling.logicalCSS)('margin-left', (0, _global_styling.mathWithUnits)(euiStep.numberSize, function (x) {
|
|
63
|
+
return x / 2;
|
|
64
|
+
})), ";;label:m;"),
|
|
65
|
+
s: /*#__PURE__*/(0, _react.css)(";label:s;"),
|
|
66
|
+
// s is the same as m, so we'll programmatically duplicate it below
|
|
67
|
+
xs: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-left', (0, _global_styling.mathWithUnits)([euiStep.numberXSSize, euiStep.numberMargin], function (x, y) {
|
|
68
|
+
return x / 2 + y;
|
|
69
|
+
})), (0, _global_styling.logicalCSS)('margin-left', (0, _global_styling.mathWithUnits)(euiStep.numberXSSize, function (x) {
|
|
70
|
+
return x / 2;
|
|
71
|
+
})), ";;label:xs;")
|
|
72
|
+
};
|
|
73
|
+
styles.s = styles.m;
|
|
74
|
+
return styles;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
exports.euiStepContentStyles = euiStepContentStyles;
|
|
78
|
+
|
|
79
|
+
var euiStepTitleStyles = function euiStepTitleStyles(euiThemeContext) {
|
|
80
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
81
|
+
var euiStep = euiStepVariables(euiTheme);
|
|
82
|
+
return {
|
|
83
|
+
euiStep__titleWrapper: /*#__PURE__*/(0, _react.css)("display:flex;gap:", euiStep.numberMargin, ";;label:euiStep__titleWrapper;"),
|
|
84
|
+
euiStep__title: /*#__PURE__*/(0, _react.css)(";label:euiStep__title;"),
|
|
85
|
+
isDisabled: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.disabledText, ";;label:isDisabled;"),
|
|
86
|
+
// Sizes
|
|
87
|
+
m: /*#__PURE__*/(0, _react.css)(";label:m;"),
|
|
88
|
+
s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('padding-top', euiTheme.size.xs), ";;label:s;"),
|
|
89
|
+
xs: /*#__PURE__*/(0, _react.css)(";label:xs;")
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
exports.euiStepTitleStyles = euiStepTitleStyles;
|