@semcore/wizard 16.2.3-prerelease.8 → 16.3.0-prerelease.0

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