basalt-ui 2.21.0 → 2.23.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 (254) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/MIGRATING.md +452 -12
  3. package/agent/agents/basalt-design-reviewer.md +1 -1
  4. package/agent/rules/basalt-tokens.md +1 -1
  5. package/agent/skills/basalt-design/SKILL.md +1 -1
  6. package/agent/skills/basalt-design/references/anti-defaults.md +1 -1
  7. package/agent/skills/basalt-design/references/catalogue.md +1 -0
  8. package/dist/charts/BandStrip.d.ts.map +1 -1
  9. package/dist/charts/BandStrip.js +73 -3
  10. package/dist/charts/Bars.d.ts.map +1 -1
  11. package/dist/charts/Bars.js +6 -0
  12. package/dist/charts/CartesianChart.d.ts +10 -0
  13. package/dist/charts/CartesianChart.d.ts.map +1 -1
  14. package/dist/charts/CartesianChart.js +8 -5
  15. package/dist/charts/ChartCard.d.ts +12 -3
  16. package/dist/charts/ChartCard.d.ts.map +1 -1
  17. package/dist/charts/ChartCard.js +39 -8
  18. package/dist/charts/DualPanel.d.ts.map +1 -1
  19. package/dist/charts/DualPanel.js +5 -8
  20. package/dist/charts/Heatmap.d.ts +12 -1
  21. package/dist/charts/Heatmap.d.ts.map +1 -1
  22. package/dist/charts/Heatmap.js +34 -5
  23. package/dist/charts/Lines.d.ts +3 -0
  24. package/dist/charts/Lines.d.ts.map +1 -1
  25. package/dist/charts/Lines.js +29 -6
  26. package/dist/charts/MirroredBars.d.ts.map +1 -1
  27. package/dist/charts/MirroredBars.js +4 -6
  28. package/dist/charts/Sparkline.d.ts +14 -2
  29. package/dist/charts/Sparkline.d.ts.map +1 -1
  30. package/dist/charts/Sparkline.js +101 -22
  31. package/dist/charts/StackedArea.d.ts +4 -1
  32. package/dist/charts/StackedArea.d.ts.map +1 -1
  33. package/dist/charts/StackedArea.js +9 -3
  34. package/dist/charts/band-fold.d.ts +38 -1
  35. package/dist/charts/band-fold.d.ts.map +1 -1
  36. package/dist/charts/band-fold.js +18 -1
  37. package/dist/charts/chart-box.module.css +19 -0
  38. package/dist/charts/chart-card.module.css +25 -0
  39. package/dist/charts/chart-dates.d.ts +12 -0
  40. package/dist/charts/chart-dates.d.ts.map +1 -0
  41. package/dist/charts/chart-dates.js +16 -0
  42. package/dist/charts/chart-legend.module.css +7 -0
  43. package/dist/charts/compile.d.ts +25 -6
  44. package/dist/charts/compile.d.ts.map +1 -1
  45. package/dist/charts/compile.js +152 -72
  46. package/dist/charts/date-tick-format.d.ts +5 -5
  47. package/dist/charts/date-tick-format.d.ts.map +1 -1
  48. package/dist/charts/date-tick-format.js +3 -7
  49. package/dist/charts/labels.d.ts +21 -6
  50. package/dist/charts/labels.d.ts.map +1 -1
  51. package/dist/charts/labels.js +52 -17
  52. package/dist/charts/legend.d.ts +2 -0
  53. package/dist/charts/legend.d.ts.map +1 -1
  54. package/dist/charts/legend.js +7 -21
  55. package/dist/charts/marks.js +1 -1
  56. package/dist/charts/panel.d.ts +0 -6
  57. package/dist/charts/panel.d.ts.map +1 -1
  58. package/dist/charts/panel.js +1 -10
  59. package/dist/charts/ref-label.d.ts +43 -0
  60. package/dist/charts/ref-label.d.ts.map +1 -0
  61. package/dist/charts/ref-label.js +75 -0
  62. package/dist/charts/scales.d.ts +4 -1
  63. package/dist/charts/scales.d.ts.map +1 -1
  64. package/dist/charts/scales.js +14 -3
  65. package/dist/charts/sparkline.module.css +13 -17
  66. package/dist/charts/sparkline.module.css.d.ts +1 -2
  67. package/dist/charts/state.d.ts +2 -0
  68. package/dist/charts/state.d.ts.map +1 -1
  69. package/dist/charts/state.js +5 -2
  70. package/dist/charts/types.d.ts +18 -8
  71. package/dist/charts/types.d.ts.map +1 -1
  72. package/dist/cli/doctor-upgrade.d.ts +1 -0
  73. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  74. package/dist/cli/doctor-upgrade.js +1 -0
  75. package/dist/cli/init.d.ts +2 -0
  76. package/dist/cli/init.d.ts.map +1 -1
  77. package/dist/cli/init.js +68 -4
  78. package/dist/cli/shot/capture.d.ts +21 -2
  79. package/dist/cli/shot/capture.d.ts.map +1 -1
  80. package/dist/cli/shot/capture.js +202 -36
  81. package/dist/cli/shot/detect.d.ts.map +1 -1
  82. package/dist/cli/shot/detect.js +17 -1
  83. package/dist/cli/shot/playwright.d.ts +13 -2
  84. package/dist/cli/shot/playwright.d.ts.map +1 -1
  85. package/dist/cli/shot/playwright.js +5 -1
  86. package/dist/cli/shot/types.d.ts +4 -0
  87. package/dist/cli/shot/types.d.ts.map +1 -1
  88. package/dist/cli/shot/types.js +2 -0
  89. package/dist/cli/tokens-css.d.ts +5 -7
  90. package/dist/cli/tokens-css.d.ts.map +1 -1
  91. package/dist/cli/tokens-css.js +11 -12
  92. package/dist/controls/controls.module.css +11 -1
  93. package/dist/controls/filter-pill.d.ts.map +1 -1
  94. package/dist/controls/filter-pill.js +1 -0
  95. package/dist/controls/sync-button.d.ts.map +1 -1
  96. package/dist/controls/sync-button.js +22 -3
  97. package/dist/controls/sync-button.module.css +34 -2
  98. package/dist/controls/sync-button.module.css.d.ts +1 -0
  99. package/dist/dashboard/bar-list.d.ts +6 -1
  100. package/dist/dashboard/bar-list.d.ts.map +1 -1
  101. package/dist/dashboard/bar-list.js +15 -8
  102. package/dist/dashboard/bar-list.module.css +83 -0
  103. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  104. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  105. package/dist/dashboard/delta-badge.js +2 -2
  106. package/dist/dashboard/index.d.ts +1 -0
  107. package/dist/dashboard/index.d.ts.map +1 -1
  108. package/dist/dashboard/index.js +2 -0
  109. package/dist/dashboard/meter-model.d.ts +84 -5
  110. package/dist/dashboard/meter-model.d.ts.map +1 -1
  111. package/dist/dashboard/meter-model.js +100 -15
  112. package/dist/dashboard/meter-parts.d.ts +9 -1
  113. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  114. package/dist/dashboard/meter-parts.js +276 -74
  115. package/dist/dashboard/meter.d.ts +54 -65
  116. package/dist/dashboard/meter.d.ts.map +1 -1
  117. package/dist/dashboard/meter.js +21 -4
  118. package/dist/dashboard/meter.module.css +76 -0
  119. package/dist/dashboard/meter.module.css.d.ts +6 -0
  120. package/dist/dashboard/page-summary.d.ts +20 -0
  121. package/dist/dashboard/page-summary.d.ts.map +1 -0
  122. package/dist/dashboard/page-summary.js +28 -0
  123. package/dist/dashboard/page-summary.module.css +89 -0
  124. package/dist/dashboard/page-summary.module.css.d.ts +15 -0
  125. package/dist/dashboard/query-state.d.ts.map +1 -1
  126. package/dist/dashboard/query-state.js +1 -1
  127. package/dist/dashboard/section.d.ts +25 -2
  128. package/dist/dashboard/section.d.ts.map +1 -1
  129. package/dist/dashboard/section.js +10 -5
  130. package/dist/dashboard/section.module.css +23 -0
  131. package/dist/dashboard/section.module.css.d.ts +1 -0
  132. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  133. package/dist/dashboard/stat-card-parts.js +1 -1
  134. package/dist/dashboard/stat-card.d.ts +4 -2
  135. package/dist/dashboard/stat-card.d.ts.map +1 -1
  136. package/dist/dashboard/stat-card.js +7 -5
  137. package/dist/dashboard/stat-card.module.css +36 -0
  138. package/dist/dashboard/stat-group.module.css +7 -0
  139. package/dist/dashboard/stat-strip.d.ts +22 -6
  140. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  141. package/dist/dashboard/stat-strip.js +104 -60
  142. package/dist/dashboard/stat-strip.module.css +122 -53
  143. package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
  144. package/dist/dashboard/visual-slot.d.ts +7 -1
  145. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  146. package/dist/dashboard/visual-slot.js +3 -1
  147. package/dist/guard/index.d.ts.map +1 -1
  148. package/dist/guard/index.js +0 -5
  149. package/dist/guard/vx-names.d.ts.map +1 -1
  150. package/dist/guard/vx-names.js +2 -0
  151. package/dist/index.d.ts +1 -1
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +3 -1
  154. package/dist/styles.css +43 -4
  155. package/dist/theme/chrome-vars.d.ts +20 -5
  156. package/dist/theme/chrome-vars.d.ts.map +1 -1
  157. package/dist/theme/chrome-vars.js +46 -3
  158. package/dist/theme/controls.module.css +37 -0
  159. package/dist/theme/controls.module.css.d.ts +2 -0
  160. package/dist/theme/index.d.ts.map +1 -1
  161. package/dist/theme/index.js +18 -27
  162. package/dist/theme/status-verdict.d.ts.map +1 -1
  163. package/dist/theme/status-verdict.js +9 -1
  164. package/dist/tokens/core.d.ts +2 -1
  165. package/dist/tokens/core.d.ts.map +1 -1
  166. package/dist/tokens/core.js +6 -1
  167. package/dist/tokens/derive.d.ts +3 -1
  168. package/dist/tokens/derive.d.ts.map +1 -1
  169. package/dist/tokens/derive.js +16 -1
  170. package/dist/tokens/palette.d.ts +11 -10
  171. package/dist/tokens/palette.d.ts.map +1 -1
  172. package/dist/tokens/palette.js +11 -10
  173. package/dist/tokens/status-text.d.ts.map +1 -1
  174. package/dist/tokens/status-text.js +3 -1
  175. package/llms.txt +42 -22
  176. package/package.json +1 -1
  177. package/src/charts/BandStrip.tsx +83 -3
  178. package/src/charts/Bars.tsx +7 -0
  179. package/src/charts/CartesianChart.tsx +18 -3
  180. package/src/charts/ChartCard.tsx +54 -13
  181. package/src/charts/DualPanel.tsx +3 -6
  182. package/src/charts/Heatmap.tsx +54 -5
  183. package/src/charts/Lines.tsx +56 -10
  184. package/src/charts/MirroredBars.tsx +3 -5
  185. package/src/charts/Sparkline.tsx +135 -25
  186. package/src/charts/StackedArea.tsx +14 -4
  187. package/src/charts/band-fold.ts +50 -1
  188. package/src/charts/chart-box.module.css +19 -0
  189. package/src/charts/chart-card.module.css +25 -0
  190. package/src/charts/chart-dates.ts +30 -0
  191. package/src/charts/chart-legend.module.css +7 -0
  192. package/src/charts/compile.ts +253 -87
  193. package/src/charts/date-tick-format.ts +10 -13
  194. package/src/charts/labels.ts +81 -26
  195. package/src/charts/legend.tsx +10 -20
  196. package/src/charts/marks.ts +1 -1
  197. package/src/charts/panel.tsx +1 -16
  198. package/src/charts/ref-label.ts +131 -0
  199. package/src/charts/scales.ts +22 -2
  200. package/src/charts/sparkline.module.css +13 -17
  201. package/src/charts/sparkline.module.css.d.ts +1 -2
  202. package/src/charts/state.tsx +9 -4
  203. package/src/charts/types.ts +18 -8
  204. package/src/cli/doctor-upgrade.ts +1 -1
  205. package/src/cli/init.ts +100 -3
  206. package/src/cli/shot/capture.ts +266 -35
  207. package/src/cli/shot/detect.ts +18 -1
  208. package/src/cli/shot/playwright.ts +20 -4
  209. package/src/cli/shot/types.ts +5 -0
  210. package/src/cli/tokens-css.ts +18 -20
  211. package/src/controls/controls.module.css +11 -1
  212. package/src/controls/filter-pill.tsx +2 -0
  213. package/src/controls/sync-button.module.css +34 -2
  214. package/src/controls/sync-button.module.css.d.ts +1 -0
  215. package/src/controls/sync-button.tsx +40 -4
  216. package/src/dashboard/bar-list.module.css +83 -0
  217. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  218. package/src/dashboard/bar-list.tsx +107 -69
  219. package/src/dashboard/delta-badge.tsx +6 -2
  220. package/src/dashboard/index.ts +1 -0
  221. package/src/dashboard/meter-model.ts +207 -24
  222. package/src/dashboard/meter-parts.tsx +349 -67
  223. package/src/dashboard/meter.module.css +76 -0
  224. package/src/dashboard/meter.module.css.d.ts +6 -0
  225. package/src/dashboard/meter.tsx +72 -18
  226. package/src/dashboard/page-summary.module.css +89 -0
  227. package/src/dashboard/page-summary.module.css.d.ts +15 -0
  228. package/src/dashboard/page-summary.tsx +95 -0
  229. package/src/dashboard/query-state.tsx +1 -1
  230. package/src/dashboard/section.module.css +23 -0
  231. package/src/dashboard/section.module.css.d.ts +1 -0
  232. package/src/dashboard/section.tsx +59 -11
  233. package/src/dashboard/stat-card-parts.tsx +5 -1
  234. package/src/dashboard/stat-card.module.css +36 -0
  235. package/src/dashboard/stat-card.tsx +12 -6
  236. package/src/dashboard/stat-group.module.css +7 -0
  237. package/src/dashboard/stat-strip.module.css +122 -53
  238. package/src/dashboard/stat-strip.module.css.d.ts +4 -0
  239. package/src/dashboard/stat-strip.tsx +176 -91
  240. package/src/dashboard/visual-slot.ts +12 -3
  241. package/src/guard/index.ts +0 -5
  242. package/src/guard/vx-names.ts +2 -0
  243. package/src/index.ts +2 -0
  244. package/src/styles.css +43 -4
  245. package/src/theme/__snapshots__/plain-theme.test.ts.snap +200 -68
  246. package/src/theme/chrome-vars.ts +77 -8
  247. package/src/theme/controls.module.css +37 -0
  248. package/src/theme/controls.module.css.d.ts +2 -0
  249. package/src/theme/index.ts +22 -32
  250. package/src/theme/status-verdict.tsx +5 -1
  251. package/src/tokens/core.ts +4 -1
  252. package/src/tokens/derive.ts +32 -3
  253. package/src/tokens/palette.ts +11 -10
  254. package/src/tokens/status-text.ts +2 -0
