# TorbatYar Frontend — Shared Components Report **Date:** 2026-07-26 **Scope:** `components/` inventory, design system analysis, duplication mapping --- ## 1. Component Layer Overview The frontend operates a **three-tier component hierarchy**: ``` Tier 1 — Platform DS components/ds/ (primary, ~90+ consumers) Tier 2 — Marketing DS components/ui/ (legacy, ~10 consumers) Tier 3 — Module DS components/{module}/design-system|ui/ Module pages components/{module}/pages/ Module shells components/{module}/*Shell.tsx ``` --- ## 2. Primary Design System (`components/ds/`) ### File inventory | File | Exports | Role | |------|---------|------| | `index.ts` | Barrel | Public API | | `Button.tsx` | `Button` | CVA variants, ref forwarding | | `Input.tsx` | `Input` | Text input | | `Card.tsx` | `Card`, subcomponents | Surface container | | `Badge.tsx` | `Badge` | Semantic tones (success/warning/danger/info) | | `Dialog.tsx` | `Dialog`, `ConfirmDialog` | Modal dialogs | | `Drawer.tsx` | `Drawer` | Side panel | | `DatePicker.tsx` | `DatePicker` | Jalali calendar | | `FormControls.tsx` | `FormField`, `Select`, `Checkbox`, `MoneyInput`, `Tabs` | Form primitives | | `NavChrome.tsx` | `TableToolbar`, `Pagination`, `Breadcrumbs`, `Skeleton` | Navigation/table chrome | | `Page.tsx` | `PageHeader`, `EmptyState`, `LoadingState`, `ErrorState`, `DataTable`, `StatCard` | Page scaffolding | ### DS export surface (from `index.ts`) ```typescript Button, Input, Card, Badge, Dialog, ConfirmDialog, PageHeader, EmptyState, LoadingState, ErrorState, DataTable, StatCard, DatePicker, Drawer, Select, FormField, Checkbox, MoneyInput, Tabs, TableToolbar, Breadcrumbs, Skeleton, Pagination ``` ### Adoption by module | Consumer | Approx. import sites | |----------|---------------------:| | Accounting | 40+ | | Beauty | 30+ | | Healthcare | 25+ | | Platform (admin, auth, settings) | 10+ | **Boundary compliance:** ✅ `components/ds/` imports nothing from domain modules. ### Known DS gap `components/ds/Button.tsx` does **not** expose a `loading` prop, but accounting routes use `