import type { Meta, StoryObj } from '@storybook/vue3-vite'; import ScrollBar from '@/components/scroll-area/scroll-bar.vue'; import ScrollArea from '../scroll-area.vue'; const meta: Meta = { title: 'Components/ScrollArea', component: ScrollArea, }; export default meta; type Story = StoryObj; export const Default: Story = { args: {}, render: args => ({ components: { ScrollArea }, setup() { return { args }; }, template: `

Tags

{{ tag }}
`, data() { return { tags: Array.from({ length: 50 }).map( (_, i, a) => `v1.2.0-beta.${a.length - i}`, ), }; }, }), }; export const VerticalScroll: Story = { args: {}, render: args => ({ components: { ScrollArea }, setup() { return { args }; }, template: `

{{ item.title }}

{{ item.description }}

`, data() { return { items: Array.from({ length: 20 }).map((_, i) => ({ id: i + 1, title: `Item ${i + 1}`, description: 'This is a sample description for the scroll area item. It demonstrates vertical scrolling.', })), }; }, }), }; export const HorizontalScroll: Story = { args: {}, render: args => ({ components: { ScrollArea }, setup() { return { args }; }, template: `
{{ item }}
`, data() { return { items: Array.from({ length: 15 }).map((_, i) => `Card ${i + 1}`), }; }, }), }; export const BothDirections: Story = { args: {}, render: args => ({ components: { ScrollArea }, setup() { return { args }; }, template: `
{{ col }}
Cell {{ row }}-{{ col }}
`, data() { return { columns: Array.from({ length: 10 }).map((_, i) => `Column ${i + 1}`), rows: Array.from({ length: 30 }).map((_, i) => i + 1), }; }, }), }; export const LongContent: Story = { args: {}, render: args => ({ components: { ScrollArea }, setup() { return { args }; }, template: `

Lorem Ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

`, }), }; export const CustomStyling: Story = { args: {}, render: args => ({ components: { ScrollArea, ScrollBar }, setup() { return { args }; }, template: `

Custom styled item {{ n }}

`, }), };