basalt-ui 3.0.0 → 3.1.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 (512) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +72 -39
  3. package/MIGRATING.md +44 -2
  4. package/README.md +39 -12
  5. package/agent/rules/basalt-tokens.md +1 -1
  6. package/agent/rules/basalt-ui.md +3 -3
  7. package/agent/skills/basalt-app/references/live.md +4 -4
  8. package/agent/skills/basalt-app/references/migrate.md +2 -2
  9. package/agent/skills/basalt-app/references/setup.md +17 -8
  10. package/agent/skills/basalt-app/references/testing.md +8 -6
  11. package/agent/skills/basalt-design/SKILL.md +2 -1
  12. package/agent/skills/basalt-design/references/controls.md +1 -0
  13. package/agent/skills/basalt-design/references/parts.md +5 -1
  14. package/agent/templates/AGENTS-block.md.tpl +6 -23
  15. package/agent/templates/AGENTS-block.site.md.tpl +5 -18
  16. package/agent/templates/AGENTS-block.tokens.md.tpl +3 -7
  17. package/agent/templates/DESIGN.md.tpl +1 -1
  18. package/agent/templates/_app-error.i18n.tpl +8 -32
  19. package/agent/templates/_app-error.tpl +8 -32
  20. package/agent/templates/_app-pending.i18n.tpl +5 -3
  21. package/agent/templates/_app-pending.tpl +5 -4
  22. package/agent/templates/main.i18n.tpl +8 -3
  23. package/agent/templates/main.tpl +8 -3
  24. package/agent/templates/router.start.tpl +8 -3
  25. package/agent/templates/seed-messages.json +0 -30
  26. package/configs/oxlint-app.json +9 -1
  27. package/configs/oxlint-bridge.json +3 -1
  28. package/configs/oxlint-parts.json +9 -1
  29. package/configs/oxlint-site.json +3 -1
  30. package/dist/astro/shiki.d.ts +3 -2
  31. package/dist/astro/shiki.d.ts.map +1 -1
  32. package/dist/cards/bar-list.d.ts.map +1 -1
  33. package/dist/cards/bar-list.js +2 -1
  34. package/dist/cards/chain-view.d.ts +37 -8
  35. package/dist/cards/chain-view.d.ts.map +1 -1
  36. package/dist/cards/chain-view.js +105 -38
  37. package/dist/cards/contract.d.ts +8 -1
  38. package/dist/cards/contract.d.ts.map +1 -1
  39. package/dist/cards/data-panel.d.ts.map +1 -1
  40. package/dist/cards/data-panel.js +1 -0
  41. package/dist/cards/event-list.d.ts.map +1 -1
  42. package/dist/cards/event-list.js +3 -2
  43. package/dist/cards/index.d.ts +1 -1
  44. package/dist/cards/index.d.ts.map +1 -1
  45. package/dist/cards/row-list.d.ts.map +1 -1
  46. package/dist/cards/row-list.js +2 -1
  47. package/dist/cards/stat-card-parts.d.ts +3 -3
  48. package/dist/cards/stat-card-parts.d.ts.map +1 -1
  49. package/dist/cards/stat-card-parts.js +8 -2
  50. package/dist/cards/stat-card.d.ts.map +1 -1
  51. package/dist/cards/stat-card.js +34 -9
  52. package/dist/charts/core/compile.d.ts +2 -0
  53. package/dist/charts/core/compile.d.ts.map +1 -1
  54. package/dist/charts/core/compile.js +16 -8
  55. package/dist/charts/core/cursor.d.ts +2 -1
  56. package/dist/charts/core/cursor.d.ts.map +1 -1
  57. package/dist/charts/core/cursor.js +8 -1
  58. package/dist/charts/core/tooltip-said.d.ts +16 -0
  59. package/dist/charts/core/tooltip-said.d.ts.map +1 -0
  60. package/dist/charts/core/tooltip-said.js +39 -0
  61. package/dist/charts/focus.d.ts.map +1 -1
  62. package/dist/charts/focus.js +1 -1
  63. package/dist/charts/parts/chart-card.d.ts.map +1 -1
  64. package/dist/charts/parts/chart-card.js +1 -0
  65. package/dist/cli/agent-note.d.ts +3 -3
  66. package/dist/cli/agent-note.d.ts.map +1 -1
  67. package/dist/cli/agent-note.js +5 -5
  68. package/dist/cli/budget/index.d.ts +7 -0
  69. package/dist/cli/budget/index.d.ts.map +1 -1
  70. package/dist/cli/budget/index.js +11 -5
  71. package/dist/cli/config.d.ts +1 -1
  72. package/dist/cli/doctor/app.d.ts.map +1 -1
  73. package/dist/cli/doctor/app.js +53 -24
  74. package/dist/cli/doctor/eject.d.ts.map +1 -1
  75. package/dist/cli/doctor/eject.js +16 -9
  76. package/dist/cli/doctor/guards.d.ts.map +1 -1
  77. package/dist/cli/doctor/guards.js +11 -8
  78. package/dist/cli/doctor/hook.js +1 -1
  79. package/dist/cli/doctor/install.d.ts.map +1 -1
  80. package/dist/cli/doctor/install.js +46 -22
  81. package/dist/cli/doctor/translations.d.ts.map +1 -1
  82. package/dist/cli/doctor/translations.js +11 -4
  83. package/dist/cli/doctor/types.d.ts +2 -2
  84. package/dist/cli/doctor/types.d.ts.map +1 -1
  85. package/dist/cli/doctor/types.js +1 -1
  86. package/dist/cli/doctor/wiring.d.ts.map +1 -1
  87. package/dist/cli/doctor/wiring.js +26 -15
  88. package/dist/cli/eject/dropped-slots.d.ts +6 -0
  89. package/dist/cli/eject/dropped-slots.d.ts.map +1 -0
  90. package/dist/cli/eject/dropped-slots.js +9 -0
  91. package/dist/cli/eject/index.d.ts.map +1 -1
  92. package/dist/cli/eject/index.js +9 -8
  93. package/dist/cli/help.d.ts.map +1 -1
  94. package/dist/cli/help.js +7 -2
  95. package/dist/cli/index.d.ts +6 -5
  96. package/dist/cli/index.d.ts.map +1 -1
  97. package/dist/cli/index.js +38 -7
  98. package/dist/cli/init/index.d.ts +10 -0
  99. package/dist/cli/init/index.d.ts.map +1 -1
  100. package/dist/cli/init/index.js +61 -10
  101. package/dist/cli/init/locales.d.ts +7 -0
  102. package/dist/cli/init/locales.d.ts.map +1 -1
  103. package/dist/cli/init/locales.js +21 -6
  104. package/dist/cli/init/router-seeds.d.ts.map +1 -1
  105. package/dist/cli/init/router-seeds.js +16 -3
  106. package/dist/cli/init/steps.d.ts +36 -3
  107. package/dist/cli/init/steps.d.ts.map +1 -1
  108. package/dist/cli/init/steps.js +201 -34
  109. package/dist/cli/lint/baseline.d.ts +27 -0
  110. package/dist/cli/lint/baseline.d.ts.map +1 -0
  111. package/dist/cli/lint/baseline.js +96 -0
  112. package/dist/cli/lint/engine.d.ts +2 -0
  113. package/dist/cli/lint/engine.d.ts.map +1 -1
  114. package/dist/cli/lint/engine.js +18 -8
  115. package/dist/cli/lint/hook.d.ts.map +1 -1
  116. package/dist/cli/lint/hook.js +8 -3
  117. package/dist/cli/lint/index.d.ts +3 -0
  118. package/dist/cli/lint/index.d.ts.map +1 -1
  119. package/dist/cli/lint/index.js +67 -8
  120. package/dist/cli/manifest.d.ts +46 -3
  121. package/dist/cli/manifest.d.ts.map +1 -1
  122. package/dist/cli/manifest.js +71 -1
  123. package/dist/cli/migrate/census.d.ts +6 -0
  124. package/dist/cli/migrate/census.d.ts.map +1 -1
  125. package/dist/cli/migrate/census.js +22 -1
  126. package/dist/cli/migrate/index.d.ts +5 -0
  127. package/dist/cli/migrate/index.d.ts.map +1 -1
  128. package/dist/cli/migrate/index.js +36 -3
  129. package/dist/cli/migrate/lost-classes.d.ts +20 -0
  130. package/dist/cli/migrate/lost-classes.d.ts.map +1 -0
  131. package/dist/cli/migrate/lost-classes.js +145 -0
  132. package/dist/cli/migrate/rows.d.ts +10 -0
  133. package/dist/cli/migrate/rows.d.ts.map +1 -1
  134. package/dist/cli/migrate/rows.js +15 -0
  135. package/dist/cli/package-manager.d.ts.map +1 -1
  136. package/dist/cli/package-manager.js +2 -1
  137. package/dist/cli/peers.d.ts +2 -0
  138. package/dist/cli/peers.d.ts.map +1 -1
  139. package/dist/cli/peers.js +7 -0
  140. package/dist/cli/presets.d.ts.map +1 -1
  141. package/dist/cli/presets.js +27 -11
  142. package/dist/cli/resolver.d.ts +13 -4
  143. package/dist/cli/resolver.d.ts.map +1 -1
  144. package/dist/cli/resolver.js +39 -5
  145. package/dist/cli/router-wiring.d.ts +1 -0
  146. package/dist/cli/router-wiring.d.ts.map +1 -1
  147. package/dist/cli/router-wiring.js +1 -1
  148. package/dist/cli/sync/engine.d.ts +8 -1
  149. package/dist/cli/sync/engine.d.ts.map +1 -1
  150. package/dist/cli/sync/engine.js +25 -14
  151. package/dist/cli/sync/index.d.ts.map +1 -1
  152. package/dist/cli/sync/index.js +7 -4
  153. package/dist/cli/sync/render.d.ts.map +1 -1
  154. package/dist/cli/sync/render.js +21 -28
  155. package/dist/cli/tokens-css.d.ts +2 -0
  156. package/dist/cli/tokens-css.d.ts.map +1 -1
  157. package/dist/cli/tokens-css.js +28 -6
  158. package/dist/controls/contract.d.ts +2 -1
  159. package/dist/controls/contract.d.ts.map +1 -1
  160. package/dist/controls/control-home.d.ts +4 -1
  161. package/dist/controls/control-home.d.ts.map +1 -1
  162. package/dist/controls/control-home.js +5 -3
  163. package/dist/controls/local-control.d.ts +28 -1
  164. package/dist/controls/local-control.d.ts.map +1 -1
  165. package/dist/controls/local-control.js +14 -2
  166. package/dist/core/cn.d.ts.map +1 -1
  167. package/dist/core/cn.js +6 -5
  168. package/dist/core/frame-figure.d.ts +2 -0
  169. package/dist/core/frame-figure.d.ts.map +1 -1
  170. package/dist/core/frame-figure.js +5 -2
  171. package/dist/core/frame-head.d.ts +3 -1
  172. package/dist/core/frame-head.d.ts.map +1 -1
  173. package/dist/core/frame-head.js +28 -7
  174. package/dist/core/frame-regions.d.ts +1 -1
  175. package/dist/core/frame-regions.d.ts.map +1 -1
  176. package/dist/core/frame-regions.js +18 -8
  177. package/dist/core/info-hint.d.ts +5 -0
  178. package/dist/core/info-hint.d.ts.map +1 -1
  179. package/dist/core/info-hint.js +22 -1
  180. package/dist/core/mark-tone.d.ts +6 -2
  181. package/dist/core/mark-tone.d.ts.map +1 -1
  182. package/dist/core/mark-tone.js +1 -1
  183. package/dist/core/mark-types.d.ts +4 -2
  184. package/dist/core/mark-types.d.ts.map +1 -1
  185. package/dist/core/messages/chain.d.ts +2 -1
  186. package/dist/core/messages/chain.d.ts.map +1 -1
  187. package/dist/core/messages/chain.js +1 -0
  188. package/dist/core/messages/index.d.ts +2 -1
  189. package/dist/core/messages/index.d.ts.map +1 -1
  190. package/dist/core/messages/index.js +2 -0
  191. package/dist/core/messages/runs.d.ts +20 -0
  192. package/dist/core/messages/runs.d.ts.map +1 -0
  193. package/dist/core/messages/runs.js +18 -0
  194. package/dist/core/phase.d.ts +25 -2
  195. package/dist/core/phase.d.ts.map +1 -1
  196. package/dist/core/ports.d.ts +4 -1
  197. package/dist/core/ports.d.ts.map +1 -1
  198. package/dist/core/provider.d.ts +3 -1
  199. package/dist/core/provider.d.ts.map +1 -1
  200. package/dist/core/provider.js +5 -3
  201. package/dist/core/scheme.d.ts +2 -1
  202. package/dist/core/scheme.d.ts.map +1 -1
  203. package/dist/core/scheme.js +1 -0
  204. package/dist/core/spark/mini-bars.d.ts +6 -4
  205. package/dist/core/spark/mini-bars.d.ts.map +1 -1
  206. package/dist/core/spark/mini-bars.js +36 -11
  207. package/dist/core/spark/sparkline.d.ts +2 -2
  208. package/dist/core/spark/sparkline.d.ts.map +1 -1
  209. package/dist/core/spark/sparkline.js +21 -2
  210. package/dist/css/bridge.css +63 -0
  211. package/dist/css/generate.d.ts +2 -2
  212. package/dist/css/generate.d.ts.map +1 -1
  213. package/dist/css/generate.js +25 -0
  214. package/dist/data/live/live-query.d.ts +2 -2
  215. package/dist/data/live/live-query.d.ts.map +1 -1
  216. package/dist/data/live/live-query.js +2 -1
  217. package/dist/lint/preset.d.ts +12 -3
  218. package/dist/lint/preset.d.ts.map +1 -1
  219. package/dist/lint/preset.js +30 -10
  220. package/dist/lint/rules/class/table.d.ts.map +1 -1
  221. package/dist/lint/rules/class/table.js +3 -1
  222. package/dist/lint/rules/structure/control-home.js +1 -1
  223. package/dist/lint/rules/structure/import-boundary.d.ts.map +1 -1
  224. package/dist/lint/rules/structure/import-boundary.js +2 -0
  225. package/dist/lint/rules/structure/label-literal.d.ts.map +1 -1
  226. package/dist/lint/rules/structure/label-literal.js +1 -1
  227. package/dist/lint/shadcn.d.ts +562 -0
  228. package/dist/lint/shadcn.d.ts.map +1 -0
  229. package/dist/lint/shadcn.js +52 -0
  230. package/dist/lint/stylelint/render.d.ts +3 -1
  231. package/dist/lint/stylelint/render.d.ts.map +1 -1
  232. package/dist/lint/stylelint/render.js +23 -2
  233. package/dist/lint/stylelint/rules.d.ts +3 -2
  234. package/dist/lint/stylelint/rules.d.ts.map +1 -1
  235. package/dist/lint/stylelint/rules.js +11 -6
  236. package/dist/lint/weakened.d.ts +8 -0
  237. package/dist/lint/weakened.d.ts.map +1 -1
  238. package/dist/lint/weakened.js +44 -1
  239. package/dist/messages/de.d.ts.map +1 -1
  240. package/dist/messages/de.js +15 -0
  241. package/dist/messages/es.d.ts.map +1 -1
  242. package/dist/messages/es.js +15 -0
  243. package/dist/messages/fr.d.ts.map +1 -1
  244. package/dist/messages/fr.js +15 -0
  245. package/dist/messages/zh-hans.d.ts.map +1 -1
  246. package/dist/messages/zh-hans.js +15 -0
  247. package/dist/page/bar-title.d.ts +25 -0
  248. package/dist/page/bar-title.d.ts.map +1 -0
  249. package/dist/page/bar-title.js +10 -0
  250. package/dist/page/contract.d.ts +11 -1
  251. package/dist/page/contract.d.ts.map +1 -1
  252. package/dist/page/empty-state.d.ts +5 -2
  253. package/dist/page/empty-state.d.ts.map +1 -1
  254. package/dist/page/empty-state.js +14 -3
  255. package/dist/page/facts.d.ts +19 -2
  256. package/dist/page/facts.d.ts.map +1 -1
  257. package/dist/page/facts.js +26 -5
  258. package/dist/page/index.d.ts +8 -0
  259. package/dist/page/index.d.ts.map +1 -1
  260. package/dist/page/index.js +9 -0
  261. package/dist/page/page-bar.d.ts.map +1 -1
  262. package/dist/page/page-bar.js +2 -7
  263. package/dist/page/page-summary.d.ts +2 -1
  264. package/dist/page/page-summary.d.ts.map +1 -1
  265. package/dist/page/page-summary.js +1 -1
  266. package/dist/page/run-button.d.ts +26 -0
  267. package/dist/page/run-button.d.ts.map +1 -0
  268. package/dist/page/run-button.js +31 -0
  269. package/dist/page/run-list.d.ts +28 -0
  270. package/dist/page/run-list.d.ts.map +1 -0
  271. package/dist/page/run-list.js +88 -0
  272. package/dist/page/run-queue.d.ts +78 -0
  273. package/dist/page/run-queue.d.ts.map +1 -0
  274. package/dist/page/run-queue.js +93 -0
  275. package/dist/page/section.d.ts +6 -1
  276. package/dist/page/section.d.ts.map +1 -1
  277. package/dist/page/section.js +34 -16
  278. package/dist/shell/commands/command-palette.d.ts.map +1 -1
  279. package/dist/shell/commands/command-palette.js +5 -1
  280. package/dist/shell/parts/header.js +1 -1
  281. package/dist/surfaces.d.ts +15 -1
  282. package/dist/surfaces.d.ts.map +1 -1
  283. package/dist/surfaces.js +19 -2
  284. package/dist/testing/index.d.ts +1 -0
  285. package/dist/testing/index.d.ts.map +1 -1
  286. package/dist/testing/index.js +3 -0
  287. package/dist/testing/pseudo-locale.d.ts +41 -0
  288. package/dist/testing/pseudo-locale.d.ts.map +1 -0
  289. package/dist/testing/pseudo-locale.js +74 -0
  290. package/dist/testing/quality.d.ts +6 -0
  291. package/dist/testing/quality.d.ts.map +1 -1
  292. package/dist/testing/quality.js +139 -1
  293. package/dist/tokens/bridge-sheet.d.ts +21 -0
  294. package/dist/tokens/bridge-sheet.d.ts.map +1 -0
  295. package/dist/tokens/bridge-sheet.js +68 -0
  296. package/dist/tokens/emit.d.ts +6 -1
  297. package/dist/tokens/emit.d.ts.map +1 -1
  298. package/dist/tokens/emit.js +26 -1
  299. package/dist/ui/accordion.js +1 -1
  300. package/dist/ui/card.d.ts +32 -4
  301. package/dist/ui/card.d.ts.map +1 -1
  302. package/dist/ui/card.js +26 -3
  303. package/dist/ui/collapsible.d.ts +4 -2
  304. package/dist/ui/collapsible.d.ts.map +1 -1
  305. package/dist/ui/collapsible.js +1 -1
  306. package/dist/ui/combobox.js +1 -1
  307. package/dist/ui/meter.d.ts +34 -3
  308. package/dist/ui/meter.d.ts.map +1 -1
  309. package/dist/ui/meter.guard.d.ts +2 -0
  310. package/dist/ui/meter.guard.d.ts.map +1 -1
  311. package/dist/ui/meter.guard.js +20 -0
  312. package/dist/ui/meter.js +23 -7
  313. package/dist/ui/primitive.contract.d.ts.map +1 -1
  314. package/dist/ui/primitive.contract.js +7 -0
  315. package/dist/ui/remote-pad.d.ts +62 -0
  316. package/dist/ui/remote-pad.d.ts.map +1 -0
  317. package/dist/ui/remote-pad.guard.d.ts +21 -0
  318. package/dist/ui/remote-pad.guard.d.ts.map +1 -0
  319. package/dist/ui/remote-pad.guard.js +6 -0
  320. package/dist/ui/remote-pad.js +148 -0
  321. package/dist/ui/segmented.d.ts.map +1 -1
  322. package/dist/ui/segmented.js +4 -0
  323. package/dist/ui/skeleton.d.ts +9 -4
  324. package/dist/ui/skeleton.d.ts.map +1 -1
  325. package/dist/ui/skeleton.guard.d.ts +6 -2
  326. package/dist/ui/skeleton.guard.d.ts.map +1 -1
  327. package/dist/ui/skeleton.guard.js +4 -0
  328. package/dist/ui/skeleton.js +2 -1
  329. package/dist/ui/slots.d.ts +2 -1
  330. package/dist/ui/slots.d.ts.map +1 -1
  331. package/dist/ui/slots.js +2 -1
  332. package/dist/vite/allotment.d.ts +1 -1
  333. package/dist/vite/allotment.d.ts.map +1 -1
  334. package/dist/vite/allotment.js +15 -1
  335. package/dist/vite/doc.d.ts +1 -1
  336. package/dist/vite/doc.d.ts.map +1 -1
  337. package/dist/vite/doc.js +12 -2
  338. package/dist/vite/head.d.ts +4 -3
  339. package/dist/vite/head.d.ts.map +1 -1
  340. package/dist/vite/index.d.ts.map +1 -1
  341. package/dist/vite/index.js +4 -1
  342. package/dist/vite/shell-worker.d.ts +6 -0
  343. package/dist/vite/shell-worker.d.ts.map +1 -0
  344. package/dist/vite/shell-worker.js +92 -0
  345. package/docs/astro.md +19 -4
  346. package/docs/bar-list.md +3 -2
  347. package/docs/bar-title.md +33 -0
  348. package/docs/basalt-provider.md +2 -1
  349. package/docs/card.md +24 -4
  350. package/docs/chain-view.md +12 -7
  351. package/docs/chart-card.md +3 -2
  352. package/docs/collapsible.md +4 -2
  353. package/docs/control-home.md +4 -2
  354. package/docs/create-run-queue.md +40 -0
  355. package/docs/data-panel.md +3 -2
  356. package/docs/de.md +1 -1
  357. package/docs/empty-state.md +3 -1
  358. package/docs/es.md +1 -1
  359. package/docs/event-list.md +3 -2
  360. package/docs/fact.md +6 -1
  361. package/docs/facts.md +5 -1
  362. package/docs/fr.md +1 -1
  363. package/docs/live-query.md +1 -1
  364. package/docs/meter.md +17 -13
  365. package/docs/mini-bars.md +7 -5
  366. package/docs/pseudo-basalt-messages.md +30 -0
  367. package/docs/pseudo-messages.md +27 -0
  368. package/docs/quality.md +2 -1
  369. package/docs/recipes/localise-app.md +2 -2
  370. package/docs/remote-pad.md +40 -0
  371. package/docs/row-list.md +3 -2
  372. package/docs/run-button.md +45 -0
  373. package/docs/run-list.md +71 -0
  374. package/docs/section.md +7 -1
  375. package/docs/set-scheme.md +2 -2
  376. package/docs/skeleton.md +4 -3
  377. package/docs/slots.md +1 -1
  378. package/docs/sparkline.md +5 -2
  379. package/docs/stat-card.md +6 -4
  380. package/docs/testing.md +64 -0
  381. package/docs/use-local-control.md +8 -1
  382. package/docs/use-runs.md +32 -0
  383. package/docs/vite.md +12 -2
  384. package/docs/zh-hans.md +1 -1
  385. package/llms.txt +88 -21
  386. package/migrations/areas/shadcn.json +338 -0
  387. package/package.json +9 -2
  388. package/src/astro/shiki.ts +3 -1
  389. package/src/cards/bar-list.tsx +2 -1
  390. package/src/cards/chain-view.tsx +167 -55
  391. package/src/cards/contract.ts +8 -1
  392. package/src/cards/data-panel.tsx +1 -0
  393. package/src/cards/event-list.tsx +2 -1
  394. package/src/cards/index.ts +1 -0
  395. package/src/cards/row-list.tsx +2 -1
  396. package/src/cards/stat-card-parts.tsx +9 -7
  397. package/src/cards/stat-card.tsx +39 -12
  398. package/src/charts/core/compile.ts +31 -19
  399. package/src/charts/core/cursor.ts +11 -3
  400. package/src/charts/core/tooltip-said.ts +55 -0
  401. package/src/charts/focus.tsx +4 -1
  402. package/src/charts/parts/chart-card.tsx +1 -0
  403. package/src/cli/agent-note.ts +12 -5
  404. package/src/cli/budget/index.ts +22 -5
  405. package/src/cli/config.ts +1 -1
  406. package/src/cli/doctor/app.ts +75 -23
  407. package/src/cli/doctor/eject.ts +30 -10
  408. package/src/cli/doctor/guards.ts +11 -8
  409. package/src/cli/doctor/hook.ts +1 -1
  410. package/src/cli/doctor/install.ts +61 -24
  411. package/src/cli/doctor/translations.ts +13 -4
  412. package/src/cli/doctor/types.ts +2 -3
  413. package/src/cli/doctor/wiring.ts +30 -16
  414. package/src/cli/eject/dropped-slots.ts +11 -0
  415. package/src/cli/eject/index.ts +13 -9
  416. package/src/cli/help.ts +34 -10
  417. package/src/cli/index.ts +56 -14
  418. package/src/cli/init/index.ts +64 -5
  419. package/src/cli/init/locales.ts +41 -8
  420. package/src/cli/init/router-seeds.ts +17 -3
  421. package/src/cli/init/steps.ts +308 -41
  422. package/src/cli/lint/baseline.ts +141 -0
  423. package/src/cli/lint/engine.ts +33 -10
  424. package/src/cli/lint/hook.ts +11 -3
  425. package/src/cli/lint/index.ts +77 -12
  426. package/src/cli/manifest.ts +132 -4
  427. package/src/cli/migrate/census.ts +35 -1
  428. package/src/cli/migrate/index.ts +46 -3
  429. package/src/cli/migrate/lost-classes.ts +203 -0
  430. package/src/cli/migrate/rows.ts +21 -0
  431. package/src/cli/package-manager.ts +4 -1
  432. package/src/cli/peers.ts +11 -0
  433. package/src/cli/presets.ts +32 -11
  434. package/src/cli/resolver.ts +58 -10
  435. package/src/cli/router-wiring.ts +3 -1
  436. package/src/cli/sync/engine.ts +30 -14
  437. package/src/cli/sync/index.ts +7 -4
  438. package/src/cli/sync/render.ts +29 -37
  439. package/src/cli/tokens-css.ts +42 -5
  440. package/src/controls/contract.ts +2 -0
  441. package/src/controls/control-home.tsx +15 -4
  442. package/src/controls/local-control.ts +49 -3
  443. package/src/core/cn.ts +9 -5
  444. package/src/core/frame-figure.tsx +7 -1
  445. package/src/core/frame-head.tsx +32 -6
  446. package/src/core/frame-regions.tsx +18 -8
  447. package/src/core/info-hint.tsx +26 -0
  448. package/src/core/mark-tone.ts +10 -3
  449. package/src/core/mark-types.ts +4 -2
  450. package/src/core/messages/chain.ts +2 -1
  451. package/src/core/messages/index.ts +4 -0
  452. package/src/core/messages/runs.ts +40 -0
  453. package/src/core/phase.ts +22 -2
  454. package/src/core/ports.ts +13 -1
  455. package/src/core/provider.tsx +7 -3
  456. package/src/core/scheme.ts +6 -2
  457. package/src/core/spark/mini-bars.tsx +59 -15
  458. package/src/core/spark/sparkline.tsx +26 -4
  459. package/src/css/bridge.css +63 -0
  460. package/src/css/generate.ts +40 -3
  461. package/src/data/live/live-query.ts +4 -3
  462. package/src/lint/preset.ts +52 -13
  463. package/src/lint/rules/class/table.ts +3 -1
  464. package/src/lint/rules/structure/control-home.ts +1 -1
  465. package/src/lint/rules/structure/import-boundary.ts +2 -0
  466. package/src/lint/rules/structure/label-literal.ts +3 -1
  467. package/src/lint/shadcn.ts +91 -0
  468. package/src/lint/stylelint/render.ts +31 -1
  469. package/src/lint/stylelint/rules.ts +19 -7
  470. package/src/lint/weakened.ts +59 -1
  471. package/src/messages/de.ts +20 -0
  472. package/src/messages/es.ts +20 -0
  473. package/src/messages/fr.ts +20 -0
  474. package/src/messages/zh-hans.ts +20 -0
  475. package/src/page/bar-title.tsx +35 -0
  476. package/src/page/contract.ts +11 -1
  477. package/src/page/empty-state.tsx +18 -8
  478. package/src/page/facts.tsx +43 -5
  479. package/src/page/index.ts +8 -0
  480. package/src/page/page-bar.tsx +2 -9
  481. package/src/page/page-summary.tsx +4 -3
  482. package/src/page/run-button.tsx +52 -0
  483. package/src/page/run-list.tsx +151 -0
  484. package/src/page/run-queue.ts +185 -0
  485. package/src/page/section.tsx +30 -5
  486. package/src/shell/commands/command-palette.tsx +10 -1
  487. package/src/shell/parts/header.tsx +1 -1
  488. package/src/surfaces.ts +18 -1
  489. package/src/testing/index.ts +1 -0
  490. package/src/testing/pseudo-locale.ts +149 -0
  491. package/src/testing/quality.ts +188 -0
  492. package/src/tokens/bridge-sheet.ts +80 -0
  493. package/src/tokens/emit.ts +45 -6
  494. package/src/ui/accordion.tsx +1 -1
  495. package/src/ui/card.tsx +56 -6
  496. package/src/ui/collapsible.tsx +5 -3
  497. package/src/ui/combobox.tsx +1 -1
  498. package/src/ui/meter.guard.ts +23 -0
  499. package/src/ui/meter.tsx +76 -27
  500. package/src/ui/no-restyle.generated.json +8 -0
  501. package/src/ui/primitive.contract.ts +7 -0
  502. package/src/ui/remote-pad.guard.ts +24 -0
  503. package/src/ui/remote-pad.tsx +249 -0
  504. package/src/ui/segmented.tsx +6 -0
  505. package/src/ui/skeleton.guard.ts +7 -2
  506. package/src/ui/skeleton.tsx +10 -4
  507. package/src/ui/slots.ts +2 -1
  508. package/src/vite/allotment.ts +15 -1
  509. package/src/vite/doc.ts +12 -2
  510. package/src/vite/head.ts +4 -3
  511. package/src/vite/index.ts +4 -1
  512. package/src/vite/shell-worker.ts +115 -0
