-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
design: Checkbox, RadioButton 스토리 작성 및 위치 이동
- Loading branch information
Showing
7 changed files
with
107 additions
and
20 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 { useEffect, useState } from 'react' | ||
import Checkbox from '.' | ||
|
||
const meta: Meta<typeof Checkbox> = { | ||
title: 'components/common/Checkbox', | ||
component: Checkbox, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
isChecked: { | ||
description: '체크 유무를 결정합니다.', | ||
}, | ||
text: { | ||
description: 'label에 표기할 텍스트를 입력합니다.', | ||
}, | ||
}, | ||
} | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof Checkbox> | ||
|
||
export const Default: Story = { | ||
render: (args) => { | ||
const [isChecked, setIsChecked] = useState(args.isChecked) | ||
|
||
useEffect(() => { | ||
setIsChecked(args.isChecked) | ||
}, [args.isChecked]) | ||
|
||
return ( | ||
<div className="text-onSurface-300"> | ||
<Checkbox | ||
{...args} | ||
isChecked={isChecked} | ||
onChange={() => setIsChecked(!isChecked)} | ||
/> | ||
</div> | ||
) | ||
}, | ||
args: { | ||
isChecked: false, | ||
text: 'checkbox', | ||
}, | ||
} |
12 changes: 4 additions & 8 deletions
12
...hared/CheckboxBottomSheet/OneCheckbox.tsx → src/components/common/Checkbox/index.tsx
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { useEffect, useState } from 'react' | ||
import RadioButton from '.' | ||
|
||
const meta: Meta<typeof RadioButton> = { | ||
title: 'components/common/RadioButton', | ||
component: RadioButton, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
id: { | ||
description: '각 RadioButton를 구분하는 value를 결정합니다.', | ||
}, | ||
isChecked: { | ||
description: '선택 유무를 결정합니다.', | ||
}, | ||
item: { | ||
description: 'label에 표기할 텍스트를 입력합니다.', | ||
}, | ||
}, | ||
} | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof RadioButton> | ||
|
||
export const Default: Story = { | ||
render: (args) => { | ||
const [isChecked, setIsChecked] = useState(args.isChecked) | ||
|
||
useEffect(() => { | ||
setIsChecked(args.isChecked) | ||
}, [args.isChecked]) | ||
|
||
return ( | ||
<div className="text-onSurface-300"> | ||
<RadioButton | ||
{...args} | ||
isChecked={isChecked} | ||
onChange={() => setIsChecked(!isChecked)} | ||
/> | ||
</div> | ||
) | ||
}, | ||
args: { | ||
isChecked: false, | ||
item: 'radioButton', | ||
}, | ||
} |
9 changes: 5 additions & 4 deletions
9
...hared/RadioBtnBottomSheet/OneRadioBtn.tsx → src/components/common/RadioButton/index.tsx
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
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