add storybook

This commit is contained in:
Aaron Po
2026-03-15 21:18:34 -04:00
parent 9a0eadc514
commit cbaa5bfbca
20 changed files with 2775 additions and 98 deletions

View File

@@ -0,0 +1,41 @@
import { Meta } from "@storybook/addon-docs/blocks";
<Meta title="Docs/Storybook" />
# Biergarten Storybook
This Storybook is scoped to real app UI only:
- `SubmitButton`
- `FormField`
- `Navbar`
- `Themes` gallery
## Theme workflow
Use the toolbar theme switcher to preview all Biergarten themes:
- `biergarten-lager`
- `biergarten-stout`
- `biergarten-cassis`
- `biergarten-weizen`
Stories are rendered inside a decorator that sets `data-theme`, so tokens and components reflect production styling.
## Tests
Two layers are enabled:
1. Story `play` tests (Storybook test runner / Vitest addon)
2. Browser checks with Playwright against Storybook iframe routes
Run:
- `npm run build-storybook -- --test`
- `npm run test:storybook:playwright`
## Rules
- Add stories only for reusable app components.
- Prefer semantic classes (`bg-primary`, `text-base-content`, etc.).
- Keep stories state-focused and minimal.