package/docs/mini-bars.md CHANGED
@@ -10,15 +10,17 @@ slots: [spark-bar, spark-caret]
10
10
 
11
11
  # MiniBars
12
12
 
13
- A row of small marks, one per item, with the state of each: `bars` from a zero baseline, `ticks` of
14
- equal height (a fleet by state) or `capsules` whose height is the value (each run's duration; an
15
- item with a tone and no value is a dot). A `tone` on a point is closed to the tone set: `neutral`
13
+ A row of small marks, one per item, with the state of each: `bars` from a zero baseline, `ticks`, one per
14
+ item, whose height ranks its state (a fleet by state) or `capsules` whose height is the value (each run's duration; an
15
+ item with a tone and no value is a dot). A counted zero is a 2 px baseline mark in a firmer ink, so it
16
+ never reads as a dropped run (a gap, `null`, draws nothing). A `tone` on a point is closed to the tone set: `neutral`
16
17
  and the `common` one (default `good`) are drawn quiet, every other tone at full strength, so the
17
18
  exception stands out of the texture. Untoned bars are dim ink with the `highlight` item (default
18
19
  the last) lit; the lit bar is drawn in the foreground ink, and a host may set `--basalt-spark-now` to recolor it. No
19
20
  `color`. `sentence` says what the strip shows and is its name; the marks are hidden from it.
