@elastic/eui 75.0.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/form/range/range_track.js +1 -1
- package/es/components/icon/assets/app_agent.js +2 -10
- package/es/components/icon/assets/app_fleet.js +10 -2
- 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 +115 -4
- package/i18ntokens.json +26 -10
- 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/form/range/range_track.js +1 -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/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/form/range/range_track.js +1 -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/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/form/range/range_track.js +1 -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/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 +2 -2
- 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/form/range/range_track.js +1 -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/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
|
@@ -33,11 +33,12 @@ var euiCodeBlockLineStyles = function euiCodeBlockLineStyles(euiThemeContext) {
|
|
|
33
33
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
34
34
|
}),
|
|
35
35
|
lineText: {
|
|
36
|
-
euiCodeBlock__lineText: /*#__PURE__*/(0, _css.css)("flex-grow:1;display:inline-block;padding-inline-start:", euiTheme.size.
|
|
36
|
+
euiCodeBlock__lineText: /*#__PURE__*/(0, _css.css)("flex-grow:1;display:inline-block;padding-inline-start:", euiTheme.size.m, ";border-inline-start:", euiTheme.border.thin, ";user-select:text;;label:euiCodeBlock__lineText;"),
|
|
37
37
|
isHighlighted: /*#__PURE__*/(0, _css.css)("background:", (0, _global_styling.euiBackgroundColor)(euiThemeContext, 'primary'), ";border-inline-start:", euiTheme.border.width.thick, " solid ", euiTheme.colors.primary, ";;label:isHighlighted;")
|
|
38
38
|
},
|
|
39
39
|
lineNumber: {
|
|
40
|
-
|
|
40
|
+
euiCodeBlock__lineNumberWrapper: /*#__PURE__*/(0, _css.css)("position:relative;flex-grow:0;flex-shrink:0;user-select:none;padding-inline-end:", euiTheme.size.m, ";box-sizing:content-box;;label:euiCodeBlock__lineNumberWrapper;"),
|
|
41
|
+
euiCodeBlock__lineNumber: /*#__PURE__*/(0, _css.css)("color:", euiTheme.colors.subduedText, ";text-align:end;display:block;;label:euiCodeBlock__lineNumber;")
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
};
|
|
@@ -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
|
|
|
@@ -105,7 +105,7 @@ var EuiRangeTrack = function EuiRangeTrack(_ref) {
|
|
|
105
105
|
}, [showTicks, ticks, min, max, tickInterval, step]);
|
|
106
106
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
107
107
|
var styles = (0, _range_track.euiRangeTrackStyles)(euiTheme);
|
|
108
|
-
var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, (tickSequence || ticks) && styles.hasTicks];
|
|
108
|
+
var cssStyles = [styles.euiRangeTrack, disabled && styles.disabled, levels && !!levels.length && styles.hasLevels, showTicks && (tickSequence || ticks) && styles.hasTicks];
|
|
109
109
|
|
|
110
110
|
var _useState = (0, _react.useState)(0),
|
|
111
111
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -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
|
|
|
@@ -23,6 +23,10 @@ var _title = require("../title");
|
|
|
23
23
|
|
|
24
24
|
var _step_number = require("./step_number");
|
|
25
25
|
|
|
26
|
+
var _services = require("../../services");
|
|
27
|
+
|
|
28
|
+
var _step = require("./step.styles");
|
|
29
|
+
|
|
26
30
|
var _react2 = require("@emotion/react");
|
|
27
31
|
|
|
28
32
|
var _excluded = ["className", "children", "headingElement", "step", "title", "titleSize", "status"];
|
|
@@ -43,27 +47,32 @@ var EuiStep = function EuiStep(_ref) {
|
|
|
43
47
|
titleSize = _ref$titleSize === void 0 ? 's' : _ref$titleSize,
|
|
44
48
|
status = _ref.status,
|
|
45
49
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
|
-
var classes = (0, _classnames.default)('euiStep',
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
var classes = (0, _classnames.default)('euiStep', className);
|
|
51
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
52
|
+
var styles = (0, _step.euiStepStyles)(euiTheme);
|
|
53
|
+
var cssStyles = [styles.euiStep, styles[titleSize]];
|
|
54
|
+
var contentStyles = (0, _step.euiStepContentStyles)(euiTheme);
|
|
55
|
+
var cssContentStyles = [contentStyles.euiStep__content, contentStyles[titleSize]];
|
|
56
|
+
var titleStyles = (0, _step.euiStepTitleStyles)(euiTheme);
|
|
57
|
+
var cssStepTitleStyles = [titleStyles.euiStep__title, status === 'disabled' && titleStyles.isDisabled, titleStyles[titleSize]];
|
|
58
|
+
var cssTitleWrapperStyles = titleStyles.euiStep__titleWrapper;
|
|
53
59
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
54
|
-
className: classes
|
|
60
|
+
className: classes,
|
|
61
|
+
css: cssStyles
|
|
55
62
|
}, rest), (0, _react2.jsx)("div", {
|
|
56
|
-
className: "euiStep__titleWrapper"
|
|
63
|
+
className: "euiStep__titleWrapper",
|
|
64
|
+
css: cssTitleWrapperStyles
|
|
57
65
|
}, (0, _react2.jsx)(_step_number.EuiStepNumber, {
|
|
58
|
-
className: numberClasses,
|
|
59
66
|
number: step,
|
|
60
67
|
status: status,
|
|
61
68
|
titleSize: titleSize
|
|
62
69
|
}), (0, _react2.jsx)(_title.EuiTitle, {
|
|
63
70
|
size: titleSize,
|
|
64
|
-
className: "euiStep__title"
|
|
71
|
+
className: "euiStep__title",
|
|
72
|
+
css: cssStepTitleStyles
|
|
65
73
|
}, /*#__PURE__*/(0, _react.createElement)(headingElement, null, title))), (0, _react2.jsx)("div", {
|
|
66
|
-
className: "euiStep__content"
|
|
74
|
+
className: "euiStep__content",
|
|
75
|
+
css: cssContentStyles
|
|
67
76
|
}, children));
|
|
68
77
|
};
|
|
69
78
|
|
|
@@ -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;
|
|
@@ -21,6 +21,10 @@ var _step_number = require("./step_number");
|
|
|
21
21
|
|
|
22
22
|
var _step_strings = require("./step_strings");
|
|
23
23
|
|
|
24
|
+
var _services = require("../../services");
|
|
25
|
+
|
|
26
|
+
var _step_horizontal = require("./step_horizontal.styles");
|
|
27
|
+
|
|
24
28
|
var _react2 = require("@emotion/react");
|
|
25
29
|
|
|
26
30
|
var _excluded = ["className", "step", "title", "onClick", "disabled", "status"];
|
|
@@ -35,43 +39,50 @@ var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
35
39
|
_ref$status = _ref.status,
|
|
36
40
|
status = _ref$status === void 0 ? 'incomplete' : _ref$status,
|
|
37
41
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
|
-
var buttonTitle = (0, _step_strings.useI18nStep)({
|
|
39
|
-
number: step,
|
|
40
|
-
title: title
|
|
41
|
-
});
|
|
42
|
-
var completeTitle = (0, _step_strings.useI18nCompleteStep)({
|
|
43
|
-
number: step,
|
|
44
|
-
title: title
|
|
45
|
-
});
|
|
46
|
-
var disabledTitle = (0, _step_strings.useI18nDisabledStep)({
|
|
47
|
-
number: step,
|
|
48
|
-
title: title
|
|
49
|
-
});
|
|
50
|
-
var incompleteTitle = (0, _step_strings.useI18nIncompleteStep)({
|
|
51
|
-
number: step,
|
|
52
|
-
title: title
|
|
53
|
-
});
|
|
54
|
-
var warningTitle = (0, _step_strings.useI18nWarningStep)({
|
|
55
|
-
number: step,
|
|
56
|
-
title: title
|
|
57
|
-
});
|
|
58
|
-
var currentTitle = (0, _step_strings.useI18nCurrentStep)({
|
|
59
|
-
number: step,
|
|
60
|
-
title: title
|
|
61
|
-
});
|
|
62
42
|
if (disabled) status = 'disabled';
|
|
63
|
-
var classes = (0, _classnames.default)('euiStepHorizontal', className
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
43
|
+
var classes = (0, _classnames.default)('euiStepHorizontal', className);
|
|
44
|
+
var euiTheme = (0, _services.useEuiTheme)();
|
|
45
|
+
var styles = (0, _step_horizontal.euiStepHorizontalStyles)(euiTheme);
|
|
46
|
+
var cssStyles = [styles.euiStepHorizontal, status === 'disabled' ? styles.disabled : styles.enabled];
|
|
47
|
+
var numberStyles = (0, _step_horizontal.euiStepHorizontalNumberStyles)(euiTheme);
|
|
48
|
+
var cssNumberStyles = [numberStyles.euiStepHorizontal__number];
|
|
49
|
+
var titleStyles = (0, _step_horizontal.euiStepHorizontalTitleStyles)(euiTheme);
|
|
50
|
+
var cssTitleStyles = [titleStyles.euiStepHorizontal__title, status === 'disabled' && titleStyles.disabled];
|
|
51
|
+
var titleAttrsMap = {
|
|
52
|
+
step: (0, _step_strings.useI18nStep)({
|
|
53
|
+
number: step,
|
|
54
|
+
title: title
|
|
55
|
+
}),
|
|
56
|
+
current: (0, _step_strings.useI18nCurrentStep)({
|
|
57
|
+
number: step,
|
|
58
|
+
title: title
|
|
59
|
+
}),
|
|
60
|
+
disabled: (0, _step_strings.useI18nDisabledStep)({
|
|
61
|
+
number: step,
|
|
62
|
+
title: title
|
|
63
|
+
}),
|
|
64
|
+
incomplete: (0, _step_strings.useI18nIncompleteStep)({
|
|
65
|
+
number: step,
|
|
66
|
+
title: title
|
|
67
|
+
}),
|
|
68
|
+
complete: (0, _step_strings.useI18nCompleteStep)({
|
|
69
|
+
number: step,
|
|
70
|
+
title: title
|
|
71
|
+
}),
|
|
72
|
+
warning: (0, _step_strings.useI18nWarningStep)({
|
|
73
|
+
number: step,
|
|
74
|
+
title: title
|
|
75
|
+
}),
|
|
76
|
+
danger: (0, _step_strings.useI18nErrorsStep)({
|
|
77
|
+
number: step,
|
|
78
|
+
title: title
|
|
79
|
+
}),
|
|
80
|
+
loading: (0, _step_strings.useI18nLoadingStep)({
|
|
81
|
+
number: step,
|
|
82
|
+
title: title
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
var titleAttr = titleAttrsMap[status || 'step'];
|
|
75
86
|
|
|
76
87
|
var onStepClick = function onStepClick(event) {
|
|
77
88
|
if (!disabled) onClick(event);
|
|
@@ -79,15 +90,19 @@ var EuiStepHorizontal = function EuiStepHorizontal(_ref) {
|
|
|
79
90
|
|
|
80
91
|
return (0, _react2.jsx)("button", (0, _extends2.default)({
|
|
81
92
|
className: classes,
|
|
82
|
-
title:
|
|
93
|
+
title: titleAttr,
|
|
83
94
|
onClick: onStepClick,
|
|
84
|
-
disabled: disabled
|
|
95
|
+
disabled: disabled,
|
|
96
|
+
css: cssStyles,
|
|
97
|
+
"data-step-status": status
|
|
85
98
|
}, rest), (0, _react2.jsx)(_step_number.EuiStepNumber, {
|
|
86
99
|
className: "euiStepHorizontal__number",
|
|
87
100
|
status: status,
|
|
88
|
-
number: step
|
|
101
|
+
number: step,
|
|
102
|
+
css: cssNumberStyles
|
|
89
103
|
}), (0, _react2.jsx)("span", {
|
|
90
|
-
className: "euiStepHorizontal__title"
|
|
104
|
+
className: "euiStepHorizontal__title",
|
|
105
|
+
css: cssTitleStyles
|
|
91
106
|
}, title));
|
|
92
107
|
};
|
|
93
108
|
|
|
@@ -109,7 +124,7 @@ EuiStepHorizontal.propTypes = {
|
|
|
109
124
|
/**
|
|
110
125
|
* Visual representation of the step number indicator.
|
|
111
126
|
* May replace the number provided in props.step with alternate styling.
|
|
112
|
-
* The `
|
|
127
|
+
* The `disabled` prop will override this.
|
|
113
128
|
*/
|
|
114
129
|
status: _propTypes.default.any,
|
|
115
130
|
className: _propTypes.default.string,
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.euiStepHorizontalTitleStyles = exports.euiStepHorizontalStyles = exports.euiStepHorizontalNumberStyles = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling/");
|
|
11
|
+
|
|
12
|
+
var _title = require("../title/title.styles");
|
|
13
|
+
|
|
14
|
+
var _step = require("./step.styles");
|
|
15
|
+
|
|
16
|
+
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)."; }
|
|
17
|
+
|
|
18
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
19
|
+
name: "b86pnw-disabled",
|
|
20
|
+
styles: "cursor:not-allowed;label:disabled;"
|
|
21
|
+
} : {
|
|
22
|
+
name: "b86pnw-disabled",
|
|
23
|
+
styles: "cursor:not-allowed;label:disabled;",
|
|
24
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var euiStepHorizontalStyles = function euiStepHorizontalStyles(euiThemeContext) {
|
|
28
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
29
|
+
var euiStep = (0, _step.euiStepVariables)(euiTheme);
|
|
30
|
+
/**
|
|
31
|
+
* 1. Ensure the connecting lines stays behind the number
|
|
32
|
+
* 2. Make the content of each step align to the top, even if the steps are of varying heights,
|
|
33
|
+
* e.g. due to some of their titles wrapping to multiple lines
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
euiStepHorizontal: /*#__PURE__*/(0, _react.css)((0, _global_styling.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:", (0, _global_styling.mathWithUnits)([euiTheme.size.l, euiStep.numberSize], function (x, y) {
|
|
38
|
+
return x + y / 2;
|
|
39
|
+
}), ";z-index:", euiTheme.levels.content, ";}&::before{inset-inline-start:0;}&::after{inset-inline-end:0;};label:euiStepHorizontal;"),
|
|
40
|
+
// Note: these selectors must be nested because focus/hover state
|
|
41
|
+
// is on the parent container, but affects specific children
|
|
42
|
+
enabled: /*#__PURE__*/(0, _react.css)("&:focus,&:hover{.euiStepHorizontal__title{text-decoration:underline;}}&:focus{outline:none;.euiStepHorizontal__number{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}.euiStepHorizontal__number:not(:focus-visible){outline:", euiTheme.focus.width, " solid ", euiTheme.colors.darkestShade, ";}};label:enabled;"),
|
|
43
|
+
disabled: _ref
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.euiStepHorizontalStyles = euiStepHorizontalStyles;
|
|
48
|
+
|
|
49
|
+
var euiStepHorizontalNumberStyles = function euiStepHorizontalNumberStyles(euiThemeContext) {
|
|
50
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
51
|
+
return {
|
|
52
|
+
euiStepHorizontal__number: /*#__PURE__*/(0, _react.css)("position:relative;z-index:", Number(euiTheme.levels.content) + 1, ";", _global_styling.euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in-out;};label:euiStepHorizontal__number;")
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.euiStepHorizontalNumberStyles = euiStepHorizontalNumberStyles;
|
|
57
|
+
|
|
58
|
+
var euiStepHorizontalTitleStyles = function euiStepHorizontalTitleStyles(euiThemeContext) {
|
|
59
|
+
var euiTheme = euiThemeContext.euiTheme;
|
|
60
|
+
return {
|
|
61
|
+
euiStepHorizontal__title: /*#__PURE__*/(0, _react.css)((0, _title.euiTitle)(euiThemeContext, 'xs'), ";margin-block-start:", euiTheme.size.s, ";font-weight:", euiTheme.font.weight.bold, ";text-align:center;", (0, _global_styling.euiBreakpoint)(euiThemeContext, ['xs', 's']), "{display:none;};label:euiStepHorizontal__title;"),
|
|
62
|
+
disabled: /*#__PURE__*/(0, _react.css)("color:", euiTheme.colors.disabledText, ";;label:disabled;")
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.euiStepHorizontalTitleStyles = euiStepHorizontalTitleStyles;
|