import { Meta, StoryObj } from '@storybook/react-webpack5';
import { fn } from 'storybook/test';
import {
createSandboxStory,
globalScope,
} from '../../../.storybook/components/sandbox/SandboxEditor';
import Stepper from '../Stepper';
const STEPS = [
{
label: 'One',
onClick: fn(),
},
{
label: 'Two',
hoverLabel: (
<>
Diana Jaramillo
dianajarm123@gmail.com
>
),
onClick: fn(),
},
{ label: 'Recipient', onClick: fn() },
{ label: 'Smellification', onClick: fn() },
{ label: 'Battle', onClick: fn() },
];
export default {
component: Stepper,
title: 'Navigation/Stepper',
argTypes: {
activeStep: {
control: 'radio',
options: [...Array(STEPS.length).keys()],
},
},
} satisfies Meta;
type Story = StoryObj;
export const Sandbox = createSandboxStory({
code: `const App = () => {
const [activeStep, setActiveStep] = React.useState(1);
return (
setActiveStep(0) },
{
label: 'You',
hoverLabel: (
<>
Diana Jaramillo
dianajarm123@gmail.com
>
),
onClick: () => setActiveStep(1),
},
{ label: 'Recipient', onClick: () => setActiveStep(2) },
{ label: 'Review', onClick: () => setActiveStep(3) },
{ label: 'Pay', onClick: () => setActiveStep(4) },
]}
/>
);
};`,
scope: globalScope,
});
export const Basic: Story = {
render: ({ activeStep, steps }) => {
return ;
},
args: {
activeStep: 2,
steps: STEPS,
},
};