@semcore/wizard 17.3.1 → 17.3.2-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,132 +1,183 @@
1
- import type { BoxProps } from '@semcore/base-components';
2
- import type { ButtonProps } from '@semcore/button';
1
+ import type { NSBox } from '@semcore/base-components';
2
+ import type { NSButton } from '@semcore/button';
3
3
  import type { Intergalactic } from '@semcore/core';
4
4
  import type { useI18n } from '@semcore/core/lib/utils/enhances/WithI18n';
5
5
  import type { NSModal } from '@semcore/modal';
6
- import type { Text, NSText } from '@semcore/typography';
6
+ import type { NSText } from '@semcore/typography';
7
7
  import type React from 'react';
8
- /** Ordered step position from 0 */
9
- export type WizardStep = number;
10
- export type WizardProps = NSModal.Props & {
11
- /**
12
- * Active step value
13
- */
14
- step: WizardStep;
15
- /** Specifies the locale for i18n support */
16
- locale?: string;
17
- };
18
- export type WizardSidebarProps = BoxProps & {
19
- /**
20
- * Sidebar title
21
- */
22
- title?: React.ReactNode;
23
- /**
24
- * @internal html id attribute
25
- */
26
- id?: string;
27
- };
28
- export type WizardStepProps = BoxProps & {
29
- /**
30
- * Ordered step position from 0
31
- */
32
- step: WizardStep;
33
- /**
34
- * Disabled step
35
- */
36
- disabled?: boolean;
37
- /**
38
- * Active flag
39
- * @internal
40
- */
41
- active?: boolean;
42
- };
43
- export type WizardStepperProps = BoxProps & {
44
- /**
45
- * Ordered step position from 0
46
- */
47
- step: WizardStep;
48
- /**
49
- * Is invoked when active the step
50
- */
51
- onActive?: ((step: WizardStep, e: React.SyntheticEvent<HTMLElement> | React.KeyboardEvent) => void) | React.Dispatch<React.SetStateAction<WizardStep>>;
52
- /**
53
- * Stepper number
54
- * @default incremental value
55
- */
56
- number?: React.ReactNode;
57
- /**
58
- * Is the step completed
59
- */
60
- completed?: boolean;
61
- /** Disables interaction with the stepper */
62
- disabled?: boolean;
63
- /**
64
- * Translation function
65
- * @internal
66
- */
67
- getI18nText?: ReturnType<typeof useI18n>;
68
- /**
69
- * Go to next step
70
- * @internal
71
- */
72
- focusNext?: () => void;
73
- /**
74
- * Go to prev step
75
- * @internal
76
- */
77
- focusPrev?: () => void;
78
- };
79
- export type WizardContentProps = BoxProps & {
80
- /**
81
- * Renders wizard content container with border-radius on the left side
82
- */
83
- noSidebar?: boolean;
84
- };
85
- export type WizardStepBackProps = ButtonProps & {
86
- /** Callback invoked when navigating to the previous step */
87
- onActive?: ((step: WizardStep, e?: React.SyntheticEvent<HTMLElement>) => void) | React.Dispatch<React.SetStateAction<WizardStep>>;
88
- /** Step name being navigated to */
89
- stepName?: string;
90
- /**
91
- * CurrentStep
92
- * @internal
93
- */
94
- step?: WizardStep;
95
- /**
96
- * Translation function
97
- * @internal
98
- */
99
- getI18nText?: ReturnType<typeof useI18n>;
100
- };
101
- export type WizardStepNextProps = ButtonProps & {
102
- /** Callback invoked when navigating to the next step */
103
- onActive?: ((step: WizardStep, e?: React.SyntheticEvent<HTMLElement>) => void) | React.Dispatch<React.SetStateAction<WizardStep>>;
104
- /** Step name being navigated to */
105
- stepName?: string;
106
- /**
107
- * CurrentStep
108
- * @internal
109
- */
110
- step?: WizardStep;
111
- /**
112
- * Translation function
113
- * @internal
114
- */
115
- getI18nText?: ReturnType<typeof useI18n>;
116
- };
117
- export type WizardDefaultProps = {
118
- step: WizardStep;
119
- i18n: Record<string, any>;
120
- locale: 'en';
121
- };
122
- export type WizardStepTitleProps = NSText.Props;
123
- export type IntergalacticWizardStepperComponent<PropsExtending = {}> = (<Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', WizardStepperProps> & PropsExtending) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', WizardStepperProps>;
124
- export type WizardType = Intergalactic.Component<'div', WizardProps> & {
125
- Sidebar: Intergalactic.Component<'div', WizardSidebarProps>;
126
- Step: Intergalactic.Component<'div', WizardStepProps>;
127
- StepTitle: typeof Text;
128
- Stepper: IntergalacticWizardStepperComponent;
129
- Content: Intergalactic.Component<'div', WizardContentProps>;
130
- StepBack: Intergalactic.Component<'button', WizardStepBackProps>;
131
- StepNext: Intergalactic.Component<'button', WizardStepNextProps>;
132
- };
8
+ declare namespace NSWizard {
9
+ /** Ordered step position from 0 */
10
+ type Step = number;
11
+ type Props = NSModal.Props & {
12
+ /**
13
+ * Active step value
14
+ */
15
+ step: NSWizard.Step;
16
+ /** Specifies the locale for i18n support */
17
+ locale?: string;
18
+ };
19
+ type DefaultProps = {
20
+ step: NSWizard.Step;
21
+ i18n: Record<string, any>;
22
+ locale: 'en';
23
+ };
24
+ type State = {
25
+ highlighted: number;
26
+ };
27
+ namespace Sidebar {
28
+ type Props = NSBox.Props & {
29
+ /**
30
+ * Sidebar title
31
+ */
32
+ title?: React.ReactNode;
33
+ /**
34
+ * @internal html id attribute
35
+ */
36
+ id?: string;
37
+ };
38
+ type Component = Intergalactic.Component<'div', Props>;
39
+ }
40
+ namespace Step {
41
+ type Props = NSBox.Props & {
42
+ /**
43
+ * Ordered step position from 0
44
+ */
45
+ step: NSWizard.Step;
46
+ /**
47
+ * Disabled step
48
+ */
49
+ disabled?: boolean;
50
+ /**
51
+ * Active flag
52
+ * @internal
53
+ */
54
+ active?: boolean;
55
+ };
56
+ type Component = Intergalactic.Component<'div', Props>;
57
+ }
58
+ namespace StepTitle {
59
+ type Props = NSText.Props;
60
+ type Component = NSText.Component;
61
+ }
62
+ namespace Stepper {
63
+ type Props = NSBox.Props & {
64
+ /**
65
+ * Ordered step position from 0
66
+ */
67
+ step: NSWizard.Step;
68
+ /**
69
+ * Is invoked when active the step
70
+ */
71
+ onActive?: ((step: NSWizard.Step, e: React.SyntheticEvent<HTMLElement> | React.KeyboardEvent) => void) | React.Dispatch<React.SetStateAction<NSWizard.Step>>;
72
+ /**
73
+ * Stepper number
74
+ * @default incremental value
75
+ */
76
+ number?: React.ReactNode;
77
+ /**
78
+ * Is the step completed
79
+ */
80
+ completed?: boolean;
81
+ /** Disables interaction with the stepper */
82
+ disabled?: boolean;
83
+ /**
84
+ * Translation function
85
+ * @internal
86
+ */
87
+ getI18nText?: ReturnType<typeof useI18n>;
88
+ /**
89
+ * Go to next step
90
+ * @internal
91
+ */
92
+ focusNext?: () => void;
93
+ /**
94
+ * Go to prev step
95
+ * @internal
96
+ */
97
+ focusPrev?: () => void;
98
+ };
99
+ type Component<PropsExtending = {}> = (<Tag extends Intergalactic.Tag = 'div'>(props: Intergalactic.InternalTypings.ComponentProps<Tag, 'div', Props> & PropsExtending) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<'div', 'div', Props>;
100
+ }
101
+ namespace Content {
102
+ type Props = NSBox.Props & {
103
+ /**
104
+ * Renders wizard content container with border-radius on the left side
105
+ */
106
+ noSidebar?: boolean;
107
+ };
108
+ type Component = Intergalactic.Component<'div', Props>;
109
+ }
110
+ namespace StepBack {
111
+ type Props = NSButton.Props & {
112
+ /** Callback invoked when navigating to the previous step */
113
+ onActive?: ((step: NSWizard.Step, e?: React.SyntheticEvent<HTMLElement>) => void) | React.Dispatch<React.SetStateAction<NSWizard.Step>>;
114
+ /** Step name being navigated to */
115
+ stepName?: string;
116
+ /**
117
+ * CurrentStep
118
+ * @internal
119
+ */
120
+ step?: NSWizard.Step;
121
+ /**
122
+ * Translation function
123
+ * @internal
124
+ */
125
+ getI18nText?: ReturnType<typeof useI18n>;
126
+ };
127
+ type Component = Intergalactic.Component<'button', Props>;
128
+ }
129
+ namespace StepNext {
130
+ type Props = NSButton.Props & {
131
+ /** Callback invoked when navigating to the next step */
132
+ onActive?: ((step: NSWizard.Step, e?: React.SyntheticEvent<HTMLElement>) => void) | React.Dispatch<React.SetStateAction<NSWizard.Step>>;
133
+ /** Step name being navigated to */
134
+ stepName?: string;
135
+ /**
136
+ * CurrentStep
137
+ * @internal
138
+ */
139
+ step?: NSWizard.Step;
140
+ /**
141
+ * Translation function
142
+ * @internal
143
+ */
144
+ getI18nText?: ReturnType<typeof useI18n>;
145
+ };
146
+ type Component = Intergalactic.Component<'button', Props>;
147
+ }
148
+ type Component = Intergalactic.Component<'div', Props> & {
149
+ Sidebar: Sidebar.Component;
150
+ Step: Step.Component;
151
+ StepTitle: StepTitle.Component;
152
+ Stepper: Stepper.Component;
153
+ Content: Content.Component;
154
+ StepBack: StepBack.Component;
155
+ StepNext: StepNext.Component;
156
+ };
157
+ }
158
+ /** @deprecated It will be removed in v19. */
159
+ export type WizardStep = NSWizard.Step;
160
+ /** @deprecated It will be removed in v19. */
161
+ export type WizardProps = NSWizard.Props;
162
+ /** @deprecated It will be removed in v19. */
163
+ export type WizardSidebarProps = NSWizard.Sidebar.Props;
164
+ /** @deprecated It will be removed in v19. */
165
+ export type WizardStepProps = NSWizard.Step.Props;
166
+ /** @deprecated It will be removed in v19. */
167
+ export type WizardStepperProps = NSWizard.Stepper.Props;
168
+ /** @deprecated It will be removed in v19. */
169
+ export type WizardContentProps = NSWizard.Content.Props;
170
+ /** @deprecated It will be removed in v19. */
171
+ export type WizardStepBackProps = NSWizard.StepBack.Props;
172
+ /** @deprecated It will be removed in v19. */
173
+ export type WizardStepNextProps = NSWizard.StepNext.Props;
174
+ /** @deprecated It will be removed in v19. */
175
+ export type WizardDefaultProps = NSWizard.DefaultProps;
176
+ /** @deprecated It will be removed in v19. */
177
+ export type WizardStepTitleProps = NSWizard.StepTitle.Props;
178
+ /** @deprecated It will be removed in v19. */
179
+ export type IntergalacticWizardStepperComponent<PropsExtending = {}> = NSWizard.Stepper.Component<PropsExtending>;
180
+ /** @deprecated It will be removed in v19. */
181
+ export type WizardType = NSWizard.Component;
182
+ export type { NSWizard };
183
+ //# sourceMappingURL=Wizard.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Wizard.types.d.ts","sourceRoot":"","sources":["../../src/Wizard.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B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,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;AACxD,6CAA6C;AAC7C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC1D,6CAA6C;AAC7C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC1D,6CAA6C;AAC7C,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,YAAY,CAAC;AAEvD,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC;AAC5D,6CAA6C;AAC7C,MAAM,MAAM,mCAAmC,CAAC,cAAc,GAAG,EAAE,IAAI,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;AAClH,6CAA6C;AAC7C,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC;AAE5C,YAAY,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { default } from './Wizard';
2
2
  export * from './Wizard';
3
3
  export type * from './Wizard.types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,cAAc,UAAU,CAAC;AAEzB,mBAAmB,gBAAgB,CAAC"}
@@ -70,3 +70,4 @@ export declare const localizedMessages: {
70
70
  nextButton: string;
71
71
  };
72
72
  };
73
+ //# sourceMappingURL=__intergalactic-dynamic-locales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__intergalactic-dynamic-locales.d.ts","sourceRoot":"","sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe7B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/wizard",
3
3
  "description": "Semrush Wizard Component",
4
- "version": "17.3.1",
4
+ "version": "17.3.2-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,12 +14,12 @@
14
14
  "require": "./lib/cjs/index.js"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/button": "^17.2.1",
18
- "@semcore/modal": "^17.2.2",
19
- "@semcore/typography": "^17.2.1"
17
+ "@semcore/button": "^17.2.2-prerelease.0",
18
+ "@semcore/modal": "^17.2.2-prerelease.0",
19
+ "@semcore/typography": "^17.2.1-prerelease.0"
20
20
  },
