diff --git a/.planning/phases/01-foundation/01-UI-SPEC.md b/.planning/phases/01-foundation/01-UI-SPEC.md index 7a92b33..dd89cc5 100644 --- a/.planning/phases/01-foundation/01-UI-SPEC.md +++ b/.planning/phases/01-foundation/01-UI-SPEC.md @@ -19,7 +19,7 @@ created: 2026-05-14 |----------|-------| | Tool | none (no shadcn — Go/templ/HTMX stack, no React) | | Preset | not applicable | -| Component library | none (raw templ components + Tailwind utilities) | +| Component library | **custom — small in-house templ design-system under `backend/internal/web/ui/`** (modeled on the reference at `go-backend/internal/web/ui/`). Phase 1 ships a minimal core; later phases extend the same package. | | Icon library | none in Phase 1 (deferred — inline SVG when needed in Phase 3+) | | Font | System font stack: `ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif` (Tailwind default `font-sans`) | @@ -243,6 +243,69 @@ Minimum bar Phase 1 must meet. Later phases inherit and extend. --- +## Component Library Contract + +Phase 1 establishes a small custom templ design-system at `backend/internal/web/ui/`. The shape follows the reference at `go-backend/internal/web/ui/` (props struct + `templ` component + variant/tone/size enums + per-component CSS layer). Layouts and pages MUST consume these components instead of hand-rolling Tailwind classes for primitives that already exist in the package — this is how token discipline is enforced across phases. + +**Package layout (Phase 1):** + +``` +backend/internal/web/ui/ +├── tokens.go // semantic token constants (TokenPrimary, TokenDanger, …) — start small +├── variants.go // Size / ButtonVariant / ButtonTone / BadgeVariant enums + class builders +├── helpers.go // shared helpers (e.g. attribute merging, normalizers) +├── base.css // resets, focus-ring base, html/body defaults (imported into tailwind.input.css) +├── button.templ //