basalt-ui 1.28.0 → 1.29.1

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 (457) hide show
  1. package/AGENTS.md +12 -19
  2. package/CHANGELOG.md +23 -0
  3. package/MIGRATING.md +171 -7
  4. package/README.md +66 -105
  5. package/agent/rules/basalt-batteries.md +60 -183
  6. package/agent/rules/basalt-charts.md +56 -75
  7. package/agent/rules/basalt-controls.md +38 -69
  8. package/agent/rules/basalt-mantine.md +58 -103
  9. package/agent/rules/basalt-state.md +42 -60
  10. package/agent/rules/basalt-tokens.md +46 -67
  11. package/agent/skills/basalt-app/SKILL.md +2 -0
  12. package/agent/templates/CLAUDE-block.md.tpl +14 -14
  13. package/agent/templates/query-client.ts.tpl +1 -1
  14. package/configs/oxlint-plugin.js +84 -254
  15. package/configs/oxlint-plugin.test.ts +23 -266
  16. package/configs/oxlint.json +0 -2
  17. package/dist/agent/ai-sdk-transport.d.ts.map +1 -1
  18. package/dist/agent/ai-sdk-transport.js +7 -4
  19. package/dist/agent/coalesce.js +1 -1
  20. package/dist/agent/merge.js +1 -1
  21. package/dist/agent/transport.d.ts +13 -2
  22. package/dist/agent/transport.d.ts.map +1 -1
  23. package/dist/agent/use-agent-thread-runs.d.ts +12 -1
  24. package/dist/agent/use-agent-thread-runs.d.ts.map +1 -1
  25. package/dist/agent/use-agent-thread-runs.js +20 -6
  26. package/dist/agent-chat/index.d.ts +1 -1
  27. package/dist/agent-chat/index.d.ts.map +1 -1
  28. package/dist/agent-chat/relative-time.js +1 -1
  29. package/dist/agent-chat/thread-detail-panel.js +1 -1
  30. package/dist/agent-chat/thread-feed-row.d.ts +32 -7
  31. package/dist/agent-chat/thread-feed-row.d.ts.map +1 -1
  32. package/dist/agent-chat/thread-feed-row.js +121 -86
  33. package/dist/agent-chat/thread-feed.d.ts +11 -1
  34. package/dist/agent-chat/thread-feed.d.ts.map +1 -1
  35. package/dist/agent-chat/thread-feed.js +10 -6
  36. package/dist/agent-chat/thread-message.js +1 -1
  37. package/dist/agent-chat/virtualize.d.ts +39 -0
  38. package/dist/agent-chat/virtualize.d.ts.map +1 -1
  39. package/dist/agent-chat/virtualize.js +15 -0
  40. package/dist/charts/index.d.ts +3 -3
  41. package/dist/charts/index.d.ts.map +1 -1
  42. package/dist/charts/index.js +8 -4
  43. package/dist/charts/kinds/BandStrip.js +1 -1
  44. package/dist/charts/kinds/Bars.d.ts +1 -3
  45. package/dist/charts/kinds/Bars.d.ts.map +1 -1
  46. package/dist/charts/kinds/Bars.js +1 -1
  47. package/dist/charts/kinds/DualPanel.d.ts +3 -1
  48. package/dist/charts/kinds/DualPanel.d.ts.map +1 -1
  49. package/dist/charts/kinds/DualPanel.js +1 -1
  50. package/dist/charts/kinds/StackedArea.js +1 -1
  51. package/dist/charts/kinds/ZonedLine.d.ts +1 -3
  52. package/dist/charts/kinds/ZonedLine.d.ts.map +1 -1
  53. package/dist/charts/primitives/Axes.d.ts +21 -2
  54. package/dist/charts/primitives/Axes.d.ts.map +1 -1
  55. package/dist/charts/primitives/Axes.js +34 -2
  56. package/dist/charts/primitives/ChartCard.d.ts +20 -4
  57. package/dist/charts/primitives/ChartCard.d.ts.map +1 -1
  58. package/dist/charts/primitives/ChartCard.js +62 -33
  59. package/dist/charts/primitives/ChartFrame.d.ts.map +1 -1
  60. package/dist/charts/primitives/ChartFrame.js +8 -1
  61. package/dist/charts/primitives/ChartPending.d.ts +12 -6
  62. package/dist/charts/primitives/ChartPending.d.ts.map +1 -1
  63. package/dist/charts/primitives/ChartPending.js +1 -1
  64. package/dist/charts/utils/format.d.ts +5 -92
  65. package/dist/charts/utils/format.d.ts.map +1 -1
  66. package/dist/charts/utils/format.js +10 -80
  67. package/dist/cli/audit-allows.d.ts +24 -0
  68. package/dist/cli/audit-allows.d.ts.map +1 -0
  69. package/dist/cli/audit-allows.js +240 -0
  70. package/dist/cli/check-theme.d.ts +10 -0
  71. package/dist/cli/check-theme.d.ts.map +1 -0
  72. package/dist/cli/check-theme.js +139 -0
  73. package/dist/cli/doctor.d.ts +47 -0
  74. package/dist/cli/doctor.d.ts.map +1 -0
  75. package/dist/cli/doctor.js +197 -0
  76. package/dist/cli/guard-hook.d.ts +9 -0
  77. package/dist/cli/guard-hook.d.ts.map +1 -0
  78. package/dist/cli/guard-hook.js +93 -0
  79. package/dist/cli/help.d.ts +9 -0
  80. package/dist/cli/help.d.ts.map +1 -0
  81. package/dist/cli/help.js +53 -0
  82. package/dist/cli/index.d.ts +360 -270
  83. package/dist/cli/index.d.ts.map +1 -1
  84. package/dist/cli/index.js +85 -1901
  85. package/dist/cli/init.d.ts +4 -0
  86. package/dist/cli/init.d.ts.map +1 -0
  87. package/dist/cli/init.js +165 -0
  88. package/dist/cli/sync.d.ts +43 -0
  89. package/dist/cli/sync.d.ts.map +1 -0
  90. package/dist/cli/sync.js +206 -0
  91. package/dist/cli/tokens-css.d.ts +51 -0
  92. package/dist/cli/tokens-css.d.ts.map +1 -0
  93. package/dist/cli/tokens-css.js +165 -0
  94. package/dist/commands/define-commands.js +1 -1
  95. package/dist/commands/define-overlays.js +1 -1
  96. package/dist/commands/index.d.ts +2 -1
  97. package/dist/commands/index.d.ts.map +1 -1
  98. package/dist/commands/index.js +6 -0
  99. package/dist/commands/overlays-mount.d.ts +7 -9
  100. package/dist/commands/overlays-mount.d.ts.map +1 -1
  101. package/dist/commands/shell-bridge.d.ts +57 -0
  102. package/dist/commands/shell-bridge.d.ts.map +1 -0
  103. package/dist/commands/shell-bridge.js +32 -0
  104. package/dist/common/errors.d.ts +35 -0
  105. package/dist/common/errors.d.ts.map +1 -1
  106. package/dist/common/errors.js +29 -1
  107. package/dist/common/index.d.ts +2 -0
  108. package/dist/common/index.d.ts.map +1 -1
  109. package/dist/common/index.js +6 -0
  110. package/dist/common/is-dev.d.ts.map +1 -0
  111. package/dist/{motion/index.d.ts → common/motion.d.ts} +1 -1
  112. package/dist/common/motion.d.ts.map +1 -0
  113. package/dist/common/props.d.ts +1 -1
  114. package/dist/common/props.d.ts.map +1 -1
  115. package/dist/common/validate.js +1 -1
  116. package/dist/content/markdown.d.ts +3 -4
  117. package/dist/content/markdown.d.ts.map +1 -1
  118. package/dist/content/markdown.js +1 -4
  119. package/dist/controls/actions.d.ts +1 -1
  120. package/dist/controls/actions.d.ts.map +1 -1
  121. package/dist/controls/panel-row.js +1 -1
  122. package/dist/controls/range-filter.js +1 -1
  123. package/dist/dashboard/delta-badge.d.ts +18 -10
  124. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  125. package/dist/dashboard/delta-badge.js +33 -1
  126. package/dist/dashboard/empty-state.d.ts +1 -4
  127. package/dist/dashboard/empty-state.d.ts.map +1 -1
  128. package/dist/dashboard/empty-state.js +1 -2
  129. package/dist/dashboard/index.d.ts +4 -2
  130. package/dist/dashboard/index.d.ts.map +1 -1
  131. package/dist/dashboard/index.js +7 -1
  132. package/dist/dashboard/query-state.d.ts +4 -13
  133. package/dist/dashboard/query-state.d.ts.map +1 -1
  134. package/dist/dashboard/query-state.js +4 -7
  135. package/dist/{section → dashboard}/section.d.ts +2 -2
  136. package/dist/{section → dashboard}/section.d.ts.map +1 -1
  137. package/dist/{section → dashboard}/section.js +2 -2
  138. package/dist/dashboard/settings-section.d.ts +1 -1
  139. package/dist/dashboard/settings-section.d.ts.map +1 -1
  140. package/dist/dashboard/settings-section.js +1 -1
  141. package/dist/dashboard/stat-card.d.ts +1 -1
  142. package/dist/dashboard/stat-card.d.ts.map +1 -1
  143. package/dist/dashboard/stat-card.js +1 -1
  144. package/dist/dashboard/widget-header.d.ts.map +1 -0
  145. package/dist/data/data-table.js +2 -2
  146. package/dist/data/table.d.ts +1 -1
  147. package/dist/data/table.d.ts.map +1 -1
  148. package/dist/data/table.js +2 -16
  149. package/dist/data/virtual.d.ts +3 -3
  150. package/dist/dev-dock.d.ts +26 -0
  151. package/dist/dev-dock.d.ts.map +1 -0
  152. package/dist/dev-dock.js +85 -0
  153. package/dist/format/date.d.ts +62 -0
  154. package/dist/format/date.d.ts.map +1 -0
  155. package/dist/format/date.js +106 -0
  156. package/dist/format/index.d.ts +39 -0
  157. package/dist/format/index.d.ts.map +1 -0
  158. package/dist/format/index.js +54 -0
  159. package/dist/format/measure.d.ts +15 -0
  160. package/dist/format/measure.d.ts.map +1 -0
  161. package/dist/format/measure.js +16 -0
  162. package/dist/format/number.d.ts +69 -0
  163. package/dist/format/number.d.ts.map +1 -0
  164. package/dist/format/number.js +62 -0
  165. package/dist/format/shared.d.ts +27 -0
  166. package/dist/format/shared.d.ts.map +1 -0
  167. package/dist/format/shared.js +29 -0
  168. package/dist/forms/field.d.ts +4 -20
  169. package/dist/forms/field.d.ts.map +1 -1
  170. package/dist/forms/field.js +0 -4
  171. package/dist/forms/form-layout.d.ts +1 -1
  172. package/dist/forms/form-layout.d.ts.map +1 -1
  173. package/dist/forms/form-layout.js +1 -1
  174. package/dist/forms/index.d.ts +1 -1
  175. package/dist/forms/index.d.ts.map +1 -1
  176. package/dist/forms/index.js +1 -2
  177. package/dist/forms/use-form-submit.d.ts +1 -1
  178. package/dist/forms/use-form-submit.js +1 -1
  179. package/dist/guard/index.d.ts +2 -9
  180. package/dist/guard/index.d.ts.map +1 -1
  181. package/dist/guard/index.js +53 -32
  182. package/dist/guard/types.d.ts +8 -10
  183. package/dist/guard/types.d.ts.map +1 -1
  184. package/dist/index.d.ts +16 -11
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.js +23 -29
  187. package/dist/notifications/index.d.ts +5 -5
  188. package/dist/notifications/index.d.ts.map +1 -1
  189. package/dist/notifications/index.js +0 -2
  190. package/dist/notifications/mount-guard.d.ts.map +1 -1
  191. package/dist/notifications/mount-guard.js +2 -2
  192. package/dist/provider/connectivity-indicator.d.ts.map +1 -0
  193. package/dist/{connectivity → provider}/connectivity-provider.d.ts +1 -1
  194. package/dist/provider/connectivity-provider.d.ts.map +1 -0
  195. package/dist/{connectivity/types.d.ts → provider/connectivity-types.d.ts} +1 -1
  196. package/dist/provider/connectivity-types.d.ts.map +1 -0
  197. package/dist/provider/error-fallback.module.css +21 -0
  198. package/dist/provider/error-fallback.module.css.d.ts +9 -0
  199. package/dist/provider/index.d.ts +20 -36
  200. package/dist/provider/index.d.ts.map +1 -1
  201. package/dist/provider/index.js +42 -32
  202. package/dist/provider/lab-theme.js +1 -1
  203. package/dist/provider/use-connectivity.d.ts +3 -0
  204. package/dist/provider/use-connectivity.d.ts.map +1 -0
  205. package/dist/query-client.d.ts +67 -0
  206. package/dist/query-client.d.ts.map +1 -0
  207. package/dist/query-client.js +35 -0
  208. package/dist/{query/devtools.d.ts → query-devtools.d.ts} +2 -2
  209. package/dist/query-devtools.d.ts.map +1 -0
  210. package/dist/register.d.ts +17 -3
  211. package/dist/register.d.ts.map +1 -1
  212. package/dist/router-tanstack/index.d.ts +4 -7
  213. package/dist/router-tanstack/index.d.ts.map +1 -1
  214. package/dist/router-tanstack/index.js +1 -9
  215. package/dist/router-tanstack/nav.d.ts +1 -1
  216. package/dist/router-tanstack/nav.d.ts.map +1 -1
  217. package/dist/router-tanstack/search-store.d.ts +3 -6
  218. package/dist/router-tanstack/search-store.d.ts.map +1 -1
  219. package/dist/router-tanstack/use-nav.d.ts +1 -1
  220. package/dist/router-tanstack/use-nav.d.ts.map +1 -1
  221. package/dist/shell/app-breadcrumbs.d.ts +1 -1
  222. package/dist/shell/app-breadcrumbs.d.ts.map +1 -1
  223. package/dist/shell/app-main.module.css +11 -0
  224. package/dist/shell/app-mobile-nav.d.ts +1 -1
  225. package/dist/shell/app-mobile-nav.d.ts.map +1 -1
  226. package/dist/shell/app-mobile-nav.js +24 -2
  227. package/dist/shell/app-sidebar.d.ts +1 -1
  228. package/dist/shell/app-sidebar.d.ts.map +1 -1
  229. package/dist/shell/app-sidebar.js +31 -2
  230. package/dist/shell/app-sidebar.module.css +10 -0
  231. package/dist/shell/index.d.ts +10 -4
  232. package/dist/shell/index.d.ts.map +1 -1
  233. package/dist/shell/index.js +13 -17
  234. package/dist/shell/mobile-nav-model.d.ts +1 -1
  235. package/dist/shell/mobile-nav-model.d.ts.map +1 -1
  236. package/dist/{nav/types.d.ts → shell/nav-types.d.ts} +1 -1
  237. package/dist/shell/nav-types.d.ts.map +1 -0
  238. package/dist/shell/page-aside.d.ts.map +1 -1
  239. package/dist/shell/page-aside.js +2 -29
  240. package/dist/shell/page-title.d.ts +14 -0
  241. package/dist/shell/page-title.d.ts.map +1 -0
  242. package/dist/shell/page-title.js +25 -0
  243. package/dist/shell/page-title.module.css +33 -0
  244. package/dist/shell/page-title.module.css.d.ts +11 -0
  245. package/dist/shell/sidebar-block-model.d.ts +1 -1
  246. package/dist/shell/sidebar-block-model.d.ts.map +1 -1
  247. package/dist/shell/sidebar-blocks.d.ts +1 -1
  248. package/dist/shell/sidebar-blocks.d.ts.map +1 -1
  249. package/dist/shell/use-breakpoint.d.ts +11 -0
  250. package/dist/shell/use-breakpoint.d.ts.map +1 -0
  251. package/dist/shell/use-breakpoint.js +33 -0
  252. package/dist/state/fields.d.ts +3 -19
  253. package/dist/state/fields.d.ts.map +1 -1
  254. package/dist/state/fields.js +6 -16
  255. package/dist/styles.css +36 -0
  256. package/dist/surfaces.d.ts +18 -41
  257. package/dist/surfaces.d.ts.map +1 -1
  258. package/dist/surfaces.js +48 -60
  259. package/dist/theme/index.d.ts.map +1 -1
  260. package/dist/{theme-toggle/index.d.ts → theme/theme-toggle.d.ts} +1 -1
  261. package/dist/theme/theme-toggle.d.ts.map +1 -0
  262. package/dist/{theme-toggle/index.js → theme/theme-toggle.js} +1 -1
  263. package/dist/tokens/index.d.ts +1 -0
  264. package/dist/tokens/index.d.ts.map +1 -1
  265. package/dist/tokens/index.js +10 -0
  266. package/dist/tokens/palette.d.ts +12 -0
  267. package/dist/tokens/palette.d.ts.map +1 -1
  268. package/dist/tokens/palette.js +13 -1
  269. package/dist/tokens.css +1 -0
  270. package/llms.txt +9 -24
  271. package/package.json +12 -16
  272. package/src/agent/ai-sdk-transport.ts +11 -4
  273. package/src/agent/coalesce.ts +1 -1
  274. package/src/agent/merge.ts +1 -1
  275. package/src/agent/transport.ts +15 -2
  276. package/src/agent/use-agent-thread-runs.ts +65 -15
  277. package/src/agent-chat/index.ts +6 -4
  278. package/src/agent-chat/relative-time.ts +1 -1
  279. package/src/agent-chat/thread-detail-panel.tsx +1 -1
  280. package/src/agent-chat/thread-feed-row.tsx +105 -30
  281. package/src/agent-chat/thread-feed.tsx +51 -25
  282. package/src/agent-chat/thread-message.tsx +1 -1
  283. package/src/agent-chat/virtualize.ts +48 -0
  284. package/src/charts/index.ts +7 -10
  285. package/src/charts/kinds/BandStrip.tsx +1 -1
  286. package/src/charts/kinds/Bars.tsx +2 -5
  287. package/src/charts/kinds/DualPanel.tsx +4 -3
  288. package/src/charts/kinds/StackedArea.tsx +1 -1
  289. package/src/charts/kinds/ZonedLine.tsx +1 -4
  290. package/src/charts/primitives/Axes.tsx +49 -0
  291. package/src/charts/primitives/ChartCard.tsx +49 -6
  292. package/src/charts/primitives/ChartFrame.tsx +5 -1
  293. package/src/charts/primitives/ChartPending.tsx +14 -8
  294. package/src/charts/utils/format.ts +17 -186
  295. package/src/cli/audit-allows.ts +371 -0
  296. package/src/cli/check-theme.ts +197 -0
  297. package/src/cli/doctor.ts +331 -0
  298. package/src/cli/guard-hook.ts +115 -0
  299. package/src/cli/help.ts +101 -0
  300. package/src/cli/index.ts +269 -3439
  301. package/src/cli/init.ts +247 -0
  302. package/src/cli/sync.ts +324 -0
  303. package/src/cli/tokens-css.ts +252 -0
  304. package/src/commands/define-commands.ts +1 -1
  305. package/src/commands/define-overlays.ts +1 -1
  306. package/src/commands/index.ts +10 -1
  307. package/src/commands/overlays-mount.tsx +8 -10
  308. package/src/commands/shell-bridge.ts +86 -0
  309. package/src/common/errors.ts +70 -0
  310. package/src/common/index.ts +2 -0
  311. package/src/common/props.ts +1 -1
  312. package/src/common/validate.ts +1 -1
  313. package/src/content/markdown.tsx +4 -8
  314. package/src/controls/actions.tsx +1 -1
  315. package/src/controls/panel-row.tsx +1 -1
  316. package/src/controls/range-filter.tsx +1 -1
  317. package/src/dashboard/delta-badge.tsx +74 -7
  318. package/src/dashboard/empty-state.tsx +2 -6
  319. package/src/dashboard/index.ts +11 -2
  320. package/src/dashboard/query-state.tsx +5 -18
  321. package/src/{section → dashboard}/section.tsx +4 -4
  322. package/src/dashboard/settings-section.tsx +2 -2
  323. package/src/dashboard/stat-card.tsx +2 -2
  324. package/src/data/data-table.tsx +3 -3
  325. package/src/data/table.ts +6 -25
  326. package/src/data/virtual-list.tsx +1 -1
  327. package/src/data/virtual.ts +3 -3
  328. package/src/dev-dock.tsx +162 -0
  329. package/src/format/date.ts +184 -0
  330. package/src/format/index.ts +69 -0
  331. package/src/format/measure.ts +31 -0
  332. package/src/format/number.ts +129 -0
  333. package/src/format/shared.ts +63 -0
  334. package/src/forms/field.ts +4 -24
  335. package/src/forms/form-layout.tsx +2 -2
  336. package/src/forms/index.ts +1 -2
  337. package/src/forms/use-form-submit.ts +2 -2
  338. package/src/guard/index.ts +80 -69
  339. package/src/guard/types.ts +7 -10
  340. package/src/index.ts +38 -29
  341. package/src/notifications/index.ts +5 -7
  342. package/src/notifications/mount-guard.ts +7 -9
  343. package/src/{connectivity → provider}/connectivity-indicator.tsx +1 -1
  344. package/src/{connectivity → provider}/connectivity-provider.tsx +1 -1
  345. package/src/provider/error-fallback.module.css +21 -0
  346. package/src/provider/error-fallback.module.css.d.ts +9 -0
  347. package/src/provider/index.tsx +71 -71
  348. package/src/provider/lab-theme.ts +1 -1
  349. package/src/{connectivity → provider}/use-connectivity.ts +3 -3
  350. package/src/query-client.ts +105 -0
  351. package/src/{query/devtools.tsx → query-devtools.tsx} +5 -4
  352. package/src/register.ts +20 -4
  353. package/src/router-tanstack/index.ts +4 -15
  354. package/src/router-tanstack/nav.ts +1 -1
  355. package/src/router-tanstack/search-store.ts +3 -4
  356. package/src/router-tanstack/use-nav.ts +1 -1
  357. package/src/shell/app-breadcrumbs.tsx +1 -1
  358. package/src/shell/app-main.module.css +11 -0
  359. package/src/shell/app-mobile-nav.tsx +28 -1
  360. package/src/shell/app-sidebar.module.css +10 -0
  361. package/src/shell/app-sidebar.tsx +31 -2
  362. package/src/shell/index.tsx +23 -28
  363. package/src/shell/mobile-nav-model.ts +1 -1
  364. package/src/shell/page-aside.tsx +2 -52
  365. package/src/shell/page-title.module.css +33 -0
  366. package/src/shell/page-title.module.css.d.ts +11 -0
  367. package/src/shell/page-title.tsx +57 -0
  368. package/src/shell/sidebar-block-model.ts +1 -1
  369. package/src/shell/sidebar-blocks.tsx +1 -1
  370. package/src/shell/use-breakpoint.ts +73 -0
  371. package/src/state/fields.ts +7 -43
  372. package/src/styles.css +36 -0
  373. package/src/surfaces.ts +47 -61
  374. package/src/theme/index.ts +7 -0
  375. package/src/{theme-toggle/index.tsx → theme/theme-toggle.tsx} +1 -1
  376. package/src/tokens/index.ts +10 -0
  377. package/src/tokens/palette.ts +12 -0
  378. package/dist/connectivity/connectivity-indicator.d.ts.map +0 -1
  379. package/dist/connectivity/connectivity-provider.d.ts.map +0 -1
  380. package/dist/connectivity/index.d.ts +0 -14
  381. package/dist/connectivity/index.d.ts.map +0 -1
  382. package/dist/connectivity/index.js +0 -8
  383. package/dist/connectivity/types.d.ts.map +0 -1
  384. package/dist/connectivity/use-connectivity.d.ts +0 -3
  385. package/dist/connectivity/use-connectivity.d.ts.map +0 -1
  386. package/dist/data/index.d.ts +0 -38
  387. package/dist/data/index.d.ts.map +0 -1
  388. package/dist/data/index.js +0 -24
  389. package/dist/motion/index.d.ts.map +0 -1
  390. package/dist/nav/types.d.ts.map +0 -1
  391. package/dist/notifications/overlay.d.ts +0 -20
  392. package/dist/notifications/overlay.d.ts.map +0 -1
  393. package/dist/notifications/overlay.js +0 -14
  394. package/dist/query/devtools.d.ts.map +0 -1
  395. package/dist/query/error-message.d.ts +0 -41
  396. package/dist/query/error-message.d.ts.map +0 -1
  397. package/dist/query/error-message.js +0 -30
  398. package/dist/query/index.d.ts +0 -47
  399. package/dist/query/index.d.ts.map +0 -1
  400. package/dist/query/index.js +0 -56
  401. package/dist/router-tanstack/field.d.ts +0 -14
  402. package/dist/router-tanstack/field.d.ts.map +0 -1
  403. package/dist/router-tanstack/field.js +0 -4
  404. package/dist/router-tanstack/multi-search-param-store.d.ts +0 -43
  405. package/dist/router-tanstack/multi-search-param-store.d.ts.map +0 -1
  406. package/dist/router-tanstack/multi-search-param-store.js +0 -30
  407. package/dist/router-tanstack/search-param-store.d.ts +0 -42
  408. package/dist/router-tanstack/search-param-store.d.ts.map +0 -1
  409. package/dist/router-tanstack/search-param-store.js +0 -25
  410. package/dist/section/index.d.ts +0 -2
  411. package/dist/section/index.d.ts.map +0 -1
  412. package/dist/section/index.js +0 -4
  413. package/dist/theme-toggle/index.d.ts.map +0 -1
  414. package/dist/utils/is-dev.d.ts.map +0 -1
  415. package/dist/widget-header/delta-badge.d.ts +0 -19
  416. package/dist/widget-header/delta-badge.d.ts.map +0 -1
  417. package/dist/widget-header/delta-badge.js +0 -36
  418. package/dist/widget-header/index.d.ts +0 -3
  419. package/dist/widget-header/index.d.ts.map +0 -1
  420. package/dist/widget-header/index.js +0 -8
  421. package/dist/widget-header/widget-header.d.ts.map +0 -1
  422. package/src/connectivity/index.ts +0 -19
  423. package/src/data/index.ts +0 -69
  424. package/src/notifications/overlay.tsx +0 -66
  425. package/src/query/error-message.ts +0 -70
  426. package/src/query/index.ts +0 -97
  427. package/src/router-tanstack/field.ts +0 -36
  428. package/src/router-tanstack/multi-search-param-store.ts +0 -106
  429. package/src/router-tanstack/search-param-store.ts +0 -100
  430. package/src/section/index.ts +0 -1
  431. package/src/widget-header/delta-badge.tsx +0 -77
  432. package/src/widget-header/index.ts +0 -10
  433. /package/dist/{utils → common}/is-dev.d.ts +0 -0
  434. /package/dist/{utils → common}/is-dev.js +0 -0
  435. /package/dist/{motion/index.js → common/motion.js} +0 -0
  436. /package/dist/{section → dashboard}/section.module.css +0 -0
  437. /package/dist/{section → dashboard}/section.module.css.d.ts +0 -0
  438. /package/dist/{widget-header → dashboard}/widget-header.d.ts +0 -0
  439. /package/dist/{widget-header → dashboard}/widget-header.js +0 -0
  440. /package/dist/{widget-header → dashboard}/widget-header.module.css +0 -0
  441. /package/dist/{widget-header → dashboard}/widget-header.module.css.d.ts +0 -0
  442. /package/dist/{connectivity → provider}/connectivity-indicator.d.ts +0 -0
  443. /package/dist/{connectivity → provider}/connectivity-indicator.js +0 -0
  444. /package/dist/{connectivity → provider}/connectivity-provider.js +0 -0
  445. /package/dist/{connectivity/types.js → provider/connectivity-types.js} +0 -0
  446. /package/dist/{connectivity → provider}/use-connectivity.js +0 -0
  447. /package/dist/{query/devtools.js → query-devtools.js} +0 -0
  448. /package/dist/{nav/types.js → shell/nav-types.js} +0 -0
  449. /package/src/{utils → common}/is-dev.ts +0 -0
  450. /package/src/{motion/index.ts → common/motion.ts} +0 -0
  451. /package/src/{section → dashboard}/section.module.css +0 -0
  452. /package/src/{section → dashboard}/section.module.css.d.ts +0 -0
  453. /package/src/{widget-header → dashboard}/widget-header.module.css +0 -0
  454. /package/src/{widget-header → dashboard}/widget-header.module.css.d.ts +0 -0
  455. /package/src/{widget-header → dashboard}/widget-header.tsx +0 -0
  456. /package/src/{connectivity/types.ts → provider/connectivity-types.ts} +0 -0
  457. /package/src/{nav/types.ts → shell/nav-types.ts} +0 -0
