@semcore/wizard 2.55.0-prerelease.1 → 2.55.0-prerelease.5
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/lib/cjs/Wizard.js +129 -109
- package/lib/cjs/Wizard.js.map +1 -1
- package/lib/cjs/Wizard.types.js +2 -0
- package/lib/cjs/Wizard.types.js.map +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/wizard.shadow.css +54 -46
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/translations/de.json +1 -1
- package/lib/cjs/translations/es.json +1 -1
- package/lib/cjs/translations/fr.json +1 -1
- package/lib/cjs/translations/it.json +1 -1
- package/lib/cjs/translations/ja.json +1 -1
- package/lib/cjs/translations/ko.json +1 -1
- package/lib/cjs/translations/nl.json +1 -1
- package/lib/cjs/translations/pl.json +1 -1
- package/lib/cjs/translations/pt.json +1 -1
- package/lib/cjs/translations/sv.json +1 -1
- package/lib/cjs/translations/tr.json +1 -1
- package/lib/cjs/translations/vi.json +1 -1
- package/lib/cjs/translations/zh.json +1 -1
- package/lib/es6/Wizard.js +121 -98
- package/lib/es6/Wizard.js.map +1 -1
- package/lib/es6/Wizard.types.js +2 -0
- package/lib/es6/Wizard.types.js.map +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/wizard.shadow.css +54 -46
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/translations/de.json +1 -1
- package/lib/es6/translations/es.json +1 -1
- package/lib/es6/translations/fr.json +1 -1
- package/lib/es6/translations/it.json +1 -1
- package/lib/es6/translations/ja.json +1 -1
- package/lib/es6/translations/ko.json +1 -1
- package/lib/es6/translations/nl.json +1 -1
- package/lib/es6/translations/pl.json +1 -1
- package/lib/es6/translations/pt.json +1 -1
- package/lib/es6/translations/sv.json +1 -1
- package/lib/es6/translations/tr.json +1 -1
- package/lib/es6/translations/vi.json +1 -1
- package/lib/es6/translations/zh.json +1 -1
- package/lib/esm/Wizard.mjs +125 -99
- package/lib/esm/style/wizard.shadow.css +54 -46
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/translations/de.json.mjs +1 -1
- package/lib/esm/translations/es.json.mjs +1 -1
- package/lib/esm/translations/fr.json.mjs +1 -1
- package/lib/esm/translations/it.json.mjs +1 -1
- package/lib/esm/translations/ja.json.mjs +1 -1
- package/lib/esm/translations/ko.json.mjs +1 -1
- package/lib/esm/translations/nl.json.mjs +1 -1
- package/lib/esm/translations/pl.json.mjs +1 -1
- package/lib/esm/translations/pt.json.mjs +1 -1
- package/lib/esm/translations/sv.json.mjs +1 -1
- package/lib/esm/translations/tr.json.mjs +1 -1
- package/lib/esm/translations/vi.json.mjs +1 -1
- package/lib/esm/translations/zh.json.mjs +1 -1
- package/lib/types/Wizard.d.ts +6 -0
- package/lib/types/Wizard.types.d.ts +124 -0
- package/lib/types/index.d.ts +3 -108
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +72 -0
- package/package.json +7 -7
- package/src/style/wizard.shadow.css +11 -1
- package/lib/cjs/index.d.js +0 -2
- package/lib/cjs/index.d.js.map +0 -1
- package/lib/es6/index.d.js +0 -2
- package/lib/es6/index.d.js.map +0 -1
package/lib/esm/Wizard.mjs
CHANGED
|
@@ -1,116 +1,145 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import
|
|
4
|
+
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import { sstyled } from "@semcore/
|
|
9
|
-
import
|
|
10
|
-
import React from "react";
|
|
11
|
-
import { ScreenReaderOnly, Box } from "@semcore/flex-box";
|
|
12
|
-
import Modal from "@semcore/modal";
|
|
13
|
-
import CheckM from "@semcore/icon/Check/m";
|
|
14
|
-
import keyboardFocusEnhance from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
|
|
15
|
-
import i18nEnhance from "@semcore/utils/lib/enhances/i18nEnhance";
|
|
16
|
-
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
17
|
-
import { setFocus } from "@semcore/utils/lib/use/useFocusLock";
|
|
18
|
-
import uniqueIDEnhancement from "@semcore/utils/lib/uniqueID";
|
|
7
|
+
import { sstyled, Component, assignProps, createComponent } from "@semcore/core";
|
|
8
|
+
import { Box, ScreenReaderOnly } from "@semcore/base-components";
|
|
19
9
|
import Button from "@semcore/button";
|
|
20
|
-
import
|
|
10
|
+
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
11
|
+
import findComponent from "@semcore/core/lib/utils/findComponent";
|
|
12
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
13
|
+
import { setFocus } from "@semcore/core/lib/utils/use/useFocusLock";
|
|
21
14
|
import ArrowLeft from "@semcore/icon/ArrowLeft/m";
|
|
15
|
+
import ArrowRight from "@semcore/icon/ArrowRight/m";
|
|
16
|
+
import CheckM from "@semcore/icon/Check/m";
|
|
17
|
+
import Modal from "@semcore/modal";
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
22
20
|
/*!__reshadow-styles__:"./style/wizard.shadow.css"*/
|
|
23
21
|
var style = (
|
|
24
22
|
/*__reshadow_css_start__*/
|
|
25
23
|
(sstyled.insert(
|
|
26
24
|
/*__inner_css_start__*/
|
|
27
|
-
".
|
|
25
|
+
".___SWizard_xpswz_gg_{max-width:980px;max-height:700px;display:flex;padding:0;background:0 0}.___SSidebar_xpswz_gg_{background:var(--intergalactic-control-primary-advertising, rgb(162, 97, 253));color:var(--intergalactic-text-primary-invert, rgba(254, 255, 255, 0.949));font-weight:var(--intergalactic-bold, 700);font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);padding:var(--intergalactic-spacing-10x, 40px) var(--intergalactic-spacing-2x, 8px);max-width:220px;flex-shrink:0;box-sizing:border-box;border-radius:var(--intergalactic-modal-rounded, calc(12px + 2px))0 0 var(--intergalactic-modal-rounded, calc(12px + 2px))}@media (max-width:1060px){.___SSidebar_xpswz_gg_{width:56px}}.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_{display:flex;gap:var(--intergalactic-spacing-1x, 4px);font-size:var(--intergalactic-fs-200, 14px);border-radius:var(--intergalactic-control-rounded, 6px);padding:var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-3x, 12px);cursor:pointer;position:relative;overflow:auto;line-height:var(--intergalactic-lh-200, 142%)}.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_:focus-visible{outline-color:var(--intergalactic-keyboard-focus-invert-outline, rgba(255, 255, 255, 0.7))}@media (hover:hover){.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_:hover{background:var(--intergalactic-control-primary-advertising-hover, rgb(150, 76, 251));z-index:2}}.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_.__active_xpswz_gg_{background:var(--intergalactic-control-primary-advertising-active, rgb(144, 65, 250))}.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_.__disabled_xpswz_gg_,.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_:disabled{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none}@media (max-width:1060px){.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_{padding:var(--intergalactic-spacing-2x, 8px)}@media (hover:hover){.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_:hover{width:-moz-max-content;width:max-content;max-width:220px}.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_:hover .___SStepDescription_xpswz_gg_{display:block;border-radius:var(--intergalactic-control-rounded, 6px);overflow:auto}.___SSidebar_xpswz_gg_ .___SStepper_xpswz_gg_.__active_xpswz_gg_:hover .___SStepDescription_xpswz_gg_{background:var(--intergalactic-control-primary-advertising-active, rgb(144, 65, 250))}}}.___SSidebarHeader_xpswz_gg_{font-size:var(--intergalactic-fs-300, 16px);margin:0 var(--intergalactic-spacing-5x, 20px) var(--intergalactic-spacing-4x, 16px)}@media (max-width:1060px){.___SSidebarHeader_xpswz_gg_{display:none}}.___SStepNumber_xpswz_gg_{display:inline-block;min-width:20px;text-align:center}.___SCompleted_xpswz_gg_{margin-top:1px}.___SStepDescription_xpswz_gg_{word-wrap:anywhere}@media (max-width:1060px){.___SStepDescription_xpswz_gg_{display:none}}.___SContent_xpswz_gg_{padding:var(--intergalactic-spacing-10x, 40px);width:100%;border-radius:0 var(--intergalactic-modal-rounded, calc(12px + 2px)) var(--intergalactic-modal-rounded, calc(12px + 2px))0;background:var(--intergalactic-bg-primary-neutral, rgb(255, 255, 255))}.___SContent_xpswz_gg_.__noSidebar_xpswz_gg_{border-radius:var(--intergalactic-modal-rounded, calc(12px + 2px))}.___SSidebarMenu_xpswz_gg_{display:contents}",
|
|
28
26
|
/*__inner_css_end__*/
|
|
29
|
-
"
|
|
27
|
+
"xpswz_gg_"
|
|
30
28
|
), /*__reshadow_css_end__*/
|
|
31
29
|
{
|
|
32
|
-
"__SWizard": "
|
|
33
|
-
"__SStepNumber": "
|
|
34
|
-
"__SCompleted": "
|
|
35
|
-
"__SContent": "
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"__SStepper": "
|
|
40
|
-
"_active": "
|
|
41
|
-
"_disabled": "
|
|
42
|
-
"__SStepDescription": "
|
|
30
|
+
"__SWizard": "___SWizard_xpswz_gg_",
|
|
31
|
+
"__SStepNumber": "___SStepNumber_xpswz_gg_",
|
|
32
|
+
"__SCompleted": "___SCompleted_xpswz_gg_",
|
|
33
|
+
"__SContent": "___SContent_xpswz_gg_",
|
|
34
|
+
"_noSidebar": "__noSidebar_xpswz_gg_",
|
|
35
|
+
"__SSidebarMenu": "___SSidebarMenu_xpswz_gg_",
|
|
36
|
+
"__SSidebar": "___SSidebar_xpswz_gg_",
|
|
37
|
+
"__SStepper": "___SStepper_xpswz_gg_",
|
|
38
|
+
"_active": "__active_xpswz_gg_",
|
|
39
|
+
"_disabled": "__disabled_xpswz_gg_",
|
|
40
|
+
"__SStepDescription": "___SStepDescription_xpswz_gg_",
|
|
41
|
+
"__SSidebarHeader": "___SSidebarHeader_xpswz_gg_"
|
|
43
42
|
})
|
|
44
43
|
);
|
|
45
|
-
var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
46
|
-
_inherits(WizardRoot2, _Component);
|
|
47
|
-
var _super = _createSuper(WizardRoot2);
|
|
44
|
+
var WizardRoot = /* @__PURE__ */ (function(_Component) {
|
|
48
45
|
function WizardRoot2() {
|
|
49
46
|
var _this;
|
|
50
47
|
_classCallCheck(this, WizardRoot2);
|
|
51
48
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
52
49
|
args[_key] = arguments[_key];
|
|
53
50
|
}
|
|
54
|
-
_this =
|
|
55
|
-
_defineProperty(
|
|
56
|
-
_defineProperty(
|
|
57
|
-
_defineProperty(
|
|
58
|
-
_defineProperty(
|
|
59
|
-
|
|
51
|
+
_this = _callSuper(this, WizardRoot2, [].concat(args));
|
|
52
|
+
_defineProperty(_this, "_steps", /* @__PURE__ */ new Map());
|
|
53
|
+
_defineProperty(_this, "modalRef", /* @__PURE__ */ React.createRef());
|
|
54
|
+
_defineProperty(_this, "contentRef", /* @__PURE__ */ React.createRef());
|
|
55
|
+
_defineProperty(_this, "stepperRefs", []);
|
|
56
|
+
_defineProperty(_this, "state", {
|
|
57
|
+
highlighted: _this.props.step
|
|
60
58
|
});
|
|
61
|
-
_defineProperty(
|
|
62
|
-
_defineProperty(_assertThisInitialized(_this), "stepperFocusPrev", function(i) {
|
|
59
|
+
_defineProperty(_this, "stepperFocusPrev", function(i) {
|
|
63
60
|
return function() {
|
|
64
61
|
var prevStep = _this._steps.get(i);
|
|
65
62
|
if (!prevStep) return;
|
|
63
|
+
if (prevStep.disabled) {
|
|
64
|
+
_this.stepperFocusPrev(i - 1)();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
66
67
|
_this.setState({
|
|
67
68
|
highlighted: prevStep === null || prevStep === void 0 ? void 0 : prevStep.step
|
|
68
69
|
});
|
|
69
70
|
setTimeout(function() {
|
|
70
71
|
var _this$stepperRefs;
|
|
71
|
-
(_this$stepperRefs = _this.stepperRefs[i - 1]) === null || _this$stepperRefs === void 0
|
|
72
|
+
(_this$stepperRefs = _this.stepperRefs[i - 1]) === null || _this$stepperRefs === void 0 || _this$stepperRefs.focus();
|
|
72
73
|
}, 0);
|
|
73
74
|
};
|
|
74
75
|
});
|
|
75
|
-
_defineProperty(
|
|
76
|
+
_defineProperty(_this, "stepperFocusNext", function(i) {
|
|
76
77
|
return function() {
|
|
77
78
|
var nextStep = _this._steps.get(i + 2);
|
|
78
79
|
if (!nextStep) return;
|
|
80
|
+
if (nextStep.disabled) {
|
|
81
|
+
_this.stepperFocusNext(i + 1)();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
79
84
|
_this.setState({
|
|
80
85
|
highlighted: nextStep === null || nextStep === void 0 ? void 0 : nextStep.step
|
|
81
86
|
});
|
|
82
87
|
setTimeout(function() {
|
|
83
88
|
var _this$stepperRefs2;
|
|
84
|
-
(_this$stepperRefs2 = _this.stepperRefs[i + 1]) === null || _this$stepperRefs2 === void 0
|
|
89
|
+
(_this$stepperRefs2 = _this.stepperRefs[i + 1]) === null || _this$stepperRefs2 === void 0 || _this$stepperRefs2.focus();
|
|
85
90
|
}, 0);
|
|
86
91
|
};
|
|
87
92
|
});
|
|
88
93
|
return _this;
|
|
89
94
|
}
|
|
90
|
-
|
|
95
|
+
_inherits(WizardRoot2, _Component);
|
|
96
|
+
return _createClass(WizardRoot2, [{
|
|
97
|
+
key: "getStepId",
|
|
98
|
+
value: function getStepId(step) {
|
|
99
|
+
return "".concat(this.asProps.uid, "-step-").concat(step);
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "getId",
|
|
103
|
+
value: function getId() {
|
|
104
|
+
return "".concat(this.asProps.uid, "-title");
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "getStepperId",
|
|
108
|
+
value: function getStepperId(step) {
|
|
109
|
+
var uid = this.asProps.uid;
|
|
110
|
+
return "".concat(uid, "-stepper-").concat(step);
|
|
111
|
+
}
|
|
112
|
+
}, {
|
|
113
|
+
key: "getContentId",
|
|
114
|
+
value: function getContentId(step) {
|
|
115
|
+
var uid = this.asProps.uid;
|
|
116
|
+
return "".concat(uid, "-content-").concat(step);
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
91
119
|
key: "getStepProps",
|
|
92
120
|
value: function getStepProps(props) {
|
|
93
121
|
return {
|
|
94
122
|
steps: this._steps,
|
|
95
123
|
active: props.step === this.asProps.step,
|
|
96
|
-
id:
|
|
124
|
+
id: this.getStepId(props.step)
|
|
97
125
|
};
|
|
98
126
|
}
|
|
99
127
|
}, {
|
|
100
128
|
key: "getSidebarProps",
|
|
101
129
|
value: function getSidebarProps() {
|
|
102
130
|
return {
|
|
103
|
-
|
|
131
|
+
id: this.getId()
|
|
104
132
|
};
|
|
105
133
|
}
|
|
106
134
|
}, {
|
|
107
135
|
key: "getContentProps",
|
|
108
136
|
value: function getContentProps() {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ref: this.contentRef
|
|
113
|
-
|
|
137
|
+
var _this$asProps = this.asProps, Children = _this$asProps.Children, step = _this$asProps.step;
|
|
138
|
+
var Sidebar2 = findComponent(Children, ["Wizard.Sidebar"], true);
|
|
139
|
+
return _defineProperty(_defineProperty({
|
|
140
|
+
ref: this.contentRef,
|
|
141
|
+
noSidebar: !Sidebar2
|
|
142
|
+
}, "aria-labelledby", this.getStepperId(step)), "id", this.getContentId(step));
|
|
114
143
|
}
|
|
115
144
|
}, {
|
|
116
145
|
key: "getStepBackProps",
|
|
@@ -142,18 +171,22 @@ var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
|
142
171
|
}, props));
|
|
143
172
|
}
|
|
144
173
|
var active = props.step === this.asProps.step;
|
|
145
|
-
var highlighted = this.state.highlighted === props.step
|
|
174
|
+
var highlighted = this.state.highlighted === props.step;
|
|
146
175
|
return {
|
|
147
176
|
active,
|
|
148
|
-
tabIndex: highlighted ? 0 : -1,
|
|
177
|
+
"tabIndex": highlighted ? 0 : -1,
|
|
149
178
|
number,
|
|
150
|
-
getI18nText: this.asProps.getI18nText,
|
|
151
|
-
uid: this.asProps.uid,
|
|
152
|
-
ref: function ref(node) {
|
|
179
|
+
"getI18nText": this.asProps.getI18nText,
|
|
180
|
+
"uid": this.asProps.uid,
|
|
181
|
+
"ref": function ref(node) {
|
|
153
182
|
_this2.stepperRefs[i] = node;
|
|
154
183
|
},
|
|
155
|
-
focusNext: this.stepperFocusNext(i),
|
|
156
|
-
focusPrev: this.stepperFocusPrev(i)
|
|
184
|
+
"focusNext": this.stepperFocusNext(i),
|
|
185
|
+
"focusPrev": this.stepperFocusPrev(i),
|
|
186
|
+
"id": this.getStepperId(props.step),
|
|
187
|
+
"aria-controls": active ? this.getContentId(props.step) : void 0,
|
|
188
|
+
"aria-disabled": props.disabled,
|
|
189
|
+
"aria-selected": active
|
|
157
190
|
};
|
|
158
191
|
}
|
|
159
192
|
}, {
|
|
@@ -162,11 +195,13 @@ var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
|
162
195
|
var _this3 = this;
|
|
163
196
|
if (prevProps.step === this.asProps.step) return;
|
|
164
197
|
this.setState({
|
|
165
|
-
highlighted: this.asProps.step
|
|
198
|
+
highlighted: this.asProps.step
|
|
166
199
|
});
|
|
167
200
|
setTimeout(function() {
|
|
168
201
|
if (prevProps.step === _this3.asProps.step) return;
|
|
169
|
-
|
|
202
|
+
if (_this3.contentRef.current) {
|
|
203
|
+
setFocus(_this3.contentRef.current);
|
|
204
|
+
}
|
|
170
205
|
}, 1);
|
|
171
206
|
}
|
|
172
207
|
}, {
|
|
@@ -174,18 +209,17 @@ var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
|
174
209
|
value: function render() {
|
|
175
210
|
var _ref7;
|
|
176
211
|
var SWizard = this.Root;
|
|
177
|
-
var _this$
|
|
212
|
+
var _this$asProps2 = this.asProps, Children = _this$asProps2.Children, styles = _this$asProps2.styles;
|
|
178
213
|
this._steps.clear();
|
|
179
|
-
return _ref7 = sstyled
|
|
214
|
+
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SWizard, _ref7.cn("SWizard", {
|
|
180
215
|
"render": Modal,
|
|
181
216
|
"aria-label": void 0,
|
|
182
217
|
"ref": this.modalRef,
|
|
183
|
-
"aria-labelledby":
|
|
218
|
+
"aria-labelledby": this.getId()
|
|
184
219
|
}), /* @__PURE__ */ React.createElement(Children, _ref7.cn("Children", {})));
|
|
185
220
|
}
|
|
186
221
|
}]);
|
|
187
|
-
|
|
188
|
-
}(Component);
|
|
222
|
+
})(Component);
|
|
189
223
|
_defineProperty(WizardRoot, "displayName", "Wizard");
|
|
190
224
|
_defineProperty(WizardRoot, "style", style);
|
|
191
225
|
_defineProperty(WizardRoot, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
|
|
@@ -196,16 +230,14 @@ _defineProperty(WizardRoot, "defaultProps", {
|
|
|
196
230
|
});
|
|
197
231
|
function Sidebar(props) {
|
|
198
232
|
var _ref = arguments[0], _ref8;
|
|
199
|
-
var Children = props.Children, styles = props.styles, title = props.title,
|
|
233
|
+
var Children = props.Children, styles = props.styles, title = props.title, id = props.id;
|
|
200
234
|
var SSidebar = Box;
|
|
201
235
|
var SSidebarHeader = "h2";
|
|
202
236
|
var SSidebarMenu = "div";
|
|
203
|
-
React.
|
|
204
|
-
|
|
205
|
-
return _ref8 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SSidebar, _ref8.cn("SSidebar", _objectSpread({}, assignProps({
|
|
206
|
-
"__excludeProps": ["title"]
|
|
237
|
+
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SSidebar, _ref8.cn("SSidebar", _objectSpread({}, assignProps({
|
|
238
|
+
"__excludeProps": ["title", "id"]
|
|
207
239
|
}, _ref))), title && /* @__PURE__ */ React.createElement(SSidebarHeader, _ref8.cn("SSidebarHeader", {
|
|
208
|
-
"id":
|
|
240
|
+
"id": id
|
|
209
241
|
}), title), /* @__PURE__ */ React.createElement(SSidebarMenu, _ref8.cn("SSidebarMenu", {
|
|
210
242
|
"role": "tablist",
|
|
211
243
|
"aria-orientation": "vertical"
|
|
@@ -217,13 +249,13 @@ function Step(props) {
|
|
|
217
249
|
var Children = props.Children, styles = props.styles, active = props.active;
|
|
218
250
|
if (active) {
|
|
219
251
|
var _ref9;
|
|
220
|
-
return _ref9 = sstyled
|
|
252
|
+
return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SStep, _ref9.cn("SStep", _objectSpread({}, assignProps({}, _ref2))), /* @__PURE__ */ React.createElement(Children, _ref9.cn("Children", {})));
|
|
221
253
|
}
|
|
222
254
|
return null;
|
|
223
255
|
}
|
|
224
256
|
function Stepper(props) {
|
|
225
|
-
var _ref3 = arguments[0],
|
|
226
|
-
var Children = props.Children, styles = props.styles, step = props.step,
|
|
257
|
+
var _ref3 = arguments[0], _ref0;
|
|
258
|
+
var Children = props.Children, styles = props.styles, step = props.step, onActive = props.onActive, completed = props.completed, number = props.number, getI18nText = props.getI18nText, focusNext = props.focusNext, focusPrev = props.focusPrev, disabled = props.disabled;
|
|
227
259
|
var SStepper = Box;
|
|
228
260
|
var SStepNumber = "span";
|
|
229
261
|
var SStepDescription = "span";
|
|
@@ -245,62 +277,56 @@ function Stepper(props) {
|
|
|
245
277
|
e.stopPropagation();
|
|
246
278
|
}
|
|
247
279
|
}, [step, onActive, focusPrev, focusNext]);
|
|
248
|
-
return
|
|
280
|
+
return _ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(SStepper, _ref0.cn("SStepper", _objectSpread({}, assignProps({
|
|
249
281
|
"role": "tab",
|
|
250
|
-
"
|
|
251
|
-
"aria-controls": active ? "".concat(uid, "-content-").concat(step) : void 0,
|
|
252
|
-
"aria-disabled": disabled,
|
|
253
|
-
"aria-selected": active,
|
|
282
|
+
"tabIndex": disabled ? void 0 : 0,
|
|
254
283
|
"onClick": handlerClick,
|
|
255
284
|
"onKeyDown": handlerKeyDown
|
|
256
|
-
}, _ref3))), completed && /* @__PURE__ */ React.createElement(ScreenReaderOnly,
|
|
285
|
+
}, _ref3))), completed && /* @__PURE__ */ React.createElement(ScreenReaderOnly, _ref0.cn("ScreenReaderOnly", {}), getI18nText("completedStep")), /* @__PURE__ */ React.createElement(SStepNumber, _ref0.cn("SStepNumber", {
|
|
257
286
|
"aria-hidden": "true"
|
|
258
|
-
}), completed ? /* @__PURE__ */ React.createElement(SCompleted,
|
|
287
|
+
}), completed ? /* @__PURE__ */ React.createElement(SCompleted, _ref0.cn("SCompleted", {})) : number), /* @__PURE__ */ React.createElement(SStepDescription, _ref0.cn("SStepDescription", {}), /* @__PURE__ */ React.createElement(Children, _ref0.cn("Children", {}))));
|
|
259
288
|
}
|
|
260
|
-
Stepper.enhance = [keyboardFocusEnhance()];
|
|
261
289
|
function Content(props) {
|
|
262
|
-
var _ref4 = arguments[0],
|
|
263
|
-
var Children = props.Children,
|
|
290
|
+
var _ref4 = arguments[0], _ref1;
|
|
291
|
+
var Children = props.Children, styles = props.styles;
|
|
264
292
|
var SContent = Box;
|
|
265
|
-
return
|
|
266
|
-
"role": "tabpanel"
|
|
267
|
-
|
|
268
|
-
"id": "".concat(uid, "-content-").concat(step)
|
|
269
|
-
}, _ref4))), hasChildren ? /* @__PURE__ */ React.createElement(Children, _ref11.cn("Children", {})) : stepName);
|
|
293
|
+
return _ref1 = sstyled(styles), /* @__PURE__ */ React.createElement(SContent, _ref1.cn("SContent", _objectSpread({}, assignProps({
|
|
294
|
+
"role": "tabpanel"
|
|
295
|
+
}, _ref4))), /* @__PURE__ */ React.createElement(Children, _ref1.cn("Children", {})));
|
|
270
296
|
}
|
|
271
297
|
function StepBack(props) {
|
|
272
|
-
var _ref5 = arguments[0],
|
|
298
|
+
var _ref5 = arguments[0], _ref10;
|
|
273
299
|
var SStepBack = Button;
|
|
274
|
-
var Children = props.Children, hasChildren = props.children, styles = props.styles, getI18nText = props.getI18nText,
|
|
300
|
+
var Children = props.Children, hasChildren = props.children, styles = props.styles, getI18nText = props.getI18nText, stepName = props.stepName;
|
|
275
301
|
var handleClick = React.useCallback(function() {
|
|
276
302
|
var _props$onActive;
|
|
277
|
-
(_props$onActive = props.onActive) === null || _props$onActive === void 0
|
|
303
|
+
(_props$onActive = props.onActive) === null || _props$onActive === void 0 || _props$onActive.call(props, props.step - 1);
|
|
278
304
|
}, [props.step]);
|
|
279
|
-
return
|
|
305
|
+
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SStepBack, _ref10.cn("SStepBack", _objectSpread({}, assignProps({
|
|
280
306
|
"use": "tertiary",
|
|
281
307
|
"size": "l",
|
|
282
308
|
"onClick": handleClick,
|
|
283
309
|
"aria-label": getI18nText("backButton", {
|
|
284
|
-
buttonName:
|
|
310
|
+
buttonName: stepName
|
|
285
311
|
})
|
|
286
|
-
}, _ref5))), /* @__PURE__ */ React.createElement(Button.Addon, null, /* @__PURE__ */ React.createElement(ArrowLeft,
|
|
312
|
+
}, _ref5))), /* @__PURE__ */ React.createElement(Button.Addon, null, /* @__PURE__ */ React.createElement(ArrowLeft, _ref10.cn("ArrowLeft", {}))), /* @__PURE__ */ React.createElement(Button.Text, null, hasChildren ? /* @__PURE__ */ React.createElement(Children, _ref10.cn("Children", {})) : stepName));
|
|
287
313
|
}
|
|
288
314
|
function StepNext(props) {
|
|
289
|
-
var _ref6 = arguments[0],
|
|
315
|
+
var _ref6 = arguments[0], _ref11;
|
|
290
316
|
var SStepNext = Button;
|
|
291
|
-
var Children = props.Children, hasChildren = props.children, styles = props.styles, getI18nText = props.getI18nText,
|
|
317
|
+
var Children = props.Children, hasChildren = props.children, styles = props.styles, getI18nText = props.getI18nText, stepName = props.stepName;
|
|
292
318
|
var handleClick = React.useCallback(function() {
|
|
293
319
|
var _props$onActive2;
|
|
294
|
-
(_props$onActive2 = props.onActive) === null || _props$onActive2 === void 0
|
|
320
|
+
(_props$onActive2 = props.onActive) === null || _props$onActive2 === void 0 || _props$onActive2.call(props, props.step + 1);
|
|
295
321
|
}, [props.step]);
|
|
296
|
-
return
|
|
322
|
+
return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(SStepNext, _ref11.cn("SStepNext", _objectSpread({}, assignProps({
|
|
297
323
|
"use": "tertiary",
|
|
298
324
|
"size": "l",
|
|
299
325
|
"onClick": handleClick,
|
|
300
326
|
"aria-label": getI18nText("nextButton", {
|
|
301
|
-
buttonName:
|
|
327
|
+
buttonName: stepName
|
|
302
328
|
})
|
|
303
|
-
}, _ref6))), /* @__PURE__ */ React.createElement(Button.Text, null, hasChildren ? /* @__PURE__ */ React.createElement(Children,
|
|
329
|
+
}, _ref6))), /* @__PURE__ */ React.createElement(Button.Text, null, hasChildren ? /* @__PURE__ */ React.createElement(Children, _ref11.cn("Children", {})) : stepName), /* @__PURE__ */ React.createElement(Button.Addon, null, /* @__PURE__ */ React.createElement(ArrowRight, _ref11.cn("ArrowRight", {}))));
|
|
304
330
|
}
|
|
305
331
|
var Wizard = createComponent(WizardRoot, {
|
|
306
332
|
Sidebar,
|
|
@@ -12,71 +12,75 @@ SSidebar {
|
|
|
12
12
|
font-weight: var(--intergalactic-bold, 700);
|
|
13
13
|
font-size: var(--intergalactic-fs-300, 16px);
|
|
14
14
|
line-height: var(--intergalactic-lh-300, 150%);
|
|
15
|
-
padding: var(--intergalactic-spacing-10x, 40px) var(--intergalactic-spacing-2x, 8px)
|
|
16
|
-
calc(var(--intergalactic-spacing-8x, 32px) + var(--intergalactic-spacing-05x, 2px));
|
|
15
|
+
padding: var(--intergalactic-spacing-10x, 40px) var(--intergalactic-spacing-2x, 8px);
|
|
17
16
|
max-width: 220px;
|
|
18
17
|
flex-shrink: 0;
|
|
19
18
|
box-sizing: border-box;
|
|
20
19
|
border-radius: var(--intergalactic-modal-rounded, calc(12px + 2px)) 0 0
|
|
21
20
|
var(--intergalactic-modal-rounded, calc(12px + 2px));
|
|
22
21
|
@media (max-width: 1060px) {
|
|
23
|
-
width:
|
|
22
|
+
width: 56px;
|
|
24
23
|
}
|
|
25
|
-
}
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
SStepper {
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: var(--intergalactic-spacing-1x, 4px);
|
|
28
|
+
font-size: var(--intergalactic-fs-200, 14px);
|
|
29
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
30
|
+
padding: var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-3x, 12px);
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
position: relative;
|
|
33
|
+
overflow: auto;
|
|
34
|
+
line-height: var(--intergalactic-lh-200, 142%);
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
39
|
-
padding: var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-3x, 12px);
|
|
40
|
-
cursor: pointer;
|
|
41
|
-
position: relative;
|
|
42
|
-
overflow: auto;
|
|
43
|
-
line-height: var(--intergalactic-lh-200, 142%);
|
|
44
|
-
|
|
45
|
-
&:hover {
|
|
46
|
-
background: var(--intergalactic-control-primary-advertising-hover, oklch(0.6 0.244 297.8));
|
|
47
|
-
z-index: 1;
|
|
48
|
-
}
|
|
49
|
-
&[active] {
|
|
50
|
-
background: var(--intergalactic-control-primary-advertising-active, oklch(0.58 0.254 297.1));
|
|
51
|
-
}
|
|
52
|
-
&:disabled,
|
|
53
|
-
&[disabled] {
|
|
54
|
-
opacity: var(--intergalactic-disabled-opacity, 0.4);
|
|
55
|
-
cursor: default;
|
|
56
|
-
pointer-events: none; /* Disable interactions */
|
|
57
|
-
}
|
|
36
|
+
&:focus-visible {
|
|
37
|
+
outline-color: var(--intergalactic-keyboard-focus-invert-outline, oklch(1 0 0 / 0.7));
|
|
38
|
+
}
|
|
58
39
|
|
|
59
|
-
@media (max-width: 1060px) {
|
|
60
|
-
padding: var(--intergalactic-spacing-2x, 8px) var(--intergalactic-spacing-1x, 4px);
|
|
61
40
|
&:hover {
|
|
62
|
-
|
|
63
|
-
|
|
41
|
+
background: var(--intergalactic-control-primary-advertising-hover, oklch(0.6 0.244 297.8));
|
|
42
|
+
z-index: 2;
|
|
64
43
|
}
|
|
65
|
-
|
|
66
|
-
display: block;
|
|
67
|
-
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
68
|
-
white-space: nowrap;
|
|
69
|
-
overflow: auto;
|
|
70
|
-
}
|
|
71
|
-
&[active]:hover SStepDescription {
|
|
44
|
+
&[active] {
|
|
72
45
|
background: var(--intergalactic-control-primary-advertising-active, oklch(0.58 0.254 297.1));
|
|
73
46
|
}
|
|
47
|
+
&:disabled,
|
|
48
|
+
&[disabled] {
|
|
49
|
+
opacity: var(--intergalactic-disabled-opacity, 0.4);
|
|
50
|
+
cursor: default;
|
|
51
|
+
pointer-events: none; /* Disable interactions */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (max-width: 1060px) {
|
|
55
|
+
padding: var(--intergalactic-spacing-2x, 8px);
|
|
56
|
+
&:hover {
|
|
57
|
+
width: max-content;
|
|
58
|
+
max-width: 220px;
|
|
59
|
+
}
|
|
60
|
+
&:hover SStepDescription {
|
|
61
|
+
display: block;
|
|
62
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
63
|
+
overflow: auto;
|
|
64
|
+
}
|
|
65
|
+
&[active]:hover SStepDescription {
|
|
66
|
+
background: var(--intergalactic-control-primary-advertising-active, oklch(0.58 0.254 297.1));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
SSidebarHeader {
|
|
73
|
+
font-size: var(--intergalactic-fs-300, 16px);
|
|
74
|
+
margin: 0 var(--intergalactic-spacing-5x, 20px) var(--intergalactic-spacing-4x, 16px);
|
|
75
|
+
@media (max-width: 1060px) {
|
|
76
|
+
display: none;
|
|
74
77
|
}
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
SStepNumber {
|
|
78
81
|
display: inline-block;
|
|
79
82
|
min-width: 20px;
|
|
83
|
+
text-align: center;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
SCompleted {
|
|
@@ -85,6 +89,7 @@ SCompleted {
|
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
SStepDescription {
|
|
92
|
+
overflow-wrap: anywhere;
|
|
88
93
|
@media (max-width: 1060px) {
|
|
89
94
|
display: none;
|
|
90
95
|
}
|
|
@@ -97,7 +102,10 @@ SContent {
|
|
|
97
102
|
0;
|
|
98
103
|
background: var(--intergalactic-bg-primary-neutral, oklch(1 0 0));
|
|
99
104
|
}
|
|
105
|
+
SContent[noSidebar] {
|
|
106
|
+
border-radius: var(--intergalactic-modal-rounded, calc(12px + 2px));
|
|
107
|
+
}
|
|
100
108
|
|
|
101
109
|
SSidebarMenu {
|
|
102
110
|
display: contents;
|
|
103
|
-
}
|
|
111
|
+
}
|
|
@@ -6,12 +6,12 @@ import it from "./it.json.mjs";
|
|
|
6
6
|
import ja from "./ja.json.mjs";
|
|
7
7
|
import ko from "./ko.json.mjs";
|
|
8
8
|
import nl from "./nl.json.mjs";
|
|
9
|
+
import pl from "./pl.json.mjs";
|
|
9
10
|
import pt from "./pt.json.mjs";
|
|
11
|
+
import sv from "./sv.json.mjs";
|
|
10
12
|
import tr from "./tr.json.mjs";
|
|
11
13
|
import vi from "./vi.json.mjs";
|
|
12
14
|
import zh from "./zh.json.mjs";
|
|
13
|
-
import pl from "./pl.json.mjs";
|
|
14
|
-
import sv from "./sv.json.mjs";
|
|
15
15
|
var localizedMessages = {
|
|
16
16
|
de,
|
|
17
17
|
en,
|