@godxjp/ui 28.7.0 → 28.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/components/data-display/index.d.ts +2 -0
  2. package/dist/components/data-display/index.js +2 -0
  3. package/dist/components/data-display/marquee.d.ts +16 -0
  4. package/dist/components/data-display/marquee.js +155 -0
  5. package/dist/components/general/reveal.d.ts +23 -2
  6. package/dist/components/general/reveal.js +37 -7
  7. package/dist/components/general/typography.d.ts +4 -1
  8. package/dist/components/general/typography.js +14 -1
  9. package/dist/components/layout/affix.d.ts +86 -0
  10. package/dist/components/layout/affix.js +187 -0
  11. package/dist/components/layout/index.d.ts +4 -0
  12. package/dist/components/layout/index.js +4 -0
  13. package/dist/components/layout/legal-document-shell.js +4 -3
  14. package/dist/components/layout/masonry.d.ts +74 -0
  15. package/dist/components/layout/masonry.js +214 -0
  16. package/dist/components/layout/page-container.js +5 -20
  17. package/dist/components/navigation/anchor.d.ts +64 -0
  18. package/dist/components/navigation/anchor.js +284 -0
  19. package/dist/components/navigation/index.d.ts +4 -0
  20. package/dist/components/navigation/index.js +4 -0
  21. package/dist/components/navigation/mega-menu.d.ts +21 -0
  22. package/dist/components/navigation/mega-menu.js +526 -0
  23. package/dist/contracts/measurement.json +1 -1
  24. package/dist/i18n/messages/en.json +517 -0
  25. package/dist/i18n/messages/ja.json +513 -0
  26. package/dist/i18n/messages/vi.json +513 -0
  27. package/dist/lib/hooks.d.ts +68 -0
  28. package/dist/lib/hooks.js +52 -0
  29. package/dist/lib/platform.d.ts +14 -0
  30. package/dist/lib/platform.js +10 -1
  31. package/dist/lib/utils.d.ts +1 -1
  32. package/dist/lib/utils.js +3 -2
  33. package/dist/lib/variants.js +4 -1
  34. package/dist/props/components/data-display.prop.d.ts +95 -1
  35. package/dist/props/components/general.prop.d.ts +47 -3
  36. package/dist/props/components/layout.prop.d.ts +194 -0
  37. package/dist/props/components/navigation.prop.d.ts +263 -0
  38. package/dist/props/registry.d.ts +359 -4
  39. package/dist/props/registry.js +472 -3
  40. package/dist/props/vocabulary/index.d.ts +1 -1
  41. package/dist/props/vocabulary/interaction.prop.d.ts +39 -2
  42. package/dist/props/vocabulary/layout.prop.d.ts +1 -1
  43. package/dist/styles/base.css +47 -14
  44. package/dist/styles/card-layout.css +2 -2
  45. package/dist/styles/chart-layout.css +6 -6
  46. package/dist/styles/control.css +15 -10
  47. package/dist/styles/data-display-layout.css +22 -6
  48. package/dist/styles/density.css +6 -0
  49. package/dist/styles/dialog-layout.css +4 -1
  50. package/dist/styles/focus-ring.css +4 -1
  51. package/dist/styles/layout.css +92 -3
  52. package/dist/styles/motion.css +121 -1
  53. package/dist/styles/navigation-layout.css +397 -1
  54. package/dist/styles/shell-layout.css +28 -21
  55. package/dist/styles/text-layout.css +134 -15
  56. package/dist/tokens/base.css +5 -0
  57. package/dist/tokens/components/activity.css +13 -4
  58. package/dist/tokens/components/affix.css +7 -0
  59. package/dist/tokens/components/anchor.css +17 -0
  60. package/dist/tokens/components/attachments.css +1 -1
  61. package/dist/tokens/components/badge.css +1 -1
  62. package/dist/tokens/components/card.css +28 -7
  63. package/dist/tokens/components/chart.css +4 -1
  64. package/dist/tokens/components/chat-composer.css +4 -1
  65. package/dist/tokens/components/control.css +72 -33
  66. package/dist/tokens/components/conversations.css +4 -1
  67. package/dist/tokens/components/data-display.css +42 -15
  68. package/dist/tokens/components/data-entry.css +8 -2
  69. package/dist/tokens/components/descriptions.css +1 -1
  70. package/dist/tokens/components/feedback.css +8 -5
  71. package/dist/tokens/components/float-button.css +8 -2
  72. package/dist/tokens/components/form.css +1 -1
  73. package/dist/tokens/components/legal-document.css +12 -3
  74. package/dist/tokens/components/logo.css +15 -6
  75. package/dist/tokens/components/marquee.css +7 -0
  76. package/dist/tokens/components/masonry.css +6 -0
  77. package/dist/tokens/components/mega-menu.css +71 -0
  78. package/dist/tokens/components/navigation.css +37 -13
  79. package/dist/tokens/components/segmented.css +4 -1
  80. package/dist/tokens/components/separator.css +4 -1
  81. package/dist/tokens/components/shell.css +99 -31
  82. package/dist/tokens/components/table.css +11 -5
  83. package/dist/tokens/components/thought-chain.css +4 -1
  84. package/dist/tokens/components/toggle.css +4 -1
  85. package/dist/tokens/components/tree.css +1 -1
  86. package/dist/tokens/components/upload.css +21 -9
  87. package/dist/tokens/foundation.css +35 -30
  88. package/dist/tokens/semantic/layout.css +26 -5
  89. package/docs/COMPOSITION-VS-COMPONENT.md +19 -1
  90. package/docs/DESIGN-AUTHORITY.md +99 -18
  91. package/docs/FRAME-COVERAGE-REPORT.md +7 -2
  92. package/docs/TOKENS.md +16 -1
  93. package/docs/data-display/marquee.tsx +254 -0
  94. package/docs/foundation/_theme-editor-scope.ts +222 -0
  95. package/docs/foundation/density.tsx +12 -2
  96. package/docs/foundation/spacing.tsx +5 -0
  97. package/docs/foundation/theme-editor.tsx +645 -0
  98. package/docs/general/activity.tsx +65 -0
  99. package/docs/general/reveal.tsx +290 -22
  100. package/docs/general/typography.tsx +91 -1
  101. package/docs/layout/affix.tsx +209 -0
  102. package/docs/layout/masonry.tsx +291 -0
  103. package/docs/navigation/anchor.tsx +285 -0
  104. package/docs/navigation/mega-menu-panel.tsx +86 -0
  105. package/docs/navigation/mega-menu.tsx +254 -0
  106. package/docs/roadmap/website-components.md +779 -0
  107. package/docs/showcase/acme-website.tsx +75 -39
  108. package/docs/showcase/case4-login.tsx +10 -2
  109. package/docs/showcase/case5-shift-calendar.tsx +1 -1
  110. package/docs/showcase/case6-agency-handy.tsx +6 -6
  111. package/docs/showcase/futurelastic-web.tsx +89 -49
  112. package/docs/showcase/marketing-page.tsx +885 -0
  113. package/docs/showcase/table-expandable-rows.tsx +4 -1
  114. package/docs/showcase/table-footer-totals.tsx +12 -2
  115. package/docs/showcase/theme-customization.tsx +1259 -0
  116. package/package.json +6 -3
  117. package/scripts/brand-accent.generated.mjs +27 -0
  118. package/scripts/ui-audit.mjs +66 -0
  119. package/scripts/visual-audit-rules.mjs +46 -2
