@semcore/wizard 16.2.3-prerelease.9 → 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.
package/lib/es6/Wizard.js CHANGED
@@ -1,3 +1,8 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime/helpers/createClass";
4
+ import _callSuper from "@babel/runtime/helpers/callSuper";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
1
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
7
  import { sstyled as _sstyled } from "@semcore/core";
3
8
  import { assignProps as _assignProps6 } from "@semcore/core";
@@ -6,188 +11,222 @@ import { assignProps as _assignProps4 } from "@semcore/core";
6
11
  import { assignProps as _assignProps3 } from "@semcore/core";
7
12
  import { assignProps as _assignProps2 } from "@semcore/core";
8
13
  import { assignProps as _assignProps } from "@semcore/core";
9
- import { ScreenReaderOnly, Box } from '@semcore/base-components';
10
14
  import Button from '@semcore/button';
11
15
  import { createComponent, Component, Root, sstyled } from '@semcore/core';
12
16
  import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
17
+ import keyboardFocusEnhance from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
13
18
  import findComponent from '@semcore/core/lib/utils/findComponent';
14
19
  import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
15
20
  import { setFocus } from '@semcore/core/lib/utils/use/useFocusLock';
21
+ import { ScreenReaderOnly, Box } from '@semcore/flex-box';
16
22
  import ArrowLeft from '@semcore/icon/ArrowLeft/m';
17
23
  import ArrowRight from '@semcore/icon/ArrowRight/m';
18
24
  import CheckM from '@semcore/icon/Check/m';
19
25
  import Modal from '@semcore/modal';
20
26
  import React from 'react';
21
27
  /*!__reshadow-styles__:"./style/wizard.shadow.css"*/
22
- const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___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}", /*__inner_css_end__*/"kiedu_gg_"),
28
+ var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___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}", /*__inner_css_end__*/"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
  import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
39
- class WizardRoot extends Component {
40
- constructor(...args) {
41
- super(...args);
42
- _defineProperty(this, "_steps", 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 WizardRoot() {
47
+ var _this;
48
+ _classCallCheck(this, WizardRoot);
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, WizardRoot, [].concat(args));
53
+ _defineProperty(_this, "_steps", 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?.step
58
- });
59
- setTimeout(() => {
60
- this.stepperRefs[i - 1]?.focus();
61
- }, 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
+ };
62
77
  });
63
- _defineProperty(this, "stepperFocusNext", i => () => {
64
- const nextStep = this._steps.get(i + 2);
65
- if (!nextStep) return;
66
- if (nextStep.disabled) {
67
- this.stepperFocusNext(i + 1)();
68
- return;
69
- }
70
- this.setState({
71
- highlighted: nextStep?.step
72
- });
73
- setTimeout(() => {
74
- this.stepperRefs[i + 1]?.focus();
75
- }, 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
+ };
76
94
  });
95
+ return _this;
77
96
  }
