basalt-ui 1.1.0 → 1.2.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 (191) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +37 -0
  3. package/README.md +47 -5
  4. package/agent/rules/basalt-app.md +126 -0
  5. package/agent/rules/basalt-content.md +3 -1
  6. package/agent/skills/basalt-app/SKILL.md +32 -10
  7. package/configs/check.yml +3 -1
  8. package/configs/oxlint.json +1 -1
  9. package/dist/agent/part-list.d.ts.map +1 -1
  10. package/dist/agent/part-list.js +17 -7
  11. package/dist/agent/stick-to-bottom.js +2 -2
  12. package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -1
  13. package/dist/agent-chat/thread-detail-panel.js +37 -33
  14. package/dist/agent-chat/thread-message.d.ts.map +1 -1
  15. package/dist/agent-chat/thread-message.js +8 -5
  16. package/dist/agent-chat/thread-outcome-card.js +3 -3
  17. package/dist/agent-chat/thread-workspace.js +1 -1
  18. package/dist/charts/primitives/ChartLegend.js +2 -0
  19. package/dist/charts/primitives/ChartTooltip.js +2 -1
  20. package/dist/cli/index.d.ts +21 -1
  21. package/dist/cli/index.d.ts.map +1 -1
  22. package/dist/cli/index.js +50 -12
  23. package/dist/connectivity/connectivity-indicator.d.ts.map +1 -1
  24. package/dist/connectivity/connectivity-indicator.js +3 -3
  25. package/dist/content/article-card.module.css +7 -5
  26. package/dist/content/article-layout.module.css +16 -12
  27. package/dist/content/callout.module.css +4 -4
  28. package/dist/content/code-block.module.css +8 -7
  29. package/dist/content/guide.module.css +3 -3
  30. package/dist/content/mermaid.module.css +2 -2
  31. package/dist/content/prose.module.css +59 -29
  32. package/dist/content/reading-progress.module.css +2 -0
  33. package/dist/content/toc.module.css +6 -3
  34. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  35. package/dist/dashboard/delta-badge.js +10 -2
  36. package/dist/dashboard/empty-state.d.ts.map +1 -1
  37. package/dist/dashboard/empty-state.js +3 -16
  38. package/dist/dashboard/settings-section.js +2 -2
  39. package/dist/dashboard/settings-section.module.css +2 -2
  40. package/dist/dashboard/stat-card.js +2 -1
  41. package/dist/data/virtual-list.d.ts.map +1 -1
  42. package/dist/data/virtual-list.js +12 -2
  43. package/dist/forms/FormErrorSummary.js +2 -2
  44. package/dist/guard/index.d.ts +20 -4
  45. package/dist/guard/index.d.ts.map +1 -1
  46. package/dist/guard/index.js +250 -37
  47. package/dist/guard/types.d.ts +24 -3
  48. package/dist/guard/types.d.ts.map +1 -1
  49. package/dist/index.d.ts +1 -0
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/provider/index.d.ts +30 -1
  52. package/dist/provider/index.d.ts.map +1 -1
  53. package/dist/provider/index.js +32 -7
  54. package/dist/provider/lab-theme.d.ts +39 -0
  55. package/dist/provider/lab-theme.d.ts.map +1 -0
  56. package/dist/provider/lab-theme.js +52 -0
  57. package/dist/shell/app-header.module.css +2 -2
  58. package/dist/shell/app-mobile-nav.module.css +1 -1
  59. package/dist/shell/app-sidebar-account.d.ts.map +1 -1
  60. package/dist/shell/app-sidebar-account.js +4 -2
  61. package/dist/shell/app-sidebar.d.ts.map +1 -1
  62. package/dist/shell/app-sidebar.js +4 -2
  63. package/dist/shell/app-sidebar.module.css +36 -26
  64. package/dist/shell/index.d.ts.map +1 -1
  65. package/dist/shell/index.js +11 -4
  66. package/dist/shell/sidebar-search.module.css +16 -4
  67. package/dist/styles.css +1 -1
  68. package/dist/surfaces.d.ts +16 -12
  69. package/dist/surfaces.d.ts.map +1 -1
  70. package/dist/surfaces.js +12 -4
  71. package/dist/theme/controls.module.css +1 -1
  72. package/dist/theme/floating.module.css +1 -1
  73. package/dist/theme/index.d.ts +116 -11
  74. package/dist/theme/index.d.ts.map +1 -1
  75. package/dist/theme/index.js +703 -566
  76. package/dist/theme/nav-link.module.css +1 -1
  77. package/dist/theme/use-basalt-spacing.d.ts +3 -0
  78. package/dist/theme/use-basalt-spacing.d.ts.map +1 -0
  79. package/dist/theme/use-basalt-spacing.js +8 -0
  80. package/dist/theme-lab/derive-controls.d.ts +13 -0
  81. package/dist/theme-lab/derive-controls.d.ts.map +1 -0
  82. package/dist/theme-lab/derive-controls.js +137 -0
  83. package/dist/theme-lab/derive-state.d.ts +55 -0
  84. package/dist/theme-lab/derive-state.d.ts.map +1 -0
  85. package/dist/theme-lab/derive-state.js +81 -0
  86. package/dist/theme-lab/index.d.ts +12 -2
  87. package/dist/theme-lab/index.d.ts.map +1 -1
  88. package/dist/theme-lab/index.js +13 -62
  89. package/dist/theme-toggle/index.d.ts.map +1 -1
  90. package/dist/theme-toggle/index.js +3 -2
  91. package/dist/tokens/derive.d.ts +89 -0
  92. package/dist/tokens/derive.d.ts.map +1 -0
  93. package/dist/tokens/derive.js +250 -0
  94. package/dist/tokens/hct.d.ts +34 -0
  95. package/dist/tokens/hct.d.ts.map +1 -0
  96. package/dist/tokens/hct.js +159 -0
  97. package/dist/tokens/index.d.ts +71 -7
  98. package/dist/tokens/index.d.ts.map +1 -1
  99. package/dist/tokens/index.js +284 -46
  100. package/dist/tokens/palette.d.ts +984 -167
  101. package/dist/tokens/palette.d.ts.map +1 -1
  102. package/dist/tokens/palette.js +617 -119
  103. package/dist/vite-color-mix.d.ts +30 -0
  104. package/dist/vite-color-mix.d.ts.map +1 -0
  105. package/dist/vite-color-mix.js +80 -0
  106. package/dist/vite.d.ts +82 -1
  107. package/dist/vite.d.ts.map +1 -1
  108. package/dist/vite.js +312 -0
  109. package/llms.txt +5 -4
  110. package/package.json +24 -9
  111. package/src/agent/part-list.tsx +13 -7
  112. package/src/agent/stick-to-bottom.tsx +2 -2
  113. package/src/agent-chat/thread-detail-panel.tsx +13 -10
  114. package/src/agent-chat/thread-message.tsx +8 -5
  115. package/src/agent-chat/thread-outcome-card.tsx +2 -2
  116. package/src/agent-chat/thread-workspace.tsx +2 -2
  117. package/src/charts/primitives/ChartLegend.tsx +2 -2
  118. package/src/charts/primitives/ChartTooltip.tsx +2 -2
  119. package/src/cli/check-theme.test.ts +18 -0
  120. package/src/cli/index.ts +112 -20
  121. package/src/cli/init-sync.test.ts +68 -0
  122. package/src/connectivity/connectivity-indicator.tsx +8 -2
  123. package/src/content/article-card.module.css +7 -5
  124. package/src/content/article-layout.module.css +16 -12
  125. package/src/content/callout.module.css +4 -4
  126. package/src/content/code-block.module.css +8 -7
  127. package/src/content/guide.module.css +3 -3
  128. package/src/content/mermaid.module.css +2 -2
  129. package/src/content/prose.module.css +59 -29
  130. package/src/content/prose.module.css.test.ts +55 -0
  131. package/src/content/reading-progress.module.css +2 -0
  132. package/src/content/toc.module.css +6 -3
  133. package/src/dashboard/delta-badge.tsx +10 -4
  134. package/src/dashboard/empty-state.tsx +3 -16
  135. package/src/dashboard/settings-section.module.css +2 -2
  136. package/src/dashboard/settings-section.tsx +2 -2
  137. package/src/dashboard/stat-card.tsx +2 -2
  138. package/src/data/virtual-list.tsx +12 -2
  139. package/src/forms/FormErrorSummary.tsx +1 -1
  140. package/src/guard/check-source.test.ts +416 -5
  141. package/src/guard/index.ts +367 -45
  142. package/src/guard/types.ts +24 -2
  143. package/src/index.ts +1 -0
  144. package/src/provider/index.test.tsx +100 -0
  145. package/src/provider/index.tsx +79 -7
  146. package/src/provider/lab-theme.test.ts +147 -0
  147. package/src/provider/lab-theme.ts +166 -0
  148. package/src/shell/app-header.module.css +2 -2
  149. package/src/shell/app-mobile-nav.module.css +1 -1
  150. package/src/shell/app-sidebar-account.tsx +9 -2
  151. package/src/shell/app-sidebar.module.css +36 -26
  152. package/src/shell/app-sidebar.tsx +12 -2
  153. package/src/shell/index.tsx +14 -3
  154. package/src/shell/sidebar-search.module.css +16 -4
  155. package/src/styles.css +1 -1
  156. package/src/surfaces.ts +25 -11
  157. package/src/theme/contrast.test.ts +19 -3
  158. package/src/theme/controls.module.css +1 -1
  159. package/src/theme/density-option.test.ts +96 -0
  160. package/src/theme/density-relations.test.ts +428 -0
  161. package/src/theme/derive-theme.test.ts +101 -0
  162. package/src/theme/floating.module.css +1 -1
  163. package/src/theme/fonts-option.test.ts +69 -0
  164. package/src/theme/index.ts +930 -563
  165. package/src/theme/nav-link.module.css +1 -1
  166. package/src/theme/radius-option.test.ts +86 -0
  167. package/src/theme/radius.test.ts +132 -0
  168. package/src/theme/spacing.test.ts +432 -0
  169. package/src/theme/use-basalt-spacing.test.tsx +51 -0
  170. package/src/theme/use-basalt-spacing.ts +38 -0
  171. package/src/theme-lab/derive-controls.test.ts +94 -0
  172. package/src/theme-lab/derive-controls.tsx +227 -0
  173. package/src/theme-lab/derive-state.test.ts +71 -0
  174. package/src/theme-lab/derive-state.ts +163 -0
  175. package/src/theme-lab/index.tsx +29 -68
  176. package/src/theme-lab/theme-lab.test.ts +4 -18
  177. package/src/theme-toggle/index.tsx +9 -4
  178. package/src/tokens/build-fonts-css.test.ts +51 -0
  179. package/src/tokens/build-radius-css.test.ts +25 -0
  180. package/src/tokens/density.test.ts +274 -0
  181. package/src/tokens/derive-radius.test.ts +62 -0
  182. package/src/tokens/derive.test.ts +30 -0
  183. package/src/tokens/derive.ts +481 -0
  184. package/src/tokens/hct.ts +231 -0
  185. package/src/tokens/index.ts +395 -45
  186. package/src/tokens/palette.test.ts +114 -0
  187. package/src/tokens/palette.ts +1118 -180
  188. package/src/vite-color-mix.test.ts +46 -0
  189. package/src/vite-color-mix.ts +137 -0
  190. package/src/vite.test.ts +192 -0
  191. package/src/vite.ts +502 -1