20
21
  Past 120 `bars` each bar stands for a run of items (the `highlight` one first, then an exception
21
- one), so a count belongs in the sentence; `ticks` and `capsules` draw every item.
22
+ one), so a count belongs in the sentence; `ticks` and `capsules` draw every item. A tick tells its
23
+ state by height as well as hue: `neutral` is the shortest, the common tone next, `bad` the full strip.
22
24
  With `axisLabels` the arrow keys and a pointer walk the items into the middle label; with a
23
25
  `focus` (`useChartFocus` over the same items) they walk the page's one focus, and the page reads
24
26
  `focus.readout`. A `StatCard` or a `StatCell` chart slot draws it as it is.
@@ -36,7 +38,7 @@ MiniBars(props: MiniBarsProps): ReactElement
36
38
  axisLabels?: readonly [string, string, string] // The label row (start, middle, end)
37
39
  sentence: string // What the mark shows, in one sentence ("ROAS 4.3x against a 2.5x target")
38
40
  points: readonly MiniBarPoint[]
39
- form?: "ticks" | "bars" | "capsules" // `bars` (default) from a zero baseline; `ticks` of equal height, one per item (a fleet by state); `capsules` whose height is the value (each run's duration), an item without one a dot
41
+ form?: "ticks" | "bars" | "capsules" // `bars` (default) from a zero baseline; `ticks`, one per item, whose height ranks its state (a fleet by state); `capsules` whose height is the value (each run's duration), an item without one a dot
40
42
  common?: Tone // The tone drawn quiet, with `neutral`; every other tone is full
