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.
Files changed (188) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +30 -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 +28 -7
  7. package/dist/agent/part-list.d.ts.map +1 -1
  8. package/dist/agent/part-list.js +17 -7
  9. package/dist/agent/stick-to-bottom.js +2 -2
  10. package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -1
  11. package/dist/agent-chat/thread-detail-panel.js +37 -33
  12. package/dist/agent-chat/thread-message.d.ts.map +1 -1
  13. package/dist/agent-chat/thread-message.js +8 -5
  14. package/dist/agent-chat/thread-outcome-card.js +3 -3
  15. package/dist/agent-chat/thread-workspace.js +1 -1
  16. package/dist/charts/primitives/ChartLegend.js +2 -0
  17. package/dist/charts/primitives/ChartTooltip.js +2 -1
  18. package/dist/cli/index.d.ts +15 -0
  19. package/dist/cli/index.d.ts.map +1 -1
  20. package/dist/cli/index.js +29 -7
  21. package/dist/connectivity/connectivity-indicator.d.ts.map +1 -1
  22. package/dist/connectivity/connectivity-indicator.js +3 -3
  23. package/dist/content/article-card.module.css +7 -5
  24. package/dist/content/article-layout.module.css +16 -12
  25. package/dist/content/callout.module.css +4 -4
  26. package/dist/content/code-block.module.css +8 -7
  27. package/dist/content/guide.module.css +3 -3
  28. package/dist/content/mermaid.module.css +2 -2
  29. package/dist/content/prose.module.css +59 -29
  30. package/dist/content/reading-progress.module.css +2 -0
  31. package/dist/content/toc.module.css +6 -3
  32. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  33. package/dist/dashboard/delta-badge.js +10 -2
  34. package/dist/dashboard/empty-state.d.ts.map +1 -1
  35. package/dist/dashboard/empty-state.js +3 -16
  36. package/dist/dashboard/settings-section.js +2 -2
  37. package/dist/dashboard/settings-section.module.css +2 -2
  38. package/dist/dashboard/stat-card.js +2 -1
  39. package/dist/data/virtual-list.d.ts.map +1 -1
  40. package/dist/data/virtual-list.js +12 -2
  41. package/dist/forms/FormErrorSummary.js +2 -2
  42. package/dist/guard/index.d.ts +20 -4
  43. package/dist/guard/index.d.ts.map +1 -1
  44. package/dist/guard/index.js +250 -37
  45. package/dist/guard/types.d.ts +24 -3
  46. package/dist/guard/types.d.ts.map +1 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/provider/index.d.ts +30 -1
  50. package/dist/provider/index.d.ts.map +1 -1
  51. package/dist/provider/index.js +32 -7
  52. package/dist/provider/lab-theme.d.ts +39 -0
  53. package/dist/provider/lab-theme.d.ts.map +1 -0
  54. package/dist/provider/lab-theme.js +52 -0
  55. package/dist/shell/app-header.module.css +2 -2
  56. package/dist/shell/app-mobile-nav.module.css +1 -1
  57. package/dist/shell/app-sidebar-account.d.ts.map +1 -1
  58. package/dist/shell/app-sidebar-account.js +4 -2
  59. package/dist/shell/app-sidebar.d.ts.map +1 -1
  60. package/dist/shell/app-sidebar.js +4 -2
  61. package/dist/shell/app-sidebar.module.css +36 -26
  62. package/dist/shell/index.d.ts.map +1 -1
  63. package/dist/shell/index.js +11 -4
  64. package/dist/shell/sidebar-search.module.css +16 -4
  65. package/dist/styles.css +1 -1
  66. package/dist/surfaces.d.ts +15 -11
  67. package/dist/surfaces.d.ts.map +1 -1
  68. package/dist/surfaces.js +4 -3
  69. package/dist/theme/controls.module.css +1 -1
  70. package/dist/theme/floating.module.css +1 -1
  71. package/dist/theme/index.d.ts +116 -11
  72. package/dist/theme/index.d.ts.map +1 -1
  73. package/dist/theme/index.js +703 -566
  74. package/dist/theme/nav-link.module.css +1 -1
  75. package/dist/theme/use-basalt-spacing.d.ts +3 -0
  76. package/dist/theme/use-basalt-spacing.d.ts.map +1 -0
  77. package/dist/theme/use-basalt-spacing.js +8 -0
  78. package/dist/theme-lab/derive-controls.d.ts +13 -0
  79. package/dist/theme-lab/derive-controls.d.ts.map +1 -0
  80. package/dist/theme-lab/derive-controls.js +137 -0
  81. package/dist/theme-lab/derive-state.d.ts +55 -0
  82. package/dist/theme-lab/derive-state.d.ts.map +1 -0
  83. package/dist/theme-lab/derive-state.js +81 -0
  84. package/dist/theme-lab/index.d.ts +12 -2
  85. package/dist/theme-lab/index.d.ts.map +1 -1
  86. package/dist/theme-lab/index.js +13 -62
  87. package/dist/theme-toggle/index.d.ts.map +1 -1
  88. package/dist/theme-toggle/index.js +3 -2
  89. package/dist/tokens/derive.d.ts +89 -0
  90. package/dist/tokens/derive.d.ts.map +1 -0
  91. package/dist/tokens/derive.js +250 -0
  92. package/dist/tokens/hct.d.ts +34 -0
  93. package/dist/tokens/hct.d.ts.map +1 -0
  94. package/dist/tokens/hct.js +159 -0
  95. package/dist/tokens/index.d.ts +71 -7
  96. package/dist/tokens/index.d.ts.map +1 -1
  97. package/dist/tokens/index.js +284 -46
  98. package/dist/tokens/palette.d.ts +984 -167
  99. package/dist/tokens/palette.d.ts.map +1 -1
  100. package/dist/tokens/palette.js +617 -119
  101. package/dist/vite-color-mix.d.ts +30 -0
  102. package/dist/vite-color-mix.d.ts.map +1 -0
  103. package/dist/vite-color-mix.js +80 -0
  104. package/dist/vite.d.ts +82 -1
  105. package/dist/vite.d.ts.map +1 -1
  106. package/dist/vite.js +312 -0
  107. package/llms.txt +5 -4
  108. package/package.json +24 -9
  109. package/src/agent/part-list.tsx +13 -7
  110. package/src/agent/stick-to-bottom.tsx +2 -2
  111. package/src/agent-chat/thread-detail-panel.tsx +13 -10
  112. package/src/agent-chat/thread-message.tsx +8 -5
  113. package/src/agent-chat/thread-outcome-card.tsx +2 -2
  114. package/src/agent-chat/thread-workspace.tsx +2 -2
  115. package/src/charts/primitives/ChartLegend.tsx +2 -2
  116. package/src/charts/primitives/ChartTooltip.tsx +2 -2
  117. package/src/cli/check-theme.test.ts +18 -0
  118. package/src/cli/index.ts +55 -5
  119. package/src/connectivity/connectivity-indicator.tsx +8 -2
  120. package/src/content/article-card.module.css +7 -5
  121. package/src/content/article-layout.module.css +16 -12
  122. package/src/content/callout.module.css +4 -4
  123. package/src/content/code-block.module.css +8 -7
  124. package/src/content/guide.module.css +3 -3
  125. package/src/content/mermaid.module.css +2 -2
  126. package/src/content/prose.module.css +59 -29
  127. package/src/content/prose.module.css.test.ts +55 -0
  128. package/src/content/reading-progress.module.css +2 -0
  129. package/src/content/toc.module.css +6 -3
  130. package/src/dashboard/delta-badge.tsx +10 -4
  131. package/src/dashboard/empty-state.tsx +3 -16
  132. package/src/dashboard/settings-section.module.css +2 -2
  133. package/src/dashboard/settings-section.tsx +2 -2
  134. package/src/dashboard/stat-card.tsx +2 -2
  135. package/src/data/virtual-list.tsx +12 -2
  136. package/src/forms/FormErrorSummary.tsx +1 -1
  137. package/src/guard/check-source.test.ts +416 -5
  138. package/src/guard/index.ts +367 -45
  139. package/src/guard/types.ts +24 -2
  140. package/src/index.ts +1 -0
  141. package/src/provider/index.test.tsx +100 -0
  142. package/src/provider/index.tsx +79 -7
  143. package/src/provider/lab-theme.test.ts +147 -0
  144. package/src/provider/lab-theme.ts +166 -0
  145. package/src/shell/app-header.module.css +2 -2
  146. package/src/shell/app-mobile-nav.module.css +1 -1
  147. package/src/shell/app-sidebar-account.tsx +9 -2
  148. package/src/shell/app-sidebar.module.css +36 -26
  149. package/src/shell/app-sidebar.tsx +12 -2
  150. package/src/shell/index.tsx +14 -3
  151. package/src/shell/sidebar-search.module.css +16 -4
  152. package/src/styles.css +1 -1
  153. package/src/surfaces.ts +17 -10
  154. package/src/theme/contrast.test.ts +19 -3
  155. package/src/theme/controls.module.css +1 -1
  156. package/src/theme/density-option.test.ts +96 -0
  157. package/src/theme/density-relations.test.ts +428 -0
  158. package/src/theme/derive-theme.test.ts +101 -0
  159. package/src/theme/floating.module.css +1 -1
  160. package/src/theme/fonts-option.test.ts +69 -0
  161. package/src/theme/index.ts +930 -563
  162. package/src/theme/nav-link.module.css +1 -1
  163. package/src/theme/radius-option.test.ts +86 -0
  164. package/src/theme/radius.test.ts +132 -0
  165. package/src/theme/spacing.test.ts +432 -0
  166. package/src/theme/use-basalt-spacing.test.tsx +51 -0
  167. package/src/theme/use-basalt-spacing.ts +38 -0
  168. package/src/theme-lab/derive-controls.test.ts +94 -0
  169. package/src/theme-lab/derive-controls.tsx +227 -0
  170. package/src/theme-lab/derive-state.test.ts +71 -0
  171. package/src/theme-lab/derive-state.ts +163 -0
  172. package/src/theme-lab/index.tsx +29 -68
  173. package/src/theme-lab/theme-lab.test.ts +4 -18
  174. package/src/theme-toggle/index.tsx +9 -4
  175. package/src/tokens/build-fonts-css.test.ts +51 -0
  176. package/src/tokens/build-radius-css.test.ts +25 -0
  177. package/src/tokens/density.test.ts +274 -0
  178. package/src/tokens/derive-radius.test.ts +62 -0
  179. package/src/tokens/derive.test.ts +30 -0
  180. package/src/tokens/derive.ts +481 -0
  181. package/src/tokens/hct.ts +231 -0
  182. package/src/tokens/index.ts +395 -45
  183. package/src/tokens/palette.test.ts +114 -0
  184. package/src/tokens/palette.ts +1118 -180
  185. package/src/vite-color-mix.test.ts +46 -0
  186. package/src/vite-color-mix.ts +137 -0
  187. package/src/vite.test.ts +192 -0
  188. package/src/vite.ts +502 -1
@@ -4,10 +4,10 @@
4
4
  *
5
5
  * Identity: modern zinc (2026-07 redesign, see `docs/DESIGN-SPEC.md`). Cool-neutral zinc surfaces
6
6
  * (Tailwind zinc family) — a low-contrast panel lift on a slightly darker page, depth via a