@@ -6,7 +6,7 @@
6
6
 
7
7
  .root {
8
8
  border-radius: var(--vx-radius-card);
9
- padding: 10px 14px;
9
+ padding: var(--vx-space-callout-inset-y) var(--vx-space-callout-inset-x);
10
10
  border-left: 2px solid var(--callout-ink);
11
11
  background: color-mix(in srgb, var(--callout-ink) 8%, transparent);
12
12
  }
@@ -38,8 +38,8 @@
38
38
  .titleRow {
39
39
  display: flex;
40
40
  align-items: center;
41
- gap: 8px;
42
- margin-bottom: 4px;
41
+ gap: var(--vx-space-callout-title-row-gap);
42
+ margin-bottom: var(--vx-space-stack-xs);
43
43
  }
44
44
 
45
45
  .icon {
@@ -73,5 +73,5 @@
73
73
  }
74
74
 
75
75
  .body p {
76
- margin: 0 0 8px;
76
+ margin: 0 0 var(--vx-space-stack-sm);
77
77
  }
@@ -6,7 +6,7 @@
6
6
 
7
7
  .container {
8
8
  position: relative;
9
- border-radius: 8px;
9
+ border-radius: var(--vx-radius-floating);
10
10
  background-color: color-mix(in srgb, var(--vx-ink) 6%, transparent);
11
11
  overflow: hidden;
12
12
  }
