TorbatYar/docs/frontend/component-library.md
Mortezakoohjani 12c8615615 Ship enterprise Accounting FE/API with CRUD parity and production wiring.
Adds accounting-service PATCH/archive, fiscal helpers, COA templates and setup status, plus SuperApp Accounting UI (DS, scoreboard, masters, vouchers, ledger, ops modules) with session refresh and HTTPS public API URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-24 15:26:43 +03:30

35 lines
1.6 KiB
Markdown

# Component Library
Located in `frontend/components/ds/`.
## Core
| Component | File | Notes |
|-----------|------|-------|
| Button | `Button.tsx` | variants: default, outline, ghost, danger, success |
| Input / Textarea / Label / FieldError | `Input.tsx` | Form primitives |
| Card family | `Card.tsx` | Card, Header, Title, Description, Content |
| Badge | `Badge.tsx` | tones: default, primary, success, warning, danger, info |
| Dialog / ConfirmDialog | `Dialog.tsx` | Modal + confirm |
| PageHeader | `Page.tsx` | Title + actions |
| DataTable | `Page.tsx` | Simple enterprise table |
| Empty / Loading / Error | `Page.tsx` | Standard states |
| StatCard | `Page.tsx` | Dashboard KPI |
| DatePicker / JalaliDateText | `DatePicker.tsx` | Shamsi calendar only; value is Gregorian ISO for APIs |
| Select / FormField / Checkbox / MoneyInput | `FormControls.tsx` | Styled `<select>`, labeled checkbox, LTR decimal input for voucher lines |
| Drawer | `Drawer.tsx` | RTL slide-over for edit forms (currencies, cost centers, projects, COA accounts) |
| Tabs / TableToolbar / Breadcrumbs / Skeleton / Pagination | `NavChrome.tsx` | List chrome + navigation |
Import via `@/components/ds`.
## Dates
- Never use native `type="date"` (Gregorian browser picker) in Accounting.
- Always use `DatePicker` for input and `JalaliDateText` / `formatJalali` for display.
- API payloads remain `YYYY-MM-DD` Gregorian.
## Accounting helpers
- `CompletionScoreboard``frontend/components/accounting/CompletionScoreboard.tsx` (reads `lib/accounting-scoreboard.ts`).
- Scoreboard doc: `docs/frontend/completion-scoreboard.md`.