basalt-ui 0.3.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (684) hide show
  1. package/AGENTS.md +70 -0
  2. package/CHANGELOG.md +216 -26
  3. package/LICENSE +201 -0
  4. package/README.md +434 -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/templates/CLAUDE-block.md.tpl +35 -0
  18. package/agent/templates/DESIGN.md.tpl +71 -0
  19. package/agent/templates/__root.tpl +31 -0
  20. package/agent/templates/query-client.ts.tpl +12 -0
  21. package/bin/basalt.mjs +14 -0
  22. package/configs/check.yml +29 -0
  23. package/configs/lefthook.yml +21 -0
  24. package/configs/oxfmt.json +8 -0
  25. package/configs/oxlint-plugin.js +269 -0
  26. package/configs/oxlint-plugin.test.ts +107 -0
  27. package/configs/oxlint.json +116 -0
  28. package/configs/tsconfig.base.json +20 -0
  29. package/configs/tsconfig.node.json +8 -0
  30. package/configs/tsconfig.react-app.json +8 -0
  31. package/dist/agent/ai-sdk-transport.d.ts +85 -0
  32. package/dist/agent/ai-sdk-transport.d.ts.map +1 -0
  33. package/dist/agent/ai-sdk-transport.js +109 -0
  34. package/dist/agent/history.d.ts +55 -0
  35. package/dist/agent/history.d.ts.map +1 -0
  36. package/dist/agent/history.js +32 -0
  37. package/dist/agent/index.d.ts +53 -0
  38. package/dist/agent/index.d.ts.map +1 -0
  39. package/dist/agent/index.js +23 -0
  40. package/dist/agent/outcome.d.ts +71 -0
  41. package/dist/agent/outcome.d.ts.map +1 -0
  42. package/dist/agent/outcome.js +30 -0
  43. package/dist/agent/part-list.d.ts +75 -0
  44. package/dist/agent/part-list.d.ts.map +1 -0
  45. package/dist/agent/part-list.js +127 -0
  46. package/dist/agent/parts.d.ts +91 -0
  47. package/dist/agent/parts.d.ts.map +1 -0
  48. package/dist/agent/parts.js +49 -0
  49. package/dist/agent/stick-to-bottom.d.ts +23 -0
  50. package/dist/agent/stick-to-bottom.d.ts.map +1 -0
  51. package/dist/agent/stick-to-bottom.js +73 -0
  52. package/dist/agent/thread.d.ts +124 -0
  53. package/dist/agent/thread.d.ts.map +1 -0
  54. package/dist/agent/thread.js +131 -0
  55. package/dist/agent/transport.d.ts +87 -0
  56. package/dist/agent/transport.d.ts.map +1 -0
  57. package/dist/agent/transport.js +21 -0
  58. package/dist/agent/use-agent-stream.d.ts +34 -0
  59. package/dist/agent/use-agent-stream.d.ts.map +1 -0
  60. package/dist/agent/use-agent-stream.js +56 -0
  61. package/dist/agent/use-agent-thread-runs.d.ts +72 -0
  62. package/dist/agent/use-agent-thread-runs.d.ts.map +1 -0
  63. package/dist/agent/use-agent-thread-runs.js +217 -0
  64. package/dist/agent-chat/composer.d.ts +18 -0
  65. package/dist/agent-chat/composer.d.ts.map +1 -0
  66. package/dist/agent-chat/composer.js +86 -0
  67. package/dist/agent-chat/index.d.ts +24 -0
  68. package/dist/agent-chat/index.d.ts.map +1 -0
  69. package/dist/agent-chat/index.js +15 -0
  70. package/dist/agent-chat/thread-detail-panel.d.ts +27 -0
  71. package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -0
  72. package/dist/agent-chat/thread-detail-panel.js +108 -0
  73. package/dist/agent-chat/thread-feed.d.ts +18 -0
  74. package/dist/agent-chat/thread-feed.d.ts.map +1 -0
  75. package/dist/agent-chat/thread-feed.js +42 -0
  76. package/dist/agent-chat/thread-message.d.ts +31 -0
  77. package/dist/agent-chat/thread-message.d.ts.map +1 -0
  78. package/dist/agent-chat/thread-message.js +128 -0
  79. package/dist/agent-chat/thread-outcome-card.d.ts +19 -0
  80. package/dist/agent-chat/thread-outcome-card.d.ts.map +1 -0
  81. package/dist/agent-chat/thread-outcome-card.js +120 -0
  82. package/dist/agent-chat/thread-workspace.d.ts +27 -0
  83. package/dist/agent-chat/thread-workspace.d.ts.map +1 -0
  84. package/dist/agent-chat/thread-workspace.js +95 -0
  85. package/dist/charts/hooks/useChartSize.d.ts +25 -0
  86. package/dist/charts/hooks/useChartSize.d.ts.map +1 -0
  87. package/dist/charts/hooks/useChartSize.js +8 -0
  88. package/dist/charts/hooks/useChartTooltip.d.ts +13 -0
  89. package/dist/charts/hooks/useChartTooltip.d.ts.map +1 -0
  90. package/dist/charts/hooks/useChartTooltip.js +26 -0
  91. package/dist/charts/hooks/useHoverSync.d.ts +30 -0
  92. package/dist/charts/hooks/useHoverSync.d.ts.map +1 -0
  93. package/dist/charts/hooks/useHoverSync.js +70 -0
  94. package/dist/charts/hover-context.d.ts +21 -0
  95. package/dist/charts/hover-context.d.ts.map +1 -0
  96. package/dist/charts/hover-context.js +12 -0
  97. package/dist/charts/hover-sync.d.ts +14 -0
  98. package/dist/charts/hover-sync.d.ts.map +1 -0
  99. package/dist/charts/hover-sync.js +17 -0
  100. package/dist/charts/index.d.ts +47 -0
  101. package/dist/charts/index.d.ts.map +1 -0
  102. package/dist/charts/index.js +129 -0
  103. package/dist/charts/kinds/Bars.d.ts +129 -0
  104. package/dist/charts/kinds/Bars.d.ts.map +1 -0
  105. package/dist/charts/kinds/Bars.js +467 -0
  106. package/dist/charts/kinds/Donut.d.ts +65 -0
  107. package/dist/charts/kinds/Donut.d.ts.map +1 -0
  108. package/dist/charts/kinds/Donut.js +158 -0
  109. package/dist/charts/kinds/DualPanel.d.ts +67 -0
  110. package/dist/charts/kinds/DualPanel.d.ts.map +1 -0
  111. package/dist/charts/kinds/DualPanel.js +326 -0
  112. package/dist/charts/kinds/Heatmap.d.ts +59 -0
  113. package/dist/charts/kinds/Heatmap.d.ts.map +1 -0
  114. package/dist/charts/kinds/Heatmap.js +175 -0
  115. package/dist/charts/kinds/MultiLine.d.ts +73 -0
  116. package/dist/charts/kinds/MultiLine.d.ts.map +1 -0
  117. package/dist/charts/kinds/MultiLine.js +275 -0
  118. package/dist/charts/kinds/StackedArea.d.ts +35 -0
  119. package/dist/charts/kinds/StackedArea.d.ts.map +1 -0
  120. package/dist/charts/kinds/StackedArea.js +151 -0
  121. package/dist/charts/kinds/ZonedLine.d.ts +94 -0
  122. package/dist/charts/kinds/ZonedLine.d.ts.map +1 -0
  123. package/dist/charts/kinds/ZonedLine.js +218 -0
  124. package/dist/charts/primitives/AreaGradient.d.ts +18 -0
  125. package/dist/charts/primitives/AreaGradient.d.ts.map +1 -0
  126. package/dist/charts/primitives/AreaGradient.js +13 -0
  127. package/dist/charts/primitives/Axes.d.ts +22 -0
  128. package/dist/charts/primitives/Axes.d.ts.map +1 -0
  129. package/dist/charts/primitives/Axes.js +79 -0
  130. package/dist/charts/primitives/ChartCard.d.ts +14 -0
  131. package/dist/charts/primitives/ChartCard.d.ts.map +1 -0
  132. package/dist/charts/primitives/ChartCard.js +144 -0
  133. package/dist/charts/primitives/ChartFrame.d.ts +70 -0
  134. package/dist/charts/primitives/ChartFrame.d.ts.map +1 -0
  135. package/dist/charts/primitives/ChartFrame.js +77 -0
  136. package/dist/charts/primitives/ChartLegend.d.ts +36 -0
  137. package/dist/charts/primitives/ChartLegend.d.ts.map +1 -0
  138. package/dist/charts/primitives/ChartLegend.js +234 -0
  139. package/dist/charts/primitives/ChartTooltip.d.ts +34 -0
  140. package/dist/charts/primitives/ChartTooltip.d.ts.map +1 -0
  141. package/dist/charts/primitives/ChartTooltip.js +134 -0
  142. package/dist/charts/primitives/Crosshair.d.ts +23 -0
  143. package/dist/charts/primitives/Crosshair.d.ts.map +1 -0
  144. package/dist/charts/primitives/Crosshair.js +21 -0
  145. package/dist/charts/primitives/HoverOverlay.d.ts +9 -0
  146. package/dist/charts/primitives/HoverOverlay.d.ts.map +1 -0
  147. package/dist/charts/primitives/HoverOverlay.js +21 -0
  148. package/dist/charts/primitives/ResponsiveChart.d.ts +45 -0
  149. package/dist/charts/primitives/ResponsiveChart.d.ts.map +1 -0
  150. package/dist/charts/primitives/ResponsiveChart.js +24 -0
  151. package/dist/charts/primitives/ZoneRects.d.ts +38 -0
  152. package/dist/charts/primitives/ZoneRects.d.ts.map +1 -0
  153. package/dist/charts/primitives/ZoneRects.js +30 -0
  154. package/dist/charts/series.d.ts +99 -0
  155. package/dist/charts/series.d.ts.map +1 -0
  156. package/dist/charts/series.js +55 -0
  157. package/dist/charts/sparklines/BarSparkline.d.ts +13 -0
  158. package/dist/charts/sparklines/BarSparkline.d.ts.map +1 -0
  159. package/dist/charts/sparklines/BarSparkline.js +33 -0
  160. package/dist/charts/sparklines/LineSparkline.d.ts +15 -0
  161. package/dist/charts/sparklines/LineSparkline.d.ts.map +1 -0
  162. package/dist/charts/sparklines/LineSparkline.js +39 -0
  163. package/dist/charts/sparklines/index.d.ts +3 -0
  164. package/dist/charts/sparklines/index.d.ts.map +1 -0
  165. package/dist/charts/sparklines/index.js +6 -0
  166. package/dist/charts/theme.d.ts +21 -0
  167. package/dist/charts/theme.d.ts.map +1 -0
  168. package/dist/charts/theme.js +30 -0
  169. package/dist/charts/utils/domain.d.ts +20 -0
  170. package/dist/charts/utils/domain.d.ts.map +1 -0
  171. package/dist/charts/utils/domain.js +7 -0
  172. package/dist/charts/utils/format.d.ts +5 -0
  173. package/dist/charts/utils/format.d.ts.map +1 -0
  174. package/dist/charts/utils/format.js +27 -0
  175. package/dist/charts/utils/ticks.d.ts +5 -0
  176. package/dist/charts/utils/ticks.d.ts.map +1 -0
  177. package/dist/charts/utils/ticks.js +18 -0
  178. package/dist/cli/index.d.ts +273 -0
  179. package/dist/cli/index.d.ts.map +1 -0
  180. package/dist/cli/index.js +907 -0
  181. package/dist/commands/ShortcutsHelp.d.ts +17 -0
  182. package/dist/commands/ShortcutsHelp.d.ts.map +1 -0
  183. package/dist/commands/ShortcutsHelp.js +64 -0
  184. package/dist/commands/define-commands.d.ts +140 -0
  185. package/dist/commands/define-commands.d.ts.map +1 -0
  186. package/dist/commands/define-commands.js +26 -0
  187. package/dist/commands/define-overlays.d.ts +134 -0
  188. package/dist/commands/define-overlays.d.ts.map +1 -0
  189. package/dist/commands/define-overlays.js +53 -0
  190. package/dist/commands/index.d.ts +42 -0
  191. package/dist/commands/index.d.ts.map +1 -0
  192. package/dist/commands/index.js +46 -0
  193. package/dist/commands/overlays-mount.d.ts +117 -0
  194. package/dist/commands/overlays-mount.d.ts.map +1 -0
  195. package/dist/commands/overlays-mount.js +116 -0
  196. package/dist/commands/projectors.d.ts +152 -0
  197. package/dist/commands/projectors.d.ts.map +1 -0
  198. package/dist/commands/projectors.js +87 -0
  199. package/dist/commands/shortcut-format.d.ts +48 -0
  200. package/dist/commands/shortcut-format.d.ts.map +1 -0
  201. package/dist/commands/shortcut-format.js +33 -0
  202. package/dist/commands/useCommandHotkeys.d.ts +14 -0
  203. package/dist/commands/useCommandHotkeys.d.ts.map +1 -0
  204. package/dist/commands/useCommandHotkeys.js +45 -0
  205. package/dist/connectivity/connectivity-indicator.d.ts +8 -0
  206. package/dist/connectivity/connectivity-indicator.d.ts.map +1 -0
  207. package/dist/connectivity/connectivity-indicator.js +203 -0
  208. package/dist/connectivity/connectivity-provider.d.ts +7 -0
  209. package/dist/connectivity/connectivity-provider.d.ts.map +1 -0
  210. package/dist/connectivity/connectivity-provider.js +125 -0
  211. package/dist/connectivity/index.d.ts +13 -0
  212. package/dist/connectivity/index.d.ts.map +1 -0
  213. package/dist/connectivity/index.js +8 -0
  214. package/dist/connectivity/types.d.ts +36 -0
  215. package/dist/connectivity/types.d.ts.map +1 -0
  216. package/dist/connectivity/types.js +0 -0
  217. package/dist/connectivity/use-connectivity.d.ts +3 -0
  218. package/dist/connectivity/use-connectivity.d.ts.map +1 -0
  219. package/dist/connectivity/use-connectivity.js +14 -0
  220. package/dist/content/article-actions.d.ts +39 -0
  221. package/dist/content/article-actions.d.ts.map +1 -0
  222. package/dist/content/article-actions.js +28 -0
  223. package/dist/content/article-card.d.ts +58 -0
  224. package/dist/content/article-card.d.ts.map +1 -0
  225. package/dist/content/article-card.js +76 -0
  226. package/dist/content/article-card.module.css +109 -0
  227. package/dist/content/article-card.module.css.d.ts +16 -0
  228. package/dist/content/article-filter-bar.d.ts +40 -0
  229. package/dist/content/article-filter-bar.d.ts.map +1 -0
  230. package/dist/content/article-filter-bar.js +56 -0
  231. package/dist/content/article-layout.d.ts +61 -0
  232. package/dist/content/article-layout.d.ts.map +1 -0
  233. package/dist/content/article-layout.js +71 -0
  234. package/dist/content/article-layout.module.css +131 -0
  235. package/dist/content/article-layout.module.css.d.ts +20 -0
  236. package/dist/content/article-model.d.ts +62 -0
  237. package/dist/content/article-model.d.ts.map +1 -0
  238. package/dist/content/article-model.js +41 -0
  239. package/dist/content/block-split.d.ts +24 -0
  240. package/dist/content/block-split.d.ts.map +1 -0
  241. package/dist/content/block-split.js +63 -0
  242. package/dist/content/callout-alert.d.ts +27 -0
  243. package/dist/content/callout-alert.d.ts.map +1 -0
  244. package/dist/content/callout-alert.js +59 -0
  245. package/dist/content/callout.d.ts +24 -0
  246. package/dist/content/callout.d.ts.map +1 -0
  247. package/dist/content/callout.js +59 -0
  248. package/dist/content/callout.module.css +77 -0
  249. package/dist/content/callout.module.css.d.ts +16 -0
  250. package/dist/content/code-block.d.ts +26 -0
  251. package/dist/content/code-block.d.ts.map +1 -0
  252. package/dist/content/code-block.js +41 -0
  253. package/dist/content/code-block.module.css +86 -0
  254. package/dist/content/code-block.module.css.d.ts +14 -0
  255. package/dist/content/copy-action.d.ts +29 -0
  256. package/dist/content/copy-action.d.ts.map +1 -0
  257. package/dist/content/copy-action.js +46 -0
  258. package/dist/content/fence-block.d.ts +19 -0
  259. package/dist/content/fence-block.d.ts.map +1 -0
  260. package/dist/content/fence-block.js +23 -0
  261. package/dist/content/glyphs.d.ts +18 -0
  262. package/dist/content/glyphs.d.ts.map +1 -0
  263. package/dist/content/glyphs.js +43 -0
  264. package/dist/content/guide.d.ts +47 -0
  265. package/dist/content/guide.d.ts.map +1 -0
  266. package/dist/content/guide.js +110 -0
  267. package/dist/content/guide.module.css +62 -0
  268. package/dist/content/guide.module.css.d.ts +13 -0
  269. package/dist/content/heading-anchor.d.ts +8 -0
  270. package/dist/content/heading-anchor.d.ts.map +1 -0
  271. package/dist/content/heading-anchor.js +23 -0
  272. package/dist/content/heading-components.d.ts +5 -0
  273. package/dist/content/heading-components.d.ts.map +1 -0
  274. package/dist/content/heading-components.js +41 -0
  275. package/dist/content/highlighter.d.ts +8 -0
  276. package/dist/content/highlighter.d.ts.map +1 -0
  277. package/dist/content/highlighter.js +85 -0
  278. package/dist/content/index.d.ts +45 -0
  279. package/dist/content/index.d.ts.map +1 -0
  280. package/dist/content/index.js +43 -0
  281. package/dist/content/markdown-hast.d.ts +23 -0
  282. package/dist/content/markdown-hast.d.ts.map +1 -0
  283. package/dist/content/markdown-hast.js +48 -0
  284. package/dist/content/markdown.d.ts +68 -0
  285. package/dist/content/markdown.d.ts.map +1 -0
  286. package/dist/content/markdown.js +180 -0
  287. package/dist/content/mdx.d.ts +20 -0
  288. package/dist/content/mdx.d.ts.map +1 -0
  289. package/dist/content/mdx.js +64 -0
  290. package/dist/content/mermaid.d.ts +32 -0
  291. package/dist/content/mermaid.d.ts.map +1 -0
  292. package/dist/content/mermaid.js +70 -0
  293. package/dist/content/mermaid.module.css +20 -0
  294. package/dist/content/mermaid.module.css.d.ts +8 -0
  295. package/dist/content/prose.d.ts +29 -0
  296. package/dist/content/prose.d.ts.map +1 -0
  297. package/dist/content/prose.js +24 -0
  298. package/dist/content/prose.module.css +330 -0
  299. package/dist/content/prose.module.css.d.ts +12 -0
  300. package/dist/content/reading-progress.d.ts +20 -0
  301. package/dist/content/reading-progress.d.ts.map +1 -0
  302. package/dist/content/reading-progress.js +38 -0
  303. package/dist/content/reading-progress.module.css +22 -0
  304. package/dist/content/reading-progress.module.css.d.ts +9 -0
  305. package/dist/content/slug.d.ts +28 -0
  306. package/dist/content/slug.d.ts.map +1 -0
  307. package/dist/content/slug.js +28 -0
  308. package/dist/content/toc.d.ts +37 -0
  309. package/dist/content/toc.d.ts.map +1 -0
  310. package/dist/content/toc.js +134 -0
  311. package/dist/content/toc.module.css +51 -0
  312. package/dist/content/toc.module.css.d.ts +13 -0
  313. package/dist/content/url-hardening.d.ts +23 -0
  314. package/dist/content/url-hardening.d.ts.map +1 -0
  315. package/dist/content/url-hardening.js +23 -0
  316. package/dist/dashboard/delta-badge.d.ts +13 -0
  317. package/dist/dashboard/delta-badge.d.ts.map +1 -0
  318. package/dist/dashboard/delta-badge.js +45 -0
  319. package/dist/dashboard/empty-state.d.ts +15 -0
  320. package/dist/dashboard/empty-state.d.ts.map +1 -0
  321. package/dist/dashboard/empty-state.js +56 -0
  322. package/dist/dashboard/index.d.ts +5 -0
  323. package/dist/dashboard/index.d.ts.map +1 -0
  324. package/dist/dashboard/index.js +16 -0
  325. package/dist/dashboard/settings-section.d.ts +24 -0
  326. package/dist/dashboard/settings-section.d.ts.map +1 -0
  327. package/dist/dashboard/settings-section.js +61 -0
  328. package/dist/dashboard/settings-section.module.css +23 -0
  329. package/dist/dashboard/settings-section.module.css.d.ts +10 -0
  330. package/dist/dashboard/stat-card.d.ts +18 -0
  331. package/dist/dashboard/stat-card.d.ts.map +1 -0
  332. package/dist/dashboard/stat-card.js +74 -0
  333. package/dist/data/data-table.d.ts +198 -0
  334. package/dist/data/data-table.d.ts.map +1 -0
  335. package/dist/data/data-table.js +342 -0
  336. package/dist/data/index.d.ts +34 -0
  337. package/dist/data/index.d.ts.map +1 -0
  338. package/dist/data/index.js +2 -0
  339. package/dist/data/table.d.ts +24 -0
  340. package/dist/data/table.d.ts.map +1 -0
  341. package/dist/data/table.js +20 -0
  342. package/dist/data/virtual-list.d.ts +74 -0
  343. package/dist/data/virtual-list.d.ts.map +1 -0
  344. package/dist/data/virtual-list.js +86 -0
  345. package/dist/data/virtual.d.ts +20 -0
  346. package/dist/data/virtual.d.ts.map +1 -0
  347. package/dist/data/virtual.js +4 -0
  348. package/dist/forms/FormErrorSummary.d.ts +29 -0
  349. package/dist/forms/FormErrorSummary.d.ts.map +1 -0
  350. package/dist/forms/FormErrorSummary.js +28 -0
  351. package/dist/forms/create-form.d.ts +31 -0
  352. package/dist/forms/create-form.d.ts.map +1 -0
  353. package/dist/forms/create-form.js +18 -0
  354. package/dist/forms/field.d.ts +22 -0
  355. package/dist/forms/field.d.ts.map +1 -0
  356. package/dist/forms/field.js +9 -0
  357. package/dist/forms/index.d.ts +17 -0
  358. package/dist/forms/index.d.ts.map +1 -0
  359. package/dist/forms/index.js +13 -0
  360. package/dist/forms/use-form-draft.d.ts +61 -0
  361. package/dist/forms/use-form-draft.d.ts.map +1 -0
  362. package/dist/forms/use-form-draft.js +55 -0
  363. package/dist/guard/guard-hook.d.ts +40 -0
  364. package/dist/guard/guard-hook.d.ts.map +1 -0
  365. package/dist/guard/guard-hook.js +55 -0
  366. package/dist/guard/index.d.ts +144 -0
  367. package/dist/guard/index.d.ts.map +1 -0
  368. package/dist/guard/index.js +315 -0
  369. package/dist/guard/types.d.ts +97 -0
  370. package/dist/guard/types.d.ts.map +1 -0
  371. package/dist/guard/types.js +0 -0
  372. package/dist/index.d.ts +24 -0
  373. package/dist/index.d.ts.map +1 -0
  374. package/dist/index.js +90 -0
  375. package/dist/motion/index.d.ts +29 -0
  376. package/dist/motion/index.d.ts.map +1 -0
  377. package/dist/motion/index.js +12 -0
  378. package/dist/notifications/bell.d.ts +12 -0
  379. package/dist/notifications/bell.d.ts.map +1 -0
  380. package/dist/notifications/bell.js +84 -0
  381. package/dist/notifications/center.d.ts +20 -0
  382. package/dist/notifications/center.d.ts.map +1 -0
  383. package/dist/notifications/center.js +144 -0
  384. package/dist/notifications/define-notifications.d.ts +97 -0
  385. package/dist/notifications/define-notifications.d.ts.map +1 -0
  386. package/dist/notifications/define-notifications.js +27 -0
  387. package/dist/notifications/index.d.ts +36 -0
  388. package/dist/notifications/index.d.ts.map +1 -0
  389. package/dist/notifications/index.js +52 -0
  390. package/dist/notifications/notify.d.ts +92 -0
  391. package/dist/notifications/notify.d.ts.map +1 -0
  392. package/dist/notifications/notify.js +127 -0
  393. package/dist/notifications/overlay.d.ts +20 -0
  394. package/dist/notifications/overlay.d.ts.map +1 -0
  395. package/dist/notifications/overlay.js +12 -0
  396. package/dist/notifications/store.d.ts +120 -0
  397. package/dist/notifications/store.d.ts.map +1 -0
  398. package/dist/notifications/store.js +113 -0
  399. package/dist/provider/index.d.ts +93 -0
  400. package/dist/provider/index.d.ts.map +1 -0
  401. package/dist/provider/index.js +106 -0
  402. package/dist/query/devtools.d.ts +21 -0
  403. package/dist/query/devtools.d.ts.map +1 -0
  404. package/dist/query/devtools.js +12 -0
  405. package/dist/query/index.d.ts +65 -0
  406. package/dist/query/index.d.ts.map +1 -0
  407. package/dist/query/index.js +68 -0
  408. package/dist/register.d.ts +139 -0
  409. package/dist/register.d.ts.map +1 -0
  410. package/dist/register.js +6 -0
  411. package/dist/router-tanstack/index.d.ts +74 -0
  412. package/dist/router-tanstack/index.d.ts.map +1 -0
  413. package/dist/router-tanstack/index.js +29 -0
  414. package/dist/router-tanstack/multi-search-param-store.d.ts +78 -0
  415. package/dist/router-tanstack/multi-search-param-store.d.ts.map +1 -0
  416. package/dist/router-tanstack/multi-search-param-store.js +35 -0
  417. package/dist/router-tanstack/search-param-store.d.ts +92 -0
  418. package/dist/router-tanstack/search-param-store.d.ts.map +1 -0
  419. package/dist/router-tanstack/search-param-store.js +26 -0
  420. package/dist/shell/account-types.d.ts +118 -0
  421. package/dist/shell/account-types.d.ts.map +1 -0
  422. package/dist/shell/account-types.js +0 -0
  423. package/dist/shell/app-breadcrumbs.d.ts +17 -0
  424. package/dist/shell/app-breadcrumbs.d.ts.map +1 -0
  425. package/dist/shell/app-breadcrumbs.js +39 -0
  426. package/dist/shell/app-header.module.css +73 -0
  427. package/dist/shell/app-header.module.css.d.ts +11 -0
  428. package/dist/shell/app-mobile-nav.d.ts +26 -0
  429. package/dist/shell/app-mobile-nav.d.ts.map +1 -0
  430. package/dist/shell/app-mobile-nav.js +106 -0
  431. package/dist/shell/app-mobile-nav.module.css +100 -0
  432. package/dist/shell/app-mobile-nav.module.css.d.ts +14 -0
  433. package/dist/shell/app-sidebar-account.d.ts +3 -0
  434. package/dist/shell/app-sidebar-account.d.ts.map +1 -0
  435. package/dist/shell/app-sidebar-account.js +84 -0
  436. package/dist/shell/app-sidebar.d.ts +56 -0
  437. package/dist/shell/app-sidebar.d.ts.map +1 -0
  438. package/dist/shell/app-sidebar.js +455 -0
  439. package/dist/shell/app-sidebar.module.css +414 -0
  440. package/dist/shell/app-sidebar.module.css.d.ts +34 -0
  441. package/dist/shell/index.d.ts +123 -0
  442. package/dist/shell/index.d.ts.map +1 -0
  443. package/dist/shell/index.js +179 -0
  444. package/dist/shell/page-header.d.ts +13 -0
  445. package/dist/shell/page-header.d.ts.map +1 -0
  446. package/dist/shell/page-header.js +23 -0
  447. package/dist/shell/sidebar-search.d.ts +12 -0
  448. package/dist/shell/sidebar-search.d.ts.map +1 -0
  449. package/dist/shell/sidebar-search.js +62 -0
  450. package/dist/shell/sidebar-search.module.css +62 -0
  451. package/dist/shell/sidebar-search.module.css.d.ts +11 -0
  452. package/dist/state.d.ts +62 -0
  453. package/dist/state.d.ts.map +1 -0
  454. package/dist/state.js +124 -0
  455. package/dist/styles.css +166 -0
  456. package/dist/surfaces.d.ts +376 -0
  457. package/dist/surfaces.d.ts.map +1 -0
  458. package/dist/surfaces.js +306 -0
  459. package/dist/theme/controls.module.css +143 -0
  460. package/dist/theme/controls.module.css.d.ts +17 -0
  461. package/dist/theme/floating.module.css +35 -0
  462. package/dist/theme/floating.module.css.d.ts +9 -0
  463. package/dist/theme/index.d.ts +22 -0
  464. package/dist/theme/index.d.ts.map +1 -0
  465. package/dist/theme/index.js +733 -0
  466. package/dist/theme/nav-link.module.css +67 -0
  467. package/dist/theme/nav-link.module.css.d.ts +8 -0
  468. package/dist/theme/segmented-control.module.css +14 -0
  469. package/dist/theme/segmented-control.module.css.d.ts +8 -0
  470. package/dist/theme/timeline.module.css +29 -0
  471. package/dist/theme/timeline.module.css.d.ts +9 -0
  472. package/dist/theme-lab/index.d.ts +59 -0
  473. package/dist/theme-lab/index.d.ts.map +1 -0
  474. package/dist/theme-lab/index.js +263 -0
  475. package/dist/theme-toggle/index.d.ts +8 -0
  476. package/dist/theme-toggle/index.d.ts.map +1 -0
  477. package/dist/theme-toggle/index.js +155 -0
  478. package/dist/tokens/index.d.ts +151 -0
  479. package/dist/tokens/index.d.ts.map +1 -0
  480. package/dist/tokens/index.js +246 -0
  481. package/dist/tokens/palette.d.ts +304 -0
  482. package/dist/tokens/palette.d.ts.map +1 -0
  483. package/dist/tokens/palette.js +186 -0
  484. package/dist/vite.d.ts +30 -0
  485. package/dist/vite.d.ts.map +1 -0
  486. package/dist/vite.js +68 -0
  487. package/llms.txt +149 -0
  488. package/package.json +246 -37
  489. package/src/agent/ai-sdk-transport.ts +280 -0
  490. package/src/agent/history.ts +128 -0
  491. package/src/agent/index.ts +92 -0
  492. package/src/agent/outcome.ts +120 -0
  493. package/src/agent/part-list.tsx +292 -0
  494. package/src/agent/parts.ts +136 -0
  495. package/src/agent/stick-to-bottom.tsx +154 -0
  496. package/src/agent/thread.ts +312 -0
  497. package/src/agent/transport.ts +114 -0
  498. package/src/agent/use-agent-stream.ts +141 -0
  499. package/src/agent/use-agent-thread-runs.ts +440 -0
  500. package/src/agent-chat/composer.tsx +131 -0
  501. package/src/agent-chat/index.ts +35 -0
  502. package/src/agent-chat/thread-detail-panel.tsx +192 -0
  503. package/src/agent-chat/thread-feed.tsx +81 -0
  504. package/src/agent-chat/thread-message.tsx +251 -0
  505. package/src/agent-chat/thread-outcome-card.tsx +196 -0
  506. package/src/agent-chat/thread-workspace.tsx +179 -0
  507. package/src/charts/hooks/useChartSize.ts +31 -0
  508. package/src/charts/hooks/useChartTooltip.ts +31 -0
  509. package/src/charts/hooks/useHoverSync.ts +116 -0
  510. package/src/charts/hover-context.ts +28 -0
  511. package/src/charts/hover-sync.tsx +37 -0
  512. package/src/charts/index.ts +118 -0
  513. package/src/charts/kinds/Bars.tsx +634 -0
  514. package/src/charts/kinds/Donut.tsx +233 -0
  515. package/src/charts/kinds/DualPanel.tsx +432 -0
  516. package/src/charts/kinds/Heatmap.tsx +255 -0
  517. package/src/charts/kinds/MultiLine.tsx +376 -0
  518. package/src/charts/kinds/StackedArea.tsx +218 -0
  519. package/src/charts/kinds/ZonedLine.tsx +346 -0
  520. package/src/charts/primitives/AreaGradient.tsx +26 -0
  521. package/src/charts/primitives/Axes.tsx +97 -0
  522. package/src/charts/primitives/ChartCard.tsx +180 -0
  523. package/src/charts/primitives/ChartFrame.tsx +157 -0
  524. package/src/charts/primitives/ChartLegend.tsx +302 -0
  525. package/src/charts/primitives/ChartTooltip.tsx +158 -0
  526. package/src/charts/primitives/Crosshair.tsx +40 -0
  527. package/src/charts/primitives/HoverOverlay.tsx +24 -0
  528. package/src/charts/primitives/ResponsiveChart.tsx +64 -0
  529. package/src/charts/primitives/ZoneRects.tsx +67 -0
  530. package/src/charts/series.ts +163 -0
  531. package/src/charts/sparklines/BarSparkline.tsx +48 -0
  532. package/src/charts/sparklines/LineSparkline.tsx +57 -0
  533. package/src/charts/sparklines/index.ts +2 -0
  534. package/src/charts/theme.tsx +53 -0
  535. package/src/charts/utils/domain.test.ts +24 -0
  536. package/src/charts/utils/domain.ts +22 -0
  537. package/src/charts/utils/format.ts +27 -0
  538. package/src/charts/utils/ticks.ts +18 -0
  539. package/src/cli/check-theme.test.ts +658 -0
  540. package/src/cli/index.ts +1497 -0
  541. package/src/cli/init-sync.test.ts +160 -0
  542. package/src/commands/ShortcutsHelp.tsx +129 -0
  543. package/src/commands/define-commands.ts +184 -0
  544. package/src/commands/define-overlays.ts +197 -0
  545. package/src/commands/index.ts +86 -0
  546. package/src/commands/overlays-mount.tsx +301 -0
  547. package/src/commands/projectors.ts +267 -0
  548. package/src/commands/shortcut-format.ts +83 -0
  549. package/src/commands/useCommandHotkeys.ts +114 -0
  550. package/src/connectivity/connectivity-indicator.tsx +249 -0
  551. package/src/connectivity/connectivity-provider.tsx +186 -0
  552. package/src/connectivity/index.ts +18 -0
  553. package/src/connectivity/types.ts +39 -0
  554. package/src/connectivity/use-connectivity.ts +25 -0
  555. package/src/content/article-actions.test.ts +78 -0
  556. package/src/content/article-actions.ts +72 -0
  557. package/src/content/article-card.module.css +109 -0
  558. package/src/content/article-card.module.css.d.ts +16 -0
  559. package/src/content/article-card.tsx +173 -0
  560. package/src/content/article-filter-bar.tsx +88 -0
  561. package/src/content/article-layout.module.css +131 -0
  562. package/src/content/article-layout.module.css.d.ts +20 -0
  563. package/src/content/article-layout.tsx +167 -0
  564. package/src/content/article-model.test.ts +119 -0
  565. package/src/content/article-model.ts +110 -0
  566. package/src/content/block-split.test.ts +75 -0
  567. package/src/content/block-split.ts +102 -0
  568. package/src/content/callout-alert.ts +88 -0
  569. package/src/content/callout.module.css +77 -0
  570. package/src/content/callout.module.css.d.ts +16 -0
  571. package/src/content/callout.tsx +96 -0
  572. package/src/content/code-block.module.css +86 -0
  573. package/src/content/code-block.module.css.d.ts +14 -0
  574. package/src/content/code-block.tsx +82 -0
  575. package/src/content/copy-action.tsx +79 -0
  576. package/src/content/fence-block.tsx +39 -0
  577. package/src/content/glyphs.tsx +53 -0
  578. package/src/content/guide.module.css +62 -0
  579. package/src/content/guide.module.css.d.ts +13 -0
  580. package/src/content/guide.tsx +174 -0
  581. package/src/content/heading-anchor.tsx +54 -0
  582. package/src/content/heading-components.tsx +62 -0
  583. package/src/content/highlighter.ts +123 -0
  584. package/src/content/index.ts +60 -0
  585. package/src/content/markdown-hast.ts +80 -0
  586. package/src/content/markdown.tsx +346 -0
  587. package/src/content/mdx.tsx +127 -0
  588. package/src/content/mermaid.module.css +20 -0
  589. package/src/content/mermaid.module.css.d.ts +8 -0
  590. package/src/content/mermaid.tsx +124 -0
  591. package/src/content/prose.module.css +330 -0
  592. package/src/content/prose.module.css.d.ts +12 -0
  593. package/src/content/prose.tsx +53 -0
  594. package/src/content/reading-progress.module.css +22 -0
  595. package/src/content/reading-progress.module.css.d.ts +9 -0
  596. package/src/content/reading-progress.tsx +67 -0
  597. package/src/content/slug.test.ts +62 -0
  598. package/src/content/slug.ts +57 -0
  599. package/src/content/toc.module.css +51 -0
  600. package/src/content/toc.module.css.d.ts +13 -0
  601. package/src/content/toc.tsx +226 -0
  602. package/src/content/url-hardening.ts +46 -0
  603. package/src/dashboard/delta-badge.tsx +70 -0
  604. package/src/dashboard/empty-state.tsx +80 -0
  605. package/src/dashboard/index.ts +11 -0
  606. package/src/dashboard/settings-section.module.css +23 -0
  607. package/src/dashboard/settings-section.module.css.d.ts +10 -0
  608. package/src/dashboard/settings-section.tsx +118 -0
  609. package/src/dashboard/stat-card.tsx +105 -0
  610. package/src/data/data-table.tsx +695 -0
  611. package/src/data/index.ts +37 -0
  612. package/src/data/table.ts +46 -0
  613. package/src/data/virtual-list.tsx +180 -0
  614. package/src/data/virtual.ts +21 -0
  615. package/src/forms/FormErrorSummary.tsx +64 -0
  616. package/src/forms/create-form.ts +57 -0
  617. package/src/forms/field.ts +30 -0
  618. package/src/forms/index.ts +26 -0
  619. package/src/forms/use-form-draft.ts +170 -0
  620. package/src/guard/check-source.test.ts +834 -0
  621. package/src/guard/guard-hook.test.ts +173 -0
  622. package/src/guard/guard-hook.ts +122 -0
  623. package/src/guard/index.ts +510 -0
  624. package/src/guard/types.ts +117 -0
  625. package/src/index.ts +139 -0
  626. package/src/motion/index.ts +26 -0
  627. package/src/notifications/bell.tsx +108 -0
  628. package/src/notifications/center.tsx +245 -0
  629. package/src/notifications/define-notifications.ts +162 -0
  630. package/src/notifications/index.ts +79 -0
  631. package/src/notifications/notify.tsx +260 -0
  632. package/src/notifications/overlay.tsx +64 -0
  633. package/src/notifications/store.ts +287 -0
  634. package/src/provider/index.tsx +234 -0
  635. package/src/query/devtools.tsx +38 -0
  636. package/src/query/index.ts +129 -0
  637. package/src/register.ts +158 -0
  638. package/src/router-tanstack/index.ts +111 -0
  639. package/src/router-tanstack/multi-search-param-store.test.ts +56 -0
  640. package/src/router-tanstack/multi-search-param-store.ts +122 -0
  641. package/src/router-tanstack/search-param-store.ts +125 -0
  642. package/src/shell/account-types.ts +119 -0
  643. package/src/shell/app-breadcrumbs.tsx +90 -0
  644. package/src/shell/app-header.module.css +73 -0
  645. package/src/shell/app-header.module.css.d.ts +11 -0
  646. package/src/shell/app-mobile-nav.module.css +100 -0
  647. package/src/shell/app-mobile-nav.module.css.d.ts +14 -0
  648. package/src/shell/app-mobile-nav.tsx +146 -0
  649. package/src/shell/app-sidebar-account.tsx +142 -0
  650. package/src/shell/app-sidebar.module.css +414 -0
  651. package/src/shell/app-sidebar.module.css.d.ts +34 -0
  652. package/src/shell/app-sidebar.tsx +632 -0
  653. package/src/shell/index.tsx +343 -0
  654. package/src/shell/page-header.tsx +35 -0
  655. package/src/shell/sidebar-search.module.css +62 -0
  656. package/src/shell/sidebar-search.module.css.d.ts +11 -0
  657. package/src/shell/sidebar-search.tsx +80 -0
  658. package/src/state.ts +246 -0
  659. package/src/styles.css +166 -0
  660. package/src/styles.floor.test.ts +36 -0
  661. package/src/surfaces.ts +489 -0
  662. package/src/theme/border-coverage.test.ts +272 -0
  663. package/src/theme/contrast.test.ts +306 -0
  664. package/src/theme/controls.module.css +143 -0
  665. package/src/theme/controls.module.css.d.ts +17 -0
  666. package/src/theme/floating.module.css +35 -0
  667. package/src/theme/floating.module.css.d.ts +9 -0
  668. package/src/theme/index.ts +933 -0
  669. package/src/theme/nav-link.module.css +67 -0
  670. package/src/theme/nav-link.module.css.d.ts +8 -0
  671. package/src/theme/segmented-control.module.css +14 -0
  672. package/src/theme/segmented-control.module.css.d.ts +8 -0
  673. package/src/theme/shadow-surfaces.test.ts +421 -0
  674. package/src/theme/timeline.module.css +29 -0
  675. package/src/theme/timeline.module.css.d.ts +9 -0
  676. package/src/theme-lab/index.tsx +359 -0
  677. package/src/theme-lab/theme-lab.test.ts +60 -0
  678. package/src/theme-toggle/index.tsx +180 -0
  679. package/src/tokens/index.ts +363 -0
  680. package/src/tokens/palette.ts +288 -0
  681. package/src/vite.ts +122 -0
  682. package/src/index.css +0 -986
  683. package/src/starlight.css +0 -308
  684. package/tailwind.config.js +0 -78
@@ -0,0 +1,17 @@
1
+ export type ShortcutsHelpProps = {
2
+ /** Section title. Default: 'Keyboard shortcuts'. */
3
+ title?: string;
4
+ /** Max-width passthrough (Mantine style prop). */
5
+ maw?: number | string;
6
+ };
7
+ /**
8
+ * Renders all registered commands that have a `shortcut` field, grouped by `group`.
9
+ * Commands with no `group` are rendered under an implicit ungrouped section.
10
+ *
11
+ * Returns `null` when no commands have shortcuts registered.
12
+ *
13
+ * @example
14
+ * <ShortcutsHelp title="Keyboard shortcuts" />
15
+ */
16
+ export declare function ShortcutsHelp({ title, maw }: ShortcutsHelpProps): import("react").JSX.Element | null;
17
+ //# sourceMappingURL=ShortcutsHelp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutsHelp.d.ts","sourceRoot":"","sources":["../../src/commands/ShortcutsHelp.tsx"],"names":[],"mappings":"AA2BA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACtB,CAAA;AA8BD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAA4B,EAAE,GAAG,EAAE,EAAE,kBAAkB,sCAyDtF"}
@@ -0,0 +1,64 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import { Box, Group, Kbd, Stack, Text, Title } from "@mantine/core";
4
+ import { toShortcutList } from "./projectors.js";
5
+ import { detectMac, parseShortcut } from "./shortcut-format.js";
6
+ import { VX } from "../tokens/index.js";
7
+ function ShortcutRow({
8
+ label,
9
+ shortcut,
10
+ isMac
11
+ }) {
12
+ const keys = parseShortcut(shortcut, isMac);
13
+ return /* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "xs", py: 2, children: [
14
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: label }),
15
+ /* @__PURE__ */ jsx(Group, { gap: 4, children: keys.map((key, i) => /* @__PURE__ */ jsx(Kbd, { size: "xs", children: key }, i)) })
16
+ ] });
17
+ }
18
+ function ShortcutsHelp({ title = "Keyboard shortcuts", maw }) {
19
+ const [isMac, setIsMac] = useState(false);
20
+ useEffect(() => {
21
+ setIsMac(detectMac());
22
+ }, []);
23
+ const shortcuts = toShortcutList();
24
+ if (shortcuts.length === 0) return null;
25
+ const grouped = /* @__PURE__ */ new Map();
26
+ for (const entry of shortcuts) {
27
+ const key = entry.group ?? "";
28
+ const bucket = grouped.get(key);
29
+ if (bucket !== void 0) {
30
+ bucket.push(entry);
31
+ } else {
32
+ grouped.set(key, [entry]);
33
+ }
34
+ }
35
+ return /* @__PURE__ */ jsxs(Box, { maw, children: [
36
+ /* @__PURE__ */ jsx(Title, { order: 5, mb: "sm", children: title }),
37
+ /* @__PURE__ */ jsx(Stack, { gap: "md", children: [...grouped.entries()].map(([group, entries]) => /* @__PURE__ */ jsxs(Stack, { gap: 2, children: [
38
+ group !== "" && /* @__PURE__ */ jsx(
39
+ Text,
40
+ {
41
+ ff: "monospace",
42
+ tt: "uppercase",
43
+ fw: 500,
44
+ c: "var(--vx-faint)",
45
+ mb: 4,
46
+ style: { fontSize: VX.text.micro, letterSpacing: "0.06em" },
47
+ children: group
48
+ }
49
+ ),
50
+ entries.map((entry) => /* @__PURE__ */ jsx(
51
+ ShortcutRow,
52
+ {
53
+ label: entry.label,
54
+ shortcut: entry.shortcut,
55
+ isMac
56
+ },
57
+ entry.id
58
+ ))
59
+ ] }, group)) })
60
+ ] });
61
+ }
62
+ export {
63
+ ShortcutsHelp
64
+ };
@@ -0,0 +1,140 @@
1
+ /**
2
+ * define-commands — const-generic factory for typed command registries.
3
+ *
4
+ * Consumer defines their commands with defineCommands, augments BasaltRegister.commands, then uses
5
+ * runCommand — unknown ids are tsc errors. The type slot gives the compile-time id union; the
6
+ * module-level stash gives the runtime values (type augmentation is erased at runtime).
7
+ *
8
+ * @example
9
+ * // commands.ts (app-side)
10
+ * import { defineCommands } from 'basalt-ui/commands'
11
+ * export const COMMANDS = defineCommands({
12
+ * 'file:save': { label: 'Save file', group: 'File', shortcut: 'Mod+S', run: () => save() },
13
+ * 'file:open': { label: 'Open file', group: 'File', shortcut: 'Mod+O', run: () => open() },
14
+ * 'help:docs': { label: 'Open docs', group: 'Help', run: () => window.open('/docs') },
15
+ * })
16
+ * declare module 'basalt-ui' {
17
+ * interface BasaltRegister { commands: typeof COMMANDS }
18
+ * }
19
+ *
20
+ * // usage.ts
21
+ * import { runCommand } from 'basalt-ui/commands'
22
+ * runCommand('file:save') // ✓ typed
23
+ * runCommand('nonexistent') // ✗ tsc error
24
+ */
25
+ import type { ReactNode } from 'react';
26
+ import type { Slot } from '../register.js';
27
+ /**
28
+ * Context passed to a command's run function. Minimal for 1.0; extend via BasaltRegister in 1.x.
29
+ *
30
+ * @example
31
+ * defineCommands({
32
+ * 'palette:close': { label: 'Close palette', run: ({ close }) => close?.() },
33
+ * })
34
+ */
35
+ export type CommandRunContext = {
36
+ /** Close the command palette (if open) before executing. Injected by BasaltOverlays. */
37
+ close?: () => void;
38
+ };
39
+ /**
40
+ * A single registered command. All fields except `label` and `run` are optional.
41
+ *
42
+ * @example
43
+ * const cmd: Command = {
44
+ * label: 'Save file',
45
+ * group: 'File',
46
+ * shortcut: 'Mod+S',
47
+ * when: () => document.hasFocus(),
48
+ * run: () => save(),
49
+ * }
50
+ */
51
+ export type Command = {
52
+ /** Display label shown in the command palette and shortcuts-help. */
53
+ label: string;
54
+ /** Optional group name for grouping in the palette and shortcuts display. */
55
+ group?: string;
56
+ /** Optional icon (ReactNode — no @tabler/icons dependency per house rules). */
57
+ icon?: ReactNode;
58
+ /**
59
+ * Optional keyboard shortcut string. Drives BOTH the ShortcutsHelp display AND live key
60
+ * binding via useCommandHotkeys() (which registers with @tanstack/react-hotkeys optional peer).
61
+ * Convention: 'Mod+S' (Mod = Cmd on mac, Ctrl elsewhere), 'Shift+Mod+P', etc.
62
+ */
63
+ shortcut?: string;
64
+ /**
65
+ * Optional predicate — when() returning false hides the command from the palette.
66
+ * Useful for context-sensitive commands (e.g. "save" only when a form is dirty).
67
+ */
68
+ when?: () => boolean;
69
+ /** The command handler. May be async. */
70
+ run: (ctx?: CommandRunContext) => void | Promise<void>;
71
+ };
72
+ /**
73
+ * The map of command id → Command that a consumer registers.
74
+ *
75
+ * @example
76
+ * const map: CommandMap = {
77
+ * 'file:save': { label: 'Save', run: () => save() },
78
+ * }
79
+ */
80
+ export type CommandMap = Record<string, Command>;
81
+ /** The consumer's registered command map, or `{}` when un-augmented. */
82
+ type Commands = Slot<'commands', CommandMap>;
83
+ /**
84
+ * The legal command id keys.
85
+ * Extract<…, string> drops symbol/number members that `keyof` always includes.
86
+ * Un-augmented: `never` (slot is `{}`, keyof is never).
87
+ * Augmented: the exact string literal union of the registered command ids.
88
+ *
89
+ * @example
90
+ * // After augmenting BasaltRegister.commands:
91
+ * const id: CommandId = 'file:save' // ✓
92
+ * const bad: CommandId = 'bad-id' // ✗ tsc error
93
+ */
94
+ export type CommandId = Extract<keyof Commands, string>;
95
+ /**
96
+ * Define a typed command map. Const-generic identity passthrough — preserves the exact literal
97
+ * keys so `runCommand('nonexistent')` is a tsc error after augmenting BasaltRegister.
98
+ *
99
+ * Stashes the runtime map so `runCommand` and `toSpotlightActions` resolve correctly at runtime
100
+ * (type augmentation is erased; the stash is the live source).
101
+ *
102
+ * @example
103
+ * export const COMMANDS = defineCommands({
104
+ * 'file:save': { label: 'Save file', group: 'File', shortcut: 'Mod+S', run: () => save() },
105
+ * })
106
+ * declare module 'basalt-ui' {
107
+ * interface BasaltRegister { commands: typeof COMMANDS }
108
+ * }
109
+ */
110
+ export declare function defineCommands<const T extends CommandMap>(spec: T): T;
111
+ /**
112
+ * Convenience helper to type a single Command object with full inference.
113
+ * Useful when splitting commands across files before merging into defineCommands.
114
+ *
115
+ * WARNING: defineCommand only TYPES a command — it does NOT register it into the runtime stash.
116
+ * Only defineCommands(map) registers commands. Calling defineCommand alone means the command will
117
+ * never appear in the palette or be reachable via runCommand.
118
+ *
119
+ * @example
120
+ * const saveCmd = defineCommand({ label: 'Save', shortcut: 'Mod+S', run: () => save() })
121
+ * // Then include saveCmd in a defineCommands({ 'file:save': saveCmd }) call to register it.
122
+ */
123
+ export declare function defineCommand(cmd: Command): Command;
124
+ /**
125
+ * Run a registered command by id. The id must be a key of the consumer's registered
126
+ * `BasaltRegister.commands` map — any other string is a tsc error.
127
+ *
128
+ * Resolves the command's run function from the runtime stash (NOT from the type slot — that is
129
+ * erased). Un-augmented (Commands = {}): CommandId = never → `runCommand` is effectively
130
+ * uncallable. Augmented: only the registered keys are accepted.
131
+ *
132
+ * @example
133
+ * runCommand('file:save')
134
+ * await runCommand('data:sync', { close: () => closeModal() })
135
+ */
136
+ export declare function runCommand(id: CommandId, ctx?: CommandRunContext): void | Promise<void>;
137
+ /** @internal — exposed for projectors.ts to iterate the runtime stash. Returns a readonly view. */
138
+ export declare function getActiveCommands(): Readonly<CommandMap>;
139
+ export {};
140
+ //# sourceMappingURL=define-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-commands.d.ts","sourceRoot":"","sources":["../../src/commands/define-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAIvC;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CACnB,CAAA;AAID;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+EAA+E;IAC/E,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,OAAO,CAAA;IACpB,yCAAyC;IACzC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACvD,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAIhD,wEAAwE;AACxE,KAAK,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,QAAQ,EAAE,MAAM,CAAC,CAAA;AAcvD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAGrE;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAEnD;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAQvF;AAED,mGAAmG;AACnG,wBAAgB,iBAAiB,IAAI,QAAQ,CAAC,UAAU,CAAC,CAExD"}
@@ -0,0 +1,26 @@
1
+ let activeCommands = {};
2
+ function defineCommands(spec) {
3
+ activeCommands = spec;
4
+ return spec;
5
+ }
6
+ function defineCommand(cmd) {
7
+ return cmd;
8
+ }
9
+ function runCommand(id, ctx) {
10
+ const cmd = activeCommands[id];
11
+ if (cmd === void 0) {
12
+ if (process.env["NODE_ENV"] !== "production")
13
+ console.warn(`[basalt] runCommand: no command registered for "${id}"`);
14
+ return;
15
+ }
16
+ return cmd.run(ctx);
17
+ }
18
+ function getActiveCommands() {
19
+ return activeCommands;
20
+ }
21
+ export {
22
+ defineCommand,
23
+ defineCommands,
24
+ getActiveCommands,
25
+ runCommand
26
+ };
@@ -0,0 +1,134 @@
1
+ /**
2
+ * define-overlays — const-generic factory for typed overlay registries.
3
+ *
4
+ * Consumer defines overlays with defineOverlays, augments BasaltRegister.overlays, then uses the
5
+ * `overlays` imperative controller — unknown keys are tsc errors. The type slot gives the
6
+ * compile-time key union; the module-level stash gives the runtime values.
7
+ *
8
+ * Uses @mantine/modals under the hood. ModalsProvider must be mounted (BasaltOverlays does this).
9
+ *
10
+ * @example
11
+ * // overlays.ts (app-side)
12
+ * import { defineOverlays } from 'basalt-ui/commands'
13
+ * export const OVERLAYS = defineOverlays({
14
+ * 'confirm:delete': {
15
+ * title: 'Delete item?',
16
+ * render: (p: { name: string }) => <Text>Delete "{p.name}"?</Text>,
17
+ * },
18
+ * })
19
+ * declare module 'basalt-ui' {
20
+ * interface BasaltRegister { overlays: typeof OVERLAYS }
21
+ * }
22
+ *
23
+ * // usage.ts
24
+ * import { overlays } from 'basalt-ui/commands'
25
+ * overlays.open('confirm:delete', { name: 'photo.jpg' }) // ✓ typed
26
+ * overlays.open('nonexistent', {}) // ✗ tsc error
27
+ */
28
+ import type { ReactNode } from 'react';
29
+ import type { Slot } from '../register.js';
30
+ /**
31
+ * A single registered overlay. The per-overlay props type P is the consumer's own payload.
32
+ *
33
+ * @example
34
+ * const overlay: Overlay<{ name: string }> = {
35
+ * title: 'Delete item?',
36
+ * render: ({ name }) => <Text>Delete "{name}"?</Text>,
37
+ * }
38
+ */
39
+ export type Overlay<P = Record<string, unknown>> = {
40
+ /** Optional modal title (ReactNode for rich headers). */
41
+ title?: ReactNode;
42
+ /** Render the modal body for a given payload. */
43
+ render: (props: P) => ReactNode;
44
+ };
45
+ /**
46
+ * The map of overlay key → Overlay that a consumer registers.
47
+ *
48
+ * @example
49
+ * const map: OverlayMap = {
50
+ * 'confirm:delete': { title: 'Confirm', render: (p: { name: string }) => <span>{p.name}</span> },
51
+ * }
52
+ */
53
+ export type OverlayMap = Record<string, Overlay<any>>;
54
+ /** The consumer's registered overlay map, or `{}` when un-augmented. */
55
+ type Overlays = Slot<'overlays', OverlayMap>;
56
+ /**
57
+ * The legal overlay keys.
58
+ * Extract<…, string> drops symbol/number members that `keyof` always includes.
59
+ * Un-augmented: `never`. Augmented: the exact string literal union.
60
+ *
61
+ * @example
62
+ * const key: OverlayKey = 'confirm:delete' // ✓ after augmenting
63
+ * const bad: OverlayKey = 'no-such-key' // ✗ tsc error
64
+ */
65
+ export type OverlayKey = Extract<keyof Overlays, string>;
66
+ /**
67
+ * Define a typed overlay map. Const-generic identity passthrough — preserves the exact literal
68
+ * keys so `overlays.open('nonexistent', …)` is a tsc error after augmenting BasaltRegister.
69
+ *
70
+ * @example
71
+ * export const OVERLAYS = defineOverlays({
72
+ * 'user:edit': { title: 'Edit user', render: (p: { id: string }) => <UserEditForm id={p.id} /> },
73
+ * })
74
+ * declare module 'basalt-ui' {
75
+ * interface BasaltRegister { overlays: typeof OVERLAYS }
76
+ * }
77
+ */
78
+ export declare function defineOverlays<const T extends OverlayMap>(spec: T): T;
79
+ /**
80
+ * Convenience helper to type a single Overlay object with full inference.
81
+ * Useful when splitting overlays across files before merging into defineOverlays.
82
+ *
83
+ * WARNING: defineOverlay only TYPES an overlay — it does NOT register it into the runtime stash.
84
+ * Only defineOverlays(map) registers overlays. Calling defineOverlay alone means the overlay will
85
+ * never be reachable via overlays.open().
86
+ *
87
+ * @example
88
+ * const deleteOverlay = defineOverlay<{ name: string }>({
89
+ * title: 'Confirm delete',
90
+ * render: ({ name }) => <Text>Delete "{name}"?</Text>,
91
+ * })
92
+ * // Then include it in a defineOverlays({ 'confirm:delete': deleteOverlay }) call to register it.
93
+ */
94
+ export declare function defineOverlay<P = Record<string, unknown>>(overlay: Overlay<P>): Overlay<P>;
95
+ /**
96
+ * Extract the props type for a registered overlay key.
97
+ * When Overlays is un-augmented ({}) this resolves to `never` so open() is uncallable.
98
+ * _K is the mapped key variable; V is the inferred props type — kept distinct to avoid shadowing.
99
+ */
100
+ type OverlayProps<K extends OverlayKey> = Overlays extends {
101
+ [_K in K]: Overlay<infer V>;
102
+ } ? V : never;
103
+ /**
104
+ * Imperative overlay controller. Resolves the overlay spec from the runtime stash and delegates
105
+ * to @mantine/modals. Use this for ephemeral, non-route-addressable overlays (confirm dialogs,
106
+ * quick-edit panels). For shareable/back-button/refreshable overlays use route masks via
107
+ * ./router-tanstack.
108
+ *
109
+ * @example
110
+ * overlays.open('confirm:delete', { name: 'photo.jpg' })
111
+ * overlays.close()
112
+ */
113
+ export declare const overlays: {
114
+ /**
115
+ * Open a registered overlay by key. Resolves the Overlay spec from the runtime stash and calls
116
+ * modals.open() with the rendered body. The props type is inferred from the registered overlay.
117
+ *
118
+ * `overlays.open('nonexistent', …)` is a tsc error when BasaltRegister.overlays is augmented.
119
+ * Un-augmented: OverlayKey = never → effectively uncallable.
120
+ *
121
+ * @example
122
+ * overlays.open('user:edit', { id: '42' })
123
+ */
124
+ open<K extends OverlayKey>(key: K, props: OverlayProps<K>): void;
125
+ /**
126
+ * Close all open overlays (delegates to modals.closeAll()).
127
+ *
128
+ * @example
129
+ * overlays.close()
130
+ */
131
+ close(): void;
132
+ };
133
+ export {};
134
+ //# sourceMappingURL=define-overlays.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-overlays.d.ts","sourceRoot":"","sources":["../../src/commands/define-overlays.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAmBvC;;;;;;;;GAQG;AAEH,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IACjD,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,iDAAiD;IACjD,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAA;CAChC,CAAA;AAED;;;;;;;GAOG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AAIrD,wEAAwE;AACxE,KAAK,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAE5C;;;;;;;;GAQG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,QAAQ,EAAE,MAAM,CAAC,CAAA;AAaxD;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,KAAK,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAGrE;AAID;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE1F;AAID;;;;GAIG;AACH,KAAK,YAAY,CAAC,CAAC,SAAS,UAAU,IAAI,QAAQ,SAAS;KAAG,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAAE,GACtF,CAAC,GACD,KAAK,CAAA;AAET;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ;IACnB;;;;;;;;;OASG;SACE,CAAC,SAAS,UAAU,OAAO,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI;IAehE;;;;;OAKG;aACM,IAAI;CAGd,CAAA"}
@@ -0,0 +1,53 @@
1
+ let modalsPromise;
2
+ function loadModals() {
3
+ modalsPromise ??= import("@mantine/modals").then((m) => m.modals).catch(() => void 0);
4
+ return modalsPromise;
5
+ }
6
+ let activeOverlays = {};
7
+ function defineOverlays(spec) {
8
+ activeOverlays = spec;
9
+ return spec;
10
+ }
11
+ function defineOverlay(overlay) {
12
+ return overlay;
13
+ }
14
+ const overlays = {
15
+ /**
16
+ * Open a registered overlay by key. Resolves the Overlay spec from the runtime stash and calls
17
+ * modals.open() with the rendered body. The props type is inferred from the registered overlay.
18
+ *
19
+ * `overlays.open('nonexistent', …)` is a tsc error when BasaltRegister.overlays is augmented.
20
+ * Un-augmented: OverlayKey = never → effectively uncallable.
21
+ *
22
+ * @example
23
+ * overlays.open('user:edit', { id: '42' })
24
+ */
25
+ open(key, props) {
26
+ const spec = activeOverlays[key];
27
+ if (spec === void 0) {
28
+ if (process.env["NODE_ENV"] !== "production")
29
+ console.warn(`[basalt] overlays.open: no overlay registered for "${String(key)}"`);
30
+ return;
31
+ }
32
+ void loadModals().then(
33
+ (modals) => modals?.open({
34
+ title: spec.title,
35
+ children: spec.render(props)
36
+ })
37
+ );
38
+ },
39
+ /**
40
+ * Close all open overlays (delegates to modals.closeAll()).
41
+ *
42
+ * @example
43
+ * overlays.close()
44
+ */
45
+ close() {
46
+ void loadModals().then((modals) => modals?.closeAll());
47
+ }
48
+ };
49
+ export {
50
+ defineOverlay,
51
+ defineOverlays,
52
+ overlays
53
+ };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * ./commands — command bus, overlay controller, Spotlight projection, shortcuts display,
3
+ * live keybindings, and composable overlay mount for basalt-ui apps.
4
+ *
5
+ * Optional peers: @mantine/modals ^9.3.0, @mantine/spotlight ^9.3.0,
6
+ * @mantine/notifications ^9.3.0, @tanstack/react-hotkeys 0.10.0.
7
+ *
8
+ * Install with: bun add @mantine/modals @mantine/spotlight @mantine/notifications @tanstack/react-hotkeys
9
+ * Also import the Spotlight styles in main.tsx (the layered bundle — the unlayered one outranks
10
+ * basalt's `@layer basalt` styles regardless of specificity): import '@mantine/spotlight/styles.layer.css'
11
+ *
12
+ * @example
13
+ * // commands.ts (app-side) — define + augment:
14
+ * import { defineCommands } from 'basalt-ui/commands'
15
+ * export const COMMANDS = defineCommands({
16
+ * 'file:save': { label: 'Save', group: 'File', shortcut: 'Mod+S', run: () => save() },
17
+ * })
18
+ * declare module 'basalt-ui' {
19
+ * interface BasaltRegister { commands: typeof COMMANDS }
20
+ * }
21
+ *
22
+ * // main.tsx — mount composable overlays (replaces <BasaltNotifications />):
23
+ * import { BasaltOverlays } from 'basalt-ui/commands'
24
+ * import '@mantine/spotlight/styles.layer.css'
25
+ * <BasaltProvider><BasaltOverlays><App /></BasaltOverlays></BasaltProvider>
26
+ *
27
+ * // usage.ts — run a command:
28
+ * import { runCommand } from 'basalt-ui/commands'
29
+ * runCommand('file:save')
30
+ *
31
+ * // Open/close Spotlight programmatically:
32
+ * import { openSpotlight, closeSpotlight } from 'basalt-ui/commands'
33
+ * openSpotlight()
34
+ */
35
+ export { defineCommands, defineCommand, runCommand, type Command, type CommandMap, type CommandId, type CommandRunContext, } from './define-commands.js';
36
+ export { defineOverlays, defineOverlay, overlays, type Overlay, type OverlayMap, type OverlayKey, } from './define-overlays.js';
37
+ export { toSpotlightActions, toRouteActions, toShortcutList, toHotkeyBindings, type RouteActionItem, type RouteActionSection, type ToRouteActionsOptions, type ShortcutEntry, type HotkeyBinding, } from './projectors.js';
38
+ export { parseShortcut, detectMac, formatShortcutDisplay } from './shortcut-format.js';
39
+ export { useCommandHotkeys } from './useCommandHotkeys.js';
40
+ export { ShortcutsHelp, type ShortcutsHelpProps } from './ShortcutsHelp.js';
41
+ export { BasaltOverlays, type BasaltOverlaysProps, basaltSpotlight, openSpotlight, closeSpotlight, } from './overlays-mount.js';
42
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,cAAc,EACd,aAAa,EACb,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAGnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAGxE,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,46 @@
1
+ import {
2
+ defineCommands,
3
+ defineCommand,
4
+ runCommand
5
+ } from "./define-commands.js";
6
+ import {
7
+ defineOverlays,
8
+ defineOverlay,
9
+ overlays
10
+ } from "./define-overlays.js";
11
+ import {
12
+ toSpotlightActions,
13
+ toRouteActions,
14
+ toShortcutList,
15
+ toHotkeyBindings
16
+ } from "./projectors.js";
17
+ import { parseShortcut, detectMac, formatShortcutDisplay } from "./shortcut-format.js";
18
+ import { useCommandHotkeys } from "./useCommandHotkeys.js";
19
+ import { ShortcutsHelp } from "./ShortcutsHelp.js";
20
+ import {
21
+ BasaltOverlays,
22
+ basaltSpotlight,
23
+ openSpotlight,
24
+ closeSpotlight
25
+ } from "./overlays-mount.js";
26
+ export {
27
+ BasaltOverlays,
28
+ ShortcutsHelp,
29
+ basaltSpotlight,
30
+ closeSpotlight,
31
+ defineCommand,
32
+ defineCommands,
33
+ defineOverlay,
34
+ defineOverlays,
35
+ detectMac,
36
+ formatShortcutDisplay,
37
+ openSpotlight,
38
+ overlays,
39
+ parseShortcut,
40
+ runCommand,
41
+ toHotkeyBindings,
42
+ toRouteActions,
43
+ toShortcutList,
44
+ toSpotlightActions,
45
+ useCommandHotkeys
46
+ };
@@ -0,0 +1,117 @@
1
+ /**
2
+ * overlays-mount — composable overlay mount for basalt-ui apps.
3
+ *
4
+ * `BasaltOverlays` bundles ModalsProvider, Spotlight, and Notifications into a single mount point.
5
+ * Put it inside BasaltProvider, before the router. It replaces the standalone `<BasaltNotifications />`
6
+ * from `basalt-ui/notifications` — do NOT mount both `<BasaltOverlays notifications />` and
7
+ * `<BasaltNotifications />` in the same tree (double-mount of `<Notifications />`).
8
+ *
9
+ * Each overlay system is opt-in via props (all default to true). Use flags to disable layers the
10
+ * app does not need — e.g. a charts-only app that has no commands can set `spotlight={false}`.
11
+ * A disabled layer's optional peer is NEVER imported — each layer is lazy-loaded (React.lazy +
12
+ * dynamic import()) only when its flag is true, and degrades to a no-op fallback instead of
13
+ * crashing when the peer is absent.
14
+ *
15
+ * Optional peers required (only when the corresponding layer is enabled):
16
+ * @mantine/modals ^9.3.0 (for modals)
17
+ * @mantine/spotlight ^9.3.0 (for spotlight)
18
+ * @mantine/notifications ^9.3.0 (for notifications)
19
+ * @tanstack/react-hotkeys ^0.10.0 (optional — keybindings degrade to no-op when absent)
20
+ *
21
+ * Spotlight live store: BasaltOverlays uses a basalt-owned createSpotlight() store so the
22
+ * spotlight instance is separate from Mantine's default global. The store is created lazily (on
23
+ * first use, whether from mounting the spotlight layer or from calling openSpotlight()/
24
+ * closeSpotlight()) so @mantine/spotlight is never imported until actually needed. Import
25
+ * `basaltSpotlight` and call `basaltSpotlight.open()` / `basaltSpotlight.close()` from consumer
26
+ * code. The re-exported `openSpotlight` / `closeSpotlight` helpers delegate to this store.
27
+ *
28
+ * @example
29
+ * // main.tsx — replace <BasaltNotifications /> with <BasaltOverlays>. Use the layered bundle —
30
+ * // the unlayered one outranks basalt's `@layer basalt` styles regardless of specificity:
31
+ * import { BasaltOverlays } from 'basalt-ui/commands'
32
+ * import '@mantine/spotlight/styles.layer.css'
33
+ *
34
+ * createRoot(root).render(
35
+ * <BasaltProvider>
36
+ * <BasaltOverlays>
37
+ * <App />
38
+ * </BasaltOverlays>
39
+ * </BasaltProvider>
40
+ * )
41
+ *
42
+ * // Disable spotlight for apps without commands — @mantine/spotlight is then never imported:
43
+ * <BasaltOverlays spotlight={false}>
44
+ * <App />
45
+ * </BasaltOverlays>
46
+ *
47
+ * // Open/close programmatically:
48
+ * import { openSpotlight, closeSpotlight } from 'basalt-ui/commands'
49
+ * openSpotlight()
50
+ */
51
+ import type { ReactNode } from 'react';
52
+ import type { NotificationsProps } from '@mantine/notifications';
53
+ import type { SpotlightActionData } from '@mantine/spotlight';
54
+ /**
55
+ * Basalt-owned Spotlight actions (open/close/toggle), backed by a lazily-created
56
+ * createSpotlight() store so @mantine/spotlight is only imported on first use.
57
+ *
58
+ * @example
59
+ * import { basaltSpotlight } from 'basalt-ui/commands'
60
+ * basaltSpotlight.open()
61
+ */
62
+ export declare const basaltSpotlight: {
63
+ open: () => void;
64
+ close: () => void;
65
+ toggle: () => void;
66
+ };
67
+ /** Open the basalt Spotlight palette programmatically. */
68
+ export declare function openSpotlight(): void;
69
+ /** Close the basalt Spotlight palette programmatically. */
70
+ export declare function closeSpotlight(): void;
71
+ export type BasaltOverlaysProps = {
72
+ /** Mount @mantine/modals ModalsProvider. Default: true. */
73
+ modals?: boolean;
74
+ /** Mount @mantine/spotlight Spotlight with mod+K shortcut. Default: true. */
75
+ spotlight?: boolean;
76
+ /** Mount @mantine/notifications Notifications overlay. Default: true. */
77
+ notifications?: boolean;
78
+ /**
79
+ * Activate @tanstack/react-hotkeys keybindings for all registered commands. Default: true.
80
+ * Degrades to no-op when @tanstack/react-hotkeys peer is absent — safe to leave enabled.
81
+ */
82
+ hotkeys?: boolean;
83
+ /** Override or extend the Notifications props (position, autoClose, limit, etc.). Defaults: position="bottom-right", autoClose=4000, limit=5. */
84
+ notificationsProps?: Omit<NotificationsProps, 'children'>;
85
+ /**
86
+ * Extra Spotlight actions merged with the command-projected actions — e.g.
87
+ * toRouteActions(nav, { onNavigate }) for page navigation. Rendered BEFORE the command actions
88
+ * and grouped by each action's `group`. A static snapshot, same as the command projection.
89
+ */
90
+ spotlightActions?: SpotlightActionData[];
91
+ /**
92
+ * Auto-project the registered command bus into Spotlight actions. Default: true. Set false when
93
+ * the app supplies the FULL action list itself via `spotlightActions` (e.g. to decorate commands
94
+ * with kind badges built from `toSpotlightActions()`) — this avoids the commands appearing twice.
95
+ */
96
+ projectCommands?: boolean;
97
+ /** App content (required). */
98
+ children: ReactNode;
99
+ };
100
+ /**
101
+ * Composable overlay mount — wraps children in ModalsProvider and renders Spotlight +
102
+ * Notifications siblings. All three layers are enabled by default; pass `false` to disable.
103
+ * A disabled layer's optional peer is never imported.
104
+ *
105
+ * Mount exactly ONE BasaltOverlays per app. Do NOT combine with a standalone
106
+ * `<BasaltNotifications />` from `basalt-ui/notifications` — that would double-mount
107
+ * `<Notifications />`.
108
+ *
109
+ * @example
110
+ * <BasaltProvider>
111
+ * <BasaltOverlays>
112
+ * <RouterProvider router={router} />
113
+ * </BasaltOverlays>
114
+ * </BasaltProvider>
115
+ */
116
+ export declare function BasaltOverlays({ modals: enableModals, spotlight: enableSpotlight, notifications: enableNotifications, hotkeys: enableHotkeys, notificationsProps, spotlightActions, projectCommands, children, }: BasaltOverlaysProps): import("react").JSX.Element;
117
+ //# sourceMappingURL=overlays-mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlays-mount.d.ts","sourceRoot":"","sources":["../../src/commands/overlays-mount.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAiC7D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;gBAChB,IAAI;iBAGH,IAAI;kBAGH,IAAI;CAGjB,CAAA;AAID,0DAA0D;AAC1D,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,IAAI,IAAI,CAErC;AAID,MAAM,MAAM,mBAAmB,GAAG;IAChC,2DAA2D;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,yEAAyE;IACzE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iJAAiJ;IACjJ,kBAAkB,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAA;IACzD;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAA;IACxC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,8BAA8B;IAC9B,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AA2FD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EAAE,YAAmB,EAC3B,SAAS,EAAE,eAAsB,EACjC,aAAa,EAAE,mBAA0B,EACzC,OAAO,EAAE,aAAoB,EAC7B,kBAAkB,EAClB,gBAAgB,EAChB,eAAsB,EACtB,QAAQ,GACT,EAAE,mBAAmB,+BAmCrB"}