@@ -15,8 +15,9 @@
15
15
  display: flex;
16
16
  align-items: center;
17
17
  justify-content: space-between;
18
- gap: 8px;
19
- padding: 6px 10px 6px 14px;
18
+ gap: var(--vx-space-code-block-header-gap);
19
+ padding: var(--vx-space-code-block-header-inset-y) var(--vx-space-code-block-header-inset-right)
20
+ var(--vx-space-code-block-header-inset-y) var(--vx-space-code-block-content-inset-x);
20
21
  border-bottom: 1px solid var(--vx-divider);
21
22
  }
22
23
 
@@ -32,7 +33,7 @@
32
33
  .headerRight {
33
34
  display: flex;
34
35
  align-items: center;
35
- gap: 6px;
36
+ gap: var(--vx-space-code-block-header-right-gap);
36
37
  flex-shrink: 0;
37
38
  }
38
39
 
@@ -51,7 +52,7 @@
51
52
  font-family: var(--basalt-font-mono);
52
53
  font-size: var(--vx-text-sm);
53
54
  line-height: 1.6;
54
- padding: 10px 14px;
55
+ padding: var(--vx-space-code-block-body-inset-y) var(--vx-space-code-block-content-inset-x);
55
56
  overflow-x: auto;
56
57
  }
57
58
 
