Skip to content

Commit 01f43ba

Browse files
committed
update provider props
1 parent 6d45f0e commit 01f43ba

File tree

2 files changed

+24
-37
lines changed

2 files changed

+24
-37
lines changed

packages/wizard/src/WizardContext/WizardContext.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ export const WizardContext = createContext<WizardContextData>({
1919
updateStep: () => {},
2020
});
2121

22+
interface WizardProviderProps
23+
extends PropsWithChildren<Omit<WizardContextData, 'isWizardContext'>> {}
24+
2225
export const WizardProvider = ({
2326
children,
2427
activeStep,
2528
updateStep,
26-
}: PropsWithChildren<Omit<WizardContextData, 'isWizardContext'>>) => {
29+
}: WizardProviderProps) => {
2730
return (
2831
<WizardContext.Provider
2932
value={{
Lines changed: 20 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react';
2-
import { storybookArgTypes, StoryMetaType } from '@lg-tools/storybook-utils';
2+
import { StoryMetaType } from '@lg-tools/storybook-utils';
33
import { StoryObj } from '@storybook/react';
44

5-
import { Body } from '@leafygreen-ui/typography';
5+
import { Body, Description, H3 } from '@leafygreen-ui/typography';
66

77
import { WizardProvider } from '../WizardContext';
88

9-
import { WizardStep } from '.';
9+
import { WizardStep, WizardStepProps } from '.';
1010

1111
const meta: StoryMetaType<typeof WizardStep> = {
1212
title: 'Composition/Wizard/WizardStep',
@@ -21,16 +21,16 @@ const meta: StoryMetaType<typeof WizardStep> = {
2121
</WizardProvider>
2222
),
2323
],
24-
argTypes: {
25-
title: storybookArgTypes.children,
26-
description: storybookArgTypes.children,
27-
children: storybookArgTypes.children,
28-
},
2924
};
3025

3126
export default meta;
3227

33-
export const LiveExample: StoryObj<typeof WizardStep> = {
28+
interface WizardStepStoryProps extends WizardStepProps {
29+
title: string;
30+
description: string;
31+
}
32+
33+
export const LiveExample: StoryObj<WizardStepStoryProps> = {
3434
args: {
3535
title: 'Step 1: Basic Information',
3636
description: 'Please provide your basic information to get started.',
@@ -43,32 +43,16 @@ export const LiveExample: StoryObj<typeof WizardStep> = {
4343
</div>
4444
),
4545
},
46-
render: args => <WizardStep {...args} />,
47-
};
48-
49-
export const WithLongDescription: StoryObj<typeof WizardStep> = {
50-
args: {
51-
title: 'Step 2: Detailed Configuration',
52-
description: (
53-
<div>
54-
<Body>
55-
This step involves more complex configuration options. Please read
56-
carefully before proceeding.
57-
</Body>
58-
<Body>
59-
<ul>
60-
<li>Configure your primary settings</li>
61-
<li>Set up your preferences</li>
62-
<li>Review the terms and conditions</li>
63-
</ul>
64-
</Body>
65-
</div>
66-
),
67-
children: (
68-
<div>
69-
<Body>Complex form content would go here...</Body>
70-
<button type="button">Sample Button</button>
71-
</div>
72-
),
46+
argTypes: {
47+
title: { control: 'text' },
48+
description: { control: 'text' },
49+
children: { control: 'text' },
7350
},
51+
render: args => (
52+
<WizardStep>
53+
<H3>{args.title}</H3>
54+
<Description>{args.description}</Description>
55+
<Body>{args.children}</Body>
56+
</WizardStep>
57+
),
7458
};

0 commit comments

Comments
 (0)