Replaced existing KPI display implementations across multiple pages with the new KpiStatGrid component for a more consistent and visually appealing presentation of statistics. Updated the Backups, BGP, Certificates, Communities, Containers, Dashboard, and Data Collection pages to utilize the KpiStatGrid, improving the overall user experience and maintainability of the codebase. Additionally, added new dependencies in package.json for required libraries.
3.7 KiB
UI Design Contract (MikrotikManager)
Surface: ReUI Frame. Kit: components/reui-kit/.
Иерархия: ReUI PRO > shadcn primitives.
Стек: Next.js 16 App Router + Turbopack + shadcn base-nova + ReUI @reui.
Карта: docs · llms.txt · Get Started · Styling · Blocks · MCP
Surface
Project lock: surface: frame. Ops / list / dashboard / detail / settings — только Frame, не shadcn Card как page shell. Не смешивать Card и Frame на одном ops-экране.
Эталон CRUD: app/(main)/servers.
Оболочка списков: DataPageCard → Frame. Панели: OpsPanel → Frame.
Canonical PRO references
Kit (components/reui-kit/)
| Component | Role |
|---|---|
KPI: только KpiStatGrid (hybrid IconTile elevated size-10.5, эталон /wireguard). Не hand-roll Frame KPI. |
|
CodeExportSheet |
Экспорт кода (.rsc / .conf) — Sheet + Frame + ScrollArea |
Переключение сервера (ops-контекст): ServerTileRail + ServerRailLayout (w-60 = --sidebar-width). Desktop rail сворачивается (persist mm:server-rail-collapsed); mobile — Sheet. Не Combobox. Страницы: OSPF, Filters, GRE, Recursive Routes, WireGuard, Terminal, Certificates, Probes, Firewall (live /api/firewall). Combobox — generic primitive, не доменный селектор хостов.
Слои:
| Слой | Путь |
|---|---|
| shadcn | components/ui/ |
| ReUI CLI | components/reui/ |
| Kit | components/reui-kit/ |
| Domain grids | components/data-grids/ |
Shared App Shell chrome
| Токен / зона | Значение |
|---|---|
--sidebar-width |
240px |
| Header right | AppsMenu → SystemMonitorPopover (тема — в NavUser) |
| Search | ⌘K / Ctrl+K only |
main |
gap-4 md:gap-6, px-4 py-4 md:px-6 md:py-5 |
Spacing & tokens
flex+gap-*— неspace-y-*/space-x-*- Semantic tokens / ReUI Badge variants — не raw
bg-emerald-*/ hex - Max 1 primary CTA на экран
Exceptions (не Frame ops shell)
network-map— canvas / topology UXterminal— terminal chrome
Forbidden
- Card как ops list/dashboard shell
- Hand-roll data-grid / KPI / code-export при наличии kit
- Дубль Copy в header + footer export sheet
- Mixing Card и Frame на одном ops-экране
- Radix-варианты docs — только Base UI (
base-nova) - Combobox / toolbar-фильтр как переключатель сервера (SoT —
ServerTileRail)
License
# .env.local (gitignored)
REUI_LICENSE_KEY=
components.json → @reui с Authorization: Bearer ${REUI_LICENSE_KEY}.