import { useTranslation } from "@godxjp/ui/i18n"; import { Button, Heading, Link, Paragraph, Text, Title, Typography, VisuallyHidden, } from "@godxjp/ui/general"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@godxjp/ui/data-display"; import { Flex, PageContainer } from "@godxjp/ui/layout"; /** * Text + Heading — the typographic primitives. Use these INSTEAD of a hand-rolled * ``. Size is a step of the * golden-ratio type scale (never an arbitrary px); tone/weight are semantic tokens. */ const sizes = ["2xs", "xs", "sm", "md", "lg", "xl", "2xl"] as const; /** The display ramp — its own card below, because it is a different ramp, not three more steps. */ const displaySizes = ["3xl", "4xl", "5xl"] as const; const tones = ["default", "muted", "primary", "success", "warning", "destructive", "info"] as const; const levels = [1, 2, 3, 4] as const; /** Heading tone — every branch paired with the section it actually belongs on. */ const headingTones = [ { tone: "default", title: "請求サマリー" }, { tone: "muted", title: "補足情報" }, { tone: "primary", title: "今月の重点項目" }, { tone: "success", title: "月次締め処理が完了しました" }, { tone: "warning", title: "承認待ちの申請があります" }, { tone: "destructive", title: "同期に失敗した明細" }, { tone: "info", title: "システムメンテナンスのお知らせ" }, ] as const; export default function Demo() { const { t } = useTranslation(); return ( Heading levels level sets BOTH the --heading-h* size token and the semantic <h1..h4> element — unless `size` overrides the size alone (see the display ramp below), which leaves the document outline where the author put it. {levels.map((level) => ( H{level} · 請求書一覧 ))} Heading tone level は文書構造、tone は意味です。見出しの tone は Text と同じ意味論トークンを読むため、 節の状態を色で示しても文書階層は変わりません。 {headingTones.map(({ tone, title }) => ( {title} {`tone="${tone}"`} ))} tone="inherit" · 面が決める 他の tone は絶対的なトークンを塗るため、色つきの面に置いた途端にページの文字色へ戻って しまいます。inherit はその面が持つ対になる前景色をそのまま使う唯一のメンバーです。 これを入れる前、--primary の上の Text は --foreground を塗って 2.45:1 でした(gh#643)。 {/* ui-audit-disable-next-line no-hand-rolled-surface no-utility-layout no-utility-spacing — the COLOURED SURFACE is the subject here, exactly as in docs/foundation/colors.tsx */}
請求サマリー 今月の請求は締め処理まで完了しています。 {`tone="inherit"`}
同じ二行を tone="default" で置くと、面ではなくページの文字色を塗ります。
Text sizes size is a type-scale step (2xs / xs / sm / md / lg / xl) — sm is the base. No px. {sizes.map((size) => ( {size} — 関連する仕訳データを表示します ))} size · 10 段の共通ラダー(Text と Heading が共有) size は Text と Heading が共有する一本のラダーです。2xs…2xl は UI ランプ(--font-size-base × φ^¼、管理画面の密度)、3xl…5xl はマーケティング用の ディスプレイランプ(--font-size-display と --font-size-display-ratio から導出)。別ランプなので、サービスは管理画面に一切触れずにヒーローだけを調整できます。 ここに至る公開 API が無かったため、どのマーケティングページも自前の font-size クラスを書いていました(gh#826)。 {/* Heading `size` over the WHOLE ladder. `level` keeps the document outline — every row below is the same

— and `size` moves the ramp alone. Ten drawn branches, which is the evidence check:frame-coverage wants for a new public prop. */} {[...sizes, ...displaySizes].map((size) => ( 国境を越える物流を、ひとつに {`size="${size}"`} ))} {/* The hero shape the two website showcases used to hand-write. `level` and `size` are separate axes — antd is the one system that conflates them, and it is also the only one with no display range at all (38px ceiling), which is the same fact twice. On a marketing page this headline IS the page title and takes `level={1}`: a real

at 54px, with no admin screen's

moving. It is `level={2}` here only because PageContainer already renders this page's one

(WCAG 1.3.1). */} Ship it everywhere リード文は UI ランプの xl / 2xl のままで十分です — 大きくすべきは見出しだけ。 {` + — zero bespoke classes`} {/* The same ladder on Text — a stat figure is display-sized but is NOT a heading, so it must be reachable without inventing an for it. This is exactly why the size axis has to be separate from the semantic one. */} {displaySizes.map((size) => ( 98.4% {``} ))} {/* Paragraph and Link read the SAME TextSizeProp, so widening the ladder widened their public surface too. Drawn over the whole ladder rather than left as an undrawn branch — an undrawn branch is what refused the 28.6.0 release. */} {[...sizes, ...displaySizes].map((size) => ( 「速い」 詳しく {` · `} ))} Tone + weight tone maps to semantic foreground tokens; weight is the 3-weight canon (400/500/700). {tones.map((tone) => ( {tone} ))} Regular 400 Medium 500 Bold 700 Numbers, codes, truncation tabular for figures, mono for ids, truncate for one line, clamp for N lines. ¥1,240,000 RC-204881 · JAN 4987241135219 とても長い説明テキストが一行に収まらない場合は省略記号で切り詰められます。 {/* clamp={2} — the card-description case (dxs-platform/platform#427): a long * Japanese description limited to 2 lines, full text kept in the DOM. */} クラウド会計・請求書発行・経費精算・勤怠管理までを一つの契約で提供する統合バックオフィスサービスです。組織の規模や業種に合わせてプランを選択でき、導入後もデータ移行と運用支援を継続的に受けられます。 明細を確認してください。 Links in running content link は色ではなく「これはリンクである」という手がかりです。ホバーだけでなく キーボードフォーカスでも下線が出るため、hover: だけのユーティリティでは 届かない利用者にも伝わります。色は tone のままなので、tone="destructive" のリンクは destructive のまま下線を引きます。 既定 · tone は primary 取り消す すべての通知を見る {/* The case Button variant="link" cannot serve. `.ui-button` is a control box — * white-space: nowrap, flex-shrink: 0, a --control-height tier and inline padding — * so in a cell it neither wraps to a second line nor shares the row's line box. * `` is text, so it does both. */} キー 件名 PKG-128 ログイン画面の余白が狭く、パスワード再設定リンクが本文と重なって見える PKG-129 請求書PDFの明細行
アクション(送信・展開)にはリンク風の Button variant="link" を使います。本文の中のリンクは Text link です。
antd Typography · Title / Paragraph / Link antd の Typography をそのまま移植したもの。Text と Heading は変わらず、Title は 5 段階、Paragraph は rows 付きの ellipsis、Link は target="_blank" に rel を自動で付けます。 請求サマリー 今月の請求は 3 件です。明細は各行のリンクから確認できます。 変更履歴を見る 内訳(level 5 · Heading にはない段) ログイン画面の余白が狭く、パスワード再設定リンクが本文と重なって見えます。 発生条件は 390px 幅の端末で、日本語ロケールのときのみです。 再現手順とスクリーンショットは添付の通りです。 copyable · editable · 装飾 antd の copyable / editable と、7 つの装飾フラグ。装飾は本物の要素を包むので、意味が スクリーンリーダーにも届きます。 RC-204881 案件名をここで直接編集できます type="secondary"(tone="muted" と同じ軸) disabled · 使えないことを示します npm run buildCtrl +{" "} S強調取り消し強い斜体 {t("textExamples.preservedText")} {t("textExamples.sampleText")} {t("textExamples.preservedText")} ); }