21
21
  "peerDependencies": {
22
- "@semcore/base-components": "^17.2.1",
22
+ "@semcore/base-components": "^17.2.2",
23
23
  "@semcore/icon": "^17.2.0"
24
24
  },
25
25
  "repository": {
@@ -28,8 +28,8 @@
28
28
  "directory": "semcore/wizard"
29
29
  },
30
30
  "devDependencies": {
31
- "@semcore/core": "17.2.1",
32
- "@semcore/base-components": "17.2.1",
31
+ "@semcore/core": "17.3.1-prerelease.0",
32
+ "@semcore/base-components": "17.2.2-prerelease.0",
33
33
  "@semcore/testing-utils": "1.0.0",
34
34
  "@semcore/icon": "17.2.0"
35
35
  },
package/src/Wizard.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ScreenReaderOnly, Box } from '@semcore/base-components';
2
2
  import Button from '@semcore/button';
3
3
  import { createComponent, Component, Root, sstyled } from '@semcore/core';
4
- import type { IRootComponentProps, Intergalactic } from '@semcore/core';
4
+ import type { Intergalactic } from '@semcore/core';
5
5
  import type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';
6
6
  import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
7
7
  import findComponent from '@semcore/core/lib/utils/findComponent';
@@ -16,31 +16,19 @@ import React from 'react';
16
16
 
