diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e8d7951 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,56 @@ +# web-app-launcher — project guide for Claude + +SvelteKit 2 + Svelte 5 (runes) + Tailwind 4 + Prisma + Vitest. Cozy Home design system (warm cream / dusk, terracotta accent, Fraunces + Figtree, soft shadows). Token contract lives in `src/app.css`. + +## Frontend + +### Basic-component reuse — MANDATORY + +When you need any of the following, **use the existing primitive from `src/lib/components/ui/`. Do not hand-roll a new Tailwind class string for a control that already has a primitive.** + +| Need | Primitive | Why | +|---|---|---| +| Boolean on/off setting | `Switch.svelte` | Pill toggle, `role="switch"`, AA contrast, terracotta track when on. Default for any "enable X" / "show Y" / "is default" field. **Never use `` for booleans.** | +| Multi-select item in a list | `Checkbox.svelte` | Rounded square with animated check-draw. Only use when the control is truly "pick any number of these," not a single boolean. | +| Dropdown of fixed options | `Select.svelte` | Styled chevron, matches Cozy input radius. Wraps native ``.** | +| Single-line text / number / email / url / password | `Input.svelte` | Standard rounded-xl, focus ring, invalid state. **Do not repeat the `w-full rounded-xl border border-input bg-background px-3 py-2 ...` string anywhere.** | +| Number in a range (refresh interval, hue, blur, etc.) | `Slider.svelte` | Cozy gradient track, terracotta-bordered knob, value tooltip, `aria-valuetext`. **Do not use raw ``.** | +| Action button (submit, save, cancel, link-as-CTA) | `Button.svelte` | Variants `primary | secondary | outline | ghost | destructive`, sizes `sm | md | lg | icon`, built-in `loading` spinner, press-squash. **Do not repeat `rounded-xl bg-primary px-4 py-2 ...` strings.** | +| Label + hint + error wrapper around a control | `Field.svelte` | Consolidates `