import { Avatar, AvatarFallback, Badge, Card, CardContent, CardDescription, CardHeader, CardTitle, ListRow, } from "@godxjp/ui/data-display"; import { Button, Text } from "@godxjp/ui/general"; import { Flex, PageContainer } from "@godxjp/ui/layout"; import { KeyRound, Laptop, Link2, Smartphone } from "lucide-react"; /** * ListRow — the single-line entity-row surface for SHORT lists inside a Card. Replaces the * hand-rolled `flex items-center justify-between border-b py-3` repeated across account pages. * Drop rows into a flush CardContent: they stack with a quiet divider and the Card border closes * the list. Border / radius / padding are tokenized (`--list-row-*`). */ export default function Demo() { return ( Navigation rows The whole row is one link, including its metadata. Current location uses aria-current. アクティブなセッション Active sessions Rows live in a flush CardContent and draw their own dividers. Trailing holds the row action: a status Badge or a destructive Button. 連携アカウント Linked accounts Leading takes an icon or Avatar; trailing takes any action control. `as="li"` when the rows are a semantic list. {/* `as="li"` rows are a SEMANTIC list — axe's `listitem` rule requires the parent to actually be a list container (ul/ol/role=list), not just visually stacked divs. */}
{/* #224 — a long organization name plus TWO trailing Buttons. The content column shrinks to `min(--list-row-body-min-width, 100%)` and the actions wrap onto their own line at narrow widths, so the page root never scrolls horizontally at 390px. */} 招待 Pending invitations Long titles + two actions: the row wraps instead of widening the page. Retune the stack threshold with `--list-row-body-min-width`, the action gap with `--list-row-trailing-gap`. } title="グローバル・トランスフォーメーション推進本部 デジタルプラットフォーム統括部" description="招待者 山田 太郎 · 2026-07-28" trailing={ <> } /> T } title="Trung tâm Điều phối Chuyển đổi số và Quản trị Dữ liệu Doanh nghiệp Toàn cầu" description="Người mời nguyễn.van.a@example.com · 2026-07-27" trailing={ <> } /> A } title="Acme Global Transformation Office · Data Platform Division" description="Invited by taro@example.com · 2026-07-26" trailing={ <> } /> {/* #246 — `density="compact"` inline-actions geometry. Inside the canonical narrow card (358px at a 390px viewport → 326px content column) the 36px Avatar, the shrinkable title/description and the two small trailing Buttons stay on ONE line, and the history rows keep their status Badge + ISO-8601 date inline with the title. The #224 wrap contract is untouched: a cluster that cannot fit still wraps, never widening the page. */} 招待 · コンパクト Compact invitations `density="compact"` lowers the row inset, the column gap and the body threshold (`--list-row-compact-*`) so avatar · title · actions read as one line in a narrow card, instead of the actions dropping to a second row. } title="グローバル推進本部" description="山田 太郎 · 2026-07-28" trailing={ <> } /> T } title="Trung tâm Dữ liệu" description="nguyen.van.a@example.com · 2026-07-27" trailing={ <> } /> A } title="Acme Data Platform" description="taro@example.com · 2026-07-26" trailing={ <> } /> {/* Compact does NOT give up the #224 safety net: a title too long for the compact threshold still wraps (and the actions drop to their own line if they cannot fit), so the page root never scrolls horizontally. */} } title="グローバル・トランスフォーメーション推進本部 デジタルプラットフォーム統括部" description="Trung tâm Điều phối Chuyển đổi số · 2026-07-25" trailing={ <> } /> {/* #246 — the compact HISTORY row: no leading slot, status Badge + ISO-8601 date inline. */} 履歴 Invitation history A compact row with a status Badge and an ISO-8601 date in `trailing` stays a single line at 390px. The metadata never drops under the title. 承認済み 2026-07-12 } /> 期限切れ 2026-06-30 } /> 辞退 2026-06-18 } /> {/* Both density branches on the same content, so the inset difference is readable at rest without toggling anything. `default` is what a row renders with density omitted. */} 密度の対比 density=default vs compact 同じ行を density="default"(既定 · ゆとりのある行間)と density="compact"(明細向けの詰めた行間)で並べています。切り替えるのは inset · 列間 · 本文の折り返し閾値だけで、内容と操作は変わりません。 {/* #225 — notification rows. `unread` renders the indicator dot (a SHAPE with localized sr-only text, never colour alone) plus the tokenized emphasis surface; read rows keep the gutter so every title stays on one optical axis. */} 通知 Notifications `unread` = indicator dot + `--list-row-unread-background`; `unread={false}` = the neutral `--list-row-read-background`. Zero, one or two inline trailing actions. } /> Mở } /> 既読} />
); }