basalt-ui 1.1.1 → 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.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +30 -0
- package/README.md +47 -5
- package/agent/rules/basalt-app.md +126 -0
- package/agent/rules/basalt-content.md +3 -1
- package/agent/skills/basalt-app/SKILL.md +28 -7
- package/dist/agent/part-list.d.ts.map +1 -1
- package/dist/agent/part-list.js +17 -7
- package/dist/agent/stick-to-bottom.js +2 -2
- package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -1
- package/dist/agent-chat/thread-detail-panel.js +37 -33
- package/dist/agent-chat/thread-message.d.ts.map +1 -1
- package/dist/agent-chat/thread-message.js +8 -5
- package/dist/agent-chat/thread-outcome-card.js +3 -3
- package/dist/agent-chat/thread-workspace.js +1 -1
- package/dist/charts/primitives/ChartLegend.js +2 -0
- package/dist/charts/primitives/ChartTooltip.js +2 -1
- package/dist/cli/index.d.ts +15 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +29 -7
- package/dist/connectivity/connectivity-indicator.d.ts.map +1 -1
- package/dist/connectivity/connectivity-indicator.js +3 -3
- package/dist/content/article-card.module.css +7 -5
- package/dist/content/article-layout.module.css +16 -12
- package/dist/content/callout.module.css +4 -4
- package/dist/content/code-block.module.css +8 -7
- package/dist/content/guide.module.css +3 -3
- package/dist/content/mermaid.module.css +2 -2
- package/dist/content/prose.module.css +59 -29
- package/dist/content/reading-progress.module.css +2 -0
- package/dist/content/toc.module.css +6 -3
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +10 -2
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +3 -16
- package/dist/dashboard/settings-section.js +2 -2
- package/dist/dashboard/settings-section.module.css +2 -2
- package/dist/dashboard/stat-card.js +2 -1
- package/dist/data/virtual-list.d.ts.map +1 -1
- package/dist/data/virtual-list.js +12 -2
- package/dist/forms/FormErrorSummary.js +2 -2
- package/dist/guard/index.d.ts +20 -4
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +250 -37
- package/dist/guard/types.d.ts +24 -3
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/provider/index.d.ts +30 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +32 -7
- package/dist/provider/lab-theme.d.ts +39 -0
- package/dist/provider/lab-theme.d.ts.map +1 -0
- package/dist/provider/lab-theme.js +52 -0
- package/dist/shell/app-header.module.css +2 -2
- package/dist/shell/app-mobile-nav.module.css +1 -1
- package/dist/shell/app-sidebar-account.d.ts.map +1 -1
- package/dist/shell/app-sidebar-account.js +4 -2
- package/dist/shell/app-sidebar.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +4 -2
- package/dist/shell/app-sidebar.module.css +36 -26
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +11 -4
- package/dist/shell/sidebar-search.module.css +16 -4
- package/dist/styles.css +1 -1
- package/dist/surfaces.d.ts +15 -11
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +4 -3
- package/dist/theme/controls.module.css +1 -1
- package/dist/theme/floating.module.css +1 -1
- package/dist/theme/index.d.ts +116 -11
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +703 -566
- package/dist/theme/nav-link.module.css +1 -1
- package/dist/theme/use-basalt-spacing.d.ts +3 -0
- package/dist/theme/use-basalt-spacing.d.ts.map +1 -0
- package/dist/theme/use-basalt-spacing.js +8 -0
- package/dist/theme-lab/derive-controls.d.ts +13 -0
- package/dist/theme-lab/derive-controls.d.ts.map +1 -0
- package/dist/theme-lab/derive-controls.js +137 -0
- package/dist/theme-lab/derive-state.d.ts +55 -0
- package/dist/theme-lab/derive-state.d.ts.map +1 -0
- package/dist/theme-lab/derive-state.js +81 -0
- package/dist/theme-lab/index.d.ts +12 -2
- package/dist/theme-lab/index.d.ts.map +1 -1
- package/dist/theme-lab/index.js +13 -62
- package/dist/theme-toggle/index.d.ts.map +1 -1
- package/dist/theme-toggle/index.js +3 -2
- package/dist/tokens/derive.d.ts +89 -0
- package/dist/tokens/derive.d.ts.map +1 -0
- package/dist/tokens/derive.js +250 -0
- package/dist/tokens/hct.d.ts +34 -0
- package/dist/tokens/hct.d.ts.map +1 -0
- package/dist/tokens/hct.js +159 -0
- package/dist/tokens/index.d.ts +71 -7
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +284 -46
- package/dist/tokens/palette.d.ts +984 -167
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +617 -119
- package/dist/vite-color-mix.d.ts +30 -0
- package/dist/vite-color-mix.d.ts.map +1 -0
- package/dist/vite-color-mix.js +80 -0
- package/dist/vite.d.ts +82 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +312 -0
- package/llms.txt +5 -4
- package/package.json +24 -9
- package/src/agent/part-list.tsx +13 -7
- package/src/agent/stick-to-bottom.tsx +2 -2
- package/src/agent-chat/thread-detail-panel.tsx +13 -10
- package/src/agent-chat/thread-message.tsx +8 -5
- package/src/agent-chat/thread-outcome-card.tsx +2 -2
- package/src/agent-chat/thread-workspace.tsx +2 -2
- package/src/charts/primitives/ChartLegend.tsx +2 -2
- package/src/charts/primitives/ChartTooltip.tsx +2 -2
- package/src/cli/check-theme.test.ts +18 -0
- package/src/cli/index.ts +55 -5
- package/src/connectivity/connectivity-indicator.tsx +8 -2
- package/src/content/article-card.module.css +7 -5
- package/src/content/article-layout.module.css +16 -12
- package/src/content/callout.module.css +4 -4
- package/src/content/code-block.module.css +8 -7
- package/src/content/guide.module.css +3 -3
- package/src/content/mermaid.module.css +2 -2
- package/src/content/prose.module.css +59 -29
- package/src/content/prose.module.css.test.ts +55 -0
- package/src/content/reading-progress.module.css +2 -0
- package/src/content/toc.module.css +6 -3
- package/src/dashboard/delta-badge.tsx +10 -4
- package/src/dashboard/empty-state.tsx +3 -16
- package/src/dashboard/settings-section.module.css +2 -2
- package/src/dashboard/settings-section.tsx +2 -2
- package/src/dashboard/stat-card.tsx +2 -2
- package/src/data/virtual-list.tsx +12 -2
- package/src/forms/FormErrorSummary.tsx +1 -1
- package/src/guard/check-source.test.ts +416 -5
- package/src/guard/index.ts +367 -45
- package/src/guard/types.ts +24 -2
- package/src/index.ts +1 -0
- package/src/provider/index.test.tsx +100 -0
- package/src/provider/index.tsx +79 -7
- package/src/provider/lab-theme.test.ts +147 -0
- package/src/provider/lab-theme.ts +166 -0
- package/src/shell/app-header.module.css +2 -2
- package/src/shell/app-mobile-nav.module.css +1 -1
- package/src/shell/app-sidebar-account.tsx +9 -2
- package/src/shell/app-sidebar.module.css +36 -26
- package/src/shell/app-sidebar.tsx +12 -2
- package/src/shell/index.tsx +14 -3
- package/src/shell/sidebar-search.module.css +16 -4
- package/src/styles.css +1 -1
- package/src/surfaces.ts +17 -10
- package/src/theme/contrast.test.ts +19 -3
- package/src/theme/controls.module.css +1 -1
- package/src/theme/density-option.test.ts +96 -0
- package/src/theme/density-relations.test.ts +428 -0
- package/src/theme/derive-theme.test.ts +101 -0
- package/src/theme/floating.module.css +1 -1
- package/src/theme/fonts-option.test.ts +69 -0
- package/src/theme/index.ts +930 -563
- package/src/theme/nav-link.module.css +1 -1
- package/src/theme/radius-option.test.ts +86 -0
- package/src/theme/radius.test.ts +132 -0
- package/src/theme/spacing.test.ts +432 -0
- package/src/theme/use-basalt-spacing.test.tsx +51 -0
- package/src/theme/use-basalt-spacing.ts +38 -0
- package/src/theme-lab/derive-controls.test.ts +94 -0
- package/src/theme-lab/derive-controls.tsx +227 -0
- package/src/theme-lab/derive-state.test.ts +71 -0
- package/src/theme-lab/derive-state.ts +163 -0
- package/src/theme-lab/index.tsx +29 -68
- package/src/theme-lab/theme-lab.test.ts +4 -18
- package/src/theme-toggle/index.tsx +9 -4
- package/src/tokens/build-fonts-css.test.ts +51 -0
- package/src/tokens/build-radius-css.test.ts +25 -0
- package/src/tokens/density.test.ts +274 -0
- package/src/tokens/derive-radius.test.ts +62 -0
- package/src/tokens/derive.test.ts +30 -0
- package/src/tokens/derive.ts +481 -0
- package/src/tokens/hct.ts +231 -0
- package/src/tokens/index.ts +395 -45
- package/src/tokens/palette.test.ts +114 -0
- package/src/tokens/palette.ts +1118 -180
- package/src/vite-color-mix.test.ts +46 -0
- package/src/vite-color-mix.ts +137 -0
- package/src/vite.test.ts +192 -0
- package/src/vite.ts +502 -1
|
@@ -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
|
|
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:
|
|
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:
|
|
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:
|
|
89
|
-
border-radius:
|
|
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:
|
|
100
|
-
padding:
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
217
|
-
padding-left:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
285
|
+
margin: var(--vx-space-stack-sm) 0;
|
|
259
286
|
}
|
|
260
287
|
|
|
261
288
|
.root.chat hr {
|
|
262
|
-
margin:
|
|
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
|
|
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:
|
|
279
|
-
padding-left:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
355
|
+
margin: var(--vx-space-prose-article-block-gap) 0;
|
|
326
356
|
}
|
|
327
357
|
|
|
328
358
|
.root.article hr {
|
|
329
|
-
margin:
|
|
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:
|
|
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:
|
|
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:
|
|
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: '
|
|
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 &&
|
|
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=
|
|
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:
|
|
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:
|
|
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=
|
|
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=
|
|
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:
|
|
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={{
|
|
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
|
-
|
|
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
|
>
|