import type { Meta } from '@storybook/vue3'; import Menubar from '@/lib/components/Menubar'; import { appearanceOptions, commonArgTypes, radiusOptions, sizeOptions } from '@/lib/constants'; import { ref } from 'vue'; const meta = { title: 'Navigation Component/Menubar', component: Menubar, parameters: { layout: 'centered', themes: { themeOverride: 'dark' }, docs: { description: { component: '리스트 형태의 선택할 수 있는 항목들이 나열된 인터페이스 요소 컴포넌트' } } }, argTypes: { radius: { ...commonArgTypes.radius, description: 'Menubar border 둥굴기' }, scaling: { ...commonArgTypes.scaling, description: 'Menubar 비율' }, 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: 'Menubar 상단 메뉴 스타일', table: { category: 'Props', type: { summary: appearanceOptions .filter((option) => option === 'solid' || option === 'ghost') .join(' | ') } }, options: appearanceOptions.filter((option) => option === 'solid' || option === 'ghost'), control: { type: 'select' }, defaultValue: { summary: 'ghost' } }, itemAppearance: { description: 'Menubar 하위 아이템 스타일', table: { category: 'Props', type: { summary: appearanceOptions .filter((option) => option === 'solid' || option === 'ghost') .join(' | ') } }, options: appearanceOptions.filter((option) => option === 'solid' || option === 'ghost'), control: { type: 'select' }, defaultValue: { summary: 'solid' } } } } as Meta; export default meta; const MenubarComponent = { MenubarRoot: Menubar.Root, MenubarMenu: Menubar.Menu, MenubarTrigger: Menubar.Trigger, MenubarContent: Menubar.Content, MenubarItem: Menubar.Item, MenubarSeparator: Menubar.Separator, MenubarSub: Menubar.Sub, MenubarSubTrigger: Menubar.SubTrigger, MenubarSubContent: Menubar.SubContent, MenubarCheckboxItem: Menubar.CheckboxItem, MenubarItemIndicator: Menubar.ItemIndicator, MenubarRadioGroup: Menubar.RadioGroup, MenubarRadioItem: Menubar.RadioItem }; export const Default = { render: (args: any) => ({ components: MenubarComponent, setup() { const checkedBookmark = ref(true); const checkedUrl = ref(false); const radioValue = ref('google'); return { checkedBookmark, checkedUrl, radioValue, args }; }, template: ` File New Tab New Window New Incognito Window Share Email Link Messages View Show Bookmarks Show Full URLs Profile google naver intranet ` }) }; export const Color = { render: () => ({ components: MenubarComponent, setup() { return { colorOptions: ['yellow', 'green'] }; }, template: `
` }), parameters: { docs: { source: { code: `
` } } } }; export const Radius = { render: () => ({ components: MenubarComponent, setup() { return { radiusOptions }; }, template: `
` }), parameters: { docs: { source: { code: `
` } } } }; export const Appearance = { render: () => ({ components: MenubarComponent, setup() { return { radiusOptions }; }, template: `
파일 새 탭 새 창 보기 확대 축소 파일 새 탭 새 창 보기 확대 축소
` }) }; export const Size = { render: () => ({ components: MenubarComponent, setup() { return { sizeOptions: ['small', 'medium'] }; }, template: `
` }), parameters: { docs: { source: { code: `
` } } } };