toast · diff

git:20260902.51b89ce to git:20260915.d786bb4

2 added, 25 removed. Audit A to A.

---
- description: Toast variants and toast() API — default, error, warning, info
+ description: Toast API — toast() from @/molecules/Toaster/toast with variant, static copy only
globs: src/components/atoms/Toast/**,src/components/molecules/Toaster/**,src/hooks/**,src/providers/**/*
alwaysApply: false
---
# Toast Rules
- @docs/components.md — _Toasts_
-
- ## Variants
-
- Use `variant` on `toast()` — never `className: 'destructive …'` or `showErrorToast` / `showSuccessToast` helpers.
-
- | Variant | When |
- |---------|------|
- | `default` | Success, confirmation (omit `variant`) |
- | `error` | Failures; omit `title` for the generic `Error` title |
- | `warning` | Caution, rate limits |
- | `info` | Neutral info (e.g. clipboard copy) |
-
- ## API
-
- ```tsx
- import { toast } from '@/molecules/Toaster/toast';
-
- toast({ variant: 'error', description: '...' });
- toast({ title: 'Saved', description: '...' }); // default
- toast({ title: 'Reposted', action: { label: 'Undo', altText: 'Undo', onClick: () => {} } });
- ```
-
- `toast()` is the only public producer API; `toast.store.ts`, `useToastState.ts`, and the `@/atoms/Toast/*` renderer atoms are Toaster-internal (ESLint-enforced). Custom actions are descriptors (`{ label, altText, onClick }`), never components — the Toaster renders and styles them. Styling: [`Toast.variants.ts`](src/components/atoms/Toast/Toast.variants.ts) only.
+ @docs/components.md — _Toasts_ (variants, `toast()` API, action descriptors, and the rule that copy is static: never interpolate user-entered text).