Components
Organization
Section titled “Organization”src/components/ ui/ shared primitives (button, input, badge, dialog, table, …) layout/ application shell (app-shell, client-shell, navbars, …)Feature screens live in features/<module>/components/
(see src/features/README.md); generic and reusable components live
in src/components/.
- Do not rewrite a primitive: compose with
components/uicomponents (classNameprops viacnfrom#/lib/utils). - A layout component carries no business logic — it receives data via
props or state hooks (
useAuth). - Accessibility is baseline:
Labelbound to the input viahtmlFor/id,aria-labelon icon controls,role="alert"on global form errors. - User-facing text is in French, hardcoded in the component (no translation layer).
Accents (Tailwind)
Section titled “Accents (Tailwind)”- Tailwind 4 utility classes + CSS variables defined in
styles.css(.border,bg-card,text-muted-foreground,text-destructive, …). - Avoid hardcoded hex colors: use theme tokens.
- Statuses:
<Badge variant="success|warning|info|danger|neutral">(components/ui/badge.tsx) — no morebg-[#hex] text-white. - Page headers, tables, modals, empty states:
page-header,table,dialog,empty-stateprimitives incomponents/ui/. - Full system: Design system.
Don’ts
Section titled “Don’ts”- ❌ Copy/paste a
ui/component to tweak it inside a feature. - ❌ Generate a “catch-all” component (
anyprops, all responsibilities). - ❌ Display data without loading/error states (Query patterns).
