Skip to content

Commit

Permalink
refactor(storybook): use satisfies and enhance type inference in Alph…
Browse files Browse the repository at this point in the history
…aStack
  • Loading branch information
yangwooseong committed Oct 11, 2023
1 parent 6c17064 commit e5367af
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AlphaStack } from './AlphaStack'

const FLEX_PROPERTIES = ['start', 'center', 'end', 'stretch']

const meta: Meta<typeof AlphaStack> = {
const meta = {
component: AlphaStack,
argTypes: {
spacing: {
Expand All @@ -41,9 +41,12 @@ const meta: Meta<typeof AlphaStack> = {
options: FLEX_PROPERTIES,
},
},
}
} satisfies Meta<typeof AlphaStack>

export default meta

type Story = StoryObj<typeof meta>

const Template: StoryFn<typeof AlphaStack> = (args) => (
<AlphaStack {...args}>
<>
Expand All @@ -54,10 +57,11 @@ const Template: StoryFn<typeof AlphaStack> = (args) => (
</AlphaStack>
)

export const Primary: StoryObj<typeof AlphaStack> = {
export const Primary: Story = {
render: Template,

args: {
direction: 'vertical',
style: {
width: '200px',
height: '200px',
Expand Down

0 comments on commit e5367af

Please sign in to comment.