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