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
@@ -0,0 +1,151 @@
1
+ import type { ReactElement } from 'react'
2
+ import { cn } from '../core/cn'
3
+ import { common } from '../core/messages/common'
4
+ import { runs as runMessages } from '../core/messages/runs'
5
+ import { useMessages } from '../core/messages/use-messages'
6
+ import { useNow } from '../core/use-now'
7
+ import { Alert } from '../ui/alert'
8
+ import { Badge } from '../ui/badge'
9
+ import { Button } from '../ui/button'
10
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../ui/collapsible'
11
+ import { Status } from '../ui/status'
12
+ import { useRuns } from './run-queue'
13
+ import type { Run, RunQueue } from './run-queue'
14
+
15
+ /** How long a finished run stays on the list, ms. A failed one stays until dismissed. */
16
+ export const DONE_VISIBLE_MS = 8000
17
+
18
+ export type RunListProps<D = unknown> = {
19
+ queue: RunQueue<D>
20
+ /** Only runs that hold one of these lanes; every run when left out. */
21
+ lanes?: readonly string[] | undefined
22
+ /** The list's accessible name. Default `Runs`. */
23
+ label?: string | undefined
24
+ /** Layout only (`mt-4`). */
25
+ className?: string
26
+ }
27
+
28
+ /** Running first, then waiting in the order pressed, then finished with the latest first. */
29
+ const RANK: Record<Run['phase'], number> = { running: 0, waiting: 1, failed: 2, done: 2 }
30
+
31
+ function order<D>(a: Run<D>, b: Run<D>): number {
32
+ const rank = RANK[a.phase] - RANK[b.phase]
33
+ if (rank !== 0) return rank
34
+ return a.phase === 'waiting' ? a.id - b.id : b.id - a.id
35
+ }
36
+
37
+ /**
38
+ * The runs of a queue as the reader needs them: what runs and for how long, what waits behind it,
39
+ * what just finished with its steps, and a failed run with the failing step's text until dismissed.
40
+ * A polite live list: a change of state is announced, the ticking elapsed time is not, and a
41
+ * failure is an `alert`, announced at once. Each row carries `data-run` with its phase.
42
+ *
43
+ * @useWhen commands started with `RunButton` or a queue need their outcome on the page
44
+ * @neverWhen the history is data from a server (use `EventList`), or one passing note is enough (use `notify`)
45
+ * @instead EventList, notify
46
+ *
47
+ * @example
48
+ * <RunList queue={commands} lanes={['living-room']} />
49
+ */
50
+ export function RunList<D = unknown>({
51
+ queue,
52
+ lanes,
53
+ label,
54
+ className,
55
+ }: RunListProps<D>): ReactElement {
56
+ const t = useMessages(runMessages)
57
+ const list = useRuns(queue)
58
+ const now = useNow(1000)
59
+ const shown = list
60
+ .filter((run) => lanes === undefined || run.lanes.some((lane) => lanes.includes(lane)))
61
+ .filter(
62
+ (run) =>
63
+ run.phase !== 'done' || run.finishedAt === null || now - run.finishedAt < DONE_VISIBLE_MS,
64
+ )
65
+ .toSorted(order)
66
+ return (
67
+ <ul
68
+ data-slot="run-list"
69
+ aria-live="polite"
70
+ aria-label={label ?? t('runs.list')}
71
+ className={cn('m-0 flex list-none flex-col gap-2 p-0', className)}
72
+ >
73
+ {shown.map((run) => (
74
+ <li key={run.id}>
75
+ <RunRow run={run} now={now} onDismiss={() => queue.dismiss(run.id)} />
76
+ </li>
77
+ ))}
78
+ </ul>
79
+ )
80
+ }
81
+
82
+ type RunRowProps = { run: Run<unknown>; now: number; onDismiss: () => void }
83
+
84
+ function RunRow({ run, now, onDismiss }: RunRowProps): ReactElement {
85
+ const t = useMessages(runMessages, common)
86
+ if (run.phase === 'failed') {
87
+ return (
88
+ <Alert tone="bad" title={t('runs.failed', run.label)} data-run="failed">
89
+ <p className="m-0">{run.error}</p>
90
+ <div className="-ms-2 flex flex-wrap items-start gap-2">
91
+ <RunSteps run={run} />
92
+ <Button size="sm" variant="ghost" onClick={onDismiss}>
93
+ {t('common.dismiss')}
94
+ </Button>
95
+ </div>
96
+ </Alert>
97
+ )
98
+ }
99
+ // `now` ticks once a second, so it can be a moment older than a run that started after the tick.
100
+ const spent = run.startedAt === null ? 0 : Math.max(0, (run.finishedAt ?? now) - run.startedAt)
101
+ return (
102
+ <div className="flex flex-col gap-0.5 text-sm" data-run={run.phase}>
103
+ <div className="flex flex-wrap items-center gap-2">
104
+ {run.phase === 'waiting' && <Status tone="neutral">{t('runs.waiting')}</Status>}
105
+ {run.phase === 'running' && <Status tone="accent">{t('runs.running')}</Status>}
106
+ {run.phase === 'done' && <Status tone="good">{t('common.done')}</Status>}
107
+ <span className="min-w-0 font-medium wrap-anywhere">{run.label}</span>
108
+ {run.note !== null && <Badge tone="info">{run.note}</Badge>}
109
+ </div>
110
+ {run.phase === 'waiting' && (
111
+ <p className="m-0 text-muted-foreground">{t('runs.waitingHint')}</p>
112
+ )}
113
+ {run.phase === 'running' && (
114
+ <p className="m-0 text-muted-foreground tabular-nums" aria-live="off">
115
+ {t('runs.elapsed', spent)}
116
+ </p>
117
+ )}
118
+ {run.phase === 'done' && run.startedAt !== null && (
119
+ <p className="m-0 text-muted-foreground tabular-nums">{t('runs.finished', spent)}</p>
120
+ )}
121
+ {run.phase === 'done' && (
122
+ <div className="-ms-2">
123
+ <RunSteps run={run} />
124
+ </div>
125
+ )}
126
+ </div>
127
+ )
128
+ }
129
+
130
+ function RunSteps({ run }: { run: Run<unknown> }): ReactElement | null {
131
+ const t = useMessages(runMessages)
132
+ if (run.steps.length === 0) return null
133
+ return (
134
+ <Collapsible>
135
+ <CollapsibleTrigger render={<Button size="sm" variant="ghost" />}>
136
+ {t('runs.steps', run.steps.length)}
137
+ </CollapsibleTrigger>
138
+ <CollapsibleContent>
139
+ <ol className="m-0 list-none p-0 text-sm">
140
+ {run.steps.map((step, index) => (
141
+ // oxlint-disable-next-line react/no-array-index-key -- the steps of a finished run never reorder
142
+ <li key={index} className="wrap-anywhere">
143
+ {step.ok ? t('runs.stepOk') : t('runs.stepFailed')}: {step.label}
144
+ {step.detail === undefined ? '' : ` (${step.detail})`}
145
+ </li>
146
+ ))}
147
+ </ol>
148
+ </CollapsibleContent>
149
+ </Collapsible>
150
+ )
151
+ }
@@ -0,0 +1,185 @@
1
+ /**
2
+ * The store behind `RunButton` and `RunList`: what the reader started and what became of it. A task
3
+ * is called at once; `lanes` mirrors a server that runs one command per lane at a time, so a later
4
+ * run on a held lane reads `waiting` until every run in front of it has finished.
5
+ */
6
+ import { useSyncExternalStore } from 'react'
7
+ import { toErrorMessage } from '../common/errors'
8
+
9
+ export type RunPhase = 'waiting' | 'running' | 'done' | 'failed'
10
+
11
+ /** One line of what a task did: shown under the run, and the failing one beside its error. */
12
+ export type RunStep = { label: string; ok: boolean; detail?: string | undefined }
13
+
14
+ /** What a task resolves with. `error` marks the run failed; a throw does the same. */
15
+ export type RunResult<D = unknown> = {
16
+ /** The failing step's text, as the reader should read it. */
17
+ error?: string | undefined
18
+ steps?: readonly RunStep[] | undefined
19
+ /** A short word beside a finished run (`Dry run`). */
20
+ note?: string | undefined
21
+ /** The app's own read-back, kept on the run. */
22
+ data?: D | undefined
23
+ }
24
+
25
+ /** A command the app can start. */
26
+ export type RunTask<D = unknown> = {
27
+ /** Identity: every button of the same `id` shows the same latest run. */
28
+ id: string
29
+ /** The words the run list shows. */
30
+ label: string
31
+ /** The server queues the command holds; none means it waits for nothing. */
32
+ lanes?: readonly string[] | undefined
33
+ run: () => Promise<RunResult<D> | void>
34
+ }
35
+
36
+ export type Run<D = unknown> = {
37
+ readonly id: number
38
+ readonly task: string
39
+ readonly label: string
40
+ readonly lanes: readonly string[]
41
+ readonly phase: RunPhase
42
+ /** Epoch ms it began to run; `null` while waiting. */
43
+ readonly startedAt: number | null
44
+ readonly finishedAt: number | null
45
+ readonly error: string | null
46
+ readonly steps: readonly RunStep[]
47
+ readonly note: string | null
48
+ readonly data: D | null
49
+ }
50
+
51
+ export type RunQueue<D = unknown> = {
52
+ /** Calls the task now and returns the run's id. */
53
+ start(task: RunTask<D>): number
54
+ /** Removes a finished run. */
55
+ dismiss(id: number): void
56
+ /** Newest first; stable until something changes. */
57
+ runs(): readonly Run<D>[]
58
+ subscribe(listener: () => void): () => void
59
+ }
60
+
61
+ /** Done runs kept. Open and failed runs are never dropped: a failure leaves only by `dismiss`. */
62
+ export const RUNS_KEPT = 30
63
+
64
+ const finished = (run: Run<unknown>): boolean => run.phase === 'done' || run.phase === 'failed'
65
+
66
+ /** Waiting runs that are now the oldest unfinished run on each of their lanes start to run. */
67
+ function promote<D>(list: readonly Run<D>[]): readonly Run<D>[] {
68
+ const holder = new Map<string, number>()
69
+ for (const run of list.toReversed()) {
70
+ if (finished(run)) continue
71
+ for (const lane of run.lanes) if (!holder.has(lane)) holder.set(lane, run.id)
72
+ }
73
+ const now = Date.now()
74
+ return list.map((run) =>
75
+ run.phase === 'waiting' && run.lanes.every((lane) => holder.get(lane) === run.id)
76
+ ? { ...run, phase: 'running', startedAt: now }
77
+ : run,
78
+ )
79
+ }
80
+
81
+ function trim<D>(list: readonly Run<D>[]): readonly Run<D>[] {
82
+ let kept = 0
83
+ return list.filter((run) => run.phase !== 'done' || ++kept <= RUNS_KEPT)
84
+ }
85
+
86
+ /**
87
+ * Makes one queue of runs, usually one per app, at module level. Give it to `RunButton` and
88
+ * `RunList`; read it in a control of your own with `useRuns`.
89
+ *
90
+ * @useWhen a command takes seconds and the reader must see it running, waiting behind another, done or failed
91
+ * @neverWhen the call is instant or its result shows in the data itself (use a mutation and `notify`)
92
+ * @instead notify, optimistic
93
+ *
94
+ * @example
95
+ * export const commands = createRunQueue()
96
+ * commands.start({ id: 'tv-on', label: 'TV on', lanes: ['living-room'], run: () => post('/tv/on') })
97
+ */
98
+ export function createRunQueue<D = unknown>(): RunQueue<D> {
99
+ let list: readonly Run<D>[] = []
100
+ let sequence = 0
101
+ const listeners = new Set<() => void>()
102
+
103
+ const commit = (next: readonly Run<D>[]): void => {
104
+ list = trim(promote(next))
105
+ for (const listener of listeners) listener()
106
+ }
107
+
108
+ const finish = (id: number, result: RunResult<D>): void => {
109
+ const finishedAt = Date.now()
110
+ commit(
111
+ list.map((run) =>
112
+ run.id === id
113
+ ? {
114
+ ...run,
115
+ phase: result.error === undefined ? 'done' : 'failed',
116
+ finishedAt,
117
+ error: result.error ?? null,
118
+ steps: result.steps ?? [],
119
+ note: result.note ?? null,
120
+ data: result.data ?? null,
121
+ }
122
+ : run,
123
+ ),
124
+ )
125
+ }
126
+
127
+ const execute = async (id: number, task: RunTask<D>): Promise<void> => {
128
+ let result: RunResult<D>
129
+ try {
130
+ result = (await task.run()) ?? {}
131
+ } catch (error) {
132
+ result = { error: toErrorMessage(error) }
133
+ }
134
+ // Outside the try: a subscriber that throws must not turn a done run into a failed one.
135
+ finish(id, result)
136
+ }
137
+
138
+ return {
139
+ start(task) {
140
+ sequence += 1
141
+ const run: Run<D> = {
142
+ id: sequence,
143
+ task: task.id,
144
+ label: task.label,
145
+ lanes: task.lanes ?? [],
146
+ phase: 'waiting',
147
+ startedAt: null,
148
+ finishedAt: null,
149
+ error: null,
150
+ steps: [],
151
+ note: null,
152
+ data: null,
153
+ }
154
+ commit([run, ...list])
155
+ void execute(run.id, task)
156
+ return run.id
157
+ },
158
+ dismiss(id) {
159
+ const next = list.filter((run) => run.id !== id || !finished(run))
160
+ if (next.length !== list.length) commit(next)
161
+ },
162
+ runs: () => list,
163
+ subscribe(listener) {
164
+ listeners.add(listener)
165
+ return () => {
166
+ listeners.delete(listener)
167
+ }
168
+ },
169
+ }
170
+ }
171
+
172
+ /**
173
+ * The queue's runs, newest first, re-read on every change. For a control that is not a button: a
174
+ * slider that holds the picked value until its command has answered.
175
+ *
176
+ * @useWhen a part of your own follows a queue's runs
177
+ * @neverWhen a button or a list is enough (use `RunButton`, `RunList`)
178
+ * @instead RunButton, RunList
179
+ *
180
+ * @example
181
+ * const pending = useRuns(commands).find((run) => run.task === 'volume')
182
+ */
183
+ export function useRuns<D>(queue: RunQueue<D>): readonly Run<D>[] {
184
+ return useSyncExternalStore(queue.subscribe, queue.runs, queue.runs)
185
+ }
@@ -1,5 +1,7 @@
1
1
  import { useId } from 'react'
