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