basalt-ui 2.21.0 → 2.22.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 (226) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/MIGRATING.md +277 -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 +27 -3
  10. package/dist/charts/Bars.d.ts.map +1 -1
  11. package/dist/charts/Bars.js +5 -0
  12. package/dist/charts/CartesianChart.d.ts +8 -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 +29 -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 +7 -1
  29. package/dist/charts/Sparkline.d.ts.map +1 -1
  30. package/dist/charts/Sparkline.js +39 -14
  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 +20 -1
  35. package/dist/charts/band-fold.d.ts.map +1 -1
  36. package/dist/charts/band-fold.js +9 -0
  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-legend.module.css +7 -0
  40. package/dist/charts/compile.d.ts +17 -6
  41. package/dist/charts/compile.d.ts.map +1 -1
  42. package/dist/charts/compile.js +145 -74
  43. package/dist/charts/labels.d.ts +15 -4
  44. package/dist/charts/labels.d.ts.map +1 -1
  45. package/dist/charts/labels.js +34 -10
  46. package/dist/charts/legend.d.ts +2 -0
  47. package/dist/charts/legend.d.ts.map +1 -1
  48. package/dist/charts/legend.js +7 -21
  49. package/dist/charts/marks.js +1 -1
  50. package/dist/charts/panel.d.ts +0 -6
  51. package/dist/charts/panel.d.ts.map +1 -1
  52. package/dist/charts/panel.js +1 -10
  53. package/dist/charts/ref-label.d.ts +26 -0
  54. package/dist/charts/ref-label.d.ts.map +1 -0
  55. package/dist/charts/ref-label.js +63 -0
  56. package/dist/charts/scales.d.ts +4 -1
  57. package/dist/charts/scales.d.ts.map +1 -1
  58. package/dist/charts/scales.js +14 -3
  59. package/dist/charts/sparkline.module.css +10 -11
  60. package/dist/charts/sparkline.module.css.d.ts +1 -2
  61. package/dist/charts/state.d.ts +2 -0
  62. package/dist/charts/state.d.ts.map +1 -1
  63. package/dist/charts/state.js +2 -1
  64. package/dist/charts/types.d.ts +14 -5
  65. package/dist/charts/types.d.ts.map +1 -1
  66. package/dist/cli/doctor-upgrade.d.ts +1 -0
  67. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  68. package/dist/cli/doctor-upgrade.js +1 -0
  69. package/dist/cli/init.d.ts +2 -0
  70. package/dist/cli/init.d.ts.map +1 -1
  71. package/dist/cli/init.js +68 -4
  72. package/dist/cli/shot/capture.d.ts +21 -2
  73. package/dist/cli/shot/capture.d.ts.map +1 -1
  74. package/dist/cli/shot/capture.js +194 -32
  75. package/dist/cli/shot/detect.d.ts.map +1 -1
  76. package/dist/cli/shot/detect.js +14 -1
  77. package/dist/cli/shot/playwright.d.ts +5 -2
  78. package/dist/cli/shot/playwright.d.ts.map +1 -1
  79. package/dist/cli/shot/types.d.ts +2 -0
  80. package/dist/cli/shot/types.d.ts.map +1 -1
  81. package/dist/cli/shot/types.js +2 -0
  82. package/dist/controls/controls.module.css +11 -1
  83. package/dist/controls/filter-pill.d.ts.map +1 -1
  84. package/dist/controls/filter-pill.js +1 -0
  85. package/dist/controls/sync-button.d.ts.map +1 -1
  86. package/dist/controls/sync-button.js +22 -3
  87. package/dist/controls/sync-button.module.css +34 -2
  88. package/dist/controls/sync-button.module.css.d.ts +1 -0
  89. package/dist/dashboard/bar-list.d.ts.map +1 -1
  90. package/dist/dashboard/bar-list.js +7 -8
  91. package/dist/dashboard/bar-list.module.css +53 -0
  92. package/dist/dashboard/bar-list.module.css.d.ts +1 -0
  93. package/dist/dashboard/index.d.ts +1 -0
  94. package/dist/dashboard/index.d.ts.map +1 -1
  95. package/dist/dashboard/index.js +2 -0
  96. package/dist/dashboard/meter-model.d.ts +77 -3
  97. package/dist/dashboard/meter-model.d.ts.map +1 -1
  98. package/dist/dashboard/meter-model.js +88 -15
  99. package/dist/dashboard/meter-parts.d.ts +8 -0
  100. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  101. package/dist/dashboard/meter-parts.js +238 -71
  102. package/dist/dashboard/meter.d.ts +43 -60
  103. package/dist/dashboard/meter.d.ts.map +1 -1
  104. package/dist/dashboard/meter.js +20 -3
  105. package/dist/dashboard/meter.module.css +61 -0
  106. package/dist/dashboard/meter.module.css.d.ts +5 -0
  107. package/dist/dashboard/page-summary.d.ts +20 -0
  108. package/dist/dashboard/page-summary.d.ts.map +1 -0
  109. package/dist/dashboard/page-summary.js +28 -0
  110. package/dist/dashboard/page-summary.module.css +89 -0
  111. package/dist/dashboard/page-summary.module.css.d.ts +15 -0
  112. package/dist/dashboard/section.d.ts +25 -2
  113. package/dist/dashboard/section.d.ts.map +1 -1
  114. package/dist/dashboard/section.js +10 -5
  115. package/dist/dashboard/section.module.css +23 -0
  116. package/dist/dashboard/section.module.css.d.ts +1 -0
  117. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  118. package/dist/dashboard/stat-card-parts.js +1 -1
  119. package/dist/dashboard/stat-card.d.ts +4 -2
  120. package/dist/dashboard/stat-card.d.ts.map +1 -1
  121. package/dist/dashboard/stat-card.js +7 -5
  122. package/dist/dashboard/stat-card.module.css +17 -0
  123. package/dist/dashboard/stat-strip.d.ts +7 -1
  124. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  125. package/dist/dashboard/stat-strip.js +74 -46
  126. package/dist/dashboard/stat-strip.module.css +67 -20
  127. package/dist/dashboard/stat-strip.module.css.d.ts +4 -0
  128. package/dist/dashboard/visual-slot.d.ts +7 -1
  129. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  130. package/dist/dashboard/visual-slot.js +3 -1
  131. package/dist/guard/vx-names.d.ts.map +1 -1
  132. package/dist/guard/vx-names.js +2 -0
  133. package/dist/index.d.ts +1 -1
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +3 -1
  136. package/dist/styles.css +34 -2
  137. package/dist/theme/chrome-vars.d.ts +20 -5
  138. package/dist/theme/chrome-vars.d.ts.map +1 -1
  139. package/dist/theme/chrome-vars.js +46 -3
  140. package/dist/theme/controls.module.css +23 -0
  141. package/dist/theme/controls.module.css.d.ts +1 -0
  142. package/dist/theme/index.d.ts.map +1 -1
  143. package/dist/theme/index.js +8 -20
  144. package/dist/tokens/core.d.ts +2 -1
  145. package/dist/tokens/core.d.ts.map +1 -1
  146. package/dist/tokens/core.js +6 -1
  147. package/dist/tokens/derive.d.ts +3 -1
  148. package/dist/tokens/derive.d.ts.map +1 -1
  149. package/dist/tokens/derive.js +16 -1
  150. package/dist/tokens/palette.d.ts +4 -0
  151. package/dist/tokens/palette.d.ts.map +1 -1
  152. package/dist/tokens/palette.js +4 -0
  153. package/dist/tokens/status-text.d.ts.map +1 -1
  154. package/dist/tokens/status-text.js +3 -1
  155. package/llms.txt +38 -20
  156. package/package.json +1 -1
  157. package/src/charts/BandStrip.tsx +33 -3
  158. package/src/charts/Bars.tsx +6 -0
  159. package/src/charts/CartesianChart.tsx +16 -3
  160. package/src/charts/ChartCard.tsx +34 -6
  161. package/src/charts/DualPanel.tsx +3 -6
  162. package/src/charts/Heatmap.tsx +54 -5
  163. package/src/charts/Lines.tsx +56 -10
  164. package/src/charts/MirroredBars.tsx +3 -5
  165. package/src/charts/Sparkline.tsx +50 -13
  166. package/src/charts/StackedArea.tsx +14 -4
  167. package/src/charts/band-fold.ts +31 -1
  168. package/src/charts/chart-box.module.css +19 -0
  169. package/src/charts/chart-card.module.css +25 -0
  170. package/src/charts/chart-legend.module.css +7 -0
  171. package/src/charts/compile.ts +210 -85
  172. package/src/charts/labels.ts +48 -14
  173. package/src/charts/legend.tsx +10 -20
  174. package/src/charts/marks.ts +1 -1
  175. package/src/charts/panel.tsx +1 -16
  176. package/src/charts/ref-label.ts +104 -0
  177. package/src/charts/scales.ts +22 -2
  178. package/src/charts/sparkline.module.css +10 -11
  179. package/src/charts/sparkline.module.css.d.ts +1 -2
  180. package/src/charts/state.tsx +3 -1
  181. package/src/charts/types.ts +14 -5
  182. package/src/cli/doctor-upgrade.ts +1 -1
  183. package/src/cli/init.ts +100 -3
  184. package/src/cli/shot/capture.ts +251 -32
  185. package/src/cli/shot/detect.ts +18 -1
  186. package/src/cli/shot/playwright.ts +2 -2
  187. package/src/cli/shot/types.ts +3 -0
  188. package/src/controls/controls.module.css +11 -1
  189. package/src/controls/filter-pill.tsx +2 -0
  190. package/src/controls/sync-button.module.css +34 -2
  191. package/src/controls/sync-button.module.css.d.ts +1 -0
  192. package/src/controls/sync-button.tsx +40 -4
  193. package/src/dashboard/bar-list.module.css +53 -0
  194. package/src/dashboard/bar-list.module.css.d.ts +1 -0
  195. package/src/dashboard/bar-list.tsx +78 -69
  196. package/src/dashboard/index.ts +1 -0
  197. package/src/dashboard/meter-model.ts +186 -20
  198. package/src/dashboard/meter-parts.tsx +285 -64
  199. package/src/dashboard/meter.module.css +61 -0
  200. package/src/dashboard/meter.module.css.d.ts +5 -0
  201. package/src/dashboard/meter.tsx +60 -10
  202. package/src/dashboard/page-summary.module.css +89 -0
  203. package/src/dashboard/page-summary.module.css.d.ts +15 -0
  204. package/src/dashboard/page-summary.tsx +95 -0
  205. package/src/dashboard/section.module.css +23 -0
  206. package/src/dashboard/section.module.css.d.ts +1 -0
  207. package/src/dashboard/section.tsx +59 -11
  208. package/src/dashboard/stat-card-parts.tsx +5 -1
  209. package/src/dashboard/stat-card.module.css +17 -0
  210. package/src/dashboard/stat-card.tsx +12 -6
  211. package/src/dashboard/stat-strip.module.css +67 -20
  212. package/src/dashboard/stat-strip.module.css.d.ts +4 -0
  213. package/src/dashboard/stat-strip.tsx +118 -72
  214. package/src/dashboard/visual-slot.ts +12 -3
  215. package/src/guard/vx-names.ts +2 -0
  216. package/src/index.ts +2 -0
  217. package/src/styles.css +34 -2
  218. package/src/theme/__snapshots__/plain-theme.test.ts.snap +186 -60
  219. package/src/theme/chrome-vars.ts +77 -8
  220. package/src/theme/controls.module.css +23 -0
  221. package/src/theme/controls.module.css.d.ts +1 -0
  222. package/src/theme/index.ts +12 -25
  223. package/src/tokens/core.ts +4 -1
  224. package/src/tokens/derive.ts +32 -3
  225. package/src/tokens/palette.ts +4 -0
  226. package/src/tokens/status-text.ts +2 -0
