@semcore/wizard 16.1.10 → 16.2.0-prerelease.12
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 +12 -0
- package/lib/cjs/Wizard.js +66 -51
- package/lib/cjs/Wizard.js.map +1 -1
- package/lib/cjs/Wizard.types.js +2 -0
- package/lib/cjs/Wizard.types.js.map +1 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/wizard.shadow.css +1 -1
- package/lib/es6/Wizard.js +66 -51
- package/lib/es6/Wizard.js.map +1 -1
- package/lib/es6/Wizard.types.js +2 -0
- package/lib/es6/Wizard.types.js.map +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/wizard.shadow.css +1 -1
- package/lib/esm/Wizard.mjs +70 -50
- package/lib/esm/style/wizard.shadow.css +1 -1
- package/lib/types/Wizard.d.ts +6 -0
- package/lib/types/Wizard.types.d.ts +135 -0
- package/lib/types/index.d.ts +3 -113
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +72 -0
- package/package.json +8 -8
- package/src/{Wizard.jsx → Wizard.tsx} +89 -49
- package/src/{index.d.ts → Wizard.types.ts} +64 -19
- package/src/{index.js → index.ts} +2 -0
- package/src/style/wizard.shadow.css +1 -1
- package/lib/cjs/index.d.js +0 -2
- package/lib/cjs/index.d.js.map +0 -1
- package/lib/es6/index.d.js +0 -2
- package/lib/es6/index.d.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Button from '@semcore/button';
|
|
2
2
|
import { createComponent, Component, Root, sstyled } from '@semcore/core';
|
|
3
|
+
import type { IRootComponentProps, Intergalactic } from '@semcore/core';
|
|
3
4
|
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
4
5
|
import keyboardFocusEnhance from '@semcore/core/lib/utils/enhances/keyboardFocusEnhance';
|
|
5
6
|
import findComponent from '@semcore/core/lib/utils/findComponent';
|
|
@@ -14,11 +15,23 @@ import React from 'react';
|
|
|
14
15
|
|
|
15
16
|
import style from './style/wizard.shadow.css';
|
|
16
17
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
18
|
+
import type {
|
|
19
|
+
WizardStep,
|
|
20
|
+
WizardProps,
|
|
21
|
+
WizardStepProps,
|
|
22
|
+
WizardStepperProps,
|
|
23
|
+
WizardSidebarProps,
|
|
24
|
+
WizardContentProps,
|
|
25
|
+
IntergalacticWizardStepperComponent,
|
|
26
|
+
WizardType,
|
|
27
|
+
WizardStepBackProps,
|
|
28
|
+
WizardStepNextProps,
|
|
29
|
+
} from './Wizard.types';
|
|
17
30
|
|
|
18
|
-
class WizardRoot extends Component {
|
|
31
|
+
class WizardRoot extends Component<WizardProps, {}, {}, typeof WizardRoot.enhance> {
|
|
19
32
|
static displayName = 'Wizard';
|
|
20
33
|
static style = style;
|
|
21
|
-
static enhance = [i18nEnhance(localizedMessages), uniqueIDEnhancement()];
|
|
34
|
+
static enhance = [i18nEnhance(localizedMessages), uniqueIDEnhancement()] as const;
|
|
22
35
|
static defaultProps = {
|
|
23
36
|
step: null,
|
|
24
37
|
i18n: localizedMessages,
|
|
@@ -26,34 +39,56 @@ class WizardRoot extends Component {
|
|
|
26
39
|
};
|
|
27
40
|
|
|
28
41
|
_steps = new Map();
|
|
29
|
-
modalRef = React.createRef();
|
|
30
|
-
contentRef = React.createRef();
|
|
42
|
+
modalRef = React.createRef<HTMLElement>();
|
|
43
|
+
contentRef = React.createRef<HTMLElement>();
|
|
31
44
|
state = { highlighted: null };
|
|
32
45
|
|
|
33
|
-
|
|
46
|
+
stepperRefs: Array<HTMLElement | null> = [];
|
|
47
|
+
|
|
48
|
+
getStepId(step: WizardStep): string {
|
|
49
|
+
return `${this.asProps.uid}-step-${step}`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getId(): string {
|
|
53
|
+
return `${this.asProps.uid}-title`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
getStepperId(step: WizardStep): string {
|
|
57
|
+
const { uid } = this.asProps;
|
|
58
|
+
|
|
59
|
+
return `${uid}-stepper-${step}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
getContentId(step: WizardStep): string {
|
|
63
|
+
const { uid } = this.asProps;
|
|
64
|
+
|
|
65
|
+
return `${uid}-content-${step}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
getStepProps(props: WizardStepProps) {
|
|
34
69
|
return {
|
|
35
70
|
steps: this._steps,
|
|
36
71
|
active: props.step === this.asProps.step,
|
|
37
|
-
id:
|
|
72
|
+
id: this.getStepId(props.step),
|
|
38
73
|
};
|
|
39
74
|
}
|
|
40
75
|
|
|
41
76
|
getSidebarProps() {
|
|
42
77
|
return {
|
|
43
|
-
|
|
78
|
+
id: this.getId(),
|
|
44
79
|
};
|
|
45
80
|
}
|
|
46
81
|
|
|
47
82
|
getContentProps() {
|
|
48
|
-
const { Children } = this.asProps;
|
|
83
|
+
const { Children, step } = this.asProps;
|
|
49
84
|
|
|
50
|
-
const Sidebar = findComponent(Children, ['Wizard.Sidebar']);
|
|
85
|
+
const Sidebar = findComponent(Children, ['Wizard.Sidebar'], true);
|
|
51
86
|
|
|
52
87
|
return {
|
|
53
|
-
uid: this.asProps.uid,
|
|
54
|
-
step: this.asProps.step,
|
|
55
88
|
ref: this.contentRef,
|
|
56
89
|
noSidebar: !Sidebar,
|
|
90
|
+
['aria-labelledby']: this.getStepperId(step),
|
|
91
|
+
id: this.getContentId(step),
|
|
57
92
|
};
|
|
58
93
|
}
|
|
59
94
|
|
|
@@ -71,8 +106,7 @@ class WizardRoot extends Component {
|
|
|
71
106
|
};
|
|
72
107
|
}
|
|
73
108
|
|
|
74
|
-
|
|
75
|
-
stepperFocusPrev = (i) => () => {
|
|
109
|
+
stepperFocusPrev = (i: number) => () => {
|
|
76
110
|
const prevStep = this._steps.get(i);
|
|
77
111
|
if (!prevStep) return;
|
|
78
112
|
this.setState({ highlighted: prevStep?.step });
|
|
@@ -81,7 +115,7 @@ class WizardRoot extends Component {
|
|
|
81
115
|
}, 0);
|
|
82
116
|
};
|
|
83
117
|
|
|
84
|
-
stepperFocusNext = (i) => () => {
|
|
118
|
+
stepperFocusNext = (i: number) => () => {
|
|
85
119
|
const nextStep = this._steps.get(i + 2);
|
|
86
120
|
if (!nextStep) return;
|
|
87
121
|
this.setState({ highlighted: nextStep?.step });
|
|
@@ -90,7 +124,7 @@ class WizardRoot extends Component {
|
|
|
90
124
|
}, 0);
|
|
91
125
|
};
|
|
92
126
|
|
|
93
|
-
getStepperProps(props, i) {
|
|
127
|
+
getStepperProps(props: WizardStepperProps, i: number) {
|
|
94
128
|
let number = i + 1;
|
|
95
129
|
if (this._steps.has(props.step)) {
|
|
96
130
|
const step = this._steps.get(props.step);
|
|
@@ -101,32 +135,40 @@ class WizardRoot extends Component {
|
|
|
101
135
|
const active = props.step === this.asProps.step;
|
|
102
136
|
const highlighted =
|
|
103
137
|
this.state.highlighted === props.step || (this.state.highlighted === null && i === 0);
|
|
138
|
+
|
|
104
139
|
return {
|
|
105
140
|
active,
|
|
106
|
-
tabIndex: highlighted ? 0 : -1,
|
|
141
|
+
'tabIndex': highlighted ? 0 : -1,
|
|
107
142
|
number,
|
|
108
|
-
getI18nText: this.asProps.getI18nText,
|
|
109
|
-
uid: this.asProps.uid,
|
|
110
|
-
ref: (node) => {
|
|
143
|
+
'getI18nText': this.asProps.getI18nText,
|
|
144
|
+
'uid': this.asProps.uid,
|
|
145
|
+
'ref': (node: HTMLElement | null) => {
|
|
111
146
|
this.stepperRefs[i] = node;
|
|
112
147
|
},
|
|
113
|
-
focusNext: this.stepperFocusNext(i),
|
|
114
|
-
focusPrev: this.stepperFocusPrev(i),
|
|
148
|
+
'focusNext': this.stepperFocusNext(i),
|
|
149
|
+
'focusPrev': this.stepperFocusPrev(i),
|
|
150
|
+
|
|
151
|
+
'id': this.getStepperId(props.step),
|
|
152
|
+
'aria-controls': active ? this.getContentId(props.step) : undefined,
|
|
153
|
+
'aria-disabled': props.disabled,
|
|
154
|
+
'aria-selected': active,
|
|
115
155
|
};
|
|
116
156
|
}
|
|
117
157
|
|
|
118
|
-
componentDidUpdate(prevProps) {
|
|
158
|
+
componentDidUpdate(prevProps: WizardProps) {
|
|
119
159
|
if (prevProps.step === this.asProps.step) return;
|
|
120
160
|
this.setState({ highlighted: this.asProps.step || null });
|
|
121
161
|
setTimeout(() => {
|
|
122
162
|
if (prevProps.step === this.asProps.step) return;
|
|
123
|
-
|
|
163
|
+
if (this.contentRef.current) {
|
|
164
|
+
setFocus(this.contentRef.current);
|
|
165
|
+
}
|
|
124
166
|
}, 1);
|
|
125
167
|
}
|
|
126
168
|
|
|
127
169
|
render() {
|
|
128
170
|
const SWizard = this.Root;
|
|
129
|
-
const { Children, styles
|
|
171
|
+
const { Children, styles } = this.asProps;
|
|
130
172
|
|
|
131
173
|
this._steps.clear();
|
|
132
174
|
|
|
@@ -135,7 +177,7 @@ class WizardRoot extends Component {
|
|
|
135
177
|
render={Modal}
|
|
136
178
|
aria-label={undefined}
|
|
137
179
|
ref={this.modalRef}
|
|
138
|
-
aria-labelledby={
|
|
180
|
+
aria-labelledby={this.getId()}
|
|
139
181
|
>
|
|
140
182
|
<Children />
|
|
141
183
|
</SWizard>,
|
|
@@ -143,15 +185,15 @@ class WizardRoot extends Component {
|
|
|
143
185
|
}
|
|
144
186
|
}
|
|
145
187
|
|
|
146
|
-
function Sidebar(props) {
|
|
147
|
-
const { Children, styles, title,
|
|
188
|
+
function Sidebar(props: WizardSidebarProps & IRootComponentProps) {
|
|
189
|
+
const { Children, styles, title, id } = props;
|
|
148
190
|
const SSidebar = Root;
|
|
149
191
|
const SSidebarHeader = 'h2';
|
|
150
192
|
const SSidebarMenu = 'div';
|
|
151
193
|
|
|
152
194
|
return sstyled(styles)(
|
|
153
|
-
<SSidebar render={Box} __excludeProps={['title']}>
|
|
154
|
-
{title && <SSidebarHeader id={
|
|
195
|
+
<SSidebar render={Box} __excludeProps={['title', 'id']}>
|
|
196
|
+
{title && <SSidebarHeader id={id}>{title}</SSidebarHeader>}
|
|
155
197
|
<SSidebarMenu role='tablist' aria-orientation='vertical'>
|
|
156
198
|
<Children />
|
|
157
199
|
</SSidebarMenu>
|
|
@@ -159,7 +201,7 @@ function Sidebar(props) {
|
|
|
159
201
|
);
|
|
160
202
|
}
|
|
161
203
|
|
|
162
|
-
function Step(props) {
|
|
204
|
+
function Step(props: IRootComponentProps & WizardStepProps) {
|
|
163
205
|
const SStep = Root;
|
|
164
206
|
const { Children, styles, active } = props;
|
|
165
207
|
if (active) {
|
|
@@ -172,18 +214,15 @@ function Step(props) {
|
|
|
172
214
|
return null;
|
|
173
215
|
}
|
|
174
216
|
|
|
175
|
-
function Stepper(props) {
|
|
217
|
+
function Stepper(props: Required<WizardStepperProps> & IRootComponentProps) {
|
|
176
218
|
const {
|
|
177
219
|
Children,
|
|
178
220
|
styles,
|
|
179
221
|
step,
|
|
180
|
-
active,
|
|
181
222
|
onActive,
|
|
182
223
|
completed,
|
|
183
|
-
disabled,
|
|
184
224
|
number,
|
|
185
225
|
getI18nText,
|
|
186
|
-
uid,
|
|
187
226
|
focusNext,
|
|
188
227
|
focusPrev,
|
|
189
228
|
} = props;
|
|
@@ -193,14 +232,14 @@ function Stepper(props) {
|
|
|
193
232
|
const SCompleted = CheckM;
|
|
194
233
|
|
|
195
234
|
const handlerClick = React.useCallback(
|
|
196
|
-
(e) => {
|
|
235
|
+
(e: React.SyntheticEvent<HTMLElement>) => {
|
|
197
236
|
if (onActive) onActive(step, e);
|
|
198
237
|
},
|
|
199
238
|
[step, onActive],
|
|
200
239
|
);
|
|
201
240
|
|
|
202
241
|
const handlerKeyDown = React.useCallback(
|
|
203
|
-
(e) => {
|
|
242
|
+
(e: React.KeyboardEvent) => {
|
|
204
243
|
if (onActive && (e.key === 'Enter' || e.key === ' ')) {
|
|
205
244
|
e.preventDefault();
|
|
206
245
|
onActive(step, e);
|
|
@@ -221,10 +260,6 @@ function Stepper(props) {
|
|
|
221
260
|
<SStepper
|
|
222
261
|
render={Box}
|
|
223
262
|
role='tab'
|
|
224
|
-
id={`${uid}-stepper-${step}`}
|
|
225
|
-
aria-controls={active ? `${uid}-content-${step}` : undefined}
|
|
226
|
-
aria-disabled={disabled}
|
|
227
|
-
aria-selected={active}
|
|
228
263
|
onClick={handlerClick}
|
|
229
264
|
onKeyDown={handlerKeyDown}
|
|
230
265
|
>
|
|
@@ -239,22 +274,20 @@ function Stepper(props) {
|
|
|
239
274
|
|
|
240
275
|
Stepper.enhance = [keyboardFocusEnhance()];
|
|
241
276
|
|
|
242
|
-
function Content(props) {
|
|
243
|
-
const { Children,
|
|
277
|
+
function Content(props: WizardContentProps & IRootComponentProps) {
|
|
278
|
+
const { Children, styles } = props;
|
|
244
279
|
const SContent = Root;
|
|
245
280
|
return sstyled(styles)(
|
|
246
281
|
<SContent
|
|
247
282
|
render={Box}
|
|
248
283
|
role='tabpanel'
|
|
249
|
-
aria-labelledby={`${uid}-stepper-${step}`}
|
|
250
|
-
id={`${uid}-content-${step}`}
|
|
251
284
|
>
|
|
252
|
-
|
|
285
|
+
<Children />
|
|
253
286
|
</SContent>,
|
|
254
287
|
);
|
|
255
288
|
}
|
|
256
289
|
|
|
257
|
-
function StepBack(props) {
|
|
290
|
+
function StepBack(props: Required<WizardStepBackProps> & IRootComponentProps) {
|
|
258
291
|
const SStepBack = Root;
|
|
259
292
|
const { Children, children: hasChildren, styles, getI18nText, stepName } = props;
|
|
260
293
|
const handleClick = React.useCallback(() => {
|
|
@@ -275,7 +308,7 @@ function StepBack(props) {
|
|
|
275
308
|
</SStepBack>,
|
|
276
309
|
);
|
|
277
310
|
}
|
|
278
|
-
function StepNext(props) {
|
|
311
|
+
function StepNext(props: Required<WizardStepNextProps> & IRootComponentProps) {
|
|
279
312
|
const SStepNext = Root;
|
|
280
313
|
const { Children, children: hasChildren, styles, getI18nText, stepName } = props;
|
|
281
314
|
const handleClick = React.useCallback(() => {
|
|
@@ -304,8 +337,15 @@ const Wizard = createComponent(WizardRoot, {
|
|
|
304
337
|
Stepper,
|
|
305
338
|
StepBack,
|
|
306
339
|
StepNext,
|
|
307
|
-
});
|
|
340
|
+
}) as WizardType;
|
|
308
341
|
|
|
309
|
-
export const wrapWizardStepper =
|
|
342
|
+
export const wrapWizardStepper = <PropsExtending extends {}>(
|
|
343
|
+
wrapper: (
|
|
344
|
+
props: Intergalactic.InternalTypings.UntypeRefAndTag<
|
|
345
|
+
Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticWizardStepperComponent>
|
|
346
|
+
> &
|
|
347
|
+
PropsExtending,
|
|
348
|
+
) => React.ReactNode,
|
|
349
|
+
) => wrapper as IntergalacticWizardStepperComponent<PropsExtending>;
|
|
310
350
|
|
|
311
351
|
export default Wizard;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ButtonProps } from '@semcore/button';
|
|
2
2
|
import type { UnknownProperties, Intergalactic } from '@semcore/core';
|
|
3
|
-
import type {
|
|
3
|
+
import type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';
|
|
4
|
+
import type { BoxProps } from '@semcore/flex-box';
|
|
4
5
|
import type { ModalProps } from '@semcore/modal';
|
|
5
6
|
import type React from 'react';
|
|
6
7
|
|
|
@@ -24,6 +25,11 @@ export type WizardSidebarProps = BoxProps & {
|
|
|
24
25
|
* Sidebar title
|
|
25
26
|
*/
|
|
26
27
|
title?: React.ReactNode;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @internal html id attribute
|
|
31
|
+
*/
|
|
32
|
+
id?: string;
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
/** @deprecated */
|
|
@@ -37,6 +43,11 @@ export type WizardStepProps = BoxProps & {
|
|
|
37
43
|
* Disabled step
|
|
38
44
|
*/
|
|
39
45
|
disabled?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Active flag
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
active?: boolean;
|
|
40
51
|
};
|
|
41
52
|
|
|
42
53
|
/** @deprecated */
|
|
@@ -50,7 +61,7 @@ export type WizardStepperProps<T extends WizardStep = WizardStep> = BoxProps & {
|
|
|
50
61
|
* Is invoked when active the step
|
|
51
62
|
*/
|
|
52
63
|
onActive?:
|
|
53
|
-
| ((step: T, e: React.SyntheticEvent<HTMLElement>) => void)
|
|
64
|
+
| ((step: T, e: React.SyntheticEvent<HTMLElement> | React.KeyboardEvent) => void)
|
|
54
65
|
| React.Dispatch<React.SetStateAction<T>>;
|
|
55
66
|
/**
|
|
56
67
|
* Stepper number
|
|
@@ -63,26 +74,72 @@ export type WizardStepperProps<T extends WizardStep = WizardStep> = BoxProps & {
|
|
|
63
74
|
completed?: boolean;
|
|
64
75
|
/** Disables interaction with the stepper */
|
|
65
76
|
disabled?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Translation function
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
getI18nText?: ReturnType<typeof useI18n>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Go to next step
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
focusNext?: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* Go to prev step
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
focusPrev?: () => void;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export type WizardContentProps = BoxProps & {
|
|
97
|
+
/**
|
|
98
|
+
* Renders wizard content container with border-radius on the left side
|
|
99
|
+
*/
|
|
100
|
+
noSidebar?: boolean;
|
|
66
101
|
};
|
|
67
102
|
|
|
68
103
|
export type WizardStepBackProps<T extends WizardStep = WizardStep> = ButtonProps & {
|
|
69
104
|
/** Callback invoked when navigating to the previous step */
|
|
70
105
|
onActive?:
|
|
71
|
-
| ((step: T, e
|
|
106
|
+
| ((step: T, e?: React.SyntheticEvent<HTMLElement>) => void)
|
|
72
107
|
| React.Dispatch<React.SetStateAction<T>>;
|
|
73
108
|
/** Step name being navigated to */
|
|
74
109
|
stepName?: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* CurrentStep
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
step?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Translation function
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
getI18nText?: ReturnType<typeof useI18n>;
|
|
75
121
|
};
|
|
76
122
|
export type WizardStepNextProps<T extends WizardStep = WizardStep> = ButtonProps & {
|
|
77
123
|
/** Callback invoked when navigating to the next step */
|
|
78
124
|
onActive?:
|
|
79
|
-
| ((step: T, e
|
|
125
|
+
| ((step: T, e?: React.SyntheticEvent<HTMLElement>) => void)
|
|
80
126
|
| React.Dispatch<React.SetStateAction<T>>;
|
|
81
127
|
/** Step name being navigated to */
|
|
82
128
|
stepName?: string;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* CurrentStep
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
step?: number;
|
|
135
|
+
/**
|
|
136
|
+
* Translation function
|
|
137
|
+
* @internal
|
|
138
|
+
*/
|
|
139
|
+
getI18nText?: ReturnType<typeof useI18n>;
|
|
83
140
|
};
|
|
84
141
|
|
|
85
|
-
type IntergalacticWizardStepperComponent<PropsExtending = {}> = (<
|
|
142
|
+
export type IntergalacticWizardStepperComponent<PropsExtending = {}> = (<
|
|
86
143
|
Value extends WizardStep,
|
|
87
144
|
Tag extends Intergalactic.Tag = 'div',
|
|
88
145
|
>(
|
|
@@ -91,23 +148,11 @@ type IntergalacticWizardStepperComponent<PropsExtending = {}> = (<
|
|
|
91
148
|
) => Intergalactic.InternalTypings.ComponentRenderingResults) &
|
|
92
149
|
Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', WizardStepperProps>;
|
|
93
150
|
|
|
94
|
-
|
|
151
|
+
export type WizardType = Intergalactic.Component<'div', WizardProps> & {
|
|
95
152
|
Sidebar: Intergalactic.Component<'div', WizardSidebarProps>;
|
|
96
153
|
Step: Intergalactic.Component<'div', WizardStepProps>;
|
|
97
154
|
Stepper: IntergalacticWizardStepperComponent;
|
|
98
|
-
Content:
|
|
155
|
+
Content: Intergalactic.Component<'div', WizardContentProps>;
|
|
99
156
|
StepBack: Intergalactic.Component<'button', WizardStepBackProps>;
|
|
100
157
|
StepNext: Intergalactic.Component<'button', WizardStepNextProps>;
|
|
101
158
|
};
|
|
102
|
-
|
|
103
|
-
declare const wrapWizardStepper: <PropsExtending extends {}>(
|
|
104
|
-
wrapper: (
|
|
105
|
-
props: Intergalactic.InternalTypings.UntypeRefAndTag<
|
|
106
|
-
Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticWizardStepperComponent>
|
|
107
|
-
> &
|
|
108
|
-
PropsExtending,
|
|
109
|
-
) => React.ReactNode,
|
|
110
|
-
) => IntergalacticWizardStepperComponent<PropsExtending>;
|
|
111
|
-
export { wrapWizardStepper };
|
|
112
|
-
|
|
113
|
-
export default Wizard;
|
package/lib/cjs/index.d.js
DELETED
package/lib/cjs/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { ButtonProps } from '@semcore/button';\nimport type { UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { Box, BoxProps } from '@semcore/flex-box';\nimport type { ModalProps } from '@semcore/modal';\nimport type React from 'react';\n\nexport type WizardStep = string | number | boolean;\n\n/** @deprecated */\nexport interface IWizardProps extends WizardProps, UnknownProperties {}\nexport type WizardProps = ModalProps & {\n /**\n * Active step value\n */\n step: WizardStep;\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\n/** @deprecated */\nexport interface IWizardSidebarProps extends WizardSidebarProps, UnknownProperties {}\nexport type WizardSidebarProps = BoxProps & {\n /**\n * Sidebar title\n */\n title?: React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IWizardStepProps extends WizardStepProps, UnknownProperties {}\nexport type WizardStepProps = BoxProps & {\n /**\n * Step value\n */\n step: WizardStep;\n /**\n * Disabled step\n */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IWizardStepperProps extends WizardStepperProps, UnknownProperties {}\nexport type WizardStepperProps<T extends WizardStep = WizardStep> = BoxProps & {\n /**\n * Step value\n */\n step: T;\n /**\n * Is invoked when active the step\n */\n onActive?:\n | ((step: T, e: React.SyntheticEvent<HTMLElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /**\n * Stepper number\n * @default incremental value\n */\n number?: React.ReactNode;\n /**\n * Is the step completed\n */\n completed?: boolean;\n /** Disables interaction with the stepper */\n disabled?: boolean;\n};\n\nexport type WizardStepBackProps<T extends WizardStep = WizardStep> = ButtonProps & {\n /** Callback invoked when navigating to the previous step */\n onActive?:\n | ((step: T, e: React.SyntheticEvent<HTMLElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Step name being navigated to */\n stepName?: string;\n};\nexport type WizardStepNextProps<T extends WizardStep = WizardStep> = ButtonProps & {\n /** Callback invoked when navigating to the next step */\n onActive?:\n | ((step: T, e: React.SyntheticEvent<HTMLElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Step name being navigated to */\n stepName?: string;\n};\n\ntype IntergalacticWizardStepperComponent<PropsExtending = {}> = (<\n Value extends WizardStep,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', WizardStepperProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.InternalTypings.ComponentAdditive<'div', 'div', WizardStepperProps>;\n\ndeclare const Wizard: Intergalactic.Component<'div', WizardProps> & {\n Sidebar: Intergalactic.Component<'div', WizardSidebarProps>;\n Step: Intergalactic.Component<'div', WizardStepProps>;\n Stepper: IntergalacticWizardStepperComponent;\n Content: typeof Box;\n StepBack: Intergalactic.Component<'button', WizardStepBackProps>;\n StepNext: Intergalactic.Component<'button', WizardStepNextProps>;\n};\n\ndeclare const wrapWizardStepper: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticWizardStepperComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticWizardStepperComponent<PropsExtending>;\nexport { wrapWizardStepper };\n\nexport default Wizard;\n"],"mappings":"","ignoreList":[]}
|
package/lib/es6/index.d.js
DELETED
package/lib/es6/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { ButtonProps } from '@semcore/button';\nimport type { UnknownProperties, Intergalactic } from '@semcore/core';\nimport type { Box, BoxProps } from '@semcore/flex-box';\nimport type { ModalProps } from '@semcore/modal';\nimport type React from 'react';\n\nexport type WizardStep = string | number | boolean;\n\n/** @deprecated */\nexport interface IWizardProps extends WizardProps, UnknownProperties {}\nexport type WizardProps = ModalProps & {\n /**\n * Active step value\n */\n step: WizardStep;\n /** Specifies the locale for i18n support */\n locale?: string;\n};\n\n/** @deprecated */\nexport interface IWizardSidebarProps extends WizardSidebarProps, UnknownProperties {}\nexport type WizardSidebarProps = BoxProps & {\n /**\n * Sidebar title\n */\n title?: React.ReactNode;\n};\n\n/** @deprecated */\nexport interface IWizardStepProps extends WizardStepProps, UnknownProperties {}\nexport type WizardStepProps = BoxProps & {\n /**\n * Step value\n */\n step: WizardStep;\n /**\n * Disabled step\n */\n disabled?: boolean;\n};\n\n/** @deprecated */\nexport interface IWizardStepperProps extends WizardStepperProps, UnknownProperties {}\nexport type WizardStepperProps<T extends WizardStep = WizardStep> = BoxProps & {\n /**\n * Step value\n */\n step: T;\n /**\n * Is invoked when active the step\n */\n onActive?:\n | ((step: T, e: React.SyntheticEvent<HTMLElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /**\n * Stepper number\n * @default incremental value\n */\n number?: React.ReactNode;\n /**\n * Is the step completed\n */\n completed?: boolean;\n /** Disables interaction with the stepper */\n disabled?: boolean;\n};\n\nexport type WizardStepBackProps<T extends WizardStep = WizardStep> = ButtonProps & {\n /** Callback invoked when navigating to the previous step */\n onActive?:\n | ((step: T, e: React.SyntheticEvent<HTMLElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Step name being navigated to */\n stepName?: string;\n};\nexport type WizardStepNextProps<T extends WizardStep = WizardStep> = ButtonProps & {\n /** Callback invoked when navigating to the next step */\n onActive?:\n | ((step: T, e: React.SyntheticEvent<HTMLElement>) => void)\n | React.Dispatch<React.SetStateAction<T>>;\n /** Step name being navigated to */\n stepName?: string;\n};\n\ntype IntergalacticWizardStepperComponent<PropsExtending = {}> = (<\n Value extends WizardStep,\n Tag extends Intergalactic.Tag = 'div',\n>(\n props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', WizardStepperProps<Value>> &\n PropsExtending,\n) => Intergalactic.InternalTypings.ComponentRenderingResults) &\nIntergalactic.InternalTypings.ComponentAdditive<'div', 'div', WizardStepperProps>;\n\ndeclare const Wizard: Intergalactic.Component<'div', WizardProps> & {\n Sidebar: Intergalactic.Component<'div', WizardSidebarProps>;\n Step: Intergalactic.Component<'div', WizardStepProps>;\n Stepper: IntergalacticWizardStepperComponent;\n Content: typeof Box;\n StepBack: Intergalactic.Component<'button', WizardStepBackProps>;\n StepNext: Intergalactic.Component<'button', WizardStepNextProps>;\n};\n\ndeclare const wrapWizardStepper: <PropsExtending extends {}>(\n wrapper: (\n props: Intergalactic.InternalTypings.UntypeRefAndTag<\n Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticWizardStepperComponent>\n > &\n PropsExtending,\n ) => React.ReactNode,\n) => IntergalacticWizardStepperComponent<PropsExtending>;\nexport { wrapWizardStepper };\n\nexport default Wizard;\n"],"mappings":"","ignoreList":[]}
|