@@ -74,8 +75,8 @@ html[data-mantine-color-scheme='light'] .body :global(.shiki span) {
74
75
  /* Floating copy button — shown only when there is no header (no title), revealed on hover/focus. */
75
76
  .floatingCopy {
76
77
  position: absolute;
77
- top: 6px;
78
- right: 6px;
78
+ top: var(--vx-space-code-block-floating-copy-offset);
79
+ right: var(--vx-space-code-block-floating-copy-offset);
79
80
  opacity: 0;
80
81
  transition: opacity 120ms ease;
81
82
  }
@@ -13,12 +13,12 @@
13
13
  }
14
14
 
15
15
  .body {
16
- padding-bottom: 8px;
16
+ padding-bottom: var(--vx-space-guide-body-gap-bottom);
17
17
  }
18
18
 
19
19
  .footer {
20
- margin-top: 20px;
21
- padding-top: 16px;
20
+ margin-top: var(--vx-space-guide-footer-gap-top);
21
+ padding-top: var(--vx-space-guide-footer-inset-top);
22
22
  border-top: 1px solid var(--vx-divider);
23
23
  }
24
24
 
@@ -8,9 +8,9 @@
8
8
  .container {
9
9
  display: flex;
10
10
  justify-content: center;
11
- border-radius: 8px;
11
+ border-radius: var(--vx-radius-floating);
12
12
  background-color: color-mix(in srgb, var(--vx-ink) 6%, transparent);
13
- padding: 16px;
13
+ padding: var(--vx-space-mermaid-container-inset);
14
14
  overflow-x: auto;
15
15
  }
16
16
 
@@ -32,11 +32,37 @@
32
32
  margin-bottom: 0;
33
33
  }
34
34
 
35
- /* Fixed-header clearance so an anchor-jumped/TOC-navigated heading isn't hidden under a sticky header. */
35
+ /* Fixed-header clearance so an anchor-jumped/TOC-navigated heading isn't hidden under a sticky
36
+ * header. RESPONSIVE (docs/CONTENT-SPEC.md §5): BasaltShell's AppShell header itself switches
37
+ * height at the `sm` breakpoint (`shell/index.tsx`'s `header={{ height: { base, sm } }}`), so the
38
+ * clearance must too — the default below is the DESKTOP value (`>= sm`, the common path); the
39
+ * `max-width: 47.99375em` override below swaps in the MOBILE value. `47.99375em` is Mantine's own
40
+ * complement of a `min-width: 48em` breakpoint (`em(px - 0.1)` — verified against the installed
41
+ * `@mantine/core`'s `MantineClasses.mjs`, the same formula behind `visibleFrom`/`hiddenFrom`), NOT
42
+ * an independently hand-picked value — a plain `47.99em` leaves a viewport band (`47.99em` to just
43
+ * under `48em`) matched by NEITHER this rule nor AppShell's own `(min-width: 48em)` override.
44
+ * `48em` is a STATIC assumption, not a value this CSS module can read live: it is Mantine's default
45
+ * `theme.breakpoints.sm` (unmodified by `baseTheme`, `theme/index.ts`), and `shell/index.tsx` reads
46
+ * that theme value directly for its own `min-width` media query — but a media query condition
47
+ * cannot resolve a CSS custom property (`@media (min-width: var(--x))` is not valid CSS), so this
48
+ * static module has no way to follow a consumer's `createBasaltTheme(overrides)` that overrides
49
+ * `breakpoints.sm`. A consumer doing so desyncs this file's breakpoint from AppShell's actual
50
+ * header-switch point — the failure mode is a heading that scrolls to a clearance tuned for the
51
+ * WRONG header on the mismatched viewport band, not a total breakage. Both values also assume
52
+ * BasaltShell's own AppShell header heights — a `./content` consumer rendering Prose standalone (no
53
+ * BasaltShell) overrides `--vx-space-sticky-header-clearance`/`-mobile` itself. */
36
54
  .root h2,
37
55
  .root h3,
38
56
  .root h4 {
39
- scroll-margin-top: 84px;
57
+ scroll-margin-top: var(--vx-space-sticky-header-clearance);
58
+ }
59
+
60
+ @media (max-width: 47.99375em) {
61
+ .root h2,
62
+ .root h3,
63
+ .root h4 {
64
+ scroll-margin-top: var(--vx-space-sticky-header-clearance-mobile);
65
+ }
40
66
  }
41
67
 
42
68
  /* Headings share family/weight/color across densities; size + margin differ below. */
@@ -56,7 +82,8 @@
56
82
  * conventional voice for a quotation and separates it from body copy without spending weight or
57
83
  * another color on it. */
