-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
4 changed files
with
74 additions
and
400 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
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 |
---|---|---|
@@ -1,79 +1,44 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import { useState } from 'react'; | ||
import CheckBox from 'ui/CheckBox'; | ||
|
||
const meta = { | ||
title: 'Components/CheckBox', | ||
component: CheckBox, | ||
parameters: { | ||
layout: 'centered', | ||
backgrounds: { | ||
default: 'dark', // 기본 배경을 'dark'로 설정 | ||
values: [ | ||
{ name: 'dark', value: "#0F1012" }, // 'dark' 배경의 색상을 검정색으로 지정 | ||
{ name: 'white', value: '#ffffff' }, | ||
], | ||
}, | ||
}, | ||
tags: ['autodocs'], | ||
} as Meta<typeof CheckBox>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Basic: Story = { | ||
render: function Render() { | ||
const [checked, onChange] = useState<boolean>(false); | ||
|
||
return <CheckBox checked={checked} size="small" onChange={(e) => onChange(e.target.checked)} />; | ||
export const Default: Story = { | ||
args: { | ||
checked: true, | ||
size: 'small', | ||
}, | ||
|
||
name: '체크박스 기본', | ||
}; | ||
|
||
export const LargeLabel: StoryObj = { | ||
render: function Render() { | ||
const [checked, onChange] = useState<boolean>(false); | ||
|
||
return ( | ||
<CheckBox | ||
checked={checked} | ||
size="large" | ||
label="Label" | ||
onChange={(e) => onChange(e.target.checked)} | ||
/> | ||
); | ||
}, | ||
|
||
name: '체크박스 설명 있는 큰 사이즈', | ||
parameters: { | ||
layout: 'centered', | ||
backgrounds: { | ||
default: 'dark', // 기본 배경을 'dark'로 설정 | ||
values: [ | ||
{ name: 'dark', value: '#2c2c2c' }, // 'dark' 배경의 색상을 검정색으로 지정 | ||
{ name: 'white', value: '#ffffff' }, | ||
], | ||
}, | ||
args: { | ||
checked: false, | ||
size: 'large', | ||
label: 'Label' | ||
}, | ||
}; | ||
|
||
export const SmallLabel: StoryObj = { | ||
render: function Render() { | ||
const [checked, onChange] = useState<boolean>(false); | ||
|
||
return ( | ||
<CheckBox | ||
checked={checked} | ||
size="small" | ||
label="Label" | ||
onChange={(e) => onChange(e.target.checked)} | ||
/> | ||
); | ||
}, | ||
|
||
name: '체크박스 설명 있는 작은 사이즈', | ||
parameters: { | ||
layout: 'centered', | ||
backgrounds: { | ||
default: 'dark', // 기본 배경을 'dark'로 설정 | ||
values: [ | ||
{ name: 'dark', value: '#2c2c2c' }, // 'dark' 배경의 색상을 검정색으로 지정 | ||
{ name: 'white', value: '#ffffff' }, | ||
], | ||
}, | ||
args: { | ||
checked: false, | ||
size: 'small', | ||
label: 'Label' | ||
}, | ||
}; |
Oops, something went wrong.