@semcore/wizard 16.0.0-prerelease.4 → 16.0.0-prerelease.7
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/esm/Wizard.mjs +236 -178
- 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 -6
package/lib/esm/Wizard.mjs
CHANGED
|
@@ -1,93 +1,107 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { sstyled
|
|
9
|
-
import
|
|
10
|
-
import { ScreenReaderOnly
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { localizedMessages
|
|
16
|
-
import { setFocus
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
var
|
|
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 = (
|
|
22
22
|
/*__reshadow_css_start__*/
|
|
23
|
-
(
|
|
23
|
+
(sstyled.insert(
|
|
24
24
|
/*__inner_css_start__*/
|
|
25
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
26
|
"1gak9_gg_"
|
|
27
27
|
), {
|
|
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_"
|
|
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_"
|
|
39
39
|
})
|
|
40
|
-
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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", {
|
|
49
55
|
highlighted: null
|
|
50
|
-
})
|
|
56
|
+
});
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "stepperRefs", []);
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "stepperFocusPrev", function(i) {
|
|
51
59
|
return function() {
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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);
|
|
59
69
|
};
|
|
60
|
-
})
|
|
70
|
+
});
|
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "stepperFocusNext", function(i) {
|
|
61
72
|
return function() {
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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);
|
|
69
82
|
};
|
|
70
|
-
})
|
|
83
|
+
});
|
|
84
|
+
return _this;
|
|
71
85
|
}
|
|
72
|
-
|
|
86
|
+
_createClass(WizardRoot2, [{
|
|
73
87
|
key: "getStepProps",
|
|
74
|
-
value: function(
|
|
88
|
+
value: function getStepProps(props) {
|
|
75
89
|
return {
|
|
76
90
|
steps: this._steps,
|
|
77
|
-
active:
|
|
78
|
-
id: "".concat(this.asProps.uid, "-step-").concat(
|
|
91
|
+
active: props.step === this.asProps.step,
|
|
92
|
+
id: "".concat(this.asProps.uid, "-step-").concat(props.step)
|
|
79
93
|
};
|
|
80
94
|
}
|
|
81
95
|
}, {
|
|
82
96
|
key: "getSidebarProps",
|
|
83
|
-
value: function() {
|
|
97
|
+
value: function getSidebarProps() {
|
|
84
98
|
return {
|
|
85
99
|
uid: this.asProps.uid
|
|
86
100
|
};
|
|
87
101
|
}
|
|
88
102
|
}, {
|
|
89
103
|
key: "getContentProps",
|
|
90
|
-
value: function() {
|
|
104
|
+
value: function getContentProps() {
|
|
91
105
|
return {
|
|
92
106
|
uid: this.asProps.uid,
|
|
93
107
|
step: this.asProps.step,
|
|
@@ -96,7 +110,7 @@ var J = (
|
|
|
96
110
|
}
|
|
97
111
|
}, {
|
|
98
112
|
key: "getStepBackProps",
|
|
99
|
-
value: function() {
|
|
113
|
+
value: function getStepBackProps() {
|
|
100
114
|
return {
|
|
101
115
|
getI18nText: this.asProps.getI18nText,
|
|
102
116
|
step: this.asProps.step
|
|
@@ -104,7 +118,7 @@ var J = (
|
|
|
104
118
|
}
|
|
105
119
|
}, {
|
|
106
120
|
key: "getStepNextProps",
|
|
107
|
-
value: function() {
|
|
121
|
+
value: function getStepNextProps() {
|
|
108
122
|
return {
|
|
109
123
|
getI18nText: this.asProps.getI18nText,
|
|
110
124
|
step: this.asProps.step
|
|
@@ -112,146 +126,190 @@ var J = (
|
|
|
112
126
|
}
|
|
113
127
|
}, {
|
|
114
128
|
key: "getStepperProps",
|
|
115
|
-
value: function(
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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;
|
|
125
142
|
return {
|
|
126
|
-
active
|
|
127
|
-
tabIndex:
|
|
128
|
-
number
|
|
143
|
+
active,
|
|
144
|
+
tabIndex: highlighted ? 0 : -1,
|
|
145
|
+
number,
|
|
129
146
|
getI18nText: this.asProps.getI18nText,
|
|
130
147
|
uid: this.asProps.uid,
|
|
131
|
-
ref: function(
|
|
132
|
-
|
|
148
|
+
ref: function ref(node) {
|
|
149
|
+
_this2.stepperRefs[i] = node;
|
|
133
150
|
},
|
|
134
|
-
focusNext: this.stepperFocusNext(
|
|
135
|
-
focusPrev: this.stepperFocusPrev(
|
|
151
|
+
focusNext: this.stepperFocusNext(i),
|
|
152
|
+
focusPrev: this.stepperFocusPrev(i)
|
|
136
153
|
};
|
|
137
154
|
}
|
|
138
155
|
}, {
|
|
139
156
|
key: "componentDidUpdate",
|
|
140
|
-
value: function(
|
|
141
|
-
var
|
|
142
|
-
|
|
157
|
+
value: function componentDidUpdate(prevProps) {
|
|
158
|
+
var _this3 = this;
|
|
159
|
+
if (prevProps.step === this.asProps.step) return;
|
|
160
|
+
this.setState({
|
|
143
161
|
highlighted: this.asProps.step || null
|
|
144
|
-
})
|
|
145
|
-
|
|
146
|
-
|
|
162
|
+
});
|
|
163
|
+
setTimeout(function() {
|
|
164
|
+
if (prevProps.step === _this3.asProps.step) return;
|
|
165
|
+
setFocus(_this3.contentRef.current);
|
|
166
|
+
}, 1);
|
|
147
167
|
}
|
|
148
168
|
}, {
|
|
149
169
|
key: "render",
|
|
150
|
-
value: function() {
|
|
151
|
-
var
|
|
152
|
-
|
|
153
|
-
|
|
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,
|
|
154
177
|
"aria-label": void 0,
|
|
155
|
-
ref: this.modalRef,
|
|
156
|
-
"aria-labelledby": "".concat(
|
|
157
|
-
}), /* @__PURE__ */
|
|
178
|
+
"ref": this.modalRef,
|
|
179
|
+
"aria-labelledby": "".concat(uid, "-title")
|
|
180
|
+
}), /* @__PURE__ */ React.createElement(Children, _ref7.cn("Children", {})));
|
|
158
181
|
}
|
|
159
|
-
}])
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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", {
|
|
165
189
|
step: null,
|
|
166
|
-
i18n:
|
|
190
|
+
i18n: localizedMessages,
|
|
167
191
|
locale: "en"
|
|
168
192
|
});
|
|
169
|
-
function
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
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",
|
|
178
207
|
"aria-orientation": "vertical"
|
|
179
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ React.createElement(Children, _ref8.cn("Children", {}))));
|
|
180
209
|
}
|
|
181
|
-
function
|
|
182
|
-
var
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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", {})));
|
|
186
217
|
}
|
|
187
218
|
return null;
|
|
188
219
|
}
|
|
189
|
-
function
|
|
190
|
-
var
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
"
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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", {
|
|
204
253
|
"aria-hidden": "true"
|
|
205
|
-
}),
|
|
254
|
+
}), completed ? /* @__PURE__ */ React.createElement(SCompleted, _ref10.cn("SCompleted", {})) : number), /* @__PURE__ */ React.createElement(SStepDescription, _ref10.cn("SStepDescription", {}), /* @__PURE__ */ React.createElement(Children, _ref10.cn("Children", {}))));
|
|
206
255
|
}
|
|
207
|
-
|
|
208
|
-
function
|
|
209
|
-
var
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
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);
|
|
215
266
|
}
|
|
216
|
-
function
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"
|
|
226
|
-
|
|
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
|
|
227
281
|
})
|
|
228
|
-
},
|
|
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));
|
|
229
283
|
}
|
|
230
|
-
function
|
|
231
|
-
var
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
"
|
|
240
|
-
|
|
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
|
|
241
298
|
})
|
|
242
|
-
},
|
|
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", {}))));
|
|
243
300
|
}
|
|
244
|
-
var
|
|
245
|
-
Sidebar
|
|
246
|
-
Content
|
|
247
|
-
Step
|
|
248
|
-
Stepper
|
|
249
|
-
StepBack
|
|
250
|
-
StepNext
|
|
251
|
-
})
|
|
252
|
-
|
|
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;
|
|
253
311
|
};
|
|
254
312
|
export {
|
|
255
|
-
|
|
256
|
-
|
|
313
|
+
Wizard as default,
|
|
314
|
+
wrapWizardStepper
|
|
257
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
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Paso completado";
|
|
2
|
+
const backButton = "Volver a {buttonName}";
|
|
3
|
+
const nextButton = "Continuar a {buttonName}";
|
|
4
|
+
const es = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
es as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Étape terminée";
|
|
2
|
+
const backButton = "Retour à {buttonName}";
|
|
3
|
+
const nextButton = "Continuer vers {buttonName}";
|
|
4
|
+
const fr = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
fr as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Fase completata";
|
|
2
|
+
const backButton = "Torna a {buttonName}";
|
|
3
|
+
const nextButton = "Continua a {buttonName}";
|
|
4
|
+
const it = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
it as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "完成したステップ";
|
|
2
|
+
const backButton = "{buttonName}に戻る";
|
|
3
|
+
const nextButton = "{buttonName} に移動";
|
|
4
|
+
const ja = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
ja as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "단계 완료됨";
|
|
2
|
+
const backButton = "{buttonName} 단계로 돌아가기";
|
|
3
|
+
const nextButton = "{buttonName}로 계속";
|
|
4
|
+
const ko = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
ko as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Voltooide stap";
|
|
2
|
+
const backButton = "Terug naar {buttonName}";
|
|
3
|
+
const nextButton = "Door naar {buttonName}";
|
|
4
|
+
const nl = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
nl as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Ukończony krok";
|
|
2
|
+
const backButton = "Wróć do: {buttonName}";
|
|
3
|
+
const nextButton = "Dalej do: {buttonName}";
|
|
4
|
+
const pl = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
pl as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Etapa concluída";
|
|
2
|
+
const backButton = "Voltar para {buttonName}";
|
|
3
|
+
const nextButton = "Continuar para {buttonName}";
|
|
4
|
+
const pt = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
pt as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Genomfört steg";
|
|
2
|
+
const backButton = "Tillbaka till {buttonName}";
|
|
3
|
+
const nextButton = "Fortsätt till {buttonName}";
|
|
4
|
+
const sv = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
sv as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Tamamlanan adım";
|
|
2
|
+
const backButton = "Geri dön{buttonName}";
|
|
3
|
+
const nextButton = "{buttonName} adresine devam edin";
|
|
4
|
+
const tr = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
tr as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "Bước đã hoàn thành";
|
|
2
|
+
const backButton = "Quay lại {buttonName}";
|
|
3
|
+
const nextButton = "Tiếp tục đến {buttonName}";
|
|
4
|
+
const vi = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
vi as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const completedStep = "已完成的步骤";
|
|
2
|
+
const backButton = "返回到{buttonName}";
|
|
3
|
+
const nextButton = "继续到 {buttonName}";
|
|
4
|
+
const zh = {
|
|
5
|
+
completedStep,
|
|
6
|
+
backButton,
|
|
7
|
+
nextButton
|
|
5
8
|
};
|
|
6
9
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
backButton,
|
|
11
|
+
completedStep,
|
|
12
|
+
zh as default,
|
|
13
|
+
nextButton
|
|
11
14
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/wizard",
|
|
3
3
|
"description": "Semrush Wizard Component",
|
|
4
|
-
"version": "16.0.0-prerelease.
|
|
4
|
+
"version": "16.0.0-prerelease.7",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/button": "16.0.0-prerelease.
|
|
18
|
-
"@semcore/flex-box": "16.0.0-prerelease.
|
|
19
|
-
"@semcore/icon": "16.0.0-prerelease.
|
|
20
|
-
"@semcore/modal": "16.0.0-prerelease.
|
|
17
|
+
"@semcore/button": "16.0.0-prerelease.7",
|
|
18
|
+
"@semcore/flex-box": "16.0.0-prerelease.7",
|
|
19
|
+
"@semcore/icon": "16.0.0-prerelease.7",
|
|
20
|
+
"@semcore/modal": "16.0.0-prerelease.7"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@semcore/base-components": "^16.0.0-prerelease.
|
|
23
|
+
"@semcore/base-components": "^16.0.0-prerelease.7"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|