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: `