78
- getStepId(step) {
79
- return `${this.asProps.uid}-step-${step}`;
80
- }
81
- getId() {
82
- return `${this.asProps.uid}-title`;
83
- }
84
- getStepperId(step) {
85
- const {
86
- uid
87
- } = this.asProps;
88
- return `${uid}-stepper-${step}`;
89
- }
90
- getContentId(step) {
91
- const {
92
- uid
93
- } = this.asProps;
94
- return `${uid}-content-${step}`;
95
- }
96
- getStepProps(props) {
97
- return {
98
- steps: this._steps,
99
- active: props.step === this.asProps.step,
100
- id: this.getStepId(props.step)
101
- };
102
- }
103
- getSidebarProps() {
104
- return {
105
- id: this.getId()
106
- };
107
- }
108
- getContentProps() {
109
- const {
110
- Children,
111
- step
112
- } = this.asProps;
113
- const Sidebar = findComponent(Children, ['Wizard.Sidebar'], true);
114
- return {
115
- ref: this.contentRef,
116
- noSidebar: !Sidebar,
117
- ['aria-labelledby']: this.getStepperId(step),
118
- id: this.getContentId(step)
119
- };
120
- }
121
- getStepBackProps() {
122
- return {
123
- getI18nText: this.asProps.getI18nText,
124
- step: this.asProps.step
125
- };
126
- }
127
- getStepNextProps() {
128
- return {
129
- getI18nText: this.asProps.getI18nText,
130
- step: this.asProps.step
131
- };
132
- }
133
- getStepperProps(props, i) {
134
- let number = i + 1;
135
- if (this._steps.has(props.step)) {
136
- const step = this._steps.get(props.step);
137
- number = step.number;
138
- } else {
139
- this._steps.set(props.step, {
140
- number,
141
- ...props
142
- });
97
+ _inherits(WizardRoot, _Component);
98
+ return _createClass(WizardRoot, [{
99
+ key: "getStepId",
100
+ value: function getStepId(step) {
101
+ return "".concat(this.asProps.uid, "-step-").concat(step);
143
102
  }
144
- const active = props.step === this.asProps.step;
145
- const highlighted = this.state.highlighted === props.step;
146
- return {
147
- active,
148
- 'tabIndex': highlighted ? 0 : -1,
149
- number,
150
- 'getI18nText': this.asProps.getI18nText,
151
- 'uid': this.asProps.uid,
152
- 'ref': node => {
153
- this.stepperRefs[i] = node;
154
- },
155
- 'focusNext': this.stepperFocusNext(i),
156
- 'focusPrev': this.stepperFocusPrev(i),
157
- 'id': this.getStepperId(props.step),
158
- 'aria-controls': active ? this.getContentId(props.step) : undefined,
159
- 'aria-disabled': props.disabled,
160
- 'aria-selected': active
161
- };
162
- }
163
- componentDidUpdate(prevProps) {
164
- if (prevProps.step === this.asProps.step) return;
165
- this.setState({
166
- highlighted: this.asProps.step
167
- });
168
- setTimeout(() => {
169
- if (prevProps.step === this.asProps.step) return;
170
- if (this.contentRef.current) {
171
- setFocus(this.contentRef.current);
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,
140
+ Children = _this$asProps.Children,
141
+ step = _this$asProps.step;
142
+ var Sidebar = findComponent(Children, ['Wizard.Sidebar'], true);
143
+ return _defineProperty(_defineProperty({
144
+ ref: this.contentRef,
145
+ noSidebar: !Sidebar
146
+ }, 'aria-labelledby', this.getStepperId(step)), "id", this.getContentId(step));
147
+ }
148
+ }, {
149
+ key: "getStepBackProps",
150
+ value: function getStepBackProps() {
151
+ return {
152
+ getI18nText: this.asProps.getI18nText,
153
+ step: this.asProps.step
154
+ };
155
+ }
156
+ }, {
157
+ key: "getStepNextProps",
158
+ value: function getStepNextProps() {
159
+ return {
160
+ getI18nText: this.asProps.getI18nText,
161
+ step: this.asProps.step
162
+ };
163
+ }
164
+ }, {
165
+ key: "getStepperProps",
166
+ value: function getStepperProps(props, i) {
167
+ var _this2 = this;
168
+ var number = i + 1;
169
+ if (this._steps.has(props.step)) {
170
+ var step = this._steps.get(props.step);
171
+ number = step.number;
172
+ } else {
173
+ this._steps.set(props.step, _objectSpread({
174
+ number: number
175
+ }, props));
172
176
  }
173
- }, 1);
174
- }
175
- render() {
176
- var _ref7;
177
- const SWizard = this.Root;
178
- const {
179
- Children,
180
- styles
181
- } = this.asProps;
182
- this._steps.clear();
183
- return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SWizard, _ref7.cn("SWizard", {
184
- "render": Modal,
185
- "aria-label": undefined,
186
- "ref": this.modalRef,
187
- "aria-labelledby": this.getId()
188
- }), /*#__PURE__*/React.createElement(Children, _ref7.cn("Children", {})));
189
- }
190
- }
177
+ var active = props.step === this.asProps.step;
178
+ var highlighted = this.state.highlighted === props.step;
179
+ return {
180
+ active: active,
181
+ 'tabIndex': highlighted ? 0 : -1,
182
+ number: number,
183
+ 'getI18nText': this.asProps.getI18nText,
184
+ 'uid': this.asProps.uid,
185
+ 'ref': function ref(node) {
186
+ _this2.stepperRefs[i] = node;
187
+ },
188
+ 'focusNext': this.stepperFocusNext(i),
189
+ 'focusPrev': this.stepperFocusPrev(i),
190
+ 'id': this.getStepperId(props.step),
191
+ 'aria-controls': active ? this.getContentId(props.step) : undefined,
192
+ 'aria-disabled': props.disabled,
193
+ 'aria-selected': active
194
+ };
195
+ }
196
+ }, {
197
+ key: "componentDidUpdate",
198
+ value: function componentDidUpdate(prevProps) {
199
+ var _this3 = this;
200
+ if (prevProps.step === this.asProps.step) return;
201
+ // @ts-ignore
202
+ this.setState({
203
+ highlighted: this.asProps.step
204
+ });
205
+ setTimeout(function () {
206
+ if (prevProps.step === _this3.asProps.step) return;
207
+ if (_this3.contentRef.current) {
208
+ setFocus(_this3.contentRef.current);
209
+ }
210
+ }, 1);
211
+ }
212
+ }, {
213
+ key: "render",
214
+ value: function render() {
215
+ var _ref7;
216
+ var SWizard = this.Root;
217
+ var _this$asProps2 = this.asProps,
218
+ Children = _this$asProps2.Children,
219
+ styles = _this$asProps2.styles;
220
+ this._steps.clear();
221
+ return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SWizard, _ref7.cn("SWizard", {
222
+ "render": Modal,
223
+ "aria-label": undefined,
224
+ "ref": this.modalRef,
225
+ "aria-labelledby": this.getId()
226
+ }), /*#__PURE__*/React.createElement(Children, _ref7.cn("Children", {})));
227
+ }
228
+ }]);
229
+ }(Component);
191
230
  _defineProperty(WizardRoot, "displayName", 'Wizard');