@@ -110,12 +110,17 @@ export function inkVars(props: {
110
110
  return INK_BY_VARIANT[variant as keyof typeof INK_BY_VARIANT] ?? {}
111
111
  }
112
112
 
113
+ /** The selected `pills` Tab: one ink step over the panel, the same neutral the SegmentedControl indicator uses. */
114
+ const PILL_FILL = 'color-mix(in srgb, var(--vx-ink) 12%, var(--vx-surface-panel))'
115
+
113
116
  /**
114
- * Tabs vars: the on-color re-point plus the active underline in ink (SPEC § 6.12). Only the
115
- * underline `default` variant takes ink (`pills` fills with the colour); an explicit `color=` opts
116
- * out. The return type lists `--tabs-text-color` and `--tabs-radius` because Mantine's
117
- * `TabsCssVariables` type declares only `--tabs-color` / `--tabs-radius` while Tabs' OWN
118
- * varsResolver writes `--tabs-text-color` (an upstream type gap).
117
+ * Tabs vars: the selected tab reads by ink and weight, never the accent (SPEC § 6.12; DESIGN-CORE
118
+ * § Accent discipline). `default` and `outline` paint their active underline/border from
119
+ * `--tabs-color`, so that is ink; `pills` fills the tab with it, so the fill is an ink-mixed panel
120
+ * and the label (`--tabs-text-color`) is ink, not the on-accent white. An explicit `color=` opts out
121
+ * of all three and keeps the on-color text var. The return type lists `--tabs-text-color` and
122
+ * `--tabs-radius` because Mantine's `TabsCssVariables` type declares only `--tabs-color` /
123
+ * `--tabs-radius` while Tabs' OWN varsResolver writes `--tabs-text-color` (an upstream type gap).
119
124
  */
120
125
  export function tabsVars(
121
126
  theme: MantineTheme,
@@ -125,12 +130,76 @@ export function tabsVars(
125
130
  autoContrast?: boolean | undefined
126
131
  },
127
132
  ): { root: Record<'--tabs-color' | '--tabs-radius' | '--tabs-text-color', string | undefined> } {
128
- const underline = !hasExplicitColor(props.color) && (props.variant ?? 'default') === 'default'
133
+ if (hasExplicitColor(props.color)) {
134
+ return {
135
+ root: {
136
+ '--tabs-text-color': onColorFor(theme, props),
137
+ '--tabs-color': undefined,
138
+ '--tabs-radius': undefined,
139
+ },
140
+ }
141
+ }
142
+ const pills = props.variant === 'pills'
129
143
  return {
130
144
  root: {
131
- '--tabs-text-color': onColorFor(theme, props),
132
- '--tabs-color': underline ? 'var(--vx-ink)' : undefined,
145
+ '--tabs-text-color': pills ? INK : onColorFor(theme, props),
146
+ '--tabs-color': pills ? PILL_FILL : INK,
133
147
  '--tabs-radius': undefined,
134
148
  },
135
149
  }
136
150
  }
151
+
152
+ /** The dot's colour: a theme colour's fill, an indexed shade's own var (`red.6`), or the caller's literal (hex, var). */
153
+ function dotColor(theme: MantineTheme, color: string): string {
154
+ if (Object.hasOwn(theme.colors, color)) return `var(--mantine-color-${color}-filled)`
155
+ const [name, shade] = color.split('.')
156
+ if (
157
+ name !== undefined &&
158
+ shade !== undefined &&
159
+ /^\d$/.test(shade) &&
160
+ Object.hasOwn(theme.colors, name)
161
+ ) {
162
+ return `var(--mantine-color-${name}-${shade})`
163
+ }
164
+ return color
165
+ }
166
+
167
+ /**
168
+ * Badge vars (SPEC § 6.10): the status chip is the neutral surface with an ink word, and a named
169
+ * colour is a leading status dot, not a tinted slab (W36 r3/r6 "tinted status Badges"). Only the
170
+ * `light` variant (the theme default); `filled`, `outline`, `dot` and `default` keep their meaning —
171
+ * a `filled` accent count is the one tinted-chrome case that stays. Any colour the caller gives (theme name, indexed shade, hex, var) becomes the dot; `gray` is the
172
+ * no-signal chip. A `leftSection` glyph replaces the dot.
173
+ */
174
+ export function badgeVars(
175
+ theme: MantineTheme,
176
+ props: { color?: string | null | undefined; variant?: string | undefined },
177
+ ): {
178
+ root: Record<
179
+ '--badge-bg' | '--badge-color' | '--badge-dot' | '--badge-dot-content' | '--badge-dot-cols',
180
+ string | undefined
181
+ >
182
+ } {
183
+ const none = {
184
+ '--badge-bg': undefined,
185
+ '--badge-color': undefined,
186
+ '--badge-dot': undefined,
187
+ '--badge-dot-content': undefined,
188
+ '--badge-dot-cols': undefined,
189
+ }
190
+ if ((props.variant ?? 'light') !== 'light') return { root: none }
191
+ const name = props.color ?? 'gray'
192
+ const dot = name === 'gray' ? undefined : dotColor(theme, name)
193
+ return {
194
+ root: {
195
+ ...none,
196
+ '--badge-bg': SUBTLE,
197
+ '--badge-color': INK,
198
+ ...(dot !== undefined && {
199
+ '--badge-dot': dot,
200
+ '--badge-dot-content': "''",
201
+ '--badge-dot-cols': 'auto 1fr',
202
+ }),
203
+ },
204
+ }
205
+ }
@@ -200,6 +200,11 @@ html[data-mantine-color-scheme] .inputWrapper[data-variant='default']:not([data-
200
200
  .actionIconRoot:disabled:not([data-loading]),
201
201
  .actionIconRoot[data-disabled]:not([data-loading]) {
202
202
  --ctrl-depth: 0 0 transparent;
203
+
204
+ /* One surface in both schemes. Mantine's disabled fill is a gray step that is the PANEL itself in
205
+ * dark, so a disabled Button there read as the subtle variant with dimmer text; an ink-mixed panel
206
+ * is visible on either page, and the state is told apart by more than ink. */
207
+ background: color-mix(in srgb, var(--vx-ink) 8%, var(--vx-surface-panel));
203
208
  }
204
209
 
205
210
  /*
@@ -318,6 +323,30 @@ html .tableRoot tbody tr:last-of-type {
318
323
  border-bottom: none;
319
324
  }
320
325
 
326
+ /* A status word is the text as written ("Healthy"), not Mantine's UPPERCASE default; a caller who wants
327
+ * a micro-caption passes `tt="uppercase"`, which is inline and wins. `html` outranks Mantine's class. */
328
+ html .badgeRoot {
329
+ text-transform: none;
330
+ }
331
+
332
+ /*
333
+ * Badge status dot: a coloured `light` Badge is the neutral surface + ink word with a leading dot in the
334
+ * status colour (`badgeVars` writes the `--badge-dot*` vars; nothing here without them). The dot is a
335
+ * grid item, so the root takes two columns while it is shown. A section (left or right) replaces it.
336
+ */
337
+ .badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section]) {
338
+ grid-template-columns: var(--badge-dot-cols, none);
339
+ column-gap: calc(0.25rem * var(--mantine-scale));
340
+ }
341
+
342
+ .badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section])::before {
343
+ content: var(--badge-dot-content, none);
344
+ width: calc(0.375rem * var(--mantine-scale));
345
+ height: calc(0.375rem * var(--mantine-scale));
346
+ border-radius: 50%;
347
+ background: var(--badge-dot);
348
+ }
349
+
321
350
  /*
322
351
  * Badge leading glyph (`leftSection`): the state encoded by shape. 12px on a 20px chip, 4px gap
323
352
  * (Mantine's own section margin is spacing.xs / 2 = 4), centred on the label.
@@ -336,3 +365,11 @@ html .tableRoot tbody tr:last-of-type {
336
365
  .badgeSection img {
337
366
  object-fit: contain;
338
367
  }
368
+
369
+ /*
370
+ * Alert: an inline Code inside it sits one nested step (3px) under the Alert's own radius
371
+ * (craft-1/nested-radius-step). The Code theme reads `--basalt-code-radius`; the Alert supplies it.
372
+ */
373
+ .alertRoot {
374
+ --basalt-code-radius: max(0px, calc(var(--alert-radius, var(--vx-radius-ctrl)) - 3px));
375
+ }
@@ -5,6 +5,7 @@
5
5
  declare const classes: {
6
6
  readonly inputWrapper: string
7
7
  readonly input: string
8
+ readonly alertRoot: string
8
9
  readonly buttonRoot: string
9
10
  readonly actionIconRoot: string
10
11
  readonly checkboxCardRoot: string
@@ -13,6 +14,7 @@ declare const classes: {
13
14
  readonly accordionItem: string
14
15
  readonly tabsRoot: string
15
16
  readonly tableRoot: string
17
+ readonly badgeRoot: string
16
18
  readonly badgeSection: string
17
19
  }
18
20
  export default classes
@@ -86,7 +86,7 @@ import { CTL_HEIGHT_VARS } from '../tokens/ctl-vars'
86
86
  import type { CtlHeightVar } from '../tokens/ctl-vars'
87
87
  import { SIZE_CLASS_BREAKPOINTS } from '../tokens/size-classes'
88
88
  import type { BasaltFontsConfig } from '../tokens/core'
89
- import { onColor, onColorFor, inkVars, tabsVars } from './chrome-vars'
89
+ import { badgeVars, onColor, onColorFor, inkVars, tabsVars } from './chrome-vars'
90
90
  import cardInsetClasses from './card-inset.module.css'
91
91
  import controlsClasses from './controls.module.css'
92
92
  import floatingClasses from './floating.module.css'
@@ -505,16 +505,19 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
505
505
  },
