basalt-ui 0.4.2 → 1.0.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 (691) hide show
  1. package/AGENTS.md +70 -0
  2. package/CHANGELOG.md +210 -40
  3. package/LICENSE +201 -0
  4. package/README.md +421 -160
  5. package/agent/rules/basalt-agent.md +395 -0
  6. package/agent/rules/basalt-charts.md +170 -0
  7. package/agent/rules/basalt-commands.md +320 -0
  8. package/agent/rules/basalt-content.md +390 -0
  9. package/agent/rules/basalt-data.md +237 -0
  10. package/agent/rules/basalt-forms.md +186 -0
  11. package/agent/rules/basalt-mantine.md +327 -0
  12. package/agent/rules/basalt-notifications.md +264 -0
  13. package/agent/rules/basalt-query.md +130 -0
  14. package/agent/rules/basalt-router.md +173 -0
  15. package/agent/rules/basalt-state.md +99 -0
  16. package/agent/rules/basalt-tokens.md +148 -0
  17. package/agent/skills/basalt-app/SKILL.md +137 -0
  18. package/agent/skills/basalt-charts/SKILL.md +179 -0
  19. package/agent/skills/basalt-design/SKILL.md +249 -0
  20. package/agent/templates/CLAUDE-block.md.tpl +38 -0
  21. package/agent/templates/DESIGN.md.tpl +71 -0
  22. package/agent/templates/__root.tpl +31 -0
  23. package/agent/templates/query-client.ts.tpl +12 -0
  24. package/bin/basalt-ui.mjs +14 -0
  25. package/configs/check.yml +29 -0
  26. package/configs/lefthook.yml +25 -0
  27. package/configs/oxfmt.json +8 -0
  28. package/configs/oxlint-plugin.js +269 -0
  29. package/configs/oxlint-plugin.test.ts +107 -0
  30. package/configs/oxlint.json +116 -0
  31. package/configs/tsconfig.base.json +20 -0
  32. package/configs/tsconfig.node.json +8 -0
  33. package/configs/tsconfig.react-app.json +8 -0
  34. package/dist/agent/ai-sdk-transport.d.ts +85 -0
  35. package/dist/agent/ai-sdk-transport.d.ts.map +1 -0
  36. package/dist/agent/ai-sdk-transport.js +109 -0
  37. package/dist/agent/history.d.ts +55 -0
  38. package/dist/agent/history.d.ts.map +1 -0
  39. package/dist/agent/history.js +32 -0
  40. package/dist/agent/index.d.ts +53 -0
  41. package/dist/agent/index.d.ts.map +1 -0
  42. package/dist/agent/index.js +23 -0
  43. package/dist/agent/outcome.d.ts +71 -0
  44. package/dist/agent/outcome.d.ts.map +1 -0
  45. package/dist/agent/outcome.js +30 -0
  46. package/dist/agent/part-list.d.ts +75 -0
  47. package/dist/agent/part-list.d.ts.map +1 -0
  48. package/dist/agent/part-list.js +127 -0
  49. package/dist/agent/parts.d.ts +91 -0
  50. package/dist/agent/parts.d.ts.map +1 -0
  51. package/dist/agent/parts.js +49 -0
  52. package/dist/agent/stick-to-bottom.d.ts +23 -0
  53. package/dist/agent/stick-to-bottom.d.ts.map +1 -0
  54. package/dist/agent/stick-to-bottom.js +73 -0
  55. package/dist/agent/thread.d.ts +124 -0
  56. package/dist/agent/thread.d.ts.map +1 -0
  57. package/dist/agent/thread.js +131 -0
  58. package/dist/agent/transport.d.ts +87 -0
  59. package/dist/agent/transport.d.ts.map +1 -0
  60. package/dist/agent/transport.js +21 -0
  61. package/dist/agent/use-agent-stream.d.ts +34 -0
  62. package/dist/agent/use-agent-stream.d.ts.map +1 -0
  63. package/dist/agent/use-agent-stream.js +56 -0
  64. package/dist/agent/use-agent-thread-runs.d.ts +72 -0
  65. package/dist/agent/use-agent-thread-runs.d.ts.map +1 -0
  66. package/dist/agent/use-agent-thread-runs.js +217 -0
  67. package/dist/agent-chat/composer.d.ts +18 -0
  68. package/dist/agent-chat/composer.d.ts.map +1 -0
  69. package/dist/agent-chat/composer.js +86 -0
  70. package/dist/agent-chat/index.d.ts +24 -0
  71. package/dist/agent-chat/index.d.ts.map +1 -0
  72. package/dist/agent-chat/index.js +15 -0
  73. package/dist/agent-chat/thread-detail-panel.d.ts +27 -0
  74. package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -0
  75. package/dist/agent-chat/thread-detail-panel.js +108 -0
  76. package/dist/agent-chat/thread-feed.d.ts +18 -0
  77. package/dist/agent-chat/thread-feed.d.ts.map +1 -0
  78. package/dist/agent-chat/thread-feed.js +42 -0
  79. package/dist/agent-chat/thread-message.d.ts +31 -0
  80. package/dist/agent-chat/thread-message.d.ts.map +1 -0
  81. package/dist/agent-chat/thread-message.js +128 -0
  82. package/dist/agent-chat/thread-outcome-card.d.ts +19 -0
  83. package/dist/agent-chat/thread-outcome-card.d.ts.map +1 -0
  84. package/dist/agent-chat/thread-outcome-card.js +120 -0
  85. package/dist/agent-chat/thread-workspace.d.ts +27 -0
  86. package/dist/agent-chat/thread-workspace.d.ts.map +1 -0
  87. package/dist/agent-chat/thread-workspace.js +95 -0
  88. package/dist/charts/hooks/useChartSize.d.ts +25 -0
  89. package/dist/charts/hooks/useChartSize.d.ts.map +1 -0
  90. package/dist/charts/hooks/useChartSize.js +8 -0
  91. package/dist/charts/hooks/useChartTooltip.d.ts +13 -0
  92. package/dist/charts/hooks/useChartTooltip.d.ts.map +1 -0
  93. package/dist/charts/hooks/useChartTooltip.js +26 -0
  94. package/dist/charts/hooks/useHoverSync.d.ts +30 -0
  95. package/dist/charts/hooks/useHoverSync.d.ts.map +1 -0
  96. package/dist/charts/hooks/useHoverSync.js +70 -0
  97. package/dist/charts/hover-context.d.ts +21 -0
  98. package/dist/charts/hover-context.d.ts.map +1 -0
  99. package/dist/charts/hover-context.js +12 -0
  100. package/dist/charts/hover-sync.d.ts +14 -0
  101. package/dist/charts/hover-sync.d.ts.map +1 -0
  102. package/dist/charts/hover-sync.js +17 -0
  103. package/dist/charts/index.d.ts +47 -0
  104. package/dist/charts/index.d.ts.map +1 -0
  105. package/dist/charts/index.js +129 -0
  106. package/dist/charts/kinds/Bars.d.ts +129 -0
  107. package/dist/charts/kinds/Bars.d.ts.map +1 -0
  108. package/dist/charts/kinds/Bars.js +467 -0
  109. package/dist/charts/kinds/Donut.d.ts +65 -0
  110. package/dist/charts/kinds/Donut.d.ts.map +1 -0
  111. package/dist/charts/kinds/Donut.js +158 -0
  112. package/dist/charts/kinds/DualPanel.d.ts +67 -0
  113. package/dist/charts/kinds/DualPanel.d.ts.map +1 -0
  114. package/dist/charts/kinds/DualPanel.js +326 -0
  115. package/dist/charts/kinds/Heatmap.d.ts +59 -0
  116. package/dist/charts/kinds/Heatmap.d.ts.map +1 -0
  117. package/dist/charts/kinds/Heatmap.js +175 -0
  118. package/dist/charts/kinds/MultiLine.d.ts +73 -0
  119. package/dist/charts/kinds/MultiLine.d.ts.map +1 -0
  120. package/dist/charts/kinds/MultiLine.js +275 -0
  121. package/dist/charts/kinds/StackedArea.d.ts +35 -0
  122. package/dist/charts/kinds/StackedArea.d.ts.map +1 -0
  123. package/dist/charts/kinds/StackedArea.js +151 -0
  124. package/dist/charts/kinds/ZonedLine.d.ts +94 -0
  125. package/dist/charts/kinds/ZonedLine.d.ts.map +1 -0
  126. package/dist/charts/kinds/ZonedLine.js +218 -0
  127. package/dist/charts/primitives/AreaGradient.d.ts +18 -0
  128. package/dist/charts/primitives/AreaGradient.d.ts.map +1 -0
  129. package/dist/charts/primitives/AreaGradient.js +13 -0
  130. package/dist/charts/primitives/Axes.d.ts +22 -0
  131. package/dist/charts/primitives/Axes.d.ts.map +1 -0
  132. package/dist/charts/primitives/Axes.js +79 -0
  133. package/dist/charts/primitives/ChartCard.d.ts +14 -0
  134. package/dist/charts/primitives/ChartCard.d.ts.map +1 -0
  135. package/dist/charts/primitives/ChartCard.js +144 -0
  136. package/dist/charts/primitives/ChartFrame.d.ts +70 -0
  137. package/dist/charts/primitives/ChartFrame.d.ts.map +1 -0
  138. package/dist/charts/primitives/ChartFrame.js +77 -0
  139. package/dist/charts/primitives/ChartLegend.d.ts +36 -0
  140. package/dist/charts/primitives/ChartLegend.d.ts.map +1 -0
  141. package/dist/charts/primitives/ChartLegend.js +234 -0
  142. package/dist/charts/primitives/ChartTooltip.d.ts +34 -0
  143. package/dist/charts/primitives/ChartTooltip.d.ts.map +1 -0
  144. package/dist/charts/primitives/ChartTooltip.js +134 -0
  145. package/dist/charts/primitives/Crosshair.d.ts +23 -0
  146. package/dist/charts/primitives/Crosshair.d.ts.map +1 -0
  147. package/dist/charts/primitives/Crosshair.js +21 -0
  148. package/dist/charts/primitives/HoverOverlay.d.ts +9 -0
  149. package/dist/charts/primitives/HoverOverlay.d.ts.map +1 -0
  150. package/dist/charts/primitives/HoverOverlay.js +21 -0
  151. package/dist/charts/primitives/ResponsiveChart.d.ts +45 -0
  152. package/dist/charts/primitives/ResponsiveChart.d.ts.map +1 -0
  153. package/dist/charts/primitives/ResponsiveChart.js +24 -0
  154. package/dist/charts/primitives/ZoneRects.d.ts +38 -0
  155. package/dist/charts/primitives/ZoneRects.d.ts.map +1 -0
  156. package/dist/charts/primitives/ZoneRects.js +30 -0
  157. package/dist/charts/series.d.ts +99 -0
  158. package/dist/charts/series.d.ts.map +1 -0
  159. package/dist/charts/series.js +55 -0
  160. package/dist/charts/sparklines/BarSparkline.d.ts +13 -0
  161. package/dist/charts/sparklines/BarSparkline.d.ts.map +1 -0
  162. package/dist/charts/sparklines/BarSparkline.js +33 -0
  163. package/dist/charts/sparklines/LineSparkline.d.ts +15 -0
  164. package/dist/charts/sparklines/LineSparkline.d.ts.map +1 -0
  165. package/dist/charts/sparklines/LineSparkline.js +39 -0
  166. package/dist/charts/sparklines/index.d.ts +3 -0
  167. package/dist/charts/sparklines/index.d.ts.map +1 -0
  168. package/dist/charts/sparklines/index.js +6 -0
  169. package/dist/charts/theme.d.ts +21 -0
  170. package/dist/charts/theme.d.ts.map +1 -0
  171. package/dist/charts/theme.js +30 -0
  172. package/dist/charts/utils/domain.d.ts +20 -0
  173. package/dist/charts/utils/domain.d.ts.map +1 -0
  174. package/dist/charts/utils/domain.js +7 -0
  175. package/dist/charts/utils/format.d.ts +5 -0
  176. package/dist/charts/utils/format.d.ts.map +1 -0
  177. package/dist/charts/utils/format.js +27 -0
  178. package/dist/charts/utils/ticks.d.ts +5 -0
  179. package/dist/charts/utils/ticks.d.ts.map +1 -0
  180. package/dist/charts/utils/ticks.js +18 -0
  181. package/dist/cli/index.d.ts +292 -0
  182. package/dist/cli/index.d.ts.map +1 -0
  183. package/dist/cli/index.js +889 -0
  184. package/dist/commands/ShortcutsHelp.d.ts +17 -0
  185. package/dist/commands/ShortcutsHelp.d.ts.map +1 -0
  186. package/dist/commands/ShortcutsHelp.js +64 -0
  187. package/dist/commands/define-commands.d.ts +140 -0
  188. package/dist/commands/define-commands.d.ts.map +1 -0
  189. package/dist/commands/define-commands.js +26 -0
  190. package/dist/commands/define-overlays.d.ts +134 -0
  191. package/dist/commands/define-overlays.d.ts.map +1 -0
  192. package/dist/commands/define-overlays.js +53 -0
  193. package/dist/commands/index.d.ts +42 -0
  194. package/dist/commands/index.d.ts.map +1 -0
  195. package/dist/commands/index.js +46 -0
  196. package/dist/commands/overlays-mount.d.ts +117 -0
  197. package/dist/commands/overlays-mount.d.ts.map +1 -0
  198. package/dist/commands/overlays-mount.js +116 -0
  199. package/dist/commands/projectors.d.ts +152 -0
  200. package/dist/commands/projectors.d.ts.map +1 -0
  201. package/dist/commands/projectors.js +87 -0
  202. package/dist/commands/shortcut-format.d.ts +48 -0
  203. package/dist/commands/shortcut-format.d.ts.map +1 -0
  204. package/dist/commands/shortcut-format.js +33 -0
  205. package/dist/commands/useCommandHotkeys.d.ts +14 -0
  206. package/dist/commands/useCommandHotkeys.d.ts.map +1 -0
  207. package/dist/commands/useCommandHotkeys.js +45 -0
  208. package/dist/connectivity/connectivity-indicator.d.ts +8 -0
  209. package/dist/connectivity/connectivity-indicator.d.ts.map +1 -0
  210. package/dist/connectivity/connectivity-indicator.js +203 -0
  211. package/dist/connectivity/connectivity-provider.d.ts +7 -0
  212. package/dist/connectivity/connectivity-provider.d.ts.map +1 -0
  213. package/dist/connectivity/connectivity-provider.js +125 -0
  214. package/dist/connectivity/index.d.ts +13 -0
  215. package/dist/connectivity/index.d.ts.map +1 -0
  216. package/dist/connectivity/index.js +8 -0
  217. package/dist/connectivity/types.d.ts +36 -0
  218. package/dist/connectivity/types.d.ts.map +1 -0
  219. package/dist/connectivity/types.js +0 -0
  220. package/dist/connectivity/use-connectivity.d.ts +3 -0
  221. package/dist/connectivity/use-connectivity.d.ts.map +1 -0
  222. package/dist/connectivity/use-connectivity.js +14 -0
  223. package/dist/content/article-actions.d.ts +39 -0
  224. package/dist/content/article-actions.d.ts.map +1 -0
  225. package/dist/content/article-actions.js +28 -0
  226. package/dist/content/article-card.d.ts +58 -0
  227. package/dist/content/article-card.d.ts.map +1 -0
  228. package/dist/content/article-card.js +76 -0
  229. package/dist/content/article-card.module.css +109 -0
  230. package/dist/content/article-card.module.css.d.ts +16 -0
  231. package/dist/content/article-filter-bar.d.ts +40 -0
  232. package/dist/content/article-filter-bar.d.ts.map +1 -0
  233. package/dist/content/article-filter-bar.js +56 -0
  234. package/dist/content/article-layout.d.ts +61 -0
  235. package/dist/content/article-layout.d.ts.map +1 -0
  236. package/dist/content/article-layout.js +71 -0
  237. package/dist/content/article-layout.module.css +131 -0
  238. package/dist/content/article-layout.module.css.d.ts +20 -0
  239. package/dist/content/article-model.d.ts +62 -0
  240. package/dist/content/article-model.d.ts.map +1 -0
  241. package/dist/content/article-model.js +41 -0
  242. package/dist/content/block-split.d.ts +24 -0
  243. package/dist/content/block-split.d.ts.map +1 -0
  244. package/dist/content/block-split.js +63 -0
  245. package/dist/content/callout-alert.d.ts +27 -0
  246. package/dist/content/callout-alert.d.ts.map +1 -0
  247. package/dist/content/callout-alert.js +59 -0
  248. package/dist/content/callout.d.ts +24 -0
  249. package/dist/content/callout.d.ts.map +1 -0
  250. package/dist/content/callout.js +59 -0
  251. package/dist/content/callout.module.css +77 -0
  252. package/dist/content/callout.module.css.d.ts +16 -0
  253. package/dist/content/code-block.d.ts +26 -0
  254. package/dist/content/code-block.d.ts.map +1 -0
  255. package/dist/content/code-block.js +41 -0
  256. package/dist/content/code-block.module.css +86 -0
  257. package/dist/content/code-block.module.css.d.ts +14 -0
  258. package/dist/content/copy-action.d.ts +29 -0
  259. package/dist/content/copy-action.d.ts.map +1 -0
  260. package/dist/content/copy-action.js +46 -0
  261. package/dist/content/fence-block.d.ts +19 -0
  262. package/dist/content/fence-block.d.ts.map +1 -0
  263. package/dist/content/fence-block.js +23 -0
  264. package/dist/content/glyphs.d.ts +18 -0
  265. package/dist/content/glyphs.d.ts.map +1 -0
  266. package/dist/content/glyphs.js +43 -0
  267. package/dist/content/guide.d.ts +47 -0
  268. package/dist/content/guide.d.ts.map +1 -0
  269. package/dist/content/guide.js +110 -0
  270. package/dist/content/guide.module.css +62 -0
  271. package/dist/content/guide.module.css.d.ts +13 -0
  272. package/dist/content/heading-anchor.d.ts +8 -0
  273. package/dist/content/heading-anchor.d.ts.map +1 -0
  274. package/dist/content/heading-anchor.js +23 -0
  275. package/dist/content/heading-components.d.ts +5 -0
  276. package/dist/content/heading-components.d.ts.map +1 -0
  277. package/dist/content/heading-components.js +41 -0
  278. package/dist/content/highlighter.d.ts +8 -0
  279. package/dist/content/highlighter.d.ts.map +1 -0
  280. package/dist/content/highlighter.js +85 -0
  281. package/dist/content/index.d.ts +45 -0
  282. package/dist/content/index.d.ts.map +1 -0
  283. package/dist/content/index.js +43 -0
  284. package/dist/content/markdown-hast.d.ts +23 -0
  285. package/dist/content/markdown-hast.d.ts.map +1 -0
  286. package/dist/content/markdown-hast.js +48 -0
  287. package/dist/content/markdown.d.ts +68 -0
  288. package/dist/content/markdown.d.ts.map +1 -0
  289. package/dist/content/markdown.js +180 -0
  290. package/dist/content/mdx.d.ts +20 -0
  291. package/dist/content/mdx.d.ts.map +1 -0
  292. package/dist/content/mdx.js +64 -0
  293. package/dist/content/mermaid.d.ts +32 -0
  294. package/dist/content/mermaid.d.ts.map +1 -0
  295. package/dist/content/mermaid.js +70 -0
  296. package/dist/content/mermaid.module.css +20 -0
  297. package/dist/content/mermaid.module.css.d.ts +8 -0
  298. package/dist/content/prose.d.ts +29 -0
  299. package/dist/content/prose.d.ts.map +1 -0
  300. package/dist/content/prose.js +24 -0
  301. package/dist/content/prose.module.css +330 -0
  302. package/dist/content/prose.module.css.d.ts +12 -0
  303. package/dist/content/reading-progress.d.ts +20 -0
  304. package/dist/content/reading-progress.d.ts.map +1 -0
  305. package/dist/content/reading-progress.js +38 -0
  306. package/dist/content/reading-progress.module.css +22 -0
  307. package/dist/content/reading-progress.module.css.d.ts +9 -0
  308. package/dist/content/slug.d.ts +28 -0
  309. package/dist/content/slug.d.ts.map +1 -0
  310. package/dist/content/slug.js +28 -0
  311. package/dist/content/toc.d.ts +37 -0
  312. package/dist/content/toc.d.ts.map +1 -0
  313. package/dist/content/toc.js +134 -0
  314. package/dist/content/toc.module.css +51 -0
  315. package/dist/content/toc.module.css.d.ts +13 -0
  316. package/dist/content/url-hardening.d.ts +23 -0
  317. package/dist/content/url-hardening.d.ts.map +1 -0
  318. package/dist/content/url-hardening.js +23 -0
  319. package/dist/dashboard/delta-badge.d.ts +13 -0
  320. package/dist/dashboard/delta-badge.d.ts.map +1 -0
  321. package/dist/dashboard/delta-badge.js +45 -0
  322. package/dist/dashboard/empty-state.d.ts +15 -0
  323. package/dist/dashboard/empty-state.d.ts.map +1 -0
  324. package/dist/dashboard/empty-state.js +56 -0
  325. package/dist/dashboard/index.d.ts +5 -0
  326. package/dist/dashboard/index.d.ts.map +1 -0
  327. package/dist/dashboard/index.js +16 -0
  328. package/dist/dashboard/settings-section.d.ts +24 -0
  329. package/dist/dashboard/settings-section.d.ts.map +1 -0
  330. package/dist/dashboard/settings-section.js +61 -0
  331. package/dist/dashboard/settings-section.module.css +23 -0
  332. package/dist/dashboard/settings-section.module.css.d.ts +10 -0
  333. package/dist/dashboard/stat-card.d.ts +18 -0
  334. package/dist/dashboard/stat-card.d.ts.map +1 -0
  335. package/dist/dashboard/stat-card.js +74 -0
  336. package/dist/data/data-table.d.ts +198 -0
  337. package/dist/data/data-table.d.ts.map +1 -0
  338. package/dist/data/data-table.js +342 -0
  339. package/dist/data/index.d.ts +34 -0
  340. package/dist/data/index.d.ts.map +1 -0
  341. package/dist/data/index.js +2 -0
  342. package/dist/data/table.d.ts +24 -0
  343. package/dist/data/table.d.ts.map +1 -0
  344. package/dist/data/table.js +20 -0
  345. package/dist/data/virtual-list.d.ts +74 -0
  346. package/dist/data/virtual-list.d.ts.map +1 -0
  347. package/dist/data/virtual-list.js +86 -0
  348. package/dist/data/virtual.d.ts +20 -0
  349. package/dist/data/virtual.d.ts.map +1 -0
  350. package/dist/data/virtual.js +4 -0
  351. package/dist/forms/FormErrorSummary.d.ts +29 -0
  352. package/dist/forms/FormErrorSummary.d.ts.map +1 -0
  353. package/dist/forms/FormErrorSummary.js +28 -0
  354. package/dist/forms/create-form.d.ts +31 -0
  355. package/dist/forms/create-form.d.ts.map +1 -0
  356. package/dist/forms/create-form.js +18 -0
  357. package/dist/forms/field.d.ts +22 -0
  358. package/dist/forms/field.d.ts.map +1 -0
  359. package/dist/forms/field.js +9 -0
  360. package/dist/forms/index.d.ts +17 -0
  361. package/dist/forms/index.d.ts.map +1 -0
  362. package/dist/forms/index.js +13 -0
  363. package/dist/forms/use-form-draft.d.ts +61 -0
  364. package/dist/forms/use-form-draft.d.ts.map +1 -0
  365. package/dist/forms/use-form-draft.js +55 -0
  366. package/dist/guard/guard-hook.d.ts +40 -0
  367. package/dist/guard/guard-hook.d.ts.map +1 -0
  368. package/dist/guard/guard-hook.js +55 -0
  369. package/dist/guard/index.d.ts +144 -0
  370. package/dist/guard/index.d.ts.map +1 -0
  371. package/dist/guard/index.js +315 -0
  372. package/dist/guard/types.d.ts +97 -0
  373. package/dist/guard/types.d.ts.map +1 -0
  374. package/dist/guard/types.js +0 -0
  375. package/dist/index.d.ts +24 -0
  376. package/dist/index.d.ts.map +1 -0
  377. package/dist/index.js +90 -0
  378. package/dist/motion/index.d.ts +29 -0
  379. package/dist/motion/index.d.ts.map +1 -0
  380. package/dist/motion/index.js +12 -0
  381. package/dist/notifications/bell.d.ts +12 -0
  382. package/dist/notifications/bell.d.ts.map +1 -0
  383. package/dist/notifications/bell.js +84 -0
  384. package/dist/notifications/center.d.ts +20 -0
  385. package/dist/notifications/center.d.ts.map +1 -0
  386. package/dist/notifications/center.js +144 -0
  387. package/dist/notifications/define-notifications.d.ts +97 -0
  388. package/dist/notifications/define-notifications.d.ts.map +1 -0
  389. package/dist/notifications/define-notifications.js +27 -0
  390. package/dist/notifications/index.d.ts +36 -0
  391. package/dist/notifications/index.d.ts.map +1 -0
  392. package/dist/notifications/index.js +52 -0
  393. package/dist/notifications/notify.d.ts +92 -0
  394. package/dist/notifications/notify.d.ts.map +1 -0
  395. package/dist/notifications/notify.js +127 -0
  396. package/dist/notifications/overlay.d.ts +20 -0
  397. package/dist/notifications/overlay.d.ts.map +1 -0
  398. package/dist/notifications/overlay.js +12 -0
  399. package/dist/notifications/store.d.ts +120 -0
  400. package/dist/notifications/store.d.ts.map +1 -0
  401. package/dist/notifications/store.js +113 -0
  402. package/dist/provider/index.d.ts +93 -0
  403. package/dist/provider/index.d.ts.map +1 -0
  404. package/dist/provider/index.js +106 -0
  405. package/dist/query/devtools.d.ts +21 -0
  406. package/dist/query/devtools.d.ts.map +1 -0
  407. package/dist/query/devtools.js +12 -0
  408. package/dist/query/index.d.ts +65 -0
  409. package/dist/query/index.d.ts.map +1 -0
  410. package/dist/query/index.js +68 -0
  411. package/dist/register.d.ts +139 -0
  412. package/dist/register.d.ts.map +1 -0
  413. package/dist/register.js +6 -0
  414. package/dist/router-tanstack/index.d.ts +74 -0
  415. package/dist/router-tanstack/index.d.ts.map +1 -0
  416. package/dist/router-tanstack/index.js +29 -0
  417. package/dist/router-tanstack/multi-search-param-store.d.ts +78 -0
  418. package/dist/router-tanstack/multi-search-param-store.d.ts.map +1 -0
  419. package/dist/router-tanstack/multi-search-param-store.js +35 -0
  420. package/dist/router-tanstack/search-param-store.d.ts +92 -0
  421. package/dist/router-tanstack/search-param-store.d.ts.map +1 -0
  422. package/dist/router-tanstack/search-param-store.js +26 -0
  423. package/dist/shell/account-types.d.ts +118 -0
  424. package/dist/shell/account-types.d.ts.map +1 -0
  425. package/dist/shell/account-types.js +0 -0
  426. package/dist/shell/app-breadcrumbs.d.ts +17 -0
  427. package/dist/shell/app-breadcrumbs.d.ts.map +1 -0
  428. package/dist/shell/app-breadcrumbs.js +39 -0
  429. package/dist/shell/app-header.module.css +73 -0
  430. package/dist/shell/app-header.module.css.d.ts +11 -0
  431. package/dist/shell/app-mobile-nav.d.ts +26 -0
  432. package/dist/shell/app-mobile-nav.d.ts.map +1 -0
  433. package/dist/shell/app-mobile-nav.js +106 -0
  434. package/dist/shell/app-mobile-nav.module.css +100 -0
  435. package/dist/shell/app-mobile-nav.module.css.d.ts +14 -0
  436. package/dist/shell/app-sidebar-account.d.ts +3 -0
  437. package/dist/shell/app-sidebar-account.d.ts.map +1 -0
  438. package/dist/shell/app-sidebar-account.js +84 -0
  439. package/dist/shell/app-sidebar.d.ts +56 -0
  440. package/dist/shell/app-sidebar.d.ts.map +1 -0
  441. package/dist/shell/app-sidebar.js +455 -0
  442. package/dist/shell/app-sidebar.module.css +414 -0
  443. package/dist/shell/app-sidebar.module.css.d.ts +34 -0
  444. package/dist/shell/index.d.ts +123 -0
  445. package/dist/shell/index.d.ts.map +1 -0
  446. package/dist/shell/index.js +179 -0
  447. package/dist/shell/page-header.d.ts +13 -0
  448. package/dist/shell/page-header.d.ts.map +1 -0
  449. package/dist/shell/page-header.js +23 -0
  450. package/dist/shell/sidebar-search.d.ts +12 -0
  451. package/dist/shell/sidebar-search.d.ts.map +1 -0
  452. package/dist/shell/sidebar-search.js +62 -0
  453. package/dist/shell/sidebar-search.module.css +62 -0
  454. package/dist/shell/sidebar-search.module.css.d.ts +11 -0
  455. package/dist/state.d.ts +62 -0
  456. package/dist/state.d.ts.map +1 -0
  457. package/dist/state.js +124 -0
  458. package/dist/styles.css +166 -0
  459. package/dist/surfaces.d.ts +386 -0
  460. package/dist/surfaces.d.ts.map +1 -0
  461. package/dist/surfaces.js +312 -0
  462. package/dist/theme/controls.module.css +143 -0
  463. package/dist/theme/controls.module.css.d.ts +17 -0
  464. package/dist/theme/floating.module.css +35 -0
  465. package/dist/theme/floating.module.css.d.ts +9 -0
  466. package/dist/theme/index.d.ts +22 -0
  467. package/dist/theme/index.d.ts.map +1 -0
  468. package/dist/theme/index.js +733 -0
  469. package/dist/theme/nav-link.module.css +67 -0
  470. package/dist/theme/nav-link.module.css.d.ts +8 -0
  471. package/dist/theme/segmented-control.module.css +14 -0
  472. package/dist/theme/segmented-control.module.css.d.ts +8 -0
  473. package/dist/theme/timeline.module.css +29 -0
  474. package/dist/theme/timeline.module.css.d.ts +9 -0
  475. package/dist/theme-lab/index.d.ts +59 -0
  476. package/dist/theme-lab/index.d.ts.map +1 -0
  477. package/dist/theme-lab/index.js +263 -0
  478. package/dist/theme-toggle/index.d.ts +8 -0
  479. package/dist/theme-toggle/index.d.ts.map +1 -0
  480. package/dist/theme-toggle/index.js +155 -0
  481. package/dist/tokens/index.d.ts +152 -0
  482. package/dist/tokens/index.d.ts.map +1 -0
  483. package/dist/tokens/index.js +249 -0
  484. package/dist/tokens/palette.d.ts +304 -0
  485. package/dist/tokens/palette.d.ts.map +1 -0
  486. package/dist/tokens/palette.js +186 -0
  487. package/dist/vite.d.ts +30 -0
  488. package/dist/vite.d.ts.map +1 -0
  489. package/dist/vite.js +68 -0
  490. package/llms.txt +149 -0
  491. package/package.json +243 -46
  492. package/src/agent/ai-sdk-transport.ts +280 -0
  493. package/src/agent/history.ts +128 -0
  494. package/src/agent/index.ts +92 -0
  495. package/src/agent/outcome.ts +120 -0
  496. package/src/agent/part-list.tsx +292 -0
  497. package/src/agent/parts.ts +136 -0
  498. package/src/agent/stick-to-bottom.tsx +154 -0
  499. package/src/agent/thread.ts +312 -0
  500. package/src/agent/transport.ts +114 -0
  501. package/src/agent/use-agent-stream.ts +141 -0
  502. package/src/agent/use-agent-thread-runs.ts +440 -0
  503. package/src/agent-chat/composer.tsx +131 -0
  504. package/src/agent-chat/index.ts +35 -0
  505. package/src/agent-chat/thread-detail-panel.tsx +192 -0
  506. package/src/agent-chat/thread-feed.tsx +81 -0
  507. package/src/agent-chat/thread-message.tsx +251 -0
  508. package/src/agent-chat/thread-outcome-card.tsx +196 -0
  509. package/src/agent-chat/thread-workspace.tsx +179 -0
  510. package/src/charts/hooks/useChartSize.ts +31 -0
  511. package/src/charts/hooks/useChartTooltip.ts +31 -0
  512. package/src/charts/hooks/useHoverSync.ts +116 -0
  513. package/src/charts/hover-context.ts +28 -0
  514. package/src/charts/hover-sync.tsx +37 -0
  515. package/src/charts/index.ts +118 -0
  516. package/src/charts/kinds/Bars.tsx +634 -0
  517. package/src/charts/kinds/Donut.tsx +233 -0
  518. package/src/charts/kinds/DualPanel.tsx +432 -0
  519. package/src/charts/kinds/Heatmap.tsx +255 -0
  520. package/src/charts/kinds/MultiLine.tsx +376 -0
  521. package/src/charts/kinds/StackedArea.tsx +218 -0
  522. package/src/charts/kinds/ZonedLine.tsx +346 -0
  523. package/src/charts/primitives/AreaGradient.tsx +26 -0
  524. package/src/charts/primitives/Axes.tsx +97 -0
  525. package/src/charts/primitives/ChartCard.tsx +180 -0
  526. package/src/charts/primitives/ChartFrame.tsx +157 -0
  527. package/src/charts/primitives/ChartLegend.tsx +302 -0
  528. package/src/charts/primitives/ChartTooltip.tsx +158 -0
  529. package/src/charts/primitives/Crosshair.tsx +40 -0
  530. package/src/charts/primitives/HoverOverlay.tsx +24 -0
  531. package/src/charts/primitives/ResponsiveChart.tsx +64 -0
  532. package/src/charts/primitives/ZoneRects.tsx +67 -0
  533. package/src/charts/series.ts +163 -0
  534. package/src/charts/sparklines/BarSparkline.tsx +48 -0
  535. package/src/charts/sparklines/LineSparkline.tsx +57 -0
  536. package/src/charts/sparklines/index.ts +2 -0
  537. package/src/charts/theme.tsx +53 -0
  538. package/src/charts/utils/domain.test.ts +24 -0
  539. package/src/charts/utils/domain.ts +22 -0
  540. package/src/charts/utils/format.ts +27 -0
  541. package/src/charts/utils/ticks.ts +18 -0
  542. package/src/cli/check-theme.test.ts +668 -0
  543. package/src/cli/help.test.ts +93 -0
  544. package/src/cli/index.ts +1535 -0
  545. package/src/cli/init-sync.test.ts +160 -0
  546. package/src/cli/placement-engine.test.ts +194 -0
  547. package/src/cli/tarball-parity.test.ts +44 -0
  548. package/src/cli/template-format.test.ts +64 -0
  549. package/src/commands/ShortcutsHelp.tsx +129 -0
  550. package/src/commands/define-commands.ts +184 -0
  551. package/src/commands/define-overlays.ts +197 -0
  552. package/src/commands/index.ts +86 -0
  553. package/src/commands/overlays-mount.tsx +301 -0
  554. package/src/commands/projectors.ts +267 -0
  555. package/src/commands/shortcut-format.ts +83 -0
  556. package/src/commands/useCommandHotkeys.ts +114 -0
  557. package/src/connectivity/connectivity-indicator.tsx +249 -0
  558. package/src/connectivity/connectivity-provider.tsx +186 -0
  559. package/src/connectivity/index.ts +18 -0
  560. package/src/connectivity/types.ts +39 -0
  561. package/src/connectivity/use-connectivity.ts +25 -0
  562. package/src/content/article-actions.test.ts +78 -0
  563. package/src/content/article-actions.ts +72 -0
  564. package/src/content/article-card.module.css +109 -0
  565. package/src/content/article-card.module.css.d.ts +16 -0
  566. package/src/content/article-card.tsx +173 -0
  567. package/src/content/article-filter-bar.tsx +88 -0
  568. package/src/content/article-layout.module.css +131 -0
  569. package/src/content/article-layout.module.css.d.ts +20 -0
  570. package/src/content/article-layout.tsx +167 -0
  571. package/src/content/article-model.test.ts +119 -0
  572. package/src/content/article-model.ts +110 -0
  573. package/src/content/block-split.test.ts +75 -0
  574. package/src/content/block-split.ts +102 -0
  575. package/src/content/callout-alert.ts +88 -0
  576. package/src/content/callout.module.css +77 -0
  577. package/src/content/callout.module.css.d.ts +16 -0
  578. package/src/content/callout.tsx +96 -0
  579. package/src/content/code-block.module.css +86 -0
  580. package/src/content/code-block.module.css.d.ts +14 -0
  581. package/src/content/code-block.tsx +82 -0
  582. package/src/content/copy-action.tsx +79 -0
  583. package/src/content/fence-block.tsx +39 -0
  584. package/src/content/glyphs.tsx +53 -0
  585. package/src/content/guide.module.css +62 -0
  586. package/src/content/guide.module.css.d.ts +13 -0
  587. package/src/content/guide.tsx +174 -0
  588. package/src/content/heading-anchor.tsx +54 -0
  589. package/src/content/heading-components.tsx +62 -0
  590. package/src/content/highlighter.ts +123 -0
  591. package/src/content/index.ts +60 -0
  592. package/src/content/markdown-hast.ts +80 -0
  593. package/src/content/markdown.tsx +346 -0
  594. package/src/content/mdx.tsx +127 -0
  595. package/src/content/mermaid.module.css +20 -0
  596. package/src/content/mermaid.module.css.d.ts +8 -0
  597. package/src/content/mermaid.tsx +124 -0
  598. package/src/content/prose.module.css +330 -0
  599. package/src/content/prose.module.css.d.ts +12 -0
  600. package/src/content/prose.tsx +53 -0
  601. package/src/content/reading-progress.module.css +22 -0
  602. package/src/content/reading-progress.module.css.d.ts +9 -0
  603. package/src/content/reading-progress.tsx +67 -0
  604. package/src/content/slug.test.ts +62 -0
  605. package/src/content/slug.ts +57 -0
  606. package/src/content/toc.module.css +51 -0
  607. package/src/content/toc.module.css.d.ts +13 -0
  608. package/src/content/toc.tsx +226 -0
  609. package/src/content/url-hardening.ts +46 -0
  610. package/src/dashboard/delta-badge.tsx +70 -0
  611. package/src/dashboard/empty-state.tsx +80 -0
  612. package/src/dashboard/index.ts +11 -0
  613. package/src/dashboard/settings-section.module.css +23 -0
  614. package/src/dashboard/settings-section.module.css.d.ts +10 -0
  615. package/src/dashboard/settings-section.tsx +118 -0
  616. package/src/dashboard/stat-card.tsx +105 -0
  617. package/src/data/data-table.tsx +695 -0
  618. package/src/data/index.ts +37 -0
  619. package/src/data/table.ts +46 -0
  620. package/src/data/virtual-list.tsx +180 -0
  621. package/src/data/virtual.ts +21 -0
  622. package/src/forms/FormErrorSummary.tsx +64 -0
  623. package/src/forms/create-form.ts +57 -0
  624. package/src/forms/field.ts +30 -0
  625. package/src/forms/index.ts +26 -0
  626. package/src/forms/use-form-draft.ts +170 -0
  627. package/src/guard/check-source.test.ts +834 -0
  628. package/src/guard/guard-hook.test.ts +173 -0
  629. package/src/guard/guard-hook.ts +122 -0
  630. package/src/guard/index.ts +510 -0
  631. package/src/guard/types.ts +117 -0
  632. package/src/index.ts +139 -0
  633. package/src/motion/index.ts +26 -0
  634. package/src/notifications/bell.tsx +108 -0
  635. package/src/notifications/center.tsx +245 -0
  636. package/src/notifications/define-notifications.ts +162 -0
  637. package/src/notifications/index.ts +79 -0
  638. package/src/notifications/notify.tsx +260 -0
  639. package/src/notifications/overlay.tsx +64 -0
  640. package/src/notifications/store.ts +287 -0
  641. package/src/provider/index.tsx +234 -0
  642. package/src/query/devtools.tsx +38 -0
  643. package/src/query/index.ts +129 -0
  644. package/src/register.ts +158 -0
  645. package/src/router-tanstack/index.ts +111 -0
  646. package/src/router-tanstack/multi-search-param-store.test.ts +56 -0
  647. package/src/router-tanstack/multi-search-param-store.ts +122 -0
  648. package/src/router-tanstack/search-param-store.ts +125 -0
  649. package/src/shell/account-types.ts +119 -0
  650. package/src/shell/app-breadcrumbs.tsx +90 -0
  651. package/src/shell/app-header.module.css +73 -0
  652. package/src/shell/app-header.module.css.d.ts +11 -0
  653. package/src/shell/app-mobile-nav.module.css +100 -0
  654. package/src/shell/app-mobile-nav.module.css.d.ts +14 -0
  655. package/src/shell/app-mobile-nav.tsx +146 -0
  656. package/src/shell/app-sidebar-account.tsx +142 -0
  657. package/src/shell/app-sidebar.module.css +414 -0
  658. package/src/shell/app-sidebar.module.css.d.ts +34 -0
  659. package/src/shell/app-sidebar.tsx +632 -0
  660. package/src/shell/index.tsx +343 -0
  661. package/src/shell/page-header.tsx +35 -0
  662. package/src/shell/sidebar-search.module.css +62 -0
  663. package/src/shell/sidebar-search.module.css.d.ts +11 -0
  664. package/src/shell/sidebar-search.tsx +80 -0
  665. package/src/state.ts +246 -0
  666. package/src/styles.css +166 -0
  667. package/src/styles.floor.test.ts +36 -0
  668. package/src/surfaces.ts +508 -0
  669. package/src/theme/border-coverage.test.ts +272 -0
  670. package/src/theme/contrast.test.ts +306 -0
  671. package/src/theme/controls.module.css +143 -0
  672. package/src/theme/controls.module.css.d.ts +17 -0
  673. package/src/theme/floating.module.css +35 -0
  674. package/src/theme/floating.module.css.d.ts +9 -0
  675. package/src/theme/index.ts +933 -0
  676. package/src/theme/nav-link.module.css +67 -0
  677. package/src/theme/nav-link.module.css.d.ts +8 -0
  678. package/src/theme/segmented-control.module.css +14 -0
  679. package/src/theme/segmented-control.module.css.d.ts +8 -0
  680. package/src/theme/shadow-surfaces.test.ts +421 -0
  681. package/src/theme/timeline.module.css +29 -0
  682. package/src/theme/timeline.module.css.d.ts +9 -0
  683. package/src/theme-lab/index.tsx +359 -0
  684. package/src/theme-lab/theme-lab.test.ts +60 -0
  685. package/src/theme-toggle/index.tsx +180 -0
  686. package/src/tokens/index.ts +369 -0
  687. package/src/tokens/palette.ts +288 -0
  688. package/src/vite.ts +122 -0
  689. package/src/index.css +0 -877
  690. package/src/starlight.css +0 -308
  691. package/tailwind.config.js +0 -78
