import AspectRatio from '@/lib/components/AspectRatio'; import { commonArgTypes, scalingOptions } from '@/lib/constants'; import type { Meta } from '@storybook/vue3'; const aspectOptions = { '1': 1, '5/4': 1.25, '5/3': 1.66, '5/2': 2.5, '5/1': 5, '16/9': 1.77 }; const meta = { title: 'Layout Component/AspectRatio', component: AspectRatio, parameters: { layout: 'centered', docs: { description: { component: '원하는 비율로 콘텐츠를 표시하는 컴포넌트' } } }, argTypes: { ratio: { table: { category: 'Props', type: { summary: 'number' } }, options: Object.keys(aspectOptions), mapping: aspectOptions, control: { type: 'select' }, description: 'width / height 비율', defaultValue: { summary: '16/9' } }, scaling: { ...commonArgTypes.scaling, description: 'AspectRatio 비율' } }, args: {} } as Meta; export default meta; export const Default = { render: (args: any) => ({ components: { AspectRatio }, setup() { return { args }; }, template: `
` }) }; export const Ratio = { render: (args: any) => ({ components: { AspectRatio }, setup() { return { args, ratioOptions: [3 / 1, 3 / 2, 3 / 3] }; }, template: `
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Scaling = { render: (args: any) => ({ components: { AspectRatio }, setup() { return { args, scalingOptions }; }, template: `
` }), parameters: { docs: { source: { code: ` ` } } } };