import Checkbox from '@/lib/components/Checkbox'; import { appearanceOptions, commonArgTypes, radiusOptions, scalingOptions, sizeOptions } from '@/lib/constants'; import type { Meta } from '@storybook/vue3'; const meta = { title: 'Select Component/Checkbox', component: Checkbox, parameters: { layout: 'centered', docs: { description: { component: '옵션을 끄거나 켤 수 있는 입력 요소로 선택지 중 다중 선택할 수 있는 기능' } } }, argTypes: { scaling: { ...commonArgTypes.scaling, description: '체크박스 비율' }, size: { ...commonArgTypes.size, table: { category: 'Props', type: { summary: sizeOptions .filter((option) => option !== 'x-small' && option !== 'x-large') .join(' | ') } }, options: sizeOptions.filter((option) => option !== 'x-small' && option !== 'x-large'), description: '체크박스 크기' }, radius: { ...commonArgTypes.radius, description: '체크박스 둥글기' }, color: { ...commonArgTypes.color, description: '체크박스 메인 색' }, appearance: { ...commonArgTypes.appearance, description: '체크박스 스타일', table: { category: 'Props', type: { summary: appearanceOptions .filter((option) => option !== 'ghost' && option !== 'outline' && option !== 'solid') .join(' | ') } }, options: appearanceOptions.filter( (option) => option !== 'ghost' && option !== 'outline' && option !== 'solid' ) }, disabled: { description: '체크박스 disabled 기본 속성', defaultValue: { summary: 'false' }, table: { category: 'Props', type: { summary: 'boolean' } }, control: { type: 'boolean' } }, checked: { table: { disable: true } }, defaultChecked: { table: { disable: true } }, indeterminate: { table: { disable: true } } }, args: {} } as Meta; export default meta; export const Default = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args }; }, template: `체크박스` }) }; export const Indeterminate = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args }; }, template: `indeterminateCheckbox` }), parameters: { docs: { source: { code: ` ` } } } }; export const Disabled = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args }; }, template: `
disabledChecked disabledUnChecked
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Checked = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args }; }, template: `
checked unchecked
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Color = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args, colorOptions: ['yellow', 'blue', 'violet', 'ruby'] }; }, template: `
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Radius = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args, radiusOptions }; }, template: `
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Scaling = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args, scalingOptions }; }, template: `
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Appearance = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args, appearanceOptions: ['surface', 'classic', 'soft'] }; }, template: `
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Size = { render: (args: any) => ({ components: { Checkbox }, setup() { return { args, sizeOptions: ['small', 'medium', 'large'] }; }, template: `
` }), parameters: { docs: { source: { code: ` ` } } } };