import type { Meta } from '@storybook/vue3'; import ContextMenu from '@/lib/components/ContextMenu'; import { appearanceOptions, commonArgTypes, radiusOptions, sizeOptions } from '@/lib/constants'; import Text from '@/lib/components/Text/Text.vue'; import { ref } from 'vue'; const meta = { title: 'Menu Select Component/ContextMenu', component: ContextMenu, parameters: { layout: 'centered', themes: { themeOverride: 'dark' }, docs: { description: { component: '우클릭 또는 특정 인터랙션 시 나타나는 컨텍스트 메뉴 컴포넌트' } } }, argTypes: { radius: { ...commonArgTypes.radius, description: 'ContextMenu 둥굴기' }, scaling: { ...commonArgTypes.scaling, description: 'ContextMenu 비율' }, size: { ...commonArgTypes.size, table: { category: 'Props', type: { summary: sizeOptions .filter((option) => option === 'small' || option === 'medium') .join(' | ') } }, options: sizeOptions.filter((option) => option === 'small' || option === 'medium'), description: 'Menubar 크기' }, color: { ...commonArgTypes.color, description: 'Menubar 메인 색' }, appearance: { description: 'MenubarItem 스타일', table: { category: 'Props', type: { summary: appearanceOptions .filter((option) => option === 'solid' || option === 'soft') .join(' | ') } }, options: appearanceOptions.filter((option) => option === 'solid' || option === 'soft'), control: { type: 'select' }, defaultValue: { summary: 'solid' } } } } as Meta; export default meta; const ContextMenuComponent = { ContextMenuRoot: ContextMenu.Root, ContextMenuTrigger: ContextMenu.Trigger, ContextMenuContent: ContextMenu.Content, ContextMenuLabel: ContextMenu.Label, ContextMenuItem: ContextMenu.Item, ContextMenuGroup: ContextMenu.Group, ContextMenuCheckboxItem: ContextMenu.CheckboxItem, ContextMenuItemIndicator: ContextMenu.ItemIndicator, ContextMenuRadioGroup: ContextMenu.RadioGroup, ContextMenuRadioItem: ContextMenu.RadioItem, ContextMenuSeparator: ContextMenu.Separator, ContextMenuSubTrigger: ContextMenu.SubTrigger, ContextMenuSubContent: ContextMenu.SubContent, Text }; export const Default = { render: (args: any) => ({ components: ContextMenuComponent, setup() { const checkValue1 = ref(true); const checkValue2 = ref(false); const radioValue = ref('apple'); return { checkValue1, checkValue2, radioValue, args }; }, template: ` 마우스 오른쪽 버튼 클릭 시 메뉴가 나타납니다 라벨 기본 아이템 사용불가 아이템 그룹 아이템1 그룹 아이템2 checked 아이템1 checked 아이템2 라디오 아이템1 라디오 아이템2 More Menu 서브 아이템1 서브 아이템2 ` }) }; export const Radius = { render: (args: any) => ({ components: ContextMenuComponent, setup() { return { args, radiusOptions }; }, template: `
` }), parameters: { docs: { source: { code: `
` } } } }; export const Appearance = { render: (args: any) => ({ components: ContextMenuComponent, setup() { return { args, appearanceOptions: ['solid', 'soft'] }; }, template: `
` }), parameters: { docs: { source: { code: `
` } } } }; export const Size = { render: (args: any) => ({ components: ContextMenuComponent, setup() { return { args, sizeOptions: ['small', 'medium'] }; }, template: `
` }), parameters: { docs: { source: { code: `
` } } } };