# IGNY8 Design System Guide
> **Single Source of Truth for UI Components**
>
> This guide ensures consistent, maintainable frontend code across the entire application.
---
## Quick Links
| Resource | Path | Description |
|----------|------|-------------|
| **Component System** | [docs/30-FRONTEND/COMPONENT-SYSTEM.md](docs/30-FRONTEND/COMPONENT-SYSTEM.md) | Full component reference with props, examples, and usage |
| **ESLint Plugin** | [frontend/eslint/](frontend/eslint/) | Custom rules enforcing design system |
| **Live Demo** | `/ui-elements` route | Interactive component showcase |
| **Design Tokens** | [frontend/src/styles/design-system.css](frontend/src/styles/design-system.css) | CSS variables and tokens |
| **Icons** | [frontend/src/icons/](frontend/src/icons/) | All SVG icons |
---
## Core Principles
### 1. Use Components, Never Raw HTML
```tsx
// ❌ NEVER
// ✅ ALWAYS
```
### 2. Import Icons from Central Location
```tsx
// ❌ NEVER
import { XIcon } from '@heroicons/react/24/outline';
import { Trash } from 'lucide-react';
// ✅ ALWAYS
import { CloseIcon, TrashBinIcon } from '../../icons';
```
### 3. Consistent Sizing
```tsx
// Icons in buttons/badges
// Standalone icons
// Large/header icons
```
---
## Component Quick Reference
| Need | Component | Import |
|------|-----------|--------|
| Action button | `Button` | `components/ui/button/Button` |
| Icon-only button | `IconButton` | `components/ui/button/IconButton` |
| Text input | `InputField` | `components/form/input/InputField` |
| Checkbox | `Checkbox` | `components/form/input/Checkbox` |
| Radio | `Radio` | `components/form/input/Radio` |
| Dropdown | `Select` | `components/form/Select` |
| Multi-line text | `TextArea` | `components/form/input/TextArea` |
| Toggle | `Switch` | `components/form/switch/Switch` |
| Status label | `Badge` | `components/ui/badge/Badge` |
| Container | `Card` | `components/ui/card/Card` |
| Popup | `Modal` | `components/ui/modal` |
| Loading | `Spinner` | `components/ui/spinner/Spinner` |
| Notification | `useToast` | `components/ui/toast/ToastContainer` |
**→ See [COMPONENT-SYSTEM.md](docs/30-FRONTEND/COMPONENT-SYSTEM.md) for full props and examples**
---
## ESLint Enforcement
### Rules
| Rule | Level | Action |
|------|-------|--------|
| `no-raw-button` | warn → error | Use `Button` or `IconButton` |
| `no-raw-input` | warn → error | Use `InputField`, `Checkbox`, `Radio` |
| `no-raw-select` | warn → error | Use `Select` or `SelectDropdown` |
| `no-raw-textarea` | warn → error | Use `TextArea` |
| `no-restricted-imports` | error | Block external icon libraries |
### Check Violations
```bash
cd frontend
npm run lint
```
### Plugin Location
The custom ESLint plugin is at: `frontend/eslint/eslint-plugin-igny8-design-system.cjs`
---
## For AI Agents
When working on this codebase:
1. **Read first**: [docs/30-FRONTEND/COMPONENT-SYSTEM.md](docs/30-FRONTEND/COMPONENT-SYSTEM.md)
2. **Never use**: `