Skip to content

Commit

Permalink
Steps: export Steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ninariccimarie committed Nov 7, 2023
1 parent 7c2fe93 commit 0e868e6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/@next/Steps/Steps.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,41 @@ export const Interactive = Template.bind({});
Interactive.args = {
type: 'normal',
};

Interactive.parameters = {
docs: {
source: {
code: `
<>
<Steps {...args} currentStep={currentStep} errorSteps={errorSteps}>
<Steps.Step label="Label 1" />
<Steps.Step label="Label 2" />
<Steps.Step label="Label 3" />
<Steps.Step label="Label 4" />
<Steps.Step label="Label 5" />
</Steps>
<div style={{ margin: '16px 0 8px' }}>
Current Step: <b>{currentStep}</b>
</div>
<div style={{ margin: '8px 0' }}>
Error Steps: <b>[{errorSteps.join(', ')}]</b>
</div>
<ButtonGroup>
<Button onClick={handlePrevClick} data-testid="prev-button">
Prev
</Button>
<Button onClick={handleNextClick} data-testid="next-button">
Next
</Button>
<Button
onClick={() => handleSetError(currentStep)}
data-testid="error-button"
>
Toggle Error
</Button>
</ButtonGroup>
</>
`,
},
},
};
2 changes: 2 additions & 0 deletions src/@next/Steps/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export type { StepsProps } from './Steps';
export { Steps } from './Steps';
1 change: 1 addition & 0 deletions src/@next/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export {
} from './Skeleton';
export type { SpinnerProps } from './Spinner';
export { Spinner } from './Spinner';
export { Steps } from './Steps';
export type { TabModel, TabProps, TabsProps } from './Tabs';
export { Tab, Tabs } from './Tabs';
export type { TagProps } from './Tag';
Expand Down

0 comments on commit 0e868e6

Please sign in to comment.