41
43
  highlight?: number | "last" // The lit item, at full strength
42
44
  ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: pseudoBasaltMessages
3
+ use when: 'a test page runs in the pseudo-locale and shows the package''s own buttons, headings or empty states'
4
+ never when: 'the page runs in a real language: pass that language pack instead'
5
+ instead: [pseudoMessages]
6
+ subpath: basalt-ui/testing
7
+ peers: ['@axe-core/playwright']
8
+ slots: []
9
+ ---
10
+
11
+ # pseudoBasaltMessages
12
+
13
+ ```tsx
14
+ // In the same test page: the package's own labels, so they do not read as untranslated literals.
15
+ import { BasaltProvider } from 'basalt-ui'
16
+ import { pseudoBasaltMessages } from 'basalt-ui/testing'
17
+ const root = (
18
+ <BasaltProvider messages={pseudoBasaltMessages()}>
19
+ <App />
20
+ </BasaltProvider>
21
+ )
22
+ ```
23
+
24
+ ## Signature
25
+
26
+ ```ts
27
+ pseudoBasaltMessages(): BasaltMessages
28
+ ```
29
+
30
+ `BasaltMessages` import from `basalt-ui`: `import type { BasaltMessages } from 'basalt-ui'`.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: pseudoMessages
3
+ use when: 'a browser test must show clipped labels and untranslated literals before a real translation does'
4
+ never when: 'the app ships to a user: it is a test locale'
5
+ instead: [pseudoBasaltMessages]
6
+ subpath: basalt-ui/testing
7
+ peers: ['@axe-core/playwright']
8
+ slots: []
9
+ ---
10
+
11
+ # pseudoMessages
12
+
13
+ ```ts
14
+ // The test page of a localised app: English, bracketed, accented and at least as long as German.
15
+ import { i18n } from '@lingui/core'
16
+ import { pseudoMessages } from 'basalt-ui/testing'
17
+ import { messages as en } from '#locales/en.po'
18
+ import { messages as de } from '#locales/de.po'
19
+ i18n.load('en', pseudoMessages(en, de))
20
+ i18n.activate('en')
21
+ ```
22
+
23
+ ## Signature
24
+
25
+ ```ts
26
+ pseudoMessages<M extends object>(source: M, longest?: object): M
27
+ ```
package/docs/quality.md CHANGED
@@ -24,6 +24,7 @@ for (const route of ROUTES) {
24
24
  await quality.ringWalk(page) // Tab through every stop: solid ring, 3:1, not clipped
25
25
  await quality.focusNotObscured(page) // 2.4.11: no focused element sits under sticky chrome
26
26
  await quality.textSpacing(page) // 1.4.12: nothing clips at line-height 1.5, 0.12em, 0.16em
27
+ await quality.textOverflow(page) // no label is ellipsised, clipped or wider than its box
27
28
  // Last, it resizes the viewport: after its sweep headless Chrome can hang in a later hit test.
28
29
  await quality.overflow(page) // 320, 390, 768, 1440, 1800: the document never scrolls sideways
29
30
  })