7
- * whisper `shadow-card` (never a hairline-only border), and ONE saturated sky-blue accent
8
- * (#0077bd light / #8ec5ff dark) used with intent (primary series, active-nav icon, links, primary
9
- * actions, focus rings, meter leaders) — chrome stays zinc-neutral otherwise. Status hues stay
10
- * UI-tuned (muted, not raw Material/AntD/Tailwind defaults).
7
+ * whisper `shadow-card` (never a hairline-only border), and ONE saturated sky-blue accent used
8
+ * with intent (primary series, active-nav icon, links, primary actions, focus rings, meter
9
+ * leaders) — chrome stays zinc-neutral otherwise. Status hues stay UI-tuned (muted, not raw
10
+ * Material/AntD/Tailwind defaults).
11
11
  *
12
12
  * Design rules baked in (see `docs/DESIGN-SPEC.md`):
13
13
  * - Neutral zinc greys carry ~90% of the surface — chrome is monochrome, accent only points.
@@ -20,7 +20,15 @@
20
20
  *
21
21
  * This module is pure data — no React, no Mantine, no browser APIs. It is consumed by
22
22
  * the token layer (emits the CSS custom properties) and by the Mantine theme.
23
+ *
24
+ * GENERATED vs hand-authored: the accent family, the 12 categorical fills, the surface stops
25
+ * (bg/panel/panelHover/elevated/subtle/field/border/hairline), the ink ramp, and the status
26
+ * solids are COMPUTED at module load from `deriveTokens(DEFAULT_DERIVE_CONFIG)` (`./derive.ts`) —
27
+ * never hand-edit a hex for one of those; retune the derive config or its calibrated constants
28
+ * instead. Everything else here (shadows, dividers, tooltip chrome, the raw `BP` hue ramps,
29
+ * `STATUS.excellent`/`STATUS.neutral`) stays hand-authored, unchanged.
23
30
  */
31
+ import type { DeriveConfig } from './derive.js';
24
32
  import type { ColorPair } from './index.js';
25
33
  /**
26
34
  * Basalt palette. Each family is shade 1→5 (index 0 = darkest, 4 = lightest).
@@ -61,7 +69,928 @@ export declare const BP: {
61
69
  * that stops saturated hues from glowing. Override indices for ordered/sibling cases.
62
70
  */
63
71
  export declare const p: (fam: readonly string[], light?: number, dark?: number) => ColorPair;
