Skip to content

Commit 7975393

Browse files
committed
[wizard] fixed types
1 parent bacedd4 commit 7975393

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

semcore/wizard/src/Wizard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function Step(props: IRootComponentProps & WizardStepProps) {
212212
return null;
213213
}
214214

215-
function Stepper(props: WizardStepperProps & IRootComponentProps) {
215+
function Stepper(props: Required<WizardStepperProps> & IRootComponentProps) {
216216
const {
217217
Children,
218218
styles,
@@ -285,7 +285,7 @@ function Content(props: WizardContentProps & IRootComponentProps) {
285285
);
286286
}
287287

288-
function StepBack(props: WizardStepBackProps & IRootComponentProps) {
288+
function StepBack(props: Required<WizardStepBackProps> & IRootComponentProps) {
289289
const SStepBack = Root;
290290
const { Children, children: hasChildren, styles, getI18nText, stepName } = props;
291291
const handleClick = React.useCallback(() => {
@@ -306,7 +306,7 @@ function StepBack(props: WizardStepBackProps & IRootComponentProps) {
306306
</SStepBack>,
307307
);
308308
}
309-
function StepNext(props: WizardStepNextProps & IRootComponentProps) {
309+
function StepNext(props: Required<WizardStepNextProps> & IRootComponentProps) {
310310
const SStepNext = Root;
311311
const { Children, children: hasChildren, styles, getI18nText, stepName } = props;
312312
const handleClick = React.useCallback(() => {

semcore/wizard/src/Wizard.types.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type WizardSidebarProps = BoxProps & {
2929
/**
3030
* @internal html id attribute
3131
*/
32-
id: string;
32+
id?: string;
3333
};
3434

3535
/** @deprecated */
@@ -79,18 +79,18 @@ export type WizardStepperProps<T extends WizardStep = WizardStep> = BoxProps & {
7979
* Translation function
8080
* @internal
8181
*/
82-
getI18nText: ReturnType<typeof useI18n>;
82+
getI18nText?: ReturnType<typeof useI18n>;
8383

8484
/**
8585
* Go to nest step
8686
* @internal
8787
*/
88-
focusNext: () => void;
88+
focusNext?: () => void;
8989
/**
9090
* Go to prev step
9191
* @internal
9292
*/
93-
focusPrev: () => void;
93+
focusPrev?: () => void;
9494
};
9595

9696
export type WizardContentProps = BoxProps & {
@@ -109,12 +109,12 @@ export type WizardStepBackProps<T extends WizardStep = WizardStep> = ButtonProps
109109
* CurrentStep
110110
* @internal
111111
*/
112-
step: number;
112+
step?: number;
113113
/**
114114
* Translation function
115115
* @internal
116116
*/
117-
getI18nText: ReturnType<typeof useI18n>;
117+
getI18nText?: ReturnType<typeof useI18n>;
118118
};
119119
export type WizardStepNextProps<T extends WizardStep = WizardStep> = ButtonProps & {
120120
/** Callback invoked when navigating to the next step */
@@ -128,12 +128,12 @@ export type WizardStepNextProps<T extends WizardStep = WizardStep> = ButtonProps
128128
* CurrentStep
129129
* @internal
130130
*/
131-
step: number;
131+
step?: number;
132132
/**
133133
* Translation function
134134
* @internal
135135
*/
136-
getI18nText: ReturnType<typeof useI18n>;
136+
getI18nText?: ReturnType<typeof useI18n>;
137137
};
138138

139139
export type IntergalacticWizardStepperComponent<PropsExtending = {}> = (<

0 commit comments

Comments
 (0)