@@ -34,5 +35,5 @@ for (const route of ROUTES) {
34
35
  ## Signature
35
36
 
36
37
  ```ts
37
- quality: { setScheme, axe, overflow, ringWalk, focusNotObscured, textSpacing }
38
+ quality: { setScheme, axe, overflow, ringWalk, focusNotObscured, textSpacing, textOverflow }
38
39
  ```
@@ -14,8 +14,8 @@ Load one catalogue per language and feature (Lingui `catalogs`), each a lazy imp
14
14
  Keep one glossary file per app (each term, what it means, its word per language) that translators and agents read first, and check a translation by translating it back. A label a library part cannot take lazily arrives as data (`PageBar` `tabs.labels`).
15
15
  Setup: `basalt-ui init --profile app --locales en,de` (the source language first) wires a new app: Lingui at a pinned version (`@lingui/core`, `@lingui/react`, `@lingui/cli`, `@lingui/format-po`, `@lingui/vite-plugin`), `lingui.config.ts`, the Vite plugin before `react()`, `src/po.d.ts` for `*.po`, one `src/locales/<language>.po` each (the seeds' words translated where the package ships the language, else empty until someone translates them), a `LocalizedProvider` that loads the catalogue before it mounts, and seeds that take their words from it.
16
16
  An app that exists takes the same command: it writes only what is missing and keeps your files, so mount `LocalizedProvider` (`src/lib/localized-provider.tsx`) in place of `BasaltProvider`, add `lingui({ macroTransform: true })` to the Vite config and move each literal into a message. Compiled `src/locales/*.js` is the CLI's output: init lists it in `.gitignore`, `.oxfmtrc.json` and `.oxlintrc.json` `ignorePatterns` once, and the edit hook and doctor accept a path `ignorePatterns` names.
17
- With two or more `locales` lint refuses literal text (`react/jsx-no-literals`, `basalt/label-literal`); `lingui/no-unlocalized-strings` (`eslint-plugin-lingui` under oxlint's `jsPlugins`) also reads strings outside both. A brand, a unit or a code sample is a constant imported from one untranslated module, or a waiver that says why (a line of `.basalt/record.txt`).
18
- Gate: `"check": "lingui extract --clean && lingui compile --strict && …"`: the extract puts a new or changed message into every catalogue empty and the strict compile fails on it; `basalt-ui doctor` fails on a `check` without that pair, an empty or missing message and a `BasaltProvider` whose `locale` is absent or a literal. It reads `src/locales/{locale}.po`; another layout, one catalogue per feature included, is the manifest's `catalogs`: path patterns (`.po` or `.json`) with `{locale}` and `*`.
17
+ With two or more `locales` lint refuses literal text (`react/jsx-no-literals`, `basalt/label-literal`); `lingui/no-unlocalized-strings` (`eslint-plugin-lingui` under oxlint's `jsPlugins`) also reads strings outside both. A brand, a unit or a code sample is a constant imported from one untranslated module, or a waiver that says why (a line of `.basalt/record.txt`). A `site` root beside the app has no catalogue: its words modules go in the manifest's `wordModules` (`docs/astro.md`).
18
+ Gate: `"check": "lingui extract --clean && lingui compile --strict && …"`: the extract puts a new or changed message into every catalogue empty and the strict compile fails on it; `basalt-ui doctor` fails on a `check` without that pair, an empty or missing message and a `BasaltProvider` whose `locale` is absent or a literal. It reads `src/locales/{locale}.po`; another layout, one catalogue per feature included, is the manifest's `catalogs`: path patterns (`.po` or `.json`) with `{locale}` and `*`. `init --catalogs '<pattern>'` writes it; when no pattern is the app's own `src/locales/{locale}.po`, `init` writes no catalogue, wiring or router seed, so the app mounts its provider and starts `check` with its catalogue step itself. A language registered before it is translated goes in `locales` and in the manifest's `partialLocales` (never the source one), with `fallbackLocales: { default: '<source>' }` in `lingui.config.ts` so the strict compile passes: doctor still requires its catalogue files and holds every other language complete.
19
19
  An app's own control names an option with `handle.label(value, useFormat().locale)`; a native menu passes `locale` to `toMenuTemplate`.
20
20
 
21
21
  ```ts
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: RemotePad
3
+ use when: 'the page drives a device or a cursor key by key: a TV, a player, a camera mount'
4
+ never when: 'the actions have no spatial or remote layout (use Button in a row or a Toolbar)'
5
+ instead: [Button, Toolbar]
6
+ subpath: basalt-ui/ui/remote-pad
7
+ peers: []
8
+ slots: [remote-pad]
9
+ ---
10
+
11
+ # RemotePad
12
+
13
+ A remote control: a D-pad (up, left, select, right, down) over rows of keys, with one `onKey`
14
+ handler. It sends and shows nothing else: a key is never busy, so three taps are three presses,
15
+ and what became of a command belongs to the page. Arrows repeat while held; another key repeats
16
+ with `repeat`.
17
+
18
+ ## Props
19
+
20
+ ### `RemotePad`
21
+
22
+ ```ts
23
+ RemotePad<K extends string = string>({ dpad, rows, onKey, disabled, "aria-label": name, className, }: RemotePadProps<K>): ReactElement
24
+ dpad: Readonly<Record<RemoteDirection, RemoteKey<K>>> // The D-pad cluster
25
+ rows?: readonly (readonly RemoteKey<K>[])[] // Rows of keys under the D-pad (back, home, play; volume); a row splits its width evenly
26
+ onKey: (key: K) => void // One press of any key, repeats included
27
+ disabled?: boolean
28
+ aria-label: string
29
+ className?: string // Layout only (`max-w-xs`)
30
+ ```
31
+
32
+ ## `remotePadVariants`
33
+
34
+ Part `remote-pad`.
35
+
36
+ No variant axes.
37
+
38
+ ## Slots
39
+
40
+ - `remote-pad`
package/docs/row-list.md CHANGED
@@ -27,7 +27,8 @@ RowList<I = unknown>(props: RowListProps<I>): ReactElement
27
27
  title: string
28
28
  subtitle?: FrameFacts // A context line under the title: a string, or facts joined by the separator dot
29
29
  icon?: IconComponent
30
- info?: string
30
+ info?: string | readonly InfoEntry[] // The definition behind the glyph: a string, or one paragraph per entry (a definition, its parts, its context); an entry may end with a link
31
+ headingLevel?: 2 | 3 | 4 // The title is a heading of this level: `3` by default; a card under a section titled `h2` keeps `3`, one under an `h3` takes `4`
31
32
  badge?: FrameBadge // The chip beside the title
32
33
  phase?: Phase | QueryStateLike
33
34
  empty?: Empty | null
@@ -40,7 +41,7 @@ RowList<I = unknown>(props: RowListProps<I>): ReactElement
40
41
  focus?: IdLink<I> // A chart's focus over the same records (`useFocusScope` or `useChartFocus`), mapped by id: `id(item)` names a row's `key ?? label`, so a sort keeps the link
41
42
  ```
42
43
 
43
- `Action`, `Empty`, `FrameBadge`, `FrameFacts`, `Phase`, `QueryStateLike`, `RowListProps` import from `basalt-ui/cards`: `import type { Action, Empty, FrameBadge, FrameFacts, Phase, QueryStateLike, RowListProps } from 'basalt-ui/cards'`.
44
+ `Action`, `Empty`, `FrameBadge`, `FrameFacts`, `InfoEntry`, `Phase`, `QueryStateLike`, `RowListProps` import from `basalt-ui/cards`: `import type { Action, Empty, FrameBadge, FrameFacts, InfoEntry, Phase, QueryStateLike, RowListProps } from 'basalt-ui/cards'`.
44
45
 
45
46
  `IconComponent` import from `basalt-ui`: `import type { IconComponent } from 'basalt-ui'`.
46
47
 
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: RunButton
3
+ use when: 'a press sends a command that takes seconds'
4
+ never when: 'the press is local and instant (use `Button`), or it submits a form (use the form''s submit)'
5
+ instead: [Button]
6
+ subpath: basalt-ui/page
7
+ peers: []
8
+ slots: []
9
+ ---
10
+
11
+ # RunButton
12
+
13
+ A button that starts a task on a queue and is busy until that task's latest run has ended. Its
14
+ `data-action` is the latest run's phase, `idle` before the first. Where the outcome shows is
15
+ `RunList`'s job.
16
+
17
+ ## Signature
18
+
19
+ ```ts
20
+ RunButton<D = unknown>({ queue, task, repeatable, onClick, loading, ...props }: RunButtonProps<D>): ReactElement
21
+ // either aria-label + shape or neither
22
+ className?: string // Layout only (`w-full`, `flex-1`, `mt-2`)
23
+ variant?: "primary" | "secondary" | "ghost" | "danger" | null
24
+ size?: "sm" | "md" | null
25
+ loading?: boolean // Disables interaction, sets `aria-busy` and draws a spinner over the label; the label keeps its place (transparent, still the accessible name), so the button never changes width
26
+ shape?: "default" | "icon"
27
+ queue: RunQueue<D>
28
+ task: RunTask<D>
29
+ repeatable?: boolean // Stays pressable while its runs are open: a remote key pressed three times in a row
30
+ aria-label: string [with shape="icon"]
31
+ ```
32
+
33
+ `RunButtonProps`, `RunQueue`, `RunTask` import from `basalt-ui/page`: `import type { RunButtonProps, RunQueue, RunTask } from 'basalt-ui/page'`.
34
+
35
+ ## Example
36
+
37
+ ```tsx
38
+ <RunButton queue={commands} task={tvOn} variant="primary">TV on</RunButton>
39
+ ```
40
+
41
+ ## Example
42
+
43
+ ```tsx
44
+ <RunButton queue={commands} task={volumeUp} repeatable>Volume up</RunButton>
45
+ ```
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: RunList
3
+ use when: 'commands started with `RunButton` or a queue need their outcome on the page'
4
+ never when: 'the history is data from a server (use `EventList`), or one passing note is enough (use `notify`)'
5
+ instead: [EventList, notify]
6
+ subpath: basalt-ui/page
7
+ peers: []
8
+ slots: [run-list]
9
+ ---
10
+
11
+ # RunList
12
+
13
+ The runs of a queue as the reader needs them: what runs and for how long, what waits behind it,
14
+ what just finished with its steps, and a failed run with the failing step's text until dismissed.
15
+ A polite live list: a change of state is announced, the ticking elapsed time is not, and a
16
+ failure is an `alert`, announced at once. Each row carries `data-run` with its phase.
17
+
18
+ ## Signature
19
+
20
+ ```ts
21
+ RunList<D = unknown>({ queue, lanes, label, className, }: RunListProps<D>): ReactElement
22
+ queue: RunQueue<D>
23
+ lanes?: readonly string[] // Only runs that hold one of these lanes; every run when left out
24
+ label?: string // The list's accessible name
25
+ className?: string // Layout only (`mt-4`)
26
+ ```
27
+
28
+ `RunListProps`, `RunQueue` import from `basalt-ui/page`: `import type { RunListProps, RunQueue } from 'basalt-ui/page'`.
29
+
30
+ ## Example
31
+
32
+ ```tsx
33
+ <RunList queue={commands} lanes={['living-room']} />
34
+ ```
35
+
36
+ ## Example
37
+
38
+ `apps/playground/src/recipes/run-commands.tsx`
39
+
40
+ ```tsx
41
+ /** One queue for the app: a room's server runs one command at a time, so the room is the lane. */
42
+ const commands = createRunQueue()
43
+
44
+ async function send(path: string): Promise<RunResult> {
45
+ const response = await fetch(path, { method: 'POST' })
46
+ return response.ok ? {} : { error: `HTTP ${response.status}` }
47
+ }
48
+
49
+ const power = (room: string, state: 'on' | 'off'): RunTask => ({
50
+ id: `tv-${state}:${room}`,
51
+ label: `TV ${state}`,
52
+ lanes: [room],
53
+ run: () => send(`/api/tv/${room}/${state}`),
54
+ })
55
+
56
+ export function RoomCommands({ room }: { room: string }): ReactElement {
57
+ return (
58
+ <div className="flex flex-col gap-4">
59
+ <div className="flex gap-2">
60
+ <RunButton queue={commands} task={power(room, 'on')} variant="primary">
61
+ TV on
62
+ </RunButton>
63
+ <RunButton queue={commands} task={power(room, 'off')}>
64
+ TV off
65
+ </RunButton>
66
+ </div>
67
+ <RunList queue={commands} lanes={[room]} />
68
+ </div>
69
+ )
70
+ }
71
+ ```
package/docs/section.md CHANGED
@@ -10,7 +10,8 @@ slots: [section, section-controls, section-summary, section-tabs]
10
10
 
11
11
  # Section
12
12
 
13
- A titled part of a page: an `h2`, an optional controls slot on the same row and the body. The
13
+ A titled part of a page: an `h2` (`h3` with `headingLevel={3}`), an optional controls slot on the
14
+ same row and the body. The
14
15
  section is a named region and a scroll anchor: its `id` is the slug of `title`, and its scroll
15
16
  margin is `--basalt-page-sticky-top`, so a `#hash` jump, a skip link or `scrollIntoView` lands the
16
17
  heading just below the page band instead of under it. Outside a `Page` the offset is zero.
@@ -23,10 +24,15 @@ Section<K extends string = string>(props: SectionProps<K>): ReactElement
23
24
  summary?: string // One line beside the title, shown while collapsed too
24
25
  controls?: { readonly kind: "controls-slot"; readonly count: number; readonly compact?: boolean; render(): ReactNode; }
25
26
  tabs?: PageTabs<K> // The section's view switch, beside the title
27
+ headingLevel?: 2 | 3 // The heading element, 3 for a part of a section; default 2
28
+ info?: string | readonly InfoEntry[] // The title's definition, behind the card head's info glyph; an array is one paragraph per entry, which may end with a link
29
+ divided?: boolean // A hairline under the heading row
26
30
  collapsible?: { defaultOpen?: boolean; state?: ControlHandle<boolean>; } // The heading is the trigger; open state is uncontrolled or a handle (F2 amendment n5)
27
31
  children?: ReactNode
28
32
  ```
29
33
 
34
+ `InfoEntry` import from `basalt-ui/cards`: `import type { InfoEntry } from 'basalt-ui/cards'`.
35
+
30
36
  `PageTabs`, `SectionProps` import from `basalt-ui/page`: `import type { PageTabs, SectionProps } from 'basalt-ui/page'`.
31
37
 
32
38
  `ControlHandle` import from `basalt-ui`: `import type { ControlHandle } from 'basalt-ui'`.
@@ -11,13 +11,13 @@ slots: []
11
11
  # setScheme
12
12
 
13
13
  `setScheme('dark' | 'light' | 'auto')` applies, stores the declared key (default `basalt:scheme`)
14
- and mirrors the declared cookie. `setScheme()` re-reads storage and applies, overriding any attribute: call it after an
14
+ and mirrors the declared cookie. `{ persist: false }` applies without either write, for an app that keeps its own preference. `setScheme()` re-reads storage and applies, overriding any attribute: call it after an
15
15
  async restore (same-tab localStorage writes fire no storage event).
16
16
 
17
17
  ## Signature
18
18
 
19
19
  ```ts
20
- setScheme(value?: Scheme, options?: { cookie?: string; key?: string; }): void
20
+ setScheme(value?: Scheme, options?: { cookie?: string; key?: string; persist?: boolean; }): void
21
21
  ```
22
22
 
23
23
  `Scheme` import from `basalt-ui`: `import type { Scheme } from 'basalt-ui'`.
package/docs/skeleton.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: Skeleton
3
- use when: 'a one-line placeholder holds the place of loading text in a hand-built layout'
3
+ use when: 'a placeholder holds the place of loading text or a block in a hand-built layout'
4
4
  never when: 'a basalt part already draws its own loading state (give it `phase`), or the wait is an action (use a Spinner or a Button `loading`)'
5
5
  instead: [StatCard, Button]
6
6
  subpath: basalt-ui/ui/skeleton
@@ -10,7 +10,7 @@ slots: [skeleton, spinner]
10
10
 
11
11
  # Skeleton
12
12
 
13
- A placeholder for one line of loading content. Match the content's text style on the skeleton or
13
+ A placeholder for one line of loading content, or with `height` for a block of that height. Match the content's text style on the skeleton or
14
14
  its parent (`text-sm`, `text-lg`) and its height equals the content's; set the width with
15
15
  `className`. Stack several for a paragraph. It is hidden from assistive tech: name the loading
16
16
  region with `aria-busy` and a status, not each box.
@@ -20,8 +20,9 @@ region with `aria-busy` and a status, not each box.
20
20
  ### `Skeleton`
21
21
 
22
22
  ```ts
23
- Skeleton({ className, ...props }: SkeletonProps): ReactElement
23
+ Skeleton({ className, height, style, ...props }: SkeletonProps): ReactElement
24
24
  className?: string // Layout only (`w-32`, `w-2/3`)
25
+ height?: number // The final height in px of a block that is not a line of text (a chart, a card), so nothing moves when it lands
25
26
  ```
26
27
 
27
28
  ### `Spinner`
package/docs/slots.md CHANGED
@@ -18,7 +18,7 @@ value (the same object, never a copy), so a new part shows up here with no edit.
18
18
 
19
19
  ```ts
20
20
  SLOTS: { full key list below }
21
- accordion, alert, avatar, badge, button, calendar, card, checkbox-matrix, checkbox, choice-card, collapsible, combobox, context-menu, control-group, copy-button, date-picker, dialog, entity, field, file-upload, info-hint, input, kbd, menu, meter, num, number-field, one-time-code, password-input, popover, progress, quick-picks, radio-group, resizable, scroll-area, segmented, select, separator, sheet, skeleton, slider, sortable-list, status, swatch-picker, switch, table, tabs, tag-input, textarea, toast, toolbar, tooltip, tree, virtual-list
21
+ accordion, alert, avatar, badge, button, calendar, card, checkbox-matrix, checkbox, choice-card, collapsible, combobox, context-menu, control-group, copy-button, date-picker, dialog, entity, field, file-upload, info-hint, input, kbd, menu, meter, num, number-field, one-time-code, password-input, popover, progress, quick-picks, radio-group, remote-pad, resizable, scroll-area, segmented, select, separator, sheet, skeleton, slider, sortable-list, status, swatch-picker, switch, table, tabs, tag-input, textarea, toast, toolbar, tooltip, tree, virtual-list
22
22
  ```
23
23
 
24
24
  ## Example
package/docs/sparkline.md CHANGED
@@ -18,8 +18,8 @@ row's middle slot, a polite live region reads each step, the line dims round the
18
18
  crosses it to both edges. `cap` holds an outlier on the top edge under an
19
19
  off-scale caret. `compare` draws a second series in muted ink on the same scale; `threshold` draws a
20
20
  dashed rule, names it where the plot is 40 px or taller and dots every breach. With a `focus`
21
- (`useChartFocus` over the same items) the points walk the page's one focus, and a held run (a table row that stands for several points) is a band over them. No `tone`, no `color`
22
- for the line: the dot is drawn in the foreground ink, and a host may set `--basalt-spark-now` to recolor it. `sentence` says what the line shows and is its name; the drawing is hidden
21
+ (`useChartFocus` over the same items) the points walk the page's one focus, and a held run (a table row that stands for several points) is a band over them. `tone` paints the line, its area and the now dot in a status tone (default `neutral`, the muted ink);
22
+ a host may still set `--basalt-spark-now` to recolor the dot. `sentence` says what the line shows and is its name; the drawing is hidden
23
23
  from it.
24
24
 
25
25
  ## Signature
@@ -30,6 +30,7 @@ Sparkline(props: SparklineProps): ReactElement
30
30
  height: number | "fill"
31
31
  width?: number
32
32
  form?: "line" | "area"
33
+ tone?: Tone // The line, its area and the now dot in a status tone; `neutral` (default) is the muted ink
33
34
  reference?: number | "mean" | { min: number; max: number; } // A value, the `'mean'`, or a target range: two dashed lines with a faint band between
34
35
  compare?: readonly SparkPoint[] // A second series in muted ink on the same scale, point for point (the period before)
35
36
  threshold?: SparkThreshold
@@ -41,6 +42,8 @@ Sparkline(props: SparklineProps): ReactElement
41
42
  sentence: string // What the mark shows, in one sentence ("ROAS 4.3x against a 2.5x target")
42
43
  ```
43
44
 
45
+ `Tone` import from `basalt-ui/cards`: `import type { Tone } from 'basalt-ui/cards'`.
46
+
44
47
  `SparklineProps`, `SparkPoint`, `SparkThreshold` import from `basalt-ui/charts`: `import type { SparklineProps, SparkPoint, SparkThreshold } from 'basalt-ui/charts'`.
45
48
 
46
49
  ## Example
package/docs/stat-card.md CHANGED
@@ -34,7 +34,8 @@ StatCard(props: StatCardProps): ReactElement
34
34
  title: string
35
35
  subtitle?: FrameFacts // A context line under the title: a string, or facts joined by the separator dot
36
36
  icon?: IconComponent
37
- info?: string
37
+ info?: string | readonly InfoEntry[] // The definition behind the glyph: a string, or one paragraph per entry (a definition, its parts, its context); an entry may end with a link
38
+ headingLevel?: 2 | 3 | 4 // The title is a heading of this level: `3` by default; a card under a section titled `h2` keeps `3`, one under an `h3` takes `4`
38
39
  badge?: FrameBadge // The chip beside the title
39
40
  phase?: Phase | QueryStateLike
40
41
  empty?: Empty | null
@@ -42,7 +43,8 @@ StatCard(props: StatCardProps): ReactElement
42
43
  unit?: string
43
44
  delta?: Delta // A change against a period; `value` prints as given, so pass `'+12%'`, never the fraction 0.12
44
45
  status?: Verdict // The verdict home: dot plus word
45
- sub?: string
46
+ sub?: string // The line under the figure: what it counts or means, or a short part list (`Core 12 · Edge 4`)
47
+ subLines?: 2 | 3 | 1 // Lines the sub may wrap to, 1 to 3 (default 1)
46
48
  subMono?: boolean // The sub line is a time or an id: drawn in the mono face with tabular numerals
47
49
  chart?: BoxSlot // Called only in `ready` and `stale`, in a fixed clipping box of `height` (72 px by default: a 72 px plot, or plot 56 + label row 16 with `axisLabels`)
48
50
  height?: number // The plot's height in px, the height the slot is called with
@@ -51,11 +53,11 @@ StatCard(props: StatCardProps): ReactElement
51
53
  footer?: FrameFooter // Two facts, or a status line with one fact at its end
52
54
  controls?: HeadControls // One or two controls; a third does not compile
53
55
  actions?: HeadActions // One to three header buttons, toggles or a check menu; a fourth does not compile
54
- menu?: CardMenu
56
+ menu?: CardMenu // Actions only, data never a node
55
57
  contextMenu?: boolean // Whether a right click, a long press or Shift+F10 on the card opens its menu at the pointer
56
58
  ```
57
59
 
58
- `CardMenu`, `Delta`, `Empty`, `FrameBadge`, `FrameFacts`, `FrameFooter`, `HeadActions`, `HeadControls`, `LegendEntry`, `Phase`, `QueryStateLike`, `StatCardProps`, `Verdict` import from `basalt-ui/cards`: `import type { CardMenu, Delta, Empty, FrameBadge, FrameFacts, FrameFooter, HeadActions, HeadControls, LegendEntry, Phase, QueryStateLike, StatCardProps, Verdict } from 'basalt-ui/cards'`.
60
+ `CardMenu`, `Delta`, `Empty`, `FrameBadge`, `FrameFacts`, `FrameFooter`, `HeadActions`, `HeadControls`, `InfoEntry`, `LegendEntry`, `Phase`, `QueryStateLike`, `StatCardProps`, `Verdict` import from `basalt-ui/cards`: `import type { CardMenu, Delta, Empty, FrameBadge, FrameFacts, FrameFooter, HeadActions, HeadControls, InfoEntry, LegendEntry, Phase, QueryStateLike, StatCardProps, Verdict } from 'basalt-ui/cards'`.
59
61
 
60
62
  `BoxSlot`, `IconComponent`, `LinkHref` import from `basalt-ui`: `import type { BoxSlot, IconComponent, LinkHref } from 'basalt-ui'`.
61
63
 
package/docs/testing.md CHANGED
@@ -15,6 +15,9 @@ import { installDomShims, settled, SLOTS } from 'basalt-ui/testing'
15
15
  | `settled(options?)` | Resolves when the Base UI mount tick has passed and the router and query client you pass are idle. |
16
16
  | `SLOTS` | Every `data-slot` each `ui/*` module renders. Select parts with it, never by class. |
17
17
 
18
+ The browser lane takes `quality` ([quality](quality.md)), `expectShellInvariants`, and the pseudo-locale
19
+ below.
20
+
18
21
  Call `installDomShims()` once, from the test preload, before the first render. Pass the router and
19
22
  the client to `settled` when the test has them: `await settled({ router, queryClient })`. With no
20
23
  options it is the mount tick alone.
@@ -40,6 +43,67 @@ options it is the mount tick alone.
40
43
  - ScrollArea, Slider and virtual lists are not meaningfully testable in a DOM runner; test the
41
44
  state they feed, and check the rest in the browser.
42
45
 
46
+ ## Interface tests: named states in a real browser
47
+
48
+ `basalt-ui shot` renders routes for a design round and compares nothing. A regression gate over
49
+ screens that need state (a lost connection, a half-filled form) is
50
+ [Playwright Test](https://playwright.dev/docs/test-snapshots) in the app: it owns the names, the
51
+ baselines, the threshold, the update mode and the clock, and basalt-ui adds the two checks it lacks.
52
+
53
+ - **A test page that mounts a state by name.** A second Vite entry renders the app with fixture
54
+ ports (client, storage, clock, fetch) chosen by `?state=&locale=`. Nothing there opens a socket.
55
+ - **A case list.** One module of `{ feature, state, width, theme, locale }`; the test name and the
56
+ PNG are `<feature>--<state>--<width>--<theme>[--<locale>]`. `--grep` selects a part of it.
57
+ - **Baselines.** `snapshotPathTemplate: '{testDir}/baselines/{arg}{ext}'`, compare with
58
+ `toHaveScreenshot` and its `threshold` or `maxDiffPixels`, rewrite with `--update-snapshots`.
59
+ - **Two runs, the same bytes.** `page.clock.setFixedTime` and `reducedMotion: 'reduce'` before
60
+ `goto`, `animations: 'disabled'` and `caret: 'hide'` on the shot, a fixed `deviceScaleFactor`,
61
+ `locale` and `timezoneId`. Fonts differ between hosts, so take and compare baselines in one pinned
62
+ Playwright image.
63
+
64
+ ```ts
65
+ // test/ui/states.ui.ts
66
+ import { expect, test } from '@playwright/test'
67
+ import { quality } from 'basalt-ui/testing'
68
+ import { CASES } from './cases'
69
+
70
+ for (const { feature, state, width, theme, locale } of CASES) {
71
+ const name = [feature, state, width, theme, ...(locale === 'en' ? [] : [locale])].join('--')
72
+ test(name, async ({ page }) => {
73
+ await page.setViewportSize({ width, height: 800 })
74
+ await page.clock.setFixedTime(new Date('2026-01-15T10:00:00Z'))
75
+ await page.emulateMedia({ reducedMotion: 'reduce' })
76
+ await quality.setScheme(page, theme)
77
+ await page.goto(`/test/ui/?state=${feature}--${state}&locale=${locale}`)
78
+ await page.getByTestId(`${state}-ready`).waitFor()
79
+ await expect(page).toHaveScreenshot(`${name}.png`, { animations: 'disabled', caret: 'hide' })
80
+ await quality.textOverflow(page, { allow: ['[data-testid="room-title"]'] })
81
+ })
82
+ }
83
+ ```
84
+
85
+ `quality.textOverflow` fails on text that is ellipsised, clipped, wider than its box or off the
86
+ screen, and on a placeholder wider than its field, and names each by `data-testid`. List a cut you
87
+ want in `allow`. A box that scrolls sideways is never a finding, and inside a scroller (the shell's
88
+ own page is one) the screen edge is not either: `quality.overflow` holds the document.
89
+
90
+ **The pseudo-locale** shows a clipped label and a literal no catalogue holds before a translator
91
+ does. The test page loads it instead of a language when `locale` is `pseudo`:
92
+
93
+ ```tsx
94
+ import { i18n } from '@lingui/core'
95
+ import { BasaltProvider } from 'basalt-ui'
96
+ import { pseudoBasaltMessages, pseudoMessages } from 'basalt-ui/testing'
97
+
98
+ i18n.load('en', pseudoMessages(en, de)) // your compiled catalogues
99
+ i18n.activate('en')
100
+ const root = (
101
+ <BasaltProvider messages={pseudoBasaltMessages()}>
102
+ <App />
103
+ </BasaltProvider>
104
+ )
105
+ ```
106
+
43
107
  ## One test, two runners
44
108
 
45
109
  The kit's own tests run under happy-dom (the plain `bun test`) and under jsdom. A process holds one
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: useLocalControl
3
- use when: 'a control''s value lives as long as one dialog, sheet or popover and nothing outside it reads it'
3
+ use when: 'a control''s value lives as long as one dialog, sheet, popover or card and nothing outside it reads it'
4
4
  never when: 'the value should survive a reload (use `persisted`), appear in a shared link (use a router field) or is another store''s (use `externalField`)'
5
5
  instead: [externalField]
6
6
  subpath: basalt-ui/controls
@@ -26,3 +26,10 @@ useLocalControl<T>(initial: T | (() => T)): LocalControl<T>
26
26
  const view = useLocalControl<'list' | 'grid'>('list')
27
27
  <FormField label="Layout" control={view}>{(bind) => <Segmented {...bind} options={LAYOUTS} />}</FormField>
28
28
  ```
29
+
30
+ ## Example
31
+
32
+ ```tsx
33
+ const window = useLocalControl('24h', { key: 'window', kind: 'enum', options: WINDOWS })
34
+ <ChartCard title="Throughput" controls={filterSlot([spec(window, 'Window', { as: 'segmented' })])} chart={…} />
35
+ ```
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: useRuns
3
+ use when: 'a part of your own follows a queue''s runs'
4
+ never when: 'a button or a list is enough (use `RunButton`, `RunList`)'
5
+ instead: [RunButton, RunList]
6
+ subpath: basalt-ui/page
7
+ peers: []
8
+ slots: []
9
+ ---
10
+
11
+ # useRuns
12
+
13
+ The queue's runs, newest first, re-read on every change. For a control that is not a button: a
14
+ slider that holds the picked value until its command has answered.
15
+
16
+ ## Signature
17
+
18
+ ```ts
19
+ useRuns<D>(queue: RunQueue<D>): readonly Run<D>[]
20
+ start: (task: RunTask<D>) => number // Calls the task now and returns the run's id
21
+ dismiss: (id: number) => void // Removes a finished run
22
+ runs: () => readonly Run<D>[] // Newest first; stable until something changes
23
+ subscribe: (listener: () => void) => () => void
24
+ ```
25
+
26
+ `Run`, `RunQueue`, `RunTask` import from `basalt-ui/page`: `import type { Run, RunQueue, RunTask } from 'basalt-ui/page'`.
27
+
28
+ ## Example
29
+
30
+ ```tsx
31
+ const pending = useRuns(commands).find((run) => run.task === 'volume')
32
+ ```
package/docs/vite.md CHANGED
@@ -67,8 +67,18 @@ The head (transformIndexHtml), replacing 2.x basaltAppPlugin:
67
67
  There is no anti-FOUC <style>: the script stamps data-theme before paint, tokens.css paints.
68
68
  app: { name, shortName, description, display, startUrl, scope, id, backgroundColor, icons,
69
69
  darkreader, seo, manifest, serviceWorker } adds site.webmanifest, its link, the icons
70
- that name rel, the apple and darkreader metas, SEO tags, and with serviceWorker the optional
71
- peer vite-plugin-pwa.
70
+ that name rel, the apple and darkreader metas, SEO tags, and the service worker.
71
+
72
+ app.serviceWorker (off by default):
73
+ 'shell' basalt's own worker, no dependency. A build emits sw.js and registers it from
74
+ index.html; a dev server gets neither. It precaches the page and the built scripts,
75
+ styles, fonts and images. The page is network first, the precached copy offline; a
76
+ precached asset is cache first. Every other request, public/ files and /api
77
+ included, is left to the browser, and nothing is cached at runtime. A new build's
78
+ worker takes over once the app's tabs are closed. An app that has its own
79
+ public/sw.js deletes it and its register() call.
80
+ true | object workbox through the optional peer vite-plugin-pwa; the object is merged over the
81
+ defaults. Absent peer: one warning, no worker.
72
82
 
73
83
  Open: F9 (HMR on an edited ejected file in a real dev server, with optimizeDeps.exclude) is not
74
84
  claimed here; it is recorded open for v3-spike-f3-eject. Until it passes, restart the dev server