-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2153db9
commit 5fd877d
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import TextField from './TextField'; | ||
|
||
const meta = { | ||
title: 'Shared/TextField', | ||
component: TextField, | ||
parameters: { | ||
}, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
label: { control: 'text' }, | ||
hasError: { control: 'boolean' }, | ||
helpMessage: { control: 'text' }, | ||
required: { control: 'boolean' }, | ||
}, | ||
} satisfies Meta<typeof TextField>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const normal: Story = { | ||
args: { | ||
label: '아이디', | ||
hasError: false, | ||
helpMessage: '중복된 아이디입니다.', | ||
required: false, | ||
}, | ||
}; | ||
export const required: Story = { | ||
args: { | ||
label: '아이디', | ||
hasError: false, | ||
helpMessage: '중복된 아이디입니다.', | ||
required: true, | ||
}, | ||
}; | ||
export const error: Story = { | ||
args: { | ||
label: '아이디', | ||
hasError: true, | ||
helpMessage: '중복된 아이디입니다.', | ||
required: true, | ||
}, | ||
}; |