import { Card, CardAction, CardBar, CardContent, CardCover, CardDescription, CardFooter, CardHeader, CardTitle, Descriptions, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, StatCard, } from "@godxjp/ui/data-display"; import { Button, Text } from "@godxjp/ui/general"; import { AspectRatio, Flex, PageContainer, ResponsiveGrid } from "@godxjp/ui/layout"; import { MoreHorizontal } from "lucide-react"; import coverTerrain from "../../assets/cover-terrain.svg"; /* * A committed SVG under docs/assets, imported so the bundler rewrites the URL against * PREVIEW_BASE. It replaces a picsum.photos fetch that hung `networkidle` and timed this page out * at 30s in CI; it was briefly an inline data: URI, which fixed the hang but put 700 * unreadable characters in the middle of the example a consumer is meant to copy. */ /** * Card — surface container. Body content ALWAYS goes in CardContent (a bare Card * has zero padding); titles in CardHeader/CardTitle; action bars in CardFooter. * Flat by design — 1px border, no shadow at rest. Composed only from real * @godxjp/ui components. */ const accents = ["primary", "success", "warning", "info", "attention", "destructive"] as const; export default function Demo() { return ( CardBar · scrollable controls + pinned action 保存 } > main が混み合うと main のみ横スクロールし、extra は末尾に固定されます。 StatCard · stacked / inline / inverse Variants default 標準のサーフェス muted 控えめな塗り outline 枠線のみ borderless 塗りのみ · 枠線なし featured 強調サーフェス hoverable · actions · Ant Design の hoverable と actions {/* * `hoverable` は見た目だけのフラグです。カード全体が押せるように見えるなら、 * キーボードでも届く本物のコントロールを必ず同居させます(ここでは footer の * Button)。div に onClick を置くのは禁止です。 */} ホバーで浮き上がる --card-hover-shadow まで一段上がります accent と併用 ホバー中もアテンションのリングは消えません asChild · カード全体をひとつのコントロールにする {/* * `hoverable` が約束する「カード全体をひとつのコントロールとして描く」側。 * `asChild` はカードの箱を子の要素に譲るので、リンクそのものがカードになり、 * Tab は一度しか止まらず、スクリーンリーダーはリンクひとつとして読み上げます。 * 入れ子の禁則:これはもうコントロールなので、中に / Accent · accentPlacement="edge" (既定 · 先頭エッジのレール) {accents.map((a) => ( {a} ))} {/* accentPlacement="perimeter" — the semantic attention border */} Accent · accentPlacement="perimeter" (全周のアテンションボーダー) variant="featured" は定義上ブランド色の全周ボーダー。トーンを自分で決めたいとき — 「対応が必要」「失敗した」— は accent と accentPlacement の 2 語で表す。本文の左インセットは レール版と同じ位置に戻るので、placement を切り替えても文字は動かない。 {accents.map((a) => ( {a} ))} Composition · banded header + separated footer 請求書 INV-2024-0312 株式会社ベトヤ · 2024-04-12 ¥438,182 ¥43,818 ¥482,000 Density · tight 12px · base 16px · cozy 20px tight 余白を詰めた密度 base 既定の密度 cozy ゆったりした密度 CardContent · flush (edge-to-edge table) · solo (no header) 仕訳明細 勘定科目 借方 貸方 売掛金 ¥482,000 売上高 ¥438,182 仮受消費税 ¥43,818
ヘッダーのない本文。solo はトップパディングをカードのシェルに合わせます。
CardCover · full-bleed media, header below オフィスビルの外観 渋谷オフィス 東京都渋谷区 · 内見受付中 連続したツールバー 本文 送信} > 下書きを保存しました
); }