17
17
  import style from './style/wizard.shadow.css';
18
18
  import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
19
- import type {
20
- WizardStep,
21
- WizardProps,
22
- WizardStepProps,
23
- WizardStepperProps,
24
- WizardSidebarProps,
25
- WizardContentProps,
26
- IntergalacticWizardStepperComponent,
27
- WizardType,
28
- WizardStepBackProps,
29
- WizardStepNextProps,
30
- WizardDefaultProps,
31
- } from './Wizard.types';
19
+ import type { NSWizard } from './Wizard.types';
32
20
 
33
21
  type State = {
34
22
  highlighted: number;
35
23
  };
36
24
 
37
25
  class WizardRoot extends Component<
38
- WizardProps,
26
+ Intergalactic.InternalTypings.InferComponentProps<NSWizard.Component>,
39
27
  typeof WizardRoot.enhance,
40
28
  {},
41
29
  WithI18nEnhanceProps,
42
- State,
43
- WizardDefaultProps
30
+ NSWizard.State,
31
+ NSWizard.DefaultProps
44
32
  > {
45
33
  static displayName = 'Wizard';
46
34
  static style = style;
@@ -61,7 +49,7 @@ class WizardRoot extends Component<
61
49
  highlighted: this.props.step,
62
50
  };
63
51
 