@@ -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,24 @@ html .tableRoot tbody tr:last-of-type {
318
323
  border-bottom: none;
319
324
  }
320
325
 
326
+ /*
327
+ * Badge status dot: a coloured `light` Badge is the neutral surface + ink word with a leading dot in the
328
+ * status colour (`badgeVars` writes the `--badge-dot*` vars; nothing here without them). The dot is a
329
+ * grid item, so the root takes two columns while it is shown. A section (left or right) replaces it.
330
+ */
331
+ .badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section]) {
332
+ grid-template-columns: var(--badge-dot-cols, none);
333
+ column-gap: calc(0.25rem * var(--mantine-scale));
334
+ }
335
+
336
+ .badgeRoot[data-variant='light']:not([data-with-left-section], [data-with-right-section])::before {
337
+ content: var(--badge-dot-content, none);
338
+ width: calc(0.375rem * var(--mantine-scale));
339
+ height: calc(0.375rem * var(--mantine-scale));
340
+ border-radius: 50%;
341
+ background: var(--badge-dot);
342
+ }
343
+
321
344
  /*
322
345
  * Badge leading glyph (`leftSection`): the state encoded by shape. 12px on a 20px chip, 4px gap
323
346
  * (Mantine's own section margin is spacing.xs / 2 = 4), centred on the label.
@@ -13,6 +13,7 @@ declare const classes: {
13
13
  readonly accordionItem: string
14
14
  readonly tabsRoot: string
15
15
  readonly tableRoot: string
16
+ readonly badgeRoot: string
16
17
  readonly badgeSection: string
17
18
  }
18
19
  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,10 +505,12 @@ 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
@@ -1081,8 +1083,8 @@ function buildTheme(data: PaletteData, options: BuildThemeOptions = {}): Mantine
1081
1083
  // The tab-list bottom rule (and the inactive-tab hover underline) is a layout separator, not
1082
1084
  // control chrome — it reads the divider token instead of the heavy gray-3/dark-4 line
1083
1085
  // (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.
1086
+ // underline, outline border and pill fill take ink, not the accent (SPEC § 6.12; DESIGN-CORE
1087
+ // § Accent discipline); `color=` opts back in.
1086
1088
  Tabs: ext<typeof Tabs>({
1087
1089
  classNames: { root: controlsClasses.tabsRoot },
1088
1090
  vars: tabsVars,
@@ -1257,28 +1259,13 @@ function buttonPaddingX(size: unknown): string | undefined {
1257
1259
  }
1258
1260
 
1259
1261
  /**
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.
1262
+ * The inset on a Button's section side EQUALS its text side, so an icon Button is balanced (Mantine
1263
+ * derives it as `--button-padding-x / 1.5`, which also left the icon side one step tighter than the
1264
+ * text side: 8/12, 12/16, 12/20). `ctl` has its own `--button-padding-x-ctl`; undefined sizes keep
1265
+ * Mantine's value.
1265
1266
  */
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
1267
  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))`
1268
+ return size === 'ctl' ? 'var(--button-padding-x-ctl)' : buttonPaddingX(size)
1282
1269
  }
1283
1270
 
1284
1271
  /**
@@ -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 {
@@ -1332,6 +1332,10 @@ function buildPaletteDataUncached(config: DeriveConfig) {
1332
1332
  bg: DERIVED.surface.bg, // page background
1333
1333
  panel: DERIVED.surface.panel, // cards, controls
1334
1334
  panelHover: DERIVED.surface.panelHover,
1335
+ // Row hover / selected on a panel — the panel one ink step along (`derive.ts`), visible in both
1336
+ // schemes where `panelHover` (lighter than `panel` in light) is not.
1337
+ rowHover: DERIVED.surface.rowHover,
1338
+ rowSelected: DERIVED.surface.rowSelected,
1335
1339
  // Elevated surface (chart area, `--mantine-color-default-hover`) — same lift as panel-hover.
1336
1340
  elevated: DERIVED.surface.elevated,
1337
1341
  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