@godxjp/ui 28.13.0 → 30.0.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 (164) hide show
  1. package/agent/START-HERE.md +29 -10
  2. package/agent/components/Anchor.json +6 -1
  3. package/agent/components/AppShell.json +1 -1
  4. package/agent/components/AreaChart.json +19 -1
  5. package/agent/components/BarChart.json +11 -1
  6. package/agent/components/Cascader.json +1 -1
  7. package/agent/components/CompactBarTrend.json +1 -1
  8. package/agent/components/DataState.json +1 -1
  9. package/agent/components/DataTable.json +4 -4
  10. package/agent/components/FormField.json +1 -1
  11. package/agent/components/InfiniteQueryState.json +1 -1
  12. package/agent/components/Input.json +1 -1
  13. package/agent/components/LineChart.json +20 -2
  14. package/agent/components/ListRow.json +1 -1
  15. package/agent/components/Masonry.json +1 -1
  16. package/agent/components/MasterDetail.json +1 -1
  17. package/agent/components/PasswordStrength.json +1 -1
  18. package/agent/components/PermissionMatrix.json +1 -1
  19. package/agent/components/Select.json +1 -0
  20. package/agent/components/Sidebar.json +1 -1
  21. package/agent/components/Table.json +8 -3
  22. package/agent/components/ThemeScope.json +49 -0
  23. package/agent/components/Topbar.json +1 -0
  24. package/agent/components/TopbarItem.json +2 -1
  25. package/agent/components/Transfer.json +1 -1
  26. package/agent/components/TreeSelect.json +1 -1
  27. package/agent/components/UploadCropDialog.json +1 -1
  28. package/agent/components/formatDate.json +1 -1
  29. package/agent/components-index.json +5 -0
  30. package/agent/components.json +138 -30
  31. package/agent/index.json +19 -9
  32. package/agent/llms.txt +10 -10
  33. package/agent/patterns/tenant-brand-color.json +28 -0
  34. package/agent/patterns-index.json +27 -0
  35. package/agent/patterns.json +28 -0
  36. package/agent/rules.json +15 -0
  37. package/agent/tokens.json +5055 -1060
  38. package/dist/app/index.d.ts +3 -0
  39. package/dist/app/index.js +3 -0
  40. package/dist/app/tenant-theme.d.ts +80 -0
  41. package/dist/app/tenant-theme.js +154 -0
  42. package/dist/app/theme-axes.d.ts +14 -1
  43. package/dist/app/theme-axes.js +24 -31
  44. package/dist/components/charts/chart-cartesian.d.ts +5 -1
  45. package/dist/components/charts/chart-cartesian.js +15 -8
  46. package/dist/components/data-display/badge.d.ts +1 -1
  47. package/dist/components/data-display/badge.js +21 -3
  48. package/dist/components/data-display/carousel.js +4 -4
  49. package/dist/components/data-display/data-table.js +13 -2
  50. package/dist/components/data-display/permission-matrix.js +1 -1
  51. package/dist/components/data-display/table.d.ts +11 -2
  52. package/dist/components/data-display/table.js +19 -3
  53. package/dist/components/data-entry/control-appearance.d.ts +12 -6
  54. package/dist/components/data-entry/control-appearance.js +1 -1
  55. package/dist/components/data-entry/select.js +4 -3
  56. package/dist/components/feedback/dialog.js +6 -3
  57. package/dist/components/feedback/overlay-header-tone.d.ts +7 -0
  58. package/dist/components/feedback/overlay-header-tone.js +4 -4
  59. package/dist/components/feedback/sheet.d.ts +1 -1
  60. package/dist/components/feedback/sheet.js +6 -9
  61. package/dist/components/feedback/sonner.js +16 -3
  62. package/dist/components/general/button.js +22 -5
  63. package/dist/components/layout/affix.js +15 -1
  64. package/dist/components/layout/sidebar.js +7 -1
  65. package/dist/components/navigation/anchor.d.ts +1 -1
  66. package/dist/components/navigation/anchor.js +5 -4
  67. package/dist/components/navigation/app-setting-picker.js +1 -1
  68. package/dist/components/navigation/pagination.js +1 -1
  69. package/dist/components/navigation/tabs.js +15 -2
  70. package/dist/components/query/infinite-query-state.d.ts +22 -6
  71. package/dist/contracts/measurement.json +1 -1
  72. package/dist/lib/control-styles.d.ts +31 -11
  73. package/dist/lib/control-styles.js +6 -6
  74. package/dist/lib/overlay-portal.d.ts +20 -0
  75. package/dist/lib/overlay-portal.js +93 -0
  76. package/dist/props/components/app.prop.d.ts +12 -0
  77. package/dist/props/components/charts.prop.d.ts +30 -0
  78. package/dist/props/components/index.d.ts +1 -1
  79. package/dist/props/components/navigation.prop.d.ts +21 -2
  80. package/dist/props/components/query.prop.d.ts +36 -2
  81. package/dist/props/registry.d.ts +46 -1
  82. package/dist/props/registry.js +38 -3
  83. package/dist/styles/alert-layout.css +39 -19
  84. package/dist/styles/badge-layout.css +11 -7
  85. package/dist/styles/base.css +14 -5
  86. package/dist/styles/card-layout.css +29 -16
  87. package/dist/styles/chart-layout.css +27 -5
  88. package/dist/styles/control.css +225 -103
  89. package/dist/styles/data-display-layout.css +178 -76
  90. package/dist/styles/data-entry-layout.css +35 -99
  91. package/dist/styles/dialog-layout.css +58 -28
  92. package/dist/styles/float-button-layout.css +5 -5
  93. package/dist/styles/focus-ring.css +11 -7
  94. package/dist/styles/layout.css +53 -25
  95. package/dist/styles/logo-layout.css +3 -3
  96. package/dist/styles/motion.css +2 -2
  97. package/dist/styles/navigation-layout.css +117 -44
  98. package/dist/styles/shell-layout.css +90 -124
  99. package/dist/styles/table-layout.css +66 -24
  100. package/dist/styles/text-layout.css +13 -4
  101. package/dist/styles/toggle.css +9 -3
  102. package/dist/tokens/components/actions.css +1 -1
  103. package/dist/tokens/components/attachments.css +4 -4
  104. package/dist/tokens/components/badge.css +4 -4
  105. package/dist/tokens/components/banner.css +1 -1
  106. package/dist/tokens/components/callout.css +1 -1
  107. package/dist/tokens/components/card.css +13 -8
  108. package/dist/tokens/components/chart.css +11 -2
  109. package/dist/tokens/components/chat-bubble.css +2 -2
  110. package/dist/tokens/components/control.css +41 -22
  111. package/dist/tokens/components/conversations.css +2 -1
  112. package/dist/tokens/components/data-display.css +23 -18
  113. package/dist/tokens/components/data-entry.css +1 -1
  114. package/dist/tokens/components/descriptions.css +2 -2
  115. package/dist/tokens/components/draggable-panel.css +2 -2
  116. package/dist/tokens/components/feedback.css +29 -9
  117. package/dist/tokens/components/float-button.css +1 -1
  118. package/dist/tokens/components/legal-document.css +2 -2
  119. package/dist/tokens/components/logo.css +2 -2
  120. package/dist/tokens/components/mega-menu.css +6 -4
  121. package/dist/tokens/components/navigation.css +27 -13
  122. package/dist/tokens/components/segmented.css +11 -6
  123. package/dist/tokens/components/separator.css +1 -1
  124. package/dist/tokens/components/shell.css +24 -10
  125. package/dist/tokens/components/table.css +13 -5
  126. package/dist/tokens/components/thought-chain.css +2 -2
  127. package/dist/tokens/components/toggle.css +3 -1
  128. package/dist/tokens/components/tree.css +3 -1
  129. package/dist/tokens/components/upload.css +8 -8
  130. package/dist/tokens/components/welcome.css +1 -1
  131. package/dist/tokens/foundation.css +30 -3
  132. package/docs/COMPOSITION-VS-COMPONENT.md +31 -0
  133. package/docs/CUSTOMER-THEMING.md +637 -1
  134. package/docs/FRAME-COVERAGE-REPORT.md +3 -2
  135. package/docs/GLASSMORPHISM-STANDARD.md +196 -0
  136. package/docs/THEME-API-COVERAGE.md +538 -0
  137. package/docs/TOKEN-RESOLUTION.md +195 -0
  138. package/docs/TOKENS.md +63 -24
  139. package/docs/asset-modules.d.ts +7 -0
  140. package/docs/data-display/charts.tsx +80 -0
  141. package/docs/data-display/data-table/index.tsx +30 -0
  142. package/docs/data-display/popover.tsx +1 -1
  143. package/docs/data-display/table.tsx +52 -0
  144. package/docs/feedback/sheet.tsx +10 -10
  145. package/docs/foundation/density.tsx +4 -4
  146. package/docs/i18n/messages/en.json +506 -0
  147. package/docs/i18n/messages/ja.json +506 -0
  148. package/docs/i18n/messages/vi.json +506 -0
  149. package/docs/layout/account-chip.tsx +2 -2
  150. package/docs/layout/responsive-grid.tsx +1 -1
  151. package/docs/navigation/toolbar.tsx +20 -12
  152. package/docs/providers/theme-scope.tsx +186 -0
  153. package/docs/showcase/caimono-price-comparison.tsx +911 -0
  154. package/docs/showcase/case4-login.tsx +2 -2
  155. package/docs/showcase/permission-matrix.tsx +13 -5
  156. package/docs/showcase/table-pagination.tsx +2 -1
  157. package/docs/showcase/tenant-brand-color.tsx +338 -0
  158. package/docs/showcase/theme-lab.tsx +2125 -0
  159. package/docs/themes/flat.css +462 -0
  160. package/docs/themes/glassmorphism.css +958 -0
  161. package/docs/themes/index.ts +219 -0
  162. package/docs/themes/neubrutalism.css +475 -0
  163. package/package.json +4 -3
  164. package/scripts/explain-token.mjs +382 -0
