import ScrollArea from '@/lib/components/ScrollArea'; import Separator from '@/lib/components/Separator'; import { commonArgTypes } from '@/lib/constants'; import { sizeOptions } from '@/lib/constants'; import type { Meta } from '@storybook/vue3'; import { ISize } from '@/lib/types'; const meta = { title: 'Layout Component/ScrollArea', component: ScrollArea.Root, parameters: { layout: 'centered', themes: { themeOverride: 'dark' }, docs: { description: { component: '스크롤 가능 영역' } } }, argTypes: { radius: { ...commonArgTypes.radius, description: 'scrollArea 둥글기' }, size: { ...commonArgTypes.size, table: { category: 'Props', type: { summary: sizeOptions .filter((value: ISize) => value != 'x-small' && value != 'x-large') .join(' | ') } }, options: sizeOptions.filter((value: ISize) => value != 'x-small' && value != 'x-large'), description: 'scrollArea 크기' } } } as Meta; export default meta; export const Default = { render: (args: any) => ({ components: { ScrollArea: ScrollArea.Root, Separator }, data() { const tags = Array.from({ length: 50 }).map((_, i, a) => `v1.2.0-beta.${a.length - i}`); return { tags }; }, setup() { return { args }; }, template: `

Tags

{{ tag }}
` }), parameters: { docs: { source: { code: ` ` } } } }; export const Horizontal = { render: (args: any) => ({ components: { ScrollArea: ScrollArea.Root, Scrollbar: ScrollArea.Scrollbar }, data() { const works = [ { id: '1', artist: 'Ornella Binni', art: 'https://images.unsplash.com/photo-1465869185982-5a1a7522cbcb?auto=format&fit=crop&w=300&q=80' }, { id: '2', artist: 'Tom Byrom', art: 'https://images.unsplash.com/photo-1548516173-3cabfa4607e9?auto=format&fit=crop&w=300&q=80' }, { id: '3', artist: 'Vladimir Malyavko', art: 'https://images.unsplash.com/photo-1494337480532-3725c85fd2ab?auto=format&fit=crop&w=300&q=80' } ]; return { works }; }, setup() { return { args }; }, template: `
Photo by {{ artwork.artist }}
` }), parameters: { docs: { source: { code: ` ` } } } };