basalt-ui 2.27.2 → 2.29.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 (343) hide show
  1. package/CHANGELOG.md +466 -307
  2. package/MIGRATING.md +358 -12
  3. package/agent/rules/basalt-batteries.md +1 -1
  4. package/agent/rules/basalt-mantine.md +1 -1
  5. package/agent/rules/basalt-tokens.md +2 -2
  6. package/agent/skills/basalt-app/SKILL.md +3 -3
  7. package/agent/skills/basalt-charts/SKILL.md +1 -1
  8. package/agent/skills/basalt-design/SKILL.md +12 -6
  9. package/agent/skills/basalt-design/references/catalogue.md +42 -36
  10. package/agent/skills/basalt-design/references/recipes.md +47 -0
  11. package/agent/skills/basalt-design/references/states.md +1 -1
  12. package/configs/oxlint-basalt.json +2 -1
  13. package/configs/oxlint-plugin.js +112 -3
  14. package/configs/oxlint-plugin.test.ts +99 -4
  15. package/configs/oxlint.json +1 -0
  16. package/dist/agent/chat/thread-message.d.ts +1 -160
  17. package/dist/agent/chat/thread-message.d.ts.map +1 -1
  18. package/dist/agent/chat/thread-message.js +7 -162
  19. package/dist/agent/chat/virtualize.d.ts +5 -5
  20. package/dist/charts/ChartCard.d.ts +14 -7
  21. package/dist/charts/ChartCard.d.ts.map +1 -1
  22. package/dist/charts/ChartCard.js +112 -23
  23. package/dist/charts/Lines.d.ts.map +1 -1
  24. package/dist/charts/Lines.js +11 -4
  25. package/dist/charts/Sparkline.d.ts +14 -2
  26. package/dist/charts/Sparkline.d.ts.map +1 -1
  27. package/dist/charts/Sparkline.js +155 -44
  28. package/dist/charts/chart-box.module.css +59 -2
  29. package/dist/charts/chart-box.module.css.d.ts +5 -0
  30. package/dist/charts/chart-card.module.css +28 -17
  31. package/dist/charts/chart-card.module.css.d.ts +3 -0
  32. package/dist/charts/compile.d.ts +1 -1
  33. package/dist/charts/compile.d.ts.map +1 -1
  34. package/dist/charts/compile.js +38 -27
  35. package/dist/charts/labels.d.ts +13 -3
  36. package/dist/charts/labels.d.ts.map +1 -1
  37. package/dist/charts/labels.js +131 -20
  38. package/dist/charts/legend.d.ts.map +1 -1
  39. package/dist/charts/legend.js +1 -1
  40. package/dist/charts/ref-label.d.ts +37 -8
  41. package/dist/charts/ref-label.d.ts.map +1 -1
  42. package/dist/charts/ref-label.js +55 -10
  43. package/dist/charts/sparkline.module.css +50 -0
  44. package/dist/charts/sparkline.module.css.d.ts +3 -0
  45. package/dist/charts/state.d.ts +4 -4
  46. package/dist/charts/state.d.ts.map +1 -1
  47. package/dist/charts/state.js +23 -5
  48. package/dist/cli/doctor-upgrade.d.ts +11 -0
  49. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  50. package/dist/cli/doctor-upgrade.js +54 -0
  51. package/dist/cli/doctor.d.ts.map +1 -1
  52. package/dist/cli/doctor.js +32 -0
  53. package/dist/cli/help.d.ts.map +1 -1
  54. package/dist/cli/help.js +8 -3
  55. package/dist/cli/index.d.ts +13 -13
  56. package/dist/cli/index.d.ts.map +1 -1
  57. package/dist/cli/index.js +36 -2
  58. package/dist/cli/init.d.ts +6 -0
  59. package/dist/cli/init.d.ts.map +1 -1
  60. package/dist/cli/init.js +118 -27
  61. package/dist/cli/router-wiring.d.ts +3 -0
  62. package/dist/cli/router-wiring.d.ts.map +1 -1
  63. package/dist/cli/router-wiring.js +2 -0
  64. package/dist/cli/shot/capture.d.ts +34 -2
  65. package/dist/cli/shot/capture.d.ts.map +1 -1
  66. package/dist/cli/shot/capture.js +95 -12
  67. package/dist/cli/shot/detect.d.ts +4 -1
  68. package/dist/cli/shot/detect.d.ts.map +1 -1
  69. package/dist/cli/shot/detect.js +38 -16
  70. package/dist/cli/shot/index.d.ts.map +1 -1
  71. package/dist/cli/shot/index.js +9 -2
  72. package/dist/cli/shot/measure.d.ts.map +1 -1
  73. package/dist/cli/shot/measure.js +11 -2
  74. package/dist/cli/shot/types.d.ts +4 -1
  75. package/dist/cli/shot/types.d.ts.map +1 -1
  76. package/dist/cli/sync.d.ts.map +1 -1
  77. package/dist/cli/sync.js +10 -2
  78. package/dist/common/could-not-load.d.ts +13 -0
  79. package/dist/common/could-not-load.d.ts.map +1 -0
  80. package/dist/common/could-not-load.js +14 -0
  81. package/dist/common/empty-copy.d.ts +16 -0
  82. package/dist/common/empty-copy.d.ts.map +1 -0
  83. package/dist/common/empty-copy.js +9 -0
  84. package/dist/common/index.d.ts +1 -0
  85. package/dist/common/index.d.ts.map +1 -1
  86. package/dist/common/index.js +3 -0
  87. package/dist/common/props.d.ts +20 -0
  88. package/dist/common/props.d.ts.map +1 -1
  89. package/dist/common/props.js +13 -1
  90. package/dist/common/retry-button.module.css +7 -3
  91. package/dist/common/virtual-rows.d.ts +196 -0
  92. package/dist/common/virtual-rows.d.ts.map +1 -0
  93. package/dist/common/virtual-rows.js +290 -0
  94. package/dist/controls/controls.module.css +33 -1
  95. package/dist/controls/controls.module.css.d.ts +2 -0
  96. package/dist/controls/enum-filter.d.ts.map +1 -1
  97. package/dist/controls/enum-filter.js +8 -2
  98. package/dist/controls/filter-pill.d.ts +27 -3
  99. package/dist/controls/filter-pill.d.ts.map +1 -1
  100. package/dist/controls/filter-pill.js +15 -4
  101. package/dist/controls/form-layout.d.ts +9 -3
  102. package/dist/controls/form-layout.d.ts.map +1 -1
  103. package/dist/controls/form-layout.js +74 -12
  104. package/dist/controls/form-layout.module.css +112 -7
  105. package/dist/controls/form-layout.module.css.d.ts +1 -0
  106. package/dist/controls/multi-select-filter.d.ts +2 -2
  107. package/dist/controls/multi-select-filter.d.ts.map +1 -1
  108. package/dist/controls/multi-select-filter.js +12 -6
  109. package/dist/controls/range-filter.d.ts +1 -1
  110. package/dist/controls/range-filter.d.ts.map +1 -1
  111. package/dist/controls/range-filter.js +8 -2
  112. package/dist/dashboard/bar-list.d.ts +5 -5
  113. package/dist/dashboard/bar-list.d.ts.map +1 -1
  114. package/dist/dashboard/bar-list.js +15 -8
  115. package/dist/dashboard/bar-list.module.css +21 -5
  116. package/dist/dashboard/board-nav.d.ts +22 -0
  117. package/dist/dashboard/board-nav.d.ts.map +1 -0
  118. package/dist/dashboard/board-nav.js +49 -0
  119. package/dist/dashboard/board.d.ts +52 -0
  120. package/dist/dashboard/board.d.ts.map +1 -0
  121. package/dist/dashboard/board.js +247 -0
  122. package/dist/dashboard/board.module.css +179 -0
  123. package/dist/dashboard/board.module.css.d.ts +28 -0
  124. package/dist/dashboard/empty-state.d.ts +6 -6
  125. package/dist/dashboard/empty-state.d.ts.map +1 -1
  126. package/dist/dashboard/empty-state.js +17 -8
  127. package/dist/dashboard/event-list-model.d.ts +54 -0
  128. package/dist/dashboard/event-list-model.d.ts.map +1 -0
  129. package/dist/dashboard/event-list-model.js +76 -0
  130. package/dist/dashboard/event-list-rows.d.ts +23 -0
  131. package/dist/dashboard/event-list-rows.d.ts.map +1 -0
  132. package/dist/dashboard/event-list-rows.js +89 -0
  133. package/dist/dashboard/event-list-scroll.d.ts +55 -0
  134. package/dist/dashboard/event-list-scroll.d.ts.map +1 -0
  135. package/dist/dashboard/event-list-scroll.js +216 -0
  136. package/dist/dashboard/event-list-skeleton.d.ts +10 -0
  137. package/dist/dashboard/event-list-skeleton.d.ts.map +1 -0
  138. package/dist/dashboard/event-list-skeleton.js +34 -0
  139. package/dist/dashboard/event-list.d.ts +65 -0
  140. package/dist/dashboard/event-list.d.ts.map +1 -0
  141. package/dist/dashboard/event-list.js +208 -0
  142. package/dist/dashboard/event-list.module.css +336 -0
  143. package/dist/dashboard/event-list.module.css.d.ts +34 -0
  144. package/dist/dashboard/index.d.ts +2 -0
  145. package/dist/dashboard/index.d.ts.map +1 -1
  146. package/dist/dashboard/index.js +4 -0
  147. package/dist/dashboard/meter-model.d.ts +6 -3
  148. package/dist/dashboard/meter-model.d.ts.map +1 -1
  149. package/dist/dashboard/meter-model.js +9 -4
  150. package/dist/dashboard/meter-parts.d.ts +3 -0
  151. package/dist/dashboard/meter-parts.d.ts.map +1 -1
  152. package/dist/dashboard/meter-parts.js +36 -6
  153. package/dist/dashboard/meter.d.ts +3 -3
  154. package/dist/dashboard/meter.d.ts.map +1 -1
  155. package/dist/dashboard/meter.js +10 -2
  156. package/dist/dashboard/meter.module.css +20 -12
  157. package/dist/dashboard/meter.module.css.d.ts +0 -1
  158. package/dist/dashboard/page-summary.d.ts +3 -3
  159. package/dist/dashboard/page-summary.d.ts.map +1 -1
  160. package/dist/dashboard/page-summary.js +7 -2
  161. package/dist/dashboard/page-summary.module.css +5 -2
  162. package/dist/dashboard/query-state.d.ts +9 -8
  163. package/dist/dashboard/query-state.d.ts.map +1 -1
  164. package/dist/dashboard/query-state.js +29 -11
  165. package/dist/dashboard/section.d.ts +11 -3
  166. package/dist/dashboard/section.d.ts.map +1 -1
  167. package/dist/dashboard/section.js +34 -7
  168. package/dist/dashboard/settings-section.d.ts +8 -5
  169. package/dist/dashboard/settings-section.d.ts.map +1 -1
  170. package/dist/dashboard/settings-section.js +12 -8
  171. package/dist/dashboard/settings-section.module.css +25 -4
  172. package/dist/dashboard/settings-section.module.css.d.ts +1 -0
  173. package/dist/dashboard/stat-card-parts.d.ts +5 -1
  174. package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
  175. package/dist/dashboard/stat-card-parts.js +8 -3
  176. package/dist/dashboard/stat-card.d.ts +3 -3
  177. package/dist/dashboard/stat-card.d.ts.map +1 -1
  178. package/dist/dashboard/stat-card.js +47 -12
  179. package/dist/dashboard/stat-card.module.css +42 -7
  180. package/dist/dashboard/stat-card.module.css.d.ts +3 -0
  181. package/dist/dashboard/stat-group.d.ts +2 -2
  182. package/dist/dashboard/stat-group.d.ts.map +1 -1
  183. package/dist/dashboard/stat-group.js +10 -3
  184. package/dist/dashboard/stat-strip.d.ts +5 -4
  185. package/dist/dashboard/stat-strip.d.ts.map +1 -1
  186. package/dist/dashboard/stat-strip.js +41 -31
  187. package/dist/dashboard/stat-strip.module.css +8 -6
  188. package/dist/dashboard/visual-slot.d.ts +4 -0
  189. package/dist/dashboard/visual-slot.d.ts.map +1 -1
  190. package/dist/dashboard/visual-slot.js +2 -0
  191. package/dist/dashboard/widget-header.d.ts +6 -6
  192. package/dist/dashboard/widget-header.d.ts.map +1 -1
  193. package/dist/dashboard/widget-header.js +4 -2
  194. package/dist/dashboard/widget-header.module.css +12 -15
  195. package/dist/format/shared.d.ts.map +1 -1
  196. package/dist/format/shared.js +24 -1
  197. package/dist/guard/index.d.ts +1 -1
  198. package/dist/guard/index.d.ts.map +1 -1
  199. package/dist/guard/index.js +4 -1
  200. package/dist/index.d.ts +1 -1
  201. package/dist/index.d.ts.map +1 -1
  202. package/dist/index.js +4 -0
  203. package/dist/shell/app-main.module.css +18 -0
  204. package/dist/styles.css +69 -0
  205. package/dist/surfaces.d.ts +2 -2
  206. package/dist/surfaces.d.ts.map +1 -1
  207. package/dist/surfaces.js +8 -2
  208. package/dist/table/cell-kinds.d.ts +47 -0
  209. package/dist/table/cell-kinds.d.ts.map +1 -0
  210. package/dist/table/cell-kinds.js +180 -0
  211. package/dist/table/cell-kinds.module.css +55 -0
  212. package/dist/table/cell-kinds.module.css.d.ts +15 -0
  213. package/dist/table/data-table-fold.d.ts +155 -0
  214. package/dist/table/data-table-fold.d.ts.map +1 -0
  215. package/dist/table/data-table-fold.js +320 -0
  216. package/dist/table/data-table-state.d.ts +10 -3
  217. package/dist/table/data-table-state.d.ts.map +1 -1
  218. package/dist/table/data-table-state.js +11 -6
  219. package/dist/table/data-table.d.ts +13 -28
  220. package/dist/table/data-table.d.ts.map +1 -1
  221. package/dist/table/data-table.js +362 -255
  222. package/dist/table/data-table.module.css +282 -3
  223. package/dist/table/data-table.module.css.d.ts +16 -0
  224. package/dist/table/table-features.d.ts +34 -4
  225. package/dist/table/table-features.d.ts.map +1 -1
  226. package/dist/table/table-features.js +10 -0
  227. package/dist/theme/card-inset.module.css +35 -0
  228. package/dist/theme/controls.module.css +55 -2
  229. package/dist/theme/ctl-theme.d.ts.map +1 -1
  230. package/dist/theme/ctl-theme.js +5 -0
  231. package/dist/theme/index.d.ts.map +1 -1
  232. package/dist/theme/index.js +14 -10
  233. package/dist/tokens/core.d.ts +1 -0
  234. package/dist/tokens/core.d.ts.map +1 -1
  235. package/dist/tokens/core.js +1 -0
  236. package/dist/tokens/derive.js +1 -1
  237. package/dist/tokens/palette.d.ts +2 -1
  238. package/dist/tokens/palette.d.ts.map +1 -1
  239. package/llms.txt +295 -5
  240. package/package.json +1 -1
  241. package/src/agent/chat/thread-message.tsx +10 -403
  242. package/src/agent/chat/virtualize.ts +5 -5
  243. package/src/charts/ChartCard.tsx +175 -31
  244. package/src/charts/Lines.tsx +13 -4
  245. package/src/charts/Sparkline.tsx +213 -48
  246. package/src/charts/chart-box.module.css +59 -2
  247. package/src/charts/chart-box.module.css.d.ts +5 -0
  248. package/src/charts/chart-card.module.css +28 -17
  249. package/src/charts/chart-card.module.css.d.ts +3 -0
  250. package/src/charts/compile.ts +59 -33
  251. package/src/charts/labels.ts +175 -24
  252. package/src/charts/legend.tsx +3 -2
  253. package/src/charts/ref-label.ts +114 -18
  254. package/src/charts/sparkline.module.css +50 -0
  255. package/src/charts/sparkline.module.css.d.ts +3 -0
  256. package/src/charts/state.tsx +40 -10
  257. package/src/cli/doctor-upgrade.ts +75 -0
  258. package/src/cli/doctor.ts +36 -0
  259. package/src/cli/help.ts +16 -6
  260. package/src/cli/index.ts +73 -67
  261. package/src/cli/init.ts +157 -36
  262. package/src/cli/router-wiring.ts +2 -2
  263. package/src/cli/shot/capture.ts +138 -16
  264. package/src/cli/shot/detect.ts +46 -22
  265. package/src/cli/shot/index.ts +8 -2
  266. package/src/cli/shot/measure.ts +11 -2
  267. package/src/cli/shot/types.ts +4 -1
  268. package/src/cli/sync.ts +12 -2
  269. package/src/common/could-not-load.ts +22 -0
  270. package/src/common/empty-copy.ts +17 -0
  271. package/src/common/index.ts +1 -0
  272. package/src/common/props.ts +30 -0
  273. package/src/common/retry-button.module.css +7 -3
  274. package/src/common/virtual-rows.tsx +682 -0
  275. package/src/controls/controls.module.css +33 -1
  276. package/src/controls/controls.module.css.d.ts +2 -0
  277. package/src/controls/enum-filter.tsx +8 -2
  278. package/src/controls/filter-pill.tsx +80 -27
  279. package/src/controls/form-layout.module.css +112 -7
  280. package/src/controls/form-layout.module.css.d.ts +1 -0
  281. package/src/controls/form-layout.tsx +115 -22
  282. package/src/controls/multi-select-filter.tsx +22 -11
  283. package/src/controls/range-filter.tsx +9 -3
  284. package/src/dashboard/bar-list.module.css +21 -5
  285. package/src/dashboard/bar-list.tsx +53 -45
  286. package/src/dashboard/board-nav.ts +67 -0
  287. package/src/dashboard/board.module.css +179 -0
  288. package/src/dashboard/board.module.css.d.ts +28 -0
  289. package/src/dashboard/board.tsx +415 -0
  290. package/src/dashboard/empty-state.tsx +21 -11
  291. package/src/dashboard/event-list-model.ts +125 -0
  292. package/src/dashboard/event-list-rows.tsx +117 -0
  293. package/src/dashboard/event-list-scroll.ts +291 -0
  294. package/src/dashboard/event-list-skeleton.tsx +62 -0
  295. package/src/dashboard/event-list.module.css +336 -0
  296. package/src/dashboard/event-list.module.css.d.ts +34 -0
  297. package/src/dashboard/event-list.tsx +336 -0
  298. package/src/dashboard/index.ts +2 -0
  299. package/src/dashboard/meter-model.ts +16 -7
  300. package/src/dashboard/meter-parts.tsx +53 -14
  301. package/src/dashboard/meter.module.css +20 -12
  302. package/src/dashboard/meter.module.css.d.ts +0 -1
  303. package/src/dashboard/meter.tsx +36 -18
  304. package/src/dashboard/page-summary.module.css +5 -2
  305. package/src/dashboard/page-summary.tsx +13 -6
  306. package/src/dashboard/query-state.tsx +55 -30
  307. package/src/dashboard/section.tsx +83 -41
  308. package/src/dashboard/settings-section.module.css +25 -4
  309. package/src/dashboard/settings-section.module.css.d.ts +1 -0
  310. package/src/dashboard/settings-section.tsx +18 -8
  311. package/src/dashboard/stat-card-parts.tsx +20 -3
  312. package/src/dashboard/stat-card.module.css +42 -7
  313. package/src/dashboard/stat-card.module.css.d.ts +3 -0
  314. package/src/dashboard/stat-card.tsx +55 -13
  315. package/src/dashboard/stat-group.tsx +22 -14
  316. package/src/dashboard/stat-strip.module.css +8 -6
  317. package/src/dashboard/stat-strip.tsx +29 -20
  318. package/src/dashboard/visual-slot.ts +5 -0
  319. package/src/dashboard/widget-header.module.css +12 -15
  320. package/src/dashboard/widget-header.tsx +8 -5
  321. package/src/format/shared.ts +30 -1
  322. package/src/guard/index.ts +7 -1
  323. package/src/index.ts +4 -0
  324. package/src/shell/app-main.module.css +18 -0
  325. package/src/styles.css +69 -0
  326. package/src/surfaces.ts +7 -1
  327. package/src/table/cell-kinds.module.css +55 -0
  328. package/src/table/cell-kinds.module.css.d.ts +15 -0
  329. package/src/table/cell-kinds.tsx +263 -0
  330. package/src/table/data-table-fold.tsx +567 -0
  331. package/src/table/data-table-state.ts +24 -13
  332. package/src/table/data-table.module.css +282 -3
  333. package/src/table/data-table.module.css.d.ts +16 -0
  334. package/src/table/data-table.tsx +430 -362
  335. package/src/table/table-features.ts +44 -4
  336. package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -66
  337. package/src/theme/card-inset.module.css +35 -0
  338. package/src/theme/controls.module.css +55 -2
  339. package/src/theme/ctl-theme.tsx +8 -0
  340. package/src/theme/index.ts +12 -8
  341. package/src/tokens/core.ts +1 -0
  342. package/src/tokens/derive.ts +1 -1
  343. package/src/tokens/palette.ts +4 -1