58
84
  .root blockquote {
59
- padding: 2px 0 2px 12px;
85
+ padding: var(--vx-space-prose-quote-inset-y) 0 var(--vx-space-prose-quote-inset-y)
86
+ var(--vx-space-prose-quote-indent);
60
87
  border-left: 2px solid var(--vx-divider);
61
88
  color: var(--vx-muted);
62
89
  font-style: italic;
@@ -85,8 +112,8 @@
85
112
  font-family: var(--basalt-font-mono);
86
113
  font-size: 0.85em;
87
114
  background-color: color-mix(in srgb, var(--vx-ink) 7%, transparent);
88
- padding: 1.5px 5px;
89
- border-radius: 4px;
115
+ padding: var(--vx-space-prose-inline-code-inset-y) var(--vx-space-prose-inline-code-inset-x);
116
+ border-radius: var(--vx-radius-fine);
90
117
  color: var(--vx-ink2);
91
118
  }
92
119
 
@@ -96,8 +123,8 @@
96
123
  font-size: var(--vx-text-sm);
97
124
  line-height: 1.5;
98
125
  background-color: color-mix(in srgb, var(--vx-ink) 6%, transparent);
99
- border-radius: 8px;
100
- padding: 10px 12px;
126
+ border-radius: var(--vx-radius-floating);
127
+ padding: var(--vx-space-prose-code-block-inset-y) var(--vx-space-prose-code-block-inset-x);
101
128
  overflow-x: auto;
102
129
  }
103
130
 
@@ -140,7 +167,7 @@
140
167
  .root h6 .headingAnchor {
141
168
  display: inline-flex;
142
169
  vertical-align: middle;
143
- margin-left: 6px;
170
+ margin-left: var(--vx-space-prose-heading-anchor-gap);
144
171
  opacity: 0;
145
172
  transition: opacity 120ms ease;
146
173
  }
@@ -177,7 +204,7 @@
177
204
  .root th,
178
205
  .root td {
179
206
  border: 1px solid var(--vx-surface-border);
180
- padding: 5px 8px;
207
+ padding: var(--vx-space-prose-table-cell-inset-y) var(--vx-space-prose-table-cell-inset-x);
181
208
  text-align: left;
182
209
  }
183
210
 
@@ -208,22 +235,22 @@
208
235
  }
209
236
 
210
237
  .root.chat p {
211
- margin: 0 0 8px;
238
+ margin: 0 0 var(--vx-space-stack-sm);
212
239
  }
213
240
 
214
241
  .root.chat ul,
215
242
  .root.chat ol {
216
- margin: 4px 0 10px;
217
- padding-left: 20px;
243
+ margin: var(--vx-space-stack-xs) 0 var(--vx-space-prose-chat-list-gap-bottom);
244
+ padding-left: var(--vx-space-prose-chat-list-indent);
218
245
  }
219
246
 
220
247
  .root.chat li {
221
- margin: 3px 0;
248
+ margin: var(--vx-space-prose-chat-list-item-gap) 0;
222
249
  }
223
250
 
224
251
  .root.chat li > ul,
225
252
  .root.chat li > ol {
226
- margin: 2px 0;
253
+ margin: var(--vx-space-prose-chat-nested-list-gap) 0;
227
254
  }
228
255
 
229
256
  .root.chat h1,
@@ -232,7 +259,7 @@
232
259
  .root.chat h4,
233
260
  .root.chat h5,
234
261
  .root.chat h6 {
235
- margin: 14px 0 6px;
262
+ margin: var(--vx-space-prose-chat-heading-gap-top) 0 var(--vx-space-prose-chat-heading-gap-bottom);
236
263
  }
237
264
 
238
265
  .root.chat h1 {
@@ -255,11 +282,11 @@
255
282
  .root.chat pre,
256
283
  .root.chat table,
257
284
  .root.chat > div {
258
- margin: 8px 0;
285
+ margin: var(--vx-space-stack-sm) 0;
259
286
  }
260
287
 
261
288
  .root.chat hr {
262
- margin: 12px 0;
289
+ margin: var(--vx-space-stack-md) 0;
263
290
  }
264
291
 
265
292
  /* ── Article density — the long-form reading density (default) ────────────────────────────────── */
@@ -270,46 +297,49 @@
270
297
  }
271
298
 
272
299
  .root.article p {
273
- margin: 0 0 14px;
300
+ margin: 0 0 var(--vx-space-prose-article-paragraph-gap);
274
301
  }
275
302
 
276
303
  .root.article ul,
277
304
  .root.article ol {
278
- margin: 6px 0 14px;
279
- padding-left: 22px;
305
+ margin: var(--vx-space-prose-article-list-gap-top) 0 var(--vx-space-prose-article-list-gap-bottom);
306
+ padding-left: var(--vx-space-prose-article-list-indent);
280
307
  }
281
308
 
282
309
  .root.article li {
283
- margin: 4px 0;
310
+ margin: var(--vx-space-stack-xs) 0;
284
311
  }
285
312
 
286
313
  .root.article li > ul,
