Skip to content

Commit

Permalink
test: TextField storybook 제작 #37
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook committed Jan 5, 2024
1 parent 2153db9 commit 5fd877d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/components/shared/text-field/TextField.stories.tsx
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,
},
};

0 comments on commit 5fd877d

Please sign in to comment.