@@ -0,0 +1,1259 @@
1
+ /**
2
+ * Showcase · theme-customization — "Flexible theme customization".
3
+ *
4
+ * ONE DENSE BOARD, dozens of real primitives, and a theme bar above it. Pick a palette and the
5
+ * whole board repaints in place: no reload, no remount, no second stylesheet. The page is the
6
+ * inventory claim as much as the theming claim — every cell below is a real installable
7
+ * `@godxjp/ui` export, composed the way a consumer would compose it.
8
+ *
9
+ * ── Gate 0 verdict: COMPOSITION PATTERN ──────────────────────────────────────────────────────
10
+ * A "ThemeBoard" / "ThemePresetChips" fails the Framework-Component Test
11
+ * (docs/COMPOSITION-VS-COMPONENT.md): C2 it owns no behaviour a primitive does not already own
12
+ * (`Segmented` is the one-of-N control, `ColorPicker` is the hex control, `applyPrimaryColor` is
13
+ * the seed API); C3 it is fully expressible from existing primitives plus a scoped token block;
14
+ * C7 it would ship one marketing page's layout to every consumer. So it lives HERE. Zero new
15
+ * components, zero new tokens.
16
+ *
17
+ * ── How the chips change the SEED (docs/CUSTOMER-THEMING.md, level 1 · scoped at level 3) ────
18
+ * The chips never touch a component and never touch a role. They move `--primary` — the seed the
19
+ * whole action family derives from at runtime (`--primary-hover`, `--primary-active`,
20
+ * `--primary-border`, `--control-outline`, `--text-link`, `--text-brand`, `--text-primary` are all
21
+ * `initial` knobs resolved at the painting element, src/tokens/derived.css). They are declared
22
+ * under `[data-godx-theme="…"]`, a SCOPE, so the board repaints while the rest of the document
23
+ * does not have to know.
24
+ *
25
+ * ── THE FREEZE TRAP THIS PAGE ACTUALLY HIT (docs/TOKENS.md · "the :root freeze rule") ─────────
26
+ * Two of them, and neither is a colour knob:
27
+ *
28
+ * 1. `--ring` is NOT an `initial` knob. src/tokens/derived.css declares `--ring: var(--primary)`
29
+ * at `:root`, and says why it cannot be a knob: it is a public role that consumer CSS reads
30
+ * as `hsl(var(--ring))` directly. A `var()` substitutes at the element that DECLARES it, so
31
+ * `--ring` computes once on `<html>` from the ROOT seed and inherits that frozen value all
32
+ * the way down. Scoping `--primary` alone therefore repainted every fill, border, link and
33
+ * hover on the board and left every FOCUS RING on the old violet. The fix is one line per
34
+ * scope: re-declare `--ring: var(--primary)` INSIDE the scope, where it re-resolves.
35
+ *
36
+ * 2. The radius scale is the same shape one tier up. `--radius-xs … --radius-2xl` are
37
+ * `calc(var(--radius) · φⁿ)` declared at `:root` (src/styles/base.css), and
38
+ * `--card-radius: var(--radius-xl)` / `--control-radius: var(--radius)` /
39
+ * `--button-radius: var(--radius-md)` / `--badge-radius: var(--radius-md)` mirror them from
40
+ * `:root` too. Scoping `--radius` for the corner chips moved NOTHING until the scope restated
41
+ * the six steps and the four component mirrors. That is the same fix acme-portal carries.
42
+ *
43
+ * ── The one thing the chips deliberately do NOT move ─────────────────────────────────────────
44
+ * `--brand` / `--brand-foreground`. The identity role is independent of the action colour on
45
+ * purpose (gh#250), so a tenant changing its button colour does not retint its logo.
46
+ *
47
+ * ── Reaching the edges, deliberately ─────────────────────────────────────────────────────────
48
+ * A tidy board is the defect, not the deliverable, so every row here carries at least one of:
49
+ * a three-line label beside a one-word one; a 71-character unbreakable token; a slot left empty
50
+ * beside the same slot fully filled; CJK beside Latin beside Vietnamese diacritics.
51
+ *
52
+ * THE FIRST SWEEP AT 375px FOUND TWO THINGS, and neither was in the page's own markup:
53
+ *
54
+ * · `ChatBubble loading` painted a 544px placeholder inside a 341px card, 214px of it outside
55
+ * with no scrollport above it. `.ui-chat-bubble-skeleton-line` declared a DEFINITE 34rem
56
+ * inside an implicit `auto` grid track, and an `auto` track floors at its item's max-content,
57
+ * so the line's own `max-inline-size: 100%` resolved against 544px and did nothing. Fixed
58
+ * upstream in src/styles/data-display-layout.css (`grid-template-columns: minmax(0, …)`),
59
+ * because a local workaround here would have left it broken for every other consumer.
60
+ *
61
+ * · A `TagInput` sat 37px wider than its column. That one was THIS page's bug: `Field` is the
62
+ * compact label-plus-control row and puts `flex-shrink: 0` on its control cell, which is right
63
+ * for a checkbox box and wrong for a full-width field. Every full-width control below is
64
+ * `FormField`; `Field` is kept only for the two `Switch` rows, which is what it is for.
65
+ *
66
+ * Measured after both: `check:frame-overflow`'s own probe reports 0 hits and 0 page overflow at
67
+ * 320 / 375 / 390 / 768 / 1024 / 1280 / 1440, and 0 under `dir="rtl"`.
68
+ *
69
+ * ── i18n / a11y / RTL ────────────────────────────────────────────────────────────────────────
70
+ * Every string and every `aria-label` comes from `t()` (`themeShowcase.*` in
71
+ * src/i18n/messages/{en,ja,vi}.json); the locale picker drives the SAME `AppProvider` locale the
72
+ * library's own chrome reads, so the page and its components switch together. Numbers, currency,
73
+ * dates, lists, regions and plurals go through `Intl` with that locale — no hand-built formats, no
74
+ * emoji flags. Logical CSS only; no Tailwind spacing or layout utilities on this page's own
75
+ * markup.
76
+ */
77
+ import * as React from "react";
78
+ import {
79
+ AtSign,
80
+ Bell,
81
+ CircleUserRound,
82
+ Fingerprint,
83
+ KeyRound,
84
+ Mail,
85
+ MapPin,
86
+ ShieldCheck,
87
+ Trash2,
88
+ } from "lucide-react";
89
+
90
+ import { applyPrimaryColor } from "@godxjp/ui/app";
91
+ import { useTranslation } from "@godxjp/ui/i18n";
92
+ import { Activity, Button, Icon, Text } from "@godxjp/ui/general";
93
+ import {
94
+ Avatar,
95
+ AvatarFallback,
96
+ Badge,
97
+ Card,
98
+ CardAction,
99
+ CardContent,
100
+ CardDescription,
101
+ CardFooter,
102
+ CardHeader,
103
+ CardTitle,
104
+ Carousel,
105
+ CarouselContent,
106
+ CarouselDots,
107
+ CarouselItem,
108
+ CarouselNext,
109
+ CarouselPrevious,
110
+ ChatBubble,
111
+ CredentialReveal,
112
+ Descriptions,
113
+ Legend,
114
+ ListRow,
115
+ Popover,
116
+ PopoverContent,
117
+ PopoverDescription,
118
+ PopoverHeader,
119
+ PopoverTitle,
120
+ PopoverTrigger,
121
+ Progress,
122
+ QrCode,
123
+ StatCard,
124
+ Swatch,
125
+ Table,
126
+ TableBody,
127
+ TableCell,
128
+ TableHead,
129
+ TableHeader,
130
+ TableRow,
131
+ ThoughtChain,
132
+ Timeline,
133
+ Welcome,
134
+ type BadgeTone,
135
+ type TimelineItem,
136
+ } from "@godxjp/ui/data-display";
137
+ import {
138
+ CheckboxGroup,
139
+ ColorPicker,
140
+ DatePicker,
141
+ Field,
142
+ FormField,
143
+ InputOTP,
144
+ InputOTPGroup,
145
+ InputOTPSlot,
146
+ Input,
147
+ PasswordInput,
148
+ PasswordStrength,
149
+ RadioGroup,
150
+ Rating,
151
+ Segmented,
152
+ Select,
153
+ Slider,
154
+ Switch,
155
+ TagInput,
156
+ } from "@godxjp/ui/data-entry";
157
+ import {
158
+ Alert,
159
+ AlertDescription,
160
+ AlertTitle,
161
+ Tooltip,
162
+ TooltipContent,
163
+ TooltipTrigger,
164
+ } from "@godxjp/ui/feedback";
165
+ import { AuthDivider, Flex, PageContainer, ResponsiveGrid, Separator } from "@godxjp/ui/layout";
166
+ import { AppSettingPicker, AppSettingToggle, Steps, Tabs } from "@godxjp/ui/navigation";
167
+
168
+ /* ────────────────────────────────────────────────────────────────────────────────────────────
169
+ * THE ENTIRE THEME LAYER. One scoped block per palette, one per corner step. No component CSS,
170
+ * no `!important`, no fork. Every seed pair was measured before it was written (WCAG 2.2 SC 1.4.3
171
+ * on the label, SC 1.4.11 on the fill against its canvas):
172
+ *
173
+ * palette light seed label fill/canvas dark seed label fill/canvas
174
+ * godx #7A00FF 6.42:1 6.42:1 #DCBCFF 12.68:1 10.61:1
175
+ * indigo #4338CA 7.90:1 7.90:1 #A5B4FC 10.53:1 8.81:1
176
+ * teal #0F766E 5.47:1 5.47:1 #5EEAD4 14.20:1 11.88:1
177
+ * amber #B45309 5.02:1 5.02:1 #FCD34D 14.56:1 12.18:1
178
+ * rose #BE123C 6.29:1 6.29:1 #FDA4AF 11.11:1 9.29:1
179
+ *
180
+ * A DARK SEED IS NOT A LIGHT SEED. Nothing in CSS lifts one onto the dark spine, so each palette
181
+ * declares both and the dark half is selected by the theme axis AppProvider writes to <html>
182
+ * (`[data-theme="dark"]`, with the legacy `.dark` class as its equal alias). A block that set the
183
+ * light seed only would keep a mid-dark fill on a dark canvas and nothing would say so.
184
+ * ──────────────────────────────────────────────────────────────────────────────────────────── */
185
+ const THEME_CSS = `
186
+ [data-godx-theme="godx"] { --primary: 268.7 100% 50%; --primary-foreground: 0 0% 100%; }
187
+ [data-godx-theme="indigo"] { --primary: 244.5 57.9% 50.6%; --primary-foreground: 0 0% 100%; }
188
+ [data-godx-theme="teal"] { --primary: 175.3 77.4% 26.1%; --primary-foreground: 0 0% 100%; }
189
+ [data-godx-theme="amber"] { --primary: 26 90.5% 37.1%; --primary-foreground: 0 0% 100%; }
190
+ [data-godx-theme="rose"] { --primary: 345.3 82.7% 40.8%; --primary-foreground: 0 0% 100%; }
191
+
192
+ :root[data-theme="dark"] [data-godx-theme="godx"], .dark [data-godx-theme="godx"] { --primary: 268.7 100% 86.9%; --primary-foreground: 0 0% 0%; }
193
+ :root[data-theme="dark"] [data-godx-theme="indigo"], .dark [data-godx-theme="indigo"] { --primary: 229.7 93.5% 81.8%; --primary-foreground: 0 0% 0%; }
194
+ :root[data-theme="dark"] [data-godx-theme="teal"], .dark [data-godx-theme="teal"] { --primary: 170.6 76.9% 64.3%; --primary-foreground: 0 0% 0%; }
195
+ :root[data-theme="dark"] [data-godx-theme="amber"], .dark [data-godx-theme="amber"] { --primary: 45.9 96.7% 64.5%; --primary-foreground: 0 0% 0%; }
196
+ :root[data-theme="dark"] [data-godx-theme="rose"], .dark [data-godx-theme="rose"] { --primary: 352.6 95.7% 81.8%; --primary-foreground: 0 0% 0%; }
197
+
198
+ /* TRAP 1 — --ring is a public ROLE, not an \`initial\` knob (src/tokens/derived.css declares
199
+ * \`--ring: var(--primary)\` at :root and explains why it must stay a role). It therefore freezes on
200
+ * the ROOT seed, and every focus ring on this board stayed violet until this line existed. One
201
+ * declaration inside the scope re-resolves it against the scope's own --primary. */
202
+ [data-godx-theme] { --ring: var(--primary); }
203
+
204
+ /* TRAP 2 — the radius scale freezes the same way, one tier up: the six steps are
205
+ * \`calc(var(--radius) · φⁿ)\` declared at :root, and four component knobs mirror them from :root
206
+ * too. Scoping --radius alone moved nothing at all; the scope has to restate the chain. */
207
+ [data-godx-corner="sharp"] { --radius: 0rem; }
208
+ [data-godx-corner="default"] { --radius: 0.375rem; }
209
+ [data-godx-corner="soft"] { --radius: 0.875rem; }
210
+ [data-godx-corner] {
211
+ --radius-xs: calc(var(--radius) / var(--radius-ratio) / var(--radius-ratio) / var(--radius-ratio));
212
+ --radius-sm: calc(var(--radius) / var(--radius-ratio) / var(--radius-ratio));
213
+ --radius-md: calc(var(--radius) / var(--radius-ratio));
214
+ --radius-lg: var(--radius);
215
+ --radius-xl: calc(var(--radius) * var(--radius-ratio));
216
+ --radius-2xl: calc(var(--radius) * var(--radius-ratio) * var(--radius-ratio));
217
+ --card-radius: var(--radius-xl);
218
+ --control-radius: var(--radius);
219
+ --button-radius: var(--radius-md);
220
+ --badge-radius: var(--radius-md);
221
+ }
222
+ `;
223
+
224
+ /** The hex each palette chip stands for, in the LIGHT theme — what the Swatch beside it samples. */
225
+ const PALETTE_SEED: Record<string, string> = {
226
+ godx: "#7A00FF",
227
+ indigo: "#4338CA",
228
+ teal: "#0F766E",
229
+ amber: "#B45309",
230
+ rose: "#BE123C",
231
+ };
232
+
233
+ /* ── Data. Ids, hex, people's names and amounts are DATA and stay as they are; every label that
234
+ * describes them is a message key. Hosts use RFC 2606 reserved names. ────────────────────────── */
235
+
236
+ /** 71 characters, no space, no hyphenation opportunity a browser will take. The string exists to
237
+ * prove the board survives one: it sits in a Descriptions value, a Timeline title and a table
238
+ * cell, each of which has to decide between truncating it and pushing its neighbour off the row. */
239
+ const UNBREAKABLE = "THEME_SEED_LEDGER_0007_CONTRAST_VERIFIED_AGAINST_CANVAS_AND_LABEL_00042";
240
+
241
+ const REGION_CODES = ["JP", "VN", "DE", "BR", "IN"] as const;
242
+
243
+ const RELEASE_ROWS = [
244
+ {
245
+ id: "RLS-2026-0912",
246
+ ref: UNBREAKABLE,
247
+ owner: "佐藤 玲",
248
+ initials: "佐",
249
+ region: "JP",
250
+ currency: "JPY",
251
+ amount: 1_284_000,
252
+ tone: "success" as BadgeTone,
253
+ statusKey: "shipped",
254
+ },
255
+ {
256
+ id: "RLS-2026-0913",
257
+ ref: "RLS-13",
258
+ owner: "Nguyễn Thị Hương Giang",
259
+ initials: "NG",
260
+ region: "VN",
261
+ currency: "VND",
262
+ amount: 41_500_000,
263
+ tone: "warning" as BadgeTone,
264
+ statusKey: "review",
265
+ },
266
+ {
267
+ id: "RLS-2026-0914",
268
+ ref: "",
269
+ owner: "A",
270
+ initials: "A",
271
+ region: "DE",
272
+ currency: "EUR",
273
+ amount: 0,
274
+ tone: "muted" as BadgeTone,
275
+ statusKey: "draft",
276
+ },
277
+ {
278
+ id: "RLS-2026-0915",
279
+ ref: "RLS-15-BUILD-ARTEFACT",
280
+ owner: "Ana Beatriz Gonçalves de Almeida",
281
+ initials: "AB",
282
+ region: "BR",
283
+ currency: "BRL",
284
+ amount: 87_640.5,
285
+ tone: "destructive" as BadgeTone,
286
+ statusKey: "failed",
287
+ },
288
+ ] as const;
289
+
290
+ const AVATARS = [
291
+ { initials: "佐", presence: "online" as const },
292
+ { initials: "NG", presence: "busy" as const },
293
+ { initials: "AB", presence: "away" as const },
294
+ { initials: "Д", presence: "offline" as const },
295
+ ];
296
+
297
+ export default function ThemeCustomizationShowcase() {
298
+ const { t, locale } = useTranslation();
299
+ const boardRef = React.useRef<HTMLDivElement>(null);
300
+
301
+ const [palette, setPalette] = React.useState("godx");
302
+ const [corner, setCorner] = React.useState("default");
303
+ const [custom, setCustom] = React.useState("#0F62FE");
304
+ const [regions, setRegions] = React.useState<string[]>(["JP", "VN"]);
305
+ const [labels, setLabels] = React.useState<string[]>(["本番", "ổn định", UNBREAKABLE]);
306
+ const [plan, setPlan] = React.useState("standard");
307
+ const [channels, setChannels] = React.useState<string[]>(["email"]);
308
+ const [cadence, setCadence] = React.useState("weekly");
309
+ const [density, setDensity] = React.useState("comfortable");
310
+ const [autoDeploy, setAutoDeploy] = React.useState(true);
311
+ const [budget, setBudget] = React.useState<number[]>([40]);
312
+ const [score, setScore] = React.useState(3.5);
313
+ const [secret, setSecret] = React.useState("");
314
+ const [confirmOpen, setConfirmOpen] = React.useState(false);
315
+
316
+ /* The CUSTOM chip takes the other documented road to the same seed: `applyPrimaryColor` computes
317
+ * `--primary`, picks `--primary-foreground` by the fill's own luminance, resets the four derived
318
+ * knobs so an ancestor's literal cannot outrank the new seed, and — note — sets `--ring` itself,
319
+ * for exactly the reason trap 1 above exists. It writes to this element, so it is scoped too.
320
+ * It does NOT lift the seed for a dark canvas; that is what `pnpm gen:brand` is for. */
321
+ React.useEffect(() => {
322
+ const root = boardRef.current;
323
+ if (!root || palette !== "custom") return;
324
+ return applyPrimaryColor(root, custom);
325
+ }, [palette, custom]);
326
+
327
+ const money = (amount: number, currency: string) =>
328
+ new Intl.NumberFormat(locale, { style: "currency", currency }).format(amount);
329
+ const regionName = (code: string) =>
330
+ new Intl.DisplayNames([locale], { type: "region" }).of(code) ?? code;
331
+ const shortDate = (iso: string) =>
332
+ new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeZone: "UTC" }).format(new Date(iso));
333
+ const percent = (value: number) =>
334
+ new Intl.NumberFormat(locale, { style: "percent", maximumFractionDigits: 1 }).format(value);
335
+ const regionList = new Intl.ListFormat(locale, { style: "long", type: "conjunction" }).format(
336
+ regions.map(regionName),
337
+ );
338
+ /* The counted noun is a CLDR CATEGORY MAP in the catalog; `t()` selects the category with
339
+ * `Intl.PluralRules` for the active locale and formats the number with `Intl.NumberFormat`.
340
+ * "1 regions" is a bug, and a single template is how you ship one. */
341
+ const seatNoun = t("themeShowcase.dashboard.seats", { count: regions.length });
342
+
343
+ const paletteOptions = ["godx", "indigo", "teal", "amber", "rose", "custom"].map((id) => ({
344
+ value: id,
345
+ label: (
346
+ <Flex as="span" align="center" gap="xs">
347
+ <Swatch color={id === "custom" ? custom : PALETTE_SEED[id]} />
348
+ <Text as="span" size="xs">
349
+ {t(`themeShowcase.palette.${id}`)}
350
+ </Text>
351
+ </Flex>
352
+ ),
353
+ }));
354
+
355
+ const timelineItems: TimelineItem[] = [
356
+ {
357
+ title: t("themeShowcase.timeline.seedApplied"),
358
+ location: t("themeShowcase.timeline.scope"),
359
+ time: shortDate("2026-09-12T09:30:00Z"),
360
+ status: "done",
361
+ },
362
+ {
363
+ /* A title with an intrinsic width of its own: it must shrink rather than push `time` off the
364
+ * end of the row. Every other item here is a short string, which can never show that. */
365
+ title: (
366
+ <Text truncate mono>
367
+ {UNBREAKABLE}
368
+ </Text>
369
+ ),
370
+ time: shortDate("2026-09-12T11:18:00Z"),
371
+ status: "current",
372
+ },
373
+ { title: t("themeShowcase.timeline.contrastQueued"), status: "pending" },
374
+ ];
375
+
376
+ return (
377
+ <div ref={boardRef} data-godx-theme={palette} data-godx-corner={corner}>
378
+ <style>{THEME_CSS}</style>
379
+ <PageContainer
380
+ title={t("themeShowcase.page.title")}
381
+ subtitle={t("themeShowcase.page.subtitle")}
382
+ extra={{
383
+ end: (
384
+ <Flex align="center" gap="sm" wrap>
385
+ <AppSettingPicker kind="locale" appearance="bar" />
386
+ <AppSettingToggle kind="theme" appearance="bar" />
387
+ </Flex>
388
+ ),
389
+ }}
390
+ >
391
+ <Flex direction="col" gap="lg">
392
+ {/* ── The theme bar: seed, corner, custom hex ─────────────────────────────────── */}
393
+ <Card>
394
+ <CardHeader>
395
+ <CardTitle level={2}>{t("themeShowcase.bar.title")}</CardTitle>
396
+ <CardDescription>{t("themeShowcase.bar.description")}</CardDescription>
397
+ </CardHeader>
398
+ <CardContent>
399
+ <Flex direction="col" gap="md">
400
+ <Segmented
401
+ aria-label={t("themeShowcase.bar.paletteLabel")}
402
+ value={palette}
403
+ onValueChange={setPalette}
404
+ options={paletteOptions}
405
+ />
406
+ <Flex direction={{ base: "col", md: "row" }} gap="md" align="start">
407
+ <Segmented
408
+ aria-label={t("themeShowcase.bar.cornerLabel")}
409
+ value={corner}
410
+ onValueChange={setCorner}
411
+ size="sm"
412
+ options={[
413
+ { value: "sharp", label: t("themeShowcase.corner.sharp") },
414
+ { value: "default", label: t("themeShowcase.corner.default") },
415
+ { value: "soft", label: t("themeShowcase.corner.soft") },
416
+ ]}
417
+ />
418
+ <FormField
419
+ id="theme-seed"
420
+ label={t("themeShowcase.bar.customLabel")}
421
+ helper={t("themeShowcase.bar.customHint")}
422
+ >
423
+ <ColorPicker
424
+ id="theme-seed"
425
+ value={custom}
426
+ onValueChange={(next) => {
427
+ setCustom(next);
428
+ setPalette("custom");
429
+ }}
430
+ />
431
+ </FormField>
432
+ </Flex>
433
+ <Text size="xs" tone="muted">
434
+ {t("themeShowcase.bar.identityNote")}
435
+ </Text>
436
+ </Flex>
437
+ </CardContent>
438
+ </Card>
439
+
440
+ {/* ── The board ───────────────────────────────────────────────────────────────── */}
441
+ <Card>
442
+ <CardContent flush>
443
+ <Tabs
444
+ defaultValue="components"
445
+ variant="line"
446
+ bodied
447
+ items={[
448
+ {
449
+ value: "components",
450
+ label: t("themeShowcase.tabs.components"),
451
+ content: (
452
+ <ComponentsBoard
453
+ t={t}
454
+ locale={locale}
455
+ regions={regions}
456
+ setRegions={setRegions}
457
+ regionList={regionList}
458
+ labels={labels}
459
+ setLabels={setLabels}
460
+ plan={plan}
461
+ setPlan={setPlan}
462
+ channels={channels}
463
+ setChannels={setChannels}
464
+ cadence={cadence}
465
+ setCadence={setCadence}
466
+ density={density}
467
+ setDensity={setDensity}
468
+ autoDeploy={autoDeploy}
469
+ setAutoDeploy={setAutoDeploy}
470
+ budget={budget}
471
+ setBudget={setBudget}
472
+ score={score}
473
+ setScore={setScore}
474
+ secret={secret}
475
+ setSecret={setSecret}
476
+ confirmOpen={confirmOpen}
477
+ setConfirmOpen={setConfirmOpen}
478
+ percent={percent}
479
+ />
480
+ ),
481
+ },
482
+ {
483
+ value: "dashboard",
484
+ label: t("themeShowcase.tabs.dashboard"),
485
+ content: (
486
+ <DashboardBoard
487
+ t={t}
488
+ money={money}
489
+ regionName={regionName}
490
+ shortDate={shortDate}
491
+ percent={percent}
492
+ seatNoun={seatNoun}
493
+ timelineItems={timelineItems}
494
+ locale={locale}
495
+ />
496
+ ),
497
+ },
498
+ ]}
499
+ />
500
+ </CardContent>
501
+ </Card>
502
+ </Flex>
503
+ </PageContainer>
504
+ </div>
505
+ );
506
+ }
507
+
508
+ type Translate = (key: string, params?: Record<string, string | number>) => string;
509
+
510
+ /* ── Tab 1 · COMPONENTS — the dense inventory ─────────────────────────────────────────────── */
511
+ function ComponentsBoard(props: {
512
+ t: Translate;
513
+ locale: string;
514
+ regions: string[];
515
+ setRegions: (next: string[]) => void;
516
+ regionList: string;
517
+ labels: string[];
518
+ setLabels: (next: string[]) => void;
519
+ plan: string;
520
+ setPlan: (next: string) => void;
521
+ channels: string[];
522
+ setChannels: (next: string[]) => void;
523
+ cadence: string;
524
+ setCadence: (next: string) => void;
525
+ density: string;
526
+ setDensity: (next: string) => void;
527
+ autoDeploy: boolean;
528
+ setAutoDeploy: (next: boolean) => void;
529
+ budget: number[];
530
+ setBudget: (next: number[]) => void;
531
+ score: number;
532
+ setScore: (next: number) => void;
533
+ secret: string;
534
+ setSecret: (next: string) => void;
535
+ confirmOpen: boolean;
536
+ setConfirmOpen: (next: boolean) => void;
537
+ percent: (value: number) => string;
538
+ }) {
539
+ const {
540
+ t,
541
+ regions,
542
+ setRegions,
543
+ regionList,
544
+ labels,
545
+ setLabels,
546
+ plan,
547
+ setPlan,
548
+ channels,
549
+ setChannels,
550
+ cadence,
551
+ setCadence,
552
+ density,
553
+ setDensity,
554
+ autoDeploy,
555
+ setAutoDeploy,
556
+ budget,
557
+ setBudget,
558
+ score,
559
+ setScore,
560
+ secret,
561
+ setSecret,
562
+ confirmOpen,
563
+ setConfirmOpen,
564
+ percent,
565
+ } = props;
566
+
567
+ return (
568
+ <ResponsiveGrid columns={{ base: 1, sm: 2, lg: 3 }} gap="lg" align="start">
569
+ {/* 1 · text entry */}
570
+ <Flex direction="col" gap="md">
571
+ <FormField
572
+ id="board-email"
573
+ label={t("themeShowcase.form.email")}
574
+ helper={t("themeShowcase.form.emailHint")}
575
+ >
576
+ <Input
577
+ id="board-email"
578
+ type="email"
579
+ autoComplete="email"
580
+ prefix={<Mail aria-hidden="true" />}
581
+ placeholder={t("themeShowcase.form.emailPlaceholder")}
582
+ defaultValue="release-desk@ops.example.jp"
583
+ />
584
+ </FormField>
585
+ <FormField id="board-handle" label={t("themeShowcase.form.handle")}>
586
+ <Input
587
+ id="board-handle"
588
+ addonBefore={<AtSign aria-hidden="true" />}
589
+ defaultValue="release-desk"
590
+ count={{ max: 24, show: true }}
591
+ />
592
+ </FormField>
593
+ </Flex>
594
+
595
+ {/* 2 · multi-select with removable tags + free tags */}
596
+ <Flex direction="col" gap="md">
597
+ <FormField
598
+ id="board-regions"
599
+ label={t("themeShowcase.form.regions")}
600
+ helper={regions.length > 0 ? regionList : t("themeShowcase.form.regionsEmpty")}
601
+ >
602
+ <Select
603
+ id="board-regions"
604
+ mode="multiple"
605
+ maxTagCount={2}
606
+ value={regions}
607
+ onValueChange={setRegions}
608
+ placeholder={t("themeShowcase.form.regionsPlaceholder")}
609
+ options={REGION_CODES.map((code) => ({
610
+ value: code,
611
+ label: new Intl.DisplayNames([props.locale], { type: "region" }).of(code) ?? code,
612
+ }))}
613
+ />
614
+ </FormField>
615
+ <FormField id="board-labels" label={t("themeShowcase.form.labels")}>
616
+ <TagInput
617
+ id="board-labels"
618
+ value={labels}
619
+ onValueChange={setLabels}
620
+ maxTagCount={2}
621
+ placeholder={t("themeShowcase.form.labelsPlaceholder")}
622
+ />
623
+ </FormField>
624
+ </Flex>
625
+
626
+ {/* 3 · dropdown + date */}
627
+ <Flex direction="col" gap="md">
628
+ <FormField id="board-plan" label={t("themeShowcase.form.plan")}>
629
+ <Select
630
+ id="board-plan"
631
+ value={plan}
632
+ onValueChange={setPlan}
633
+ options={[
634
+ { value: "starter", label: t("themeShowcase.plan.starter") },
635
+ { value: "standard", label: t("themeShowcase.plan.standard") },
636
+ { value: "scale", label: t("themeShowcase.plan.scale") },
637
+ ]}
638
+ />
639
+ </FormField>
640
+ <FormField id="board-date" label={t("themeShowcase.form.releaseDate")}>
641
+ <DatePicker id="board-date" defaultValue={new Date("2026-09-12T00:00:00Z")} />
642
+ </FormField>
643
+ </Flex>
644
+
645
+ {/* 4 · checkboxes — a three-line label beside a one-word one, and a disabled row */}
646
+ <Flex direction="col" gap="md">
647
+ <Text size="xs" tone="muted" weight="medium">
648
+ {t("themeShowcase.form.channels")}
649
+ </Text>
650
+ <CheckboxGroup
651
+ name="board-channels"
652
+ value={channels}
653
+ onValueChange={setChannels}
654
+ options={[
655
+ { value: "email", label: t("themeShowcase.channel.email") },
656
+ {
657
+ value: "escalation",
658
+ label: t("themeShowcase.channel.escalation"),
659
+ description: t("themeShowcase.channel.escalationHint"),
660
+ },
661
+ { value: "pager", label: t("themeShowcase.channel.pager"), disabled: true },
662
+ ]}
663
+ />
664
+ </Flex>
665
+
666
+ {/* 5 · radios + segmented */}
667
+ <Flex direction="col" gap="md">
668
+ <Text size="xs" tone="muted" weight="medium">
669
+ {t("themeShowcase.form.cadence")}
670
+ </Text>
671
+ <RadioGroup
672
+ name="board-cadence"
673
+ value={cadence}
674
+ onValueChange={setCadence}
675
+ orientation="horizontal"
676
+ options={[
677
+ { value: "daily", label: t("themeShowcase.cadence.daily") },
678
+ { value: "weekly", label: t("themeShowcase.cadence.weekly") },
679
+ { value: "manual", label: t("themeShowcase.cadence.manual") },
680
+ ]}
681
+ />
682
+ <Segmented
683
+ aria-label={t("themeShowcase.form.density")}
684
+ value={density}
685
+ onValueChange={setDensity}
686
+ size="sm"
687
+ options={[
688
+ { value: "compact", label: t("themeShowcase.density.compact") },
689
+ { value: "default", label: t("themeShowcase.density.default") },
690
+ { value: "comfortable", label: t("themeShowcase.density.comfortable") },
691
+ ]}
692
+ />
693
+ </Flex>
694
+
695
+ {/* 6 · switch + slider + activity */}
696
+ <Flex direction="col" gap="md">
697
+ <Field
698
+ id="board-auto"
699
+ label={t("themeShowcase.form.autoDeploy")}
700
+ description={t("themeShowcase.form.autoDeployHint")}
701
+ >
702
+ <Switch id="board-auto" checked={autoDeploy} onCheckedChange={setAutoDeploy} />
703
+ </Field>
704
+ <Field id="board-freeze" label={t("themeShowcase.form.freeze")}>
705
+ <Switch id="board-freeze" loading defaultChecked />
706
+ </Field>
707
+ <FormField
708
+ id="board-budget"
709
+ label={t("themeShowcase.form.budget", { value: percent(budget[0] / 100) })}
710
+ >
711
+ <Slider id="board-budget" value={budget} onValueChange={setBudget} />
712
+ </FormField>
713
+ <Activity label={t("themeShowcase.form.syncing")} />
714
+ </Flex>
715
+
716
+ {/* 7 · steps */}
717
+ <Flex direction="col" gap="md">
718
+ <Text size="xs" tone="muted" weight="medium">
719
+ {t("themeShowcase.steps.caption")}
720
+ </Text>
721
+ <Steps
722
+ value={1}
723
+ percent={62}
724
+ orientation="vertical"
725
+ items={[
726
+ {
727
+ title: t("themeShowcase.steps.finished"),
728
+ description: t("themeShowcase.steps.finishedHint"),
729
+ },
730
+ { title: t("themeShowcase.steps.inProcess") },
731
+ {
732
+ title: t("themeShowcase.steps.waiting"),
733
+ description: t("themeShowcase.steps.waitingHint"),
734
+ },
735
+ ]}
736
+ />
737
+ </Flex>
738
+
739
+ {/* 8 · progress: bar, ring, breakdown + legend */}
740
+ <Flex direction="col" gap="md">
741
+ <Progress
742
+ value={62}
743
+ label={t("themeShowcase.progress.rollout", { value: percent(0.62) })}
744
+ />
745
+ <Progress
746
+ value={94}
747
+ tone="warning"
748
+ label={t("themeShowcase.progress.quota", { value: percent(0.94) })}
749
+ />
750
+ <Flex align="center" gap="md" wrap>
751
+ <Progress shape="ring" value={18} label="18/42" />
752
+ <Progress
753
+ shape="ring"
754
+ value={100}
755
+ tone="success"
756
+ label={t("themeShowcase.progress.done")}
757
+ />
758
+ </Flex>
759
+ <Progress
760
+ segments={[
761
+ { value: 2, tone: "destructive", label: t("themeShowcase.legend.failed") },
762
+ { value: 3, tone: "warning", label: t("themeShowcase.legend.review") },
763
+ { value: 12, tone: "success", label: t("themeShowcase.legend.shipped") },
764
+ ]}
765
+ />
766
+ <Legend
767
+ items={[
768
+ { tone: "destructive", label: t("themeShowcase.legend.failed") },
769
+ { tone: "warning", label: t("themeShowcase.legend.review") },
770
+ { tone: "success", label: t("themeShowcase.legend.shipped") },
771
+ ]}
772
+ />
773
+ </Flex>
774
+
775
+ {/* 9 · status marks — never colour alone: every dot carries its word */}
776
+ <Flex direction="col" gap="md">
777
+ <Text size="xs" tone="muted" weight="medium">
778
+ {t("themeShowcase.status.caption")}
779
+ </Text>
780
+ <Flex gap="xs" wrap>
781
+ <Badge tone="success">{t("themeShowcase.status.success")}</Badge>
782
+ <Badge tone="destructive">{t("themeShowcase.status.error")}</Badge>
783
+ <Badge tone="muted">{t("themeShowcase.status.default")}</Badge>
784
+ <Badge tone="info">{t("themeShowcase.status.processing")}</Badge>
785
+ <Badge tone="warning">{t("themeShowcase.status.warning")}</Badge>
786
+ <Badge tone="primary" variant="outline">
787
+ {t("themeShowcase.status.seed")}
788
+ </Badge>
789
+ </Flex>
790
+ <Flex gap="xs" wrap>
791
+ <Button size="sm">{t("themeShowcase.action.primary")}</Button>
792
+ <Button size="sm" variant="secondary">
793
+ {t("themeShowcase.action.secondary")}
794
+ </Button>
795
+ <Button size="sm" variant="outline">
796
+ {t("themeShowcase.action.outline")}
797
+ </Button>
798
+ <Button size="sm" variant="dashed">
799
+ {t("themeShowcase.action.dashed")}
800
+ </Button>
801
+ <Button size="sm" variant="ghost">
802
+ {t("themeShowcase.action.ghost")}
803
+ </Button>
804
+ <Button size="sm" loading loadingText={t("themeShowcase.action.deploying")}>
805
+ {t("themeShowcase.action.deploying")}
806
+ </Button>
807
+ <Tooltip>
808
+ <TooltipTrigger asChild>
809
+ <Button
810
+ size="icon-sm"
811
+ variant="outline"
812
+ aria-label={t("themeShowcase.action.discard")}
813
+ >
814
+ <Trash2 aria-hidden="true" />
815
+ </Button>
816
+ </TooltipTrigger>
817
+ <TooltipContent>{t("themeShowcase.action.discard")}</TooltipContent>
818
+ </Tooltip>
819
+ </Flex>
820
+ </Flex>
821
+
822
+ {/* 10 · confirm popover + avatar stack */}
823
+ <Flex direction="col" gap="md">
824
+ <Popover open={confirmOpen} onOpenChange={setConfirmOpen}>
825
+ <PopoverTrigger asChild>
826
+ <Button variant="outline" size="sm">
827
+ {t("themeShowcase.confirm.trigger")}
828
+ </Button>
829
+ </PopoverTrigger>
830
+ <PopoverContent>
831
+ <PopoverHeader>
832
+ <PopoverTitle>{t("themeShowcase.confirm.title")}</PopoverTitle>
833
+ <PopoverDescription>{t("themeShowcase.confirm.description")}</PopoverDescription>
834
+ </PopoverHeader>
835
+ <Flex gap="xs" justify="end">
836
+ <Button size="xs" variant="ghost" onClick={() => setConfirmOpen(false)}>
837
+ {t("themeShowcase.confirm.cancel")}
838
+ </Button>
839
+ <Button size="xs" variant="destructive" onClick={() => setConfirmOpen(false)}>
840
+ {t("themeShowcase.confirm.ok")}
841
+ </Button>
842
+ </Flex>
843
+ </PopoverContent>
844
+ </Popover>
845
+ <Flex align="center" gap="xs" wrap>
846
+ {AVATARS.map((person) => (
847
+ <Avatar key={person.initials} size="sm" presence={person.presence}>
848
+ <AvatarFallback>{person.initials}</AvatarFallback>
849
+ </Avatar>
850
+ ))}
851
+ <Avatar size="sm" appearance="tinted">
852
+ <AvatarFallback>+8</AvatarFallback>
853
+ </Avatar>
854
+ <Text size="xs" tone="muted">
855
+ {t("themeShowcase.avatars.caption")}
856
+ </Text>
857
+ </Flex>
858
+ <Rating
859
+ value={score}
860
+ onValueChange={setScore}
861
+ allowHalf
862
+ tooltips={[
863
+ t("themeShowcase.rating.1"),
864
+ t("themeShowcase.rating.2"),
865
+ t("themeShowcase.rating.3"),
866
+ t("themeShowcase.rating.4"),
867
+ t("themeShowcase.rating.5"),
868
+ ]}
869
+ />
870
+ <Rating value={4} readOnly />
871
+ </Flex>
872
+
873
+ {/* 11 · OTP verification card */}
874
+ <Card variant="outline">
875
+ <CardHeader>
876
+ <CardTitle level={3}>{t("themeShowcase.otp.title")}</CardTitle>
877
+ <CardDescription>{t("themeShowcase.otp.description")}</CardDescription>
878
+ </CardHeader>
879
+ <CardContent>
880
+ <InputOTP
881
+ maxLength={6}
882
+ align="center"
883
+ pattern="[0-9]*"
884
+ aria-label={t("themeShowcase.otp.field")}
885
+ >
886
+ <InputOTPGroup>
887
+ <InputOTPSlot index={0} />
888
+ <InputOTPSlot index={1} />
889
+ <InputOTPSlot index={2} />
890
+ <InputOTPSlot index={3} />
891
+ <InputOTPSlot index={4} />
892
+ <InputOTPSlot index={5} />
893
+ </InputOTPGroup>
894
+ </InputOTP>
895
+ </CardContent>
896
+ <CardFooter>
897
+ <Button fullWidth>{t("themeShowcase.otp.verify")}</Button>
898
+ </CardFooter>
899
+ </Card>
900
+
901
+ {/* 12 · sign-up card with a divider and two identity handoffs */}
902
+ <Card variant="outline">
903
+ <CardHeader>
904
+ <CardTitle level={3}>{t("themeShowcase.signup.title")}</CardTitle>
905
+ <CardDescription>{t("themeShowcase.signup.description")}</CardDescription>
906
+ </CardHeader>
907
+ <CardContent>
908
+ <Flex direction="col" gap="md">
909
+ <FormField id="signup-email" label={t("themeShowcase.signup.email")}>
910
+ <Input
911
+ id="signup-email"
912
+ type="email"
913
+ autoComplete="email"
914
+ placeholder="you@example.jp"
915
+ />
916
+ </FormField>
917
+ <FormField id="signup-secret" label={t("themeShowcase.signup.password")}>
918
+ <PasswordInput
919
+ id="signup-secret"
920
+ value={secret}
921
+ onChange={(event) => setSecret(event.target.value)}
922
+ autoComplete="new-password"
923
+ />
924
+ </FormField>
925
+ <PasswordStrength value={secret} />
926
+ <Button fullWidth>{t("themeShowcase.signup.submit")}</Button>
927
+ <AuthDivider label={t("themeShowcase.signup.or")} />
928
+ <Button variant="outline" fullWidth>
929
+ <ShieldCheck aria-hidden="true" />
930
+ {t("themeShowcase.signup.sso")}
931
+ </Button>
932
+ <Button variant="outline" fullWidth>
933
+ <Fingerprint aria-hidden="true" />
934
+ {t("themeShowcase.signup.passkey")}
935
+ </Button>
936
+ </Flex>
937
+ </CardContent>
938
+ </Card>
939
+
940
+ {/* 13 · notifications — one row with every slot filled, one with only a title */}
941
+ <Card variant="outline">
942
+ <CardHeader>
943
+ <CardTitle level={3}>{t("themeShowcase.notify.title")}</CardTitle>
944
+ <CardAction>
945
+ <Badge tone="info">2</Badge>
946
+ </CardAction>
947
+ </CardHeader>
948
+ <CardContent flush>
949
+ <Flex as="ul" marker="none" direction="col" gap="none">
950
+ <ListRow
951
+ as="li"
952
+ unread
953
+ align="start"
954
+ overflow="wrap"
955
+ leading={<Bell aria-hidden="true" />}
956
+ title={t("themeShowcase.notify.longTitle")}
957
+ description={t("themeShowcase.notify.longMeta")}
958
+ trailing={
959
+ <Button size="xs" variant="outline">
960
+ {t("themeShowcase.notify.open")}
961
+ </Button>
962
+ }
963
+ />
964
+ <ListRow
965
+ as="li"
966
+ align="start"
967
+ overflow="wrap"
968
+ title={t("themeShowcase.notify.bareTitle")}
969
+ />
970
+ </Flex>
971
+ </CardContent>
972
+ </Card>
973
+
974
+ {/* 14 · enrolment QR + the manual fallback */}
975
+ <Flex direction="col" gap="md">
976
+ <Text size="xs" tone="muted" weight="medium">
977
+ {t("themeShowcase.qr.caption")}
978
+ </Text>
979
+ <QrCode
980
+ value="otpauth://totp/ops.example.jp:release-desk?secret=JBSWY3DPEHPK3PXP&issuer=ops.example.jp"
981
+ label={t("themeShowcase.qr.label")}
982
+ size="md"
983
+ />
984
+ <CredentialReveal
985
+ secret="JBSW Y3DP EHPK 3PXP"
986
+ label={t("themeShowcase.qr.manualKey")}
987
+ warning={null}
988
+ />
989
+ </Flex>
990
+
991
+ {/* 15 · assistant surfaces — Welcome, ChatBubble (full · bare · pending), ThoughtChain */}
992
+ <Flex direction="col" gap="md">
993
+ <Welcome
994
+ icon={<Icon as={CircleUserRound} size="lg" tone="primary" />}
995
+ title={t("themeShowcase.welcome.title")}
996
+ description={t("themeShowcase.welcome.description")}
997
+ extra={
998
+ <Button size="xs" variant="ghost">
999
+ {t("themeShowcase.welcome.dismiss")}
1000
+ </Button>
1001
+ }
1002
+ />
1003
+ <ChatBubble
1004
+ placement="start"
1005
+ avatar={
1006
+ <Avatar size="sm" aria-hidden="true">
1007
+ <AvatarFallback>AI</AvatarFallback>
1008
+ </Avatar>
1009
+ }
1010
+ header={t("themeShowcase.chat.assistant")}
1011
+ footer={t("themeShowcase.chat.sent")}
1012
+ >
1013
+ {t("themeShowcase.chat.answer")}
1014
+ </ChatBubble>
1015
+ <ChatBubble placement="end">{t("themeShowcase.chat.bare")}</ChatBubble>
1016
+ <ChatBubble placement="start" header={t("themeShowcase.chat.assistant")} loading />
1017
+ <ThoughtChain
1018
+ label={t("themeShowcase.thought.label")}
1019
+ defaultExpandedKeys={["contrast"]}
1020
+ items={[
1021
+ {
1022
+ key: "read",
1023
+ title: t("themeShowcase.thought.read"),
1024
+ description: t("themeShowcase.thought.readHint"),
1025
+ status: "success",
1026
+ },
1027
+ {
1028
+ key: "contrast",
1029
+ title: t("themeShowcase.thought.contrast"),
1030
+ content: t("themeShowcase.thought.contrastBody"),
1031
+ collapsible: true,
1032
+ status: "loading",
1033
+ },
1034
+ { key: "write", title: t("themeShowcase.thought.write"), status: "error" },
1035
+ ]}
1036
+ />
1037
+ </Flex>
1038
+
1039
+ {/* 16 · carousel */}
1040
+ <Flex direction="col" gap="md">
1041
+ <Text size="xs" tone="muted" weight="medium">
1042
+ {t("themeShowcase.carousel.caption")}
1043
+ </Text>
1044
+ <Carousel opts={{ loop: true }}>
1045
+ <CarouselContent>
1046
+ {["godx", "indigo", "teal", "amber", "rose"].map((id) => (
1047
+ <CarouselItem key={id}>
1048
+ <Card variant="muted">
1049
+ <CardContent>
1050
+ <Flex align="center" gap="sm">
1051
+ <Swatch
1052
+ color={PALETTE_SEED[id]}
1053
+ aria-label={t(`themeShowcase.palette.${id}`)}
1054
+ />
1055
+ <Flex direction="col" gap="none">
1056
+ <Text weight="medium">{t(`themeShowcase.palette.${id}`)}</Text>
1057
+ <Text size="xs" tone="muted" mono>
1058
+ {PALETTE_SEED[id]}
1059
+ </Text>
1060
+ </Flex>
1061
+ </Flex>
1062
+ </CardContent>
1063
+ </Card>
1064
+ </CarouselItem>
1065
+ ))}
1066
+ </CarouselContent>
1067
+ <CarouselPrevious />
1068
+ <CarouselNext />
1069
+ <CarouselDots />
1070
+ </Carousel>
1071
+ </Flex>
1072
+
1073
+ {/* 17 · an alert that is not tidy: a long body beside a one-word title */}
1074
+ <Flex direction="col" gap="md">
1075
+ <Alert tone="warning">
1076
+ <AlertTitle>{t("themeShowcase.alert.title")}</AlertTitle>
1077
+ <AlertDescription>{t("themeShowcase.alert.description")}</AlertDescription>
1078
+ </Alert>
1079
+ <Alert tone="success">
1080
+ <AlertTitle>{t("themeShowcase.alert.okTitle")}</AlertTitle>
1081
+ </Alert>
1082
+ </Flex>
1083
+ </ResponsiveGrid>
1084
+ );
1085
+ }
1086
+
1087
+ /* ── Tab 2 · DASHBOARD ─────────────────────────────────────────────────────────────────────── */
1088
+ function DashboardBoard(props: {
1089
+ t: Translate;
1090
+ money: (amount: number, currency: string) => string;
1091
+ regionName: (code: string) => string;
1092
+ shortDate: (iso: string) => string;
1093
+ percent: (value: number) => string;
1094
+ seatNoun: string;
1095
+ timelineItems: TimelineItem[];
1096
+ locale: string;
1097
+ }) {
1098
+ const { t, money, regionName, shortDate, percent, seatNoun, timelineItems, locale } = props;
1099
+
1100
+ return (
1101
+ <Flex direction="col" gap="lg">
1102
+ <ResponsiveGrid columns={{ base: 1, sm: 2, lg: 4 }} gap="md">
1103
+ <StatCard
1104
+ label={t("themeShowcase.dashboard.releases")}
1105
+ value={new Intl.NumberFormat(locale).format(1284)}
1106
+ delta="+12%"
1107
+ hint={t("themeShowcase.dashboard.releasesHint")}
1108
+ />
1109
+ <StatCard
1110
+ label={t("themeShowcase.dashboard.revenue")}
1111
+ value={money(8_200_000, "JPY")}
1112
+ accent="primary"
1113
+ />
1114
+ {/* Every slot filled, next to a tile with nothing but its label and a dash. */}
1115
+ <StatCard
1116
+ label={t("themeShowcase.dashboard.failureRate")}
1117
+ value={percent(0.021)}
1118
+ delta="-0.4pt"
1119
+ hint={t("themeShowcase.dashboard.failureHint")}
1120
+ inverse
1121
+ />
1122
+ <StatCard label={t("themeShowcase.dashboard.seatsLabel")} value="—" hint={seatNoun} />
1123
+ </ResponsiveGrid>
1124
+
1125
+ <ResponsiveGrid columns={{ base: 1, lg: 2 }} gap="lg" align="start">
1126
+ <Card>
1127
+ <CardHeader>
1128
+ <CardTitle level={3}>{t("themeShowcase.dashboard.mix")}</CardTitle>
1129
+ <CardAction>
1130
+ <Legend
1131
+ items={[
1132
+ { tone: "destructive", label: t("themeShowcase.legend.failed") },
1133
+ { tone: "warning", label: t("themeShowcase.legend.review") },
1134
+ { tone: "success", label: t("themeShowcase.legend.shipped") },
1135
+ ]}
1136
+ />
1137
+ </CardAction>
1138
+ </CardHeader>
1139
+ <CardContent>
1140
+ <Flex direction="col" gap="md">
1141
+ <Progress
1142
+ segments={[
1143
+ { value: 2, tone: "destructive", label: t("themeShowcase.legend.failed") },
1144
+ { value: 3, tone: "warning", label: t("themeShowcase.legend.review") },
1145
+ { value: 12, tone: "success", label: t("themeShowcase.legend.shipped") },
1146
+ ]}
1147
+ />
1148
+ <Separator />
1149
+ <Descriptions
1150
+ columns={{ sm: 1, md: 2 }}
1151
+ items={[
1152
+ {
1153
+ key: "env",
1154
+ label: t("themeShowcase.dashboard.environment"),
1155
+ children: "ops.example.jp",
1156
+ },
1157
+ /* Deliberately empty: a value with nothing in it, beside one with everything. */
1158
+ { key: "owner", label: t("themeShowcase.dashboard.owner"), children: "" },
1159
+ {
1160
+ key: "ledger",
1161
+ label: t("themeShowcase.dashboard.ledger"),
1162
+ children: UNBREAKABLE,
1163
+ mono: true,
1164
+ span: "filled",
1165
+ },
1166
+ ]}
1167
+ />
1168
+ </Flex>
1169
+ </CardContent>
1170
+ </Card>
1171
+
1172
+ <Card>
1173
+ <CardHeader>
1174
+ <CardTitle level={3}>{t("themeShowcase.dashboard.activity")}</CardTitle>
1175
+ </CardHeader>
1176
+ <CardContent>
1177
+ <Timeline variant="status" items={timelineItems} />
1178
+ </CardContent>
1179
+ </Card>
1180
+ </ResponsiveGrid>
1181
+
1182
+ <Card>
1183
+ <CardHeader>
1184
+ <CardTitle level={3}>{t("themeShowcase.dashboard.table")}</CardTitle>
1185
+ <CardDescription>{t("themeShowcase.dashboard.tableHint")}</CardDescription>
1186
+ </CardHeader>
1187
+ <CardContent flush>
1188
+ <Table>
1189
+ <TableHeader>
1190
+ <TableRow>
1191
+ <TableHead>{t("themeShowcase.table.id")}</TableHead>
1192
+ <TableHead>{t("themeShowcase.table.owner")}</TableHead>
1193
+ <TableHead>{t("themeShowcase.table.region")}</TableHead>
1194
+ <TableHead>{t("themeShowcase.table.ref")}</TableHead>
1195
+ <TableHead>{t("themeShowcase.table.status")}</TableHead>
1196
+ <TableHead className="text-end">{t("themeShowcase.table.amount")}</TableHead>
1197
+ </TableRow>
1198
+ </TableHeader>
1199
+ <TableBody>
1200
+ {RELEASE_ROWS.map((row) => (
1201
+ <TableRow key={row.id}>
1202
+ <TableCell>
1203
+ <Text size="xs" mono tone="muted">
1204
+ {row.id}
1205
+ </Text>
1206
+ </TableCell>
1207
+ <TableCell>
1208
+ <Flex align="center" gap="xs">
1209
+ <Avatar size="xs">
1210
+ <AvatarFallback>{row.initials}</AvatarFallback>
1211
+ </Avatar>
1212
+ <Text size="sm">{row.owner}</Text>
1213
+ </Flex>
1214
+ </TableCell>
1215
+ <TableCell>
1216
+ <Flex align="center" gap="xs">
1217
+ <Icon as={MapPin} size="xs" tone="muted" />
1218
+ <Text size="sm">{regionName(row.region)}</Text>
1219
+ </Flex>
1220
+ </TableCell>
1221
+ <TableCell>
1222
+ {row.ref ? (
1223
+ <Text size="xs" mono truncate>
1224
+ {row.ref}
1225
+ </Text>
1226
+ ) : (
1227
+ <Text size="xs" tone="muted">
1228
+ {t("themeShowcase.table.noRef")}
1229
+ </Text>
1230
+ )}
1231
+ </TableCell>
1232
+ <TableCell>
1233
+ <Badge tone={row.tone} variant="outline">
1234
+ {t(`themeShowcase.releaseStatus.${row.statusKey}`)}
1235
+ </Badge>
1236
+ </TableCell>
1237
+ <TableCell className="text-end tabular-nums">
1238
+ {money(row.amount, row.currency)}
1239
+ </TableCell>
1240
+ </TableRow>
1241
+ ))}
1242
+ </TableBody>
1243
+ </Table>
1244
+ </CardContent>
1245
+ <CardFooter>
1246
+ <Flex align="center" gap="sm" wrap justify="between" fill>
1247
+ <Text size="xs" tone="muted">
1248
+ {t("themeShowcase.dashboard.updated", { date: shortDate("2026-09-21T00:00:00Z") })}
1249
+ </Text>
1250
+ <Button size="xs" variant="outline">
1251
+ <KeyRound aria-hidden="true" />
1252
+ {t("themeShowcase.dashboard.rotate")}
1253
+ </Button>
1254
+ </Flex>
1255
+ </CardFooter>
1256
+ </Card>
1257
+ </Flex>
1258
+ );
1259
+ }