package/src/index.ts ADDED
@@ -0,0 +1,139 @@
1
+ /**
2
+ * basalt-ui root barrel — the Mantine-coupled surface.
3
+ *
4
+ * Provider + theme + the app shell. The Mantine-free token/chart layer is published under the
5
+ * `basalt-ui/tokens` and `basalt-ui/charts` subpath exports (see package.json), NOT re-exported
6
+ * here, so a tokens/charts-only consumer never pulls in `@mantine/*`.
7
+ */
8
+
9
+ export {
10
+ BasaltProvider,
11
+ type BasaltProviderProps,
12
+ BasaltErrorBoundary,
13
+ type BasaltErrorContext,
14
+ } from './provider'
15
+ export { createBasaltTheme, baseTheme, cssVariablesResolver } from './theme'
16
+ export { ThemeToggle, type ThemeToggleProps } from './theme-toggle'
17
+ export { MOTION_DURATION, MOTION_SPRING, MOTION_EASE_STANDARD } from './motion'
18
+ export {
19
+ BasaltShell,
20
+ NavCountBadge,
21
+ AppSidebar,
22
+ SidebarSearch,
23
+ type SidebarSearchConfig,
24
+ SidebarAccount,
25
+ MobileNav,
26
+ AppBreadcrumbs,
27
+ type BreadcrumbLinkRenderer,
28
+ PageHeaderProvider,
29
+ PageActions,
30
+ PageActionsOutlet,
31
+ type SidebarSection,
32
+ type SidebarItem,
33
+ type BasaltShellProps,
34
+ type BrandConfig,
35
+ type SettingsMenuItem,
36
+ type AppSidebarProps,
37
+ type MobileNavItem,
38
+ type MobileNavSection,
39
+ type NavLinkRenderer,
40
+ type MobileNavLinkRenderer,
41
+ type AccountBadgeTone,
42
+ type BasaltIdentity,
43
+ type BasaltRole,
44
+ type BasaltPlan,
45
+ type AccountMenuItem,
46
+ type BasaltAccountState,
47
+ type BasaltAccountActions,
48
+ type BasaltAccountProps,
49
+ } from './shell'
50
+
51
+ // ── Design seam (register.ts) ─────────────────────────────────────────────────────────────────────
52
+ // BasaltRegister MUST be exported from the package main entry so `declare module 'basalt-ui'`
53
+ // augmentation works — a consumer cannot augment 'basalt-ui/charts'.
54
+ export {
55
+ type BasaltRegister,
56
+ type Slot,
57
+ type Series,
58
+ type SeriesKey,
59
+ type AsyncState,
60
+ assertNever,
61
+ type StandardSchemaV1,
62
+ } from './register'
63
+
64
+ // ── Persisted state + online hook (state.ts) ─────────────────────────────────────────────────────
65
+ export {
66
+ createPersistedState,
67
+ type PersistedStateOptions,
68
+ useOnlineStatus,
69
+ readPersistedValue,
70
+ } from './state'
71
+
72
+ // ── Dashboard composites (KPI atoms + settings building blocks) ──────────────────────────────────
73
+ export {
74
+ DeltaBadge,
75
+ type DeltaBadgeProps,
76
+ StatCard,
77
+ type StatCardProps,
78
+ EmptyState,
79
+ type EmptyStateProps,
80
+ SettingsSection,
81
+ type SettingsSectionProps,
82
+ SettingsRow,
83
+ type SettingsRowProps,
84
+ DangerZone,
85
+ type DangerZoneProps,
86
+ } from './dashboard'
87
+
88
+ // ── Connectivity (auto-mounted by BasaltProvider) ────────────────────────────────────────────────
89
+ export { ConnectivityProvider, ConnectivityIndicator, useConnectivity } from './connectivity'
90
+ export type {
91
+ ConnectivityStatus,
92
+ ConnectivitySnapshot,
93
+ ConnectivityProviderProps,
94
+ ConnectivityOverride,
95
+ } from './connectivity'
96
+
97
+ // ── Type-only re-exports for compile fixtures (H.4) ──────────────────────────────────────────────
98
+ // SurfaceSpec/RuleName/SkillName: the value SURFACES stays internal; types only for surfaces-broken
99
+ // fixture. GuardKind: type-only for fixture completeness. No ./surfaces subpath exposed.
100
+ export type { SurfaceSpec, RuleName, SkillName } from './surfaces'
101
+ export type { GuardKind } from './guard/types'
102
+
103
+ // ── Agent chat (thread feed + detail workspace) ──────────────────────────────────────────────────
104
+ // Everything from `./agent-chat` (Mantine-styled thread-chat components + the flagship
105
+ // ThreadWorkspace) belongs at the root. From the headless `./agent` layer, SELECTIVELY re-export
106
+ // only the pieces a ThreadWorkspace consumer needs — NOT an export-star — so the optional-peer
107
+ // BasaltStickToBottom and the rest of `./agent` stay off the root entry; `edenTransport` stays out
108
+ // too, sourced from `basalt-ui/agent` instead. `agent-chat/thread-message.tsx` DOES reach
109
+ // `./content`'s `Markdown` for its text renderer — root's markdown/shiki/mermaid optional peers
110
+ // come from that path, not from `./agent`.
111
+ export {
112
+ ThreadWorkspace,
113
+ ThreadFeed,
114
+ ThreadOutcomeCard,
115
+ ThreadDetailPanel,
116
+ Composer,
117
+ threadPartRenderers,
118
+ ThreadTranscript,
119
+ } from './agent-chat'
120
+ export type {
121
+ ThreadWorkspaceProps,
122
+ ThreadFeedProps,
123
+ ThreadOutcomeCardProps,
124
+ ThreadDetailPanelProps,
125
+ ComposerProps,
126
+ ThreadTranscriptProps,
127
+ } from './agent-chat'
128
+ export { createThreadsStore, heuristicOutcome, useAgentThreadRuns } from './agent'
129
+ export type {
130
+ AgentThread,
131
+ AgentOutcome,
132
+ ThreadStatus,
133
+ ThreadsStore,
134
+ ThreadsStoreOptions,
135
+ OutcomeResolver,
136
+ ChatMessage,
137
+ AgentPart,
138
+ AgentTransport,
139
+ } from './agent'
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Shared motion constants — the animation analog of the `--vx-*` token system. A component reaches
3
+ * for these instead of inventing its own duration/easing/spring values, so animated chrome across
4
+ * the framework feels like one identity. Pairs with `motion` (`motion/react`), the framework's one
5
+ * animation dependency (bundled implementation detail, same precedent as `@visx/*`).
6
+ *
7
+ * Reduced-motion is read via `@mantine/hooks`' `useReducedMotion` (already a peer dep) at the call
8
+ * site — this module stays framework-agnostic (no React) so it can be imported anywhere.
9
+ */
10
+
11
+ /**
12
+ * Seconds, for tween-based transitions. Capped at 0.3 (300ms) — basalt-mantine.md's interaction
13
+ * doctrine holds "never above 300ms (feels laggy)" for Mantine's own `Transition`, and the same
14
+ * ceiling applies here so the two animation mechanisms agree on pacing.
15
+ */
16
+ export const MOTION_DURATION = {
17
+ fast: 0.15,
18
+ base: 0.25,
19
+ slow: 0.3,
20
+ } as const
21
+
22
+ /** Standard ease curve for tween transitions (Material "standard" curve). */
23
+ export const MOTION_EASE_STANDARD = [0.4, 0, 0.2, 1] as const
24
+
25
+ /** Standard spring for interactive, physical-feeling transitions (icon morphs, reveals). */
26
+ export const MOTION_SPRING = { type: 'spring', stiffness: 400, damping: 32, mass: 0.9 } as const
@@ -0,0 +1,108 @@
1
+ /**
2
+ * NotificationBell — ActionIcon + Indicator showing the unread Inbox count, opens a
3
+ * NotificationCenter in a Popover. Designed for the shell `globalActions` slot (ReactNode).
4
+ *
5
+ * The badge counts unread Inbox items (errors / warnings / actionable notifications you haven't
6
+ * seen) — not every toast that fired. Opening the bell does NOT mark anything read; items are
7
+ * marked read when interacted with inside the center.
8
+ *
9
+ * @example
10
+ * import { NotificationBell } from 'basalt-ui/notifications'
11
+ *
12
+ * // In the shell's globalActions prop:
13
+ * <BasaltShell
14
+ * globalActions={<NotificationBell />}
15
+ * {...rest}
16
+ * />
17
+ */
18
+ import { ActionIcon, Indicator, Popover } from '@mantine/core'
19
+ import { useDisclosure } from '@mantine/hooks'
20
+ import { useRef } from 'react'
21
+ import { useNotificationHistory } from './store'
22
+ import { NotificationCenter } from './center'
23
+
24
+ const HOVER_OPEN_DELAY = 150
25
+ const HOVER_CLOSE_DELAY = 200
26
+
27
+ export type NotificationBellProps = {
28
+ /** Tooltip label. Default: 'Notifications'. */
29
+ label?: string
30
+ }
31
+
32
+ /**
33
+ * Bell icon button with an unread-Inbox indicator. Opens a NotificationCenter popover.
34
+ *
35
+ * @example
36
+ * <BasaltShell globalActions={<NotificationBell />} {...rest} />
37
+ */
38
+ export function NotificationBell({ label = 'Notifications' }: NotificationBellProps) {
39
+ const [opened, { open, toggle, close }] = useDisclosure(false)
40
+ const { unreadCount } = useNotificationHistory()
41
+ const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)
42
+
43
+ const scheduleOpen = () => {
44
+ clearTimeout(timer.current)
45
+ timer.current = setTimeout(() => open(), HOVER_OPEN_DELAY)
46
+ }
47
+ const scheduleClose = () => {
48
+ clearTimeout(timer.current)
49
+ timer.current = setTimeout(() => close(), HOVER_CLOSE_DELAY)
50
+ }
51
+
52
+ return (
53
+ <Popover opened={opened} onClose={close} position="bottom-end" withArrow withinPortal>
54
+ <Popover.Target>
55
+ <Indicator
56
+ color="color-mix(in srgb, var(--vx-ink) 8%, transparent)"
57
+ size={16}
58
+ label={unreadCount > 9 ? '9+' : String(unreadCount)}
59
+ disabled={unreadCount === 0}
60
+ processing={false}
61
+ styles={{
62
+ indicator: {
63
+ color: 'var(--vx-ink)',
64
+ fontFamily: 'var(--basalt-font-mono)',
65
+ fontWeight: 500,
66
+ },
67
+ }}
68
+ >
69
+ <ActionIcon
70
+ variant="transparent"
71
+ color="gray"
72
+ onClick={toggle}
73
+ onMouseEnter={scheduleOpen}
74
+ onMouseLeave={scheduleClose}
75
+ aria-label={label}
76
+ aria-expanded={opened}
77
+ aria-haspopup="dialog"
78
+ >
79
+ {/* Bell icon (simple SVG — no @tabler/icons dep per house rules) */}
80
+ <svg
81
+ width={18}
82
+ height={18}
83
+ viewBox="0 0 24 24"
84
+ fill="none"
85
+ stroke="var(--mantine-color-dimmed)"
86
+ strokeWidth={2}
87
+ strokeLinecap="round"
88
+ strokeLinejoin="round"
89
+ aria-hidden
90
+ >
91
+ <path d="M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9" />
92
+ <path d="M13.73 21a2 2 0 0 1-3.46 0" />
93
+ </svg>
94
+ </ActionIcon>
95
+ </Indicator>
96
+ </Popover.Target>
97
+
98
+ <Popover.Dropdown
99
+ p="md"
100
+ aria-label="Notification center"
101
+ onMouseEnter={scheduleOpen}
102
+ onMouseLeave={scheduleClose}
103
+ >
104
+ <NotificationCenter />
105
+ </Popover.Dropdown>
106
+ </Popover>
107
+ )
108
+ }
@@ -0,0 +1,245 @@
1
+ /**
2
+ * NotificationCenter — a two-view notification surface, not a flat toast log.
3
+ *
4
+ * - **Inbox** (default): items that need attention (errors, warnings, anything with an action) and
5
+ * are not yet dismissed. This is the working set — the things you still have to deal with.
6
+ * - **All**: the full persisted history, newest first.
7
+ *
8
+ * Each item can be marked read (on interaction), dismissed (leaves the Inbox, stays in history), or
9
+ * removed outright. Actionable items render a button resolved from the notifications registry, so a
10
+ * notification can navigate or open a modal even after a reload. Consumes useNotificationHistory.
11
+ *
12
+ * @example
13
+ * import { NotificationCenter } from 'basalt-ui/notifications'
14
+ * <NotificationCenter />
15
+ */
16
+ import { useState } from 'react'
17
+ import type { MouseEvent } from 'react'
18
+ import {
19
+ Box,
20
+ Button,
21
+ CloseButton,
22
+ Group,
23
+ ScrollArea,
24
+ SegmentedControl,
25
+ Stack,
26
+ Text,
27
+ } from '@mantine/core'
28
+ import { VX } from '../tokens'
29
+ import { resolveAction } from './define-notifications'
30
+ import { useNotificationHistory } from './store'
31
+ import type { NotificationHistoryItem, NotificationIntent } from './store'
32
+
33
+ // ── Relative time ─────────────────────────────────────────────────────────────
34
+
35
+ function relativeTime(createdAt: number): string {
36
+ const seconds = Math.floor((Date.now() - createdAt) / 1000)
37
+ if (seconds < 60) return 'just now'
38
+ const minutes = Math.floor(seconds / 60)
39
+ if (minutes < 60) return `${minutes}m ago`
40
+ const hours = Math.floor(minutes / 60)
41
+ if (hours < 24) return `${hours}h ago`
42
+ const days = Math.floor(hours / 24)
43
+ return `${days}d ago`
44
+ }
45
+
46
+ // ── Intent → Mantine color (drives the action Button's own `light`-variant tint) ──────────────
47
+
48
+ const INTENT_COLOR: Record<NotificationIntent, string> = {
49
+ success: 'green',
50
+ error: 'red',
51
+ warning: 'yellow',
52
+ info: 'blue',
53
+ }
54
+
55
+ // ── Intent → status token (docs/DESIGN-SPEC.md §5: "severity accents via status tokens") — the
56
+ // exact spec success/warning/danger hex, used for the item's left-border accent. `info` has no
57
+ // status tone, so it reads the neutral accent instead.
58
+ const INTENT_STATUS: Record<NotificationIntent, string> = {
59
+ success: VX.status.good,
60
+ error: VX.status.bad,
61
+ warning: VX.status.warn,
62
+ info: VX.accent,
63
+ }
64
+
65
+ type CenterView = 'inbox' | 'all'
66
+
67
+ // ── NotificationItem ──────────────────────────────────────────────────────────
68
+
69
+ function NotificationItem({
70
+ item,
71
+ view,
72
+ onMarkRead,
73
+ onDismiss,
74
+ onRemove,
75
+ }: {
76
+ item: NotificationHistoryItem
77
+ view: CenterView
78
+ onMarkRead: (id: string) => void
79
+ onDismiss: (id: string) => void
80
+ onRemove: (id: string) => void
81
+ }) {
82
+ const isUnread = item.readAt === undefined
83
+ const isDismissed = item.dismissedAt !== undefined
84
+ const color = INTENT_COLOR[item.intent]
85
+ const statusAccent = INTENT_STATUS[item.intent]
86
+ const resolved = item.action !== undefined ? resolveAction(item.action) : undefined
87
+
88
+ function handleAction(e: MouseEvent): void {
89
+ e.stopPropagation()
90
+ onMarkRead(item.id)
91
+ resolved?.run()
92
+ }
93
+
94
+ // In the Inbox, the close button archives (dismiss); in the full history it deletes (remove).
95
+ function handleClose(): void {
96
+ if (view === 'inbox') onDismiss(item.id)
97
+ else onRemove(item.id)
98
+ }
99
+
100
+ return (
101
+ <Box
102
+ px="xs"
103
+ py={6}
104
+ onClick={isUnread ? () => onMarkRead(item.id) : undefined}
105
+ style={{
106
+ cursor: isUnread ? 'pointer' : 'default',
107
+ borderInlineStart: `3px solid ${statusAccent}`,
108
+ borderRadius: 'var(--mantine-radius-sm)',
109
+ background: isUnread ? 'var(--mantine-color-default-hover)' : 'transparent',
110
+ opacity: isDismissed ? 0.55 : 1,
111
+ }}
112
+ >
113
+ <Group gap="xs" align="flex-start" wrap="nowrap">
114
+ <Stack gap={2} style={{ minWidth: 0, flex: 1 }}>
115
+ {item.title !== undefined && (
116
+ <Text size="sm" fw={isUnread ? 600 : 500} lh={1.2} truncate="end">
117
+ {item.title}
118
+ </Text>
119
+ )}
120
+ <Text
121
+ size="sm"
122
+ lh={1.3}
123
+ {...(item.title !== undefined && { c: 'dimmed' })}
124
+ style={{ wordBreak: 'break-word' }}
125
+ >
126
+ {item.message}
127
+ </Text>
128
+ <Group gap="xs" align="center" mt={2} wrap="nowrap">
129
+ <Text ff="monospace" c="var(--vx-faint)" style={{ fontSize: VX.text.micro }}>
130
+ {relativeTime(item.createdAt)}
131
+ </Text>
132
+ {resolved !== undefined && (
133
+ <Button variant="light" color={color} size="compact-xs" onClick={handleAction}>
134
+ {resolved.label}
135
+ </Button>
136
+ )}
137
+ </Group>
138
+ </Stack>
139
+ <CloseButton
140
+ size="sm"
141
+ onClick={handleClose}
142
+ aria-label={view === 'inbox' ? 'Dismiss notification' : 'Delete notification'}
143
+ title={view === 'inbox' ? 'Dismiss' : 'Delete'}
144
+ style={{ flexShrink: 0 }}
145
+ />
146
+ </Group>
147
+ </Box>
148
+ )
149
+ }
150
+
151
+ // ── NotificationCenter ────────────────────────────────────────────────────────
152
+
153
+ export type NotificationCenterProps = {
154
+ /** Maximum height of the scrollable list. Default: 320px. */
155
+ maxHeight?: number | string
156
+ }
157
+
158
+ /**
159
+ * Two-view notification center (Inbox / All) with per-item read, dismiss, and remove, plus
160
+ * registry-resolved action buttons. Designed to be mounted inside a Popover or Drawer (e.g.
161
+ * NotificationBell).
162
+ *
163
+ * @example
164
+ * import { NotificationCenter } from 'basalt-ui/notifications'
165
+ *
166
+ * <Popover>
167
+ * <Popover.Dropdown>
168
+ * <NotificationCenter />
169
+ * </Popover.Dropdown>
170
+ * </Popover>
171
+ */
172
+ export function NotificationCenter({ maxHeight = 320 }: NotificationCenterProps) {
173
+ const { items, inbox, unreadCount, markRead, markAllRead, dismiss, dismissAll, remove, clear } =
174
+ useNotificationHistory()
175
+ const [view, setView] = useState<CenterView>('inbox')
176
+
177
+ const list = view === 'inbox' ? inbox : items
178
+ const emptyLabel = view === 'inbox' ? "You're all caught up" : 'No notifications yet'
179
+
180
+ return (
181
+ <Stack gap="xs" style={{ width: 320 }}>
182
+ {/* Header: title + a single mark-all-read affordance (only when there's something unread) */}
183
+ <Group justify="space-between" align="center" wrap="nowrap">
184
+ <Text size="sm" fw={600}>
185
+ Notifications
186
+ </Text>
187
+ {unreadCount > 0 && (
188
+ <Button variant="subtle" size="compact-xs" onClick={markAllRead}>
189
+ Mark all read
190
+ </Button>
191
+ )}
192
+ </Group>
193
+
194
+ {/* View switch */}
195
+ <SegmentedControl
196
+ fullWidth
197
+ size="xs"
198
+ value={view}
199
+ onChange={(value) => setView(value as CenterView)}
200
+ data={[
201
+ { value: 'inbox', label: inbox.length > 0 ? `Inbox (${inbox.length})` : 'Inbox' },
202
+ { value: 'all', label: 'All' },
203
+ ]}
204
+ />
205
+
206
+ {/* List */}
207
+ {list.length === 0 ? (
208
+ <Text size="sm" c="dimmed" ta="center" py="lg">
209
+ {emptyLabel}
210
+ </Text>
211
+ ) : (
212
+ <ScrollArea.Autosize mah={maxHeight} type="hover">
213
+ <Stack gap={4} pr="xs">
214
+ {list.map((item) => (
215
+ <NotificationItem
216
+ key={item.id}
217
+ item={item}
218
+ view={view}
219
+ onMarkRead={markRead}
220
+ onDismiss={dismiss}
221
+ onRemove={remove}
222
+ />
223
+ ))}
224
+ </Stack>
225
+ </ScrollArea.Autosize>
226
+ )}
227
+
228
+ {/* Footer: bulk action scoped to the active view */}
229
+ {view === 'inbox' && inbox.length > 0 && (
230
+ <Group justify="flex-end">
231
+ <Button variant="subtle" size="compact-xs" color="gray" onClick={dismissAll}>
232
+ Dismiss all
233
+ </Button>
234
+ </Group>
235
+ )}
236
+ {view === 'all' && items.length > 0 && (
237
+ <Group justify="flex-end">
238
+ <Button variant="subtle" size="compact-xs" color="gray" onClick={clear}>
239
+ Clear all
240
+ </Button>
241
+ </Group>
242
+ )}
243
+ </Stack>
244
+ )
245
+ }
@@ -0,0 +1,162 @@
1
+ /**
2
+ * defineNotifications — const-generic factory for typed notification kind registries.
3
+ * Mirrors the defineSeries pattern from ./tokens (const-generic, identity passthrough).
4
+ *
5
+ * Consumer augments BasaltRegister.notifications with the spec map type, then uses the typed
6
+ * `emit` helper which resolves the registered kind at compile-time. An unknown kind is a tsc error.
7
+ *
8
+ * @example
9
+ * // notifications.ts (app-side)
10
+ * import { defineNotifications } from 'basalt-ui/notifications'
11
+ * export const NOTIFICATIONS = defineNotifications({
12
+ * 'upload:success': { intent: 'success', toMessage: (p: { name: string }) => `Uploaded ${p.name}` },
13
+ * 'upload:error': { intent: 'error', toMessage: (_: unknown) => 'Upload failed' },
14
+ * })
15
+ * declare module 'basalt-ui' {
16
+ * interface BasaltRegister { notifications: typeof NOTIFICATIONS }
17
+ * }
18
+ *
19
+ * // usage.ts
20
+ * import { emit } from 'basalt-ui/notifications'
21
+ * emit('upload:success', { name: 'photo.jpg' }) // ✓ typed
22
+ * emit('nonexistent', {}) // ✗ tsc error
23
+ */
24
+ import type { ReactNode } from 'react'
25
+ import type { Slot } from '../register'
26
+ import { notify } from './notify'
27
+ import type { NotifyOptions, NotificationIntent } from './notify'
28
+ import type { NotificationActionRef } from './store'
29
+
30
+ export type { NotificationIntent }
31
+
32
+ // ── NotificationAction ────────────────────────────────────────────────────────
33
+
34
+ /**
35
+ * The action a notification kind carries: a button label + a handler. The handler lives in the
36
+ * registry (code, app-scoped) — only a serializable `{ kind, payload }` ref is persisted — so an
37
+ * actionable notification keeps working after a reload. The handler can do anything (navigate, open
38
+ * a modal, retry a request); it receives the same payload that was passed to `emit`.
39
+ */
40
+ export type NotificationAction = {
41
+ label: string
42
+ run: (payload: unknown) => void
43
+ }
44
+
45
+ // ── NotificationSpecMap ───────────────────────────────────────────────────────
46
+
47
+ /** A single notification kind spec — intent + optional payload→message renderer + optional action. */
48
+ export type NotificationSpec = {
49
+ intent?: NotificationIntent
50
+ toMessage?: (payload: unknown) => ReactNode
51
+ action?: NotificationAction
52
+ }
53
+
54
+ /** The map of kind → spec that a consumer registers. */
55
+ export type NotificationSpecMap = Record<string, NotificationSpec>
56
+
57
+ // ── Slot extraction (mirror of SeriesKey pattern in register.ts) ──────────────
58
+
59
+ /** The consumer's registered notification spec map, or `{}` when un-augmented. */
60
+ type Notifications = Slot<'notifications', NotificationSpecMap>
61
+
62
+ /**
63
+ * The legal notification kind keys.
64
+ * Extract<…, string> drops symbol/number members that `keyof` always includes.
65
+ * Un-augmented: `never`. Augmented: the exact string literal union.
66
+ */
67
+ export type NotificationKind = Extract<keyof Notifications, string>
68
+
69
+ // ── defineNotification (singular) ────────────────────────────────────────────
70
+
71
+ /**
72
+ * Type a single notification spec without registering it.
73
+ * Identity passthrough — preserves the exact literal shape for local type-checking.
74
+ *
75
+ * **WARNING:** this does NOT register the spec in the runtime registry and does NOT
76
+ * augment BasaltRegister. Use `defineNotifications` (plural) to register a full spec
77
+ * map and enable `emit()`. Use this only when you need to type an isolated spec constant
78
+ * before merging it into a larger map.
79
+ *
80
+ * @example
81
+ * const uploadSuccess = defineNotification({
82
+ * intent: 'success',
83
+ * toMessage: (p: { name: string }) => `Uploaded ${p.name}`,
84
+ * })
85
+ * // Merge into the full registry before passing to defineNotifications:
86
+ * const NOTIFICATIONS = defineNotifications({ 'upload:success': uploadSuccess })
87
+ */
88
+ export function defineNotification<const T extends NotificationSpec>(spec: T): T {
89
+ return spec
90
+ }
91
+
92
+ // ── defineNotifications ───────────────────────────────────────────────────────
93
+
94
+ /**
95
+ * Define a typed notification spec map. Const-generic identity passthrough — preserves the exact
96
+ * literal keys so `emit('nonexistent-kind', …)` is a tsc error after augmenting BasaltRegister.
97
+ *
98
+ * @example
99
+ * const NOTIFICATIONS = defineNotifications({
100
+ * 'save:success': { intent: 'success', toMessage: () => 'Changes saved' },
101
+ * 'save:error': { intent: 'error', toMessage: () => 'Failed to save' },
102
+ * })
103
+ */
104
+ /**
105
+ * Module-level runtime registry. The BasaltRegister type-slot gives the compile-time kind union,
106
+ * but the augmentation is erased at runtime — so defineNotifications also stashes the runtime spec
107
+ * map here for emit() to resolve intent/toMessage. Call defineNotifications once (the app's single
108
+ * notifications registry); the last call wins.
109
+ */
110
+ let activeRegistry: NotificationSpecMap = {}
111
+
112
+ export function defineNotifications<const T extends NotificationSpecMap>(spec: T): T {
113
+ activeRegistry = spec
114
+ return spec
115
+ }
116
+
117
+ // ── emit ──────────────────────────────────────────────────────────────────────
118
+
119
+ /**
120
+ * Emit a registered notification kind. The kind must be a key of the consumer's registered
121
+ * `BasaltRegister.notifications` map — any other string is a tsc error.
122
+ *
123
+ * Resolves the spec's intent + toMessage, then calls notify(). Extra opts override spec defaults.
124
+ *
125
+ * Un-augmented (Notifications = {}): NotificationKind = never → `emit` is effectively uncallable.
126
+ * Augmented: only the registered keys are accepted.
127
+ *
128
+ * @example
129
+ * emit('upload:success', { name: 'photo.jpg' })
130
+ * emit('upload:error', null, { title: 'Storage full' })
131
+ */
132
+ export function emit(
133
+ kind: NotificationKind,
134
+ payload?: unknown,
135
+ opts?: Omit<NotifyOptions, 'intent' | 'message'>,
136
+ ): string {
137
+ // The kind's compile-time validity comes from the BasaltRegister slot; the runtime spec
138
+ // (intent/toMessage/action) comes from the registry stashed by defineNotifications.
139
+ const spec: NotificationSpec | undefined = activeRegistry[kind]
140
+ const intent = spec?.intent ?? 'info'
141
+ const message = spec?.toMessage !== undefined ? spec.toMessage(payload) : kind
142
+ // When the kind defines an action, persist a serializable ref so the center can resolve it later.
143
+ const action: NotificationActionRef | undefined =
144
+ spec?.action !== undefined ? { kind, payload } : undefined
145
+
146
+ return notify({ ...opts, intent, message, ...(action !== undefined && { action }) })
147
+ }
148
+
149
+ // ── resolveAction ───────────────────────────────────────────────────────────
150
+
151
+ /**
152
+ * Resolve a persisted action ref against the active registry — returns the button label and a
153
+ * bound handler, or undefined if the kind is unregistered (e.g. the registry changed since the
154
+ * item was stored). Used by the notification center to render an item's action.
155
+ */
156
+ export function resolveAction(
157
+ ref: NotificationActionRef,
158
+ ): { label: string; run: () => void } | undefined {
159
+ const action = activeRegistry[ref.kind]?.action
160
+ if (action === undefined) return undefined
161
+ return { label: action.label, run: () => action.run(ref.payload) }
162
+ }