@@ -15,6 +15,12 @@ const GLYPH_EM = 0.62
15
15
  const EDGE_INSET = 6
16
16
  const LINE_GAP = 3
17
17
 
18
+ /**
19
+ * A box another label has claimed in the same plot: a share of the plot width and a span of values
20
+ * on the left axis. A caption never takes a spot that overlaps one.
21
+ */
22
+ export type LabelBox = { fx0: number; fx1: number; y0: number; y1: number }
23
+
18
24
  const ORDER_END: readonly RefLabelPosition[] = [
19
25
  'end-above',
20
26
  'end-below',
@@ -29,7 +35,7 @@ const ORDER_START: readonly RefLabelPosition[] = [
29
35
  ]
30
36
 
31
37
  /** The y range of the polyline `points` (sorted by `fx`) between `fx0` and `fx1`, or `null`. */
32
- function yRangeWithin(
38
+ export function yRangeWithin(
33
39
  points: readonly RefLabelPoint[],
34
40
  fx0: number,
35
41
  fx1: number,
@@ -57,6 +63,15 @@ function yRangeWithin(
57
63
  return lo <= hi ? [lo, hi] : null
58
64
  }
59
65
 
66
+ /**
67
+ * The `dy` that puts a caption's box clear of its line. The engine centres the text on its y and
68
+ * its line box is a little taller than the glyphs, so a full font size off the line leaves the
69
+ * box half a font size plus its leading clear (the old −5 put the centre ON the dashes).
70
+ */
71
+ export function refLabelDy(position: RefLabelPosition, fontSize: number): number {
72
+ return position.endsWith('above') ? -fontSize : fontSize
73
+ }
74
+
60
75
  export function refLabelPosition(opts: {
61
76
  /** `RefLine.labelPosition`: wins over everything. */
62
77
  pinned: RefLabelPosition | undefined
@@ -70,8 +85,11 @@ export function refLabelPosition(opts: {
70
85
  fontSize: number
71
86
  /** One polyline per visible series on the line's axis. */
72
87
  series: readonly (readonly RefLabelPoint[])[]
88
+ /** Labels already placed on this axis (end labels): a caption keeps clear of them too. */
89
+ claimed?: readonly LabelBox[] | undefined
73
90
  }): RefLabelPosition {
74
91
  const { pinned, startFirst, value, plotWidth, plotHeight, label, fontSize, series } = opts
92
+ const { claimed = [] } = opts
75
93
  const order = startFirst ? ORDER_START : ORDER_END
76
94
  if (pinned !== undefined) return pinned
77
95
  const [lo, hi] = [Math.min(...opts.domain), Math.max(...opts.domain)]
@@ -92,10 +110,12 @@ export function refLabelPosition(opts: {
92
110
  const [fx0, fx1] = position.startsWith('end')
93
111
  ? [1 - widthFx, 1 - EDGE_INSET / plotWidth]
94
112
  : [EDGE_INSET / plotWidth, widthFx]
95
- return series.every((points) => {
96
- const range = yRangeWithin(points, fx0, fx1)
97
- return range === null || range[1] < from || range[0] > to
98
- })
113
+ return (
114
+ series.every((points) => {
115
+ const range = yRangeWithin(points, fx0, fx1)
116
+ return range === null || range[1] < from || range[0] > to
117
+ }) && claimed.every((b) => b.fx1 < fx0 || b.fx0 > fx1 || b.y1 < from || b.y0 > to)
118
+ )
99
119
  }
100
120
  // A caption that cannot avoid the data still stays inside the plot.
101
121
  return (
@@ -104,28 +124,104 @@ export function refLabelPosition(opts: {
104
124
  }
105
125
 
106
126
  /** The gap between a sparkline reference label's box and its line, px. */
107
- const SPARK_LABEL_GAP = 2
127
+ const SPARK_LABEL_GAP = 4
128
+ /** Air between a sparkline label's box and the data line (stroke and end dot included), px. */
129
+ const SPARK_LINE_AIR = 5
130
+
131
+ export type SparkLabelPlacement = {
132
+ side: 'above' | 'below'
133
+ end: 'start' | 'end'
134
+ /** The engine centres the text on its y: the offset that puts the box on `side` of the line. */
135
+ dy: number
136
+ }
108
137
 
109
138
  /**
110
- * Which side of its line a sparkline's reference label sits on, and its `dy` (the engine centres
111
- * the text on its y): above by default, below when the line is too near the plot top for the label
112
- * box to fit above it. The box clears the line by {@link SPARK_LABEL_GAP}, so the dashed rule never
113
- * strikes the text, and stays inside the plot (`height` less the line inset each side).
139
+ * Where a sparkline's reference label sits: of start-above, start-below, end-above, end-below, the
140
+ * one whose box stays inside the plot (`height` in full) and moves least off the reference to clear
141
+ * the data line by {@link SPARK_LINE_AIR} (the first of the four on a tie). The box clears the
142
+ * reference by at least {@link SPARK_LABEL_GAP}, so the dashed rule never strikes the text.
143
+ * `line` is the plotted polyline as `{ fx, y }` (a share of the plot width, a value on `domain`);
144
+ * without it (a bar sparkline, or no `width`/`label`) only the plot bounds decide.
114
145
  */
115
146
  export function referenceLabelPlacement(opts: {
116
147
  value: number
117
148
  domain: readonly [number, number]
118
149
  height: number
150
+ /** Plot width, px. */
151
+ width?: number | undefined
119
152
  /** The plot's margin inside the svg box, px. */
120
153
  inset: number
121
154
  fontSize: number
122
- }): { side: 'above' | 'below'; dy: number } {
123
- const { value, domain, height, inset, fontSize } = opts
155
+ label?: string | undefined
156
+ line?: readonly RefLabelPoint[] | undefined
157
+ }): SparkLabelPlacement {
158
+ const { value, domain, height, inset, fontSize, line } = opts
159
+ const { width = 0, label = '' } = opts
124
160
  const [lo, hi] = [Math.min(...domain), Math.max(...domain)]
125
- const share = hi === lo ? 0 : (value - lo) / (hi - lo)
126
- const line = inset + (height - 2 * inset) * (1 - share)
127
- const reach = SPARK_LABEL_GAP + fontSize + 1
128
- const side = line - reach >= 0 || line + reach > height ? 'above' : 'below'
129
- const dy = (SPARK_LABEL_GAP + (fontSize + 1) / 2) * (side === 'above' ? -1 : 1)
130
- return { side, dy }
161
+ const plotH = height - 2 * inset
162
+ const plotW = width - 2 * inset
163
+ const px = (y: number): number => inset + plotH * (1 - (hi === lo ? 0 : (y - lo) / (hi - lo)))
164
+ const at = px(value)
165
+ const boxH = fontSize
166
+ const boxW = label.length * fontSize * GLYPH_EM + EDGE_INSET
167
+ const pxLine = line?.map((p) => ({ fx: p.fx, y: px(p.y) }))
168
+ const candidates = (['start', 'end'] as const).flatMap((end) =>
169
+ (['above', 'below'] as const).map((side) => {
170
+ const nominal = side === 'above' ? at - SPARK_LABEL_GAP - boxH : at + SPARK_LABEL_GAP
171
+ const [fx0, fx1] = end === 'start' ? [0, boxW / plotW] : [1 - boxW / plotW, 1]
172
+ // The curve between two points stays between their values but not on the chord, so the
173
+ // window reaches out to the vertices that bound it.
174
+ const lead = pxLine?.find((p) => p.fx >= fx1)?.fx ?? fx1
175
+ const trail = pxLine?.findLast((p) => p.fx <= fx0)?.fx ?? fx0
176
+ const range =
177
+ pxLine === undefined || plotW <= 0
178
+ ? null
179
+ : yRangeWithin(pxLine, Math.min(trail, fx0), Math.max(lead, fx1))
180
+ // A box the line comes within the air of slides away from the reference, along its side, until it has air.
181
+ const near =
182
+ range !== null &&
183
+ range[1] + SPARK_LINE_AIR > nominal &&
184
+ range[0] - SPARK_LINE_AIR < nominal + boxH
185
+ const top = !near
186
+ ? nominal
187
+ : side === 'above'
188
+ ? range[0] - SPARK_LINE_AIR - boxH
189
+ : range[1] + SPARK_LINE_AIR
190
+ return {
191
+ side,
192
+ end,
193
+ top,
194
+ range,
195
+ shift: Math.abs(top - nominal),
196
+ fits: top >= 0 && top + boxH <= height,
197
+ }
198
+ }),
199
+ )
200
+ // The box stays inside the plot (the top edge last, so a box taller than the plot starts at 0).
201
+ const scored = candidates.map((c) => {
202
+ const top = Math.max(0, Math.min(c.top, height - boxH))
203
+ const covered =
204
+ c.range === null
205
+ ? 0
206
+ : Math.max(0, Math.min(top + boxH, c.range[1]) - Math.max(top, c.range[0]))
207
+ return { ...c, top, strikesRule: top < at && top + boxH > at, covered }
208
+ })
209
+ type Spot = (typeof scored)[number]
210
+ // The fitting spot that stays nearest the reference (the first of the four on a tie).
211
+ const nearer = (c: Spot, best: Spot): boolean => c.shift < best.shift
212
+ // Nothing fits (the line peaks on the reference in a short box): the spot that clears the
213
+ // reference rule first, then covers the least of the data line.
214
+ const better = (c: Spot, best: Spot): boolean =>
215
+ c.strikesRule === best.strikesRule ? c.covered < best.covered : best.strikesRule
216
+ const pick = (spots: Spot[], beats: (c: Spot, best: Spot) => boolean): Spot | undefined =>
217
+ spots.reduce<Spot | undefined>(
218
+ (best, c) => (best === undefined || beats(c, best) ? c : best),
219
+ undefined,
220
+ )
221
+ const { side, end, top } = (pick(
222
+ scored.filter((c) => c.fits),
223
+ nearer,
224
+ ) ?? pick(scored, better)) as Spot
225
+ const dy = top + boxH / 2 - at
226
+ return { side, end, dy }
131
227
  }
@@ -114,3 +114,53 @@
114
114
  border-radius: 50%;
115
115
  transform: translate(-50%, -50%);
116
116
  }
117
+
118
+ /* The reference caption steps aside while a readout shows: the chip can land on it (a long caption
119
+ * reaches the chip's line), and the readout is what the pointer asked for. */
120
+ .root[data-basalt-readout] [data-ts-key='reference-label'] {
121
+ visibility: hidden;
122
+ }
123
+
124
+ /* The window caption under a hosted plot: the span on the start edge, the reference's key on the end. */
125
+ .frame {
126
+ display: flex;
127
+ flex-direction: column;
128
+ min-width: 0;
129
+ }
130
+
131
+ /* The plot keeps its stated height whatever box the frame sits in. */
132
+ .frame > :first-child {
133
+ flex: none;
134
+ }
135
+
136
+ .caption {
137
+ display: flex;
138
+ align-items: baseline;
139
+ justify-content: space-between;
140
+ /* The key keeps a word's air from the span and drops to its own line when the two cannot share one
141
+ * (a ~160px cell at 390), rather than touching it. */
142
+ flex-wrap: wrap;
143
+ column-gap: var(--vx-space-stack-lg, 1rem);
144
+ margin-block-start: var(--vx-space-stack-xs, 0.25rem);
145
+ font-family: var(--basalt-font-numeral, var(--basalt-font-sans));
146
+ font-variant-numeric: lining-nums;
147
+ font-size: var(--vx-text-micro);
148
+ line-height: 1.25;
149
+ color: var(--vx-muted);
150
+ white-space: nowrap;
151
+ }
152
+
153
+ /* The reference's key follows the drawn line: a short dash, then its name. */
154
+ .key {
155
+ display: inline-flex;
156
+ align-items: center;
157
+ column-gap: var(--vx-space-stack-xs, 0.25rem);
158
+ margin-inline-start: auto;
159
+ }
160
+
161
+ .key::before {
162
+ content: '';
163
+ inline-size: 0.75rem;
164
+ block-size: 1px;
165
+ background: repeating-linear-gradient(to right, var(--vx-line) 0 3px, transparent 3px 5px);
166
+ }
@@ -9,5 +9,8 @@ declare const classes: {
9
9
  readonly sep: string
10
10
  readonly layer: string
11
11
  readonly dot: string
12
+ readonly frame: string
13
+ readonly caption: string
14
+ readonly key: string
12
15
  }
13
16
  export default classes
@@ -3,6 +3,8 @@
3
3
  * the chart chrome and `ChartCard`, so a pending card and a pending chart read the same.
4
4
  */
5
5
  import type { CSSProperties, ReactElement, ReactNode } from 'react'
6
+ import { splitEmptyCopy } from '../common/empty-copy'
7
+ import { couldNotLoad } from '../common/could-not-load'
6
8
  import { toErrorMessage } from '../common/errors'
7
9
  import { RetryButton } from '../common/retry-button'
8
10
  import { VX } from '../tokens'
@@ -42,10 +44,10 @@ const pendingStyle: CSSProperties = {
42
44
  const GHOST_BARS = [38, 52, 44, 66, 58, 74, 62, 48] as const
43
45
 
44
46
  /**
45
- * The shape a pending plot draws: `'bars'` (default), `'line'` for a line or area chart, or a bar
46
- * count when the loaded chart's data length is known (a 6-month chart loads 6 bars).
47
+ * The shape a pending plot draws: `'bars'` (default), `'line'` for a line or area chart, `'band'`
48
+ * for a `BandStrip` (one row), or a bar count when the loaded chart's data length is known (a 6-month chart loads 6 bars).
47
49
  */
48
- export type PlotGhostShape = 'bars' | 'line' | number
50
+ export type PlotGhostShape = 'bars' | 'line' | 'band' | number
49
51
 
50
52
  /** A mild rise across the width, in a 100 x 40 box stretched to the plot. */
51
53
  const GHOST_LINE = '0,30 12,26 25,28 38,18 50,22 62,12 75,16 88,8 100,12'
@@ -60,6 +62,12 @@ function PlotGhost({ shape = 'bars' }: { shape?: PlotGhostShape }): ReactElement
60
62
  </svg>
61
63
  </div>
62
64
  )
65
+ if (shape === 'band')
66
+ return (
67
+ <div aria-hidden="true" data-basalt-plot-ghost="band" className={boxClasses.ghost}>
68
+ <span className={boxClasses.ghostBand} />
69
+ </div>
70
+ )
63
71
  const count =
64
72
  typeof shape === 'number' ? Math.max(1, Math.min(Math.floor(shape), 60)) : GHOST_BARS.length
65
73
  return (
@@ -97,6 +105,11 @@ const errorStyle: CSSProperties = {
97
105
  fontSize: VX.text.sm,
98
106
  gap: VX.space.controlGap,
99
107
  }
108
+ // The empty tile's one ring: an inset shadow, never a border, as `EmptyState`'s section tier draws it.
109
+ const tileStyle: CSSProperties = {
110
+ // theme-allow surface-shadow-override — an inset ring on a tile inside a surface, not a card's depth
111
+ boxShadow: `var(--basalt-state-ring, inset 0 0 0 1px ${VX.surface.hairline})`,
112
+ }
100
113
  const errorHeadStyle: CSSProperties = {
101
114
  display: 'inline-flex',
102
115
  alignItems: 'center',
@@ -108,7 +121,7 @@ const errorHeadStyle: CSSProperties = {
108
121
  const errorMessageStyle: CSSProperties = { color: VX.muted }
109
122
 
110
123
  const emptyLabel = (state: ChartState | undefined): string =>
111
- typeof state?.empty === 'string' ? state.empty : 'Nothing recorded in this range.'
124
+ typeof state?.empty === 'string' ? state.empty : 'Nothing plotted in this range.'
112
125
 
113
126
  /** Fills the same {@link ChartBox} the chart will, so a pending, failed or empty chart (and a
114
127
  * `<Suspense>` fallback built from one) occupies the final chart's height. */
@@ -126,7 +139,7 @@ export function ChartPlaceholder(props: {
126
139
  /** For a box too small to hold a sentence (a sparkline): error and empty show a `—` and carry the
127
140
  * label as the accessible name and the hover title. */
128
141
  compact?: boolean
129
- /** Error only: what failed to load, "Could not load {noun}". Default: no noun. */
142
+ /** Error only: what failed to load, "Could not load {noun}" (see `couldNotLoad`). Default: bare. */
130
143
  noun?: string
131
144
  /** Pending only: the ghost's shape. Default `'bars'`. */
132
145
  ghost?: PlotGhostShape
@@ -152,7 +165,8 @@ export function ChartPlaceholder(props: {
152
165
  if (kind === 'pending')
153
166
  return fit(
154
167
  <output aria-label="Loading chart" aria-busy="true" className={stateClass} style={style}>
155
- {!props.compact && <PlotGhost {...(props.ghost !== undefined && { shape: props.ghost })} />}
168
+ {/* A sparkline's box is too small for bars: it ghosts a line, in the same tone as every ghost. */}
169
+ <PlotGhost shape={props.ghost ?? (props.compact ? 'line' : 'bars')} />
156
170
  </output>,
157
171
  )
158
172
  const label =
@@ -166,7 +180,7 @@ export function ChartPlaceholder(props: {
166
180
  {kind === 'error' && (
167
181
  <span style={errorHeadStyle}>
168
182
  <span aria-hidden="true" data-basalt-status-dot="" style={dotStyle} />
169
- Could not load{props.noun === undefined ? '' : ` ${props.noun}`}
183
+ {couldNotLoad(props.noun)}
170
184
  </span>
171
185
  )}
172
186
  <span style={errorMessageStyle}>{label}</span>
@@ -189,9 +203,25 @@ export function ChartPlaceholder(props: {
189
203
  {body}
190
204
  </div>,
191
205
  )
206
+ if (props.compact)
207
+ return fit(
208
+ <output data-basalt-chart-state={kind} className={stateClass} style={style} {...name}>
209
+ {body}
210
+ </output>,
211
+ )
212
+ // The § 6.11 empty tile inside the chart's own box: one ring, card radius, the title at `sm` 500
213
+ // and a muted line, centred. `EmptyState` is Mantine-coupled, so the anatomy is plain HTML here.
214
+ // The live region holds the copy only; the action is its sibling, so a button is not announced.
215
+ const { title, description } = splitEmptyCopy(label)
192
216
  return fit(
193
- <output data-basalt-chart-state={kind} className={stateClass} style={style} {...name}>
194
- {body}
195
- </output>,
217
+ <div data-basalt-chart-state={kind} className={stateClass} style={boxStyle}>
218
+ <div data-basalt-empty-tile="" className={boxClasses.emptyTile} style={tileStyle}>
219
+ <output className={boxClasses.emptyCopy}>
220
+ <span className={boxClasses.emptyTitle}>{title}</span>
221
+ {description !== undefined && <span className={boxClasses.emptyText}>{description}</span>}
222
+ </output>
223
+ {props.action !== undefined && <div>{props.action}</div>}
224
+ </div>
225
+ </div>,
196
226
  )
197
227
  }
@@ -660,3 +660,78 @@ export function subpathPeersCheck(cwd: string, scanned: string[], install: Basal
660
660
  }
661
661
  })
662
662
  }
663
+
664
+ /** Emitted `tokens:css` / `fonts:css` sheets from another version; the header names the re-emit command. */
665
+ export function staleEmittedSheets(
666
+ cwd: string,
667
+ files: readonly string[],
668
+ installedVersion: string | null,
669
+ ): string[] {
670
+ if (installedVersion === null) return []
671
+ const out: string[] = []
672
+ for (const rel of files) {
673
+ if (!rel.endsWith('.css')) continue
674
+ const provenance = (readIfExists(resolve(cwd, rel)) ?? '').split('\n')[1]?.trim() ?? ''
675
+ const m = /^\/\* basalt-ui (\S+) — `(basalt-ui (?:tokens|fonts):css[^`]*)` \*\/$/.exec(
676
+ provenance,
677
+ )
678
+ if (m === null || m[1] === installedVersion) continue
679
+ out.push(
680
+ `emitted-sheets: ${rel} was emitted by ${m[1]}, installed is ${installedVersion} — ` +
681
+ `\`--check\` fails until it is re-emitted. Fix: \`${m[2]}\``,
682
+ )
683
+ }
684
+ return out
685
+ }
686
+
687
+ /** `a` versus `b` as dotted numbers: negative when `a` is older. */
688
+ export function compareVersions(a: string, b: string): number {
689
+ const y = b.split('.').map(Number)
690
+ return (
691
+ a
692
+ .split('.')
693
+ .map((n, i) => Number(n) - (y[i] ?? 0))
694
+ .find((d) => d !== 0) ?? 0
695
+ )
696
+ }
697
+
698
+ const VISIBLE_HEADING = /^#{2,4}\s+Visible without code change/i
699
+ const CONSUMER_VISIBLE = /basalt\/[a-z][\w-]*|--vx-[\w-]+|\berror\b|\bpromoted?\b/i
700
+
701
+ /**
702
+ * The consumer-visible lines of every MIGRATING.md section with `from < version <= to` (`to`
703
+ * null: no upper bound), newest first as the file is ordered: lines naming a `basalt/*` rule id, a
704
+ * `--vx-*` token, `error` or `promoted`, plus the whole `Visible without code change` subsection.
705
+ * Fenced code and table separators are skipped; only long table rows are cut, never a bullet.
706
+ */
707
+ export function migratingSince(markdown: string, from: string, to: string | null): string[] {
708
+ const out: string[] = []
709
+ let version: string | null = null
710
+ let visible = false
711
+ let fenced = false
712
+ for (const line of markdown.split('\n')) {
713
+ const h2 = /^## (\d+\.\d+\.\d+)\b(.*)$/.exec(line)
714
+ if (h2 !== null || line.startsWith('## ')) {
715
+ const v = h2?.[1] ?? null
716
+ version =
717
+ v !== null && compareVersions(v, from) > 0 && (to === null || compareVersions(v, to) <= 0)
718
+ ? v
719
+ : null
720
+ visible = false
721
+ fenced = false
722
+ if (version !== null) out.push(`\n## ${version}${h2?.[2] ?? ''}`)
723
+ continue
724
+ }
725
+ if (version === null) continue
726
+ if (line.startsWith('```')) fenced = !fenced
727
+ if (fenced || line.startsWith('```')) continue
728
+ if (/^#{3,4}\s/.test(line)) visible = VISIBLE_HEADING.test(line)
729
+ const trimmed = line.trim()
730
+ if (trimmed === '' || /^\|[-\s|:]+\|$/.test(trimmed)) continue
731
+ if (!visible && !CONSUMER_VISIBLE.test(line)) continue
732
+ out.push(
733
+ trimmed.startsWith('|') && trimmed.length > 240 ? `${trimmed.slice(0, 240)}…` : trimmed,
734
+ )
735
+ }
736
+ return out
737
+ }
package/src/cli/doctor.ts CHANGED
@@ -41,8 +41,11 @@ import {
41
41
  appWiringCheck,
42
42
  shellDeclarationFindings,
43
43
  startWiringWarnings,
44
+ compareVersions,
44
45
  droppedSubpathsCheck,
45
46
  exactPeersCheck,
47
+ migratingSince,
48
+ staleEmittedSheets,
46
49
  oxlintFloorCheck,
47
50
  retiredLintRulesCheck,
48
51
  subpathPeersCheck,
@@ -101,6 +104,32 @@ function aiMajorsAt(dir: string): Partial<Record<AiMajorField, number>> {
101
104
  return out
102
105
  }
103
106
 
107
+ /** `doctor --from <version>`: the consumer-visible MIGRATING.md changes since `from`, up to the install. */
108
+ function doctorFrom(invocationCwd: string, from: string | undefined): number {
109
+ if (from === undefined || !/^\d+\.\d+\.\d+$/.test(from)) {
110
+ console.error('basalt-ui doctor --from <x.y.z>: the version you are upgrading from.')
111
+ return 1
112
+ }
113
+ const install = findBasaltInstall(resolveProjectDir(invocationCwd).dir)
114
+ const markdown = install.dir === null ? null : readIfExists(resolve(install.dir, 'MIGRATING.md'))
115
+ if (markdown === null) {
116
+ console.error('basalt-ui doctor --from: no installed basalt-ui. Fix: `bun add basalt-ui`.')
117
+ return 1
118
+ }
119
+ if (install.version !== null && compareVersions(from, install.version) > 0) {
120
+ console.error(`basalt-ui doctor --from ${from}: newer than the installed ${install.version}.`)
121
+ return 1
122
+ }
123
+ const lines = migratingSince(markdown, from, install.version)
124
+ const span = `after ${from} up to ${install.version ?? 'the install'}`
125
+ console.log(
126
+ lines.length === 0
127
+ ? `No consumer-visible changes recorded ${span}.`
128
+ : `Consumer-visible changes ${span} (full text: MIGRATING.md):\n${lines.join('\n')}`,
129
+ )
130
+ return 0
131
+ }
132
+
104
133
  /**
105
134
  * Check a consumer repo's basalt integration and print a pass/warn report. One directory, no
106
135
  * workspace walking (see {@link resolveProjectDir}). Checks, in print order:
@@ -129,6 +158,11 @@ export function doctor(
129
158
  designLoop: DesignLoopProbes = {},
130
159
  ): number {
131
160
  if (conflictingProfileFlags('doctor', flags)) return 1
161
+ const fromAt = flags.findIndex((f) => f === '--from' || f.startsWith('--from='))
162
+ if (fromAt !== -1) {
163
+ const flag = flags[fromAt] as string
164
+ return doctorFrom(invocationCwd, flag.startsWith('--from=') ? flag.slice(7) : flags[fromAt + 1])
165
+ }
132
166
  const project = resolveProjectDir(invocationCwd)
133
167
  // Inside the app package of a monorepo the manifest is above: read the install root instead.
134
168
  const aboveRoot = project.relocatedFrom === null ? installRootAbove(project.dir) : null
@@ -426,6 +460,8 @@ export function doctor(
426
460
  for (const line of shell.warnings) warn(line)
427
461
  }
428
462
 
463
+ for (const line of staleEmittedSheets(cwd, scannableFiles(cwd, cfg), install.version)) warn(line)
464
+
429
465
  // ── Design loop: advisory info lines (no warning count — they never change the verdict) ─────
430
466
  if (profile !== 'tokens-only') lines.push(...designLoopLines(cwd, resolveRoots(cfg), designLoop))
431
467
 
package/src/cli/help.ts CHANGED
@@ -18,6 +18,7 @@ export const COMMAND_OPTIONS: Record<
18
18
  > = {
19
19
  init: {
20
20
  'no-merge-lint': { type: 'boolean' },
21
+ 'no-install': { type: 'boolean' },
21
22
  },
22
23
  sync: {
23
24
  force: { type: 'boolean' },
@@ -31,7 +32,11 @@ export const COMMAND_OPTIONS: Record<
31
32
  'tokens-only': { type: 'boolean' },
32
33
  framework: { type: 'boolean' },
33
34
  },
34
- doctor: { 'tokens-only': { type: 'boolean' }, framework: { type: 'boolean' } },
35
+ doctor: {
36
+ 'tokens-only': { type: 'boolean' },
37
+ framework: { type: 'boolean' },
38
+ from: { type: 'string' },
39
+ },
35
40
  'guard-hook': {},
36
41
  'tokens:css': {
37
42
  out: { type: 'string' },
@@ -78,10 +83,10 @@ export function unknownFlag(cmd: string, flags: readonly string[]): string | nul
78
83
 
79
84
  /** The one usage string — printed by `basalt help` / `--help` / `-h` AND the unknown-command fallback. */
80
85
  export const USAGE =
81
- 'Usage: basalt-ui <--version | init [--no-merge-lint] |\n' +
86
+ 'Usage: basalt-ui <--version | init [--no-merge-lint] [--no-install] |\n' +
82
87
  ' sync [--force] [--check] [--verbose] [--tokens-only|--framework] |\n' +
83
88
  ' check-theme [--audit-allows] |\n' +
84
- ' doctor [--tokens-only|--framework] | guard-hook | tokens:css | fonts:css |\n' +
89
+ ' doctor [--tokens-only|--framework|--from <x.y.z>] | guard-hook | tokens:css | fonts:css |\n' +
85
90
  ' shot <route…> | shot detect | help>\n\n' +
86
91
  'check-theme [--tokens-only|--framework] [--audit-allows]\n' +
87
92
  ' --audit-allows reports instead of scanning: every `theme-allow` annotation and every\n' +
@@ -102,13 +107,15 @@ export const USAGE =
102
107
  ' Render routes in Chromium (Playwright from YOUR project: bun add -d playwright) and write\n' +
103
108
  ' board.html, metrics.json and png/* — every data-shot anchor × light/dark × desktop/mobile ×\n' +
104
109
  ' rest, hover, focus, tooltip, empty, loading, error. --dist serves a built SPA dir itself.\n' +
110
+ ' --out must resolve inside the project (the app dir in a monorepo, not the repo root); routes are\n' +
111
+ ' separate arguments (zsh does not word-split $ROUTES).\n' +
105
112
  ' Default --out .basalt/shots (emptied each run); .basalt/shots/last.json names the last out dir.\n' +
106
113
  ' A real, signed-in app: [--local-storage <key>=<@env:NAME|@file:path>]… seeds localStorage (app origin\n' +
107
114
  ' only) before any page script; [--api <prefix>=<origin>]… (with --dist) proxies GET/HEAD under that\n' +
108
115
  ' prefix to the origin (other methods get 405 unless --api-allow-writes); [--header <name>=@env:NAME]… is\n' +
109
116
  ' added to every proxied request, to EVERY --api origin (never on a navigation; https required);\n' +
110
117
  ' [--wait <ms|networkidle>] adds ms of settle AFTER networkidle (default none); [--auto-anchors] crops\n' +
111
- ' each Card, Paper and table over 120×60 px on a page with no data-shot. Values are never printed or\n' +
118
+ ' each Card, Paper and table over 120×60 px (else main, section, header, form) on a page with no data-shot. Values are never printed or\n' +
112
119
  ' written; a redirect, 401/403/404, 5xx or dead API fails every shot of that page. Shots of real data go to the\n' +
113
120
  ' reviewer subagent and so to its model provider: point --api at staging or synthetic data when the\n' +
114
121
  " app holds other people's data. Example:\n" +
@@ -127,10 +134,13 @@ export const USAGE =
127
134
  ' P2 noted, not failing: degraded: a lint warning, a contrast measured on an assumed white backdrop\n' +
128
135
  ' P3 noted, not failing: polish: an off-scale value within 1 px of a step\n' +
129
136
  ' score = 100 - (25 per P0 + 10 per P1 + 3 per P2 + 1 per P3), floored at 0. Each run appends\n' +
130
- ' {at, out, commit, counts, score} to .basalt/shots/history.json and prints the last 5 scores as a trend.\n' +
137
+ ' {at, out, commit, counts, score} to .basalt/shots/history.json and prints the last 5 scores of THAT --out dir as a trend\n' +
138
+ ' with the finding count beside each (the score floors at 0). No anchor measured: "nothing measured", no score.\n' +
139
+ ' detect takes --out <dir>, never a positional.\n' +
131
140
  ' A component can declare a rest anchor absent in a URL state with data-shot-absent="empty error": that\n' +
132
141
  ' cell is recorded `absent`, not `error`.\n\n' +
133
- 'doctor [--tokens-only|--framework]\n' +
142
+ 'doctor [--tokens-only|--framework] [--from <x.y.z>]\n' +
143
+ ' doctor --from <x.y.z> print the consumer-visible MIGRATING changes since that version\n' +
134
144
  ' Checks THIS project only: the manifest exists, the oxlint preset is wired, the pre-commit\n' +
135
145
  ' hook runs check-theme (via `lefthook dump`), and the ai package major is consistent within\n' +
136
146
  ' this package.json. Profile is DECLARED, same as check-theme — never inferred.\n\n' +