diff --git a/src/components/SpinButton/SpinButton.stories.tsx b/src/components/SpinButton/SpinButton.stories.tsx index 79f292ab..4231e0be 100644 --- a/src/components/SpinButton/SpinButton.stories.tsx +++ b/src/components/SpinButton/SpinButton.stories.tsx @@ -1,26 +1,23 @@ -import React, { useState } from 'react'; -import { ComponentStory, ComponentMeta } from '@storybook/react'; +import React from 'react'; +import { StoryObj, StoryFn, Meta } from '@storybook/react'; import { SpinButton } from './SpinButton'; import { Box } from '../Box'; import { TextField } from '../TextField'; -export default { - title: 'Components/SpinButton', +const meta: Meta = { component: SpinButton, argTypes: { onClick: { action: 'clicked' }, }, -} as ComponentMeta; - -const Template: ComponentStory = (args) => ( - -); +}; +export default meta; +type Story = StoryObj; -export const Default = Template.bind({}); +export const Default: Story = {}; -export const KeyboardSupport = () => { - const [valueNow, setValueNow] = useState(0); +export const KeyboardSupport: StoryFn = () => { + const [valueNow, setValueNow] = React.useState(0); return ( = { component: Stepper, - argTypes: {}, - subcomponents: { Step }, -} as ComponentMeta; + argTypes: { + height: { + control: { type: 'number' }, + }, + width: { + control: { type: 'number' }, + }, + margin: { + control: { type: 'number' }, + }, + marginTop: { + control: { type: 'number' }, + }, + marginBottom: { + control: { type: 'number' }, + }, + marginLeft: { + control: { type: 'number' }, + }, + marginRight: { + control: { type: 'number' }, + }, + marginX: { + control: { type: 'number' }, + }, + marginY: { + control: { type: 'number' }, + }, + padding: { + control: { type: 'number' }, + }, + paddingTop: { + control: { type: 'number' }, + }, + paddingBottom: { + control: { type: 'number' }, + }, + paddingLeft: { + control: { type: 'number' }, + }, + paddingRight: { + control: { type: 'number' }, + }, + paddingX: { + control: { type: 'number' }, + }, + paddingY: { + control: { type: 'number' }, + }, + }, +}; +export default meta; +type Story = StoryObj; -const Template: ComponentStory = (args) => ( +const Template: StoryFn = (args) => ( @@ -25,7 +74,9 @@ const Template: ComponentStory = (args) => ( ); -export const Default = Template.bind({}); -Default.args = { - activeStep: 1, +export const Default: Story = { + render: Template, + args: { + activeStep: 1, + }, };