UI Design System & AI Coder Instructions (Ui Reference)
Every page across https://api.gpkeys.com/ and https://api.gpkeys.com/api/ is built on the DropX Admin UI system located in the local workspace folder `Ui Reference /` (excluded from TypeScript compilation in tsconfig.json).
If you are an AI coding assistant or contributor, follow these standards on every new page, section, card, table, and graph.
1. Visual Shell & Tokens (src/css/custom.css)
- Shell Architecture (
src/theme/Layout/index.tsx): Collapsible DropX Sidebar (256pxexpanded /68pxicon-only collapsed / drawer< 1024px), sticky68pxHeader (Ctrl + KQuick Search modal, theme toggle, fullscreen toggle, EN/FR locale menu), and full-width responsive content container (360pxmobile to3840px4K TV). - Theme Tokens:
- Light: canvas
--background: #f9fafb, surface--card: #ffffff, border--border: #e5e7eb, primary#4f46e5/#6366f1. - Dark (
[data-theme='dark']+.dark): canvas--background: #0f172a, surface--card: #1e293b, border--border: #334155, primary#818cf8. - Chart Palette:
--chart-1(#6366f1/#818cf8) through--chart-7.
- Light: canvas
2. Reusable UI Components (src/components/ui/index.tsx)
Import DropX UI primitives instead of writing one-off cards or badges:
import {
AnimatedProgress,
Badge,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
GradientCard,
PageHeader,
} from '@site/src/components/ui'
PageHeader: Breadcrumb, eyebrow badges,<h1>title, subtitle, and right-aligned action buttons.GradientCard: KPI stat cards supportingprimary,success,warning,danger,info,purple,pink,ocean, andsunsetgradients.Card+.data-table: Rounded12px(--radius-xl) cards with--shadow-cardelevation; wrap tables in.gp-table-wrapwith classgp-table data-table.
3. Recharts Graphs (src/components/ui/chart-theme.ts)
All graphs use Recharts (AreaChart, BarChart, PieChart, LineChart) paired with DropX theme helpers and <BrowserOnly> for safe static SSR builds:
import BrowserOnly from '@docusaurus/BrowserOnly'
import { Area, AreaChart, CartesianGrid, ResponsiveContainer, Tooltip, XAxis, YAxis } from 'recharts'
import { axisTick, chartColors, tooltipProps } from '@site/src/components/ui/chart-theme'
Graph rules:
- Always style strokes/fills via
chartColors, ticks viaaxisTick, and tooltips via{...tooltipProps}. - Wrap
<ResponsiveContainer>inside<BrowserOnly>with a fixed-height container (height: 220pxor260px) anddirection: ltr. - Clearly badge sample/mock data as Sandbox Reference unless fetched from a live API endpoint.
- Keep existing charts (
src/components/ApiTelemetryDashboard.tsx) synchronized withopenapi.yamlanddocs/rate-limits.md.
4. Navigation, i18n & Verification
- Navigation: Register new pages in both
sidebars.tsandsrc/config/navigation.ts(SIDEBAR_NAV_GROUPS+QUICK_SEARCH_ENTRIES). - Localization: Translate UI strings in
i18n/fr/code.json, and preservedir="ltr"isolation on URLs, code snippets, and charts. - Footer Credit: Preserve the
"Designed & developed by DataDropX"(https://datadropx.net) credit insrc/theme/Footer/index.tsx. - Verify Every Edit: Run
pnpm typecheck && pnpm verifybefore committing or deploying.