@@ -0,0 +1,462 @@
1
+ /**
2
+ * flat theme — the SECOND theme, and the control.
3
+ *
4
+ * gh#882: "adding a second theme must mean one new CSS file and one new row, never a page edit".
5
+ * This is that file. It proves the switch is real rather than promised, and — because it removes
6
+ * every corner, every shadow and every translucency the default theme spends — it is also the
7
+ * control: what these components look like when the decoration is taken away.
8
+ *
9
+ * SAME CONSTRAINT AS `glassmorphism.css`, no exceptions: every line below is a
10
+ * `--custom-property` declaration under `[data-theme-style="flat"]`. No `background:`, no
11
+ * `border-radius:`, no `box-shadow:`, no selector into a `.ui-*` class. What cannot be expressed
12
+ * that way is written down as a finding on the page, not worked around here.
13
+ *
14
+ * ── FINDING 1 · one number, sixty-eight declarations ─────────────────────────────────────────
15
+ * "Square the corners" is one design decision and it costs SIXTY-EIGHT lines. `--radius` is the
16
+ * seed; `--radius-xs … --radius-2xl` are `calc(var(--radius) · φⁿ)` declared at `:root`
17
+ * (src/styles/base.css:169-176); and 61 component knobs are `--x-radius: var(--radius-<step>)`,
18
+ * also declared at `:root` (src/tokens/components/*.css). A `var()` substitutes where the
19
+ * REFERENCING property is declared, so all 68 resolve once against the root's `--radius` and
20
+ * inherit the frozen result — the `:root` freeze rule of docs/TOKEN-RESOLUTION.md §3, at scale.
21
+ * Setting `--radius: 0` here alone moves NOTHING except the handful of call sites that read
22
+ * `--radius` directly. This is the same trap `docs/showcase/theme-customization.tsx` records for
23
+ * `--ring`, except there it was one line and here it is sixty-seven.
24
+ *
25
+ * The list below is GENERATED, not hand-kept:
26
+ * grep -rhoE "^\s*--[a-z0-9-]*radius[a-z0-9-]*:\s*var\(--radius[a-z0-9-]*\)" src/tokens/
27
+ * A hand-kept list is what went blind in gh#854, and a theme that squares 40 of 61 corners looks
28
+ * like a bug rather than a style.
29
+ *
30
+ * ── FINDING 1b · the brand INK does not follow the seed to a safe ratio, and this theme SHOWS it
31
+ * On a light canvas the seed-derived link/active ink fails AA at both ends of the seed range:
32
+ * measured with `measure-glass.mjs`, the coral seed puts six strings at 2.11-3.71:1 and the citron
33
+ * seed (#FFD400) puts the same six at 1.07-1.43:1 — Sidebar active item, NavList active item,
34
+ * MegaMenu trigger, Anchor link, `Button variant="link"`. `tenantTheme()` guarantees
35
+ * `--primary` against `--primary-foreground`; it says nothing about `--primary` used as INK on the
36
+ * page's own surface, and nothing derives a safe value for that.
37
+ *
38
+ * The `base` row — no theme file at all — keeps those failures, and that is where the finding
39
+ * lives: a consumer who hands the library a light brand colour gets inaccessible navigation ink
40
+ * and has nothing to say about it, because the seed is the only input. This file DOES restate the
41
+ * roles, darker, so the matrix also shows the second half of the answer: the gap is reachable by
42
+ * a theme, one line per role, once you know which of them are `:root`-bound. Both columns are
43
+ * needed — base is the defect, flat and glass are the proof it can be closed from outside.
44
+ *
45
+ * ── FINDING 2 · the pill is a SHAPE, not a corner ────────────────────────────────────────────
46
+ * Eight knobs mirror `--radius-pill` (Switch's track, ScrollArea's thumb, the count chips on
47
+ * Segmented/Tabs/Toggle) and one mirrors `--radius-sharp`. They are deliberately left alone: a
48
+ * squared Switch reads as a Checkbox, which is a meaning change, not a style change. A flat theme
49
+ * that squares them would be measuring its own taste rather than the token model.
50
+ *
51
+ * ── FINDING 3 · the shadow mirrors are mostly FIXED now, and the exceptions are visible ──────
52
+ * gh#880 turned `--card-shadow` / `--sheet-shadow` / `--popover-shadow` / `--tooltip-shadow` /
53
+ * `--segmented-item-selected-shadow` into `initial` knobs, so restating the six foundation steps
54
+ * reaches them at the call site — no per-mirror restatement, unlike the radius family above and
55
+ * unlike what `glassmorphism.css` had to do before that fix. Six mirrors are still frozen
56
+ * `var(--shadow-*)` bindings at `:root` and each needs its own line; they are listed as such.
57
+ *
58
+ * ── FINDING 4 · this theme owes no translucency fallback, and that is not an omission ────────
59
+ * docs/TOKEN-RESOLUTION.md §5 puts `prefers-reduced-transparency` and `@supports not
60
+ * (backdrop-filter)` on the theme that made a surface translucent. Nothing here is translucent and
61
+ * no blur knob is turned on, so there is nothing to fall back to. The absence is the proof.
62
+ */
63
+ [data-theme-style="flat"] {
64
+ /* ── Corners. The seed, its six derived steps, then every frozen component mirror. ────────── */
65
+ --radius: 0;
66
+ --radius-xs: 0;
67
+ --radius-sm: 0;
68
+ --radius-md: 0;
69
+ --radius-lg: 0;
70
+ --radius-xl: 0;
71
+ --radius-2xl: 0;
72
+
73
+ --actions-radius: 0;
74
+ --app-launcher-launchpad-mark-radius: 0;
75
+ --app-launcher-launchpad-tile-radius: 0;
76
+ --app-launcher-mark-radius: 0;
77
+ --app-launcher-tile-radius: 0;
78
+ --attachments-card-radius: 0;
79
+ --avatar-square-radius: 0;
80
+ --badge-radius: 0;
81
+ --button-radius: 0;
82
+ --calendar-day-radius: 0;
83
+ --calendar-weekday-radius: 0;
84
+ --card-radius: 0;
85
+ --card-service-launcher-icon-radius: 0;
86
+ --cascader-result-radius: 0;
87
+ --chart-trend-bar-radius: 0;
88
+ --chat-bubble-radius: 0;
89
+ --code-block-radius: 0;
90
+ --control-affix-action-radius: 0;
91
+ --control-radius: 0;
92
+ --conversations-item-radius: 0;
93
+ --descriptions-border-radius: 0;
94
+ --draggable-panel-radius: 0;
95
+ --float-button-group-radius: 0;
96
+ --legal-document-toc-item-radius: 0;
97
+ --logo-radius: 0;
98
+ --mega-menu-link-radius: 0;
99
+ --mega-menu-panel-radius: 0;
100
+ --mega-menu-trigger-radius: 0;
101
+ --menu-item-radius: 0;
102
+ --popover-radius: 0;
103
+ --progress-breakdown-radius: 0;
104
+ --prose-code-radius: 0;
105
+ --prose-image-radius: 0;
106
+ --segmented-item-radius: 0;
107
+ --segmented-track-radius: 0;
108
+ --skeleton-element-radius: 0;
109
+ --skeleton-radius: 0;
110
+ --slider-tooltip-radius: 0;
111
+ --stat-card-icon-radius: 0;
112
+ --steps-nav-radius: 0;
113
+ --table-skeleton-radius: 0;
114
+ --tabs-add-radius: 0;
115
+ --tabs-card-radius: 0;
116
+ --tabs-overflow-radius: 0;
117
+ --tabs-tab-remove-radius: 0;
118
+ --thought-chain-item-radius: 0;
119
+ --thumbnail-radius: 0;
120
+ --time-picker-option-radius: 0;
121
+ --timeline-grid-event-radius: 0;
122
+ --tooltip-radius: 0;
123
+ --transfer-pane-radius: 0;
124
+ --transfer-row-radius: 0;
125
+ --tree-node-radius: 0;
126
+ --tree-select-row-radius: 0;
127
+ --upload-draft-radius: 0;
128
+ --upload-dropzone-radius: 0;
129
+ --upload-picture-badge-radius: 0;
130
+ --upload-picture-radius: 0;
131
+ --upload-row-radius: 0;
132
+ --upload-tile-radius: 0;
133
+ --welcome-radius: 0;
134
+
135
+ /* ── Elevation. Six foundation steps flattened; five component mirrors are `initial` knobs
136
+ * since gh#880 and follow the steps at their own call site, so they need no line here. The
137
+ * six below are still root-bound `var(--shadow-*)` and do not. ─────────────────────────── */
138
+ --shadow-xs: none;
139
+ --shadow-sm: none;
140
+ --shadow-md: none;
141
+ --shadow-lg: none;
142
+ --shadow-xl: none;
143
+ --shadow-2xl: none;
144
+
145
+ --app-launcher-launchpad-mark-shadow: none;
146
+ --card-hover-shadow: none;
147
+ --control-shadow: none;
148
+ --draggable-panel-shadow: none;
149
+ --float-button-shadow: none;
150
+ --mega-menu-panel-shadow: none;
151
+
152
+ /* ── Surfaces. Opaque, paper-white, separated by a line rather than by a shadow — which is what
153
+ * "flat" means and also what removes every variable glassmorphism introduces. The border is
154
+ * the ONLY separator left, so it is darker than the default hairline: at `0 0% 90%` a
155
+ * shadowless Card has no edge at all against the canvas. ───────────────────────────────── */
156
+ --card-background: 0 0% 100%;
157
+ --card: 0 0% 100%;
158
+ --popover: 0 0% 100%;
159
+ --border: 220 13% 78%;
160
+ --input: 220 13% 72%;
161
+
162
+ /* ── Ink. One ramp, all of it above 7:1 on white — the flat surfaces give the text nothing to
163
+ * hide behind, so "muted" here is a lighter WEIGHT at the same ratio, per
164
+ * docs/GLASSMORPHISM-STANDARD.md §3, and not a lighter grey. ──────────────────────────── */
165
+ --foreground: 220 26% 12%;
166
+ --card-foreground: 220 26% 12%;
167
+ --popover-foreground: 220 26% 12%;
168
+ --muted-foreground: 220 16% 32%;
169
+ --text-tertiary: 220 14% 38%;
170
+
171
+ /* ── The one place the seed is allowed to paint a large area: the page canvas and the two
172
+ * neutral fills, tinted a few percent towards `--primary` so the theme is visibly the seed's
173
+ * and not a fixed grey. The `from` clause lives inside the token because these roles are
174
+ * consumed as bare triplets — see the long note in `glassmorphism.css`; without relative
175
+ * colour support the literals below stand. ───────────────────────────────────────────── */
176
+ --background: 220 20% 97%;
177
+ --muted: 220 16% 93%;
178
+ --accent: 220 16% 90%;
179
+ --secondary: 220 14% 92%;
180
+ /* ── The brand ink ramp. Every one of these is `:root`-bound in the library, so it resolves
181
+ * against the ROOT seed and inherits that value into this scope no matter what `--primary`
182
+ * says here. A token read inside `hsl()` takes a bare triplet; one read as a complete value
183
+ * takes a whole `hsl(...)`; getting it backwards fails silently. ─────────────────────────── */
184
+ --text-link: 220 80% 34%;
185
+ --text-brand: 220 80% 34%;
186
+ --text-primary: 220 80% 30%;
187
+ --anchor-ink-color: 220 80% 34%;
188
+ --auth-shell-divider-label-color: 220 16% 32%;
189
+ --org-switcher-meta-foreground: 220 16% 32%;
190
+ --separator-label-color: 220 16% 32%;
191
+ --sidebar-item-active-foreground: hsl(220 80% 30%);
192
+ --sidebar-nav-icon-active-foreground: hsl(220 80% 30%);
193
+ --mega-menu-trigger-current-foreground: hsl(220 80% 30%);
194
+ --mega-menu-trigger-open-foreground: hsl(220 80% 30%);
195
+ --mega-menu-link-current-foreground: hsl(220 80% 30%);
196
+ --timeline-grid-event-muted-color: hsl(220 16% 32%);
197
+
198
+ /* ── INTERACTION STATES. The same sweep the glass theme documents, at the other polarity: this
199
+ * canvas is light, so a hover is a slightly DARKER wash and the ring is a dark ink. §3 still
200
+ * holds — the state is carried by the fill and the weight, never by lowering the ink's ratio.
201
+ * The ring is 2px (§4b) and pinned OFF the brand: pinning it to `--ring`, which follows the
202
+ * seed, is what makes a `#FFD400` tenant's focus indicator invisible on white. ─────────── */
203
+ --focus-ring-color: 220 80% 24%;
204
+ --focus-outline-color: 220 80% 24%;
205
+ --focus-ring-width: calc(2px * var(--focus-outline));
206
+ --control-outline: 220 80% 24%;
207
+ --focus-ring-glow-color: 220 80% 24%;
208
+ --topbar-item-hover-background: 220 16% 88%;
209
+ --topbar-item-hover-color: 220 26% 12%;
210
+ --segmented-item-hover-background: 220 16% 88%;
211
+ --segmented-item-hover-color: 220 26% 12%;
212
+ --segmented-item-active-background: 220 16% 84%;
213
+ --app-launcher-tile-hover-background: 220 16% 90%;
214
+ --app-launcher-tile-hover-color: 220 26% 12%;
215
+ --control-variant-filled-hover-background: 220 16% 88%;
216
+ --choice-button-selected-color: 220 26% 12%;
217
+ --choice-button-selected-border-color: 220 30% 40%;
218
+ --secondary-hover: 220 14% 86%;
219
+ --secondary-active: 220 14% 82%;
220
+
221
+ --region-focus-ring-color: hsl(220 80% 24%);
222
+ --menu-item-hover-background: hsl(220 16% 92%);
223
+ --menu-item-hover-foreground: hsl(220 26% 12%);
224
+ --table-row-hover-background: hsl(220 16% 94%);
225
+ --table-row-selected-background: hsl(220 20% 90%);
226
+ --tree-node-hover-background: hsl(220 16% 94%);
227
+ --tree-node-selected-background: hsl(220 20% 90%);
228
+ --tree-node-selected-foreground: hsl(220 26% 12%);
229
+ --mega-menu-trigger-hover-background: hsl(220 16% 92%);
230
+ --mega-menu-trigger-hover-foreground: hsl(220 26% 12%);
231
+ --mega-menu-link-hover-background: hsl(220 16% 92%);
232
+ --mega-menu-link-hover-foreground: hsl(220 26% 12%);
233
+ --sidebar-nav-item-hover-foreground: hsl(220 26% 12%);
234
+ --sidebar-nav-icon-hover-foreground: hsl(220 26% 12%);
235
+ --conversations-item-active-background: hsl(220 20% 90%);
236
+ --conversations-item-active-color: hsl(220 26% 12%);
237
+ --tabs-count-active-background: hsl(220 20% 86%);
238
+ --tabs-count-active-color: hsl(220 26% 12%);
239
+ --toggle-soft-hover-background: hsl(220 16% 90%);
240
+ --toggle-pressed-count-background: hsl(220 20% 84%);
241
+ --toggle-pressed-count-color: hsl(220 26% 12%);
242
+ --toggle-pressed-border-color: hsl(220 20% 50%);
243
+ --switch-unchecked-background: hsl(220 14% 74%);
244
+ --switch-content-unchecked-foreground: hsl(220 16% 28%);
245
+ --text-action-color: hsl(220 26% 16%);
246
+ --text-action-color-hover: hsl(220 26% 8%);
247
+
248
+ --app-shell-main-background: hsl(220 20% 97%);
249
+ }
250
+
251
+ @supports (color: hsl(from red h s l)) {
252
+ [data-theme-style="flat"] {
253
+ --background: from hsl(var(--primary)) h 20% 97%;
254
+ --muted: from hsl(var(--primary)) h 16% 93%;
255
+ --accent: from hsl(var(--primary)) h 16% 90%;
256
+ --secondary: from hsl(var(--primary)) h 14% 92%;
257
+ --border: from hsl(var(--primary)) h 13% 78%;
258
+ --app-shell-main-background: hsl(from hsl(var(--primary)) h 20% 97%);
259
+
260
+ /* Seed-tinted, and clamped in LIGHTNESS rather than copied: `--primary` itself is what fails
261
+ * as ink on a light canvas (1.07:1 for #FFD400), so the hue follows the seed and the lightness
262
+ * is fixed at a value that clears 4.5:1 on this theme's own surfaces.
263
+ *
264
+ * 26%/24%, AND THE NUMBER WAS MEASURED TWICE. At 34%/30% every seed cleared except citron,
265
+ * which still failed at 4.32:1 and 3.65:1 — because lightness is not luminance: at a fixed
266
+ * HSL lightness a yellow hue is far brighter than a blue one, so one clamp cannot serve the
267
+ * hue circle. Four points lower clears the worst hue with margin and only darkens the rest,
268
+ * which is the safe direction. A theme that wanted a tighter ramp would need per-hue
269
+ * lightness, which is `oklch`, and none of these roles is declared in it. */
270
+ --text-link: from hsl(var(--primary)) h 80% 26%;
271
+ --text-brand: from hsl(var(--primary)) h 80% 26%;
272
+ --text-primary: from hsl(var(--primary)) h 80% 30%;
273
+ --anchor-ink-color: from hsl(var(--primary)) h 80% 26%;
274
+ --sidebar-item-active-foreground: hsl(from hsl(var(--primary)) h 80% 24%);
275
+ --sidebar-nav-icon-active-foreground: hsl(from hsl(var(--primary)) h 80% 24%);
276
+ --mega-menu-trigger-current-foreground: hsl(from hsl(var(--primary)) h 80% 24%);
277
+ --mega-menu-trigger-open-foreground: hsl(from hsl(var(--primary)) h 80% 24%);
278
+ --mega-menu-link-current-foreground: hsl(from hsl(var(--primary)) h 80% 24%);
279
+ }
280
+ }
281
+
282
+ /**
283
+ * ── FINDING 5 · gh#896 — flat was permanently light, and the cause is the same shape as the
284
+ * `:root` freeze rule above but the opposite fault: not a value that never re-resolves, but a
285
+ * value that never gets a CHANCE to. `[data-theme-style="flat"]` is a scope BELOW `:root`
286
+ * (verified in Chromium: `HTML > BODY > DIV#root > DIV[data-theme-style]`), while the library's
287
+ * own polarity switch — `.dark, :root[data-theme="dark"]` — is declared ON the root
288
+ * (src/tokens/foundation.css:1024). A declaration on the element itself always wins over an
289
+ * inherited one regardless of specificity, so every `--background`/`--card`/`--foreground` line
290
+ * in the block above shadowed the ENTIRE dark branch: toggling `.dark` on `<html>` changed the
291
+ * ink and fills the div would have inherited, but the div never consulted them because it had its
292
+ * own value already. Measured before this block existed: 0/5 of the five core tokens moved.
293
+ *
294
+ * The fix mirrors the library's own selector pair exactly — `.dark [data-theme-style="flat"],
295
+ * [data-theme="dark"] [data-theme-style="flat"]` — so it is the SAME div, matched by TWO
296
+ * selectors of equal (0,2,0) specificity, each higher than the base rule's (0,1,0). Whichever one
297
+ * matches wins on every property it restates; every property this block does NOT restate (the
298
+ * 68-line radius family, the six `none` shadows) is untouched and keeps flowing from the base
299
+ * rule above, because cascade specificity is resolved PER PROPERTY, not per rule — a polarity
300
+ * switch does not need to re-declare "flat" a second time.
301
+ *
302
+ * ── WHY THE `--primary`-DERIVED BRAND INK IS NOT A SECOND FREEZE PROBLEM HERE ──────────────────
303
+ * `docs/themes/index.ts`'s `ThemeRow.inkSurface` and `src/app/tenant-theme.ts` walk
304
+ * `--text-link`/`--text-brand`/`--text-primary` to literal HSL and emit them as an INLINE style —
305
+ * which outranks any external stylesheet rule on the SAME element, at any specificity. `flat`'s
306
+ * own `inkSurface` is `null`, so that walk always targets the LIGHT default regardless of this
307
+ * theme's polarity. Traced rather than assumed: the inline style lands on an ANCESTOR of this
308
+ * div (not on it), because Finding 1b above already demonstrates the light block's own
309
+ * `--text-link: 220 80% 34%` beats whatever `tenantTheme()` emits for citron/coral — a fact that
310
+ * would be impossible if the inline style sat on this same element. So the same "declared on the
311
+ * element beats inherited from a scope above" rule that CAUSED gh#896 is what already NEUTRALISES
312
+ * the inline-style hazard for these six roles; restating them below is what closes the gap, same
313
+ * as it already does for light. `inkSurface` remains a `base`/`glass` concern, not a `flat` one,
314
+ * because flat sets these tokens directly on both polarities and never falls through to the
315
+ * seed-walked default.
316
+ *
317
+ * ── VALUES: SOLVED AGAINST THE WORST NEUTRAL FILL, NOT GUESSED ──────────────────────────────────
318
+ * Every ink token below was checked with the same sRGB relative-luminance formula
319
+ * `measure-glass.mjs` uses, against all five neutral fills this file declares
320
+ * (`--background` 9% / `--card` 13% / `--muted` 17% / `--secondary` 19% / `--accent` 22%,
321
+ * hue 220 throughout) — `--accent` at 22% is the brightest of the five and so the worst case for
322
+ * a light ink. Worst-case ratios: `--foreground` 10.58:1, `--muted-foreground` 5.21:1,
323
+ * `--text-tertiary` 4.62:1, `--focus-ring-color` 5.71:1, brand ink 6.56–7.50:1 — all clear the
324
+ * 4.5:1 text floor with margin. The two seed-tinted brand-ink lightnesses (80%/84%) were also
325
+ * checked against all FIVE `SEEDS` from `docs/themes/index.ts` (violet/azure/coral/citron/navy —
326
+ * their hue is what `hsl(from var(--primary)) h …` actually keeps): the worst combination, the
327
+ * violet seed against `--accent`, is 5.73:1, still clear of 4.5:1. Boundary colours
328
+ * (`--border` 52%, `--input` 58%, `--switch-unchecked-background` 54%) were solved the same way
329
+ * against the SAME worst fill for the 3:1 non-text floor — `--border` lands at 3.05:1 against
330
+ * `--accent`, its worst case, and every other pairing is higher.
331
+ *
332
+ * ── THE ONE PLACE THE MATRIX STAYS FLAT-CHARACTER RATHER THAN MIRRORING GLASS ───────────────────
333
+ * No blur, no translucency, no shadow is introduced here — every fill below is a bare `H S% L%`
334
+ * or `hsl(...)` triplet at full alpha, same constraint as the light block. A hover/active wash
335
+ * that would be a slightly DARKER neutral on the light canvas is a slightly LIGHTER one here,
336
+ * because that is what "the same visual weight, the opposite polarity" means; the ink family
337
+ * never drops below its measured ratio to represent a lower-emphasis state (docs/
338
+ * GLASSMORPHISM-STANDARD.md §3, restated here because it is a general rule, not a glass-only one).
339
+ */
340
+ .dark [data-theme-style="flat"],
341
+ [data-theme="dark"] [data-theme-style="flat"] {
342
+ /* ── Surfaces. Opaque, ink-navy, separated by a line rather than a shadow — same flat rule as
343
+ * light, inverted: the card is LIGHTER than the canvas instead of matching it, and the
344
+ * border has to be LIGHTER than every surface it can sit against instead of darker. ──────── */
345
+ --card-background: 220 16% 13%;
346
+ --card: 220 16% 13%;
347
+ --popover: 220 16% 13%;
348
+ --border: 220 13% 52%;
349
+ --input: 220 13% 58%;
350
+
351
+ /* ── Ink. Same "weight carries the hierarchy, not the ratio" rule as the light block — the
352
+ * darkest surface here is `--accent` at 22%, and every ink below still clears 4.5:1 against
353
+ * it (see the docblock above). ─────────────────────────────────────────────────────────── */
354
+ --foreground: 220 20% 94%;
355
+ --card-foreground: 220 20% 94%;
356
+ --popover-foreground: 220 20% 94%;
357
+ --muted-foreground: 220 14% 68%;
358
+ --text-tertiary: 220 12% 64%;
359
+
360
+ /* ── The page canvas and the two neutral fills — darkest of the five, so `--accent` (not
361
+ * `--background`) is the ink floor's worst case. ─────────────────────────────────────────── */
362
+ --background: 220 20% 9%;
363
+ --muted: 220 14% 17%;
364
+ --accent: 220 14% 22%;
365
+ --secondary: 220 13% 19%;
366
+
367
+ /* ── The brand ink ramp. Bare triplet, read inside `hsl()` at the call site, except the five
368
+ * "active"/mega-menu roles which are consumed as a COMPLETE value and so are written as
369
+ * `hsl(...)` — same split the light block documents at line 180 above. */
370
+ --text-link: 220 80% 80%;
371
+ --text-brand: 220 80% 80%;
372
+ --text-primary: 220 80% 84%;
373
+ --anchor-ink-color: 220 80% 80%;
374
+ --auth-shell-divider-label-color: 220 14% 68%;
375
+ --org-switcher-meta-foreground: 220 14% 68%;
376
+ --separator-label-color: 220 14% 68%;
377
+ --sidebar-item-active-foreground: hsl(220 80% 84%);
378
+ --sidebar-nav-icon-active-foreground: hsl(220 80% 84%);
379
+ --mega-menu-trigger-current-foreground: hsl(220 80% 84%);
380
+ --mega-menu-trigger-open-foreground: hsl(220 80% 84%);
381
+ --mega-menu-link-current-foreground: hsl(220 80% 84%);
382
+ --timeline-grid-event-muted-color: hsl(220 14% 68%);
383
+
384
+ /* ── INTERACTION STATES. The light block's hover wash is a darker neutral because that canvas
385
+ * is light; here every hover/active fill is a LIGHTER wash instead, and the ring stays a
386
+ * fixed dark-ink hue rather than following the seed, same reasoning as light: a citron/navy
387
+ * seed's `--ring` would be unreadable, or invisible, against this canvas. ────────────────── */
388
+ --focus-ring-color: 220 80% 76%;
389
+ --focus-outline-color: 220 80% 76%;
390
+ --control-outline: 220 80% 76%;
391
+ --focus-ring-glow-color: 220 80% 76%;
392
+ --topbar-item-hover-background: 220 14% 22%;
393
+ --topbar-item-hover-color: 220 20% 94%;
394
+ --segmented-item-hover-background: 220 14% 22%;
395
+ --segmented-item-hover-color: 220 20% 94%;
396
+ --segmented-item-active-background: 220 14% 26%;
397
+ --app-launcher-tile-hover-background: 220 14% 24%;
398
+ --app-launcher-tile-hover-color: 220 20% 94%;
399
+ --control-variant-filled-hover-background: 220 14% 22%;
400
+ --choice-button-selected-color: 220 20% 94%;
401
+ --choice-button-selected-border-color: 220 30% 55%;
402
+ --secondary-hover: 220 13% 23%;
403
+ --secondary-active: 220 13% 27%;
404
+
405
+ --region-focus-ring-color: hsl(220 80% 76%);
406
+ --menu-item-hover-background: hsl(220 14% 24%);
407
+ --menu-item-hover-foreground: hsl(220 20% 94%);
408
+ --table-row-hover-background: hsl(220 14% 18%);
409
+ --table-row-selected-background: hsl(220 16% 22%);
410
+ --tree-node-hover-background: hsl(220 14% 18%);
411
+ --tree-node-selected-background: hsl(220 16% 22%);
412
+ --tree-node-selected-foreground: hsl(220 20% 94%);
413
+ --mega-menu-trigger-hover-background: hsl(220 14% 24%);
414
+ --mega-menu-trigger-hover-foreground: hsl(220 20% 94%);
415
+ --mega-menu-link-hover-background: hsl(220 14% 24%);
416
+ --mega-menu-link-hover-foreground: hsl(220 20% 94%);
417
+ --sidebar-nav-item-hover-foreground: hsl(220 20% 94%);
418
+ --sidebar-nav-icon-hover-foreground: hsl(220 20% 94%);
419
+ --conversations-item-active-background: hsl(220 16% 22%);
420
+ --conversations-item-active-color: hsl(220 20% 94%);
421
+ --tabs-count-active-background: hsl(220 16% 26%);
422
+ --tabs-count-active-color: hsl(220 20% 94%);
423
+ --toggle-soft-hover-background: hsl(220 14% 22%);
424
+ --toggle-pressed-count-background: hsl(220 16% 26%);
425
+ --toggle-pressed-count-color: hsl(220 20% 94%);
426
+ --toggle-pressed-border-color: hsl(220 20% 55%);
427
+ /* Track fill is a mid-tone (54%) so it reads as a distinct surface at 3:1+ against every
428
+ * neutral below it; the label riding on top needs to be dark, not light, to hold 4.5:1 against
429
+ * that same mid-tone — the one ink role in this block that goes DARK rather than light. */
430
+ --switch-unchecked-background: hsl(220 14% 54%);
431
+ --switch-content-unchecked-foreground: hsl(220 16% 10%);
432
+ --text-action-color: hsl(220 20% 90%);
433
+ --text-action-color-hover: hsl(220 20% 97%);
434
+
435
+ --app-shell-main-background: hsl(220 20% 9%);
436
+ }
437
+
438
+ @supports (color: hsl(from red h s l)) {
439
+ .dark [data-theme-style="flat"],
440
+ [data-theme="dark"] [data-theme-style="flat"] {
441
+ --background: from hsl(var(--primary)) h 20% 9%;
442
+ --muted: from hsl(var(--primary)) h 14% 17%;
443
+ --accent: from hsl(var(--primary)) h 14% 22%;
444
+ --secondary: from hsl(var(--primary)) h 13% 19%;
445
+ --border: from hsl(var(--primary)) h 13% 52%;
446
+ --app-shell-main-background: hsl(from hsl(var(--primary)) h 20% 9%);
447
+
448
+ /* Same lightness in both the static block above and here — unlike the light `@supports`
449
+ * branch, which had to drop four points to clear citron, checking all FIVE seeds at these
450
+ * numbers (see the docblock above) already clears the worst one (violet, 5.73:1 on
451
+ * `--accent`) with margin, so no further clamp is needed. */
452
+ --text-link: from hsl(var(--primary)) h 80% 80%;
453
+ --text-brand: from hsl(var(--primary)) h 80% 80%;
454
+ --text-primary: from hsl(var(--primary)) h 80% 84%;
455
+ --anchor-ink-color: from hsl(var(--primary)) h 80% 80%;
456
+ --sidebar-item-active-foreground: hsl(from hsl(var(--primary)) h 80% 84%);
457
+ --sidebar-nav-icon-active-foreground: hsl(from hsl(var(--primary)) h 80% 84%);
458
+ --mega-menu-trigger-current-foreground: hsl(from hsl(var(--primary)) h 80% 84%);
459
+ --mega-menu-trigger-open-foreground: hsl(from hsl(var(--primary)) h 80% 84%);
460
+ --mega-menu-link-current-foreground: hsl(from hsl(var(--primary)) h 80% 84%);
461
+ }
462
+ }