64
- /** Semantic status hues — solids + the family they fill from (alpha applied in the token layer). */
72
+ /**
73
+ * Card / control depth shadows (`docs/DESIGN-SPEC.md` §2) — depth is a whisper shadow + a 1px
74
+ * ring baked into the SAME value (never a separate `border`). The ring embeds
75
+ * `var(--vx-surface-hairline)` so it stays single-sourced against the hairline pair below.
76
+ * Structural — independent of the derive config, unlike everything `buildPaletteData` below emits.
77
+ */
78
+ export declare const SHADOW: {
79
+ readonly card: {
80
+ readonly light: "0 1px 2px rgba(28,25,23,0.05), 0 0 0 1px var(--vx-surface-hairline)";
81
+ readonly dark: "0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px color-mix(in srgb, #ffffff 4%, transparent)";
82
+ };
83
+ readonly ctrl: {
84
+ readonly light: "0 1px 2px rgba(28,25,23,0.12)";
85
+ readonly dark: "0 1px 2px rgba(0,0,0,0.35)";
86
+ };
87
+ readonly overlay: {
88
+ readonly light: "0 8px 24px rgba(28,25,23,0.10)";
89
+ readonly dark: "0 8px 24px rgba(0,0,0,0.5)";
90
+ };
91
+ };
92
+ /**
93
+ * The resolved shape {@link deriveRadius} returns — the two anchors plus every offset that tracks
94
+ * one of them. The independent Mantine-scale stops (`scaleXs`/`scaleLg`/`scaleXl`) are NOT part of
95
+ * this shape — they never move with the knob (see `RADIUS_STEP` below).
96
+ */
97
+ export type RadiusValues = {
98
+ card: number;
99
+ ctrl: number;
100
+ floating: number;
101
+ tight: number;
102
+ fine: number;
103
+ };
104
+ /** `deriveRadius`'s accepted level range — exported (not through the `./tokens` barrel, same
105
+ * precedent as {@link scaleSpace}) so a cross-level test can derive the levels it loops over from
106
+ * the SAME bound `deriveRadius` enforces, instead of a hardcoded literal that silently stops
107
+ * covering the real range if the range ever changes again. */
108
+ export declare const RADIUS_LEVEL_RANGE: {
109
+ readonly min: -5;
110
+ readonly max: 5;
111
+ };
112
+ /**
113
+ * Derive the two radius anchors (`card`/`ctrl`) and their dependent offsets from a single integer
114
+ * `level` (`docs/DESIGN-SPEC.md` §4) — the radius analog of `deriveTokens`'s color knobs. `level: 0`
115
+ * reproduces the shipped identity exactly (`card: 7, ctrl: 6, floating: 8, tight: 5, fine: 4`,
116
+ * locked by `theme/radius.test.ts`).
117
+ *
118
+ * The law: `card = 7 + level`, `ctrl = 6 + level`, both clamped to `≥ 0`; every offset then follows
119
+ * its anchor — `floating = card + 1`, `tight = ctrl - 1`, `fine = ctrl - 2` — each ALSO clamped to
120
+ * `≥ 0` (so an aggressive negative level flattens the smaller tiers to square before the larger
121
+ * ones). The three independent Mantine-scale stops (`RADIUS_STEP.scaleXs/scaleLg/scaleXl`) are not
122
+ * part of this law — they stay fixed regardless of `level`.
123
+ *
124
+ * Throws on a non-integer or out-of-range (`[-5, 5]`) level — same throw-and-propagate discipline
125
+ * as `deriveTokens`'s accent-seed validation.
126
+ */
127
+ export declare function deriveRadius(level: number): RadiusValues;
128
+ /**
129
+ * Corner-radius anchors (`docs/DESIGN-SPEC.md` §4) — the two independent tiers the Mantine theme
130
+ * (`theme/index.ts`) resolves every component radius to. `card` mirrors the `--vx-radius-card` CSS
131
+ * var, `ctrl` mirrors `--vx-radius-ctrl` (`tokens/index.ts`'s `frameworkDerived` emits both from
132
+ * these SAME numbers), so the var and every JS `defaultProps.radius` in the theme read one source
133
+ * instead of two that can drift apart. `deriveRadius(0)`'s output — structural, independent of the
134
+ * derive config. Values are UNCHANGED from the shipped identity (locked by `theme/radius.test.ts`).
135
+ */
136
+ export declare const RADIUS: {
137
+ /** Card / Paper / `ChartCard` (Mantine-free chart chrome shares this token too). */
138
+ readonly card: number;
139
+ /** Inputs, buttons, segmented-control track — also `defaultRadius: 'md'` in the Mantine `radius`
140
+ * size-scale below. */
141
+ readonly ctrl: number;
142
+ };
143
+ /**
144
+ * Every OTHER radius number the Mantine theme resolves to a literal, named instead of bare. Each
145
+ * key is either an explicit offset from a `RADIUS` anchor (named for what tier it belongs to — see
146
+ * `deriveRadius` for the law that carries a retune along) or, where no such relation exists, its own
147
+ * independent constant (the Mantine `radius` scale predates the card/ctrl split). `deriveRadius(0)`'s
148
+ * output for the anchor-derived keys — UNCHANGED from the shipped identity (locked by
149
+ * `theme/radius.test.ts`).
150
+ */
151
+ export declare const RADIUS_STEP: {
152
+ /** Tooltip / Popover / Modal / Notification (`docs/DESIGN-SPEC.md` §5 floating tier) — one step
153
+ * above the card radius. */
154
+ readonly floating: number;
155
+ /** SegmentedControl's active indicator, Kbd, Code — one step below the control radius. */
156
+ readonly tight: number;
157
+ /** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius. */
158
+ readonly fine: number;
159
+ /** The Mantine `radius` scale's `xs` step — independent of both anchors. */
160
+ readonly scaleXs: 2;
161
+ /** The Mantine `radius` scale's `lg` step — independent of both anchors. */
162
+ readonly scaleLg: 16;
163
+ /** The Mantine `radius` scale's `xl` step — independent of both anchors. */
164
+ readonly scaleXl: 32;
165
+ /** Fully-rounded pill affordance (scroll-to-bottom button, chips). Fixed — a pill reads round at
166
+ * any radius level, so it does not track the knob (like the scale stops above). */
167
+ readonly pill: 9999;
168
+ };
169
+ /**
170
+ * Density-tracking semantic spacing anchors — the values {@link deriveSpacing}'s `level` knob
171
+ * retunes together, the spacing analog of `RADIUS` above. Frequency-audited from the component
172
+ * sweep: `rowInsetX`/`rowInsetY` are the `6px 10px` row inset that appears verbatim in 4 places
173
+ * (NavLink root, Menu item), `stackXs`..`stackXl` are the 4px vertical rhythm (rebuilt from ONE
174
+ * scaled unit at non-zero levels — see {@link deriveSpacing}'s doc for why), and `inputHeight`/
175
+ * `controlHeight` are a `size: 'md'` Mantine Input's/Button's/ActionIcon's resolved height
176
+ * (Mantine's own default: `2.625rem` = 42px at the 16px root) — re-pointed onto `--vx-space-input-
177
+ * height`/`--vx-space-control-height` by `theme/index.ts`'s `Input.extend`/`Button.extend`/
178
+ * `ActionIcon.extend` `vars` (see `Input.extend`'s doc comment for why `--input-height`/`--button-
179
+ * height`/`--ai-size`, not `size`, is the override point). `tokens/index.ts`'s `frameworkDerived`
180
+ * emits each of these as a `--vx-space-*` CSS var from these SAME numbers, and `theme/index.ts`
181
+ * re-points its NavLink/Menu/Input/Button/ActionIcon geometry onto that var, so the var and every
182
+ * JS default read one source instead of two that can drift apart. This is the BASE (level-0) table
183
+ * {@link deriveSpacing} scales from.
184
+ */
185
+ declare const SPACE_ANCHORS_BASE: {
186
+ /** Horizontal inset of a nav/menu row (NavLink root, Menu item). */
187
+ readonly rowInsetX: 10;
188
+ /** Vertical inset of a nav/menu row (NavLink root, Menu item). */
189
+ readonly rowInsetY: 6;
190
+ /** The 4px vertical rhythm's tightest step. Rebuilt from a single scaled unit at non-zero levels
191
+ * (see {@link deriveSpacing}'s doc) — this literal is the level-0 reference only. */
192
+ readonly stackXs: 4;
193
+ /** The 4px vertical rhythm, 2nd step — always `2 * stackXs` (see {@link deriveSpacing}'s doc). */
194
+ readonly stackSm: 8;
195
+ /** The 4px vertical rhythm, 3rd step — always `3 * stackXs`. (It USED to coincide with
196
+ * `SPACE_SCALE.sm` at level 0; the component-roominess retune moved the scale off the rhythm, which
197
+ * is exactly the independence that constant's doc describes.) */
198
+ readonly stackMd: 12;
199
+ /** The 4px vertical rhythm, 4th step — always `4 * stackXs`. */
200
+ readonly stackLg: 16;
201
+ /** The 4px vertical rhythm's widest step — always `6 * stackXs`. */
202
+ readonly stackXl: 24;
203
+ /** A `size: 'md'` Mantine Input's resolved height (see the group doc above). */
204
+ readonly inputHeight: 42;
205
+ /** A `size: 'md'` Mantine Button's/ActionIcon's resolved height — the SAME number as `inputHeight`
206
+ * (both read {@link CONTROL_HEIGHT_BASE}), so a Button/ActionIcon placed beside a `size="md"`
207
+ * Input tracks it at every density level instead of only coinciding at level 0 (the defect this
208
+ * anchor fixes — Mantine's own `--button-height-md`/`--ai-size` are static, density-blind). */
209
+ readonly controlHeight: 42;
210
+ };
211
+ /**
212
+ * The Mantine `spacing` size-scale (`xs`/`sm`/`md`/`lg`/`xl`) — the app-wide generic rhythm every
213
+ * `p=`/`m=`/`gap=` prop in every consumer resolves through. Density-tracking, like
214
+ * `SPACE_ANCHORS_BASE` above, but deliberately a SEPARATE group — and, since the
215
+ * component-roominess retune, no longer even numerically coincident with one. (`xs`/`sm`/`md`/`xl`
216
+ * used to equal `rowInsetX`/`stackMd`/`stackLg`/`stackXl`; that was a past density pass landing
217
+ * there, never a law, and this group moving alone is the proof.) An anchor is a SPECIFIC
218
+ * component's inset (NavLink/Menu row padding); a scale stop is the GENERIC scale every layout call
219
+ * site reads. Coupling them would mean retuning a nav row's inset silently reshapes every `p="xs"`
220
+ * app-wide, and {@link deriveSpacing} could never move the two at different rates if they were
221
+ * merged — the same reason `RADIUS_STEP.scaleXs`/`scaleLg`/`scaleXl` stay independent of `RADIUS`
222
+ * even though `radius.md` happens to also equal `RADIUS.ctrl` (that one IS a documented law: the
223
+ * control tier IS the `md` stop, hence `defaultRadius: 'md'` — no such relation exists here). Base
224
+ * table for {@link deriveSpacing}.
225
+ */
226
+ declare const SPACE_SCALE_BASE: {
227
+ readonly xs: 11;
228
+ readonly sm: 13;
229
+ readonly md: 18;
230
+ readonly lg: 20;
231
+ readonly xl: 26;
232
+ };
233
+ /**
234
+ * Density-tracking, genuine one-offs — named insets that fit neither the anchor vertical rhythm/
235
+ * row inset nor the generic scale rhythm above. Unlike `RADIUS_STEP`'s independent scale stops,
236
+ * these DO track density; they are simply each their own single-use anchor, not part of either
237
+ * group above. Base table for {@link deriveSpacing} — level 0 is UNCHANGED from the shipped
238
+ * identity (locked by `theme/spacing.test.ts`).
239
+ *
240
+ * Extended by the CSS-module spacing sweep (`docs/STATUS.md`) — every hardcoded spacing literal in
241
+ * `src/**\/*.module.css` now resolves through one of these named one-offs (or a `SPACE`/`SPACE_SCALE`
242
+ * anchor above, reused where a site is genuinely that concept — e.g. `SPACE.rowInsetX` reused for
243
+ * the sidebar frame/search/section-band/footer-row horizontal inset, `SPACE.stackXs/Sm/Md/Xl` reused
244
+ * for Prose/Callout/ArticleCard vertical-rhythm margins that land exactly on the 4px grid). Two or
245
+ * more sites sharing one entry below means they must render at the SAME value for a structural
246
+ * reason (documented per group); a value that merely coincides with another site's number gets its
247
+ * own entry instead — see `docs/STATUS.md`'s spacing-sweep note for the specific coincidental calls.
248
+ *
249
+ * Extended again by the density pass (this commit) with the STRUCTURAL chart constants
250
+ * `tokens/index.ts`'s `VX` object used to hardcode directly (`legendGap`/`margin`/`dotR` — see the
251
+ * "charts" group below) plus `progressBarSize` (the Progress bar's numeric `defaultProps.size`,
252
+ * previously an untokenized literal `6`) — both are numeric Mantine `defaultProps`/SVG-prop sites
253
+ * with the SAME "dev slider can't reach it" limitation as `timelineBullet` (see `deriveSpacing`'s
254
+ * doc and the `theme-lab` "known constraint" note).
255
+ */
256
+ declare const SPACE_STEP_BASE: {
257
+ /** Timeline `defaultProps.bulletSize`. */
258
+ readonly timelineBullet: 22;
259
+ /** NavLink leftSection icon-to-label gap — shared by `theme/nav-link.module.css` (every render
260
+ * path) and `shell/app-sidebar.module.css`'s own `.link` rule (belt-and-suspenders on the same
261
+ * DOM), and reused verbatim for `.footerBtn`/`.accountRow`'s icon gap (their own doc comments call
262
+ * out "IDENTICAL geometry to a nav row"). */
263
+ readonly navIconGap: 10;
264
+ /** Sidebar region-to-region gap: `.brand`'s bottom padding and `.searchSlot`'s bottom padding (in
265
+ * both the expanded and collapsed rail variants) — the searchSlot comment explicitly says its gap
266
+ * opens the nav region "the same way the brand row's own bottom padding does". */
267
+ readonly sidebarRegionGap: 10;
268
+ /** Blockquote rail's own vertical inset. */
269
+ readonly proseQuoteInsetY: 2;
270
+ /** Blockquote text indent past the rail. */
271
+ readonly proseQuoteIndent: 12;
272
+ /** Inline code chip vertical inset. */
273
+ readonly proseInlineCodeInsetY: 1.5;
274
+ /** Inline code chip horizontal inset. */
275
+ readonly proseInlineCodeInsetX: 5;
276
+ /** Raw `<pre>` fallback block vertical inset. */
277
+ readonly proseCodeBlockInsetY: 10;
278
+ /** Raw `<pre>` fallback block horizontal inset. */
279
+ readonly proseCodeBlockInsetX: 12;
280
+ /** Heading copy-link anchor's gap from the heading text. */
281
+ readonly proseHeadingAnchorGap: 6;
282
+ /** Table cell vertical inset. */
283
+ readonly proseTableCellInsetY: 5;
284
+ /** Table cell horizontal inset. */
285
+ readonly proseTableCellInsetX: 8;
286
+ /** Chat-density list's bottom margin (top margin reuses `SPACE.stackXs`). */
287
+ readonly proseChatListGapBottom: 10;
288
+ /** Chat-density list indent. */
289
+ readonly proseChatListIndent: 20;
290
+ /** Chat-density list-item vertical margin. */
291
+ readonly proseChatListItemGap: 3;
292
+ /** Chat-density nested-list vertical margin. */
293
+ readonly proseChatNestedListGap: 2;
294
+ /** Chat-density heading top margin. */
295
+ readonly proseChatHeadingGapTop: 14;
296
+ /** Chat-density heading bottom margin. */
297
+ readonly proseChatHeadingGapBottom: 6;
298
+ /** Article-density paragraph bottom margin. */
299
+ readonly proseArticleParagraphGap: 14;
300
+ /** Article-density list top margin. */
301
+ readonly proseArticleListGapTop: 6;
302
+ /** Article-density list bottom margin. */
303
+ readonly proseArticleListGapBottom: 14;
304
+ /** Article-density list indent. */
305
+ readonly proseArticleListIndent: 22;
306
+ /** Article-density `h1` top margin. */
307
+ readonly proseArticleH1GapTop: 6;
308
+ /** Article-density `h1` bottom margin. */
309
+ readonly proseArticleH1GapBottom: 14;
310
+ /** Article-density `h2`/`h3`/`h4`-`h6` shared top margin — one heading-rhythm law repeated
311
+ * verbatim across all three selectors, not a coincidence. */
312
+ readonly proseArticleHeadingGapTop: 30;
313
+ /** Article-density `h2`/`h3`/`h4`-`h6` shared bottom margin (see `proseArticleHeadingGapTop`). */
314
+ readonly proseArticleHeadingGapBottom: 10;
315
+ /** Article-density `h2`'s bottom-rule padding. */
316
+ readonly proseArticleH2RuleGap: 6;
317
+ /** Article-density block-object (blockquote/pre/table/embedded div) margin. */
318
+ readonly proseArticleBlockGap: 18;
319
+ /** Content-column-to-TOC-rail column gap. The governing `@media (max-width: 1200px)` breakpoint
320
+ * (`article-layout.module.css`) is deliberately NOT density-coupled — it is a viewport-comfort
321
+ * threshold for showing the TOC rail at all, not a sum of the column tracks: the grid's first
322
+ * column is `minmax(0, var(--vx-prose-measure))`, a FLEXIBLE track that shrinks to fit rather
323
+ * than a fixed width the breakpoint would need to sum. A gap and a responsive breakpoint are
324
+ * different concepts — forcing them to move together would be the coincidence-not-law trap in
325
+ * reverse (see `articleTocRailWidth` below for the track this gap sits beside, which — unlike
326
+ * the breakpoint — IS a genuine density-tracking dimension). */
327
+ readonly articleColumnGap: 56;
328
+ /** TOC rail's own grid-column track width (`.root`'s `grid-template-columns` second track). The
329
+ * rail's contents (`content/toc.module.css`'s link rows) already track density via
330
+ * `tocLinkInsetY`/`tocLinkIndent`/`tocSubIndent`, so a fixed-width raw literal here would squeeze
331
+ * those rows' available space as density rises instead of growing with them — the inverse of the
332
+ * AppShell navbar/rail-width tokenization, same rationale. */
333
+ readonly articleTocRailWidth: 220;
334
+ /** Meta header's own vertical stack gap (title/description/metaRow). */
335
+ readonly articleHeaderGap: 10;
336
+ /** Meta header's bottom padding (above its divider). */
337
+ readonly articleHeaderPaddingBottom: 20;
338
+ /** Meta header's bottom margin (below its divider). */
339
+ readonly articleHeaderMarginBottom: 28;
340
+ /** Meta-row icon-to-text gap. */
341
+ readonly articleMetaRowGap: 6;
342
+ /** Prev/next footer's column gap. */
343
+ readonly articleFooterGap: 12;
344
+ /** Prev/next footer's top margin (above its divider). */
345
+ readonly articleFooterMarginTop: 40;
346
+ /** Prev/next footer's top padding (below its divider). */
347
+ readonly articleFooterPaddingTop: 20;
348
+ /** Prev/next nav-target icon-to-text gap. */
349
+ readonly articleNavTargetGap: 6;
350
+ /** Header's title-to-controls gap. */
351
+ readonly codeBlockHeaderGap: 8;
352
+ /** Header's vertical inset. */
353
+ readonly codeBlockHeaderInsetY: 6;
354
+ /** Header's right inset (before the header-right control cluster). */
355
+ readonly codeBlockHeaderInsetRight: 10;
356
+ /** Content-column left edge — shared by the header's left inset and the body's horizontal inset,
357
+ * so the header title and the code text line up on the same left edge. */
358
+ readonly codeBlockContentInsetX: 14;
359
+ /** Header-right control cluster's own gap. */
360
+ readonly codeBlockHeaderRightGap: 6;
361
+ /** Body's vertical inset. */
362
+ readonly codeBlockBodyInsetY: 10;
363
+ /** Floating copy button's corner offset — one value reused for both `top` and `right`. */
364
+ readonly codeBlockFloatingCopyOffset: 6;
365
+ /** Panel vertical inset. */
366
+ readonly calloutInsetY: 10;
367
+ /** Panel horizontal inset. */
368
+ readonly calloutInsetX: 14;
369
+ /** Title row's icon-to-text gap. */
370
+ readonly calloutTitleRowGap: 8;
371
+ /** Rail's own vertical stack gap (header-to-list). */
372
+ readonly tocRootGap: 6;
373
+ /** Link row's vertical inset. */
374
+ readonly tocLinkInsetY: 4;
375
+ /** Link row's text indent past the rail guide. */
376
+ readonly tocLinkIndent: 12;
377
+ /** Nested (sub-heading) link's extra indent. */
378
+ readonly tocSubIndent: 24;
379
+ /** Tag row's own gap. */
380
+ readonly articleCardTagsGap: 4;
381
+ /** Tag chip's vertical inset. */
382
+ readonly articleCardTagInsetY: 1;
383
+ /** Tag chip's horizontal inset. */
384
+ readonly articleCardTagInsetX: 6;
385
+ /** Meta line's top gap. */
386
+ readonly articleCardMetaGapTop: 2;
387
+ /** Drawer body's bottom gap (before the footer). */
388
+ readonly guideBodyGapBottom: 8;
389
+ /** Footer's top margin (above its divider). */
390
+ readonly guideFooterGapTop: 20;
391
+ /** Footer's top inset (below its divider). */
392
+ readonly guideFooterInsetTop: 16;
393
+ /** Trigger's icon-to-label gap. */
394
+ readonly sidebarSearchGap: 7;
395
+ /** Trigger's height — floored at 24px in {@link deriveSpacing} (WCAG 2.5.8 minimum target size);
396
+ * the collapsed rail's `ActionIcon` variant reads the SAME resolved value (`shell/sidebar-
397
+ * search.module.css`'s `.railBtn`), so both states of the control stay consistent at every level. */
398
+ readonly sidebarSearchTriggerHeight: 32;
399
+ /** Row's vertical inset. */
400
+ readonly settingsRowInsetY: 10;
401
+ /** Row's own gap (label cluster to control). */
402
+ readonly settingsRowGap: 16;
403
+ /** Diagram container's inset (all sides). */
404
+ readonly mermaidContainerInset: 16;
405
+ /** Brand row's top inset. */
406
+ readonly sidebarBrandInsetTop: 2;
407
+ /** Brand row's horizontal inset. */
408
+ readonly sidebarBrandInsetX: 7;
409
+ /** Gap between nav sections. */
410
+ readonly sidebarSectionGap: 12;
411
+ /** Account row's top inset. */
412
+ readonly sidebarAccountInsetTop: 9;
413
+ /** Account row's horizontal inset. */
414
+ readonly sidebarAccountInsetX: 7;
415
+ /** Account row's bottom inset. */
416
+ readonly sidebarAccountInsetBottom: 2;
417
+ /** Identity-initials avatar block's fixed size (width and height). */
418
+ readonly sidebarAvatarSize: 28;
419
+ /** Section-label row's bottom gap (before the first nav row). */
420
+ readonly sidebarSectionLabelGap: 2;
421
+ /** Collapsible child-list wrapper's top margin. */
422
+ readonly sidebarChildListGapTop: 2;
423
+ /** Collapsible child-list wrapper's bottom margin. */
424
+ readonly sidebarChildListGapBottom: 3;
425
+ /** Collapsible child-list wrapper's left indent. */
426
+ readonly sidebarChildListIndent: 15;
427
+ /** Child NavLink row's vertical inset. */
428
+ readonly sidebarChildRowInsetY: 4;
429
+ /** Child NavLink row's extra left indent (past the rail guide). */
430
+ readonly sidebarChildRowIndent: 12;
431
+ /** Account-menu `<Menu width={…}>` (`app-sidebar-account.tsx`). */
432
+ readonly sidebarAccountMenuWidth: 220;
433
+ /** Settings-menu `<Menu width={…}>` (`app-sidebar.tsx`). */
434
+ readonly sidebarSettingsMenuWidth: 200;
435
+ /** Mobile two-row header's page-actions row height. */
436
+ readonly appHeaderMobileActionsHeight: 52;
437
+ /** AppShell desktop header bar height — sized to hold one row of `size="md"` controls, so it
438
+ * tracks `controlHeight`. Its level-0 coincidence with `appShellNavbarRailWidth` below is a
439
+ * coincidence, not a law: this is a horizontal bar's HEIGHT (governed by control height), that
440
+ * is a vertical rail's WIDTH (governed by icon footprint). They stay separate entries. */
441
+ readonly appShellHeaderHeight: 48;
442
+ /** AppShell mobile (two-row) header height. Not one concept but a sum: row 1 + `app-header.
443
+ * module.css`'s wrap row-gap (`--mantine-spacing-sm`) + `appHeaderMobileActionsHeight`. Two of
444
+ * those three addends already track density, so the container must too — held fixed, row 1's
445
+ * budget collapses 52px -> 12px across the level range.
446
+ *
447
+ * KEEP THIS EQUAL TO THE SUM. At level 0: 32 (row 1) + 13 (`SPACE_SCALE.sm`) + 52
448
+ * (`appHeaderMobileActionsHeight`) = 97. It was 96 while `SPACE_SCALE.sm` was 12; the
449
+ * component-roominess retune raised that addend, and leaving the total at 96 silently took the
450
+ * pixel out of row 1 instead — which is what ate the last of its WCAG 2.5.8 target-size margin at
451
+ * density -3 (`theme/density-relations.test.ts` measures row 1 as the REMAINDER of this sum, so
452
+ * the total is the only place the budget can come from). Raise this whenever `SPACE_SCALE.sm` or
453
+ * `appHeaderMobileActionsHeight` moves. Better still, make it unnecessary: computing this the way
454
+ * `stickyHeaderClearance*` already is — post-`step`, from its own addends rather than as an
455
+ * independent literal — would make the drift impossible instead of merely re-tuned. That is the
456
+ * same refactor, and the same reasoning, this PR applied to the clearances; it is worth doing to
457
+ * this one too, and it stays a follow-up only because it moves every non-zero level's value. */
458
+ readonly appShellHeaderMobileHeight: 97;
459
+ /** AppShell navbar width, expanded — ONE entry for both the `base` (mobile drawer) and the
460
+ * expanded `sm` value: the same `.root` at full width, genuinely one concept. */
461
+ readonly appShellNavbarWidth: 216;
462
+ /** AppShell navbar width, collapsed icon rail. Separate from `appShellHeaderHeight` above
463
+ * despite sharing 48 at level 0 (see that entry's note). */
464
+ readonly appShellNavbarRailWidth: 48;
465
+ /** Tab's icon-to-label gap. */
466
+ readonly mobileNavTabGap: 3;
467
+ /** `ChartLegend`'s column/row gap (`VX.legendGap`). */
468
+ readonly chartLegendGap: 22;
469
+ /** Chart plot-area margin, top (`VX.margin.top`). */
470
+ readonly chartMarginTop: 12;
471
+ /** Chart plot-area margin, right (`VX.margin.right`). */
472
+ readonly chartMarginRight: 16;
473
+ /** Chart plot-area margin, bottom (`VX.margin.bottom`). */
474
+ readonly chartMarginBottom: 30;
475
+ /** Chart plot-area margin, left (`VX.margin.left`). */
476
+ readonly chartMarginLeft: 44;
477
+ /** Data-point marker radius (`VX.dotR`) — a discrete visual footprint, not a stroke weight, so
478
+ * (unlike `lineWidth`/`line2Width`) it tracks density: a judgment call, made this way because it
479
+ * reads as a "size" (closer to `sidebarAvatarSize` above) rather than a line thickness. */
480
+ readonly chartDotR: 5;
481
+ /** Progress bar thickness (`components.Progress.defaultProps.size`) — a numeric Mantine size prop,
482
+ * same "dev slider can't reach it, production `{ density }` rebuilds it" limitation as
483
+ * `timelineBullet` above (see `deriveSpacing`'s doc). */
484
+ readonly progressBarSize: 6;
485
+ /** `agent/part-list.tsx` + `agent-chat/thread-message.tsx` reasoning/tool-call rail's left inset. */
486
+ readonly agentRailInsetX: 10;
487
+ /** `agent/part-list.tsx`'s `DefaultReasoning` body / both rail code blocks' top gap. */
488
+ readonly agentPartGapTop: 6;
489
+ /** Both rail code blocks' own inset (all sides). */
490
+ readonly agentCodeInset: 8;
491
+ /** `agent/part-list.tsx`'s `DefaultError` vertical inset. */
492
+ readonly agentErrorInsetY: 8;
493
+ /** `agent/part-list.tsx`'s `DefaultError` horizontal inset. */
494
+ readonly agentErrorInsetX: 10;
495
+ /** `agent/stick-to-bottom.tsx`'s scroll-to-bottom button top gap. */
496
+ readonly agentScrollButtonGapTop: 8;
497
+ /** `agent-chat/thread-message.tsx`'s message bubble vertical inset. */
498
+ readonly agentMessageInsetY: 10;
499
+ /** `agent-chat/thread-message.tsx`'s message bubble horizontal inset. */
500
+ readonly agentMessageInsetX: 12;
501
+ /** `agent-chat/thread-detail-panel.tsx`'s transcript scroll container's own inset (all sides). */
502
+ readonly agentTranscriptInset: 16;
503
+ /** `agent-chat/thread-outcome-card.tsx` + `dashboard/delta-badge.tsx`'s status badge vertical inset. */
504
+ readonly badgeInsetY: 2;
505
+ /** `agent-chat/thread-outcome-card.tsx` + `dashboard/delta-badge.tsx`'s status badge horizontal inset. */
506
+ readonly badgeInsetX: 7;
507
+ /** `dashboard/stat-card.tsx`'s header/value/sparkline stack gap. */
508
+ readonly statCardGap: 8;
509
+ /** `data/virtual-list.tsx`'s skeleton row vertical inset. */
510
+ readonly virtualRowInsetY: 8;
511
+ /** `data/virtual-list.tsx`'s skeleton row horizontal inset. */
512
+ readonly virtualRowInsetX: 12;
513
+ };
514
+ /**
515
+ * Density-EXEMPT structurals — unlike `SPACE`/`SPACE_STEP` above, these never move with the density
516
+ * knob. `tokens/index.ts` does NOT emit these as `--vx-*` CSS vars (see the comment there for why: a
517
+ * var would only invite someone to think they move).
518
+ */
519
+ export declare const SPACE_FIXED: {
520
+ /** Timeline `defaultProps.lineWidth`; also used for 1px borders. */
521
+ readonly hairline: 1;
522
+ /** ReadingProgress's fixed top-bar height — a hairline-like indicator line (docs/CONTENT-SPEC.md
523
+ * §7), not a spacing gap that should thicken with density. Stays a literal at its one call site
524
+ * (`content/reading-progress.module.css`), same as `hairline`. */
525
+ readonly readingProgressHeight: 2;
526
+ /** SegmentedControl track's optical inset (`styles.root` padding) — moved OUT of `SPACE_STEP` and
527
+ * exempted from the density knob because it is load-bearing for the nested-corner law
528
+ * (docs/DESIGN-SPEC.md §4): `RADIUS.card === RADIUS_STEP.tight + segmentedTrackInset` (`7 = 5 +
529
+ * 2`). `RADIUS.card`/`RADIUS_STEP.tight` both shift together under the RADIUS knob (`card = 7 +
530
+ * level`, `tight = ctrl - 1 = 5 + level`), so their difference is ALWAYS exactly 2 regardless of
531
+ * that knob — a density-tracking inset would break concentricity in both directions (verified: this
532
+ * inset's own value, HAD it stayed density-tracking, resolves via `scaleSpace(2, level, multiplier)`
533
+ * to 1 at density's floor level -3 and 3 at its ceiling level +3 — the widest swing `deriveSpacing`'s
534
+ * `[-3, 3]` range can produce) for no compensating benefit, since the two radii it sits between
535
+ * never move independently of each other. */
536
+ readonly segmentedTrackInset: 2;
537
+ };
538
+ /**
539
+ * The resolved shape {@link deriveSpacing} returns — the two anchor/scale base groups above (as
540
+ * `anchors`/`scale`) PLUS every `SPACE_STEP_BASE` one-off (as `step`) and the NavLink row
541
+ * line-height (as `rowLineHeight`), all scaled together from one integer `level`. Kept as separate
542
+ * groups rather than flattened into one object for the same reason `SPACE_SCALE_BASE`'s doc gives:
543
+ * the law must be free to move an anchor and a scale stop at different rates. The spacing analog of
544
+ * {@link RadiusValues}.
545
+ */
546
+ export type SpaceValues = {
547
+ anchors: {
548
+ [K in keyof typeof SPACE_ANCHORS_BASE]: number;
549
+ };
550
+ scale: {
551
+ [K in keyof typeof SPACE_SCALE_BASE]: number;
552
+ };
553
+ /** `SPACE_STEP_BASE`'s one-offs PLUS `stickyHeaderClearance`/`stickyHeaderClearanceMobile`, NEITHER
554
+ * of which is in that base table — both are computed after the rest of `step`, one from
555
+ * `appShellHeaderHeight` (desktop) and one from `appShellHeaderMobileHeight` (mobile), see
556
+ * {@link deriveSpacing}'s doc. Kept on this same `step` object (not split into a third group)
557
+ * because every consumer reads them exactly like any other one-off — only their DERIVATION
558
+ * differs. Two keys, not one, because the clearance is RESPONSIVE (Decision 3): a consumer picks
559
+ * whichever one matches the breakpoint it's rendering at — see `docs/CONTENT-SPEC.md` §5 and
560
+ * `content/prose.module.css`/`content/article-layout.module.css` for the CSS-side split. */
561
+ step: {
562
+ [K in keyof typeof SPACE_STEP_BASE]: number;
563
+ } & {
564
+ stickyHeaderClearance: number;
565
+ stickyHeaderClearanceMobile: number;
566
+ };
567
+ /** NavLink row line-height (`theme/index.ts`'s row-geometry styles) — additive, not
568
+ * multiplicative; see {@link deriveSpacing}'s doc for why. */
569
+ rowLineHeight: number;
570
+ };
571
+ /**
572
+ * Scale one density-tracking spacing number by `multiplier`, rounding to the nearest integer and
573
+ * clamping at an UNCONDITIONAL floor of 1 (an aggressive negative level can never collapse a real
574
+ * inset to 0 or below).
575
+ *
576
+ * At `level === 0` the multiplier is exactly 1 — return `value` verbatim instead of routing it
577
+ * through `Math.round`, so a non-integer base (`proseInlineCodeInsetY: 1.5`) stays byte-identical
578
+ * rather than rounding to `2` (`Math.round(1.5 * 1)` rounds half-up) — the level-0 acceptance gate
579
+ * (`theme/spacing.test.ts`) requires the EXACT shipped number, not merely an equal one.
580
+ *
581
+ * The floor is UNREACHABLE through {@link deriveSpacing}'s public `[-3, 3]` level range TODAY: every
582
+ * `SPACE_ANCHORS_BASE`/`SPACE_SCALE_BASE`/`SPACE_STEP_BASE` value is an integer `>= 1`, the
583
+ * shallowest multiplier `deriveSpacing` ever passes is `0.7` (level `-3`), and `round(v * 0.7)` is
584
+ * already `>= 1` for every `v >= 1` (`round(1 * 0.7)` is `1`, the smallest case) — so the clamp
585
+ * never changes the result on that path YET. It is applied unconditionally (not gated behind
586
+ * `value >= 1`) precisely so a FUTURE base `< 1` doesn't silently round to 0: a gated floor only
587
+ * protects inputs that could never reach 0 in the first place and skips the one case that could
588
+ * (`round(0.5 * 0.7) = round(0.35) = 0` for a hypothetical `0.5` base at level `-3`, unguarded by a
589
+ * `value >= 1` gate). Exported (not re-exported by the `./tokens` barrel — this stays outside the
590
+ * published surface, `scripts/export-surface.json`) purely so `palette.test.ts` can drive the clamp
591
+ * directly with a `multiplier`/`value` pair `deriveSpacing` itself can never produce, and prove the
592
+ * floor still holds if a base or the level range ever changes.
593
+ */
594
+ export declare function scaleSpace(value: number, level: number, multiplier: number): number;
595
+ /**
596
+ * Derive every density-tracking spacing number (anchors, scale stops, one-offs, row line-height)
597
+ * from a single integer `level` (`docs/DESIGN-SPEC.md` §4-adjacent) — the spacing analog of
598
+ * {@link deriveRadius}. `level: 0` reproduces the shipped identity exactly (locked by
599
+ * `theme/spacing.test.ts` and `tokens/density.test.ts`) for every value EXCEPT
600
+ * `step.stickyHeaderClearance`/`step.stickyHeaderClearanceMobile` — see the third bullet below for
601
+ * why those are a deliberate exception.
602
+ *
603
+ * The law: a MULTIPLIER, `1 + 0.1 * level`, applied to every `SPACE_ANCHORS_BASE`/
604
+ * `SPACE_SCALE_BASE`/`SPACE_STEP_BASE` constant, then rounded (see {@link scaleSpace}) — a
605
+ * multiplier rather than an additive step because these values span 1px to 180px; an additive
606
+ * constant would distort small and large insets by wildly different proportions.
607
+ *
608
+ * Three groups deviate from the plain per-value multiplier above:
609
+ *
610
+ * - `stackXs`..`stackXl` (the 4px vertical rhythm) are rebuilt from ONE scaled unit —
611
+ * `unit = scaleSpace(4, level, multiplier)`, then `stackXs = unit`, `stackSm = 2 * unit`,
612
+ * `stackMd = 3 * unit`, `stackLg = 4 * unit`, `stackXl = 6 * unit` — instead of each step
613
+ * independently rounding its own base. Independent rounding breaks the rhythm at non-zero levels
614
+ * (level +1 used to land 4/8/13/17/25, no common factor) and silently drifts the documented 2:1
615
+ * pairs (`stackXl`:`stackMd`, `stackLg`:`stackSm`) by a px at almost every level; the shared-unit
616
+ * rebuild keeps every step an exact multiple of `unit` and both pairs exactly 2:1, at every level
617
+ * including 0 (`unit` is 4 there, reproducing 4/8/12/16/24 verbatim). `SPACE_SCALE_BASE`'s own
618
+ * `xs`/`sm`/`md`/`lg`/`xl` stops do NOT get this treatment — that group's `sm`:`xl` 1:2 coincidence
619
+ * is documented as incidental (a past density pass landed there), not a law like the stack rhythm's,
620
+ * so it keeps the plain per-value multiplier.
621
+ * - `step.sidebarSearchTriggerHeight` is floored at 24px after scaling — WCAG 2.5.8's minimum
622
+ * interactive-target size. Without the floor, a negative level shrinks the sidebar search trigger
623
+ * (and, transitively, the collapsed rail's `ActionIcon` variant, which reads this same resolved
624
+ * value) below the accessible floor (22px at level -3) while also crowding out its fixed-size icon
625
+ * and `Kbd` chip.
626
+ * - `step.stickyHeaderClearance` (desktop) and `step.stickyHeaderClearanceMobile` (mobile) are not
627
+ * scaled off their own base AT ALL — `SPACE_STEP_BASE` has no such key any more (see that table's
628
+ * doc). Both are computed AFTER the rest of `step`, RESPONSIVELY, one per AppShell breakpoint:
629
+ * `stickyHeaderClearance = step.appShellHeaderHeight + anchors.stackMd` (desktop, `>= sm`) and
630
+ * `stickyHeaderClearanceMobile = step.appShellHeaderMobileHeight + anchors.stackMd` (mobile,
631
+ * `< sm` — the SAME `sm`/48em breakpoint the AppShell header itself switches on, `shell/index.tsx`).
632
+ * A SINGLE clearance value (this law's own prior shape) can only be tuned against ONE header, and
633
+ * whichever one it under-shoots stays broken: the original independent literal (84) was tuned only
634
+ * against the desktop header (48) and under-cleared the mobile header (96) by 12px at level 0
635
+ * already, before density entered the picture; deriving ONE value off the taller mobile header
636
+ * fixed that under-clear but then OVER-cleared the desktop header by 60px (108 vs. the 48px header
637
+ * needs) — dead space above every anchored heading and a TOC rail shoved down on the common
638
+ * (desktop) path. Splitting into two responsive values fixes both directions at once: each clears
639
+ * ONLY its own header, with the SAME `anchors.stackMd` breathing room (not a bare `+ 0`) so a
640
+ * scrolled-to heading doesn't sit flush against the header's bottom edge — density-tracking, like
641
+ * the header height it's added to, so the margin itself never freezes at one notch. Level 0:
642
+ * desktop `48 + 12 = 60` (a deliberate BREAK from the pre-split 84/108 — see `theme/spacing.test.ts`
643
+ * for why `stickyHeaderClearance` alone is exempt from the byte-identity gate every other spacing
644
+ * token is held to), mobile `96 + 12 = 108` (unchanged from the pre-split single-value law).
645
+ * **Consumer coupling (accepted, not hidden):** both values assume `BasaltShell`'s own AppShell
646
+ * header heights — a `./content` consumer NOT rendering inside `BasaltShell` (e.g. `Prose`/
647
+ * `ArticleLayout` standalone) gets clearance numbers tuned for a header it may not have, and must
648
+ * override `--vx-space-sticky-header-clearance`/`--vx-space-sticky-header-clearance-mobile`
649
+ * itself. Documented on the `./content` surface too (`docs/CONTENT-SPEC.md` §5), not only here.
650
+ *
651
+ * `rowLineHeight` is the ONE exception to the multiplier entirely: `1.35 + ROW_LINE_HEIGHT_STEP *
652
+ * level`, ADDITIVE, its own gentler, INDEPENDENT coefficient (see {@link ROW_LINE_HEIGHT_STEP}'s own
653
+ * doc for why it must stay independent of `multiplier`). It carries the NavLink row's
654
+ * `lineHeight: '1.35'` (`theme/index.ts`, load-bearing for row height) along with the row's padding,
655
+ * but the multiplier law would overshoot it — `1.35 * 1.3` at level +3 is already a much larger
656
+ * relative move than the padding it accompanies, well past the readable line-height range. The
657
+ * additive step instead lands `1.25`..`1.45` across the full range, a proportionate nudge. Rounded
658
+ * to 2 decimals (`Math.round(x * 100) / 100`) to avoid floating-point noise (`1.35 +
659
+ * ROW_LINE_HEIGHT_STEP * 3` is not exactly `1.45` in raw IEEE-754 arithmetic).
660
+ *
661
+ * `SPACE_FIXED` is NEVER part of this law — see that constant's own doc for why.
662
+ *
663
+ * **What actually tracks a retuned `level`, end to end, and what doesn't** (the real scope of the
664
+ * "dev slider gap" — bigger than "a few numeric `defaultProps`", but ALSO narrower than it looks at
665
+ * first glance — see the Input/Button/ActionIcon note below):
666
+ * - `createBasaltTheme({ density })` (`../theme`) rebuilds `theme.spacing` (the generic Mantine
667
+ * scale) AND every density-anchored `defaultProps`/`styles` number (Timeline's `bulletSize`,
668
+ * Progress's `size`) from THIS function's output — this is the one production entry point, and it
669
+ * is complete for all of those.
670
+ * - `theme-lab/DeriveControls` (the DEV-tool slider) can only move `--vx-*` CSS custom properties
671
+ * via an injected `<style>` — it CANNOT reach a numeric `defaultProps`/SVG-prop value baked into
672
+ * the theme object at all, so Timeline's `bulletSize` and Progress's `size` stay visibly static
673
+ * there. The SAME limitation applies to `theme.spacing` itself (the generic Mantine `xs`/`sm`/
674
+ * `md`/`lg`/`xl` scale): `createBasaltTheme({ density })` bakes it into the theme object as
675
+ * rem strings (`theme/index.ts`'s `buildTheme`), and `spaceDecls` (`tokens/index.ts`) deliberately
676
+ * emits no `--vx-space-scale-*`/`--mantine-spacing-*` var for it (see that function's own doc) —
677
+ * so the dev slider's injected `<style>` cannot reach it either, and a component reading
678
+ * `var(--mantine-spacing-sm)` (e.g. `shell/app-header.module.css`) stays at its level-0 value
679
+ * under the dev slider even though it correctly retunes on the production path. Input's/Button's/
680
+ * ActionIcon's `size="md"` height is NOT in this bucket, despite reading
681
+ * like the same shape of gap: `theme/index.ts`'s `Input.extend`/`Button.extend`/`ActionIcon.extend`
682
+ * resolve their height through `vars` (`--input-height`/`--button-height`/`--ai-size`, each wrapping
683
+ * `var(--vx-space-input-height)`/`var(--vx-space-control-height)` in a `calc(...)`), not a numeric
684
+ * `defaultProps` literal — a CSS custom property the dev slider's injected `<style>` CAN reach, so
685
+ * it DOES visibly follow the Density slider there too, not only in production.
686
+ * - `tokens/index.ts`'s `VX.legendGap`/`VX.margin`/`VX.dotR` (chart legend gap, plot-area margins,
687
+ * marker radius) are the ONE case that fails BOTH paths — including the PRODUCTION one. `VX` is
688
+ * built once at module load from the frozen level-0 `SPACE_STEP` snapshot (visx SVG props read
689
+ * plain JS numbers, not `var()` strings), so it never re-reads a `density` option passed to
690
+ * `createBasaltTheme` at all — a genuine, currently-unfixed production gap, not merely a
691
+ * dev-tool-only limitation like the `defaultProps` above.
692
+ *
693
+ * Throws on a non-integer or out-of-range (`[-3, 3]`) level — same throw-and-propagate discipline as
694
+ * `deriveRadius`/`deriveTokens`'s accent-seed validation.
695
+ *
696
+ * The range is `[-3, 3]`, not `[-5, 5]` like `deriveRadius` — a DELIBERATE, narrower range with a
697
+ * steeper per-notch coefficient (`0.1`, not `0.06`) chosen so the two endpoints reproduce the exact
698
+ * SAME multiplier envelope (`0.7`..`1.3`, `3 * 0.1 === 5 * 0.06`) at fewer, more meaningful notches.
699
+ * At `0.06`/±5, an integer base `v <= 8` (41 of the 108 spacing values, including the entire 4px
700
+ * stack rhythm) is BYTE-IDENTICAL to level 0 at one notch of movement (`0.06 * v < 0.5` rounds back
701
+ * to `v`) — not a dead zone at one notch, but uniform over-quantization across the whole range: the
702
+ * knob advertised more resolution than integer-px rounding could carry. `0.1`/±3 keeps the identical
703
+ * expressive envelope (nothing about how compact/spacious the knob can go changes) while dropping
704
+ * the frozen-at-one-notch count from 43 (at ±1) to 18/22 — see `Fix 7` in
705
+ * `theme/density-relations.test.ts` for the regression guards that pin this down.
706
+ */
707
+ /** `deriveSpacing`'s accepted level range — exported (not through the `./tokens` barrel, same
708
+ * precedent as {@link scaleSpace}) so `density-relations.test.ts`'s `ALL_LEVELS` can derive the
709
+ * levels it loops over from the SAME bound `deriveSpacing` enforces, instead of a hardcoded literal
710
+ * that silently stops covering the real range if the range ever changes again (as it already has
711
+ * once, `[-5, 5]` -> `[-3, 3]` — see this function's own doc above). */
712
+ export declare const DENSITY_LEVEL_RANGE: {
713
+ readonly min: -3;
714
+ readonly max: 3;
715
+ };
716
+ export declare function deriveSpacing(level: number): SpaceValues;
717
+ /** `deriveSpacing(0)` — the shipped identity's spacing values, computed once. `SPACE`/`SPACE_SCALE`/
718
+ * `SPACE_STEP`/`ROW_LINE_HEIGHT` below are defined FROM this, the same way `RADIUS`/`RADIUS_STEP`
719
+ * are defined from `DEFAULT_RADIUS_VALUES = deriveRadius(0)` — one source, so the two can never
720
+ * drift. Exported so `theme/use-basalt-spacing.ts`'s `useBasaltSpacing` can fall back to it when
721
+ * `theme.other.basaltDensity` is absent (the level-0 case — `createBasaltTheme` deliberately omits
722
+ * that key at level 0, see `theme/index.ts`'s `isDefaultDensity` short-circuit). */
723
+ export declare const DEFAULT_SPACE_VALUES: SpaceValues;
724
+ /** Density-tracking semantic spacing anchors at the shipped identity — see `SPACE_ANCHORS_BASE`'s
725
+ * doc for what each key means. `deriveSpacing(0)`'s `anchors`, UNCHANGED from the pre-density-knob
726
+ * shipped identity (locked by `theme/spacing.test.ts`). */
727
+ export declare const SPACE: {
728
+ readonly rowInsetX: number;
729
+ readonly rowInsetY: number;
730
+ readonly stackXs: number;
731
+ readonly stackSm: number;
732
+ readonly stackMd: number;
733
+ readonly stackLg: number;
734
+ readonly stackXl: number;
735
+ readonly inputHeight: number;
736
+ readonly controlHeight: number;
737
+ };
738
+ /** The Mantine `spacing` size-scale at the shipped identity — see `SPACE_SCALE_BASE`'s doc.
739
+ * `deriveSpacing(0)`'s `scale`, UNCHANGED from the shipped identity (locked by
740
+ * `theme/spacing.test.ts`). */
741
+ export declare const SPACE_SCALE: {
742
+ readonly xs: number;
743
+ readonly sm: number;
744
+ readonly md: number;
745
+ readonly lg: number;
746
+ readonly xl: number;
747
+ };
748
+ /** Density-tracking one-offs at the shipped identity — see `SPACE_STEP_BASE`'s doc. `deriveSpacing(0)`'s
749
+ * `step`, UNCHANGED from the shipped identity (locked by `theme/spacing.test.ts`) EXCEPT
750
+ * `stickyHeaderClearance` (originally 84, then a single derived 108, now the desktop half of the
751
+ * Decision-3 responsive split at 60) and its new `stickyHeaderClearanceMobile` sibling (108) — the
752
+ * deliberate level-0 breaks in the density work; see `deriveSpacing`'s doc (third bullet) for why. */
753
+ export declare const SPACE_STEP: {
754
+ readonly timelineBullet: number;
755
+ readonly navIconGap: number;
756
+ readonly sidebarRegionGap: number;
757
+ readonly proseQuoteInsetY: number;
758
+ readonly proseQuoteIndent: number;
759
+ readonly proseInlineCodeInsetY: number;
760
+ readonly proseInlineCodeInsetX: number;
761
+ readonly proseCodeBlockInsetY: number;
762
+ readonly proseCodeBlockInsetX: number;
763
+ readonly proseHeadingAnchorGap: number;
764
+ readonly proseTableCellInsetY: number;
765
+ readonly proseTableCellInsetX: number;
766
+ readonly proseChatListGapBottom: number;
767
+ readonly proseChatListIndent: number;
768
+ readonly proseChatListItemGap: number;
769
+ readonly proseChatNestedListGap: number;
770
+ readonly proseChatHeadingGapTop: number;
771
+ readonly proseChatHeadingGapBottom: number;
772
+ readonly proseArticleParagraphGap: number;
773
+ readonly proseArticleListGapTop: number;
774
+ readonly proseArticleListGapBottom: number;
775
+ readonly proseArticleListIndent: number;
776
+ readonly proseArticleH1GapTop: number;
777
+ readonly proseArticleH1GapBottom: number;
778
+ readonly proseArticleHeadingGapTop: number;
779
+ readonly proseArticleHeadingGapBottom: number;
780
+ readonly proseArticleH2RuleGap: number;
781
+ readonly proseArticleBlockGap: number;
782
+ readonly articleColumnGap: number;
783
+ readonly articleTocRailWidth: number;
784
+ readonly articleHeaderGap: number;
785
+ readonly articleHeaderPaddingBottom: number;
786
+ readonly articleHeaderMarginBottom: number;
787
+ readonly articleMetaRowGap: number;
788
+ readonly articleFooterGap: number;
789
+ readonly articleFooterMarginTop: number;
790
+ readonly articleFooterPaddingTop: number;
791
+ readonly articleNavTargetGap: number;
792
+ readonly codeBlockHeaderGap: number;
793
+ readonly codeBlockHeaderInsetY: number;
794
+ readonly codeBlockHeaderInsetRight: number;
795
+ readonly codeBlockContentInsetX: number;
796
+ readonly codeBlockHeaderRightGap: number;
797
+ readonly codeBlockBodyInsetY: number;
798
+ readonly codeBlockFloatingCopyOffset: number;
799
+ readonly calloutInsetY: number;
800
+ readonly calloutInsetX: number;
801
+ readonly calloutTitleRowGap: number;
802
+ readonly tocRootGap: number;
803
+ readonly tocLinkInsetY: number;
804
+ readonly tocLinkIndent: number;
805
+ readonly tocSubIndent: number;
806
+ readonly articleCardTagsGap: number;
807
+ readonly articleCardTagInsetY: number;
808
+ readonly articleCardTagInsetX: number;
809
+ readonly articleCardMetaGapTop: number;
810
+ readonly guideBodyGapBottom: number;
811
+ readonly guideFooterGapTop: number;
812
+ readonly guideFooterInsetTop: number;
813
+ readonly sidebarSearchGap: number;
814
+ readonly sidebarSearchTriggerHeight: number;
815
+ readonly settingsRowInsetY: number;
816
+ readonly settingsRowGap: number;
817
+ readonly mermaidContainerInset: number;
818
+ readonly sidebarBrandInsetTop: number;
819
+ readonly sidebarBrandInsetX: number;
820
+ readonly sidebarSectionGap: number;
821
+ readonly sidebarAccountInsetTop: number;
822
+ readonly sidebarAccountInsetX: number;
823
+ readonly sidebarAccountInsetBottom: number;
824
+ readonly sidebarAvatarSize: number;
825
+ readonly sidebarSectionLabelGap: number;
826
+ readonly sidebarChildListGapTop: number;
827
+ readonly sidebarChildListGapBottom: number;
828
+ readonly sidebarChildListIndent: number;
829
+ readonly sidebarChildRowInsetY: number;
830
+ readonly sidebarChildRowIndent: number;
831
+ readonly sidebarAccountMenuWidth: number;
832
+ readonly sidebarSettingsMenuWidth: number;
833
+ readonly appHeaderMobileActionsHeight: number;
834
+ readonly appShellHeaderHeight: number;
835
+ readonly appShellHeaderMobileHeight: number;
836
+ readonly appShellNavbarWidth: number;
837
+ readonly appShellNavbarRailWidth: number;
838
+ readonly mobileNavTabGap: number;
839
+ readonly chartLegendGap: number;
840
+ readonly chartMarginTop: number;
841
+ readonly chartMarginRight: number;
842
+ readonly chartMarginBottom: number;
843
+ readonly chartMarginLeft: number;
844
+ readonly chartDotR: number;
845
+ readonly progressBarSize: number;
846
+ readonly agentRailInsetX: number;
847
+ readonly agentPartGapTop: number;
848
+ readonly agentCodeInset: number;
849
+ readonly agentErrorInsetY: number;
850
+ readonly agentErrorInsetX: number;
851
+ readonly agentScrollButtonGapTop: number;
852
+ readonly agentMessageInsetY: number;
853
+ readonly agentMessageInsetX: number;
854
+ readonly agentTranscriptInset: number;
855
+ readonly badgeInsetY: number;
856
+ readonly badgeInsetX: number;
857
+ readonly statCardGap: number;
858
+ readonly virtualRowInsetY: number;
859
+ readonly virtualRowInsetX: number;
860
+ } & {
861
+ stickyHeaderClearance: number;
862
+ stickyHeaderClearanceMobile: number;
863
+ };
864
+ /** NavLink row line-height at the shipped identity (`1.35`) — `deriveSpacing(0)`'s `rowLineHeight`,
865
+ * UNCHANGED from the shipped identity (locked by `theme/spacing.test.ts`). */
866
+ export declare const ROW_LINE_HEIGHT: number;
867
+ declare function buildPaletteDataUncached(config: DeriveConfig): {
868
+ ACCENT: {
869
+ readonly accent: ColorPair;
870
+ readonly accentHover: ColorPair;
871
+ readonly accentFill: ColorPair;
872
+ readonly accentFillHover: ColorPair;
873
+ readonly onAccent: ColorPair;
874
+ };
875
+ FILL: {
876
+ readonly gray: string;
877
+ readonly red: string;
878
+ readonly pink: string;
879
+ readonly grape: string;
880
+ readonly violet: string;
881
+ readonly indigo: string;
882
+ readonly cyan: string;
883
+ readonly teal: string;
884
+ readonly green: string;
885
+ readonly lime: string;
886
+ readonly yellow: string;
887
+ readonly orange: string;
888
+ };
889
+ SURFACE: {
890
+ readonly bg: ColorPair;
891
+ readonly panel: ColorPair;
892
+ readonly panelHover: ColorPair;
893
+ readonly elevated: ColorPair;
894
+ readonly border: ColorPair;
895
+ readonly hairline: ColorPair;
896
+ readonly subtle: ColorPair;
897
+ readonly overlay: {
898
+ readonly light: "#ffffff";
899
+ readonly dark: "color-mix(in srgb, #3f3f46 50%, #27272a)";
900
+ };
901
+ readonly field: ColorPair;
902
+ readonly divider: {
903
+ readonly light: "color-mix(in srgb, #e5e5e5 65%, transparent)";
904
+ readonly dark: "color-mix(in srgb, #ffffff 6%, transparent)";
905
+ };
906
+ };
907
+ INK: {
908
+ readonly ink: ColorPair;
909
+ readonly ink2: ColorPair;
910
+ readonly muted: ColorPair;
911
+ readonly faint: ColorPair;
912
+ };
913
+ NEUTRAL: {
914
+ readonly line: {
915
+ readonly light: "#52525c";
916
+ readonly dark: "#e4e4e7";
917
+ };
918
+ readonly line2: {
919
+ readonly light: "#71717a";
920
+ readonly dark: "#a1a1aa";
921
+ };
922
+ readonly axis: {
923
+ readonly light: string;
924
+ readonly dark: "rgba(255,255,255,0.6)";
925
+ };
926
+ readonly axisStroke: {
927
+ readonly light: string;
928
+ readonly dark: "rgba(255,255,255,0.12)";
929
+ };
930
+ readonly grid: {
931
+ readonly light: string;
932
+ readonly dark: "rgba(255,255,255,0.06)";
933
+ };
934
+ readonly crosshair: {
935
+ readonly light: string;
936
+ readonly dark: "rgba(255,255,255,0.42)";
937
+ };
938
+ readonly dotStroke: {
939
+ readonly light: "#ffffff";
940
+ readonly dark: "#27272a";
941
+ };
942
+ readonly tooltipBg: {
943
+ readonly light: "#ffffff";
944
+ readonly dark: "rgba(39,39,42,0.96)";
945
+ };
946
+ readonly tooltipText: {
947
+ readonly light: string;
948
+ readonly dark: "rgba(255,255,255,0.88)";
949
+ };
950
+ readonly tooltipMuted: {
951
+ readonly light: string;
952
+ readonly dark: "rgba(255,255,255,0.5)";
953
+ };
954
+ readonly tooltipBorder: {
955
+ readonly light: "1px solid #e4e4e7";
956
+ readonly dark: "none";
957
+ };
958
+ readonly tooltipShadow: {
959
+ readonly light: `0 2px 8px ${string}`;
960
+ readonly dark: "0 2px 8px rgba(0,0,0,0.35)";
961
+ };
962
+ readonly legendText: {
963
+ readonly light: string;
964
+ readonly dark: "rgba(255,255,255,0.92)";
965
+ };
966
+ readonly neutral: ColorPair;
967
+ };
968
+ SEMANTIC: {
969
+ readonly good: ColorPair;
970
+ readonly bad: ColorPair;
971
+ readonly warn: ColorPair;
972
+ };
973
+ STATUS: {
974
+ readonly excellent: ColorPair;
975
+ readonly good: ColorPair;
976
+ readonly warn: ColorPair;
977
+ readonly bad: ColorPair;
978
+ readonly neutral: ColorPair;
979
+ };
980
+ };
981
+ /**
982
+ * Build the full derive-config-dependent palette data for `config` (defaults to
983
+ * {@link DEFAULT_DERIVE_CONFIG}, the shipped identity). The default config always resolves to one
984
+ * pinned singleton (see `defaultPaletteData` above); any other config is memoized by value (not
985
+ * reference) in `paletteDataCache`, capped at `PALETTE_DATA_CACHE_MAX` entries (FIFO eviction), so
986
+ * repeated calls with an equal config — e.g. from `BasaltProvider` on every render — are a cache
987
+ * hit, not a re-derivation.
988
+ */
989
+ export declare function buildPaletteData(config?: DeriveConfig): PaletteData;
990
+ /** The shape {@link buildPaletteData} returns — the derive-config-dependent half of the palette. */
991
+ export type PaletteData = ReturnType<typeof buildPaletteDataUncached>;
992
+ /** Semantic status hues — solids + the family they fill from (alpha applied in the token layer).
993
+ * GENERATED — see `buildPaletteData` above. */
65
994
  export declare const SEMANTIC: {
66
995
  readonly good: ColorPair;
67
996
  readonly bad: ColorPair;
@@ -69,9 +998,7 @@ export declare const SEMANTIC: {
69
998
  };
70
999
  /**
71
1000
  * Score / zone status scale (excellent → poor). `good`/`warn`/`bad` are the SAME spec
72
- * success/warning/danger pairs as `SEMANTIC` (also the direct source for Badge/Notification/delta
73
- * -badge status-tint idioms in the theme — one set of hexes, several consumers). `excellent`
74
- * (top-of-scale grade) and `neutral` keep their prior chart-only families (unchanged BP families).
1001
+ * success/warning/danger pairs as `SEMANTIC`. GENERATED — see `buildPaletteData` above.
75
1002
  */
76
1003
  export declare const STATUS: {
77
1004
  readonly excellent: ColorPair;
@@ -81,10 +1008,8 @@ export declare const STATUS: {
81
1008
  readonly neutral: ColorPair;
82
1009
  };
83
1010
  /**
84
- * Theme-resolved neutrals (line / axis / grid / tooltip chrome). Mirrors the old
85
- * useVxTheme() outputs, retuned to the zinc identity — the light-scheme opacity bases below use
86
- * the new `ink` rgb (38,38,38 = #262626) rather than the old warm near-black, so chart chrome
87
- * reads on the same cool-neutral ink as the rest of the chrome.
1011
+ * Theme-resolved neutrals (line / axis / grid / tooltip chrome). GENERATED — see `buildPaletteData`
1012
+ * above.
88
1013
  */
89
1014
  export declare const NEUTRAL: {
90
1015
  readonly line: {
@@ -96,19 +1021,19 @@ export declare const NEUTRAL: {
96
1021
  readonly dark: "#a1a1aa";
97
1022
  };
98
1023
  readonly axis: {
99
- readonly light: "rgba(38,38,38,0.6)";
1024
+ readonly light: string;
100
1025
  readonly dark: "rgba(255,255,255,0.6)";
101
1026
  };
102
1027
  readonly axisStroke: {
103
- readonly light: "rgba(38,38,38,0.12)";
1028
+ readonly light: string;
104
1029
  readonly dark: "rgba(255,255,255,0.12)";
105
1030
  };
106
1031
  readonly grid: {
107
- readonly light: "rgba(38,38,38,0.07)";
1032
+ readonly light: string;
108
1033
  readonly dark: "rgba(255,255,255,0.06)";
109
1034
  };
110
1035
  readonly crosshair: {
111
- readonly light: "rgba(38,38,38,0.32)";
1036
+ readonly light: string;
112
1037
  readonly dark: "rgba(255,255,255,0.42)";
113
1038
  };
114
1039
  readonly dotStroke: {
@@ -120,11 +1045,11 @@ export declare const NEUTRAL: {
120
1045
  readonly dark: "rgba(39,39,42,0.96)";
121
1046
  };
122
1047
  readonly tooltipText: {
123
- readonly light: "rgba(38,38,38,0.88)";
1048
+ readonly light: string;
124
1049
  readonly dark: "rgba(255,255,255,0.88)";
125
1050
  };
126
1051
  readonly tooltipMuted: {
127
- readonly light: "rgba(38,38,38,0.5)";
1052
+ readonly light: string;
128
1053
  readonly dark: "rgba(255,255,255,0.5)";
129
1054
  };
130
1055
  readonly tooltipBorder: {
@@ -132,173 +1057,65 @@ export declare const NEUTRAL: {
132
1057
  readonly dark: "none";
133
1058
  };
134
1059
  readonly tooltipShadow: {
135
- readonly light: "0 2px 8px rgba(38,38,38,0.1)";
1060
+ readonly light: `0 2px 8px ${string}`;
136
1061
  readonly dark: "0 2px 8px rgba(0,0,0,0.35)";
137
1062
  };
138
- readonly neutral: {
139
- readonly light: "#525252";
140
- readonly dark: "#d4d4d4";
1063
+ readonly legendText: {
1064
+ readonly light: string;
1065
+ readonly dark: "rgba(255,255,255,0.92)";
141
1066
  };
1067
+ readonly neutral: ColorPair;
142
1068
  };
143
- /** Ink text ramp (`docs/DESIGN-SPEC.md` §2) — primary/emphasis/secondary/tertiary body text. */
1069
+ /** Ink text ramp (`docs/DESIGN-SPEC.md` §2). GENERATED — see `buildPaletteData` above. */
144
1070
  export declare const INK: {
145
- readonly ink: {
146
- readonly light: "#262626";
147
- readonly dark: "#e5e5e5";
148
- };
149
- readonly ink2: {
150
- readonly light: "#404040";
151
- readonly dark: "#dddddd";
152
- };
153
- readonly muted: {
154
- readonly light: "#525252";
155
- readonly dark: "#d4d4d4";
156
- };
157
- readonly faint: {
158
- readonly light: "#737373";
159
- readonly dark: "#a1a1a1";
160
- };
1071
+ readonly ink: ColorPair;
1072
+ readonly ink2: ColorPair;
1073
+ readonly muted: ColorPair;
1074
+ readonly faint: ColorPair;
161
1075
  };
162
- /**
163
- * The one saturated sky-blue accent. It has TWO roles, and they are DIFFERENT COLORS — conflating
164
- * them is what made dark mode unfixable.
165
- *
166
- * • `accent` — the accent as INK: link text, active-nav icon, chart lines, focus ring. It is read
167
- * AGAINST THE PAGE, so it must be LIGHT on dark (`#8ec5ff`, 8.64:1 on the dark page) and DEEP on
168
- * light (`#0077bd`, 4.60:1 on the light page). This pair inverts across schemes, as it must.
169
- *
170
- * • `accentFill` — the accent as SURFACE: filled buttons, a checked Switch/Checkbox, the active
171
- * Timeline bullet, the Composer send button. It CARRIES A LABEL, so it is squeezed from both
172
- * sides at once: white text needs ≥4.5:1 against the fill, AND the control needs ≥3:1 against
173
- * the page it sits on. On the dark page those two constraints leave one narrow window, and
174
- * `#0077bd` is the value in it (white 4.80:1, fill-vs-dark-page 3.26:1). Deeper (`#0069a8`,
175
- * `#04669b`) buys text contrast but drops the button to 2.5–2.7:1 against the page — the control
176
- * fades into the background. Lighter breaks white text. So the fill is the SAME hex in both
177
- * schemes, and `onAccent` is white in both.
178
- *
179
- * `onAccent` is THE foreground for any accent fill. `theme/index.ts` bridges Mantine's
180
- * `--mantine-color-<primary>-filled` onto `--vx-accentFill` and every filled foreground onto
181
- * `--vx-onAccent`, so ONE token drives the chrome — which is also what makes the theme lab able to
182
- * retune the accent live. Mantine's own `autoContrast` cannot express this (it resolves the
183
- * foreground scheme-blindly, in JS). Regression-locked by `theme/contrast.test.ts`.
184
- */
1076
+ /** The one saturated sky-blue accent. GENERATED — see `buildPaletteData` above. */
185
1077
  export declare const ACCENT: {
186
- readonly accent: {
187
- readonly light: "#0077bd";
188
- readonly dark: "#8ec5ff";
189
- };
190
- readonly accentHover: {
191
- readonly light: "#0069a8";
192
- readonly dark: "#51a2ff";
193
- };
194
- readonly accentFill: {
195
- readonly light: "#0077bd";
196
- readonly dark: "#0077bd";
197
- };
198
- readonly accentFillHover: {
199
- readonly light: "#0069a8";
200
- readonly dark: "#0069a8";
201
- };
202
- readonly onAccent: {
203
- readonly light: "#ffffff";
204
- readonly dark: "#ffffff";
205
- };
1078
+ readonly accent: ColorPair;
1079
+ readonly accentHover: ColorPair;
1080
+ readonly accentFill: ColorPair;
1081
+ readonly accentFillHover: ColorPair;
1082
+ readonly onAccent: ColorPair;
206
1083
  };
207
- /**
208
- * Filled-surface hexes for the Mantine accent families — THE FILL BAND.
209
- *
210
- * A filled control is constrained from both sides at once (the `ACCENT` note above derives this for
211
- * the accent): a white label needs ≥4.5:1 against the fill, and the control needs ≥3:1 against the
212
- * page behind it — on BOTH pages, since a fill does not invert across schemes. In WCAG terms that
213
- * pins the fill's relative luminance into one narrow band, ~0.150–0.183. There is no room for a
214
- * family to sit outside it: too light and the label dies, too dark and the button fades into the
215
- * dark page.
216
- *
217
- * So every family's fill is its own hue placed at the SAME luminance (0.165, the band's centre).
218
- * Each hex is the family's Mantine shade-6 scaled uniformly in LINEAR-light space — luminance is
219
- * linear in linear-RGB, so a uniform scale lands on the target exactly while preserving the hue and
220
- * saturation exactly. The result is a system law rather than a per-color judgement call: EVERY
221
- * filled surface reads white, on either page, at ~4.9:1 / ~3.2:1. Untuned, five families sat under
222
- * the 3:1 page floor (grape 2.17:1) and three needed black labels.
223
- *
224
- * `blue` is absent on purpose — it is the accent, and its fill lives in `ACCENT.accentFill` so the
225
- * accent keeps ONE source. `dark` is absent too: `color="dark"` is a deliberately near-black
226
- * surface, not a band member. Hover is DERIVED in CSS from the fill (see `tokens/index.ts`), so
227
- * retuning a fill moves its hover with it. Regression-locked by `theme/contrast.test.ts`.
228
- */
1084
+ /** Filled-surface hexes for the Mantine accent families — THE FILL BAND. GENERATED — see
1085
+ * `buildPaletteData` above. */
229
1086
  export declare const FILL: {
230
- readonly gray: "#707078";
231
- readonly red: "#cc3c41";
232
- readonly pink: "#d22b6a";
233
- readonly grape: "#ad47ad";
234
- readonly violet: "#ad47ad";
235
- readonly indigo: "#745cda";
236
- readonly cyan: "#1378aa";
237
- readonly teal: "#007f75";
238
- readonly green: "#1f8228";
239
- readonly lime: "#617a1a";
240
- readonly yellow: "#936a05";
241
- readonly orange: "#a56113";
242
- };
243
- /**
244
- * Card / control depth shadows (`docs/DESIGN-SPEC.md` §2) — depth is a whisper shadow + a 1px
245
- * ring baked into the SAME value (never a separate `border`). The ring embeds
246
- * `var(--vx-surface-hairline)` so it stays single-sourced against the hairline pair below.
247
- */
248
- export declare const SHADOW: {
249
- readonly card: {
250
- readonly light: "0 1px 2px rgba(28,25,23,0.05), 0 0 0 1px var(--vx-surface-hairline)";
251
- readonly dark: "0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px color-mix(in srgb, #ffffff 4%, transparent)";
252
- };
253
- readonly ctrl: {
254
- readonly light: "0 1px 2px rgba(28,25,23,0.12)";
255
- readonly dark: "0 1px 2px rgba(0,0,0,0.35)";
256
- };
257
- readonly overlay: {
258
- readonly light: "0 8px 24px rgba(28,25,23,0.10)";
259
- readonly dark: "0 8px 24px rgba(0,0,0,0.5)";
260
- };
1087
+ readonly gray: string;
1088
+ readonly red: string;
1089
+ readonly pink: string;
1090
+ readonly grape: string;
1091
+ readonly violet: string;
1092
+ readonly indigo: string;
1093
+ readonly cyan: string;
1094
+ readonly teal: string;
1095
+ readonly green: string;
1096
+ readonly lime: string;
1097
+ readonly yellow: string;
1098
+ readonly orange: string;
261
1099
  };
1100
+ /** App chrome surfaces — the zinc identity for the Mantine theme (`docs/DESIGN-SPEC.md` §2).
1101
+ * GENERATED — see `buildPaletteData` above. */
262
1102
  export declare const SURFACE: {
263
- readonly bg: {
264
- readonly light: "color-mix(in srgb, #f4f4f5 50%, #e4e4e7)";
265
- readonly dark: "color-mix(in srgb, #27272a 70%, #18181b)";
266
- };
267
- readonly panel: {
268
- readonly light: "#f4f4f5";
269
- readonly dark: "#27272a";
270
- };
271
- readonly panelHover: {
272
- readonly light: "#fafafa";
273
- readonly dark: "color-mix(in srgb, #3f3f46 50%, #27272a)";
274
- };
275
- readonly elevated: {
276
- readonly light: "#fafafa";
277
- readonly dark: "color-mix(in srgb, #3f3f46 50%, #27272a)";
278
- };
279
- readonly border: {
280
- readonly light: "color-mix(in srgb, #e4e4e7 50%, #d4d4d8)";
281
- readonly dark: "#3f3f46";
282
- };
283
- readonly hairline: {
284
- readonly light: "#e5e5e5";
285
- readonly dark: "color-mix(in srgb, #52525c 50%, #3f3f46)";
286
- };
287
- readonly subtle: {
288
- readonly light: "#eeeef0";
289
- readonly dark: "#2d2d33";
290
- };
1103
+ readonly bg: ColorPair;
1104
+ readonly panel: ColorPair;
1105
+ readonly panelHover: ColorPair;
1106
+ readonly elevated: ColorPair;
1107
+ readonly border: ColorPair;
1108
+ readonly hairline: ColorPair;
1109
+ readonly subtle: ColorPair;
291
1110
  readonly overlay: {
292
1111
  readonly light: "#ffffff";
293
1112
  readonly dark: "color-mix(in srgb, #3f3f46 50%, #27272a)";
294
1113
  };
295
- readonly field: {
296
- readonly light: "#ffffff";
297
- readonly dark: "color-mix(in srgb, #27272a 70%, #18181b)";
298
- };
1114
+ readonly field: ColorPair;
299
1115
  readonly divider: {
300
1116
  readonly light: "color-mix(in srgb, #e5e5e5 65%, transparent)";
301
1117
  readonly dark: "color-mix(in srgb, #ffffff 6%, transparent)";
302
1118
  };
303
1119
  };
1120
+ export {};
304
1121
  //# sourceMappingURL=palette.d.ts.map