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
@@ -20,7 +20,7 @@ import { readLabel } from './label'
20
20
  import { useLocale } from './use-locale'
21
21
  import { CardMenu } from './card-menu'
22
22
  import { cn } from './cn'
23
- import { InfoGlyph } from './info-hint'
23
+ import { InfoGlyph, InfoText } from './info-hint'
24
24
  import { AppLink } from './link'
25
25
  import type {
26
26
  FrameBadge,
@@ -295,6 +295,26 @@ export function HeadTool({ action }: { action: HeadAction }): ReactElement {
295
295
  return <ButtonTool action={action} />
296
296
  }
297
297
 
298
+ const TITLE = 'm-0 min-w-0 text-md font-semibold tracking-tight text-foreground'
299
+ const TITLE_ONE_LINE = 'truncate'
300
+ const TITLE_WRAPPED = 'leading-5 [overflow-wrap:anywhere]'
301
+
302
+ /** The title: a heading of the given level, `h3` without one. */
303
+ function Title({
304
+ level,
305
+ wrap,
306
+ children,
307
+ }: {
308
+ level: FrameHead['headingLevel']
309
+ wrap: boolean
310
+ children: ReactNode
311
+ }): ReactElement {
312
+ const className = cn(TITLE, wrap ? TITLE_WRAPPED : TITLE_ONE_LINE)
313
+ if (level === 2) return <h2 className={className}>{children}</h2>
314
+ if (level === 4) return <h4 className={className}>{children}</h4>
315
+ return <h3 className={className}>{children}</h3>
316
+ }
317
+
298
318
  export type FrameHeadBandProps = Omit<FrameHead, 'title'> & {
299
319
  /** `undefined` only in a Suspense fallback: the title is a bar. */
300
320
  title: string | undefined
@@ -304,6 +324,8 @@ export type FrameHeadBandProps = Omit<FrameHead, 'title'> & {
304
324
  contextMenu?: boolean | undefined
305
325
  /** The standard items a right click lists under `menu`. */
306
326
  standard?: ((card: HTMLElement) => readonly Action[]) | undefined
327
+ /** The title wraps onto further lines instead of ending in an ellipsis: a card whose title is a sentence. */
328
+ wrap?: boolean | undefined
307
329
  /** The data-slot prefix of the controls and menu boxes (`chart`, `data-panel`, `stat`, `card`). */
308
330
  slot: string
309
331
  /** The frame's own tools after the actions (a chart card's expand). */
@@ -323,6 +345,7 @@ export function FrameHeadBand({
323
345
  subtitle,
324
346
  icon: Icon,
325
347
  info,
348
+ headingLevel,
326
349
  badge,
327
350
  actions: given = [],
328
351
  controls,
@@ -332,6 +355,7 @@ export function FrameHeadBand({
332
355
  slot,
333
356
  tools,
334
357
  raised = false,
358
+ wrap = false,
335
359
  }: FrameHeadBandProps): ReactElement {
336
360
  const t = useMessages(common)
337
361
  const actions = given.filter((action): action is HeadAction => action !== undefined)
@@ -349,17 +373,19 @@ export function FrameHeadBand({
349
373
  </span>
350
374
  )}
351
375
  <div className="min-w-0 flex-1">
352
- <div className="flex h-5 min-w-0 items-center gap-1.5">
376
+ <div
377
+ className={cn('flex min-w-0 gap-1.5', wrap ? 'min-h-5 items-start' : 'h-5 items-center')}
378
+ >
353
379
  {title === undefined ? (
354
380
  <div aria-hidden="true" className={cn(BAR, 'h-4 w-32')} />
355
381
  ) : (
356
- <p className="m-0 min-w-0 truncate text-md font-semibold tracking-tight text-foreground">
382
+ <Title level={headingLevel} wrap={wrap}>
357
383
  {title}
358
- </p>
384
+ </Title>
359
385
  )}
360
- {title !== undefined && info !== undefined && (
386
+ {title !== undefined && info !== undefined && info.length > 0 && (
361
387
  <InfoGlyph title={title} className={cn(z, '-my-0.5 -ml-1')}>
362
- {info}
388
+ <InfoText info={info} />
363
389
  </InfoGlyph>
364
390
  )}
365
391
  {/* An empty label is the slot a frame keeps while it has no word: it draws no pill. */}
@@ -15,6 +15,7 @@ import { cn } from './cn'
15
15
  import { useFormat } from './format'
16
16
  import { useLocale } from './use-locale'
17
17
  import { formatValue } from './frame-figure'
18
+ import { InfoGlyph } from './info-hint'
18
19
  import { PhaseBoundary } from './phase-boundary'
19
20
  import { Facts } from './frame-head'
20
21
  import { cards } from './messages/cards'
@@ -142,16 +143,20 @@ export const factsIn = (facts: FootFacts): Fact[] => facts.flatMap((fact) => (fa
142
143
  function FactItem({ fact, phase }: { fact: Fact; phase: RegionPhase }): ReactElement {
143
144
  const format = useFormat()
144
145
  const dashed = phase === 'error' || phase === 'empty'
146
+ const shown = formatValue(fact.value, format)
145
147
  return (
146
- <dl className="m-0 flex min-w-0 items-baseline gap-2">
147
- <dt className="truncate text-muted-foreground">{fact.label}</dt>
148
+ <dl className="m-0 flex min-w-0 items-center gap-2">
149
+ <dt className="flex min-w-0 items-center text-muted-foreground">
150
+ <span>{fact.label}</span>
151
+ {fact.info !== undefined && <InfoGlyph title={fact.label}>{fact.info}</InfoGlyph>}
152
+ </dt>
148
153
  <dd
149
154
  data-state={phase === 'other' ? undefined : phase}
150
155
  data-monospace={fact.mono === true ? '' : undefined}
151
156
  className={cn(
152
- 'm-0 text-md font-semibold tabular-nums',
157
+ 'm-0 flex items-center text-md font-semibold tabular-nums',
153
158
  fact.mono === true && 'font-mono',
154
- dashed ? 'text-muted-foreground' : 'text-foreground',
159
+ dashed || shown === null ? 'text-muted-foreground' : 'text-foreground',
155
160
  )}
156
161
  >
157
162
  {phase === 'loading' ? (
@@ -159,7 +164,10 @@ function FactItem({ fact, phase }: { fact: Fact; phase: RegionPhase }): ReactEle
159
164
  ) : dashed ? (
160
165
  '–'
161
166
  ) : (
162
- (formatValue(fact.value, format) ?? '–')
167
+ (shown ?? '–')
168
+ )}
169
+ {phase === 'other' && shown === null && fact.reason !== undefined && (
170
+ <InfoGlyph title={fact.label}>{fact.reason}</InfoGlyph>
163
171
  )}
164
172
  </dd>
165
173
  </dl>
@@ -170,7 +178,7 @@ function FactItem({ fact, phase }: { fact: Fact; phase: RegionPhase }): ReactEle
170
178
  * The footer on the card shell: two facts spread across the width, or a status line with one fact at
171
179
  * its end; a legend, when the frame puts it here, leads on the start side. While the frame loads a
172
180
  * value or the status line is a bar, once it failed or is empty a value is a dash and the line is
173
- * drawn as the page gave it (the page gates its own words); the labels stay and the row keeps its height. Below `regular` a footer with a legend
181
+ * drawn as the page gave it (the page gates its own words); the labels stay and a row holds its height unless its facts wrap onto a second row. Below `regular` a footer with a legend
174
182
  * wraps the legend over the facts.
175
183
  */
176
184
  export function FrameFooterRow({
@@ -196,11 +204,13 @@ export function FrameFooterRow({
196
204
  <div
197
205
  data-slot={`${slot}-footer`}
198
206
  className={cn(
199
- 'mt-auto flex h-10 items-center justify-between gap-x-4 px-(--basalt-card-edge) text-xs',
207
+ 'mt-auto flex items-center justify-between gap-x-4 px-(--basalt-card-edge) text-xs',
208
+ // Parts that do not fit one row stack, each label whole.
209
+ 'min-h-10 flex-wrap gap-y-1 py-1.5',
200
210
  // Below `regular` a legend or a status line stacks its parts in rows of one height, so no
201
211
  // phase (a bar for a value, a held line) wraps differently from the ready frame.
202
212
  stacked &&
203
- '@max-regular:h-auto @max-regular:flex-col @max-regular:items-stretch @max-regular:justify-start @max-regular:py-2',
213
+ '@max-regular:flex-col @max-regular:flex-nowrap @max-regular:items-stretch @max-regular:justify-start @max-regular:py-2',
204
214
  )}
205
215
  >
206
216
  {legend !== undefined && <div className="flex min-h-6 min-w-0 items-center">{legend}</div>}
@@ -1,8 +1,10 @@
1
1
  import { useEffect, useId, useRef, useState } from 'react'
2
2
  import type { PointerEvent, ReactElement, ReactNode } from 'react'
3
3
  import { cn } from './cn'
4
+ import { AppLink } from './link'
4
5
  import { base } from './messages/base'
5
6
  import { useMessages } from './messages/use-messages'
7
+ import type { InfoEntry } from './phase'
6
8
 
7
9
  /** The pointer rests this long on the glyph before the panel opens, and may be gone this long before it closes. */
8
10
  const HOVER_MS = 150
@@ -18,6 +20,30 @@ const holdsAnotherPopover = (glyph: HTMLElement): boolean =>
18
20
  (other) => !other.hasAttribute('data-info-panel') && !other.contains(glyph),
19
21
  )
20
22
 
23
+ /** The definition: one block per entry. Spans only, as the glyph's panel sits where a paragraph may. */
24
+ export function InfoText({ info }: { info: string | readonly InfoEntry[] }): ReactNode {
25
+ if (typeof info === 'string') return info
26
+ return info.map((entry, i) => (
27
+ // oxlint-disable-next-line jsx-a11y/prefer-tag-over-role -- a <p> cannot sit in the glyph's span panel
28
+ <span key={i} role="paragraph" data-slot="info-paragraph" className="block not-first:mt-1.5">
29
+ {typeof entry === 'string' ? (
30
+ entry
31
+ ) : (
32
+ <>
33
+ {entry.text}{' '}
34
+ <AppLink
35
+ href={entry.href}
36
+ data-slot="info-link"
37
+ className="font-medium text-foreground underline underline-offset-2 focus-ring"
38
+ >
39
+ {entry.label}
40
+ </AppLink>
41
+ </>
42
+ )}
43
+ </span>
44
+ ))
45
+ }
46
+
21
47
  export type InfoGlyphProps = {
22
48
  /** The panel's title and the glyph's name (`What <title> means`). */
23
49
  title: string
@@ -37,6 +37,13 @@ export const MARK_COMMON: Tone = 'good'
37
37
  export const isQuietTone = (tone: Tone, common: Tone = MARK_COMMON): boolean =>
38
38
  tone === 'neutral' || tone === common
39
39
 
40
- /** The fill class of one mark: quiet for `neutral` and the common tone, full otherwise. */
41
- export const markFill = (tone: Tone, common: Tone = MARK_COMMON): string =>
42
- (isQuietTone(tone, common) ? MARK_QUIET : MARK_FULL)[tone]
40
+ /**
41
+ * The fill class of one mark: quiet for `neutral` and the common tone, full otherwise. `quiet`
42
+ * overrides that for one mark: `true` draws any tone quiet (two parts of one hue told apart),
43
+ * `false` draws any tone, `neutral` included, at full strength.
44
+ */
45
+ export const markFill = (
46
+ tone: Tone,
47
+ common: Tone = MARK_COMMON,
48
+ quiet?: boolean | undefined,
49
+ ): string => ((quiet ?? isQuietTone(tone, common)) ? MARK_QUIET : MARK_FULL)[tone]
@@ -51,6 +51,8 @@ export type SparklineBase = {
51
51
  height: number | 'fill'
52
52
  width?: number
53
53
  form?: 'line' | 'area'
54
+ /** The line, its area and the now dot in a status tone; `neutral` (default) is the muted ink. */
55
+ tone?: Tone | undefined
54
56
  /** A value, the `'mean'`, or a target range: two dashed lines with a faint band between. */
55
57
  reference?: number | 'mean' | { min: number; max: number }
56
58
  /** A second series in muted ink on the same scale, point for point (the period before). */
@@ -82,12 +84,12 @@ export type SparklineProps = SparklineBase & MarkName
82
84
 
83
85
  export type MiniBarsProps = Omit<
84
86
  SparklineBase,
85
- 'points' | 'form' | 'reference' | 'compare' | 'threshold'
87
+ 'points' | 'form' | 'reference' | 'compare' | 'threshold' | 'tone'
86
88
  > &
87
89
  MarkName & {
88
90
  points: readonly MiniBarPoint[]
89
91
  /**
90
- * `bars` (default) from a zero baseline; `ticks` of equal height, one per item (a fleet by state);
92
+ * `bars` (default) from a zero baseline; `ticks`, one per item, whose height ranks its state (a fleet by state);
91
93
  * `capsules` whose height is the value (each run's duration), an item without one a dot.
92
94
  */
93
95
  form?: 'bars' | 'ticks' | 'capsules'
@@ -6,7 +6,7 @@ import type { BasaltMessages } from './index'
6
6
  * controls. Their own area, so a page that draws no chain (a `DataTable`, a `RowList`) ships none.
7
7
  */
8
8
  export type ChainMessages = Record<
9
- 'chain.blocks' | 'chain.fit' | 'chain.focusNone' | 'chain.controls',
9
+ 'chain.blocks' | 'chain.planned' | 'chain.fit' | 'chain.focusNone' | 'chain.controls',
10
10
  string
11
11
  > &
12
12
  Record<'chain.zoomLevel', (f: Format, scale: number) => string> &
@@ -17,6 +17,7 @@ export type ChainMessages = Record<
17
17
 
18
18
  export const chain = {
19
19
  'chain.blocks': 'Blocks',
20
+ 'chain.planned': 'Planned',
20
21
  'chain.waitsOn': (_f, names) => `Waits on ${names}`,
21
22
  'chain.alsoWaitsOn': (_f, names) => `Also waits on ${names}`,
22
23
  'chain.fit': 'Fit to width',
@@ -56,6 +56,8 @@ import { menu } from './menu'
56
56
  import type { MenuMessages } from './menu'
57
57
  import { page } from './page'
58
58
  import type { PageMessages } from './page'
59
+ import { runs } from './runs'
60
+ import type { RunsMessages } from './runs'
59
61
  import { schedule } from './schedule'
60
62
  import type { ScheduleMessages } from './schedule'
61
63
  import { select } from './select'
@@ -88,6 +90,7 @@ export type BasaltMessages = SelectMessages &
88
90
  ChartsMessages &
89
91
  AiMessages &
90
92
  PageMessages &
93
+ RunsMessages &
91
94
  ScheduleMessages &
92
95
  CommonMessages &
93
96
  ShellMessages &
@@ -119,6 +122,7 @@ export const en: BasaltMessages = {
119
122
  ...charts,
120
123
  ...ai,
121
124
  ...page,
125
+ ...runs,
122
126
  ...schedule,
123
127
  ...common,
124
128
  ...shell,
@@ -0,0 +1,40 @@
1
+ import type { Format } from '../format'
2
+ import type { BasaltMessages } from './index'
3
+
4
+ /**
5
+ * The strings `RunList` prints, keys under the `runs.` prefix: the list's name, the waiting and
6
+ * running words, the line under a run (waiting, elapsed, finished), the failure title and the result
7
+ * steps. Done and the dismiss button are `common.*`.
8
+ */
9
+ export type RunsMessages = Record<
10
+ | 'runs.list'
11
+ | 'runs.waiting'
12
+ | 'runs.running'
13
+ | 'runs.waitingHint'
14
+ | 'runs.stepOk'
15
+ | 'runs.stepFailed',
16
+ string
17
+ > &
18
+ Record<'runs.elapsed' | 'runs.finished', (f: Format, ms: number) => string> &
19
+ Record<'runs.failed', (f: Format, label: string) => string> &
20
+ Record<'runs.steps', (f: Format, count: number) => string>
21
+
22
+ /** Under a minute a run's time keeps a decimal, so a quick command does not read "0s". */
23
+ function took(f: Format, ms: number): string {
24
+ return ms < 60_000
25
+ ? f.number(ms / 1000, { style: 'unit', unit: 'second', maximumFractionDigits: 1 })
26
+ : f.duration(ms, 'compact')
27
+ }
28
+
29
+ export const runs = {
30
+ 'runs.list': 'Runs',
31
+ 'runs.waiting': 'Waiting',
32
+ 'runs.running': 'Running',
33
+ 'runs.waitingHint': 'Waiting for the command before it.',
34
+ 'runs.stepOk': 'ok',
35
+ 'runs.stepFailed': 'failed',
36
+ 'runs.elapsed': (f, ms) => `Running for ${f.duration(ms, 'compact')}.`,
37
+ 'runs.finished': (f, ms) => `Finished in ${took(f, ms)}.`,
38
+ 'runs.failed': (_f, label) => `${label}: failed`,
39
+ 'runs.steps': (f, count) => `Steps (${f.number(count)})`,
40
+ } satisfies Partial<BasaltMessages>
package/src/core/phase.ts CHANGED
@@ -61,9 +61,14 @@ export type FrameState = {
61
61
  */
62
62
  export type Fact = {
63
63
  label: string
64
- value: string | number
64
+ /** `null` is a value that is not there: a muted dash, never zero. Give a `reason` when the reader will ask why. */
65
+ value: string | number | null
65
66
  /** The value is a time or an id: drawn in the mono face with tabular numerals. */
66
67
  mono?: boolean | undefined
68
+ /** Why a `null` value is missing, one short phrase (`Not reported by this host`): the dash gets a glyph that opens it. Ignored while the frame loads, failed or is empty. */
69
+ reason?: string | undefined
70
+ /** What the label means, one or two sentences: a glyph after the label opens it. */
71
+ info?: string | undefined
67
72
  }
68
73
 
69
74
  /**
@@ -133,13 +138,28 @@ export type FrameFigure = {
133
138
  facts?: FrameFacts | undefined
134
139
  }
135
140
 
141
+ /**
142
+ * One entry of a frame's `info`: a paragraph of plain words, or a paragraph that ends with a link
143
+ * (`Read more in the language guide`). The link draws through the provider's link, inside the panel.
144
+ *
145
+ * @useWhen an info paragraph points to a longer explanation, a guide or a definition elsewhere
146
+ * @neverWhen the words alone explain the figure (a plain string entry)
147
+ * @instead FrameHead
148
+ * @example
149
+ * { text: 'A held signal waits for a person.', href: 'https://example.com/guide', label: 'Read more' }
150
+ */
151
+ export type InfoEntry = string | { text: string; href: LinkHref; label: string }
152
+
136
153
  /** The header every frame shares. An `undefined` field is an absent one. */
137
154
  export type FrameHead = {
138
155
  title: string
139
156
  /** A context line under the title: a string, or facts joined by the separator dot. */
140
157
  subtitle?: FrameFacts | undefined
141
158
  icon?: IconComponent | undefined
142
- info?: string | undefined
159
+ /** 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. */
160
+ info?: string | readonly InfoEntry[] | undefined
161
+ /** 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`. */
162
+ headingLevel?: 2 | 3 | 4 | undefined
143
163
  /** The chip beside the title. */
144
164
  badge?: FrameBadge | undefined
145
165
  }
package/src/core/ports.ts CHANGED
@@ -137,13 +137,25 @@ export type LinkHref = NavTarget | ExternalHref
137
137
  */
138
138
  export type LinkComponent = (props: {
139
139
  href: string | NavTarget
140
+ tabIndex?: number | undefined
141
+ title?: string | undefined
140
142
  /** `path`: current while the path matches, whatever the search (a route `InnerNav` item under a filter). Default: path and search. */
141
143
  match?: 'path'
142
144
  className?: string
143
145
  'data-slot'?: string
144
146
  children?: ReactNode
145
- 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false'
147
+ 'aria-current'?:
148
+ | 'page'
149
+ | 'step'
150
+ | 'location'
151
+ | 'date'
152
+ | 'time'
153
+ | boolean
154
+ | 'true'
155
+ | 'false'
156
+ | undefined
146
157
  'aria-label'?: string
158
+ 'aria-describedby'?: string | undefined
147
159
  onClick?: (event: never) => void
148
160
  }) => ReactNode
149
161
 
@@ -29,6 +29,8 @@ export type LiveBinding = { start(): () => void }
29
29
  export type BasaltProviderProps = BasaltIntlProps & {
30
30
  /** Stamped on `<html data-theme>` and stored raw. Omitted: the boot script owns the first paint and nothing is written. */
31
31
  scheme?: Scheme
32
+ /** `false`: the scheme is stamped on `<html data-theme>` but not stored under `basalt:scheme`, for an app that keeps its own preference. Default `true`. */
33
+ persist?: boolean
32
34
  /** `<html lang>`, written in an effect. Defaults to `locale`, else `en`. */
33
35
  lang?: string
34
36
  /**
@@ -46,10 +48,11 @@ export type BasaltProviderProps = BasaltIntlProps & {
46
48
  }
47
49
 
48
50
  /** `auto` is the attribute absent (the always-emitted OS media fallback applies). Storage may throw. */
49
- function applyScheme(scheme: Scheme): void {
51
+ function applyScheme(scheme: Scheme, persist: boolean): void {
50
52
  const root = document.documentElement
51
53
  if (scheme === 'auto') root.removeAttribute('data-theme')
52
54
  else root.setAttribute('data-theme', scheme)
55
+ if (!persist) return
53
56
  try {
54
57
  localStorage.setItem(SCHEME_KEY, scheme)
55
58
  } catch {
@@ -77,6 +80,7 @@ function applyScheme(scheme: Scheme): void {
77
80
  */
78
81
  export function BasaltProvider({
79
82
  scheme,
83
+ persist = true,
80
84
  locale,
81
85
  timeZone,
82
86
  messages,
@@ -86,8 +90,8 @@ export function BasaltProvider({
86
90
  children,
87
91
  }: BasaltProviderProps): ReactNode {
88
92
  useEffect(() => {
89
- if (scheme !== undefined) applyScheme(scheme)
90
- }, [scheme])
93
+ if (scheme !== undefined) applyScheme(scheme, persist)
94
+ }, [scheme, persist])
91
95
 
92
96
  useEffect(() => {
93
97
  document.documentElement.lang = lang
@@ -50,14 +50,17 @@ function apply(value: Scheme): void {
50
50
 
51
51
  /**
52
52
  * `setScheme('dark' | 'light' | 'auto')` applies, stores the declared key (default `basalt:scheme`)
53
- * and mirrors the declared cookie. `setScheme()` re-reads storage and applies, overriding any attribute: call it after an
53
+ * 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
54
54
  * async restore (same-tab localStorage writes fire no storage event).
55
55
  *
56
56
  * @useWhen a control or a command switches the color scheme, or an async restore must re-apply the stored one
57
57
  * @neverWhen the app picks the first scheme at mount (pass `BasaltProvider` `scheme`), or code writes `data-theme` or `basalt:scheme` by hand
58
58
  * @instead BasaltProvider
59
59
  */
60
- export function setScheme(value?: Scheme, options: { cookie?: string; key?: string } = {}): void {
60
+ export function setScheme(
61
+ value?: Scheme,
62
+ options: { cookie?: string; key?: string; persist?: boolean } = {},
63
+ ): void {
61
64
  if (typeof document === 'undefined') return
62
65
  if (options.cookie) declaredCookie = options.cookie
63
66
  if (options.key) declaredKey = options.key
@@ -67,6 +70,7 @@ export function setScheme(value?: Scheme, options: { cookie?: string; key?: stri
67
70
  return
68
71
  }
69
72
  apply(value)
73
+ if (options.persist === false) return
70
74
  try {
71
75
  localStorage.setItem(declaredKey, value)
72
76
  } catch {
@@ -24,29 +24,56 @@ type Form = NonNullable<MiniBarsProps['form']>
24
24
 
25
25
  /** The row of items per form: how wide an item's slot is and how the slots sit in the box. */
26
26
  const STRIP: Readonly<Record<Form, string>> = {
27
- bars: 'justify-center gap-0.75',
28
- ticks: 'h-full max-h-4 justify-start gap-0.5',
29
- capsules: 'justify-start gap-0.75',
27
+ bars: 'justify-center',
28
+ ticks: 'h-full max-h-4 justify-start',
29
+ capsules: 'justify-start',
30
30
  }
31
+ /** The gap a form asks for at normal density, as a step of the spacing unit (`--basalt-space`). */
32
+ const GAP_STEP: Readonly<Record<Form, number>> = { bars: 0.75, ticks: 0.5, capsules: 0.75 }
31
33
  const SLOT: Readonly<Record<Form, string>> = {
32
34
  bars: 'max-w-6',
33
35
  ticks: 'max-w-1',
34
36
  capsules: 'max-w-2.5',
35
37
  }
36
38
 
39
+ /**
40
+ * The gap between items: the form's gap, shrunk so `n` one-pixel items always fit the strip. Every
41
+ * item is at least a pixel, so the gaps may take the rest of the width and no more.
42
+ */
43
+ function gapOf(form: Form, n: number): string {
44
+ return `max(0px, min(calc(var(--basalt-space) * ${GAP_STEP[form]}), calc((100% - ${n}px) / ${Math.max(n - 1, 1)})))`
45
+ }
46
+
47
+ /**
48
+ * A tick's height by state, percent of the strip, so the state is told by shape as well as hue: the
49
+ * quiet `neutral` is shortest, the `common` tone next, the exceptions taller, `bad` the full strip.
50
+ */
51
+ const TICK_HEIGHT: Readonly<Record<Tone, number>> = {
52
+ neutral: 40,
53
+ good: 80,
54
+ accent: 80,
55
+ info: 80,
56
+ warn: 80,
57
+ bad: 100,
58
+ }
59
+ /** The common tone's tick, whichever tone the page names common. */
60
+ const TICK_COMMON = 60
61
+
37
62
  /** The tallest capsule is the box; a run too short to draw keeps a round one this tall. */
38
63
  const CAPSULE_FLOOR = 'min-h-2'
39
64
 
40
65
  /**
41
- * A row of small marks, one per item, with the state of each: `bars` from a zero baseline, `ticks` of
42
- * equal height (a fleet by state) or `capsules` whose height is the value (each run's duration; an
43
- * item with a tone and no value is a dot). A `tone` on a point is closed to the tone set: `neutral`
66
+ * A row of small marks, one per item, with the state of each: `bars` from a zero baseline, `ticks`, one per
67
+ * item, whose height ranks its state (a fleet by state) or `capsules` whose height is the value (each run's duration; an
68
+ * 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
69
+ * never reads as a dropped run (a gap, `null`, draws nothing). A `tone` on a point is closed to the tone set: `neutral`
44
70
  * and the `common` one (default `good`) are drawn quiet, every other tone at full strength, so the
45
71
  * exception stands out of the texture. Untoned bars are dim ink with the `highlight` item (default
46
72
  * the last) lit; the lit bar is drawn in the foreground ink, and a host may set `--basalt-spark-now` to recolor it. No
47
73
  * `color`. `sentence` says what the strip shows and is its name; the marks are hidden from it.
48
74
  * Past 120 `bars` each bar stands for a run of items (the `highlight` one first, then an exception
49
- * one), so a count belongs in the sentence; `ticks` and `capsules` draw every item.
75
+ * one), so a count belongs in the sentence; `ticks` and `capsules` draw every item. A tick tells its
76
+ * state by height as well as hue: `neutral` is the shortest, the common tone next, `bad` the full strip.
50
77
  * With `axisLabels` the arrow keys and a pointer walk the items into the middle label; with a
51
78
  * `focus` (`useChartFocus` over the same items) they walk the page's one focus, and the page reads
52
79
  * `focus.readout`. A `StatCard` or a `StatCell` chart slot draws it as it is.
@@ -146,6 +173,7 @@ export function MiniBarsView(
146
173
  // A capped bar keeps the room its off-scale caret takes over it.
147
174
  form !== 'ticks' && (capped.size === 0 ? 'top-0' : 'top-1.5'),
148
175
  )}
176
+ style={{ columnGap: gapOf(form, rows.length) }}
149
177
  >
150
178
  {rows.map((row, i) => (
151
179
  <span
@@ -155,7 +183,7 @@ export function MiniBarsView(
155
183
  data-index={i}
156
184
  {...markItem(focus, i)}
157
185
  className={cn(
158
- 'relative h-full min-w-px flex-1',
186
+ 'relative h-full min-w-0 flex-1',
159
187
  SLOT[form],
160
188
  dimsOthers && i !== active && 'opacity-40',
161
189
  )}
@@ -222,8 +250,16 @@ function Mark(props: {
222
250
  'data-tone': row.tone,
223
251
  'data-lit': on ? '' : undefined,
224
252
  }
225
- if (form === 'ticks')
226
- return <span {...shared} className={cn('absolute inset-0 rounded-full', paint)} />
253
+ if (form === 'ticks') {
254
+ const pct = tone === common ? TICK_COMMON : TICK_HEIGHT[tone]
255
+ return (
256
+ <span
257
+ {...shared}
258
+ className={cn('absolute inset-x-0 bottom-0 rounded-full', paint)}
259
+ style={{ height: `${pct}%` }}
260
+ />
261
+ )
262
+ }
227
263
  if (form === 'capsules') {
228
264
  if (row.v === null) {
229
265
  // A skipped item is a dot; an item with neither a value nor a tone is a gap.
@@ -246,19 +282,27 @@ function Mark(props: {
246
282
  />
247
283
  )
248
284
  }
249
- if (rect === null || rect.height === 0) return null
285
+ if (rect === null) return null
286
+ // A counted zero is a 2 px mark on the zero line in a firmer ink, so it reads as a count, not a gap.
287
+ const zero = rect.height === 0
250
288
  return (
251
289
  <span
252
290
  {...shared}
253
291
  className={cn(
254
292
  'absolute inset-x-0',
255
293
  // The data end is rounded: the top of a bar above zero, the bottom of one below.
256
- (row.v ?? 0) < 0 ? 'rounded-b-[3px]' : 'rounded-t-[3px]',
257
- paint ?? (on ? '' : 'bg-foreground/34 dark:bg-foreground/38'),
294
+ zero ? 'h-0.5 rounded-full' : (row.v ?? 0) < 0 ? 'rounded-b-[3px]' : 'rounded-t-[3px]',
295
+ paint ??
296
+ (on
297
+ ? ''
298
+ : zero
299
+ ? 'bg-foreground/60 dark:bg-foreground/64'
300
+ : 'bg-foreground/34 dark:bg-foreground/38'),
258
301
  )}
259
302
  style={{
260
- top: `${rect.y}%`,
261
- height: `${rect.height}%`,
303
+ // A zero's tick ends on the zero line and never starts above the strip's top edge.
304
+ top: zero ? `max(0px, calc(${rect.y}% - 2px))` : `${rect.y}%`,
305
+ height: zero ? undefined : `${rect.height}%`,
262
306
  ...(on && !toned ? { background: 'var(--basalt-spark-now, var(--color-foreground))' } : {}),
263
307
  }}
264
308
  />