2
2
  import type { ReactElement } from 'react'
3
+ import { cn } from '../core/cn'
4
+ import { InfoGlyph, InfoText } from '../core/info-hint'
3
5
  import { headingSlug } from '../core/slug'
4
6
  import type { ControlHandle } from '../core/ports'
5
7
  import { SlotHomeContext } from '../core/slot-home'
@@ -8,7 +10,8 @@ import type { SectionProps } from './contract'
8
10
  import { isEmptyTabs, renderTabs } from './page-tabs'
9
11
 
10
12
  /**
11
- * 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
12
15
  * section is a named region and a scroll anchor: its `id` is the slug of `title`, and its scroll
13
16
  * margin is `--basalt-page-sticky-top`, so a `#hash` jump, a skip link or `scrollIntoView` lands the
14
17
  * heading just below the page band instead of under it. Outside a `Page` the offset is zero.
@@ -16,6 +19,10 @@ import { isEmptyTabs, renderTabs } from './page-tabs'
16
19
  * `tabs` is the section's view switch: `{ state, label }` of an enum field draws a tab strip
17
20
  * bound to it, a `ControlsSlot` renders as is.
18
21
  *
22
+ * `info` puts the card head's definition glyph beside the title and `divided` rules a hairline under
23
+ * the row. There is no free node beside the title: words go in `summary`, a control in `controls`
24
+ * (`filterSlot.custom` for your own) or `tabs`.
25
+ *
19
26
  * `summary` is one line beside the title, shown while the section is collapsed too. `collapsible`
20
27
  * makes the heading the trigger of a region around the body: `defaultOpen` for an uncontrolled
21
28
  * section (open unless `false`), `state` (a boolean field) for one the URL or the device remembers;
@@ -79,12 +86,16 @@ function SectionFrame<K extends string>({
79
86
  controls,
80
87
  tabs,
81
88
  children,
89
+ headingLevel = 2,
90
+ info,
91
+ divided,
82
92
  collapse,
83
93
  }: SectionProps<K> & { collapse?: Collapse }): ReactElement {
84
94
  const headingId = useId()
85
95
  const anchor = headingSlug(title)
96
+ const Heading = headingLevel === 3 ? 'h3' : 'h2'
86
97
  const heading = (
87
- <h2
98
+ <Heading
88
99
  id={headingId}
89
100
  className="m-0 min-w-0 font-head text-md font-semibold tracking-tight word-head text-foreground"
90
101
  >
@@ -96,12 +107,26 @@ function SectionFrame<K extends string>({
96
107
  <Chevron />
97
108
  </CollapsibleTrigger>
98
109
  )}
99
- </h2>
110
+ </Heading>
100
111
  )
101
112
  const header = (
102
- <header className="flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2">
113
+ <header
114
+ className={cn(
115
+ 'flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2',
116
+ divided === true && 'border-b border-border pb-2',
117
+ )}
118
+ >
103
119
  <div className="flex min-w-0 flex-1 flex-wrap items-baseline gap-x-3">
104
- {heading}
120
+ {info === undefined || info.length === 0 ? (
121
+ heading
122
+ ) : (
123
+ <div className="flex min-w-0 items-center gap-1">
124
+ {heading}
125
+ <InfoGlyph title={title} className="-my-0.5">
126
+ <InfoText info={info} />
127
+ </InfoGlyph>
128
+ </div>
129
+ )}
105
130
  {summary !== undefined && summary !== '' && (
106
131
  <p data-slot="section-summary" className="m-0 min-w-0 text-sm text-muted-foreground">
107
132
  {summary}
@@ -40,6 +40,11 @@ const LazyPaletteSheet = lazy(async () => ({
40
40
 
41
41
  const NO_SOURCES: readonly PaletteSource[] = []
42
42
 
43
+ /** The search field: the first focus of every opening (the dialog's own default is its Close button). */
44
+ function focusSearch(): HTMLElement | null {
45
+ return document.querySelector<HTMLElement>('[data-slot="command-palette"] input')
46
+ }
47
+
43
48
  /** A source row's result with the source it came from. */