192
231
  _defineProperty(WizardRoot, "style", style);
193
232
  _defineProperty(WizardRoot, "enhance", [i18nEnhance(localizedMessages), uniqueIDEnhancement()]);
@@ -199,20 +238,16 @@ _defineProperty(WizardRoot, "defaultProps", {
199
238
  function Sidebar(props) {
200
239
  var _ref = arguments[0],
201
240
  _ref8;
202
- const {
203
- Children,
204
- styles,
205
- title,
206
- id
207
- } = props;
208
- const SSidebar = Box;
209
- const SSidebarHeader = 'h2';
210
- const SSidebarMenu = 'div';
211
- return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SSidebar, _ref8.cn("SSidebar", {
212
- ..._assignProps({
213
- "__excludeProps": ['title', 'id']
214
- }, _ref)
215
- }), title && /*#__PURE__*/React.createElement(SSidebarHeader, _ref8.cn("SSidebarHeader", {
241
+ var Children = props.Children,
242
+ styles = props.styles,
243
+ title = props.title,
244
+ id = props.id;
245
+ var SSidebar = Box;
246
+ var SSidebarHeader = 'h2';
247
+ var SSidebarMenu = 'div';
248
+ return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SSidebar, _ref8.cn("SSidebar", _objectSpread({}, _assignProps({
249
+ "__excludeProps": ['title', 'id']
250
+ }, _ref))), title && /*#__PURE__*/React.createElement(SSidebarHeader, _ref8.cn("SSidebarHeader", {
216
251
  "id": id
217
252
  }), title), /*#__PURE__*/React.createElement(SSidebarMenu, _ref8.cn("SSidebarMenu", {
218
253
  "role": 'tablist',
@@ -221,43 +256,36 @@ function Sidebar(props) {
221
256
  }
222
257
  function Step(props) {
223
258
  var _ref2 = arguments[0];
224
- const SStep = Box;
225
- const {
226
- Children,
227
- styles,
228
- active
229
- } = props;
259
+ var SStep = Box;
260
+ var Children = props.Children,
261
+ styles = props.styles,
262
+ active = props.active;
230
263
  if (active) {
231
264
  var _ref9;
232
- return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SStep, _ref9.cn("SStep", {
233
- ..._assignProps2({}, _ref2)
234
- }), /*#__PURE__*/React.createElement(Children, _ref9.cn("Children", {})));
265
+ return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SStep, _ref9.cn("SStep", _objectSpread({}, _assignProps2({}, _ref2))), /*#__PURE__*/React.createElement(Children, _ref9.cn("Children", {})));
235
266
  }
236
267
  return null;
237
268
  }
238
269
  function Stepper(props) {
239
270
  var _ref3 = arguments[0],
240
271
  _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 => {
272
+ var Children = props.Children,
273
+ styles = props.styles,
274
+ step = props.step,
275
+ onActive = props.onActive,
276
+ completed = props.completed,
277
+ number = props.number,
278
+ getI18nText = props.getI18nText,
279
+ focusNext = props.focusNext,
280
+ focusPrev = props.focusPrev;
281
+ var SStepper = Box;
282
+ var SStepNumber = 'span';
283
+ var SStepDescription = 'span';
284
+ var SCompleted = CheckM;
285
+ var handlerClick = React.useCallback(function (e) {
258
286
  if (onActive) onActive(step, e);
259
287
  }, [step, onActive]);
260
- const handlerKeyDown = React.useCallback(e => {
288
+ var handlerKeyDown = React.useCallback(function (e) {
261
289
  if (onActive && (e.key === 'Enter' || e.key === ' ')) {
262
290
  e.preventDefault();
263
291
  onActive(step, e);
@@ -271,89 +299,79 @@ function Stepper(props) {
271
299
  e.stopPropagation();
272
300
  }
273
301
  }, [step, onActive, focusPrev, focusNext]);
274
- return _ref0 = sstyled(styles), /*#__PURE__*/React.createElement(SStepper, _ref0.cn("SStepper", {
275
- ..._assignProps3({
276
- "role": 'tab',
277
- "tabIndex": disabled ? undefined : 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", {
302
+ return _ref0 = sstyled(styles), /*#__PURE__*/React.createElement(SStepper, _ref0.cn("SStepper", _objectSpread({}, _assignProps3({
303
+ "role": 'tab',
304
+ "onClick": handlerClick,
305
+ "onKeyDown": handlerKeyDown
306
+ }, _ref3))), completed && /*#__PURE__*/React.createElement(ScreenReaderOnly, _ref0.cn("ScreenReaderOnly", {}), getI18nText('completedStep')), /*#__PURE__*/React.createElement(SStepNumber, _ref0.cn("SStepNumber", {
282
307
  "aria-hidden": 'true'
283
308
  }), completed ? /*#__PURE__*/React.createElement(SCompleted, _ref0.cn("SCompleted", {})) : number), /*#__PURE__*/React.createElement(SStepDescription, _ref0.cn("SStepDescription", {}), /*#__PURE__*/React.createElement(Children, _ref0.cn("Children", {}))));
284
309
  }
310
+ Stepper.enhance = [keyboardFocusEnhance()];
285
311
  function Content(props) {
286
312
  var _ref4 = arguments[0],
287
313
  _ref1;
288
- const {
289
- Children,
290
- styles
291
- } = props;
292
- const SContent = Box;
293
- return _ref1 = sstyled(styles), /*#__PURE__*/React.createElement(SContent, _ref1.cn("SContent", {
294
- ..._assignProps4({
295
- "role": 'tabpanel'
296
- }, _ref4)
297
- }), /*#__PURE__*/React.createElement(Children, _ref1.cn("Children", {})));
314
+ var Children = props.Children,
315
+ styles = props.styles;
316
+ var SContent = Box;
317
+ return _ref1 = sstyled(styles), /*#__PURE__*/React.createElement(SContent, _ref1.cn("SContent", _objectSpread({}, _assignProps4({
318
+ "role": 'tabpanel'
319
+ }, _ref4))), /*#__PURE__*/React.createElement(Children, _ref1.cn("Children", {})));
298
320
  }
299
321
  function StepBack(props) {
300
322
  var _ref5 = arguments[0],
301
323
  _ref10;
302
- const SStepBack = Button;
303
- const {
304
- Children,
305
- children: hasChildren,
306
- styles,
307
- getI18nText,
308
- stepName
309
- } = props;
310
- const handleClick = React.useCallback(() => {
311
- props.onActive?.(props.step - 1);
324
+ var SStepBack = Button;
325
+ var Children = props.Children,
326
+ hasChildren = props.children,
327
+ styles = props.styles,
328
+ getI18nText = props.getI18nText,
329
+ stepName = props.stepName;
330
+ var handleClick = React.useCallback(function () {
331
+ var _props$onActive;
332
+ (_props$onActive = props.onActive) === null || _props$onActive === void 0 || _props$onActive.call(props, props.step - 1);
312
333
  }, [props.step]);
313
- return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SStepBack, _ref10.cn("SStepBack", {
314
- ..._assignProps5({
315
- "use": 'tertiary',
316
- "size": 'l',
317
- "onClick": handleClick,
318
- "aria-label": getI18nText('backButton', {
319
- buttonName: stepName
320
- })
321
- }, _ref5)
322
- }), /*#__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));
334
+ return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SStepBack, _ref10.cn("SStepBack", _objectSpread({}, _assignProps5({
335
+ "use": 'tertiary',
336
+ "size": 'l',
337
+ "onClick": handleClick,
338
+ "aria-label": getI18nText('backButton', {
339
+ buttonName: stepName
340
+ })
341
+ }, _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));
323
342
  }
324
343
  function StepNext(props) {
325
344
  var _ref6 = arguments[0],
326
345
  _ref11;
327
- const SStepNext = Button;
328
- const {
329
- Children,
330
- children: hasChildren,
331
- styles,
332
- getI18nText,
333
- stepName
334
- } = props;
335
- const handleClick = React.useCallback(() => {
336
- props.onActive?.(props.step + 1);
346
+ var SStepNext = Button;
347
+ var Children = props.Children,
348
+ hasChildren = props.children,
349
+ styles = props.styles,
350
+ getI18nText = props.getI18nText,
351
+ stepName = props.stepName;
352
+ var handleClick = React.useCallback(function () {
353
+ var _props$onActive2;
354
+ (_props$onActive2 = props.onActive) === null || _props$onActive2 === void 0 || _props$onActive2.call(props, props.step + 1);
337
355
  }, [props.step]);
338
- return _ref11 = sstyled(styles), /*#__PURE__*/React.createElement(SStepNext, _ref11.cn("SStepNext", {
339
- ..._assignProps6({
340
- "use": 'tertiary',
341
- "size": 'l',
342
- "onClick": handleClick,
343
- "aria-label": getI18nText('nextButton', {
344
- buttonName: stepName
345
- })
346
- }, _ref6)
347
- }), /*#__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", {}))));
356
+ return _ref11 = sstyled(styles), /*#__PURE__*/React.createElement(SStepNext, _ref11.cn("SStepNext", _objectSpread({}, _assignProps6({
357
+ "use": 'tertiary',
358
+ "size": 'l',
359
+ "onClick": handleClick,
360
+ "aria-label": getI18nText('nextButton', {
361
+ buttonName: stepName
362
+ })
363
+ }, _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", {}))));
348
364
  }
349
- const Wizard = createComponent(WizardRoot, {
350
- Sidebar,
351
- Content,
352
- Step,
353
- Stepper,
354
- StepBack,
355
- StepNext
365
+ var Wizard = createComponent(WizardRoot, {
366
+ Sidebar: Sidebar,
367
+ Content: Content,
368
+ Step: Step,
369
+ Stepper: Stepper,
370
+ StepBack: StepBack,
371
+ StepNext: StepNext
356
372
  });
357
- export const wrapWizardStepper = wrapper => wrapper;
373
+ export var wrapWizardStepper = function wrapWizardStepper(wrapper) {
374
+ return wrapper;
375
+ };
358
376
  export default Wizard;
359
377
  //# sourceMappingURL=Wizard.js.map