basalt-ui 1.1.1 → 1.3.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 (191) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +46 -0
  3. package/README.md +64 -8
  4. package/agent/rules/basalt-app.md +126 -0
  5. package/agent/rules/basalt-content.md +3 -1
  6. package/agent/rules/basalt-tokens.md +14 -5
  7. package/agent/skills/basalt-app/SKILL.md +28 -7
  8. package/dist/agent/part-list.d.ts.map +1 -1
  9. package/dist/agent/part-list.js +17 -7
  10. package/dist/agent/stick-to-bottom.js +2 -2
  11. package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -1
  12. package/dist/agent-chat/thread-detail-panel.js +37 -33
  13. package/dist/agent-chat/thread-message.d.ts.map +1 -1
  14. package/dist/agent-chat/thread-message.js +8 -5
  15. package/dist/agent-chat/thread-outcome-card.js +3 -3
  16. package/dist/agent-chat/thread-workspace.js +1 -1
  17. package/dist/charts/primitives/ChartLegend.js +2 -0
  18. package/dist/charts/primitives/ChartTooltip.js +2 -1
  19. package/dist/cli/index.d.ts +29 -0
  20. package/dist/cli/index.d.ts.map +1 -1
  21. package/dist/cli/index.js +80 -9
  22. package/dist/connectivity/connectivity-indicator.d.ts.map +1 -1
  23. package/dist/connectivity/connectivity-indicator.js +3 -3
  24. package/dist/content/article-card.module.css +7 -5
  25. package/dist/content/article-layout.module.css +16 -12
  26. package/dist/content/callout.module.css +4 -4
  27. package/dist/content/code-block.module.css +8 -7
  28. package/dist/content/guide.module.css +3 -3
  29. package/dist/content/mermaid.module.css +2 -2
  30. package/dist/content/prose.module.css +59 -29
  31. package/dist/content/reading-progress.module.css +2 -0
  32. package/dist/content/toc.module.css +6 -3
  33. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  34. package/dist/dashboard/delta-badge.js +10 -2
  35. package/dist/dashboard/empty-state.d.ts.map +1 -1
  36. package/dist/dashboard/empty-state.js +3 -16
  37. package/dist/dashboard/settings-section.js +2 -2
  38. package/dist/dashboard/settings-section.module.css +2 -2
  39. package/dist/dashboard/stat-card.js +2 -1
  40. package/dist/data/virtual-list.d.ts.map +1 -1
  41. package/dist/data/virtual-list.js +12 -2
  42. package/dist/forms/FormErrorSummary.js +2 -2
  43. package/dist/guard/index.d.ts +20 -4
  44. package/dist/guard/index.d.ts.map +1 -1
  45. package/dist/guard/index.js +266 -38
  46. package/dist/guard/types.d.ts +24 -3
  47. package/dist/guard/types.d.ts.map +1 -1
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/provider/index.d.ts +30 -1
  51. package/dist/provider/index.d.ts.map +1 -1
  52. package/dist/provider/index.js +32 -7
  53. package/dist/provider/lab-theme.d.ts +39 -0
  54. package/dist/provider/lab-theme.d.ts.map +1 -0
  55. package/dist/provider/lab-theme.js +52 -0
  56. package/dist/shell/app-header.module.css +2 -2
  57. package/dist/shell/app-mobile-nav.module.css +1 -1
  58. package/dist/shell/app-sidebar-account.d.ts.map +1 -1
  59. package/dist/shell/app-sidebar-account.js +4 -2
  60. package/dist/shell/app-sidebar.d.ts.map +1 -1
  61. package/dist/shell/app-sidebar.js +4 -2
  62. package/dist/shell/app-sidebar.module.css +36 -26
  63. package/dist/shell/index.d.ts.map +1 -1
  64. package/dist/shell/index.js +11 -4
  65. package/dist/shell/sidebar-search.module.css +16 -4
  66. package/dist/styles.css +22 -11
  67. package/dist/surfaces.d.ts +21 -11
  68. package/dist/surfaces.d.ts.map +1 -1
  69. package/dist/surfaces.js +10 -3
  70. package/dist/theme/controls.module.css +1 -1
  71. package/dist/theme/floating.module.css +1 -1
  72. package/dist/theme/index.d.ts +116 -11
  73. package/dist/theme/index.d.ts.map +1 -1
  74. package/dist/theme/index.js +703 -566
  75. package/dist/theme/nav-link.module.css +1 -1
  76. package/dist/theme/use-basalt-spacing.d.ts +3 -0
  77. package/dist/theme/use-basalt-spacing.d.ts.map +1 -0
  78. package/dist/theme/use-basalt-spacing.js +8 -0
  79. package/dist/theme-lab/derive-controls.d.ts +13 -0
  80. package/dist/theme-lab/derive-controls.d.ts.map +1 -0
  81. package/dist/theme-lab/derive-controls.js +137 -0
  82. package/dist/theme-lab/derive-state.d.ts +55 -0
  83. package/dist/theme-lab/derive-state.d.ts.map +1 -0
  84. package/dist/theme-lab/derive-state.js +81 -0
  85. package/dist/theme-lab/index.d.ts +12 -2
  86. package/dist/theme-lab/index.d.ts.map +1 -1
  87. package/dist/theme-lab/index.js +13 -62
  88. package/dist/theme-toggle/index.d.ts.map +1 -1
  89. package/dist/theme-toggle/index.js +3 -2
  90. package/dist/tokens/derive.d.ts +89 -0
  91. package/dist/tokens/derive.d.ts.map +1 -0
  92. package/dist/tokens/derive.js +250 -0
  93. package/dist/tokens/hct.d.ts +34 -0
  94. package/dist/tokens/hct.d.ts.map +1 -0
  95. package/dist/tokens/hct.js +159 -0
  96. package/dist/tokens/index.d.ts +143 -7
  97. package/dist/tokens/index.d.ts.map +1 -1
  98. package/dist/tokens/index.js +322 -48
  99. package/dist/tokens/palette.d.ts +984 -167
  100. package/dist/tokens/palette.d.ts.map +1 -1
  101. package/dist/tokens/palette.js +617 -119
  102. package/dist/tokens.css +248 -0
  103. package/dist/vite-color-mix.d.ts +30 -0
  104. package/dist/vite-color-mix.d.ts.map +1 -0
  105. package/dist/vite-color-mix.js +80 -0
  106. package/dist/vite.d.ts +82 -1
  107. package/dist/vite.d.ts.map +1 -1
  108. package/dist/vite.js +312 -0
  109. package/llms.txt +14 -4
  110. package/package.json +41 -10
  111. package/src/agent/part-list.tsx +13 -7
  112. package/src/agent/stick-to-bottom.tsx +2 -2
  113. package/src/agent-chat/thread-detail-panel.tsx +13 -10
  114. package/src/agent-chat/thread-message.tsx +8 -5
  115. package/src/agent-chat/thread-outcome-card.tsx +2 -2
  116. package/src/agent-chat/thread-workspace.tsx +2 -2
  117. package/src/charts/primitives/ChartLegend.tsx +2 -2
  118. package/src/charts/primitives/ChartTooltip.tsx +2 -2
  119. package/src/cli/check-theme.test.ts +18 -0
  120. package/src/cli/index.ts +129 -6
  121. package/src/cli/tokens-css.test.ts +90 -0
  122. package/src/connectivity/connectivity-indicator.tsx +8 -2
  123. package/src/content/article-card.module.css +7 -5
  124. package/src/content/article-layout.module.css +16 -12
  125. package/src/content/callout.module.css +4 -4
  126. package/src/content/code-block.module.css +8 -7
  127. package/src/content/guide.module.css +3 -3
  128. package/src/content/mermaid.module.css +2 -2
  129. package/src/content/prose.module.css +59 -29
  130. package/src/content/prose.module.css.test.ts +55 -0
  131. package/src/content/reading-progress.module.css +2 -0
  132. package/src/content/toc.module.css +6 -3
  133. package/src/dashboard/delta-badge.tsx +10 -4
  134. package/src/dashboard/empty-state.tsx +3 -16
  135. package/src/dashboard/settings-section.module.css +2 -2
  136. package/src/dashboard/settings-section.tsx +2 -2
  137. package/src/dashboard/stat-card.tsx +2 -2
  138. package/src/data/virtual-list.tsx +12 -2
  139. package/src/forms/FormErrorSummary.tsx +1 -1
  140. package/src/guard/check-source.test.ts +483 -15
  141. package/src/guard/index.ts +426 -47
  142. package/src/guard/types.ts +24 -2
  143. package/src/index.ts +1 -0
  144. package/src/provider/index.test.tsx +100 -0
  145. package/src/provider/index.tsx +79 -7
  146. package/src/provider/lab-theme.test.ts +147 -0
  147. package/src/provider/lab-theme.ts +166 -0
  148. package/src/shell/app-header.module.css +2 -2
  149. package/src/shell/app-mobile-nav.module.css +1 -1
  150. package/src/shell/app-sidebar-account.tsx +9 -2
  151. package/src/shell/app-sidebar.module.css +36 -26
  152. package/src/shell/app-sidebar.tsx +12 -2
  153. package/src/shell/index.tsx +14 -3
  154. package/src/shell/sidebar-search.module.css +16 -4
  155. package/src/styles.css +22 -11
  156. package/src/surfaces.ts +24 -10
  157. package/src/theme/contrast.test.ts +19 -3
  158. package/src/theme/controls.module.css +1 -1
  159. package/src/theme/density-option.test.ts +96 -0
  160. package/src/theme/density-relations.test.ts +428 -0
  161. package/src/theme/derive-theme.test.ts +101 -0
  162. package/src/theme/floating.module.css +1 -1
  163. package/src/theme/fonts-option.test.ts +69 -0
  164. package/src/theme/index.ts +930 -563
  165. package/src/theme/nav-link.module.css +1 -1
  166. package/src/theme/radius-option.test.ts +86 -0
  167. package/src/theme/radius.test.ts +132 -0
  168. package/src/theme/spacing.test.ts +432 -0
  169. package/src/theme/use-basalt-spacing.test.tsx +51 -0
  170. package/src/theme/use-basalt-spacing.ts +38 -0
  171. package/src/theme-lab/derive-controls.test.ts +94 -0
  172. package/src/theme-lab/derive-controls.tsx +227 -0
  173. package/src/theme-lab/derive-state.test.ts +71 -0
  174. package/src/theme-lab/derive-state.ts +163 -0
  175. package/src/theme-lab/index.tsx +29 -68
  176. package/src/theme-lab/theme-lab.test.ts +4 -18
  177. package/src/theme-toggle/index.tsx +9 -4
  178. package/src/tokens/build-fonts-css.test.ts +51 -0
  179. package/src/tokens/build-radius-css.test.ts +25 -0
  180. package/src/tokens/density.test.ts +274 -0
  181. package/src/tokens/derive-radius.test.ts +62 -0
  182. package/src/tokens/derive.test.ts +30 -0
  183. package/src/tokens/derive.ts +481 -0
  184. package/src/tokens/hct.ts +231 -0
  185. package/src/tokens/index.ts +534 -48
  186. package/src/tokens/palette.test.ts +114 -0
  187. package/src/tokens/palette.ts +1118 -180
  188. package/src/vite-color-mix.test.ts +46 -0
  189. package/src/vite-color-mix.ts +137 -0
  190. package/src/vite.test.ts +192 -0
  191. package/src/vite.ts +502 -1