44
49
  type SourceHit = { source: PaletteSource; result: ShownResult }
45
50
 
@@ -264,11 +269,13 @@ export function CommandPalette({
264
269
  aria-label={t('shell.searchCommands')}
265
270
  placeholder={placeholder ?? t('shell.paletteHint')}
266
271
  />
272
+ {/* Inline in the palette's own dialog: the listbox is the semantics, so the popup is no second dialog. */}
267
273
  <PopupFrame
268
274
  kind="autocomplete"
269
275
  slot="autocomplete-content"
270
276
  className="relative max-h-80 overflow-y-auto outline-none"
271
277
  container={listHost ?? undefined}
278
+ popupProps={{ role: 'presentation' }}
272
279
  >
273
280
  <OptionListBody
274
281
  list={list}
@@ -321,7 +328,9 @@ export function CommandPalette({
321
328
  <>
322
329
  <ShortcutOverlay commands={commands} />
323
330
  <Dialog open={open} onOpenChange={setOpen}>
324
- <DialogContent title={paletteName(t)}>{body}</DialogContent>
331
+ <DialogContent title={paletteName(t)} initialFocus={focusSearch}>
332
+ {body}
333
+ </DialogContent>
325
334
  </Dialog>
326
335
  </>
327
336
  )
@@ -265,7 +265,7 @@ function ActionBody({ action, box }: { action: GlobalAction; box: ShellBox }): R
265
265
  {count > 0 && (
266
266
  <span
267
267
  aria-hidden="true"
268
- className="absolute end-0.5 top-0.5 min-w-4 rounded-full bg-warn px-1 text-center text-[10px]/4 font-medium text-primary-foreground"
268
+ className="absolute end-0.5 top-0.5 min-w-4 rounded-full bg-warn px-1 text-center text-[10px]/4 font-medium text-(--basalt-canvas)"
269
269
  >
270
270
  {shown}
271
271
  </span>
package/src/surfaces.ts CHANGED
@@ -284,7 +284,7 @@ export const SURFACES = {
284
284
  rule: 'page',
285
285
  skill: ['basalt-design'],
286
286
  description:
287
- 'v3 page composites — Page, PageBar, PageAside, Section, SplitPage, InnerNav, QueryState, overlays, and the article parts (Prose, Callout, Toc, ArticleLayout)',
287
+ 'v3 page composites — Page, PageBar, PageAside, Section, SplitPage, InnerNav, QueryState, overlays, runs (createRunQueue, useRuns, RunButton, RunList), and the article parts (Prose, Callout, Toc, ArticleLayout)',
288
288
  globs: { shipped: [], repo: ['packages/basalt-ui/src/page/**'] },
289
289
  forbiddenImports: [],
290
290
  },
@@ -292,6 +292,7 @@ export const SURFACES = {
292
292
  kind: 'tooling',
293
293
  layer: 'ui',
294
294
  description:
295
+ // ChainView owns dependency record cards; FlowCanvas owns the editable flow surface.
295
296
  'v3 card composites — StatCard, StatGroup, BarList, EventList, RowList, RelationshipCard, StepRail, ChainView, Board, FlowCanvas, FlowChecklist, useFlow',
296
297
  globs: { shipped: [], repo: ['packages/basalt-ui/src/cards/**'] },
297
298
  forbiddenImports: [],
@@ -374,6 +375,14 @@ export const SURFACES = {
374
375
  description: 'v3 oxlint plugin — tooling, no app bundle',
375
376
  forbiddenImports: [],
376
377
  },
378
+ './lint/shadcn': {
379
+ kind: 'tooling',
380
+ layer: 'build-tooling',
381
+ description:
382
+ "v3 oxlint plugin: the bought @shadcn/lint rules, a file's own tv or cva left unread — tooling, no app bundle",
383
+ optionalPeers: ['@shadcn/lint'],
384
+ forbiddenImports: [],
385
+ },
377
386
  './stylelint': {
378
387
  kind: 'tooling',
379
388
  layer: 'build-tooling',
@@ -493,6 +502,14 @@ export const SURFACES = {
493
502
  'v3 table tier sheet — plain CSS in @layer basalt.table (container-query tiers, card projection); an app that imports ./table imports it',
494
503
  forbiddenImports: [],
495
504
  },
505
+ './bridge.css': {
506
+ kind: 'tooling',
507
+ layer: 'non-js-asset',
508
+ description:
509
+ 'v3 opt-in bridge for an app with its own components — the Tailwind scale names tailwind.css clears and the shadcn color names, on the --basalt-* tokens; import it after tailwind.css',
510
+ optionalPeers: ['tailwindcss'],
511
+ forbiddenImports: [],
512
+ },
496
513
  './tailwind.css': {
497
514
  kind: 'tooling',
498
515
  layer: 'non-js-asset',
@@ -5,4 +5,5 @@ export { settled } from './settled'
5
5
  export { SLOTS } from './slots'
6
6
  export { expectShellInvariants } from './shell-invariants'
7
7
  export { quality } from './quality'
8
+ export { pseudoBasaltMessages, pseudoMessages } from './pseudo-locale'
8
9
  export { expectCatalog } from './expect-catalog'
@@ -0,0 +1,149 @@
1
+ /**
2
+ * The pseudo-locale of a screenshot or overflow test: every message accented, lengthened and put in
3
+ * brackets, so a label that only fits English shows as cut and a literal no catalogue holds stands out
4
+ * as plain English. Made from the compiled catalogue in the test page, so it needs no extra locale and
5
+ * no catalogue file. Lingui's own `pseudoLocale` option promises no length.
6
+ */
7
+ import { en } from '../core/messages'
8
+ import type { BasaltMessages } from '../core/messages'
9
+
10
+ /** A message as Lingui compiles it: a string, or literals and placeholders `[name, type?, options?]`. */
11
+ type Compiled = string | readonly Token[]
12
+ type Token = string | readonly [name: string, type?: string, options?: unknown]
13
+ type TextFunction = (...args: unknown[]) => string
14
+
15
+ const PLAIN = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
16
+ const ACCENTED = Array.from('áƀçðéƒĝĥíĵķļɱñóƥǫŕšţúṽŵẋýžÁƁÇÐÉƑĜĤÍĴĶĻṀÑÓƤǪŔŠŢÚṼŴẊÝŽ')
17
+ const GROWTH = 1.4
18
+ /** The padding's word length, as a long compound: the padded message can still wrap. */
19
+ const WORD = 10
20
+ /** Rich-text tags (`<0>`) are markup, not text. */
21
+ const TAG = /(<\/?\d+\/?>)/
22
+
23
+ const accent = (text: string): string =>
24
+ text
25
+ .split(TAG)
26
+ .map((part) =>
27
+ TAG.test(part) ? part : part.replace(/[a-z]/gi, (c) => ACCENTED[PLAIN.indexOf(c)]!),
28
+ )
29
+ .join('')
30
+
31
+ const accentMessage = (message: Compiled): Compiled =>
32
+ typeof message === 'string'
33
+ ? accent(message)
34
+ : message.map((token): Token => {
35
+ if (typeof token === 'string') return accent(token)
36
+ const [name, type, options] = token
37
+ // A plain placeholder and a formatter's style name carry no text; plural and select branches do.
38
+ if (type === undefined || typeof options !== 'object' || options === null) return token
39
+ const branches = Object.entries(options).map(([key, value]) => [
40
+ key,
41
+ key === 'offset' ? value : accentMessage(value as Compiled),
42
+ ])
43
+ return [name, type, Object.fromEntries(branches)]
44
+ })
45
+
46
+ /** The letters a message prints around its values; a plural or select counts its longest branch. */
47
+ function literalLength(message: Compiled): number {
48
+ if (typeof message === 'string')
49
+ return Array.from(
50
+ message
51
+ .split(TAG)
52
+ .filter((p) => !TAG.test(p))
53
+ .join(''),
54
+ ).length
55
+ return message.reduce<number>((total, token) => {
56
+ if (typeof token === 'string') return total + literalLength(token)
57
+ const options = token[2]
58
+ if (typeof options !== 'object' || options === null) return total
59
+ const lengths = Object.entries(options)
60
+ .filter(([key]) => key !== 'offset')
61
+ .map(([, value]) => literalLength(value as Compiled))
62
+ return total + Math.max(0, ...lengths)
63
+ }, 0)
64
+ }
65
+
66
+ /** The padding that brings `length` letters, with the two brackets, to the target. */
67
+ function padding(length: number, longest: number): string {
68
+ const missing = Math.max(longest, Math.ceil(length * GROWTH)) - length - 2
69
+ let text = ''
70
+ while (text.length < missing)
71
+ text += ` ${'õ'.repeat(Math.min(WORD, missing - text.length - 1) || 1)}`
72
+ return text
73
+ }
74
+
75
+ /** A function message's output: accented around the string values it was given, which stay as they are. */
76
+ function accentAround(text: string, values: readonly string[]): string {
77
+ const value = values.find((v) => v !== '' && text.includes(v))
78
+ if (value === undefined) return accent(text)
79
+ const rest = values.filter((v) => v !== value)
80
+ return text
81
+ .split(value)
82
+ .map((part) => accentAround(part, rest))
83
+ .join(value)
84
+ }
85
+
86
+ function pseudoEntry(message: unknown, longest: unknown): unknown {
87
+ if (typeof message === 'function') {
88
+ return (...args: unknown[]): string => {
89
+ const text = (message as TextFunction)(...args)
90
+ const other = typeof longest === 'function' ? (longest as TextFunction)(...args) : ''
91
+ const values = args.filter((a): a is string => typeof a === 'string')
92
+ return `[${accentAround(text, values)}${padding(text.length, other.length)}]`
93
+ }
94
+ }
95
+ if (message === '') return message
96
+ const compiled = message as Compiled
97
+ const target = literalLength((longest ?? '') as Compiled)
98
+ const pad = padding(literalLength(compiled), target)
99
+ const accented = accentMessage(compiled)
100
+ return typeof accented === 'string' ? `[${accented}${pad}]` : ['[', ...accented, pad, ']']
101
+ }
102
+
103
+ /**
104
+ * ```ts
105
+ * // The test page of a localised app: English, bracketed, accented and at least as long as German.
106
+ * import { i18n } from '@lingui/core'
107
+ * import { pseudoMessages } from 'basalt-ui/testing'
108
+ * import { messages as en } from '#locales/en.po'
109
+ * import { messages as de } from '#locales/de.po'
110
+ * i18n.load('en', pseudoMessages(en, de))
111
+ * i18n.activate('en')
112
+ * ```
113
+ *
114
+ * A copy of a compiled Lingui catalogue with every message accented, in brackets and at least 1.4 times
115
+ * as long, or as long as the same message of `longest` where that is longer. Placeholders, rich-text
116
+ * tags and plural branches survive.
117
+ *
118
+ * @useWhen a browser test must show clipped labels and untranslated literals before a real translation does
119
+ * @neverWhen the app ships to a user: it is a test locale
120
+ * @instead pseudoBasaltMessages
121
+ */
122
+ export function pseudoMessages<M extends object>(source: M, longest?: object): M {
123
+ const other = (longest ?? {}) as Record<string, unknown>
124
+ return Object.fromEntries(
125
+ Object.entries(source).map(([id, message]) => [id, pseudoEntry(message, other[id])]),
126
+ ) as M
127
+ }
128
+
129
+ /**
130
+ * ```tsx
131
+ * // In the same test page: the package's own labels, so they do not read as untranslated literals.
132
+ * import { BasaltProvider } from 'basalt-ui'
133
+ * import { pseudoBasaltMessages } from 'basalt-ui/testing'
134
+ * const root = (
135
+ * <BasaltProvider messages={pseudoBasaltMessages()}>
136
+ * <App />
137
+ * </BasaltProvider>
138
+ * )
139
+ * ```
140
+ *
141
+ * basalt-ui's own English labels in the pseudo-locale, for the provider's `messages` prop.
142
+ *
143
+ * @useWhen a test page runs in the pseudo-locale and shows the package's own buttons, headings or empty states
144
+ * @neverWhen the page runs in a real language: pass that language pack instead
145
+ * @instead pseudoMessages
146
+ */
147
+ export function pseudoBasaltMessages(): BasaltMessages {
148
+ return pseudoMessages(en)
149
+ }