import { Card, CardContent, CardDescription, CardHeader, CardTitle, Progress, StatCard, } from "@godxjp/ui/data-display"; import { Badge } from "@godxjp/ui/data-display"; import { CompactBarTrend } from "@godxjp/ui/charts/compact-bar-trend"; import { Text } from "@godxjp/ui/general"; import { Flex, PageContainer, ResponsiveGrid } from "@godxjp/ui/layout"; import { AlertTriangle, CheckCircle2, Clock, Database, Package, Percent, Ship, TrendingUp, Users, Wallet, } from "lucide-react"; /** * StatCard — KPI tile. * * WHY THIS PAGE IS LONG. It was 99 lines and four tidy tiles, and the owner's verdict on the * published site was that nothing here lets you judge whether the component is any good. That is * the correct verdict: a KPI tile is trivial with `¥8,200,000` and a `+12%` delta. It is worth * something only when the number is a 14-digit total, the label is a three-clause Japanese noun * phrase, the delta means the opposite of what its sign says, or the value has not arrived yet. * * So every section below is a case a real dashboard hits, and several of them are the cases that * BREAK a naive tile. If a section looks ugly, that is the page doing its job — the component has * to earn it, not the sample data. * * StatCard IS already a bordered Card, so it renders DIRECTLY in ResponsiveGrid — never wrapped in * Card/CardContent, which double-borders it. */ const trend7 = [ { d: "月", v: 42 }, { d: "火", v: 51 }, { d: "水", v: 38 }, { d: "木", v: 64 }, { d: "金", v: 72 }, { d: "土", v: 21 }, { d: "日", v: 9 }, ]; /** A section heading. Headings are headings, not Cards — a Card here would nest borders. */ function Section({ title, why, children, }: { title: string; why: string; children: React.ReactNode; }) { return ( {title} {why} {children} ); } export default function Demo() { return (
} /> } /> } />
} /> } /> } />
承認待ち } />
} /> } />
使い方の要点 この3点を外すと、上のどれかが必ず崩れます。 StatCard はそれ自体がカードです。ResponsiveGrid に直接置いてください。Card/CardContent で包むと枠が二重になります。 delta は符号で色が決まります 。増えて困る指標(解約・エラー・コスト)には必ず inverse を付けてください。付け忘れは「悪化を緑で祝う」表示になります。 hint は ReactNode です。文字列だけでなく、上のように CompactBarTrend・Progress・Badge をそのまま入れられます。
); }