feat(web): set up Storybook (preview + MSW + stories for real components)

This commit is contained in:
2026-06-05 16:55:40 +02:00
parent 4e1138f8ce
commit b2d026f217
17 changed files with 2400 additions and 30 deletions
+32
View File
@@ -0,0 +1,32 @@
import type { Meta, StoryObj } from '@storybook/react-vite'
import { expect } from 'storybook/test'
import { Badge } from './badge'
const meta = {
component: Badge,
tags: ['ai-generated'],
} satisfies Meta<typeof Badge>
export default meta
type Story = StoryObj<typeof meta>
export const Default: Story = {
args: { children: 'Public' },
play: async ({ canvas }) => {
const badge = canvas.getByText('Public')
await expect(badge).toHaveAttribute('data-slot', 'badge')
},
}
export const Secondary: Story = {
args: { variant: 'secondary', children: 'Internal' },
}
export const Destructive: Story = {
args: { variant: 'destructive', children: 'Error' },
}
export const Outline: Story = {
args: { variant: 'outline', children: 'Draft' },
}