import Select from '@/lib/components/Select';
import { commonArgTypes, radiusOptions } from '@/lib/constants';
import { Icon } from '@iconify/vue';
import type { Meta } from '@storybook/vue3';
import { ref } from 'vue';
const meta = {
title: 'Select Component/Select',
component: Select,
parameters: {
layout: 'centered',
themes: {
themeOverride: 'dark'
},
docs: {
description: {
component: '제공된 목록에서 하나 이상의 목록을 선택할 수 있는 기능'
}
}
},
argTypes: {
scaling: {
...commonArgTypes.scaling,
description: 'Select 크기'
},
radius: {
...commonArgTypes.radius,
description: 'Select 둥글기'
},
color: {
...commonArgTypes.color,
description: 'Select 색상'
},
size: {
table: {
category: 'Props',
type: { summary: ['small', 'medium', 'large'].join(' | ') }
},
control: { type: 'select' },
options: ['small', 'medium', 'large'],
defaultValue: { summary: 'medium' },
description: 'Select 크기'
},
appearance: {
table: {
category: 'Props',
type: { summary: ['classic', 'soft', 'surface', 'ghost'].join(' | ') }
},
control: { type: 'select' },
defaultValue: { summary: 'surface' },
description: 'Select 스타일',
options: ['classic', 'soft', 'surface', 'ghost']
}
}
} as Meta;
export default meta;
const selectComponents = {
SelectRoot: Select.Root,
SelectTrigger: Select.Trigger,
SelectContent: Select.Content,
SelectLabel: Select.Label,
SelectGroup: Select.Group,
SelectItem: Select.Item,
SelectSeparator: Select.Separator,
Icon
};
export const Default = {
render: (args: any) => ({
components: selectComponents,
setup() {
const selectedValue = ref(null);
return { selectedValue, args };
},
template: `