506
506
  }),
507
507
  // Status chip (SPEC § 6.10): `light` + `tight`, neutral until `color=` opts in (the accent is
508
- // never a status chip's default); a `leftSection` glyph is sized in `badgeSection`.
508
+ // never a status chip's default). The neutral surface + ink word is the chip; a named colour is
509
+ // a leading dot (`badgeVars`); a `leftSection` glyph is sized in `badgeSection`.
509
510
  Badge: ext<typeof Badge>({
510
511
  defaultProps: { variant: 'light', color: 'gray', radius: radius.tight },
511
- classNames: { section: controlsClasses.badgeSection },
512
+ classNames: { root: controlsClasses.badgeRoot, section: controlsClasses.badgeSection },
513
+ vars: badgeVars,
512
514
  }),
513
515
  // Alert renders its title in the body font by default; bring it onto the head-font idiom
514
516
  // (docs/DESIGN-SPEC.md §5) like every other titled surface. Radius/padding/color tint are
515
517
  // already on-system (defaultRadius 'md' control tier + the variant color resolver), so only
516
518
  // the title font is overridden.
517
519
  Alert: ext<typeof Alert>({
520
+ classNames: { root: controlsClasses.alertRoot },
518
521
  styles: {
519
522
  title: {
520
523
  fontFamily: 'var(--basalt-font-head)',
@@ -773,11 +776,11 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
773
776
  // label that no longer fits its equal share truncates instead of forcing the column wide.
774
777
  //
775
778
  // The track's padding is `SPACE_FIXED.segmentedTrackInset`, a plain literal — NOT a
776
- // `--vx-space-*` var — because it is density-EXEMPT: it is load-bearing for the nested-corner
777
- // law (`RADIUS.ctrl === RADIUS_STEP.fine + segmentedTrackInset`, see that constant's doc in
778
- // `tokens/palette.ts`), and `radius.ctrl`/`RADIUS_STEP.fine` below already track the
779
- // RADIUS knob together, so the inset between them must stay fixed at exactly 2 regardless of
780
- // density.
779
+ // `--vx-space-*` var — because it is density-EXEMPT (see that constant's doc in
780
+ // `tokens/palette.ts`). The INDICATOR radius is the track's per-instance radius (`--sc-radius`,
781
+ // which Mantine sets on the root from the `radius` prop) minus 3 px: exact concentricity would
782
+ // be track − inset (2 px), but `craft-1/nested-radius-step` wants nested surfaces ≥ 3 px apart
783
+ // and that lint step wins. A custom `radius` therefore nests too.
781
784
  SegmentedControl: ext<typeof SegmentedControl>({
782
785
  defaultProps: { radius: radius.ctrl },
783
786
  classNames: {
@@ -816,7 +819,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
816
819
  // ink-12% fill sat one shade from the track and read as a hover state.
817
820
  boxShadow: 'var(--vx-shadow-raised)',
818
821
  outline: '1px solid color-mix(in srgb, var(--vx-ink) 14%, transparent)',
819
- borderRadius: 'var(--vx-radius-fine)',
822
+ // Track radius − 3 px: craft-1/nested-radius-step beats exact concentricity.
823
+ borderRadius: 'max(0px, calc(var(--sc-radius, var(--vx-radius-ctrl)) - 3px))',
820
824
  },
821
825
  // Conditionally spread the WHOLE key (never a present `label: undefined`) — the package
822
826
  // builds under `exactOptionalPropertyTypes`, which treats a key present-but-`undefined` as
@@ -1038,7 +1042,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
1038
1042
  styles: {
1039
1043
  root: {
1040
1044
  backgroundColor: 'color-mix(in srgb, var(--vx-ink) 7%, transparent)',
1041
- borderRadius: 'var(--vx-radius-tight)',
1045
+ // An Alert re-points the var (`controls.module.css`) so a nested Code steps down.
1046
+ borderRadius: 'var(--basalt-code-radius, var(--vx-radius-tight))',
1042
1047
  },
1043
1048
  },
1044
1049
  }),
@@ -1081,8 +1086,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
1081
1086
  // The tab-list bottom rule (and the inactive-tab hover underline) is a layout separator, not
1082
1087
  // control chrome — it reads the divider token instead of the heavy gray-3/dark-4 line
1083
1088
  // (controls.module.css; custom properties are stripped from `styles` objects). The active tab
1084
- // underline takes ink, not the accent (SPEC § 6.12; DESIGN-CORE § Accent discipline);
1085
- // `color=` opts back in. Only the underline `default` variant — `pills` fills with the colour.
1089
+ // underline, outline border and pill fill take ink, not the accent (SPEC § 6.12; DESIGN-CORE
1090
+ // § Accent discipline); `color=` opts back in.
1086
1091
  Tabs: ext<typeof Tabs>({
1087
1092
  classNames: { root: controlsClasses.tabsRoot },
1088
1093
  vars: tabsVars,
@@ -1257,28 +1262,13 @@ function buttonPaddingX(size: unknown): string | undefined {
1257
1262
  }
1258
1263
 
1259
1264
  /**
1260
- * The inset on a Button's section side, a step of the same stack scale. Mantine derives it as
1261
- * `--button-padding-x / 1.5` (`Button.css`, `[data-with-left-section]` / `[data-with-right-section]`),
1262
- * which lands at 10.67 / 13.33 / 21.33 / 5.33 px — off the scale. Each size takes the nearest step to
1263
- * that quotient at level 0 (xs 8, sm 12, md 12, lg 16, xl 24; compact-xs/sm 4, compact-md/lg 8,
1264
- * compact-xl 12; `ctl` 6.67 → 8). Undefined sizes keep Mantine's own value.
1265
+ * The inset on a Button's section side EQUALS its text side, so an icon Button is balanced (Mantine
1266
+ * derives it as `--button-padding-x / 1.5`, which also left the icon side one step tighter than the
1267
+ * text side: 8/12, 12/16, 12/20). `ctl` has its own `--button-padding-x-ctl`; undefined sizes keep
1268
+ * Mantine's value.
1265
1269
  */
1266
- const BUTTON_SECTION_X: Record<string, string> = {
1267
- xs: 'var(--vx-space-stack-sm)',
1268
- sm: 'var(--vx-space-stack-md)',
1269
- md: 'var(--vx-space-stack-md)',
1270
- lg: 'var(--vx-space-stack-lg)',
1271
- xl: 'var(--vx-space-stack-xl)',
1272
- ctl: 'var(--vx-space-stack-sm)',
1273
- 'compact-xs': 'var(--vx-space-stack-xs)',
1274
- 'compact-sm': 'var(--vx-space-stack-xs)',
1275
- 'compact-md': 'var(--vx-space-stack-sm)',
1276
- 'compact-lg': 'var(--vx-space-stack-sm)',
1277
- 'compact-xl': 'var(--vx-space-stack-md)',
1278
- }
1279
1270
  function buttonSectionX(size: unknown): string | undefined {
1280
- const step = BUTTON_SECTION_X[typeof size === 'string' ? size : 'sm']
1281
- return step === undefined ? undefined : `calc(${step} * var(--mantine-scale))`
1271
+ return size === 'ctl' ? 'var(--button-padding-x-ctl)' : buttonPaddingX(size)
1282
1272
  }
1283
1273
 
1284
1274
  /**
@@ -23,7 +23,11 @@ export function StatusVerdict({ color, word, phrase, className, style }: StatusV
23
23
  return (
24
24
  <span className={cx(classes.verdict, className)} {...(style !== undefined && { style })}>
25
25
  <StatusDot color={color} />
26
- <span data-verdict-word="" {...(phrase !== undefined && { 'aria-hidden': true })}>
26
+ <span
27
+ data-verdict-word=""
28
+ title={phrase ?? word}
29
+ {...(phrase !== undefined && { 'aria-hidden': true })}
30
+ >
27
31
  {word}
28
32
  </span>
29
33
  {phrase !== undefined && <span className={classes.hidden}>{phrase}</span>}
@@ -165,7 +165,6 @@ export const VX = {
165
165
  // "dev slider/production JS defaultProps" gap as Timeline's `bulletSize` — see `deriveSpacing`'s
166
166
  // doc in tokens/palette.ts).
167
167
  legendGap: SPACE_STEP.chartLegendGap,
168
- legendFontSize: TEXT.sm,
169
168
 
170
169
  // The type scale (px numbers — see TEXT above). Use in inline styles and visx SVG props;
171
170
  // use `var(--vx-text-*)` in CSS modules.
@@ -273,6 +272,8 @@ export const VX = {
273
272
  bg: 'var(--vx-surface-bg)',
274
273
  panel: 'var(--vx-surface-panel)',
275
274
  panelHover: 'var(--vx-surface-panel-hover)',
275
+ rowHover: 'var(--vx-surface-row-hover)', // a hovered row on a panel, visible in both schemes
276
+ rowSelected: 'var(--vx-surface-row-selected)', // a selected row on a panel
276
277
  elevated: 'var(--vx-surface-elevated)',
277
278
  subtle: 'var(--vx-surface-subtle)',
278
279
  overlay: 'var(--vx-surface-overlay)', // floating layer (menus, popovers, modals, drawers)
@@ -414,6 +415,8 @@ function frameworkPrimitives(side: Side, data: PaletteData): string {
414
415
  decl('surface-bg', su.bg[side]),
415
416
  decl('surface-panel', su.panel[side]),
416
417
  decl('surface-panel-hover', su.panelHover[side]),
418
+ decl('surface-row-hover', su.rowHover[side]),
419
+ decl('surface-row-selected', su.rowSelected[side]),
417
420
  decl('surface-elevated', su.elevated[side]),
418
421
  decl('surface-subtle', su.subtle[side]),
419
422
  decl('surface-overlay', su.overlay[side]),
@@ -279,8 +279,12 @@ export type SurfaceKey =
279
279
  | 'field'
280
280
  | 'border'
281
281
  | 'hairline'
282
+ | RowSurfaceKey
282
283
 
283
- const SURFACE_TONE: Record<Side, Record<SurfaceKey, number>> = {
284
+ /** The row surfaces: the panel mixed toward the ink, not a tone stop of their own. */
285
+ export type RowSurfaceKey = 'rowHover' | 'rowSelected'
286
+
287
+ const SURFACE_TONE: Record<Side, Record<Exclude<SurfaceKey, RowSurfaceKey>, number>> = {
284
288
  light: {
285
289
  bg: 93.45,
286
290
  panel: 96.21,
@@ -303,6 +307,22 @@ const SURFACE_TONE: Record<Side, Record<SurfaceKey, number>> = {
303
307
  },
304
308
  }
305
309
 
310
+ // Ink share of a row surface, per scheme. Hover must clear the `panelHover` step's contrast against the
311
+ // panel (the dark step is the larger, 5.7 tones vs 2.1); selected sits one step above. Light stays
312
+ // shallow so tertiary text and status text keep their margin on a selected row.
313
+ const ROW_INK_MIX: Record<RowSurfaceKey, Record<Side, number>> = {
314
+ rowHover: { light: 0.05, dark: 0.07 },
315
+ rowSelected: { light: 0.075, dark: 0.09 },
316
+ }
317
+
318
+ /** `a` toward `b` by `t` per sRGB channel — the hex twin of `color-mix(in srgb, b t%, a)`. */
319
+ function mixHex(a: string, b: string, t: number): string {
320
+ const channel = (hex: string, i: number): number =>
321
+ Number.parseInt(hex.slice(1 + 2 * i, 3 + 2 * i), 16)
322
+ const out = [0, 1, 2].map((i) => Math.round(channel(a, i) * (1 - t) + channel(b, i) * t))
323
+ return `#${out.map((c) => c.toString(16).padStart(2, '0')).join('')}`
324
+ }
325
+
306
326
  // Ink ramp tone stops (achromatic). NOT shifted by lightLevel/darkLevel — text tone stays stable
307
327
  // while surfaces move around it.
308
328
  export type InkKey = 'ink' | 'ink2' | 'muted' | 'faint'
@@ -311,7 +331,7 @@ const INK_TONE: Record<Side, Record<InkKey, number>> = {
311
331
  // light `faint` is tone 44.5 so tertiary text clears WCAG AA (4.5:1) on every text surface
312
332
  // (bg / panel / subtle / field); 48.44 landed at 4.23–4.31:1 on bg and subtle.
313
333
  light: { ink: 15.16, ink2: 27.09, muted: 34.88, faint: 44.5 },
314
- dark: { ink: 90.94, ink2: 88.12, muted: 84.91, faint: 66.24 },
334
+ dark: { ink: 90.94, ink2: 88.12, muted: 84.91, faint: 68.5 },
315
335
  }
316
336
 
317
337
  // ── Status/semantic — three baked hues, each with its own calibrated tone+chroma stop per scheme.
@@ -437,7 +457,7 @@ export function deriveTokensRaw(
437
457
  }
438
458
 
439
459
  const surface = {} as Record<SurfaceKey, ColorPair>
440
- for (const key of Object.keys(SURFACE_TONE.light) as SurfaceKey[]) {
460
+ for (const key of Object.keys(SURFACE_TONE.light) as Exclude<SurfaceKey, RowSurfaceKey>[]) {
441
461
  surface[key] = {
442
462
  light: hctToHex({
443
463
  hue: neutral.hue,
@@ -460,6 +480,15 @@ export function deriveTokensRaw(
460
480
  }
461
481
  }
462
482
 
483
+ // Row hover/selected: the panel one ink step along, so both read in both schemes (`panelHover`
484
+ // is LIGHTER than `panel` in light and vanishes on it). `row-surfaces.test.ts` pins the floor.
485
+ for (const key of Object.keys(ROW_INK_MIX) as RowSurfaceKey[]) {
486
+ surface[key] = {
487
+ light: mixHex(surface.panel.light, ink.ink.light, ROW_INK_MIX[key].light),
488
+ dark: mixHex(surface.panel.dark, ink.ink.dark, ROW_INK_MIX[key].dark),
489
+ }
490
+ }
491
+
463
492
  const status = deriveStatusHexes(surface)
464
493
 
465
494
  return {
@@ -240,7 +240,9 @@ export const RADIUS_STEP = {
240
240
  floating: DEFAULT_RADIUS_VALUES.floating, // 11
241
241
  /** SegmentedControl's active indicator, Kbd, Code — one step below the control radius. */
242
242
  tight: DEFAULT_RADIUS_VALUES.tight, // 5
243
- /** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius. */
243
+ /** Progress bar, and the Mantine scale's `sm` step — two steps below the control radius. (No
244
+ * longer the SegmentedControl indicator: that is the track radius − 3 px, the nested-radius lint
245
+ * step, set in `theme/index.ts`.) */
244
246
  fine: DEFAULT_RADIUS_VALUES.fine, // 4
245
247
  /** The Mantine `radius` scale's `xs` step — independent of both anchors. */
246
248
  scaleXs: 2,
@@ -840,15 +842,10 @@ export const SPACE_FIXED = {
840
842
  readingProgressHeight: 2,
841
843
  /** SegmentedControl track's optical inset (`styles.root` padding) — moved OUT of `SPACE_STEP` and
842
844
  * exempted from the density knob because it is load-bearing for the nested-corner law
843
- * (docs/DESIGN-SPEC.md §4): `RADIUS.ctrl === RADIUS_STEP.fine + segmentedTrackInset` (`6 = 4 +
844
- * 2`; the track takes the control radius, the indicator the `fine` tier). `RADIUS.ctrl`/
845
- * `RADIUS_STEP.fine` both shift together under the RADIUS knob (`ctrl = 6 + level`, `fine = ctrl
846
- * - 2`), so their difference is exactly 2 regardless of that knob (down to level -4; at -5 `fine`
847
- * clamps to 0 against `ctrl` 1) — a density-tracking inset would break concentricity in both directions (verified: this
848
- * inset's own value, HAD it stayed density-tracking, resolves via `scaleSpace(2, level, multiplier)`
849
- * to 1 at density's floor level -3 and 3 at its ceiling level +3 — the widest swing `deriveSpacing`'s
850
- * `[-3, 3]` range can produce) for no compensating benefit, since the two radii it sits between
851
- * never move independently of each other. */
845
+ * (docs/DESIGN-SPEC.md §4). The indicator radius is the track radius − 3 px (the nested-radius
846
+ * lint step wins over exact concentricity, which would be track − inset), so the inset no longer
847
+ * sets a corner; it stays fixed because a density-tracking inset (1 at density -3, 3 at +3 via
848
+ * `scaleSpace(2, level, multiplier)`) would make the track's optical weight swing for no benefit. */
852
849
  segmentedTrackInset: 2,
853
850
  } as const
854
851
 
@@ -1332,6 +1329,10 @@ function buildPaletteDataUncached(config: DeriveConfig) {
1332
1329
  bg: DERIVED.surface.bg, // page background
1333
1330
  panel: DERIVED.surface.panel, // cards, controls
1334
1331
  panelHover: DERIVED.surface.panelHover,
1332
+ // Row hover / selected on a panel — the panel one ink step along (`derive.ts`), visible in both
1333
+ // schemes where `panelHover` (lighter than `panel` in light) is not.
1334
+ rowHover: DERIVED.surface.rowHover,
1335
+ rowSelected: DERIVED.surface.rowSelected,
1335
1336
  // Elevated surface (chart area, `--mantine-color-default-hover`) — same lift as panel-hover.
1336
1337
  elevated: DERIVED.surface.elevated,
1337
1338
  border: DERIVED.surface.border, // "line" — strong border (layout/control chrome, NOT the card ring)
@@ -34,6 +34,8 @@ export const STATUS_TEXT_SURFACES: Readonly<Record<SurfaceKey, boolean>> = {
34
34
  field: true,
35
35
  border: false,
36
36
  hairline: false,
37
+ rowHover: true,
38
+ rowSelected: true,
37
39
  }
38
40
 
39
41
  export const STATUS_TEXT_CONTRAST_MIN = 4.5