64
- getStepId(step: WizardStep): string {
52
+ getStepId(step: NSWizard.Step): string {
65
53
  return `${this.asProps.uid}-step-${step}`;
66
54
  }
67
55
 
@@ -69,19 +57,19 @@ class WizardRoot extends Component<
69
57
  return `${this.asProps.uid}-title`;
70
58
  }
71
59
 
72
- getStepperId(step: WizardStep): string {
60
+ getStepperId(step: NSWizard.Step): string {
73
61
  const { uid } = this.asProps;
74
62
 
75
63
  return `${uid}-stepper-${step}`;
76
64
  }
77
65
 
78
- getContentId(step: WizardStep): string {
66
+ getContentId(step: NSWizard.Step): string {
79
67
  const { uid } = this.asProps;
80
68
 
81
69
  return `${uid}-content-${step}`;
82
70
  }
83
71
 
84
- getStepProps(props: WizardStepProps) {
72
+ getStepProps(props: NSWizard.Step.Props) {
85
73
  return {
86
74
  steps: this._steps,
87
75
  active: props.step === this.asProps.step,
@@ -148,7 +136,7 @@ class WizardRoot extends Component<
148
136
  }, 0);
149
137
  };
150
138
 
151
- getStepperProps(props: WizardStepperProps, i: number) {
139
+ getStepperProps(props: NSWizard.Stepper.Props, i: number) {
152
140
  let number = i + 1;
153
141
  if (this._steps.has(props.step)) {
154
142
  const step = this._steps.get(props.step);
@@ -178,7 +166,7 @@ class WizardRoot extends Component<
178
166
  };
179
167
  }
180
168
 
181
- componentDidUpdate(prevProps: WizardProps) {
169
+ componentDidUpdate(prevProps: typeof this.asProps) {
182
170
  if (prevProps.step === this.asProps.step) return;
183
171
 
184
172
  this.setState({ highlighted: this.asProps.step });
@@ -209,7 +197,9 @@ class WizardRoot extends Component<
209
197
  }
210
198
  }
211
199
 
212
- function Sidebar(props: WizardSidebarProps & IRootComponentProps) {
200
+ function Sidebar(
201
+ props: Intergalactic.InternalTypings.InferChildComponentProps<NSWizard.Sidebar.Component, typeof WizardRoot, 'Sidebar'>,
202
+ ) {
213
203
  const { Children, styles, title, id } = props;
214
204
  const SSidebar = Root;
215
205
  const SSidebarHeader = 'h2';
@@ -225,7 +215,9 @@ function Sidebar(props: WizardSidebarProps & IRootComponentProps) {
225
215
  );
226
216
  }
227
217
 
228
- function Step(props: IRootComponentProps & WizardStepProps) {
218
+ function Step(
219
+ props: Intergalactic.InternalTypings.InferChildComponentProps<NSWizard.Step.Component, typeof WizardRoot, 'Step'>,
220
+ ) {
229
221
  const SStep = Root;
230
222
  const { Children, styles, active } = props;
231
223
  if (active) {
@@ -238,7 +230,9 @@ function Step(props: IRootComponentProps & WizardStepProps) {
238
230
  return null;
239
231
  }
240
232
 
241
- function Stepper(props: Required<WizardStepperProps> & IRootComponentProps) {
233
+ function Stepper(
234
+ props: Intergalactic.InternalTypings.InferChildComponentProps<NSWizard.Stepper.Component, typeof WizardRoot, 'Stepper'>,
235
+ ) {
242
236
  const {
243
237
  Children,
244
238
  styles,
@@ -299,7 +293,7 @@ function Stepper(props: Required<WizardStepperProps> & IRootComponentProps) {
299
293
  );
300
294
  }
301
295
 
302
- function Content(props: WizardContentProps & IRootComponentProps) {
296
+ function Content(props: Intergalactic.InternalTypings.InferChildComponentProps<NSWizard.Content.Component, typeof WizardRoot, 'Content'>) {
303
297
  const { Children, styles } = props;
304
298
  const SContent = Root;
305
299
  return sstyled(styles)(
@@ -312,7 +306,9 @@ function Content(props: WizardContentProps & IRootComponentProps) {
312
306
  );
313
307
  }
314
308
 
315
- function StepBack(props: Required<WizardStepBackProps> & IRootComponentProps) {
309
+ function StepBack(
310
+ props: Intergalactic.InternalTypings.InferChildComponentProps<NSWizard.StepBack.Component, typeof WizardRoot, 'StepBack'>,
311
+ ) {
316
312
  const SStepBack = Root;
317
313
  const { Children, children: hasChildren, styles, getI18nText, stepName } = props;
318
314
  const handleClick = React.useCallback(() => {
@@ -333,7 +329,9 @@ function StepBack(props: Required<WizardStepBackProps> & IRootComponentProps) {
333
329
  </SStepBack>,
334
330
  );
335
331
  }
336
- function StepNext(props: Required<WizardStepNextProps> & IRootComponentProps) {
332
+ function StepNext(
333
+ props: Intergalactic.InternalTypings.InferChildComponentProps<NSWizard.StepNext.Component, typeof WizardRoot, 'StepNext'>,
334
+ ) {
337
335
  const SStepNext = Root;
338
336
  const { Children, children: hasChildren, styles, getI18nText, stepName } = props;
339
337
  const handleClick = React.useCallback(() => {
@@ -355,7 +353,9 @@ function StepNext(props: Required<WizardStepNextProps> & IRootComponentProps) {
355
353
  );
356
354
  }
357
355
 
358
- function StepTitle(props: Intergalactic.InternalTypings.InferChildComponentProps<WizardType, typeof WizardRoot, 'StepTitle'>) {
356
+ function StepTitle(
357
+ props: Intergalactic.InternalTypings.InferChildComponentProps<NSWizard.StepTitle.Component, typeof WizardRoot, 'StepTitle'>,
358
+ ) {
359
359
  const SWizardStepTitle = Root;
360
360
  const { styles } = props;
361
361
 
@@ -370,7 +370,7 @@ function StepTitle(props: Intergalactic.InternalTypings.InferChildComponentProps
370
370
  * {@link https://developer.semrush.com/intergalactic/components/wizard/wizard-api/|API} | {@link https://developer.semrush.com/intergalactic/components/wizard/wizard-code/|Examples}
371
371
  */
372
372
  const Wizard = createComponent<
373
- WizardType,
373
+ NSWizard.Component,
374
374
  typeof WizardRoot
375
375
  >(WizardRoot, {
376
376
  Sidebar,
@@ -385,10 +385,10 @@ const Wizard = createComponent<
385
385
  export const wrapWizardStepper = <PropsExtending extends {}>(
386
386
  wrapper: (
387
387
  props: Intergalactic.InternalTypings.UntypeRefAndTag<
388
- Intergalactic.InternalTypings.ComponentPropsNesting<IntergalacticWizardStepperComponent>
388
+ Intergalactic.InternalTypings.ComponentPropsNesting<NSWizard.Stepper.Component>
389
389
  > &
390
390
  PropsExtending,
391
391
  ) => React.ReactNode,
392
- ) => wrapper as IntergalacticWizardStepperComponent<PropsExtending>;
392
+ ) => wrapper as NSWizard.Stepper.Component<PropsExtending>;
393
393
 
394
394
  export default Wizard;