package/AGENTS.md CHANGED
@@ -11,8 +11,8 @@ Toolchain: Bun runtime, oxlint + oxfmt, conventional commits (empty scope), `mas
11
11
  | `basalt-ui` | mantine-coupled | BasaltProvider, createBasaltTheme, BasaltShell + sidebar/mobile-nav/breadcrumbs, NavCountBadge, ThemeToggle, ThreadWorkspace + thread-chat components, dashboard composites (DeltaBadge, StatCard, EmptyState, SettingsSection/SettingsRow/DangerZone) |
12
12
  | `basalt-ui/charts` | headless | visx chart primitives, sparklines, hooks, and token re-exports (Mantine-free) |
13
13
  | `basalt-ui/tokens` | headless | VX token refs, buildPaletteCss, defineSeries, seriesTokens, groupTokens, alpha (Mantine-free) |
14
- | `basalt-ui/theme-lab` | mantine-coupled | ThemeLabControls, applyOverrides, COLOR_GROUPS for live theme inspection |
15
- | `basalt-ui/vite` | mantine-coupled | basaltViteConfig(opts) — Vite preset for basalt-ui consumer apps |
14
+ | `basalt-ui/theme-lab` | mantine-coupled | ThemeLabControls, applyOverrides, COLOR_GROUPS — a low-level inspector for the non-derived structural tokens; identity/color tuning lives in DeriveControls |
15
+ | `basalt-ui/vite` | mantine-coupled | basaltViteConfig(opts) — Vite preset for basalt-ui consumer apps; basaltAppPlugin(opts) — PWA head, manifest, and icon metadata derived from the token palette |
16
16
  | `basalt-ui/guard` | headless | checkSource, GUARD_RULES, Finding types — the headless theme-guard core |
17
17
  | `basalt-ui/query` | headless | createBasaltQueryClient, transport-agnostic unwrap, lazy BasaltQueryDevtools |
18
18
  | `basalt-ui/router-tanstack` | headless | TanStack Router bridge: useBasaltNav (active route) + useRouterBreadcrumbs + createSearchParamStore (single-select URL-state store) + createMultiSearchParamStore (multi-select URL-state store) |
package/CHANGELOG.md CHANGED
@@ -1,3 +1,49 @@
1
+ # [1.3.0](https://github.com/jkrumm/basalt-ui/compare/v1.2.0...v1.3.0) (2026-07-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * realign the spacing guard with the retuned scale and CSS reality ([dc6918a](https://github.com/jkrumm/basalt-ui/commit/dc6918a8e5753ce6b5ebb187ccc97421293a0014))
7
+ * stop styles.css reaching past the framework's own chrome ([24f66dc](https://github.com/jkrumm/basalt-ui/commit/24f66dc0e0bb9bd8386235ee3a9e2974eb6b452c))
8
+
9
+
10
+ ### Features
11
+
12
+ * add a core-only spacing emission mode to buildPaletteCss ([1a3d59b](https://github.com/jkrumm/basalt-ui/commit/1a3d59bb1558bb66771d3a51295993ab18084015))
13
+ * let buildPaletteCss target a custom color-scheme selector ([944a674](https://github.com/jkrumm/basalt-ui/commit/944a674c02a47b32c6badf7a2e000e4b0ccb26b3))
14
+ * make the react and mantine peers optional ([841f88f](https://github.com/jkrumm/basalt-ui/commit/841f88fdfed2ba946a72921b231bcdc427af173c))
15
+ * ship a prebuilt tokens.css and a tokens:css subcommand ([b23aca3](https://github.com/jkrumm/basalt-ui/commit/b23aca32b81cf4c9d580562cfc46b89a9c5a38da))
16
+
17
+ # [1.2.0](https://github.com/jkrumm/basalt-ui/compare/v1.1.1...v1.2.0) (2026-07-27)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * let styles-block radii follow the dev radius slider ([81f0318](https://github.com/jkrumm/basalt-ui/commit/81f0318ede0fe60f8f95c89481090c7de990bfe2))
23
+ * make the raw-surface guard token-aware ([0deab9a](https://github.com/jkrumm/basalt-ui/commit/0deab9a24fcaae643419f89d075a103e6c078b97))
24
+ * make the virtual-list skeleton density-aware and lock the space var set ([f6fbde6](https://github.com/jkrumm/basalt-ui/commit/f6fbde634d2b1795d3a3f5cf3d3149b1eadac793))
25
+ * respect Vite's base when emitting app URLs ([488fe0c](https://github.com/jkrumm/basalt-ui/commit/488fe0cb39fa7dbd3d29d985aa264767fb952a0d))
26
+ * strip comments before the theme guard scans ([ac5e81d](https://github.com/jkrumm/basalt-ui/commit/ac5e81d414d7cfb290bd598f60bed1335f86234c))
27
+
28
+
29
+ ### Features
30
+
31
+ * add basaltAppPlugin for PWA head, manifest, and icon metadata ([cef0114](https://github.com/jkrumm/basalt-ui/commit/cef0114e85f7d2107c640bdfb24978e6b0d29d40))
32
+ * add fonts option and derive legendText ([82a6af3](https://github.com/jkrumm/basalt-ui/commit/82a6af3eaba65ad86dcf18ec3aa94f8d798b3d4e))
33
+ * add per-rule path exemptions to the theme guard ([5f085bb](https://github.com/jkrumm/basalt-ui/commit/5f085bb2ae919f09fafac473818cb3874704d5b1))
34
+ * add the density knob to the theme config ([e992638](https://github.com/jkrumm/basalt-ui/commit/e992638b5897b8a7a12d4c142aad513bff6d0ca9))
35
+ * add the radius knob to the theme config ([3207e8a](https://github.com/jkrumm/basalt-ui/commit/3207e8a8b3e4c718e815fa9a1dd5f2540f88ffbc))
36
+ * derive the palette from one accent seed ([bc6fe31](https://github.com/jkrumm/basalt-ui/commit/bc6fe31e892f626e48f3dc60ff5351fa5805ace1))
37
+ * dogfood the inline-display and raw-html-layout guards ([4844f62](https://github.com/jkrumm/basalt-ui/commit/4844f62db7a2762c2c40973c2b612fecc33031b9))
38
+ * dogfood the inline-spacing guard on the package ([583e18c](https://github.com/jkrumm/basalt-ui/commit/583e18c21c12ba0858b9d31ef7fc433c127bc2fd))
39
+ * dogfood the raw-spacing guard on the package ([c9a2cf9](https://github.com/jkrumm/basalt-ui/commit/c9a2cf9f7bfd6cfd2a284cf1ec57295c55ad6f14))
40
+ * dogfood the raw-surface guard on the package ([b70a29a](https://github.com/jkrumm/basalt-ui/commit/b70a29aa048227fa048c0acdfc0847a69d9f9f5b))
41
+ * embed DeriveControls in playground settings ([8439aa1](https://github.com/jkrumm/basalt-ui/commit/8439aa1b8b94409d2c1047ccf697aceec4068b40))
42
+ * make the theme lab move the theme object, not just CSS vars ([1eb4257](https://github.com/jkrumm/basalt-ui/commit/1eb4257a9525094b386f80699e8282c53982e974))
43
+ * mention the radius knob in the Derive panel copy ([7a1b064](https://github.com/jkrumm/basalt-ui/commit/7a1b064c548f98143350d366696eb1f7ab8e6b6f))
44
+ * scan CSS modules in the theme guard ([2b0d9d4](https://github.com/jkrumm/basalt-ui/commit/2b0d9d433917ef5bcc55d0400e76de50f622c526))
45
+ * tighten the sidebar, open up components — retune the level-0 spacing bases ([8b6119a](https://github.com/jkrumm/basalt-ui/commit/8b6119aa601793f8947302288d02cfb1803dc1b8))
46
+
1
47
  ## [1.1.1](https://github.com/jkrumm/basalt-ui/compare/v1.1.0...v1.1.1) (2026-07-17)
2
48
 
3
49
 
package/README.md CHANGED
@@ -22,13 +22,26 @@ bun add basalt-ui
22
22
  bun add react react-dom @mantine/core @mantine/hooks @tanstack/react-query
23
23
  ```