287
314
  .root.article li > ol {
288
- margin: 4px 0;
315
+ margin: var(--vx-space-stack-xs) 0;
289
316
  }
290
317
 
291
318
  .root.article h1 {
292
319
  font-size: var(--vx-text-h1);
293
- margin: 6px 0 14px;
320
+ margin: var(--vx-space-prose-article-h1-gap-top) 0 var(--vx-space-prose-article-h1-gap-bottom);
294
321
  }
295
322
 
296
323
  .root.article h2 {
297
324
  font-size: var(--vx-text-h2);
298
- margin: 30px 0 10px;
325
+ margin: var(--vx-space-prose-article-heading-gap-top) 0
326
+ var(--vx-space-prose-article-heading-gap-bottom);
299
327
  border-bottom: 1px solid var(--vx-divider);
300
- padding-bottom: 6px;
328
+ padding-bottom: var(--vx-space-prose-article-h2-rule-gap);
301
329
  }
302
330
 
303
331
  .root.article h3 {
304
332
  font-size: var(--vx-text-xl);
305
- margin: 30px 0 10px;
333
+ margin: var(--vx-space-prose-article-heading-gap-top) 0
334
+ var(--vx-space-prose-article-heading-gap-bottom);
306
335
  }
307
336
 
308
337
  .root.article h4,
309
338
  .root.article h5,
310
339
  .root.article h6 {
311
340
  font-size: var(--vx-text-lg);
312
- margin: 30px 0 10px;
341
+ margin: var(--vx-space-prose-article-heading-gap-top) 0
342
+ var(--vx-space-prose-article-heading-gap-bottom);
313
343
  }
314
344
 