@@ -1,97 +0,0 @@
1
- /**
2
- * ./query — thin TanStack Query adapter + transport-agnostic Eden unwrap.
3
- * Optional peer: @tanstack/react-query.
4
- */
5
- import { QueryClient } from '@tanstack/react-query'
6
- import type { QueryClientConfig } from '@tanstack/react-query'
7
-
8
- // ── createBasaltQueryClient ───────────────────────────────────────────────────────────────────────
9
-
10
- const BASALT_QUERY_DEFAULTS = {
11
- staleTime: 30_000,
12
- gcTime: 5 * 60 * 1000,
13
- retry: 2,
14
- refetchOnWindowFocus: false,
15
- } as const
16
-
17
- /**
18
- * Wraps QueryClient with basalt dashboard defaults. All options are mergeable — consumer
19
- * overrides win per-query, framework defaults are the fallback.
20
- *
21
- * @example
22
- * import { createBasaltQueryClient, QueryClientProvider } from 'basalt-ui/query'
23
- * import { useState } from 'react'
24
- *
25
- * function Root({ children }: { children: React.ReactNode }) {
26
- * const [client] = useState(() => createBasaltQueryClient())
27
- * return <QueryClientProvider client={client}>{children}</QueryClientProvider>
28
- * }
29
- */
30
- export function createBasaltQueryClient(config?: QueryClientConfig): QueryClient {
31
- return new QueryClient({
32
- ...config,
33
- defaultOptions: {
34
- ...config?.defaultOptions,
35
- queries: { ...BASALT_QUERY_DEFAULTS, ...config?.defaultOptions?.queries },
36
- },
37
- })
38
- }
39
-
40
- // ── unwrap ────────────────────────────────────────────────────────────────────────────────────────
41
-
42
- /**
43
- * Transport-agnostic unwrap for any `{ data, error }` envelope (Eden Treaty, raw fetch wrappers,
44
- * etc.). TData is inferred from the data field. Throws on the error branch so failures surface
45
- * to the nearest error boundary or TanStack Query's error state.
46
- *
47
- * Null guard: if `error` is falsy but `data` is `null`, unwrap throws with a descriptive message.
48
- * This catches 204 No Content responses and silent transport failures that return `{ data: null,
49
- * error: null }` — both signal an unexpected absence of data and should not silently resolve.
50
- *
51
- * @example
52
- * import { unwrap } from 'basalt-ui/query'
53
- *
54
- * queryFn: () => unwrap(api.users.get({ query: params }))
55
- * // mutation:
56
- * mutationFn: (body) => unwrap(api.resource.post({ body }))
57
- * // manual:
58
- * const rows = await unwrap(api.users.get())
59
- */
60
- export async function unwrap<TData>(
61
- response: Promise<{ data: TData | null; error: unknown }>,
62
- ): Promise<TData> {
63
- const { data, error } = await response
64
- if (error) throw error
65
- if (data === null)
66
- throw new Error(
67
- 'unwrap: null data with no error — check for a 204 response or a transport failure',
68
- )
69
- return data as TData
70
- }
71
-
72
- // ── Error decoding ────────────────────────────────────────────────────────────────────────────────
73
-
74
- export { toErrorMessage, errorStatus } from './error-message'
75
-
76
- // ── Re-exports from @tanstack/react-query ────────────────────────────────────────────────────────
77
-
78
- // Provider + boundary helpers
79
- export {
80
- QueryClientProvider,
81
- QueryErrorResetBoundary,
82
- useQueryErrorResetBoundary,
83
- } from '@tanstack/react-query'
84
-
85
- // Primary fetch hooks — import from basalt-ui/query rather than dual-importing @tanstack/react-query
86
- export {
87
- useQuery,
88
- useSuspenseQuery,
89
- useMutation,
90
- useQueryClient,
91
- useInfiniteQuery,
92
- queryOptions,
93
- } from '@tanstack/react-query'
94
-
95
- // ── Re-export devtools helper ─────────────────────────────────────────────────────────────────────
96
-
97
- export { BasaltQueryDevtools } from './devtools'
@@ -1,36 +0,0 @@
1
- /**
2
- * `field.*` — the field vocabulary `createSearchStore` takes, re-exported at the surface a consumer
3
- * imports it from (`basalt-ui/router-tanstack`, beside the store factory).
4
- *
5
- * The builders and their codecs LIVE in `../state` on purpose: a field is declarative data with no
6
- * router in it, and `createLocalStore` — the router-free lane, published on `basalt-ui/state` —
7
- * has to build the same fields without pulling in `@tanstack/react-router`. One definition, two
8
- * surfaces, no second description of the same param.
9
- *
10
- * Full field reference: the JSDoc on `field` itself, and `docs/CONTROLS-SPEC.md` §4.
11
- */
12
- export { field } from '../state'
13
- export type {
14
- AnyField,
15
- BooleanField,
16
- EnumField,
17
- FieldFallback,
18
- FieldHandle,
19
- FieldLane,
20
- FieldOption,
21
- FieldSetOptions,
22
- FieldValue,
23
- MultiField,
24
- NumberField,
25
- RangeField,
26
- RangeParams,
27
- RangePresets,
28
- RangeWindow,
29
- RangeWindows,
30
- RangeValue,
31
- ResolvedLane,
32
- ResolveLane,
33
- SearchValues,
34
- StoredValues,
35
- StringField,
36
- } from '../state'
@@ -1,106 +0,0 @@
1
- /**
2
- * @deprecated `createMultiSearchParamStore` is a thin wrapper over `createSearchStore`
3
- * and is removed in 1.29.0. Replace it with `field.multi`:
4
- *
5
- * const store = createSearchStore({
6
- * key: 'article-tags',
7
- * fields: { tags: field.multi(['api', 'design', 'guide'], []) },
8
- * })
9
- *
10
- * Two differences to know when you migrate:
11
- *
12
- * - **An empty URL array is a VALUE in the new store**, not "absent". This wrapper keeps the old
13
- * rule (`?tags=[]` falls through to localStorage, then to `fallback`) so an existing consumer's
14
- * links behave identically; `field.multi` treats a cleared selection as a cleared selection.
15
- * - `useStore` is localStorage-only. `store.field.tags.use()` reads the URL first (A8).
16
- *
17
- * Encoding is unchanged and array-native: TanStack Router's default
18
- * `stringifySearchWith(JSON.stringify, JSON.parse)` round-trips `{ tags: ['a', 'b'] }` losslessly,
19
- * so there is no CSV step to intercept — a consumer wanting `?tags=a,b` configures router-global
20
- * `parseSearch`/`stringifySearch` and this store keeps working untouched, because it hands the
21
- * router an array rather than an encoding.
22
- *
23
- * Decoding is unchanged too: array-only input, allowlist-filtered, deduped, then re-sorted into
24
- * `values` DECLARATION order — so `['api', 'design']` and `['design', 'api']` normalize to the same
25
- * array, and one logical selection has one URL.
26
- *
27
- * The four returned members (`validateSearch`, `useStore`, `readStored`, `linkSearch`), their
28
- * signatures and the single-value localStorage envelope are preserved byte-for-byte.
29
- */
30
- import { createPersistedState, field } from '../state'
31
- import { buildSearchStore } from './search-store'
32
-
33
- // ── Types ──────────────────────────────────────────────────────────────────
34
-
35
- export type MultiSearchParamStoreOptions<T extends string, P extends string = string> = {
36
- /** localStorage key (namespaced `basalt:<key>` automatically). */
37
- key: string
38
- /** URL search-param name (e.g. `"tags"`, `"categories"`). */
39
- param: P
40
- /** Allowed values — `as const` for best type inference. Also the canonical sort order. */
41
- values: readonly T[]
42
- /** Factory default when nothing is in the URL or localStorage. Default `[]` (unfiltered). */
43
- fallback?: readonly T[]
44
- /** Envelope version — bump when `values` change to discard stale localStorage. */
45
- version?: number
46
- }
47
-
48
- export type MultiSearchParamStore<T extends string, P extends string = string> = {
49
- /**
50
- * validateSearch — pass directly to `createFileRoute({ validateSearch })`.
51
- * Falls back to localStorage, then to `fallback`.
52
- */
53
- validateSearch: (search: Record<string, unknown>) => { [K in P]: readonly T[] }
54
- /**
55
- * React hook: `const [current, persist] = store.useStore()`.
56
- * localStorage only — it does NOT read or write the URL.
57
- */
58
- useStore: () => readonly [readonly T[], (next: readonly T[]) => void]
59
- /** Plain read — for use outside React (tests, guards, fallback reads). */
60
- readStored: () => readonly T[] | null
61
- /**
62
- * The click-time `search:` thunk for a nav link — `() => ({ [param]: readStored() ?? fallback })`.
63
- * Pass it BY REFERENCE (`search: store.linkSearch`), never call it; see `createSearchParamStore`
64
- * for why a module-scope literal silently defeats the store.
65
- *
66
- * No dev warning rides on this one, unlike the single-value store: an empty array in the URL is
67
- * indistinguishable from an absent param here, so a link declaring `{ tags: [] }` restores
68
- * correctly and there is no broken state to detect.
69
- */
70
- linkSearch: () => { [K in P]: readonly T[] }
71
- }
72
-
73
- // ── Implementation ─────────────────────────────────────────────────────────
74
-
75
- /** @deprecated Use `createSearchStore` + `field.multi`. Removed in 1.29.0. */
76
- export function createMultiSearchParamStore<const T extends string, const P extends string>(
77
- opts: MultiSearchParamStoreOptions<T, P>,
78
- ): MultiSearchParamStore<T, P> {
79
- const version = opts.version ?? 1
80
- const fallback = opts.fallback ?? []
81
- const store = buildSearchStore({
82
- key: opts.key,
83
- version,
84
- fields: { [opts.param]: field.multi(opts.values, fallback) },
85
- legacyValueField: opts.param,
86
- })
87
-
88
- const persisted = createPersistedState<readonly T[]>({
89
- key: opts.key,
90
- version,
91
- initial: fallback,
92
- })
93
- // A reader, like the single-value wrapper's — see the note there.
94
- const useStore = (): readonly [readonly T[], (next: readonly T[]) => void] => {
95
- store.markReaderWired()
96
- return persisted()
97
- }
98
-
99
- return {
100
- validateSearch: (search) => store.validateSearch(search) as { [K in P]: readonly T[] },
101
- useStore,
102
- readStored: () =>
103
- (store.readStored() as Record<string, readonly T[] | undefined>)[opts.param] ?? null,
104
- linkSearch: () => store.linkSearch() as { [K in P]: readonly T[] },
105
- }
106
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * @deprecated `createSearchParamStore` is a thin wrapper over `createSearchStore` and is
3
- * removed in 1.29.0. It can express exactly one closed string enum on one param; the store it
4
- * delegates to expresses six field kinds, per-field lanes, and a range's three params.
5
- *
6
- * Migration is mechanical:
7
- *
8
- * // before
9
- * const range = createSearchParamStore({
10
- * key: 'dashboard-range', param: 'range', values: ['1d', '7d', '30d'] as const, fallback: '30d',
11
- * })
12
- * const [, persist] = range.useStore() // localStorage only — never the URL
13
- *
14
- * // after
15
- * const dash = createSearchStore({
16
- * key: 'dashboard-range',
17
- * fields: { range: field.enum(['1d', '7d', '30d'], '30d') },
18
- * })
19
- * const [value, set] = dash.field.range.use() // reads the URL, writes both lanes
20
- *
21
- * The two are NOT equivalent in the one way that matters: `useStore` reads localStorage, so a deep
22
- * link `?range=7d` rendered `30d` (A8). `field.range.use()` reads the URL first. See
23
- * `docs/CONTROLS-SPEC.md` §4 and `MIGRATING.md`.
24
- *
25
- * What the wrapper preserves byte-for-byte, because `basalt-ui-obsidian` consumes it two hops
26
- * downstream: the four returned members (`validateSearch`, `useStore`, `readStored`, `linkSearch`),
27
- * their signatures, and the single-value localStorage envelope an existing browser already holds.
28
- */
29
- import { createPersistedState, field } from '../state'
30
- import { buildSearchStore } from './search-store'
31
-
32
- // ── Types ──────────────────────────────────────────────────────────────────
33
-
34
- export type SearchParamStoreOptions<T extends string, P extends string = string> = {
35
- /** localStorage key (namespaced `basalt:<key>` automatically). */
36
- key: string
37
- /** URL search-param name (e.g. `"range"`, `"tab"`, `"filter"`). */
38
- param: P
39
- /** Allowed values — `as const` for best type inference. */
40
- values: readonly T[]
41
- /** Factory default when nothing is in the URL or localStorage. */
42
- fallback: T
43
- /** Envelope version — bump when `values` change to discard stale localStorage. */
44
- version?: number
45
- }
46
-
47
- export type SearchParamStore<T extends string, P extends string = string> = {
48
- /**
49
- * validateSearch — pass directly to `createFileRoute({ validateSearch })`.
50
- * Falls back to localStorage, then to `fallback`.
51
- */
52
- validateSearch: (search: Record<string, unknown>) => { [K in P]: T }
53
- /**
54
- * React hook: `const [current, persist] = store.useStore()`.
55
- * localStorage only — it does NOT read or write the URL. `createSearchStore`'s
56
- * `field.<name>.use()` is the replacement that does both.
57
- */
58
- useStore: () => readonly [T, (next: T) => void]
59
- /** Plain read — for use outside React (tests, guards, fallback reads). */
60
- readStored: () => T | null
61
- /**
62
- * The click-time `search:` thunk for a nav link — `() => ({ [param]: readStored() ?? fallback })`.
63
- *
64
- * Pass it BY REFERENCE (`search: store.linkSearch`), never call it: `<Link>` re-evaluates the
65
- * thunk on every click, so arriving from outside the sub-tree restores the last selection,
66
- * whereas a value computed once at module scope goes stale immediately and pins the fallback.
67
- */
68
- linkSearch: () => { [K in P]: T }
69
- }
70
-
71
- // ── Implementation ─────────────────────────────────────────────────────────
72
-
73
- /** @deprecated Use `createSearchStore` + `field.enum`. Removed in 1.29.0. */
74
- export function createSearchParamStore<const T extends string, const P extends string>(
75
- opts: SearchParamStoreOptions<T, P>,
76
- ): SearchParamStore<T, P> {
77
- const version = opts.version ?? 1
78
- const store = buildSearchStore({
79
- key: opts.key,
80
- version,
81
- fields: { [opts.param]: field.enum(opts.values, opts.fallback) },
82
- legacyValueField: opts.param,
83
- })
84
-
85
- const persisted = createPersistedState<T>({ key: opts.key, version, initial: opts.fallback })
86
- // `useStore` is a reader too. Without this, a consumer whose ONLY reader is `useStore()` — the
87
- // documented wiring for this factory — would start seeing the pinned-link warning it never saw
88
- // before, purely because the wrapper now delegates.
89
- const useStore = (): readonly [T, (next: T) => void] => {
90
- store.markReaderWired()
91
- return persisted()
92
- }
93
-
94
- return {
95
- validateSearch: (search) => store.validateSearch(search) as { [K in P]: T },
96
- useStore,
97
- readStored: () => (store.readStored() as Record<string, T | undefined>)[opts.param] ?? null,
98
- linkSearch: () => store.linkSearch() as { [K in P]: T },
99
- }
100
- }
@@ -1 +0,0 @@
1
- export { Section, type SectionProps, type SectionSlot } from './section'
@@ -1,77 +0,0 @@
1
- /**
2
- * DeltaBadge — the KPI trend chip (docs/DESIGN-SPEC.md §5): mono 11.5px weight 600, status-color
3
- * text on a status-13% tint, control radius, 2px/7px padding, optional ▲/▼ glyph at 9px.
4
- * `polarity` decides the TONE the sign maps to — `'up-good'` (default) reads a rise as success and
5
- * a fall as danger; `'up-bad'` inverts that for a metric where a rise is the worse reading (a
6
- * cycle-top index, latency, error rate); `'neutral'` renders every sign in a faint, non-verdict
7
- * tint. Zero is always faint with no glyph, under every polarity. The label never carries a
8
- * leading "+"; pass `format` to control the magnitude string (defaults to a one-decimal percentage
9
- * of the absolute value). The ▲/▼ glyph is DIRECTION, not verdict, and stays polarity-independent —
10
- * governed only by `withGlyph` and the sign.
11
- *
12
- * Mantine-free (plain `<span>` + this folder's CSS module, docs/CONTROLS-SPEC.md §2.2) so
13
- * `WidgetHeader` can compose it from inside `charts/` without tripping `basalt/token-layer-
14
- * boundary` or `check-dist-layering.mjs`.
15
- *
16
- * @example
17
- * import { DeltaBadge } from 'basalt-ui'
18
- *
19
- * <DeltaBadge value={12.4} /> // ▲ 12.4%, success tint
20
- * <DeltaBadge value={-3.1} /> // ▼ 3.1%, danger tint
21
- * <DeltaBadge value={0} /> // 0.0%, neutral faint tint, no glyph
22
- * <DeltaBadge value={182} format={(v) => `${Math.abs(v)}ms`} withGlyph={false} />
23
- * <DeltaBadge value={35.9} polarity="up-bad" /> // ▲ 35.9%, danger tint — a rise is bad here
24
- */
25
- import { alpha, VX } from '../tokens'
26
- import classes from './widget-header.module.css'
27
-
28
- export type DeltaPolarity = 'up-good' | 'up-bad' | 'neutral'
29
-
30
- export type DeltaBadgeProps = {
31
- /** Signed delta driving tone (positive/negative/zero) and, by default, the label magnitude. */
32
- value: number
33
- /** Which sign reads as the good verdict. `'up-good'` (default) is today's behaviour — positive
34
- * success, negative danger. `'up-bad'` inverts it for a metric where a rise is the worse reading.
35
- * `'neutral'` renders every sign in the faint tint — a change with no verdict attached. Zero is
36
- * always faint regardless. */
37
- polarity?: DeltaPolarity
38
- /** Formats the value into the label text. Defaults to `${Math.abs(value).toFixed(1)}%`. */
39
- format?: (value: number) => string
40
- /** Render the ▲/▼ direction glyph. Defaults to `true`; a zero value never shows a glyph. */
41
- withGlyph?: boolean
42
- /** Optional comparison timeframe rendered directly after the value in a dimmer shade of the same
43
- * tone (e.g. `MoM`, `WoW`, `YTD`) — states what the delta is measured against without a hover. */
44
- period?: string | undefined
45
- }
46
-
47
- const defaultFormat = (value: number): string => `${Math.abs(value).toFixed(1)}%`
48
-
49
- function resolveTone(value: number, polarity: DeltaPolarity): string {
50
- if (value === 0 || polarity === 'neutral') return VX.faint
51
- const rose = value > 0
52
- const good = polarity === 'up-good' ? rose : !rose
53
- return good ? VX.status.good : VX.status.bad
54
- }
55
-
56
- export function DeltaBadge({
57
- value,
58
- polarity = 'up-good',
59
- format = defaultFormat,
60
- withGlyph = true,
61
- period,
62
- }: DeltaBadgeProps) {
63
- const tone = resolveTone(value, polarity)
64
- const glyph = value > 0 ? '▲' : value < 0 ? '▼' : undefined
65
- const showGlyph = withGlyph && glyph !== undefined
66
-
67
- return (
68
- <span
69
- className={classes.deltaBadge}
70
- style={{ backgroundColor: alpha(tone, 0.13), color: tone }}
71
- >
72
- {showGlyph && <span className={classes.deltaGlyph}>{glyph}</span>}
73
- {format(value)}
74
- {period !== undefined && <span className={classes.deltaPeriod}>{period}</span>}
75
- </span>
76
- )
77
- }
@@ -1,10 +0,0 @@
1
- export {
2
- WidgetHeader,
3
- type WidgetHeaderDeltaProps,
4
- type WidgetHeaderMetricProps,
5
- type WidgetHeaderProps,
6
- type WidgetHeaderSlot,
7
- type WidgetHeaderTier,
8
- type WidgetHeaderTitleProps,
9
- } from './widget-header'
10
- export { DeltaBadge, type DeltaBadgeProps, type DeltaPolarity } from './delta-badge'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes