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
@@ -0,0 +1,369 @@
1
+ /**
2
+ * Mantine-free token + palette layer.
3
+ *
4
+ * This module is PURE DATA + string helpers — ZERO `@mantine/*` imports (lint-enforced).
5
+ * Colors are CSS custom properties under the `--vx-*` prefix (do NOT rename the prefix).
6
+ * They resolve per color scheme in CSS, so `VX.*` works in components AND in non-component
7
+ * files. Apply opacity via `alpha(token, a)` (never raw `rgba()`) so the hue keeps resolving.
8
+ *
9
+ * Grounded in argo `packages/charts/src/{tokens,palette,theme-vars,utils/color}.ts`.
10
+ */
11
+
12
+ import { ACCENT, FILL, INK, NEUTRAL, SEMANTIC, SHADOW, STATUS, SURFACE } from './palette'
13
+
14
+ // The raw hue families + pair-picker — the building blocks a consumer's series module composes
15
+ // (`hrv: p(BP.blue)`). The doctrine sends every consumer here, so they are public surface, not
16
+ // palette internals; dropping them from this barrel hard-fails the consumer's build (1.0.0 bug,
17
+ // pinned by scripts/export-surface.json).
18
+ export { BP, p } from './palette'
19
+
20
+ /** A per-theme color pair: a hue keeps its identity but shifts shade across schemes. */
21
+ export type ColorPair = { light: string; dark: string }
22
+
23
+ /** A map of token name → per-theme color pair (the input shape for series/group builders). */
24
+ export type SeriesMap = Record<string, ColorPair>
25
+
26
+ /**
27
+ * Apply opacity to any palette token, theme-aware. Use instead of raw `rgba()` so the
28
+ * underlying hue still resolves per color scheme.
29
+ *
30
+ * alpha(VX.neutral, 0.5) // muted hairline
31
+ * alpha(VX.status.warn, 0.1) // zone-band fill
32
+ */
33
+ export const alpha = (token: string, a: number): string =>
34
+ `color-mix(in srgb, ${token} ${Math.round(a * 100)}%, transparent)`
35
+
36
+ /**
37
+ * VX tokens — `var(--vx-*)` string refs + non-color sizing constants. Colors resolve per
38
+ * color scheme in CSS, so `VX.*` works in components AND in non-component files. Never
39
+ * reference raw hex in chart files — use `VX.*` / `alpha()`.
40
+ *
41
+ * The framework ships ONLY generic primitives — no domain `VX.series` tree (apps rebuild
42
+ * that with `seriesTokens` / `groupTokens` against their own series maps).
43
+ */
44
+ /**
45
+ * The type scale — the ONE owned ladder, in px.
46
+ *
47
+ * Type is a token axis like color / spacing / radius / motion: a single edit point, never a
48
+ * hardcoded literal at a call site. Every font-size in the framework resolves to a step here.
49
+ *
50
+ * Two representations are DERIVED from this one object, so they cannot drift:
51
+ * • `VX.text.*` — plain numbers, for inline `style` objects and visx SVG props (React appends
52
+ * `px`; SVG presentation attributes can't resolve `var()`, so a ref string would break charts).
53
+ * • `--vx-text-*` — the CSS-var form (`11px`, …), for CSS modules and the Mantine theme.
54
+ *
55
+ * The Mantine theme additionally re-expresses the ladder through Mantine's `rem()` (see
56
+ * `theme/index.ts`), so the component surface scales with the user's browser font-size AND with
57
+ * `--mantine-scale`. `md` is the body step; `lg` is pinned at exactly 16px because it doubles as
58
+ * the iOS input floor (see the `styles.css` floor — Safari zooms the viewport on focus below 16px).
59
+ */
60
+ const TEXT = {
61
+ micro: 11, // mono uppercase micro-label (table th, Menu.Label, sidebar/section headers, axis ticks)
62
+ xs: 12.5, // delta badges, tooltip meta, dense chrome, StatCard labels
63
+ sm: 13.5, // table/stat numerals, chart tooltip, legend
64
+ md: 15, // BODY — nav rows, menu items, timeline, labels, prose; chart/card titles
65
+ lg: 16, // breadcrumb current — ALSO the iOS input floor (do not lower)
66
+ xl: 18, // section titles
67
+ h2: 21, // article-density Prose h2 (docs/CONTENT-SPEC.md §5)
68
+ kpi: 24, // the StatCard hero numeral (density pass: 31 → 24, tighter/less shouty)
69
+ h1: 26, // article-density Prose h1 (docs/CONTENT-SPEC.md §5)
70
+ } as const
71
+
72
+ export const VX = {
73
+ // Non-color sizing constants
74
+ lineWidth: 2.5,
75
+ line2Width: 2,
76
+ axisFont: TEXT.micro,
77
+ dotR: 5,
78
+ // The ONE dashed pattern — plotted stroke, legend swatch, tooltip swatch all read this.
79
+ dashArray: '6 4' as const,
80
+ // Legend layout — replaces the hardcoded 18/13 in ChartLegend.
81
+ legendGap: 22,
82
+ legendFontSize: TEXT.sm,
83
+
84
+ // The type scale (px numbers — see TEXT above). Use in inline styles and visx SVG props;
85
+ // use `var(--vx-text-*)` in CSS modules.
86
+ text: TEXT,
87
+
88
+ // Single source for the card corner radius — shared by the Mantine-free ChartCard and the
89
+ // Mantine chrome (Card/Paper resolve to this SAME token). One knob, so cards never diverge.
90
+ radiusCard: 'var(--vx-radius-card)',
91
+ // Single source for the control corner radius (inputs, search, buttons, segmented track).
92
+ radiusCtrl: 'var(--vx-radius-ctrl)',
93
+
94
+ // Secondary-line color (back-compat alias; now theme-aware via --vx-line2)
95
+ line2Dark: 'var(--vx-line2)',
96
+
97
+ // Semantic fills — consistent opacity across all charts
98
+ good: 'var(--vx-good)',
99
+ goodSoft: 'var(--vx-goodSoft)',
100
+ bad: 'var(--vx-bad)',
101
+ warn: 'var(--vx-warn)',
102
+ goodSolid: 'var(--vx-goodSolid)',
103
+ badSolid: 'var(--vx-badSolid)',
104
+ warnSolid: 'var(--vx-warnSolid)',
105
+
106
+ // Reference/dashed lines for thresholds
107
+ goodRef: 'var(--vx-goodRef)',
108
+ badRef: 'var(--vx-badRef)',
109
+ warnRef: 'var(--vx-warnRef)',
110
+
111
+ // Neutral primary line/text color — the default for single-series, no-signal marks
112
+ // ("white/gray per theme"). Same value as the NEUTRAL.line pair.
113
+ line: 'var(--vx-line)',
114
+ line2: 'var(--vx-line2)',
115
+
116
+ // Axis label + axis stroke colors (theme-aware). Exposed as flat refs so a bespoke chart that
117
+ // renders raw <text> labels or axis lines (without the Axis* primitives) needs no hook.
118
+ axis: 'var(--vx-axis)',
119
+ axisStroke: 'var(--vx-axisStroke)',
120
+
121
+ // Grid, hover, legend
122
+ grid: 'var(--vx-grid)',
123
+ crosshair: 'var(--vx-crosshair)',
124
+ dotStroke: 'var(--vx-dotStroke)',
125
+ legendText: 'var(--vx-legendText)',
126
+
127
+ // Tooltip chrome — muted (secondary) text inside a bespoke tooltip. The other tooltip vars
128
+ // (bg/text/border/shadow) are only exposed via `useVxTheme()` (see `charts/theme.tsx`); this
129
+ // one is flattened onto `VX` too because bespoke-tooltip authors reached for `VX.muted` (the
130
+ // general ink-ramp muted) instead and got the wrong token — same pattern as `VX.muted` below.
131
+ tooltipMuted: 'var(--vx-tooltipMuted)',
132
+
133
+ // Base neutral for hairlines / muted text / overlays — apply opacity via alpha()
134
+ neutral: 'var(--vx-neutral)',
135
+
136
+ // Ink text ramp (docs/DESIGN-SPEC.md §2) — primary/emphasis/secondary/tertiary body text.
137
+ ink: 'var(--vx-ink)',
138
+ ink2: 'var(--vx-ink2)',
139
+ muted: 'var(--vx-muted)',
140
+ faint: 'var(--vx-faint)',
141
+
142
+ // The accent as INK — primary series, active-nav icon, links, focus rings. Read against the PAGE,
143
+ // so it inverts across schemes (light on dark, deep on light).
144
+ accent: 'var(--vx-accent)',
145
+ accentHover: 'var(--vx-accentHover)',
146
+ // The accent as SURFACE — a filled control that carries a label. Squeezed between white-text
147
+ // contrast and page contrast, so it is the same hex in both schemes (see ACCENT in palette.ts).
148
+ // Mantine's `--mantine-color-<primary>-filled` is bridged onto this, so it drives ALL filled
149
+ // chrome; a raw `--vx-accent` fill would be unreadable on dark. Fills use THIS, never `accent`.
150
+ accentFill: 'var(--vx-accentFill)',
151
+ accentFillHover: 'var(--vx-accentFillHover)',
152
+ onAccent: 'var(--vx-onAccent)',
153
+
154
+ // Layout separators (header bottom rule, sidebar child indent) — distinct from `surface.border`.
155
+ divider: 'var(--vx-divider)',
156
+
157
+ // Depth shadows — a whisper shadow + a 1px ring baked into the value (never a `border` prop).
158
+ shadowCard: 'var(--vx-shadow-card)',
159
+ shadowCtrl: 'var(--vx-shadow-ctrl)',
160
+ // Floating-layer elevation (menus, popovers, tooltips, modals, drawers) — a real drop shadow.
161
+ shadowOverlay: 'var(--vx-shadow-overlay)',
162
+
163
+ // App surfaces (cards, borders) — shared with the Mantine chrome
164
+ surface: {
165
+ bg: 'var(--vx-surface-bg)',
166
+ panel: 'var(--vx-surface-panel)',
167
+ panelHover: 'var(--vx-surface-panelHover)',
168
+ elevated: 'var(--vx-surface-elevated)',
169
+ subtle: 'var(--vx-surface-subtle)',
170
+ overlay: 'var(--vx-surface-overlay)', // floating layer (menus, popovers, modals, drawers)
171
+ field: 'var(--vx-surface-field)', // input field surface (slightly inset on a panel)
172
+ border: 'var(--vx-surface-border)', // "line" — strong border
173
+ hairline: 'var(--vx-surface-hairline)', // card ring only
174
+ },
175
+
176
+ // Score / zone status scale (excellent → poor)
177
+ status: {
178
+ excellent: 'var(--vx-status-excellent)',
179
+ good: 'var(--vx-status-good)',
180
+ warn: 'var(--vx-status-warn)',
181
+ bad: 'var(--vx-status-bad)',
182
+ neutral: 'var(--vx-status-neutral)',
183
+ },
184
+
185
+ // Shared sizing
186
+ margin: { top: 12, right: 16, bottom: 30, left: 44 },
187
+ minPxPerTick: 55,
188
+ } as const
189
+
190
+ type Side = 'light' | 'dark'
191
+
192
+ /** A CSS declaration line for a single `--vx-*` custom property. */
193
+ const decl = (name: string, value: string): string => ` --vx-${name}: ${value};`
194
+
195
+ /** Emit one prefixed group of pairs for a given scheme side. */
196
+ const groupSide = (prefix: string, map: SeriesMap, side: Side): string =>
197
+ Object.entries(map)
198
+ .map(([key, pair]) => decl(`${prefix}${key}`, pair[side]))
199
+ .join('\n')
200
+
201
+ /**
202
+ * Built-in framework primitives for a given scheme side — STATUS group, semantic solids,
203
+ * neutral line/axis/grid/tooltip chrome, legend text, and the surface ramp. Domain series
204
+ * (SERIES/ACTIVITY/USAGE) are NOT shipped — apps append them via `opts.groups`.
205
+ */
206
+ function frameworkPrimitives(side: Side): string {
207
+ const n = NEUTRAL
208
+ const s = SEMANTIC
209
+ const su = SURFACE
210
+ const ink = INK
211
+ const ac = ACCENT
212
+ return [
213
+ groupSide('status-', STATUS as SeriesMap, side),
214
+ decl('goodSolid', s.good[side]),
215
+ decl('badSolid', s.bad[side]),
216
+ decl('warnSolid', s.warn[side]),
217
+ decl('neutral', n.neutral[side]),
218
+ decl('line', n.line[side]),
219
+ decl('line2', n.line2[side]),
220
+ decl('axis', n.axis[side]),
221
+ decl('axisStroke', n.axisStroke[side]),
222
+ decl('grid', n.grid[side]),
223
+ decl('crosshair', n.crosshair[side]),
224
+ decl('dotStroke', n.dotStroke[side]),
225
+ decl('tooltipBg', n.tooltipBg[side]),
226
+ decl('tooltipText', n.tooltipText[side]),
227
+ decl('tooltipMuted', n.tooltipMuted[side]),
228
+ decl('tooltipBorder', n.tooltipBorder[side]),
229
+ decl('tooltipShadow', n.tooltipShadow[side]),
230
+ decl('legendText', side === 'dark' ? 'rgba(255,255,255,0.92)' : 'rgba(38,38,38,0.82)'),
231
+ decl('ink', ink.ink[side]),
232
+ decl('ink2', ink.ink2[side]),
233
+ decl('muted', ink.muted[side]),
234
+ decl('faint', ink.faint[side]),
235
+ decl('accent', ac.accent[side]),
236
+ decl('accentHover', ac.accentHover[side]),
237
+ decl('accentFill', ac.accentFill[side]),
238
+ decl('accentFillHover', ac.accentFillHover[side]),
239
+ decl('onAccent', ac.onAccent[side]),
240
+ decl('divider', su.divider[side]),
241
+ decl('shadow-card', SHADOW.card[side]),
242
+ decl('shadow-ctrl', SHADOW.ctrl[side]),
243
+ decl('shadow-overlay', SHADOW.overlay[side]),
244
+ decl('surface-bg', su.bg[side]),
245
+ decl('surface-panel', su.panel[side]),
246
+ decl('surface-panelHover', su.panelHover[side]),
247
+ decl('surface-elevated', su.elevated[side]),
248
+ decl('surface-subtle', su.subtle[side]),
249
+ decl('surface-overlay', su.overlay[side]),
250
+ decl('surface-field', su.field[side]),
251
+ decl('surface-border', su.border[side]),
252
+ decl('surface-hairline', su.hairline[side]),
253
+ ].join('\n')
254
+ }
255
+
256
+ /**
257
+ * Theme-independent scalars + semantic fills, defined once on `:root`.
258
+ *
259
+ * Area-gradient strength is a global knob (the theme lab overrides these two on `:root`
260
+ * to retune every line-area fill live). 0%/0% disables gradients app-wide.
261
+ */
262
+ const FRAMEWORK_DERIVED = [
263
+ decl('radius-card', '7px'),
264
+ decl('radius-ctrl', '6px'),
265
+ // Article-density Prose measure (docs/CONTENT-SPEC.md §5) — theme-independent, like the radii.
266
+ decl('prose-measure', '72ch'),
267
+ // The fill band (see FILL in palette.ts). Emitted on `:root`, NOT per scheme — a filled surface
268
+ // is the same hex in both, which is the whole point: it is squeezed between its white label and
269
+ // the page behind it, and only one luminance band satisfies both on both pages.
270
+ ...Object.entries(FILL).map(([name, hex]) => decl(`fill-${name}`, hex)),
271
+ // Hover is DERIVED from the fill, so retuning a fill (in the theme lab, or here) carries its
272
+ // hover along instead of leaving a stale pair. 88% of the fill over black lands ~0.128 luminance:
273
+ // a visible press-darkening that still clears AA for the white label (~5.9:1).
274
+ ...Object.keys(FILL).map((name) =>
275
+ decl(`fillHover-${name}`, `color-mix(in srgb, var(--vx-fill-${name}) 88%, #000)`),
276
+ ),
277
+ // The type scale, emitted from the SAME `TEXT` object `VX.text` reads — CSS modules and the
278
+ // Mantine theme consume these; inline styles / visx read the numbers. One ladder, two forms.
279
+ ...Object.entries(TEXT).map(([step, px]) => decl(`text-${step}`, `${px}px`)),
280
+ decl('area-top', '22%'),
281
+ decl('area-bottom', '1%'),
282
+ decl('good', 'color-mix(in srgb, var(--vx-goodSolid) 18%, transparent)'),
283
+ decl('goodSoft', 'color-mix(in srgb, var(--vx-goodSolid) 8%, transparent)'),
284
+ decl('bad', 'color-mix(in srgb, var(--vx-badSolid) 18%, transparent)'),
285
+ decl('warn', 'color-mix(in srgb, var(--vx-warnSolid) 8%, transparent)'),
286
+ decl('goodRef', 'color-mix(in srgb, var(--vx-goodSolid) 30%, transparent)'),
287
+ decl('badRef', 'color-mix(in srgb, var(--vx-badSolid) 30%, transparent)'),
288
+ decl('warnRef', 'color-mix(in srgb, var(--vx-warnSolid) 20%, transparent)'),
289
+ ].join('\n')
290
+
291
+ /**
292
+ * Wrap a map of `{ name: ColorPair }` into `var(--vx-<prefix><name>)` token refs — the runtime
293
+ * companion to `buildPaletteCss`. Lets a consumer define its own series and read stable refs.
294
+ *
295
+ * Returns an exact-keyed object: the return type mirrors the keys of the input map, so a renamed
296
+ * or removed key becomes a tsc error rather than silently widening to `Record<string, string>`.
297
+ */
298
+ export function seriesTokens<const T extends SeriesMap>(
299
+ map: T,
300
+ prefix = '',
301
+ ): { [K in keyof T]: string } {
302
+ const out = {} as { [K in keyof T]: string }
303
+ for (const key of Object.keys(map) as (keyof T)[]) out[key] = `var(--vx-${prefix}${String(key)})`
304
+ return out
305
+ }
306
+
307
+ /**
308
+ * Define a named series map. Identity passthrough — gives consumers a typed authoring entry
309
+ * point and preserves the exact literal keys of the input (const-generic so callers get back T,
310
+ * not the widened SeriesMap, enabling downstream exact-key checks in groupTokens / seriesTokens).
311
+ */
312
+ export function defineSeries<const T extends SeriesMap>(map: T): T {
313
+ return map
314
+ }
315
+
316
+ /**
317
+ * Build a single namespaced group's token refs (`var(--vx-<name>-<key>)`).
318
+ *
319
+ * Returns an exact-keyed object matching the keys of `map` — a stale or renamed key is a tsc
320
+ * error at the call site rather than a silent `Record<string, string>` widening.
321
+ */
322
+ export function groupTokens<const T extends SeriesMap>(
323
+ name: string,
324
+ map: T,
325
+ ): { [K in keyof T]: string } {
326
+ return seriesTokens(map, `${name}-`)
327
+ }
328
+
329
+ /** Options for {@link buildPaletteCss}. */
330
+ export type BuildPaletteOpts = {
331
+ /** Extra named series maps to emit under the given prefixes (e.g. `{ '': SERIES, 'activity-': ACTIVITY }`). */
332
+ groups?: Record<string, SeriesMap>
333
+ /** Theme-independent derived declarations (gradients, semantic fills) emitted once on `:root`. */
334
+ derived?: string[]
335
+ }
336
+
337
+ /**
338
+ * Emit the `--vx-*` stylesheet: a `:root` block of theme-independent scalars, then the
339
+ * dark (default) and light primitive blocks under `html[data-mantine-color-scheme='…']`.
340
+ *
341
+ * The framework chrome (STATUS/SEMANTIC/SURFACE pairs + the framework DERIVED defaults) is
342
+ * built in, so an empty `buildPaletteCss()` already emits every framework var. Consumer
343
+ * `opts.groups` / `opts.derived` append on top (e.g. argo's domain SERIES/ACTIVITY/USAGE).
344
+ *
345
+ * Dark is the default (`:root`) since the framework defaults to dark; the
346
+ * `[data-mantine-color-scheme]` selectors track Mantine's toggle on `<html>`.
347
+ */
348
+ export function buildPaletteCss(opts: BuildPaletteOpts = {}): string {
349
+ const groups = opts.groups ?? {}
350
+ const extraDerived = (opts.derived ?? []).map((d) => ` ${d}`).join('\n')
351
+ const derived = extraDerived ? `${FRAMEWORK_DERIVED}\n${extraDerived}` : FRAMEWORK_DERIVED
352
+ const side = (s: Side): string => {
353
+ const extra = Object.entries(groups)
354
+ .map(([prefix, map]) => groupSide(prefix, map, s))
355
+ .join('\n')
356
+ const framework = frameworkPrimitives(s)
357
+ return extra ? `${framework}\n${extra}` : framework
358
+ }
359
+ return `:root {
360
+ ${derived}
361
+ }
362
+ :root,
363
+ html[data-mantine-color-scheme='dark'] {
364
+ ${side('dark')}
365
+ }
366
+ html[data-mantine-color-scheme='light'] {
367
+ ${side('light')}
368
+ }`
369
+ }
@@ -0,0 +1,288 @@
1
+ /**
2
+ * palette.ts — Basalt single source of truth for ALL framework color
3
+ * (charts via VX tokens + chrome via the Mantine theme).
4
+ *
5
+ * Identity: modern zinc (2026-07 redesign, see `docs/DESIGN-SPEC.md`). Cool-neutral zinc surfaces
6
+ * (Tailwind zinc family) — a low-contrast panel lift on a slightly darker page, depth via a
7
+ * whisper `shadow-card` (never a hairline-only border), and ONE saturated sky-blue accent
8
+ * (#0077bd light / #8ec5ff dark) used with intent (primary series, active-nav icon, links, primary
9
+ * actions, focus rings, meter leaders) — chrome stays zinc-neutral otherwise. Status hues stay
10
+ * UI-tuned (muted, not raw Material/AntD/Tailwind defaults).
11
+ *
12
+ * Design rules baked in (see `docs/DESIGN-SPEC.md`):
13
+ * - Neutral zinc greys carry ~90% of the surface — chrome is monochrome, accent only points.
14
+ * - Depth = `shadow-card` (a whisper shadow + a 1px ring baked into the SAME shadow value) —
15
+ * borders-as-borders remain only for genuine layout dividers (the `line` token).
16
+ * - Interactive neutral fills are INK color-mixes (`alpha(VX.ink, 0.06)` etc.), never grey hexes.
17
+ * - Each metric is ONE hue; multi-series only where data is genuinely categorical.
18
+ * - Series colors are per-theme PAIRS: a lighter shade on dark (no glow/bleed on dark
19
+ * backgrounds), a deeper shade on light (enough contrast). Hue identity stays constant.
20
+ *
21
+ * This module is pure data — no React, no Mantine, no browser APIs. It is consumed by
22
+ * the token layer (emits the CSS custom properties) and by the Mantine theme.
23
+ */
24
+
25
+ import type { ColorPair } from './index'
26
+
27
+ /**
28
+ * Basalt palette. Each family is shade 1→5 (index 0 = darkest, 4 = lightest).
29
+ * `darkGray` / `gray` / `lightGray` are the zinc identity (Tailwind zinc scale, blue channel a
30
+ * whisper above red — cool, not warm) shared by the dark surface ramp, the mid-grey chart-line
31
+ * ramp, and the light surfaces. `blue` is the single saturated sky accent family (built around the
32
+ * `#0077bd` / `#8ec5ff` accent pair — see the `ramp10` pin in `theme/index.ts` for how the Mantine
33
+ * tuple resolves the exact hexes at the fill and ink indices).
34
+ *
35
+ * These families are the RAW hues. What a filled control actually paints is `FILL` / `ACCENT`
36
+ * below — the same hues placed in one shared luminance band, which is a hard constraint, not a
37
+ * taste call. Read those two before touching any color here.
38
+ */
39
+ export const BP = {
40
+ black: '#18181b',
41
+ white: '#ffffff',
42
+ // Zinc dark-surface ramp: darkest (page bg extreme) → lightest (mid-tone border/text step).
43
+ // Mirrors Tailwind zinc-900/800/700/600/500.
44
+ darkGray: ['#18181b', '#27272a', '#3f3f46', '#52525c', '#71717a'],
45
+ // Zinc mid greys for text / lines (cool-neutral, replaces the old warm-neutral ramp).
46
+ // Mirrors Tailwind zinc-600/500/400/300/200.
47
+ gray: ['#52525c', '#71717a', '#a1a1aa', '#d4d4d8', '#e4e4e7'],
48
+ // Zinc light surfaces: darkest (line/border step) → lightest (panel-hover). Mirrors Tailwind
49
+ // zinc-300/200, the literal `#e5e5e5` hairline, zinc-100 (panel), zinc-50 (panel-hover).
50
+ lightGray: ['#d4d4d8', '#e4e4e7', '#e5e5e5', '#f4f4f5', '#fafafa'],
51
+
52
+ // Saturated sky-blue accent family (darkest → lightest), built around the exact spec accent
53
+ // hue. `ramp10` interpolates a 5-stop family across 10 fractional positions, which can't land on
54
+ // an arbitrary target at an arbitrary index — so `theme/index.ts` pins the exact hexes onto the
55
+ // two indices that matter (6 = the fill band, 4 = the dark INK accent) after building the ramp.
56
+ // The family itself only has to read as one coherent hue.
57
+ blue: ['#0c4a6e', '#0369a1', '#0284c7', '#38bdf8', '#7dd3fc'],
58
+ green: ['#165a36', '#1c6e42', '#238551', '#32a467', '#72ca9b'],
59
+ orange: ['#77450d', '#935610', '#c87619', '#ec9a3c', '#fbb360'],
60
+ red: ['#8e292c', '#ac2f33', '#cd4246', '#e76a6e', '#fa999c'],
61
+ vermilion: ['#96290d', '#b83211', '#d33d17', '#eb6847', '#ff9980'],
62
+ rose: ['#a82255', '#c22762', '#db2c6f', '#f5498b', '#ff66a1'],
63
+ violet: ['#5c255c', '#7c327c', '#9d3f9d', '#bd6bbd', '#d69fd6'],
64
+ indigo: ['#5642a6', '#634dbf', '#7961db', '#9881f3', '#bdadff'],
65
+ cerulean: ['#0c5174', '#0f6894', '#147eb3', '#3fa6da', '#68c1ee'],
66
+ turquoise: ['#004d46', '#007067', '#00a396', '#13c9ba', '#7ae1d8'],
67
+ forest: ['#1d7324', '#238c2c', '#29a634', '#43bf4d', '#62d96b'],
68
+ lime: ['#43501b', '#5a701a', '#8eb125', '#b6d94c', '#d4f17e'],
69
+ gold: ['#5c4405', '#866103', '#d1980b', '#f0b726', '#fbd065'],
70
+ sepia: ['#5e4123', '#7a542e', '#946638', '#af855a', '#d0b090'],
71
+ } as const
72
+
73
+ /**
74
+ * Pick a per-theme shade pair from a Basalt family.
75
+ * Defaults: shade 3 (index 2) on light, shade 4 (index 3) on dark — the dark-mode lift
76
+ * that stops saturated hues from glowing. Override indices for ordered/sibling cases.
77
+ */
78
+ export const p = (fam: readonly string[], light = 2, dark = 3): ColorPair => ({
79
+ light: fam[light]!,
80
+ dark: fam[dark]!,
81
+ })
82
+
83
+ /** Spec status hues (`docs/DESIGN-SPEC.md` §2) — exact, shared by SEMANTIC + STATUS below. */
84
+ const SUCCESS: ColorPair = { light: '#2f7a4f', dark: '#56c07a' }
85
+ const WARNING: ColorPair = { light: '#b5750f', dark: '#e0a83a' }
86
+ const DANGER: ColorPair = { light: '#b53f3f', dark: '#e0685f' }
87
+
88
+ /** Semantic status hues — solids + the family they fill from (alpha applied in the token layer). */
89
+ export const SEMANTIC = {
90
+ good: SUCCESS,
91
+ bad: DANGER,
92
+ warn: WARNING,
93
+ } as const
94
+
95
+ /**
96
+ * Score / zone status scale (excellent → poor). `good`/`warn`/`bad` are the SAME spec
97
+ * success/warning/danger pairs as `SEMANTIC` (also the direct source for Badge/Notification/delta
98
+ * -badge status-tint idioms in the theme — one set of hexes, several consumers). `excellent`
99
+ * (top-of-scale grade) and `neutral` keep their prior chart-only families (unchanged BP families).
100
+ */
101
+ export const STATUS = {
102
+ excellent: p(BP.forest),
103
+ good: SUCCESS,
104
+ warn: WARNING,
105
+ bad: DANGER,
106
+ neutral: p(BP.gray, 1, 2),
107
+ } as const
108
+
109
+ /**
110
+ * Theme-resolved neutrals (line / axis / grid / tooltip chrome). Mirrors the old
111
+ * useVxTheme() outputs, retuned to the zinc identity — the light-scheme opacity bases below use
112
+ * the new `ink` rgb (38,38,38 = #262626) rather than the old warm near-black, so chart chrome
113
+ * reads on the same cool-neutral ink as the rest of the chrome.
114
+ */
115
+ export const NEUTRAL = {
116
+ line: { light: BP.gray[0], dark: BP.gray[4] }, // primary line
117
+ line2: { light: BP.gray[1], dark: BP.gray[2] }, // secondary line
118
+ axis: { light: 'rgba(38,38,38,0.6)', dark: 'rgba(255,255,255,0.6)' },
119
+ axisStroke: { light: 'rgba(38,38,38,0.12)', dark: 'rgba(255,255,255,0.12)' },
120
+ grid: { light: 'rgba(38,38,38,0.07)', dark: 'rgba(255,255,255,0.06)' },
121
+ crosshair: { light: 'rgba(38,38,38,0.32)', dark: 'rgba(255,255,255,0.42)' },
122
+ dotStroke: { light: BP.white, dark: BP.darkGray[1] }, // matches chart-area bg
123
+ tooltipBg: { light: BP.white, dark: 'rgba(39,39,42,0.96)' },
124
+ tooltipText: { light: 'rgba(38,38,38,0.88)', dark: 'rgba(255,255,255,0.88)' },
125
+ tooltipMuted: { light: 'rgba(38,38,38,0.5)', dark: 'rgba(255,255,255,0.5)' },
126
+ tooltipBorder: { light: `1px solid ${BP.lightGray[1]}`, dark: 'none' },
127
+ tooltipShadow: { light: '0 2px 8px rgba(38,38,38,0.1)', dark: '0 2px 8px rgba(0,0,0,0.35)' },
128
+ // Base neutral for hairlines / muted / DIMMED text / overlays — apply opacity via alpha().
129
+ // Binds to --mantine-color-dimmed, so it is THE dimmed-text lever. Equal to `INK.muted` (the
130
+ // spec's "muted (secondary text)" row) — kept as its own pair for the pre-existing `--vx-neutral`
131
+ // name (never renamed), while `INK.muted` below is the new explicit spec-named token.
132
+ neutral: { light: '#525252', dark: '#d4d4d4' },
133
+ } as const
134
+
135
+ /** Ink text ramp (`docs/DESIGN-SPEC.md` §2) — primary/emphasis/secondary/tertiary body text. */
136
+ export const INK = {
137
+ ink: { light: '#262626', dark: '#e5e5e5' }, // primary text
138
+ ink2: { light: '#404040', dark: '#dddddd' }, // emphasis body
139
+ muted: { light: '#525252', dark: '#d4d4d4' }, // secondary text (= NEUTRAL.neutral)
140
+ faint: { light: '#737373', dark: '#a1a1a1' }, // tertiary text / micro-labels
141
+ } as const
142
+
143
+ /**
144
+ * The one saturated sky-blue accent. It has TWO roles, and they are DIFFERENT COLORS — conflating
145
+ * them is what made dark mode unfixable.
146
+ *
147
+ * • `accent` — the accent as INK: link text, active-nav icon, chart lines, focus ring. It is read
148
+ * AGAINST THE PAGE, so it must be LIGHT on dark (`#8ec5ff`, 8.64:1 on the dark page) and DEEP on
149
+ * light (`#0077bd`, 4.60:1 on the light page). This pair inverts across schemes, as it must.
150
+ *
151
+ * • `accentFill` — the accent as SURFACE: filled buttons, a checked Switch/Checkbox, the active
152
+ * Timeline bullet, the Composer send button. It CARRIES A LABEL, so it is squeezed from both
153
+ * sides at once: white text needs ≥4.5:1 against the fill, AND the control needs ≥3:1 against
154
+ * the page it sits on. On the dark page those two constraints leave one narrow window, and
155
+ * `#0077bd` is the value in it (white 4.80:1, fill-vs-dark-page 3.26:1). Deeper (`#0069a8`,
156
+ * `#04669b`) buys text contrast but drops the button to 2.5–2.7:1 against the page — the control
157
+ * fades into the background. Lighter breaks white text. So the fill is the SAME hex in both
158
+ * schemes, and `onAccent` is white in both.
159
+ *
160
+ * `onAccent` is THE foreground for any accent fill. `theme/index.ts` bridges Mantine's
161
+ * `--mantine-color-<primary>-filled` onto `--vx-accentFill` and every filled foreground onto
162
+ * `--vx-onAccent`, so ONE token drives the chrome — which is also what makes the theme lab able to
163
+ * retune the accent live. Mantine's own `autoContrast` cannot express this (it resolves the
164
+ * foreground scheme-blindly, in JS). Regression-locked by `theme/contrast.test.ts`.
165
+ */
166
+ export const ACCENT = {
167
+ accent: { light: '#0077bd', dark: '#8ec5ff' }, // accent as INK — inverts across schemes
168
+ accentHover: { light: '#0069a8', dark: '#51a2ff' },
169
+ accentFill: { light: '#0077bd', dark: '#0077bd' }, // accent as SURFACE — same hex in both schemes
170
+ accentFillHover: { light: '#0069a8', dark: '#0069a8' }, // deeper on hover (white text 5.86:1)
171
+ onAccent: { light: '#ffffff', dark: '#ffffff' }, // text on an accent fill — white in BOTH
172
+ } as const
173
+
174
+ /**
175
+ * Filled-surface hexes for the Mantine accent families — THE FILL BAND.
176
+ *
177
+ * A filled control is constrained from both sides at once (the `ACCENT` note above derives this for
178
+ * the accent): a white label needs ≥4.5:1 against the fill, and the control needs ≥3:1 against the
179
+ * page behind it — on BOTH pages, since a fill does not invert across schemes. In WCAG terms that
180
+ * pins the fill's relative luminance into one narrow band, ~0.150–0.183. There is no room for a
181
+ * family to sit outside it: too light and the label dies, too dark and the button fades into the
182
+ * dark page.
183
+ *
184
+ * So every family's fill is its own hue placed at the SAME luminance (0.165, the band's centre).
185
+ * Each hex is the family's Mantine shade-6 scaled uniformly in LINEAR-light space — luminance is
186
+ * linear in linear-RGB, so a uniform scale lands on the target exactly while preserving the hue and
187
+ * saturation exactly. The result is a system law rather than a per-color judgement call: EVERY
188
+ * filled surface reads white, on either page, at ~4.9:1 / ~3.2:1. Untuned, five families sat under
189
+ * the 3:1 page floor (grape 2.17:1) and three needed black labels.
190
+ *
191
+ * `blue` is absent on purpose — it is the accent, and its fill lives in `ACCENT.accentFill` so the
192
+ * accent keeps ONE source. `dark` is absent too: `color="dark"` is a deliberately near-black
193
+ * surface, not a band member. Hover is DERIVED in CSS from the fill (see `tokens/index.ts`), so
194
+ * retuning a fill moves its hover with it. Regression-locked by `theme/contrast.test.ts`.
195
+ */
196
+ export const FILL = {
197
+ gray: '#707078',
198
+ red: '#cc3c41',
199
+ pink: '#d22b6a',
200
+ grape: '#ad47ad',
201
+ violet: '#ad47ad',
202
+ indigo: '#745cda',
203
+ cyan: '#1378aa',
204
+ teal: '#007f75',
205
+ green: '#1f8228',
206
+ lime: '#617a1a',
207
+ yellow: '#936a05',
208
+ orange: '#a56113',
209
+ } as const
210
+
211
+ /**
212
+ * Card / control depth shadows (`docs/DESIGN-SPEC.md` §2) — depth is a whisper shadow + a 1px
213
+ * ring baked into the SAME value (never a separate `border`). The ring embeds
214
+ * `var(--vx-surface-hairline)` so it stays single-sourced against the hairline pair below.
215
+ */
216
+ export const SHADOW = {
217
+ card: {
218
+ light: '0 1px 2px rgba(28,25,23,0.05), 0 0 0 1px var(--vx-surface-hairline)',
219
+ dark: '0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px color-mix(in srgb, #ffffff 4%, transparent)',
220
+ },
221
+ ctrl: {
222
+ light: '0 1px 2px rgba(28,25,23,0.12)',
223
+ dark: '0 1px 2px rgba(0,0,0,0.35)',
224
+ },
225
+ // Floating-layer elevation (menus, popovers, tooltips, modals, drawers) — a REAL drop shadow, a
226
+ // step above `card`, so detached surfaces read as lifted off the page (`docs/DESIGN-SPEC.md` §5).
227
+ // Unlike `card`, no embedded ring: floating surfaces carry a real 1px `--vx-surface-border` so
228
+ // Mantine's rotated-square arrow inherits a proper edge.
229
+ overlay: {
230
+ light: '0 8px 24px rgba(28,25,23,0.10)',
231
+ dark: '0 8px 24px rgba(0,0,0,0.5)',
232
+ },
233
+ } as const
234
+
235
+ /**
236
+ * App chrome surfaces — the zinc identity for the Mantine theme (`docs/DESIGN-SPEC.md` §2).
237
+ *
238
+ * `border` ("line") is the STRONG border used broadly for layout/control chrome (AppShell, Table,
239
+ * Input, Divider, Tabs, Popover, Accordion — everything bound through `--mantine-color-default-
240
+ * border` / `--mantine-color-gray-{2,3,4}` in the resolver below). `hairline` ("card ring") is a
241
+ * DISTINCT, thinner pair used ONLY inside `shadow-card`'s embedded ring — cards carry no `border`
242
+ * property at all, the ring lives in the shadow. Never conflate the two.
243
+ */
244
+ /** Dark page-bg expression — shared by `bg` and the input `field` surface below. */
245
+ const DARK_PAGE = 'color-mix(in srgb, #27272a 70%, #18181b)'
246
+
247
+ export const SURFACE = {
248
+ bg: {
249
+ light: 'color-mix(in srgb, #f4f4f5 50%, #e4e4e7)',
250
+ dark: DARK_PAGE,
251
+ }, // page background
252
+ panel: { light: '#f4f4f5', dark: '#27272a' }, // cards, controls
253
+ panelHover: {
254
+ light: '#fafafa',
255
+ dark: 'color-mix(in srgb, #3f3f46 50%, #27272a)',
256
+ },
257
+ // Elevated surface (chart area, `--mantine-color-default-hover`) — same lift as panel-hover.
258
+ elevated: {
259
+ light: '#fafafa',
260
+ dark: 'color-mix(in srgb, #3f3f46 50%, #27272a)',
261
+ },
262
+ border: {
263
+ light: 'color-mix(in srgb, #e4e4e7 50%, #d4d4d8)',
264
+ dark: '#3f3f46',
265
+ }, // "line" — strong border (layout/control chrome, NOT the card ring)
266
+ hairline: {
267
+ light: '#e5e5e5',
268
+ dark: 'color-mix(in srgb, #52525c 50%, #3f3f46)',
269
+ }, // card ring only — consumed by `SHADOW.card`
270
+ // Hover/striped/track fallback surface — a faint step between `panel` and `border`. Used by
271
+ // Table hover/striped, Code, SegmentedControl track fallback, Tabs/Accordion/Menu hover.
272
+ subtle: { light: '#eeeef0', dark: '#2d2d33' },
273
+ // Floating-layer surface (menus, popovers, tooltips, modals, drawers). On light it reads pure
274
+ // white — a clean lift above the zinc-100 panel; on dark it reuses the `panelHover` elevated step
275
+ // (≈ #333338) so detached surfaces sit a shade above the panel. Paired with `SHADOW.overlay` +
276
+ // a real `border` so Mantine's arrow renders a proper edge (`docs/DESIGN-SPEC.md` §5).
277
+ overlay: {
278
+ light: '#ffffff',
279
+ dark: 'color-mix(in srgb, #3f3f46 50%, #27272a)',
280
+ },
281
+ // Input field surface (docs/DESIGN-SPEC.md §5 field idiom) — reads slightly inset ON a panel.
282
+ // Light: pure white on the zinc-100 panel; dark: the page-bg step (one darker than panel).
283
+ field: { light: '#ffffff', dark: DARK_PAGE },
284
+ divider: {
285
+ light: 'color-mix(in srgb, #e5e5e5 65%, transparent)',
286
+ dark: 'color-mix(in srgb, #ffffff 6%, transparent)',
287
+ }, // layout separators (header bottom rule, sidebar child indent)
288
+ } as const