315
345
  /* Block objects — code blocks, callouts, diagrams, tables, quotes — interrupt the paragraph flow
@@ -322,9 +352,9 @@
322
352
  .root.article pre,
323
353
  .root.article table,
324
354
  .root.article > div {
325
- margin: 18px 0;
355
+ margin: var(--vx-space-prose-article-block-gap) 0;
326
356
  }
327
357
 
328
358
  .root.article hr {
329
- margin: 24px 0;
359
+ margin: var(--vx-space-stack-xl) 0;
330
360
  }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Regression test for the responsive sticky-header-clearance split (Decision 3,
3
+ * `deriveSpacing`'s JSDoc in `tokens/palette.ts`, third bullet) — the CSS side of it has no other
4
+ * coverage: `theme/spacing.test.ts`/`density-relations.test.ts` lock the two `--vx-space-sticky-
5
+ * header-clearance*` NUMBERS, but nothing asserted that `prose.module.css` actually wires the
6
+ * DESKTOP var to the unconditional rule and the MOBILE var to the `max-width` override — an
7
+ * inverted media query, a swap of the two vars, or a deleted `@media` block would all pass the rest
8
+ * of the suite silently. Asserted directly against the shipped CSS text, same pattern as
9
+ * `styles.floor.test.ts`.
10
+ */
11
+ import { readFileSync } from 'node:fs'
12
+ import { dirname, resolve } from 'node:path'
13
+ import { fileURLToPath } from 'node:url'
14
+ import { describe, expect, it } from 'bun:test'
15
+
16
+ const PROSE_CSS_PATH = resolve(dirname(fileURLToPath(import.meta.url)), 'prose.module.css')
17
+
18
+ describe('prose.module.css — responsive sticky-header clearance split (Decision 3)', () => {
19
+ const css = readFileSync(PROSE_CSS_PATH, 'utf8')
20
+
21
+ // The first (unconditional) `.root h2, .root h3, .root h4 { scroll-margin-top: … }` rule in the
22
+ // file — `.match` without the `g` flag returns the first match, which is this one since it
23
+ // precedes the `@media` override in source.
24
+ const baseRuleMatch = css.match(
25
+ /\.root h2,\s*\.root h3,\s*\.root h4\s*\{\s*scroll-margin-top:\s*([^;]+);\s*\}/,
26
+ )
27
+
28
+ it('the base (non-media) rule clears the DESKTOP header', () => {
29
+ expect(baseRuleMatch).not.toBeNull()
30
+ expect(baseRuleMatch?.[1]).toBe('var(--vx-space-sticky-header-clearance)')
31
+ })
32
+
33
+ // Requires the literal `max-width: 47.99375em` query wrapping the rule — fails if the query is
34
+ // inverted to `min-width`, retuned to a different value, or the whole `@media` block is deleted.
35
+ const mediaBlockMatch = css.match(
36
+ /@media\s*\(max-width:\s*47\.99375em\)\s*\{[\s\S]*?\.root h2,\s*\.root h3,\s*\.root h4\s*\{\s*scroll-margin-top:\s*([^;]+);\s*\}\s*\}/,
37
+ )
38
+
39
+ it("the mobile override exists at Mantine's exact 48em min-width complement (47.99375em)", () => {
40
+ expect(mediaBlockMatch).not.toBeNull()
41
+ })
42
+
43
+ it('the media override clears the MOBILE header, not the desktop one (catches a var swap)', () => {
44
+ expect(mediaBlockMatch?.[1]).toBe('var(--vx-space-sticky-header-clearance-mobile)')
45
+ })
46
+
47
+ it('the base rule appears before the override in source order — both share (0,2,1) specificity, so a same-specificity tie resolves by source order regardless of the @media nesting; an override placed BEFORE the base rule would lose to it even while the media query matches', () => {
48
+ const baseIndex = css.indexOf('scroll-margin-top: var(--vx-space-sticky-header-clearance);')
49
+ const mobileIndex = css.indexOf(
50
+ 'scroll-margin-top: var(--vx-space-sticky-header-clearance-mobile);',
51
+ )
52
+ expect(baseIndex).toBeGreaterThan(-1)
53
+ expect(mobileIndex).toBeGreaterThan(baseIndex)
54
+ })
55
+ })
@@ -7,6 +7,8 @@
7
7
  .root {
8
8
  position: fixed;
9
9
  inset: 0 0 auto 0;
10
+ /* SPACE_FIXED.readingProgressHeight (tokens/palette.ts) — a hairline-like indicator height,
11
+ * density-exempt like a divider, so it stays a literal (not a --vx-space-* var). */
10
12
  height: 2px;
11
13
  background: transparent;
12
14
  z-index: 100;
@@ -6,7 +6,7 @@
6
6
  .root {
7
7
  display: flex;
8
8
  flex-direction: column;
9
- gap: 6px;
9
+ gap: var(--vx-space-toc-root-gap);
10
10
  }
11
11
 
12
12
  .header {
@@ -31,7 +31,10 @@
31
31
  font-size: var(--vx-text-sm);
32
32
  color: var(--vx-muted);
33
33
  text-decoration: none;
34
- padding: 4px 0 4px 12px;
34
+ padding: var(--vx-space-toc-link-inset-y) 0 var(--vx-space-toc-link-inset-y)
35
+ var(--vx-space-toc-link-indent);
36
+ /* Cancels the 1px hairline `.list` border-left so this row's own (transparent) border-left below
37
+ * lands flush with it — tied to that border WIDTH, not a spacing value, so it stays a literal. */
35
38
  margin-left: -1px;
36
39
  border-left: 2px solid transparent;
37
40
  transition: color 120ms ease;
@@ -42,7 +45,7 @@
42
45
  }
43
46
 
44
47
  .sub {
45
- padding-left: 24px;
48
+ padding-left: var(--vx-space-toc-sub-indent);
46
49
  }
47
50
 
48
51
  .active {
@@ -45,13 +45,13 @@ export function DeltaBadge({
45
45
  styles={{
46
46
  root: {
47
47
  backgroundColor: alpha(tone, 0.13),
48
- padding: '2px 7px',
48
+ padding: 'var(--vx-space-badge-inset-y) var(--vx-space-badge-inset-x)',
49
49
  height: 'auto',
50
50
  },
51
51
  label: {
52
- display: 'inline-flex',
52
+ display: 'inline-flex', // theme-allow: Mantine Badge styles.label part — CSS-in-JS, not a layout node
53
53
  alignItems: 'center',
54
- gap: 3,
54
+ gap: 3, // theme-allow: sub-scale badge glyph-to-label gap, below the token scale
55
55
  fontFamily: 'var(--basalt-font-mono)',
56
56
  fontSize: VX.text.xs,
57
57
  fontWeight: 600,
@@ -64,7 +64,13 @@ export function DeltaBadge({
64
64
  {/* optical glyph ratio relative to the label, not a scale step */}
65
65
  {showGlyph && <span style={{ fontSize: '0.8em' }}>{glyph}</span>}
66
66
  {format(value)}
67
- {period && <span style={{ marginLeft: 4, fontWeight: 500, opacity: 0.6 }}>{period}</span>}
67
+ {period && (
68
+ <span
69
+ style={{ marginLeft: 4, fontWeight: 500, opacity: 0.6 }} // theme-allow: sub-scale optical period offset, below the token scale
70
+ >
71
+ {period}
72
+ </span>
73
+ )}
68
74
  </Badge>
69
75
  )
70
76
  }
@@ -15,7 +15,7 @@
15
15
  * variant="section"
16
16
  * />
17
17
  */
18
- import { Stack } from '@mantine/core'
18
+ import { Center, Stack } from '@mantine/core'
19
19
  import type { ReactNode } from 'react'
20
20
  import { VX } from '../tokens'
21
21
 
@@ -42,26 +42,13 @@ export function EmptyState({
42
42
  return (
43
43
  <Stack
44
44
  align="center"
45
- gap={10}
45
+ gap="xs"
46
46
  style={{
47
47
  padding: variant === 'page' ? '64px 24px' : '32px 20px',
48
48
  textAlign: 'center',
49
49
  }}
50
50
  >
51
- {icon && (
52
- <div
53
- style={{
54
- width: 32,
55
- height: 32,
56
- display: 'flex',
57
- alignItems: 'center',
58
- justifyContent: 'center',
59
- color: VX.faint,
60
- }}
61
- >
62
- {icon}
63
- </div>
64
- )}
51
+ {icon && <Center style={{ width: 32, height: 32, color: VX.faint }}>{icon}</Center>}
65
52
  <span
66
53
  style={{
67
54
  fontFamily: 'var(--basalt-font-head)',
@@ -4,7 +4,7 @@
4
4
  * `:not(:last-child)` strips the divider there so the section doesn't end on a trailing line.
5
5
  */
6
6
  .rows > * {
7
- padding: 10px 0;
7
+ padding: var(--vx-space-settings-row-inset-y) 0;
8
8
  }
9
9
 
10
10
  .rows > *:not(:last-child) {
@@ -15,7 +15,7 @@
15
15
  display: flex;
16
16
  align-items: flex-start;
17
17
  justify-content: space-between;
18
- gap: 16px;
18
+ gap: var(--vx-space-settings-row-gap);
19
19
  }
20
20
 
21
21
  .control {
@@ -59,7 +59,7 @@ export type SettingsSectionProps = {
59
59
  export function SettingsSection({ title, description, children }: SettingsSectionProps) {
60
60
  return (
61
61
  <Card style={{ padding: 'var(--mantine-spacing-xs) var(--mantine-spacing-sm)' }}>
62
- <Stack gap={2} mb={12}>
62
+ <Stack gap={2} mb="sm">
63
63
  <span style={titleStyle}>{title}</span>
64
64
  {description && (
65
65
  <span style={{ fontSize: VX.text.sm, color: VX.muted }}>{description}</span>
@@ -105,7 +105,7 @@ export function DangerZone({ title, description, children }: DangerZoneProps) {
105
105
  boxShadow: `${VX.shadowCard}, 0 0 0 1px ${alpha(VX.status.bad, 0.25)}`,
106
106
  }}
107
107
  >
108
- <Stack gap={2} mb={12}>
108
+ <Stack gap={2} mb="sm">
109
109
  <span style={eyebrowStyle}>Danger Zone</span>
110
110
  <span style={titleStyle}>{title}</span>
111
111
  {description && (
@@ -52,9 +52,9 @@ export function StatCard({ label, value, delta, deltaPeriod, sparkline, menu }:
52
52
  // explicit for intent.
53
53
  padding: 'var(--mantine-spacing-xs) var(--mantine-spacing-sm)',
54
54
  minHeight: 118,
55
- display: 'flex',
55
+ display: 'flex', // theme-allow: Card root as a flex column — Mantine Card takes no layout props
56
56
  flexDirection: 'column',
57
- gap: 8,
57
+ gap: 'var(--vx-space-stat-card-gap)',
58
58
  overflow: 'hidden',
59
59
  }}
60
60
  >
@@ -130,9 +130,19 @@ export function BasaltVirtualList<T>({
130
130
  {Array.from({ length: skeletonRows }, (_, i) => (
131
131
  <div
132
132
  key={`skeleton-${i}`}
133
- style={{ height: estimateSize, padding: '8px 12px', boxSizing: 'border-box' }}
133
+ style={{
134
+ height: estimateSize,
135
+ padding: 'var(--vx-space-virtual-row-inset-y) var(--vx-space-virtual-row-inset-x)',
136
+ boxSizing: 'border-box',
137
+ }}
134
138
  >
135
- <Skeleton height={estimateSize - 16} radius="sm" />
139
+ {/* Inner height = row height minus the row's own vertical inset (top + bottom), read
140
+ from the same density-tracking var the padding above uses — a hardcoded subtrahend
141
+ would only be correct at density level 0. */}
142
+ <Skeleton
143
+ height={`calc(${estimateSize}px - 2 * var(--vx-space-virtual-row-inset-y))`}
144
+ radius="sm"
145
+ />
136
146
  </div>
137
147
  ))}
138
148
  </Box>
@@ -45,12 +45,12 @@ export function FormErrorSummary<Values extends Record<string, unknown>>({
45
45
  return (
46
46
  <Alert
47
47
  role="alert"
48
- radius={6}
49
48
  title={<Text fw={600}>{title}</Text>}
50
49
  styles={{
51
50
  root: {
52
51
  backgroundColor: alpha(VX.status.bad, 0.13),
53
52
  color: VX.status.bad,
53
+ borderRadius: 'var(--vx-radius-ctrl)',
54
54
  },
55
55
  }}
56
56
  >