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
@@ -6,47 +6,53 @@ Shipped composites: `StatCard`, `ChartCard`, `Section`, `WidgetHeader`, `BasaltD
6
6
 
7
7
  Run this first. A "yes, chart" answer sends you to § 2.
8
8
 
9
- | The data is | Not this | Use |
10
- | ------------------------------- | ---------------- | ------------------------------------------------------- |
11
- | One current value | A one-bar chart | `StatCard` (`stat-tile.md`) |
12
- | A handful of headline numbers | A grouped bar | `StatGroup variant="strip"` or a row of `StatCard` |
13
- | One ratio against a limit | A two-slice pie | `Meter` with a target tick |
14
- | More than ~7 meaningful classes | More colours | `BasaltDataTable` |
15
- | Fewer than 4 points | A line | `StatCard` |
16
- | 3–10 target-vs-actual metrics | A bar per metric | A grid of `Meter`s with `target` (basalt's bullet form) |
9
+ | The data is | Not this | Use |
10
+ | --------------------------------- | ---------------- | ------------------------------------------------------- |
11
+ | One current value | A one-bar chart | `StatCard` (`stat-tile.md`) |
12
+ | A handful of headline numbers | A grouped bar | `StatGroup variant="strip"` or a row of `StatCard` |
13
+ | One ratio against a limit | A two-slice pie | `Meter` with a target tick |
14
+ | More than ~7 meaningful classes | More colours | `BasaltDataTable` |
15
+ | Fewer than 4 points | A line | `StatCard` |
16
+ | 3–10 target-vs-actual metrics | A bar per metric | A grid of `Meter`s with `target` (basalt's bullet form) |
17
+ | A few regions compared | A choropleth | `Bars` in a `ChartCard` |
18
+ | A set of points (sites, stations) | A map of dots | `BasaltDataTable` |
17
19
 
18
20
  ## 2. Data shape to expression
19
21
 
20
- | Data shape | Encoding | basalt export (import path) | Not this |
21
- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------- |
22
- | Single value with a trend | Figure, text delta, `qualifier`, axis-less sparkline with end dot along the bottom | `StatCard` (`basalt-ui`) + `sparkline` slot with `Sparkline` (`basalt-ui/charts`) | A bare number in a box |
23
- | Progress to a target | Filled track, target tick, end captions; extra cut-offs as `ticks` | `Meter` (`basalt-ui`) with `target`, `ticks` | A hand-rolled progress bar |
24
- | Committed vs forecast | Two segments, the forecast lighter, a tick and a caption at the boundary | `Meter` `segments`, `forecastCaption` | Two cards |
25
- | Headline ratio where the shape is the message | Ring, value centred, one per row | `Meter shape="ring"` | A donut plus a total card |
26
- | Reading in named bands (low / ok / high) | Zoned bar with the reading as a marker; each zone names its `short` label for a narrow track; `ticks` mark cut-offs or a window mean | `Meter` `zones`, `ticks` | Colour-only thresholds |
27
- | Part of a whole, 2–6 parts | One segmented bar, parts in order, captions under the segments | `Meter` `segments`; `Bars` stacked | A row of N `StatCard`s; a donut |
28
- | Part of a whole when the parts are the page's subject | Donut | `Donut` (`basalt-ui/charts`) | Donut beside a total card |
29
- | Ranked list, top N (5–10) | Label, bar on a shared scale, right-aligned value | `BarList` (`basalt-ui`), its default thin-track rows | A table with a `%` column |
30
- | Value over time | Line; stacked area for parts of a total | `Lines` / `StackedArea` in a `ChartCard` | A bar per day |
31
- | Spend over a period against a budget | Cumulative line against the budget line; the forecast end labelled with its figure and date, the budget crossing labelled. Strip form: `Meter` with the reading at the fill end and the target figure on the tick via `caption` | `Lines` + `refLines` in a `ChartCard`; `Meter` `target`, `ticks` | A daily bar per day; an unlabelled forecast |
32
- | Compare categories | Bars | `Bars layout="grouped"` in a `ChartCard` | A pie |
33
- | Distribution as a slot micro-visual (`StatCard`, strip cell) | Small axis-less histogram | `Bars`, no axes, in the slot | A mean alone |
34
- | Distribution as a card's subject | One bar per bin, x labelled with the bin range ("€0–50"), y axis optional | `Bars` in a `ChartCard` | A mean alone; an axis-less histogram |
35
- | Status over time | Band strip; heat grid for daily data | `BandStrip` / `Heatmap` (`basalt-ui/charts`) | A table of dates |
36
- | Categorical status per cell (up, degraded, down) | Flat status fills; a glyph on warn and bad, never hue alone | `Heatmap` `states` with a `tone` each, no hex; `BandStrip` `glyph` | A hue-only grid |
37
- | A set of KPIs about one record | One joined surface, cells split by hairlines | `StatGroup variant="strip"` | N unrelated cards |
38
- | Many rows, several attributes | Table, right-aligned figures | `BasaltDataTable` (`basalt-ui/table`) | Cards per row |
39
- | Nothing yet / failed | Why and what to do | `EmptyState`, or the component's own `query` state | "No data" |
22
+ | Data shape | Encoding | basalt export (import path) | Not this |
23
+ | ------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
24
+ | Single value with a trend | Figure, text delta, `qualifier`, axis-less sparkline with end dot along the bottom | `StatCard` (`basalt-ui`) + `sparkline` slot with `Sparkline` (`basalt-ui/charts`) | A bare number in a box |
25
+ | Progress to a target | Filled track, target tick, end captions; extra cut-offs as `ticks` | `Meter` (`basalt-ui`) with `target`, `ticks` | A hand-rolled progress bar |
26
+ | Committed vs forecast | Two segments, the forecast lighter, a tick and a caption at the boundary | `Meter` `segments`, `forecastCaption` | Two cards |
27
+ | Headline ratio where the shape is the message | Ring, value centred, one per row | `Meter shape="ring"` | A donut plus a total card |
28
+ | Reading in named bands (low / ok / high) | Zoned bar with the reading as a marker; each zone names its `short` label for a narrow track; `ticks` mark cut-offs or a window mean | `Meter` `zones`, `ticks` | Colour-only thresholds |
29
+ | Part of a whole, 2–6 parts | One segmented bar, parts in order, a series `color` per part (`tone: 'muted'` is one shared fill: an "Other" tail only), captions under the segments | `Meter` `segments`; `Bars` stacked | A row of N `StatCard`s; a donut |
30
+ | Part of a whole when the parts are the page's subject | Donut | `Donut` (`basalt-ui/charts`) | Donut beside a total card |
31
+ | Ranked list, top N (5–10) | Label, bar on a shared scale, right-aligned value | `BarList` (`basalt-ui`), its default thin-track rows | A table with a `%` column |
32
+ | Event sequence (activity, history) | Day groups, actor and sentence, then a line leading with the time; a rail for a record's timeline | `EventList` (`basalt-ui`), `density="feed"` or `"timeline"` | A table with a date column |
33
+ | Value over time | Line; stacked area for parts of a total | `Lines` / `StackedArea` in a `ChartCard` | A bar per day |
34
+ | Spend over a period against a budget | Cumulative line against the budget line; the forecast end labelled with its figure and date, the budget crossing labelled. Strip form: `Meter` with the reading at the fill end and the target figure on the tick via `caption` | `Lines` + `refLines` in a `ChartCard`; `Meter` `target`, `ticks` | A daily bar per day; an unlabelled forecast |
35
+ | Compare categories | Bars | `Bars layout="grouped"` in a `ChartCard` | A pie |
36
+ | Distribution as a slot micro-visual (`StatCard`, strip cell) | Small axis-less histogram | `Bars`, no axes, in the slot | A mean alone |
37
+ | Distribution as a card's subject | One bar per bin, x labelled with the bin range ("€0–50"), y axis optional | `Bars` in a `ChartCard` | A mean alone; an axis-less histogram |
38
+ | Status over time | Band strip; heat grid for daily data | `BandStrip` / `Heatmap` (`basalt-ui/charts`) | A table of dates |
39
+ | Categorical status per cell (up, degraded, down) | Flat status fills; a glyph on warn and bad, never hue alone | `Heatmap` `states` with a `tone` each, no hex; `BandStrip` `glyph` | A hue-only grid |
40
+ | A set of KPIs about one record | One joined surface, cells split by hairlines | `StatGroup variant="strip"` | N unrelated cards |
41
+ | Many rows, several attributes | Table, right-aligned figures | `BasaltDataTable` (`basalt-ui/table`) | Cards per row |
42
+ | Record facts in a table row | Cell kinds: entity (avatar + name, no wrap), status chip, right-aligned figure, relative time, inline meter | `BasaltDataTable` column `meta.kind` | Text in every cell |
43
+ | A geographic field: a raster or grid of values over an area, read as a pattern | A map canvas filling its card flush (the Mantine flush card variant), with a key rail at its edge (beside it or overlaid): the colour ramp, its unit and 3–5 labelled stops; the time scrubber and any legend float over the canvas as panels, whose radius steps down by itself | The map library's canvas in that card; `height: var(--basalt-main-content-h)` for a page-high map | A choropleth of a few regions; a point set; a ramp with no unit or stops |
44
+ | Work items by status (columns with counts) | Columns with a count each, cards inside | `Board` (`basalt-ui`) | A table with a status column; a chart of counts |
45
+ | A record, a pending decision, an entity or a list row | The recipe in `recipes.md` | `StatGroup`, `EventList`, `PageAside`, `PageSummary` (`basalt-ui`) | A card per section; a hand-rolled facts layout |
46
+ | Nothing yet / failed | Why and what to do | `EmptyState`, or the component's own `query` state | "No data" |
40
47
 
41
48
  Sections that sit side by side use one title size; a `Section` beside a `ChartCard` does not step a size down.
42
49
 
50
+ A `Section` has no surface of its own. A lone `BarList`, `EventList` or `Meter` in a grid beside `ChartCard`s goes in a `ChartCard` (`placeholderHeight="content"`), so the row reads as one surface level; a `Section` holding several figures or cards stays flat.
51
+
43
52
  ## Not shipped — report the gap, don't hand-roll
44
53
 
45
- | Shape | Missing |
46
- | -------------------------------------------------------------------- | -------------- |
47
- | Event sequence (day groups, time pinned right) | `EventList` |
48
- | Work items by status (columns with counts) | `Board` |
49
- | Record page (header, facts line, strip, events) and list-row recipes | recipes only |
50
- | Bounded score inside a row | tick meter |
51
- | Daily data over months with month labels | calendar grid |
52
- | Gapless histogram with bin-edge ticks | histogram kind |
54
+ | Shape | Missing |
55
+ | ---------------------------------------- | -------------- |
56
+ | Bounded score inside a row | tick meter |
57
+ | Daily data over months with month labels | calendar grid |
58
+ | Gapless histogram with bin-edge ticks | histogram kind |
@@ -0,0 +1,47 @@
1
+ # Recipes
2
+
3
+ Shapes composed from shipped exports, not components of their own. Compose them; never hand-roll a variant. A recipe is promoted to a component only when two apps converge on it. Routing by data shape lives in `catalogue.md`.
4
+
5
+ ## Record page
6
+
7
+ `StatGroup variant="strip"` under the header, `EventList` under the decision card, `PageAside` for the rest.
8
+
9
+ header: avatar tile · title · ≤2 Badges · one mono facts line · actions right
10
+ strip: StatGroup variant="strip"
11
+ main: pending decision card, then EventList (rail density for a timeline)
12
+ aside: PageAside
13
+
14
+ Not this: a card per section, or facts spread over the header, strip and aside.
15
+
16
+ ## Decision card
17
+
18
+ The question is the headline (`md`, 500). Facts sit under it on one `xs` muted line, `·`-separated. Evidence goes in an inset panel on `VX.surface.field` with the control radius. The action row holds one filled primary, one subtle secondary and one quiet (menu or ghost), each with a key hint.
19
+
20
+ Not this: a topic title as the headline, or three filled buttons.
21
+
22
+ ## Entity card
23
+
24
+ A card whose header is avatar, name and a status badge. Under it a 2×2 `StatGroup variant="strip"` (caption, value, unit per cell), then one status line ("Now …").
25
+
26
+ Not this: a bespoke facts layout per entity kind.
27
+
28
+ ## Distribution in a card
29
+
30
+ One `Bars` in a `ChartCard`: one bar per level on a shared scale, the level's series colour as the swatch, the count right-aligned at the bar's end. 2–6 parts of one whole: `Meter` `segments` with captions instead, each part a series `color` (muted parts share one fill and read as one slab).
31
+
32
+ Not this: a hand-built swatch-and-count list, or a donut when the parts are not the page's subject.
33
+
34
+ ## Page summary
35
+
36
+ `PageSummary`: a headline, then one sentence carrying at least one live number ("3 decisions pending, oldest 4 d"). No sentence without a number.
37
+
38
+ Not this: a prose welcome line, or a figure the summary leads with restated as a second card.
39
+
40
+ ## List row
41
+
42
+ Leading glyph, title, one muted meta line, a trailing affordance (chevron, count or menu). Inset 6 × 8, control radius, hover on the neutral ink step.
43
+
44
+ [glyph] Title ›
45
+ meta · meta
46
+
47
+ Not this: inline SVG icons with custom CSS per panel, or a second meta line.
@@ -12,7 +12,7 @@ Every empty, loading and error state answers two things: why, and what the reade
12
12
 
13
13
  One wording per repeated gap: the same missing source reads the same on every card that depends on it. Write it once and pass it to each (`emptyText`, `ChartCard` `state`), never rephrase per card.
14
14
 
15
- The default error title is a bare "Could not load" and relies on the host's title naming the thing; outside a titled host the title must name it ("Could not load <thing>"): `QueryState.errorTitle` / `QueryState.errorFallback`, `ErrorState.title` / `ErrorState.fallback`, and `ChartCard` `stateNoun` on a chart. "The request failed." is the fallback only, never a cause: the real cause is the server message or the fallback prop. The table's empty default ("No data to display.") is a fallback too; pass `emptyState` with the cause and the next step.
15
+ A titled host names the thing itself (`StatCard`, a strip cell, `ChartCard`, the data table: "Could not load revenue" from the title). A `Section` names a nested error too (its `query`, or a `QueryState.errorTitle`-less one in its body); outside a titled host the title must name it ("Could not load <thing>"): `QueryState.errorTitle` / `QueryState.errorFallback`, `ErrorState.title` / `ErrorState.fallback`, and `ChartCard` `stateNoun` on a chart. "The request failed." is the fallback only, never a cause: the real cause is the server message or the fallback prop. The table's empty default ("No data to display.") is a fallback too; pass `emptyState` with the cause and the next step.
16
16
 
17
17
  ## Do / don't, on three shapes
18
18
 
@@ -22,6 +22,7 @@
22
22
  "basalt/agent-no-raw-usechat": "error",
23
23
  "basalt/ai-sdk-major": "error",
24
24
  "basalt/raw-breakpoint": "error",
25
- "basalt/route-view-transition": "error"
25
+ "basalt/route-view-transition": "error",
26
+ "basalt/status-fill-as-text": "error"
26
27
  }
27
28
  }
@@ -152,6 +152,7 @@ export const KNOWN_RULE_IDS = new Set([
152
152
  'raw-breakpoint',
153
153
  'no-dev-helper',
154
154
  'route-view-transition',
155
+ 'status-fill-as-text',
155
156
  // These two honour `basalt-agent-allow`, never `theme-allow` — but they are real ids, so an
156
157
  // annotation naming one must parse as a (useless) scoped annotation rather than as prose.
157
158
  'agent-no-raw-usechat',
@@ -600,7 +601,8 @@ export const CARD_INSET_PX = 'md'
600
601
  const CARD_INSET_MESSAGE =
601
602
  'Card/Paper is off the card idiom — the theme owns the 12/16 inset and radius, so write no ' +
602
603
  'p/padding/py/px/radius. Flush whole card: variant="flush"; full-bleed region in a padded card: ' +
603
- '<Card.Section>; a deliberate exception: {/* theme-allow card-inset — reason */}. (basalt/card-inset)'
604
+ '<Card.Section>; a deliberate exception: {/* theme-allow card-inset — reason */}. The older ' +
605
+ 'py="xs" px="sm" idiom is off-idiom too — delete it. (basalt/card-inset)'
604
606
  const CARD_INSET_REDUNDANT_MESSAGE =
605
607
  'Card/Paper inset is redundant — the theme owns it (12/16, density-scaled); delete ' +
606
608
  'py="sm" px="md". (basalt/card-inset)'
@@ -2709,6 +2711,9 @@ export const CTL_THEME_TAGS = new Set([
2709
2711
  'MultiSelect',
2710
2712
  'SegmentedControl',
2711
2713
  'NativeSelect',
2714
+ 'NumberInput',
2715
+ 'PasswordInput',
2716
+ 'Textarea',
2712
2717
  'Radio',
2713
2718
  'RadioGroup',
2714
2719
  'Checkbox',
@@ -2720,8 +2725,8 @@ export const CTL_THEME_TAGS = new Set([
2720
2725
  /**
2721
2726
  * A size/width/breakpoint prop on a control the slot theme tiers. The slot's hoisted
2722
2727
  * `MantineThemeProvider` already resolves the tier with no prop. A `SettingsRow`'s `control` is NOT
2723
- * a tiered slot (see {@link SLOT_ATTRS}): a form row keeps Mantine's `md`, so the `size` written
2724
- * there is load-bearing rather than redundant.
2728
+ * a tiered slot for this rule (see {@link SLOT_ATTRS}): it mounts its own `CtlSlot` (Wave 46), but a
2729
+ * `size="md"` written there is the documented opt-out back to Mantine's `md`, so it stays legal.
2725
2730
  *
2726
2731
  * Scoped to `RAW_FILTER_TAGS` ∪ `BOUND_TAGS` (basalt's own controls, by name) ∪ a Mantine-imported
2727
2732
  * {@link CTL_THEME_TAGS} member, and skipped under an overlay ({@link hostedInsideSlot}) — see
@@ -4208,6 +4213,109 @@ const routeViewTransition = {
4208
4213
  },
4209
4214
  }
4210
4215
 
4216
+ // ── Rule 36 — status-fill-as-text ───────────────────────────────────────────────────────────────
4217
+
4218
+ const STATUS_FILL_AS_TEXT_MESSAGE =
4219
+ 'VX.status.excellent is a FILL (about 3:1 on a light card) and fails AA as text. Paint zone words and ' +
4220
+ 'numerals with VX.status.good (solved to AA) and keep excellent on a swatch, band or heatmap ' +
4221
+ 'cell (bg / fill / backgroundColor). (basalt/status-fill-as-text)'
4222
+
4223
+ const EXCELLENT_CSS_VAR = /var\(\s*--vx-status-excellent\b/
4224
+
4225
+ /** Strips parentheses-equivalent wrappers: TS `as` / `satisfies` / `!` and the JSX expression container. */
4226
+ function unwrapExpression(node) {
4227
+ let current = unwrapExpressionContainer(node)
4228
+ while (
4229
+ current &&
4230
+ (current.type === 'TSAsExpression' ||
4231
+ current.type === 'TSSatisfiesExpression' ||
4232
+ current.type === 'TSNonNullExpression' ||
4233
+ current.type === 'ParenthesizedExpression')
4234
+ ) {
4235
+ current = current.expression
4236
+ }
4237
+ return current
4238
+ }
4239
+
4240
+ /** True when `node` is `VX.status.excellent` or the string `var(--vx-status-excellent)`. */
4241
+ function isExcellentToken(node) {
4242
+ if (node?.type === 'MemberExpression' && !node.computed) {
4243
+ const status = node.object
4244
+ return (
4245
+ node.property?.name === 'excellent' &&
4246
+ status?.type === 'MemberExpression' &&
4247
+ !status.computed &&
4248
+ status.property?.name === 'status' &&
4249
+ status.object?.type === 'Identifier' &&
4250
+ status.object.name === 'VX'
4251
+ )
4252
+ }
4253
+ if (isStringLiteral(node)) return EXCELLENT_CSS_VAR.test(node.value)
4254
+ if (node?.type === 'TemplateLiteral') {
4255
+ return node.quasis.some((quasi) => EXCELLENT_CSS_VAR.test(quasi.value.cooked ?? ''))
4256
+ }
4257
+ return false
4258
+ }
4259
+
4260
+ /** True when any value `node` can evaluate to (through ternaries and `??` / `||` / `&&`) is the token. */
4261
+ function mayBeExcellentToken(node) {
4262
+ const value = unwrapExpression(node)
4263
+ if (value?.type === 'ConditionalExpression') {
4264
+ return mayBeExcellentToken(value.consequent) || mayBeExcellentToken(value.alternate)
4265
+ }
4266
+ if (value?.type === 'LogicalExpression') {
4267
+ return mayBeExcellentToken(value.left) || mayBeExcellentToken(value.right)
4268
+ }
4269
+ return isExcellentToken(value)
4270
+ }
4271
+
4272
+ /** True when an object literal is, or sits inside, the value of a `style` / `styles` JSX prop. */
4273
+ function insideStyleProp(objectNode) {
4274
+ for (let up = objectNode.parent; up; up = up.parent) {
4275
+ if (up.type === 'JSXAttribute') {
4276
+ return (
4277
+ up.name?.type === 'JSXIdentifier' && (up.name.name === 'style' || up.name.name === 'styles')
4278
+ )
4279
+ }
4280
+ if (up.type === 'JSXElement' || up.type === 'Program') return false
4281
+ }
4282
+ return false
4283
+ }
4284
+
4285
+ // A static check: it sees the token written at the text position, not a map read later
4286
+ // (`c={ZONE_COLORS[grade]}`). `color=` is deliberately not judged — on a Mantine Badge/Button/
4287
+ // ThemeIcon or a chart mark it is a fill — so a `<Text color=…>` / `<Title color=…>` is a known
4288
+ // false negative. Only `c=` and a `color:` key under a `style`/`styles` prop are text: the key is
4289
+ // the CSS `color` property, so it paints text on whichever part it sits (`styles={{ section: … }}`
4290
+ // included).
4291
+ // Ships: error
4292
+ const statusFillAsText = {
4293
+ meta: {
4294
+ type: 'problem',
4295
+ docs: {
4296
+ description: 'Disallow the fill-only VX.status.excellent in a text-colour position.',
4297
+ },
4298
+ schema: [],
4299
+ },
4300
+ create(context) {
4301
+ if (isTestFile(context)) return {}
4302
+ const report = (node) => {
4303
+ if (hasThemeAllow(context, node, 'status-fill-as-text')) return
4304
+ context.report({ node, message: STATUS_FILL_AS_TEXT_MESSAGE })
4305
+ }
4306
+ return {
4307
+ JSXAttribute(node) {
4308
+ if (node.name?.type !== 'JSXIdentifier' || node.name.name !== 'c') return
4309
+ if (node.value && mayBeExcellentToken(node.value)) report(node)
4310
+ },
4311
+ Property(node) {
4312
+ if (propertyKeyName(node) !== 'color' || !mayBeExcellentToken(node.value)) return
4313
+ if (node.parent?.type === 'ObjectExpression' && insideStyleProp(node.parent)) report(node)
4314
+ },
4315
+ }
4316
+ },
4317
+ }
4318
+
4211
4319
  // ── Grace ledger ────────────────────────────────────────────────────────────────────────────────
4212
4320
 
4213
4321
  /**
@@ -4269,5 +4377,6 @@ export default {
4269
4377
  'raw-breakpoint': rawBreakpoint,
4270
4378
  'no-dev-helper': noDevHelper,
4271
4379
  'route-view-transition': routeViewTransition,
4380
+ 'status-fill-as-text': statusFillAsText,
4272
4381
  },
4273
4382
  }
@@ -71,6 +71,7 @@ beforeEach(() => {
71
71
  'basalt/raw-breakpoint': 'error',
72
72
  'basalt/no-dev-helper': 'error',
73
73
  'basalt/route-view-transition': 'error',
74
+ 'basalt/status-fill-as-text': 'error',
74
75
  },
75
76
  }),
76
77
  )
@@ -1875,9 +1876,10 @@ describe('basalt/hand-rolled-filter', () => {
1875
1876
  expect(rules).not.toContain('hand-rolled-filter')
1876
1877
  })
1877
1878
 
1878
- // The settled reading of law C1's THIRD home (docs/CONTROLS-SPEC.md §5/§6): a form row keeps
1879
- // Mantine's `md` tier, so a raw input bound to a setting is right there — and `control` /
1880
- // `SettingsRow` are absent from the slot set for exactly that reason.
1879
+ // The settled reading of law C1's THIRD home (docs/CONTROLS-SPEC.md §5/§6): a form row is not a
1880
+ // chrome slot, so a raw input bound to a setting is right there (it mounts its own `CtlSlot` since
1881
+ // Wave 46, and a `size` on the control is the opt-out) — `control` / `SettingsRow` are absent from
1882
+ // the slot set for exactly that reason.
1881
1883
  it("does NOT flag a raw Select in a SettingsRow's control — the form-row home", () => {
1882
1884
  const { code, rules } = run(
1883
1885
  `${BASALT_IMPORT}${MANTINE_IMPORT}export const C = () => (\n <SettingsSection title="S">\n <SettingsRow label="Channel" control={<Select data={[]} />} />\n </SettingsSection>\n)\n`,
@@ -2645,7 +2647,7 @@ describe('basalt/control-size-literal', () => {
2645
2647
  expect(rules).toContain('control-size-literal')
2646
2648
  })
2647
2649
 
2648
- it("does NOT flag a size prop in a SettingsRow's control — the form tier is Mantine's md", () => {
2650
+ it('does NOT flag a size prop in a SettingsRow\'s control — it is a form row, and size="md" is the opt-out of its ctl tier', () => {
2649
2651
  const { code, rules } = run(
2650
2652
  `${MANTINE_IMPORT}export const C = () => (\n <SettingsRow label="L" control={<Button size="compact-sm">Go</Button>} />\n)\n`,
2651
2653
  )
@@ -4281,6 +4283,99 @@ describe('basalt/route-view-transition', () => {
4281
4283
  })
4282
4284
  })
4283
4285
 
4286
+ // ── status-fill-as-text ──────────────────────────────────────────────────────
4287
+
4288
+ describe('basalt/status-fill-as-text', () => {
4289
+ const VXI = `import { VX } from 'basalt-ui/tokens'\n`
4290
+ it.each([
4291
+ [
4292
+ 'c= on a Text',
4293
+ `${VXI}export const C = () => <Text c={VX.status.excellent}>Excellent</Text>\n`,
4294
+ ],
4295
+ [
4296
+ 'c= with the CSS var',
4297
+ `export const C = () => <Text c="var(--vx-status-excellent)">x</Text>\n`,
4298
+ ],
4299
+ [
4300
+ 'c= through a ternary',
4301
+ `${VXI}export const C = (p: { ok: boolean }) => <Text c={p.ok ? VX.status.excellent : VX.status.warn}>x</Text>\n`,
4302
+ ],
4303
+ [
4304
+ 'a style color key',
4305
+ `${VXI}export const C = () => <span style={{ color: VX.status.excellent }}>x</span>\n`,
4306
+ ],
4307
+ [
4308
+ 'a styles-prop color key',
4309
+ `${VXI}export const C = () => <Badge styles={{ label: { color: VX.status.excellent } }}>x</Badge>\n`,
4310
+ ],
4311
+ [
4312
+ 'a nested styles key on a non-text part (the CSS color property paints its text)',
4313
+ `${VXI}export const C = () => <Progress styles={{ section: { color: VX.status.excellent } }} />\n`,
4314
+ ],
4315
+ [
4316
+ 'a style color with the CSS var',
4317
+ `export const C = () => <span style={{ color: 'var(--vx-status-excellent)' }}>x</span>\n`,
4318
+ ],
4319
+ ])('flags %s', (_name, source) => {
4320
+ const { code, rules } = run(source, 'lib.tsx')
4321
+ expect(code).toBe(1)
4322
+ expect(rules).toContain('status-fill-as-text')
4323
+ })
4324
+
4325
+ it.each([
4326
+ ['bg=', `${VXI}export const C = () => <Box bg={VX.status.excellent} />\n`],
4327
+ [
4328
+ 'a swatch backgroundColor',
4329
+ `${VXI}export const C = () => <i style={{ backgroundColor: VX.status.excellent }} />\n`,
4330
+ ],
4331
+ [
4332
+ 'a style borderColor',
4333
+ `${VXI}export const C = () => <i style={{ borderColor: VX.status.excellent }} />\n`,
4334
+ ],
4335
+ [
4336
+ 'fill= and stroke=',
4337
+ `${VXI}export const C = () => <rect fill={VX.status.excellent} stroke={VX.status.excellent} />\n`,
4338
+ ],
4339
+ [
4340
+ 'alpha() on a fill',
4341
+ `${VXI}export const C = () => <Box bg={alpha(VX.status.excellent, 0.2)} />\n`,
4342
+ ],
4343
+ [
4344
+ 'c= with the solved text token',
4345
+ `${VXI}export const C = () => <Text c={VX.status.good}>x</Text>\n`,
4346
+ ],
4347
+ [
4348
+ 'a chart series color key',
4349
+ `${VXI}export const S = { zone: { color: VX.status.excellent } }\n`,
4350
+ ],
4351
+ [
4352
+ 'a Badge color prop (fill)',
4353
+ `${VXI}export const C = () => <Badge color={VX.status.excellent}>x</Badge>\n`,
4354
+ ],
4355
+ [
4356
+ 'a Progress/Badge color prop and its styles background (fills)',
4357
+ `${VXI}export const C = () => <Progress color={VX.status.excellent} styles={{ section: { backgroundColor: VX.status.excellent } }} />\n`,
4358
+ ],
4359
+ // Out of static reach: argo's ZONE_COLORS map, read later — `c={ZONE_COLORS[grade]}`.
4360
+ [
4361
+ 'a map value consumed through a lookup (statically out of reach)',
4362
+ `${VXI}const ZONE_COLORS = { excellent: VX.status.excellent } as const\nexport const C = () => <Text c={ZONE_COLORS.excellent}>x</Text>\n`,
4363
+ ],
4364
+ ])('does NOT flag %s', (_name, source) => {
4365
+ expect(run(source, 'lib.tsx').rules).not.toContain('status-fill-as-text')
4366
+ })
4367
+
4368
+ it('does not apply in test files', () => {
4369
+ const source = `${VXI}export const C = () => <Text c={VX.status.excellent}>x</Text>\n`
4370
+ expect(run(source, 'lib.test.tsx').rules).not.toContain('status-fill-as-text')
4371
+ })
4372
+
4373
+ it('honours a theme-allow annotation naming the rule', () => {
4374
+ const source = `${VXI}export const C = () => (\n // theme-allow status-fill-as-text: decorative large display numeral\n <Text c={VX.status.excellent}>x</Text>\n)\n`
4375
+ expect(run(source, 'lib.tsx').rules).not.toContain('status-fill-as-text')
4376
+ })
4377
+ })
4378
+
4284
4379
  describe('rule level locks', () => {
4285
4380
  const levels = (path: string) =>
4286
4381
  (JSON.parse(readFileSync(path, 'utf8')) as { rules: Record<string, unknown> }).rules
@@ -33,6 +33,7 @@
33
33
  "react/set-state-in-effect": "error",
34
34
  "no-constant-binary-expression": "error"
35
35
  },
36
+ "ignorePatterns": [".claude/worktrees/**"],
36
37
  "overrides": [
37
38
  {
38
39
  "files": ["**/*.{ts,tsx}"],