24
24
 
25
- Peer requirements: `react` / `react-dom` `^19`, `@mantine/core` + `@mantine/hooks` `^9.3`,
26
- `@tanstack/react-query` (`BasaltProvider` hard-requires it at build time). Bun auto-installs
27
- peers, but pnpm/npm consumers must add it explicitly or hit an unexplained build failure.
25
+ The root `.` entry needs all five: `react` / `react-dom` `^19`, `@mantine/core` +
26
+ `@mantine/hooks` `^9.3`, and `@tanstack/react-query` (`BasaltProvider` hard-requires it at build
27
+ time). **Install them yourself — every peer is declared `optional`**, so no package manager adds
28
+ them for you and a missing one surfaces as an unresolved import when you build, not as a warning
29
+ when you install. That optionality is what lets the Mantine-free subpaths cost nothing (below);
30
+ version mismatches on an installed peer still warn.
28
31
 
29
32
  A real app also needs `@types/react @types/react-dom` (dev) and a standard Vite `vite-env.d.ts`
30
33
  for `tsc --noEmit` to pass.
31
34
 
35
+ **No React?** `./tokens`, `./charts`, `./state` and `./guard` resolve with none of the five
36
+ installed, and the token system is consumable with no package at all:
37
+
38
+ ```bash
39
+ bunx basalt-ui tokens:css --selector-attribute data-theme --only core --out src/tokens.css
40
+ ```
41
+
42
+ See [`docs/FRAMEWORK-FREE.md`](https://github.com/jkrumm/basalt-ui/blob/master/docs/FRAMEWORK-FREE.md)
43
+ for the selector-specificity trap, the `color-mix` opacity law, and the surface-token roles.
44
+
32
45
  ### 2. Scaffold the repo doctrine (`basalt-ui init`)
33
46
 
34
47
  ```bash
@@ -38,7 +51,7 @@ bunx basalt-ui init
38
51
  That's the whole install — there is no plugin, no marketplace, and no second version to track.
39
52
  `init` writes into the consumer repo:
40
53
 
41
- - `.claude/rules/basalt-*.md` — twelve Claude Code rules (`basalt-tokens`, `basalt-charts`, `basalt-mantine`, `basalt-router`, `basalt-query`, `basalt-state`, `basalt-forms`, `basalt-notifications`, `basalt-commands`, `basalt-data`, `basalt-agent`, `basalt-content`)
54
+ - `.claude/rules/basalt-*.md` — thirteen Claude Code rules (`basalt-tokens`, `basalt-charts`, `basalt-mantine`, `basalt-router`, `basalt-query`, `basalt-state`, `basalt-forms`, `basalt-notifications`, `basalt-commands`, `basalt-data`, `basalt-agent`, `basalt-content`, `basalt-app`)
42
55
  - `.claude/skills/basalt-{app,design,charts}/SKILL.md` — the three skills (`/basalt-app`, `/basalt-design`, `/basalt-charts`), same managed path as the rules
43
56
  - A managed `<!-- basalt:begin/end -->` block in `CLAUDE.md` — stack facts, the DESIGN.md pointer, and the frontend-design restraint override
44
57
  - A thin `DESIGN.md` seed — your app's deltas (series dictionary, identity, deviations)
@@ -93,6 +106,24 @@ createRoot(document.getElementById('root')!).render(
93
106
  > `@mantine/spotlight/styles.layer.css` if you install those optional-peer batteries
94
107
  > (`./notifications` / `./commands` — see [Adapter batteries](#adapter-batteries) below).
95
108
 
109
+ ### Theming
110
+
111
+ The shipped palette isn't a fixed set of hexes — it's **generated** from one accent seed + five
112
+ bounded knobs, with contrast guaranteed by derivation rather than hand-tuning:
113
+
114
+ ```ts
115
+ const theme = createBasaltTheme(
116
+ {
117
+ /* app deltas only */
118
+ },
119
+ { derive: { accent: '#7c3aed', neutral: 'zinc', vibrancy: 1 } },
120
+ )
121
+ ```
122
+
123
+ `derive` accepts `accent` (hex seed), `neutral` (`'zinc' | 'neutral' | 'stone' | 'slate'`), and
124
+ `lightLevel` / `darkLevel` / `vibrancy` / `accentBrightness` (`-5..5`, all optional — omitted knobs
125
+ keep the shipped default). Never hand-edit a palette hex to retune the identity.
126
+
96
127
  `BasaltOverlays` (from `basalt-ui/commands`) is the composable overlay mount: it bundles
97
128
  `ModalsProvider`, `Spotlight`, and `Notifications` into a single mount point and replaces a
98
129
  standalone `<BasaltNotifications />`. `paletteOptions={{ groups: paletteGroups }}` emits your
@@ -113,11 +144,19 @@ import type { SidebarSection } from 'basalt-ui'
113
144
 
114
145
  ```ts
115
146
  // vite.config.ts
116
- import { basaltViteConfig } from 'basalt-ui/vite'
147
+ import react from '@vitejs/plugin-react'
148
+ import { basaltAppPlugin, basaltViteConfig } from 'basalt-ui/vite'
149
+ import { defineConfig } from 'vite'
117
150
 
118
- export default basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' })
151
+ export default defineConfig({
152
+ ...basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' }),
153
+ plugins: [react(), ...basaltAppPlugin({ name: 'MyApp', description: '…' })],
154
+ })
119
155
  ```
120
156
 
157
+ `basaltViteConfig` stays config-only (no `plugins`, by contract); `basaltAppPlugin` is the plugin
158
+ half — see the `./vite` adapter battery under [Adapter batteries](#adapter-batteries) below.
159
+
121
160
  > **Local consumption (sibling checkouts).** Developing against an unpublished / `file:`-linked
122
161
  > basalt-ui from a sibling repo? Build `dist/` first — `bunx basalt-ui` always resolves
123
162
  > `bin/basalt-ui.mjs` → `dist/cli/index.js`, even though the _runtime_ import can ride
@@ -158,7 +197,7 @@ scanned files. Other `"basalt"` config keys (`exempt`,
158
197
  | `./charts` | **free** | visx chart primitives, sparklines, hooks, and token re-exports |
159
198
  | `./tokens` | **free** | `VX` token refs, `buildPaletteCss`, `defineSeries`, `seriesTokens`, `groupTokens`, `alpha`, `ColorPair` / `SeriesMap` types |
160
199
  | `./theme-lab` | coupled | `ThemeLabControls`, `applyOverrides`, `loadOverrides`, `COLOR_GROUPS` for live theme inspection |
161
- | `./vite` | — | `basaltViteConfig(opts)` — Vite preset for basalt-ui consumer apps |
200
+ | `./vite` | — | `basaltViteConfig(opts)` — Vite preset for basalt-ui consumer apps; `basaltAppPlugin(opts)` — PWA head, manifest, and icon metadata derived from the token palette |
162
201
  | `./guard` | **free** | `checkSource`, `GUARD_RULES`, `Finding` types — the headless theme-guard core |
163
202
  | `./query` | **free** | `createBasaltQueryClient`, transport-agnostic `unwrap`, lazy `BasaltQueryDevtools` |
164
203
  | `./router-tanstack` | **free** | TanStack Router bridge: `useBasaltNav` (active route) + `useRouterBreadcrumbs` |
@@ -173,6 +212,7 @@ scanned files. Other `"basalt"` config keys (`exempt`,
173
212
  | `./connectivity` | coupled | `ConnectivityProvider` (aggregates browser/React-Query/SSE/health-check status), `useConnectivity`, `ConnectivityIndicator` — auto-mounted by `BasaltProvider` |
174
213
  | `./content` | coupled | `Prose`, `CodeBlock`, `Callout`, `TableOfContents`, `ReadingProgress`, `Markdown`, `MermaidDiagram`, `ArticleLayout`, `ArticleCard` / `ArticleGrid`, `GuideLink` / `GuideDrawer`, `mdxComponents` |
175
214
  | `./styles.css` | — | `@layer basalt` base styles, iOS input safety net, font stack |
215
+ | `./tokens.css` | **free** | Prebuilt `--vx-*` stylesheet — the default `buildPaletteCss()` output as a plain file, for a consumer with no bundler, React or Mantine; `basalt-ui tokens:css` re-emits it with a custom scheme selector |
176
216
  | `./configs/*` | — | Raw toolchain presets — oxlint, oxfmt, tsconfig (base/react-app/node), lefthook |
177
217
  | `./llms.txt` | — | Machine-readable surface map — one entry per published subpath with import specifier, description, layer, and optional peers |
178
218
 
@@ -428,6 +468,22 @@ function Inbox() {
428
468
  distilled `{ title, summary }` outcome, never the raw prompt or thinking. See
429
469
  `agent/rules/basalt-agent.md` for the full doctrine.
430
470
 
471
+ ### `./vite` — PWA / head metadata (optional peer)
472
+
473
+ `basaltAppPlugin` (see [Wire the runtime](#wire-the-runtime) above) needs no install by default —
474
+ its `serviceWorker` option is the only part with an optional peer, and it's `false` unless you opt
475
+ in:
476
+
477
+ ```bash
478
+ bun add -D vite-plugin-pwa workbox-build workbox-window # only if serviceWorker is enabled
479
+ ```
480
+
481
+ Without the peer installed, `serviceWorker: true` degrades to a one-line console warning (no
482
+ service worker, no crash) — everything else (theme-color meta, anti-FOUC background,
483
+ `site.webmanifest`, favicon/apple-touch-icon links, OG/Twitter defaults) works with zero extra
484
+ dependencies. Full doctrine, plugin ordering, and the bring-your-own icon filenames:
485
+ `agent/rules/basalt-app.md`.
486
+
431
487
  ---
432
488
 
433
489
  ## Type seam (`BasaltRegister`)
@@ -460,7 +516,7 @@ bunx basalt-ui init # scaffold doctrine into a consumer repo
460
516
  bunx basalt-ui sync # three-way diff against .basalt/manifest.json after a basalt-ui upgrade
461
517
  bunx basalt-ui sync --check # CI drift gate — non-zero exit on any managed-file drift
462
518
  bunx basalt-ui check-theme # palette guard — fails on colors that bypass the central --vx-* system
463
- bunx basalt-ui doctor # check consumer repo basalt integration health (manifest + one version axis: node_modules vs manifest)
519
+ bunx basalt-ui doctor # check consumer repo basalt integration health (manifest + one version axis: node_modules vs manifest) + warn on missing basaltAppPlugin icon files under public/
464
520
  bunx basalt-ui info # human-readable surface map: subpath, layer, rule, skills, optional peers
465
521
  bunx basalt-ui info --json # same map as stable JSON (InfoOutput shape)
466
522
  ```
@@ -0,0 +1,126 @@
1
+ ---
2
+ source: basalt-ui
3
+ description: App bootstrapping for basalt-ui consumers — composing basaltViteConfig + basaltAppPlugin in vite.config.ts, plugin ordering, the required Mantine CSS layer order, and the PWA/favicon/manifest surface (bring-your-own icons, opt-in serviceWorker).
4
+ paths:
5
+ - 'vite.config.ts'
6
+ - 'apps/**/vite.config.ts'
7
+ - 'index.html'
8
+ - 'apps/**/index.html'
9
+ - 'src/main.tsx'
10
+ - 'apps/**/src/main.tsx'
11
+ ---
12
+
13
+ # Basalt App — Bootstrapping & Vite Config
14
+
15
+ `basalt-ui/vite` ships two entry points with a deliberate split: `basaltViteConfig` is **config
16
+ only**, `basaltAppPlugin` is the **plugin** half. This rule covers composing them, where
17
+ `basaltAppPlugin` sits relative to other plugins, and the head/PWA/manifest surface it generates.
18
+
19
+ ## Composing the vite config
20
+
21
+ ```ts
22
+ // vite.config.ts
23
+ import react from '@vitejs/plugin-react'
24
+ import { basaltAppPlugin, basaltViteConfig } from 'basalt-ui/vite'
25
+ import { defineConfig } from 'vite'
26
+
27
+ export default defineConfig({
28
+ ...basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' }),
29
+ plugins: [react(), ...basaltAppPlugin({ name: 'MyApp', description: '…' })],
30
+ })
31
+ ```
32
+
33
+ `basaltAppPlugin(opts)` returns `PluginOption[]` (a Vite plugin array, not a single plugin) — spread
34
+ it into your own `plugins` array with `...basaltAppPlugin({...})`, same as any other Vite plugin
35
+ that ships more than one plugin instance.
36
+
37
+ `basaltViteConfig` **never returns `plugins`** and never will — it stays config-only by contract.
38
+ Plugins carry app-specific concerns (router codegen, PWA, `react-compiler` babel options) that don't
39
+ belong in a shared, app-agnostic spine; keeping them out of `basaltViteConfig` means adopting the
40
+ preset never silently injects a plugin you didn't ask for, and `basaltAppPlugin` can be adopted (or
41
+ skipped) independently of the rest of the preset.
42
+
43
+ ## Plugin ordering
44
+
45
+ `basaltAppPlugin`'s hooks (`transformIndexHtml`, `generateBundle`, `configureServer`) don't
46
+ generate a virtual module another plugin resolves against — unlike
47
+ `@content-collections/vite`, whose plugin-ordering rule (agent/rules/basalt-content.md) requires
48
+ `contentCollections()` to run FIRST because it generates the virtual `content-collections` module
49
+ other plugins/transforms may depend on. `basaltAppPlugin` has no equivalent requirement, so when
50
+ composing both:
51
+
52
+ ```ts
53
+ plugins: [
54
+ contentCollections(), // FIRST — see basalt-content.md
55
+ react(), // or tanstackStart()
56
+ ...basaltAppPlugin({ name: 'MyApp' }), // position is free — see below
57
+ ]
58
+ ```
59
+
60
+ Position is a readability convention here, not a correctness requirement — including with
61
+ `serviceWorker` enabled. `vite-plugin-pwa` expands to five plugins that **self-order** via
62
+ `enforce` (`vite-plugin-pwa` is `enforce: 'pre'`; `:build`, `:info` and `:pwa-assets` are
63
+ `enforce: 'post'`), and Vite sorts by `enforce` before array position. Its precache manifest is
64
+ built in `closeBundle`, where `workbox-build` globs the **output directory on disk** — every other
65
+ plugin's transforms and emits have already landed there. So no ordering relationship exists between
66
+ `basaltAppPlugin` and `react()`/`tanstackStart()`.
67
+
68
+ The one real caveat is a plugin that **emits files from its own `closeBundle`**: if it runs after
69
+ `vite-plugin-pwa`'s, those files are written too late to be precached (the `rollup-plugin-copy`
70
+ class of bug). `vite-plugin-pwa` exposes `integration.closeBundleOrder` to sequence against it.
71
+
72
+ ## CSS layer order (Mantine)
73
+
74
+ `basalt-ui/styles.css` must load AFTER every `@mantine/*/styles.layer.css` bundle — the layered
75
+ bundles order `@layer mantine, basalt` so basalt's rules (including the iOS 16px input floor) win;
76
+ an unlayered Mantine import outranks `@layer basalt` regardless of specificity. In `main.tsx`:
77
+
78
+ ```ts
79
+ import '@mantine/core/styles.layer.css'
80
+ // ...other @mantine/*/styles.layer.css bundles for any batteries you install
81
+ import 'basalt-ui/styles.css'
82
+ ```
83
+
84
+ ## Head, manifest, and icons — bring your own
85
+
86
+ `basaltAppPlugin` injects dual `theme-color` tags (light/dark media queries) and an anti-FOUC inline
87
+ `<style>` background, both resolved from the `SURFACE.bg` token — never hand-compute these hexes,
88
+ they track the palette automatically. It also injects the `apple-mobile-web-app-*` /
89
+ `mobile-web-app-capable` meta set, a `darkreader-lock` meta (default on), a viewport tag with
90
+ `viewport-fit=cover` (skipped when the consumer's own `index.html` already declares one), and
91
+ site-wide OG/Twitter defaults from `options.seo`.
92
+
93
+ Icons are **bring-your-own** — basalt-ui takes no `sharp`/image-processing dependency. The plugin
94
+ expects these filenames under `public/` (or `icons.dir` if customized):
95
+
96
+ ```text
97
+ favicon.ico
98
+ favicon.svg
99
+ favicon-96x96.png
100
+ apple-touch-icon.png
101
+ web-app-manifest-192x192.png
102
+ web-app-manifest-512x512.png
103
+ ```
104
+
105
+ Generate the set with `@vite-pwa/assets-generator` (or realfavicongenerator.net) from a single
106
+ source image — it lives in the CONSUMER's own devDependencies, not basalt-ui's. `basalt-ui doctor`
107
+ warns (does not fail) when `public/` exists but is missing one of these files.
108
+
109
+ `basaltAppPlugin` also emits `site.webmanifest` (served in dev too) with explicit `id`/`scope`/
110
+ `start_url` — pass `manifest: false` to skip it, or `icons: false` to skip the icon `<link>` tags
111
+ without touching the manifest.
112
+
113
+ ## Service worker (opt-in)
114
+
115
+ `serviceWorker` defaults to `false` — no service worker unless you ask for it. `true` composes the
116
+ optional peer `vite-plugin-pwa` with argo-derived workbox defaults (`autoUpdate` registration,
117
+ `cleanupOutdatedCaches`, a `/index.html` navigate fallback that denies `/api/*`); pass an object to
118
+ deep-merge overrides on top. When the peer (plus its own peers `workbox-build`/`workbox-window`) is
119
+ not installed, the plugin degrades to a one-line console warning — no service worker, no throw:
120
+
121
+ ```bash
122
+ bun add -D vite-plugin-pwa workbox-build workbox-window
123
+ ```
124
+
125
+ `basaltAppPlugin` always emits its own `site.webmanifest` — `serviceWorker`'s `manifest: false` is
126
+ baked into the defaults so `vite-plugin-pwa` never emits a competing one.
@@ -284,7 +284,9 @@ bun add -D @content-collections/core @content-collections/vite @content-collecti
284
284
 
285
285
  **`vite.config.ts`** — the content-collections vite plugin MUST precede every other plugin (it
286
286
  generates the virtual `content-collections` module other plugins/transforms may depend on).
287
- TanStack Start (`>= 1.121`) wires it the same way:
287
+ TanStack Start (`>= 1.121`) wires it the same way. This ordering holds regardless of what else is in
288
+ the `plugins` array — see `agent/rules/basalt-app.md` for where `basaltAppPlugin` sits relative to
289
+ it:
288
290
 
289
291
  ```ts
290
292
  import { defineConfig } from 'vite'
@@ -93,10 +93,12 @@ Popover, Accordion, cards) renders one border shade, one card background, and on
93
93
 
94
94
  ## Spacing & radius — prefer the scale token
95
95
 
96
- - `baseTheme` owns the scales: `spacing` 10/12/16/20/32 → `xs…xl`, `radius` 2/4/8/16/32 → `xs…xl`.
97
- **Use the token**, not the raw number, when a value equals a step: `p="md"` not `p={16}`,
98
- `gap="sm"` not `gap={12}`, `radius="sm"` not `radius={4}`. The guard flags exact token-equals
99
- (`p={16}`, any numeric `radius`).
96
+ - `baseTheme` owns the scales: `spacing` 11/13/18/20/26 → `xs…xl`, `radius` 2/4/6/16/32 → `xs…xl`.
97
+ Both are DERIVED — `deriveSpacing(level)` / `deriveRadius(level)` in `tokens/palette.ts` move them
98
+ with `createBasaltTheme`'s `density` / `radius` knobs, so read the numbers as level-0 values, not
99
+ as constants. **Use the token**, not the raw number, when a value equals a step: `p="md"` not
100
+ `p={18}`, `gap="sm"` not `gap={13}`, `radius="sm"` not `radius={4}`. The guard flags exact
101
+ token-equals (`p={18}`, any numeric `radius`).
100
102
  - **Card radius has one source: `--vx-radius-card` (7px) = `VX.radiusCard`.** Every
101
103
  card corner — the Mantine chrome (`Card`/`Paper`, `radius="md"`) and the Mantine-free `ChartCard`
102
104
  (`var(--vx-radius-card)`) — resolves to this single token; cards must never diverge. Don't inline
@@ -105,8 +107,15 @@ Popover, Accordion, cards) renders one border shade, one card background, and on
105
107
  spacing step (`sm`/`xs`) for shell, nav, and card padding rather than `md`/`lg` air (see
106
108
  basalt-mantine.md for the shipped dense defaults).
107
109
  - **Sub-scale micro-spacing is legitimate and allowed raw** — `gap={2}`, `pl={4}`, `mt={6}` have no
108
- token equivalent (the scale starts at 10). Use them freely for tight clusters; don't invent
110
+ token equivalent (the scale starts at 11). Use them freely for tight clusters; don't invent
109
111
  micro-tokens or pepper `theme-allow`. One-off layout dims (`h={36}`, `w={64}`) are also fine raw.
112
+ **The same permission holds in CSS modules**, where it has to be enforced differently: there is no
113
+ prop form to prefer, so `inline-spacing` simply does not fire on a declaration whose every literal
114
+ is ≤ 10px (`gap: 2px`, `padding: 4px 8px`). A `var()` component is dropped before that judgement;
115
+ one non-micro value makes the whole declaration a finding (`padding: 4px 16px` flags). Other units
116
+ are out — the doctrine is px, so `padding: 1.5rem` still flags. An inline style OBJECT in TSX
117
+ (`style={{ padding: 4 }}`) also still flags: there the Mantine prop exists and should have been
118
+ used.
110
119
  - **Icons** size via the icon's own `size` prop (`size={16}`), not spacing tokens — that's not spacing.
111
120
 
112
121
  ## Type
@@ -36,10 +36,10 @@ own the files.
36
36
 
37
37
  `init` writes the repo-side doctrine and toolchain into a consumer (monorepo globs supported):
38
38
 
39
- - `.claude/rules/basalt-*.md` — the twelve shipped rules (`basalt-tokens`, `basalt-charts`,
39
+ - `.claude/rules/basalt-*.md` — the thirteen shipped rules (`basalt-tokens`, `basalt-charts`,
40
40
  `basalt-mantine`, `basalt-router`, `basalt-query`, `basalt-state`, `basalt-forms`,
41
- `basalt-notifications`, `basalt-commands`, `basalt-data`, `basalt-agent`, `basalt-content`),
42
- managed verbatim.
41
+ `basalt-notifications`, `basalt-commands`, `basalt-data`, `basalt-agent`, `basalt-content`,
42
+ `basalt-app`), managed verbatim.
43
43
  - `.claude/skills/basalt-{app,charts,design}/SKILL.md` — the three skills (`/basalt-app`,
44
44
  `/basalt-charts`, `/basalt-design`), managed verbatim, same path the rules take.
45
45
  - A managed `<!-- basalt:begin --> ... <!-- basalt:end -->` block in `CLAUDE.md`: stack facts, the
@@ -73,11 +73,22 @@ const theme = createBasaltTheme({
73
73
  ```
74
74
 
75
75
  ```ts
76
- // vite.config.ts — the shipped preset (dedupe react + @mantine/*, strictPort, /api proxy, BASALT_LOCAL alias)
77
- import { basaltViteConfig } from 'basalt-ui/vite'
78
- export default basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' })
76
+ // vite.config.ts — basaltViteConfig (dedupe react + @mantine/*, strictPort, /api proxy,
77
+ // BASALT_LOCAL alias) composed with basaltAppPlugin (PWA head, manifest, icon metadata)
78
+ import react from '@vitejs/plugin-react'
79
+ import { basaltAppPlugin, basaltViteConfig } from 'basalt-ui/vite'
80
+ import { defineConfig } from 'vite'
81
+
82
+ export default defineConfig({
83
+ ...basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' }),
84
+ plugins: [react(), ...basaltAppPlugin({ name: 'MyApp', description: '…' })],
85
+ })
79
86
  ```
80
87
 
88
+ `basaltViteConfig` stays config-only (no `plugins`) by contract; `basaltAppPlugin` is the plugin
89
+ half — spread it into your own `plugins` array. See `agent/rules/basalt-app.md` for plugin
90
+ ordering (e.g. alongside `@content-collections/vite`) and the full head/PWA/manifest surface.
91
+
81
92
  ```js
82
93
  // Tailwind era is over — there is no Tailwind. Styles come from:
83
94
  import 'basalt-ui/styles.css' // @layer basalt base styles, iOS input safety net, font stack
@@ -120,7 +131,13 @@ both.
120
131
  - `BasaltProvider` wraps the app; `createBasaltTheme` used for theme deltas; `basalt-ui/styles.css`
121
132
  imported.
122
133
  - `basaltViteConfig` adopted; `oxlint . && basalt-ui check-theme` is the lint command.
123
- - A thin `DESIGN.md` (deltas) + the twelve `basalt-*` rules + the managed CLAUDE block are present.
134
+ - `basaltAppPlugin` composed into `plugins` (see the vite.config.ts snippet above); icon files
135
+ (`favicon.ico`, `favicon.svg`, `favicon-96x96.png`, `apple-touch-icon.png`,
136
+ `web-app-manifest-192x192.png`, `web-app-manifest-512x512.png`) generated and placed under
137
+ `public/` — `basalt-ui doctor` warns if any are missing.
138
+ - `site.webmanifest` is emitted by `basaltAppPlugin` — no manual manifest file needed unless
139
+ `manifest: false` was passed.
140
+ - A thin `DESIGN.md` (deltas) + the thirteen `basalt-*` rules + the managed CLAUDE block are present.
124
141
  - `<first basalt.root>/lib/series.ts` exists as the one guard-exempt series source (for any app metric colors).
125
142
  - `basalt-ui sync --check` wired in CI (recommended) to catch drift on future upgrades.
126
143
 
@@ -136,3 +153,7 @@ both.
136
153
  animated chrome (`ThemeToggle` today) comes for free, no consumer dependency needed. Reach for
137
154
  the shared `MOTION_DURATION` / `MOTION_SPRING` tokens for any new animated interaction rather
138
155
  than inventing ad hoc durations/easings or a competing animation library.
156
+ - `vite-plugin-pwa` (`^1.3.0`) is an OPTIONAL peer, only needed when `basaltAppPlugin`'s
157
+ `serviceWorker` option is truthy — omit it entirely for apps that don't want an installable/
158
+ offline-capable app. See `agent/rules/basalt-app.md` for the full head/PWA/manifest/icons
159
+ surface `basaltAppPlugin` owns.
@@ -1 +1 @@
1
- {"version":3,"file":"part-list.d.ts","sourceRoot":"","sources":["../../src/agent/part-list.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAGhC,OAAO,KAAK,EACV,SAAS,EAMV,MAAM,SAAS,CAAA;AAIhB,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI,CAAC,KAAK,EAAE;IAC1E,IAAI,EAAE,OAAO,CAAC,KAAK,E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AAC,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;IAC1C,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAC1C,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAA;CACzC,CAAA;AA4HD,MAAM,MAAM,aAAa,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI;IAC/D,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAA;CACzD,CAAA;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,EAAE,EAC5D,KAAK,EACL,UAAU,GACX,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,CAgEpC"}
@@ -10,13 +10,16 @@ const MICRO_LABEL_STYLE = {
10
10
  textTransform: "uppercase",
11
11
  color: VX.faint
12
12
  };
13
- const RAIL_STYLE = { borderLeft: `2px solid ${VX.divider}`, paddingLeft: 10 };
13
+ const RAIL_STYLE = {
14
+ borderLeft: `2px solid ${VX.divider}`,
15
+ paddingLeft: "var(--vx-space-agent-rail-inset-x)"
16
+ };
14
17
  const CODE_BLOCK_STYLE = {
15
- marginTop: 6,
18
+ marginTop: "var(--vx-space-agent-part-gap-top)",
16
19
  fontFamily: "var(--basalt-font-mono)",
17
20
  backgroundColor: alpha(VX.ink, 0.06),
18
- borderRadius: 8,
19
- padding: 8,
21
+ borderRadius: "var(--vx-radius-card)",
22
+ padding: "var(--vx-space-agent-code-inset)",
20
23
  overflowX: "auto"
21
24
  };
22
25
  function DefaultText({ part }) {
@@ -39,7 +42,14 @@ function DefaultReasoning({ part }) {
39
42
  children: "Reasoning"
40
43
  }
41
44
  ),
42
- /* @__PURE__ */ jsx("div", { className: "basalt-agent-reasoning-body", style: { color: VX.muted, marginTop: 6 }, children: part.text })
45
+ /* @__PURE__ */ jsx(
46
+ "div",
47
+ {
48
+ className: "basalt-agent-reasoning-body",
49
+ style: { color: VX.muted, marginTop: "var(--vx-space-agent-part-gap-top)" },
50
+ children: part.text
51
+ }
52
+ )
43
53
  ] });
44
54
  }
45
55
  function DefaultToolCall({ part }) {
@@ -71,8 +81,8 @@ function DefaultError({ part }) {
71
81
  style: {
72
82
  backgroundColor: alpha(VX.status.bad, 0.13),
73
83
  color: VX.status.bad,
74
- borderRadius: 8,
75
- padding: "8px 10px"
84
+ borderRadius: "var(--vx-radius-card)",
85
+ padding: "var(--vx-space-agent-error-inset-y) var(--vx-space-agent-error-inset-x)"
76
86
  },
77
87
  children: part.message
78
88
  }
@@ -32,8 +32,8 @@ const LazyStickToBottom = lazy(
32
32
  justifyContent: "center",
33
33
  width: 30,
34
34
  height: 30,
35
- margin: "8px auto 0",
36
- borderRadius: 999,
35
+ margin: "var(--vx-space-agent-scroll-button-gap-top) auto 0",
36
+ borderRadius: "var(--vx-radius-pill)",
37
37
  border: "none",
38
38
  cursor: "pointer",
39
39
  backgroundColor: "var(--vx-surface-panel)",
@@ -1 +1 @@
1
- {"version":3,"file":"thread-detail-panel.d.ts","sourceRoot":"","sources":["../../src/agent-chat/thread-detail-panel.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAiDpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,uFAAuF;IACvF,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IACnC,0FAA0F;IAC1F,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAA;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,SAAS,CAAC,EAAE,YAAY,CAA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S,EACT,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,GACR,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAuFtC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { ActionIcon, Alert, Box, Button, Divider, Stack, Text } from "@mantine/core";
2
+ import { ActionIcon, Alert, Box, Button, Divider, Flex, Stack, Text } from "@mantine/core";
3
3
  import { useReducedMotion } from "@mantine/hooks";
4
4
  import { motion } from "motion/react";
5
5
  import { BasaltStickToBottom } from "../agent/index.js";
@@ -44,46 +44,50 @@ function ThreadDetailPanel({
44
44
  const reduceMotion = useReducedMotion();
45
45
  if (thread === null) return /* @__PURE__ */ jsx(EmptyPanel, {});
46
46
  const streaming = runStatus === "streaming";
47
- const panel = /* @__PURE__ */ jsxs(Box, { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
48
- /* @__PURE__ */ jsxs(
49
- Box,
47
+ const panel = /* @__PURE__ */ jsxs(Flex, { direction: "column", h: "100%", children: [
48
+ /* @__PURE__ */ jsxs(Flex, { p: "sm", align: "center", justify: "space-between", children: [
49
+ /* @__PURE__ */ jsx(
50
+ Text,
51
+ {
52
+ fw: 550,
53
+ lineClamp: 1,
54
+ style: {
55
+ fontFamily: "var(--basalt-font-head)",
56
+ fontSize: VX.text.md,
57
+ fontStretch: "88%"
58
+ },
59
+ children: threadLabel(thread)
60
+ }
61
+ ),
62
+ /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "gray", onClick: onClose, "aria-label": "Close thread", children: /* @__PURE__ */ jsx(CloseGlyph, {}) })
63
+ ] }),
64
+ /* @__PURE__ */ jsx(Divider, { color: "var(--vx-divider)" }),
65
+ /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsxs(
66
+ BasaltStickToBottom,
50
67
  {
51
- p: "sm",
52
- style: { display: "flex", alignItems: "center", justifyContent: "space-between" },
68
+ style: {
69
+ height: "100%",
70
+ // theme-allow — BasaltStickToBottom owns this scroll node (see stick-to-bottom.tsx).
71
+ overflowY: "auto",
72
+ padding: "var(--vx-space-agent-transcript-inset)"
73
+ },
53
74
  children: [
54
75
  /* @__PURE__ */ jsx(
55
- Text,
76
+ ThreadTranscript,
56
77
  {
57
- fw: 550,
58
- lineClamp: 1,
59
- style: {
60
- fontFamily: "var(--basalt-font-head)",
61
- fontSize: VX.text.md,
62
- fontStretch: "88%"
63
- },
64
- children: threadLabel(thread)
78
+ messages: thread.messages,
79
+ ...liveParts !== void 0 ? { liveParts } : {},
80
+ ...runStatus !== void 0 ? { liveStatus: runStatus } : {}
65
81
  }
66
82
  ),
67
- /* @__PURE__ */ jsx(ActionIcon, { variant: "subtle", color: "gray", onClick: onClose, "aria-label": "Close thread", children: /* @__PURE__ */ jsx(CloseGlyph, {}) })
83
+ thread.status === "error" && /* @__PURE__ */ jsx(Alert, { color: "red", variant: "light", mt: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", align: "flex-start", children: [
84
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: "This run didn\u2019t finish. Try sending the message again." }),
85
+ onRetry !== void 0 && /* @__PURE__ */ jsx(Button, { size: "compact-sm", variant: "light", color: "red", onClick: onRetry, children: "Retry" })
86
+ ] }) }),
87
+ thread.status === "interrupted" && /* @__PURE__ */ jsx(Alert, { color: "yellow", variant: "light", mt: "md", children: "Interrupted \u2014 resend to continue." })
68
88
  ]
69
89
  }
70
- ),
71
- /* @__PURE__ */ jsx(Divider, { color: "var(--vx-divider)" }),
72
- /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsxs(BasaltStickToBottom, { style: { height: "100%", overflowY: "auto", padding: 16 }, children: [
73
- /* @__PURE__ */ jsx(
74
- ThreadTranscript,
75
- {
76
- messages: thread.messages,
77
- ...liveParts !== void 0 ? { liveParts } : {},
78
- ...runStatus !== void 0 ? { liveStatus: runStatus } : {}
79
- }
80
- ),
81
- thread.status === "error" && /* @__PURE__ */ jsx(Alert, { color: "red", variant: "light", mt: "md", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", align: "flex-start", children: [
82
- /* @__PURE__ */ jsx(Text, { size: "sm", children: "This run didn\u2019t finish. Try sending the message again." }),
83
- onRetry !== void 0 && /* @__PURE__ */ jsx(Button, { size: "compact-sm", variant: "light", color: "red", onClick: onRetry, children: "Retry" })
84
- ] }) }),
85
- thread.status === "interrupted" && /* @__PURE__ */ jsx(Alert, { color: "yellow", variant: "light", mt: "md", children: "Interrupted \u2014 resend to continue." })
86
- ] }) }),
90
+ ) }),
87
91
  /* @__PURE__ */ jsx(Divider, { color: "var(--vx-divider)" }),
88
92
  /* @__PURE__ */ jsx(Box, { p: "sm", children: /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
89
93
  /* @__PURE__ */ jsx(Composer, { onSubmit: onSend, disabled: streaming }),
@@ -1 +1 @@
1
- {"version":3,"file":"thread-message.d.ts","sourceRoot":"","sources":["../../src/agent-chat/thread-message.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,WAAW,EAIX,YAAY,EAGb,MAAM,UAAU,CAAA;AAgGjB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,kBAAkB,CAM3D,CAAA;AAyDD,MAAM,MAAM,qBAAqB,GAAG;IAClC,qDAAqD;IACrD,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;IAChC,4FAA4F;IAC5F,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAA;IAChC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,YAAY,CAAA;CACnC,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,UAAU,GACX,EAAE,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