@semcore/wizard 16.1.1-prerelease.4 → 16.1.2-prerelease.1
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 +6 -0
- package/README.md +1 -31
- package/lib/cjs/Wizard.js +56 -59
- package/lib/cjs/Wizard.js.map +1 -1
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +4 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/Wizard.js +52 -54
- package/lib/es6/Wizard.js.map +1 -1
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/Wizard.mjs +56 -56
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/types/index.d.ts +7 -7
- package/package.json +7 -7
- package/src/Wizard.jsx +13 -12
- package/src/index.d.ts +7 -7
- package/src/translations/__intergalactic-dynamic-locales.ts +2 -2
package/lib/esm/Wizard.mjs
CHANGED
|
@@ -1,64 +1,66 @@
|
|
|
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 _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
|
5
|
+
import _isNativeReflectConstruct from "@babel/runtime/helpers/esm/isNativeReflectConstruct";
|
|
6
|
+
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
5
7
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
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";
|
|
9
|
+
import { createComponent, sstyled, Component, assignProps } from "@semcore/core";
|
|
10
|
+
import Button from "@semcore/button";
|
|
14
11
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
15
|
-
import
|
|
16
|
-
import { setFocus } from "@semcore/core/lib/utils/use/useFocusLock";
|
|
12
|
+
import keyboardFocusEnhance from "@semcore/core/lib/utils/enhances/keyboardFocusEnhance";
|
|
17
13
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
14
|
+
import { setFocus } from "@semcore/core/lib/utils/use/useFocusLock";
|
|
15
|
+
import { Box, ScreenReaderOnly } from "@semcore/flex-box";
|
|
20
16
|
import ArrowLeft from "@semcore/icon/ArrowLeft/m";
|
|
17
|
+
import ArrowRight from "@semcore/icon/ArrowRight/m";
|
|
18
|
+
import CheckM from "@semcore/icon/Check/m";
|
|
19
|
+
import Modal from "@semcore/modal";
|
|
20
|
+
import React from "react";
|
|
21
|
+
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
22
|
+
function _callSuper(t, o, e) {
|
|
23
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
24
|
+
}
|
|
21
25
|
/*!__reshadow-styles__:"./style/wizard.shadow.css"*/
|
|
22
26
|
var style = (
|
|
23
27
|
/*__reshadow_css_start__*/
|
|
24
28
|
(sstyled.insert(
|
|
25
29
|
/*__inner_css_start__*/
|
|
26
|
-
".
|
|
30
|
+
".___SWizard_lwrx4_gg_{max-width:980px;max-height:700px;display:flex;padding:0;background:0 0}.___SSidebar_lwrx4_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);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_lwrx4_gg_{width:56px}}.___SSidebarHeader_lwrx4_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_lwrx4_gg_{display:none}}.___SStepper_lwrx4_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%)}.___SStepper_lwrx4_gg_:focus-visible{outline-color:var(--intergalactic-keyboard-focus-outline-invert, rgba(255, 255, 255, 0.7))}@media (hover:hover){.___SStepper_lwrx4_gg_:hover{background:var(--intergalactic-control-primary-advertising-hover, #421983);z-index:1}}.___SStepper_lwrx4_gg_.__active_lwrx4_gg_{background:var(--intergalactic-control-primary-advertising-active, #8649e1)}.___SStepper_lwrx4_gg_.__disabled_lwrx4_gg_,.___SStepper_lwrx4_gg_:disabled{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}@media (max-width:1060px){.___SStepper_lwrx4_gg_{padding:var(--intergalactic-spacing-2x, 8px)}@media (hover:hover){.___SStepper_lwrx4_gg_:hover{width:-moz-fit-content;width:fit-content;max-width:220px}.___SStepper_lwrx4_gg_:hover .___SStepDescription_lwrx4_gg_{display:block;border-radius:var(--intergalactic-control-rounded, 6px);white-space:nowrap;overflow:auto}.___SStepper_lwrx4_gg_.__active_lwrx4_gg_:hover .___SStepDescription_lwrx4_gg_{background:var(--intergalactic-control-primary-advertising-active, #8649e1)}}}.___SStepNumber_lwrx4_gg_{display:inline-block;min-width:20px;text-align:center}.___SCompleted_lwrx4_gg_{margin-top:1px}@media (max-width:1060px){.___SStepDescription_lwrx4_gg_{display:none}}.___SContent_lwrx4_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_lwrx4_gg_{display:contents}",
|
|
27
31
|
/*__inner_css_end__*/
|
|
28
|
-
"
|
|
32
|
+
"lwrx4_gg_"
|
|
29
33
|
), /*__reshadow_css_end__*/
|
|
30
34
|
{
|
|
31
|
-
"__SWizard": "
|
|
32
|
-
"__SStepNumber": "
|
|
33
|
-
"__SCompleted": "
|
|
34
|
-
"__SContent": "
|
|
35
|
-
"__SSidebarMenu": "
|
|
36
|
-
"__SSidebar": "
|
|
37
|
-
"__SSidebarHeader": "
|
|
38
|
-
"__SStepper": "
|
|
39
|
-
"_active": "
|
|
40
|
-
"_disabled": "
|
|
41
|
-
"__SStepDescription": "
|
|
35
|
+
"__SWizard": "___SWizard_lwrx4_gg_",
|
|
36
|
+
"__SStepNumber": "___SStepNumber_lwrx4_gg_",
|
|
37
|
+
"__SCompleted": "___SCompleted_lwrx4_gg_",
|
|
38
|
+
"__SContent": "___SContent_lwrx4_gg_",
|
|
39
|
+
"__SSidebarMenu": "___SSidebarMenu_lwrx4_gg_",
|
|
40
|
+
"__SSidebar": "___SSidebar_lwrx4_gg_",
|
|
41
|
+
"__SSidebarHeader": "___SSidebarHeader_lwrx4_gg_",
|
|
42
|
+
"__SStepper": "___SStepper_lwrx4_gg_",
|
|
43
|
+
"_active": "__active_lwrx4_gg_",
|
|
44
|
+
"_disabled": "__disabled_lwrx4_gg_",
|
|
45
|
+
"__SStepDescription": "___SStepDescription_lwrx4_gg_"
|
|
42
46
|
})
|
|
43
47
|
);
|
|
44
48
|
var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
45
|
-
_inherits(WizardRoot2, _Component);
|
|
46
|
-
var _super = _createSuper(WizardRoot2);
|
|
47
49
|
function WizardRoot2() {
|
|
48
50
|
var _this;
|
|
49
51
|
_classCallCheck(this, WizardRoot2);
|
|
50
52
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
53
|
args[_key] = arguments[_key];
|
|
52
54
|
}
|
|
53
|
-
_this =
|
|
54
|
-
_defineProperty(
|
|
55
|
-
_defineProperty(
|
|
56
|
-
_defineProperty(
|
|
57
|
-
_defineProperty(
|
|
55
|
+
_this = _callSuper(this, WizardRoot2, [].concat(args));
|
|
56
|
+
_defineProperty(_this, "_steps", /* @__PURE__ */ new Map());
|
|
57
|
+
_defineProperty(_this, "modalRef", /* @__PURE__ */ React.createRef());
|
|
58
|
+
_defineProperty(_this, "contentRef", /* @__PURE__ */ React.createRef());
|
|
59
|
+
_defineProperty(_this, "state", {
|
|
58
60
|
highlighted: null
|
|
59
61
|
});
|
|
60
|
-
_defineProperty(
|
|
61
|
-
_defineProperty(
|
|
62
|
+
_defineProperty(_this, "stepperRefs", []);
|
|
63
|
+
_defineProperty(_this, "stepperFocusPrev", function(i) {
|
|
62
64
|
return function() {
|
|
63
65
|
var prevStep = _this._steps.get(i);
|
|
64
66
|
if (!prevStep) return;
|
|
@@ -67,11 +69,11 @@ var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
|
67
69
|
});
|
|
68
70
|
setTimeout(function() {
|
|
69
71
|
var _this$stepperRefs;
|
|
70
|
-
(_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();
|
|
71
73
|
}, 0);
|
|
72
74
|
};
|
|
73
75
|
});
|
|
74
|
-
_defineProperty(
|
|
76
|
+
_defineProperty(_this, "stepperFocusNext", function(i) {
|
|
75
77
|
return function() {
|
|
76
78
|
var nextStep = _this._steps.get(i + 2);
|
|
77
79
|
if (!nextStep) return;
|
|
@@ -80,13 +82,14 @@ var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
|
80
82
|
});
|
|
81
83
|
setTimeout(function() {
|
|
82
84
|
var _this$stepperRefs2;
|
|
83
|
-
(_this$stepperRefs2 = _this.stepperRefs[i + 1]) === null || _this$stepperRefs2 === void 0
|
|
85
|
+
(_this$stepperRefs2 = _this.stepperRefs[i + 1]) === null || _this$stepperRefs2 === void 0 || _this$stepperRefs2.focus();
|
|
84
86
|
}, 0);
|
|
85
87
|
};
|
|
86
88
|
});
|
|
87
89
|
return _this;
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
_inherits(WizardRoot2, _Component);
|
|
92
|
+
return _createClass(WizardRoot2, [{
|
|
90
93
|
key: "getStepProps",
|
|
91
94
|
value: function getStepProps(props) {
|
|
92
95
|
return {
|
|
@@ -183,7 +186,6 @@ var WizardRoot = /* @__PURE__ */ function(_Component) {
|
|
|
183
186
|
}), /* @__PURE__ */ React.createElement(Children, _ref7.cn("Children", {})));
|
|
184
187
|
}
|
|
185
188
|
}]);
|
|
186
|
-
return WizardRoot2;
|
|
187
189
|
}(Component);
|
|
188
190
|
_defineProperty(WizardRoot, "displayName", "Wizard");
|
|
189
191
|
_defineProperty(WizardRoot, "style", style);
|
|
@@ -199,8 +201,6 @@ function Sidebar(props) {
|
|
|
199
201
|
var SSidebar = Box;
|
|
200
202
|
var SSidebarHeader = "h2";
|
|
201
203
|
var SSidebarMenu = "div";
|
|
202
|
-
React.useCallback(function(e) {
|
|
203
|
-
}, []);
|
|
204
204
|
return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SSidebar, _ref8.cn("SSidebar", _objectSpread({}, assignProps({
|
|
205
205
|
"__excludeProps": ["title"]
|
|
206
206
|
}, _ref))), title && /* @__PURE__ */ React.createElement(SSidebarHeader, _ref8.cn("SSidebarHeader", {
|
|
@@ -221,7 +221,7 @@ function Step(props) {
|
|
|
221
221
|
return null;
|
|
222
222
|
}
|
|
223
223
|
function Stepper(props) {
|
|
224
|
-
var _ref3 = arguments[0],
|
|
224
|
+
var _ref3 = arguments[0], _ref0;
|
|
225
225
|
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;
|
|
226
226
|
var SStepper = Box;
|
|
227
227
|
var SStepNumber = "span";
|
|
@@ -244,7 +244,7 @@ function Stepper(props) {
|
|
|
244
244
|
e.stopPropagation();
|
|
245
245
|
}
|
|
246
246
|
}, [step, onActive, focusPrev, focusNext]);
|
|
247
|
-
return
|
|
247
|
+
return _ref0 = sstyled(styles), /* @__PURE__ */ React.createElement(SStepper, _ref0.cn("SStepper", _objectSpread({}, assignProps({
|
|
248
248
|
"role": "tab",
|
|
249
249
|
"id": "".concat(uid, "-stepper-").concat(step),
|
|
250
250
|
"aria-controls": active ? "".concat(uid, "-content-").concat(step) : void 0,
|
|
@@ -252,54 +252,54 @@ function Stepper(props) {
|
|
|
252
252
|
"aria-selected": active,
|
|
253
253
|
"onClick": handlerClick,
|
|
254
254
|
"onKeyDown": handlerKeyDown
|
|
255
|
-
}, _ref3))), completed && /* @__PURE__ */ React.createElement(ScreenReaderOnly,
|
|
255
|
+
}, _ref3))), completed && /* @__PURE__ */ React.createElement(ScreenReaderOnly, _ref0.cn("ScreenReaderOnly", {}), getI18nText("completedStep")), /* @__PURE__ */ React.createElement(SStepNumber, _ref0.cn("SStepNumber", {
|
|
256
256
|
"aria-hidden": "true"
|
|
257
|
-
}), completed ? /* @__PURE__ */ React.createElement(SCompleted,
|
|
257
|
+
}), completed ? /* @__PURE__ */ React.createElement(SCompleted, _ref0.cn("SCompleted", {})) : number), /* @__PURE__ */ React.createElement(SStepDescription, _ref0.cn("SStepDescription", {}), /* @__PURE__ */ React.createElement(Children, _ref0.cn("Children", {}))));
|
|
258
258
|
}
|
|
259
259
|
Stepper.enhance = [keyboardFocusEnhance()];
|
|
260
260
|
function Content(props) {
|
|
261
|
-
var _ref4 = arguments[0],
|
|
261
|
+
var _ref4 = arguments[0], _ref1;
|
|
262
262
|
var Children = props.Children, hasChildren = props.children, styles = props.styles, uid = props.uid, step = props.step;
|
|
263
263
|
var SContent = Box;
|
|
264
|
-
return
|
|
264
|
+
return _ref1 = sstyled(styles), /* @__PURE__ */ React.createElement(SContent, _ref1.cn("SContent", _objectSpread({}, assignProps({
|
|
265
265
|
"role": "tabpanel",
|
|
266
266
|
"aria-labelledby": "".concat(uid, "-stepper-").concat(step),
|
|
267
267
|
"id": "".concat(uid, "-content-").concat(step)
|
|
268
|
-
}, _ref4))), hasChildren ? /* @__PURE__ */ React.createElement(Children,
|
|
268
|
+
}, _ref4))), hasChildren ? /* @__PURE__ */ React.createElement(Children, _ref1.cn("Children", {})) : stepName);
|
|
269
269
|
}
|
|
270
270
|
function StepBack(props) {
|
|
271
|
-
var _ref5 = arguments[0],
|
|
271
|
+
var _ref5 = arguments[0], _ref10;
|
|
272
272
|
var SStepBack = Button;
|
|
273
273
|
var Children = props.Children, hasChildren = props.children, styles = props.styles, getI18nText = props.getI18nText, stepName2 = props.stepName;
|
|
274
274
|
var handleClick = React.useCallback(function() {
|
|
275
275
|
var _props$onActive;
|
|
276
|
-
(_props$onActive = props.onActive) === null || _props$onActive === void 0
|
|
276
|
+
(_props$onActive = props.onActive) === null || _props$onActive === void 0 || _props$onActive.call(props, props.step - 1);
|
|
277
277
|
}, [props.step]);
|
|
278
|
-
return
|
|
278
|
+
return _ref10 = sstyled(styles), /* @__PURE__ */ React.createElement(SStepBack, _ref10.cn("SStepBack", _objectSpread({}, assignProps({
|
|
279
279
|
"use": "tertiary",
|
|
280
280
|
"size": "l",
|
|
281
281
|
"onClick": handleClick,
|
|
282
282
|
"aria-label": getI18nText("backButton", {
|
|
283
283
|
buttonName: stepName2
|
|
284
284
|
})
|
|
285
|
-
}, _ref5))), /* @__PURE__ */ React.createElement(Button.Addon, null, /* @__PURE__ */ React.createElement(ArrowLeft,
|
|
285
|
+
}, _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", {})) : stepName2));
|
|
286
286
|
}
|
|
287
287
|
function StepNext(props) {
|
|
288
|
-
var _ref6 = arguments[0],
|
|
288
|
+
var _ref6 = arguments[0], _ref11;
|
|
289
289
|
var SStepNext = Button;
|
|
290
290
|
var Children = props.Children, hasChildren = props.children, styles = props.styles, getI18nText = props.getI18nText, stepName2 = props.stepName;
|
|
291
291
|
var handleClick = React.useCallback(function() {
|
|
292
292
|
var _props$onActive2;
|
|
293
|
-
(_props$onActive2 = props.onActive) === null || _props$onActive2 === void 0
|
|
293
|
+
(_props$onActive2 = props.onActive) === null || _props$onActive2 === void 0 || _props$onActive2.call(props, props.step + 1);
|
|
294
294
|
}, [props.step]);
|
|
295
|
-
return
|
|
295
|
+
return _ref11 = sstyled(styles), /* @__PURE__ */ React.createElement(SStepNext, _ref11.cn("SStepNext", _objectSpread({}, assignProps({
|
|
296
296
|
"use": "tertiary",
|
|
297
297
|
"size": "l",
|
|
298
298
|
"onClick": handleClick,
|
|
299
299
|
"aria-label": getI18nText("nextButton", {
|
|
300
300
|
buttonName: stepName2
|
|
301
301
|
})
|
|
302
|
-
}, _ref6))), /* @__PURE__ */ React.createElement(Button.Text, null, hasChildren ? /* @__PURE__ */ React.createElement(Children,
|
|
302
|
+
}, _ref6))), /* @__PURE__ */ React.createElement(Button.Text, null, hasChildren ? /* @__PURE__ */ React.createElement(Children, _ref11.cn("Children", {})) : stepName2), /* @__PURE__ */ React.createElement(Button.Addon, null, /* @__PURE__ */ React.createElement(ArrowRight, _ref11.cn("ArrowRight", {}))));
|
|
303
303
|
}
|
|
304
304
|
var Wizard = createComponent(WizardRoot, {
|
|
305
305
|
Sidebar,
|
|
@@ -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,
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { UnknownProperties, Intergalactic } from '@semcore/core';
|
|
3
|
-
import { Box, BoxProps } from '@semcore/flex-box';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import type { ButtonProps } from '@semcore/button';
|
|
2
|
+
import type { UnknownProperties, Intergalactic } from '@semcore/core';
|
|
3
|
+
import type { Box, BoxProps } from '@semcore/flex-box';
|
|
4
|
+
import type { ModalProps } from '@semcore/modal';
|
|
5
|
+
import type React from 'react';
|
|
6
6
|
|
|
7
7
|
export type WizardStep = string | number | boolean;
|
|
8
8
|
|
|
@@ -84,7 +84,7 @@ type IntergalacticWizardStepperComponent<PropsExtending = {}> = (<
|
|
|
84
84
|
props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', WizardStepperProps<Value>> &
|
|
85
85
|
PropsExtending,
|
|
86
86
|
) => Intergalactic.InternalTypings.ComponentRenderingResults) &
|
|
87
|
-
|
|
87
|
+
Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', WizardStepperProps>;
|
|
88
88
|
|
|
89
89
|
declare const Wizard: Intergalactic.Component<'div', WizardProps> & {
|
|
90
90
|
Sidebar: Intergalactic.Component<'div', WizardSidebarProps>;
|
|
@@ -100,7 +100,7 @@ declare const wrapWizardStepper: <PropsExtending extends {}>(
|
|
|
100
100
|
props: Intergalactic.InternalTypings.UntypeRefAndTag<
|
|
101
101
|
Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticWizardStepperComponent>
|
|
102
102
|
> &
|
|
103
|
-
|
|
103
|
+
PropsExtending,
|
|
104
104
|
) => React.ReactNode,
|
|
105
105
|
) => IntergalacticWizardStepperComponent<PropsExtending>;
|
|
106
106
|
export { wrapWizardStepper };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/wizard",
|
|
3
3
|
"description": "Semrush Wizard Component",
|
|
4
|
-
"version": "16.1.
|
|
4
|
+
"version": "16.1.2-prerelease.1",
|
|
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.
|
|
18
|
-
"@semcore/flex-box": "16.0.
|
|
19
|
-
"@semcore/icon": "16.2.
|
|
20
|
-
"@semcore/modal": "16.1.
|
|
17
|
+
"@semcore/button": "16.0.2-prerelease.1",
|
|
18
|
+
"@semcore/flex-box": "16.0.2-prerelease.1",
|
|
19
|
+
"@semcore/icon": "16.2.1-prerelease.1",
|
|
20
|
+
"@semcore/modal": "16.1.2-prerelease.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@semcore/base-components": "^16.0.
|
|
23
|
+
"@semcore/base-components": "^16.0.2-prerelease.1"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"directory": "semcore/wizard"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@
|
|
31
|
+
"@semcore/core": "16.0.0",
|
|
32
32
|
"@semcore/testing-utils": "1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
package/src/Wizard.jsx
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Button from '@semcore/button';
|
|
2
2
|
import { createComponent, Component, Root, sstyled } from '@semcore/core';
|
|
3
|
-
import { Box } from '@semcore/flex-box';
|
|
4
|
-
import Modal from '@semcore/modal';
|
|
5
|
-
import CheckM from '@semcore/icon/Check/m';
|
|
6
|
-
import keyboardFocusEnhance from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
|
|
7
3
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
8
|
-
import
|
|
9
|
-
import { ScreenReaderOnly } from '@semcore/flex-box';
|
|
10
|
-
import { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';
|
|
4
|
+
import keyboardFocusEnhance from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
|
|
11
5
|
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
6
|
+
import { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';
|
|
7
|
+
import { ScreenReaderOnly, Box } from '@semcore/flex-box';
|
|
14
8
|
import ArrowLeft from '@semcore/icon/ArrowLeft/m';
|
|
9
|
+
import ArrowRight from '@semcore/icon/ArrowRight/m';
|
|
10
|
+
import CheckM from '@semcore/icon/Check/m';
|
|
11
|
+
import Modal from '@semcore/modal';
|
|
12
|
+
import React from 'react';
|
|
15
13
|
|
|
16
14
|
import style from './style/wizard.shadow.css';
|
|
15
|
+
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
17
16
|
|
|
18
17
|
class WizardRoot extends Component {
|
|
19
18
|
static displayName = 'Wizard';
|
|
@@ -43,6 +42,7 @@ class WizardRoot extends Component {
|
|
|
43
42
|
uid: this.asProps.uid,
|
|
44
43
|
};
|
|
45
44
|
}
|
|
45
|
+
|
|
46
46
|
getContentProps() {
|
|
47
47
|
return {
|
|
48
48
|
uid: this.asProps.uid,
|
|
@@ -50,12 +50,14 @@ class WizardRoot extends Component {
|
|
|
50
50
|
ref: this.contentRef,
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
+
|
|
53
54
|
getStepBackProps() {
|
|
54
55
|
return {
|
|
55
56
|
getI18nText: this.asProps.getI18nText,
|
|
56
57
|
step: this.asProps.step,
|
|
57
58
|
};
|
|
58
59
|
}
|
|
60
|
+
|
|
59
61
|
getStepNextProps() {
|
|
60
62
|
return {
|
|
61
63
|
getI18nText: this.asProps.getI18nText,
|
|
@@ -72,6 +74,7 @@ class WizardRoot extends Component {
|
|
|
72
74
|
this.stepperRefs[i - 1]?.focus();
|
|
73
75
|
}, 0);
|
|
74
76
|
};
|
|
77
|
+
|
|
75
78
|
stepperFocusNext = (i) => () => {
|
|
76
79
|
const nextStep = this._steps.get(i + 2);
|
|
77
80
|
if (!nextStep) return;
|
|
@@ -140,8 +143,6 @@ function Sidebar(props) {
|
|
|
140
143
|
const SSidebarHeader = 'h2';
|
|
141
144
|
const SSidebarMenu = 'div';
|
|
142
145
|
|
|
143
|
-
const handleKeyDown = React.useCallback((e) => {}, []);
|
|
144
|
-
|
|
145
146
|
return sstyled(styles)(
|
|
146
147
|
<SSidebar render={Box} __excludeProps={['title']}>
|
|
147
148
|
{title && <SSidebarHeader id={`${uid}-title`}>{title}</SSidebarHeader>}
|
package/src/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { UnknownProperties, Intergalactic } from '@semcore/core';
|
|
3
|
-
import { Box, BoxProps } from '@semcore/flex-box';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
1
|
+
import type { ButtonProps } from '@semcore/button';
|
|
2
|
+
import type { UnknownProperties, Intergalactic } from '@semcore/core';
|
|
3
|
+
import type { Box, BoxProps } from '@semcore/flex-box';
|
|
4
|
+
import type { ModalProps } from '@semcore/modal';
|
|
5
|
+
import type React from 'react';
|
|
6
6
|
|
|
7
7
|
export type WizardStep = string | number | boolean;
|
|
8
8
|
|
|
@@ -84,7 +84,7 @@ type IntergalacticWizardStepperComponent<PropsExtending = {}> = (<
|
|
|
84
84
|
props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', WizardStepperProps<Value>> &
|
|
85
85
|
PropsExtending,
|
|
86
86
|
) => Intergalactic.InternalTypings.ComponentRenderingResults) &
|
|
87
|
-
|
|
87
|
+
Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', WizardStepperProps>;
|
|
88
88
|
|
|
89
89
|
declare const Wizard: Intergalactic.Component<'div', WizardProps> & {
|
|
90
90
|
Sidebar: Intergalactic.Component<'div', WizardSidebarProps>;
|
|
@@ -100,7 +100,7 @@ declare const wrapWizardStepper: <PropsExtending extends {}>(
|
|
|
100
100
|
props: Intergalactic.InternalTypings.UntypeRefAndTag<
|
|
101
101
|
Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticWizardStepperComponent>
|
|
102
102
|
> &
|
|
103
|
-
|
|
103
|
+
PropsExtending,
|
|
104
104
|
) => React.ReactNode,
|
|
105
105
|
) => IntergalacticWizardStepperComponent<PropsExtending>;
|
|
106
106
|
export { wrapWizardStepper };
|
|
@@ -6,12 +6,12 @@ import it from './it.json';
|
|
|
6
6
|
import ja from './ja.json';
|
|
7
7
|
import ko from './ko.json';
|
|
8
8
|
import nl from './nl.json';
|
|
9
|
+
import pl from './pl.json';
|
|
9
10
|
import pt from './pt.json';
|
|
11
|
+
import sv from './sv.json';
|
|
10
12
|
import tr from './tr.json';
|
|
11
13
|
import vi from './vi.json';
|
|
12
14
|
import zh from './zh.json';
|
|
13
|
-
import pl from './pl.json';
|
|
14
|
-
import sv from './sv.json';
|
|
15
15
|
|
|
16
16
|
export const localizedMessages = {
|
|
17
17
|
de,
|