basalt-ui 1.1.1 → 1.2.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 (188) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +30 -0
  3. package/README.md +47 -5
  4. package/agent/rules/basalt-app.md +126 -0
  5. package/agent/rules/basalt-content.md +3 -1
  6. package/agent/skills/basalt-app/SKILL.md +28 -7
  7. package/dist/agent/part-list.d.ts.map +1 -1
  8. package/dist/agent/part-list.js +17 -7
  9. package/dist/agent/stick-to-bottom.js +2 -2
  10. package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -1
  11. package/dist/agent-chat/thread-detail-panel.js +37 -33
  12. package/dist/agent-chat/thread-message.d.ts.map +1 -1
  13. package/dist/agent-chat/thread-message.js +8 -5
  14. package/dist/agent-chat/thread-outcome-card.js +3 -3
  15. package/dist/agent-chat/thread-workspace.js +1 -1
  16. package/dist/charts/primitives/ChartLegend.js +2 -0
  17. package/dist/charts/primitives/ChartTooltip.js +2 -1
  18. package/dist/cli/index.d.ts +15 -0
  19. package/dist/cli/index.d.ts.map +1 -1
  20. package/dist/cli/index.js +29 -7
  21. package/dist/connectivity/connectivity-indicator.d.ts.map +1 -1
  22. package/dist/connectivity/connectivity-indicator.js +3 -3
  23. package/dist/content/article-card.module.css +7 -5
  24. package/dist/content/article-layout.module.css +16 -12
  25. package/dist/content/callout.module.css +4 -4
  26. package/dist/content/code-block.module.css +8 -7
  27. package/dist/content/guide.module.css +3 -3
  28. package/dist/content/mermaid.module.css +2 -2
  29. package/dist/content/prose.module.css +59 -29
  30. package/dist/content/reading-progress.module.css +2 -0
  31. package/dist/content/toc.module.css +6 -3
  32. package/dist/dashboard/delta-badge.d.ts.map +1 -1
  33. package/dist/dashboard/delta-badge.js +10 -2
  34. package/dist/dashboard/empty-state.d.ts.map +1 -1
  35. package/dist/dashboard/empty-state.js +3 -16
  36. package/dist/dashboard/settings-section.js +2 -2
  37. package/dist/dashboard/settings-section.module.css +2 -2
  38. package/dist/dashboard/stat-card.js +2 -1
  39. package/dist/data/virtual-list.d.ts.map +1 -1
  40. package/dist/data/virtual-list.js +12 -2
  41. package/dist/forms/FormErrorSummary.js +2 -2
  42. package/dist/guard/index.d.ts +20 -4
  43. package/dist/guard/index.d.ts.map +1 -1
  44. package/dist/guard/index.js +250 -37
  45. package/dist/guard/types.d.ts +24 -3
  46. package/dist/guard/types.d.ts.map +1 -1
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/provider/index.d.ts +30 -1
  50. package/dist/provider/index.d.ts.map +1 -1
  51. package/dist/provider/index.js +32 -7
  52. package/dist/provider/lab-theme.d.ts +39 -0
  53. package/dist/provider/lab-theme.d.ts.map +1 -0
  54. package/dist/provider/lab-theme.js +52 -0
  55. package/dist/shell/app-header.module.css +2 -2
  56. package/dist/shell/app-mobile-nav.module.css +1 -1
  57. package/dist/shell/app-sidebar-account.d.ts.map +1 -1
  58. package/dist/shell/app-sidebar-account.js +4 -2
  59. package/dist/shell/app-sidebar.d.ts.map +1 -1
  60. package/dist/shell/app-sidebar.js +4 -2
  61. package/dist/shell/app-sidebar.module.css +36 -26
  62. package/dist/shell/index.d.ts.map +1 -1
  63. package/dist/shell/index.js +11 -4
  64. package/dist/shell/sidebar-search.module.css +16 -4
  65. package/dist/styles.css +1 -1
  66. package/dist/surfaces.d.ts +15 -11
  67. package/dist/surfaces.d.ts.map +1 -1
  68. package/dist/surfaces.js +4 -3
  69. package/dist/theme/controls.module.css +1 -1
  70. package/dist/theme/floating.module.css +1 -1
  71. package/dist/theme/index.d.ts +116 -11
  72. package/dist/theme/index.d.ts.map +1 -1
  73. package/dist/theme/index.js +703 -566
  74. package/dist/theme/nav-link.module.css +1 -1
  75. package/dist/theme/use-basalt-spacing.d.ts +3 -0
  76. package/dist/theme/use-basalt-spacing.d.ts.map +1 -0
  77. package/dist/theme/use-basalt-spacing.js +8 -0
  78. package/dist/theme-lab/derive-controls.d.ts +13 -0
  79. package/dist/theme-lab/derive-controls.d.ts.map +1 -0
  80. package/dist/theme-lab/derive-controls.js +137 -0
  81. package/dist/theme-lab/derive-state.d.ts +55 -0
  82. package/dist/theme-lab/derive-state.d.ts.map +1 -0
  83. package/dist/theme-lab/derive-state.js +81 -0
  84. package/dist/theme-lab/index.d.ts +12 -2
  85. package/dist/theme-lab/index.d.ts.map +1 -1
  86. package/dist/theme-lab/index.js +13 -62
  87. package/dist/theme-toggle/index.d.ts.map +1 -1
  88. package/dist/theme-toggle/index.js +3 -2
  89. package/dist/tokens/derive.d.ts +89 -0
  90. package/dist/tokens/derive.d.ts.map +1 -0
  91. package/dist/tokens/derive.js +250 -0
  92. package/dist/tokens/hct.d.ts +34 -0
  93. package/dist/tokens/hct.d.ts.map +1 -0
  94. package/dist/tokens/hct.js +159 -0
  95. package/dist/tokens/index.d.ts +71 -7
  96. package/dist/tokens/index.d.ts.map +1 -1
  97. package/dist/tokens/index.js +284 -46
  98. package/dist/tokens/palette.d.ts +984 -167
  99. package/dist/tokens/palette.d.ts.map +1 -1
  100. package/dist/tokens/palette.js +617 -119
  101. package/dist/vite-color-mix.d.ts +30 -0
  102. package/dist/vite-color-mix.d.ts.map +1 -0
  103. package/dist/vite-color-mix.js +80 -0
  104. package/dist/vite.d.ts +82 -1
  105. package/dist/vite.d.ts.map +1 -1
  106. package/dist/vite.js +312 -0
  107. package/llms.txt +5 -4
  108. package/package.json +24 -9
  109. package/src/agent/part-list.tsx +13 -7
  110. package/src/agent/stick-to-bottom.tsx +2 -2
  111. package/src/agent-chat/thread-detail-panel.tsx +13 -10
  112. package/src/agent-chat/thread-message.tsx +8 -5
  113. package/src/agent-chat/thread-outcome-card.tsx +2 -2
  114. package/src/agent-chat/thread-workspace.tsx +2 -2
  115. package/src/charts/primitives/ChartLegend.tsx +2 -2
  116. package/src/charts/primitives/ChartTooltip.tsx +2 -2
  117. package/src/cli/check-theme.test.ts +18 -0
  118. package/src/cli/index.ts +55 -5
  119. package/src/connectivity/connectivity-indicator.tsx +8 -2
  120. package/src/content/article-card.module.css +7 -5
  121. package/src/content/article-layout.module.css +16 -12
  122. package/src/content/callout.module.css +4 -4
  123. package/src/content/code-block.module.css +8 -7
  124. package/src/content/guide.module.css +3 -3
  125. package/src/content/mermaid.module.css +2 -2
  126. package/src/content/prose.module.css +59 -29
  127. package/src/content/prose.module.css.test.ts +55 -0
  128. package/src/content/reading-progress.module.css +2 -0
  129. package/src/content/toc.module.css +6 -3
  130. package/src/dashboard/delta-badge.tsx +10 -4
  131. package/src/dashboard/empty-state.tsx +3 -16
  132. package/src/dashboard/settings-section.module.css +2 -2
  133. package/src/dashboard/settings-section.tsx +2 -2
  134. package/src/dashboard/stat-card.tsx +2 -2
  135. package/src/data/virtual-list.tsx +12 -2
  136. package/src/forms/FormErrorSummary.tsx +1 -1
  137. package/src/guard/check-source.test.ts +416 -5
  138. package/src/guard/index.ts +367 -45
  139. package/src/guard/types.ts +24 -2
  140. package/src/index.ts +1 -0
  141. package/src/provider/index.test.tsx +100 -0
  142. package/src/provider/index.tsx +79 -7
  143. package/src/provider/lab-theme.test.ts +147 -0
  144. package/src/provider/lab-theme.ts +166 -0
  145. package/src/shell/app-header.module.css +2 -2
  146. package/src/shell/app-mobile-nav.module.css +1 -1
  147. package/src/shell/app-sidebar-account.tsx +9 -2
  148. package/src/shell/app-sidebar.module.css +36 -26
  149. package/src/shell/app-sidebar.tsx +12 -2
  150. package/src/shell/index.tsx +14 -3
  151. package/src/shell/sidebar-search.module.css +16 -4
  152. package/src/styles.css +1 -1
  153. package/src/surfaces.ts +17 -10
  154. package/src/theme/contrast.test.ts +19 -3
  155. package/src/theme/controls.module.css +1 -1
  156. package/src/theme/density-option.test.ts +96 -0
  157. package/src/theme/density-relations.test.ts +428 -0
  158. package/src/theme/derive-theme.test.ts +101 -0
  159. package/src/theme/floating.module.css +1 -1
  160. package/src/theme/fonts-option.test.ts +69 -0
  161. package/src/theme/index.ts +930 -563
  162. package/src/theme/nav-link.module.css +1 -1
  163. package/src/theme/radius-option.test.ts +86 -0
  164. package/src/theme/radius.test.ts +132 -0
  165. package/src/theme/spacing.test.ts +432 -0
  166. package/src/theme/use-basalt-spacing.test.tsx +51 -0
  167. package/src/theme/use-basalt-spacing.ts +38 -0
  168. package/src/theme-lab/derive-controls.test.ts +94 -0
  169. package/src/theme-lab/derive-controls.tsx +227 -0
  170. package/src/theme-lab/derive-state.test.ts +71 -0
  171. package/src/theme-lab/derive-state.ts +163 -0
  172. package/src/theme-lab/index.tsx +29 -68
  173. package/src/theme-lab/theme-lab.test.ts +4 -18
  174. package/src/theme-toggle/index.tsx +9 -4
  175. package/src/tokens/build-fonts-css.test.ts +51 -0
  176. package/src/tokens/build-radius-css.test.ts +25 -0
  177. package/src/tokens/density.test.ts +274 -0
  178. package/src/tokens/derive-radius.test.ts +62 -0
  179. package/src/tokens/derive.test.ts +30 -0
  180. package/src/tokens/derive.ts +481 -0
  181. package/src/tokens/hct.ts +231 -0
  182. package/src/tokens/index.ts +395 -45
  183. package/src/tokens/palette.test.ts +114 -0
  184. package/src/tokens/palette.ts +1118 -180
  185. package/src/vite-color-mix.test.ts +46 -0
  186. package/src/vite-color-mix.ts +137 -0
  187. package/src/vite.test.ts +192 -0
  188. 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,33 @@
1
+ # [1.2.0](https://github.com/jkrumm/basalt-ui/compare/v1.1.1...v1.2.0) (2026-07-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * let styles-block radii follow the dev radius slider ([81f0318](https://github.com/jkrumm/basalt-ui/commit/81f0318ede0fe60f8f95c89481090c7de990bfe2))
7
+ * make the raw-surface guard token-aware ([0deab9a](https://github.com/jkrumm/basalt-ui/commit/0deab9a24fcaae643419f89d075a103e6c078b97))
8
+ * make the virtual-list skeleton density-aware and lock the space var set ([f6fbde6](https://github.com/jkrumm/basalt-ui/commit/f6fbde634d2b1795d3a3f5cf3d3149b1eadac793))
9
+ * respect Vite's base when emitting app URLs ([488fe0c](https://github.com/jkrumm/basalt-ui/commit/488fe0cb39fa7dbd3d29d985aa264767fb952a0d))
10
+ * strip comments before the theme guard scans ([ac5e81d](https://github.com/jkrumm/basalt-ui/commit/ac5e81d414d7cfb290bd598f60bed1335f86234c))
11
+
12
+
13
+ ### Features
14
+
15
+ * add basaltAppPlugin for PWA head, manifest, and icon metadata ([cef0114](https://github.com/jkrumm/basalt-ui/commit/cef0114e85f7d2107c640bdfb24978e6b0d29d40))
16
+ * add fonts option and derive legendText ([82a6af3](https://github.com/jkrumm/basalt-ui/commit/82a6af3eaba65ad86dcf18ec3aa94f8d798b3d4e))
17
+ * add per-rule path exemptions to the theme guard ([5f085bb](https://github.com/jkrumm/basalt-ui/commit/5f085bb2ae919f09fafac473818cb3874704d5b1))
18
+ * add the density knob to the theme config ([e992638](https://github.com/jkrumm/basalt-ui/commit/e992638b5897b8a7a12d4c142aad513bff6d0ca9))
19
+ * add the radius knob to the theme config ([3207e8a](https://github.com/jkrumm/basalt-ui/commit/3207e8a8b3e4c718e815fa9a1dd5f2540f88ffbc))
20
+ * derive the palette from one accent seed ([bc6fe31](https://github.com/jkrumm/basalt-ui/commit/bc6fe31e892f626e48f3dc60ff5351fa5805ace1))
21
+ * dogfood the inline-display and raw-html-layout guards ([4844f62](https://github.com/jkrumm/basalt-ui/commit/4844f62db7a2762c2c40973c2b612fecc33031b9))
22
+ * dogfood the inline-spacing guard on the package ([583e18c](https://github.com/jkrumm/basalt-ui/commit/583e18c21c12ba0858b9d31ef7fc433c127bc2fd))
23
+ * dogfood the raw-spacing guard on the package ([c9a2cf9](https://github.com/jkrumm/basalt-ui/commit/c9a2cf9f7bfd6cfd2a284cf1ec57295c55ad6f14))
24
+ * dogfood the raw-surface guard on the package ([b70a29a](https://github.com/jkrumm/basalt-ui/commit/b70a29aa048227fa048c0acdfc0847a69d9f9f5b))
25
+ * embed DeriveControls in playground settings ([8439aa1](https://github.com/jkrumm/basalt-ui/commit/8439aa1b8b94409d2c1047ccf697aceec4068b40))
26
+ * make the theme lab move the theme object, not just CSS vars ([1eb4257](https://github.com/jkrumm/basalt-ui/commit/1eb4257a9525094b386f80699e8282c53982e974))
27
+ * mention the radius knob in the Derive panel copy ([7a1b064](https://github.com/jkrumm/basalt-ui/commit/7a1b064c548f98143350d366696eb1f7ab8e6b6f))
28
+ * scan CSS modules in the theme guard ([2b0d9d4](https://github.com/jkrumm/basalt-ui/commit/2b0d9d433917ef5bcc55d0400e76de50f622c526))
29
+ * tighten the sidebar, open up components — retune the level-0 spacing bases ([8b6119a](https://github.com/jkrumm/basalt-ui/commit/8b6119aa601793f8947302288d02cfb1803dc1b8))
30
+
1
31
  ## [1.1.1](https://github.com/jkrumm/basalt-ui/compare/v1.1.0...v1.1.1) (2026-07-17)
2
32
 
3
33
 
package/README.md CHANGED
@@ -38,7 +38,7 @@ bunx basalt-ui init
38
38
  That's the whole install — there is no plugin, no marketplace, and no second version to track.
39
39
  `init` writes into the consumer repo:
40
40
 
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`)
41
+ - `.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
42
  - `.claude/skills/basalt-{app,design,charts}/SKILL.md` — the three skills (`/basalt-app`, `/basalt-design`, `/basalt-charts`), same managed path as the rules
43
43
  - A managed `<!-- basalt:begin/end -->` block in `CLAUDE.md` — stack facts, the DESIGN.md pointer, and the frontend-design restraint override
44
44
  - A thin `DESIGN.md` seed — your app's deltas (series dictionary, identity, deviations)
@@ -93,6 +93,24 @@ createRoot(document.getElementById('root')!).render(
93
93
  > `@mantine/spotlight/styles.layer.css` if you install those optional-peer batteries
94
94
  > (`./notifications` / `./commands` — see [Adapter batteries](#adapter-batteries) below).
95
95
 
96
+ ### Theming
97
+
98
+ The shipped palette isn't a fixed set of hexes — it's **generated** from one accent seed + five
99
+ bounded knobs, with contrast guaranteed by derivation rather than hand-tuning:
100
+
101
+ ```ts
102
+ const theme = createBasaltTheme(
103
+ {
104
+ /* app deltas only */
105
+ },
106
+ { derive: { accent: '#7c3aed', neutral: 'zinc', vibrancy: 1 } },
107
+ )
108
+ ```
109
+
110
+ `derive` accepts `accent` (hex seed), `neutral` (`'zinc' | 'neutral' | 'stone' | 'slate'`), and
111
+ `lightLevel` / `darkLevel` / `vibrancy` / `accentBrightness` (`-5..5`, all optional — omitted knobs
112
+ keep the shipped default). Never hand-edit a palette hex to retune the identity.
113
+
96
114
  `BasaltOverlays` (from `basalt-ui/commands`) is the composable overlay mount: it bundles
97
115
  `ModalsProvider`, `Spotlight`, and `Notifications` into a single mount point and replaces a
98
116
  standalone `<BasaltNotifications />`. `paletteOptions={{ groups: paletteGroups }}` emits your
@@ -113,11 +131,19 @@ import type { SidebarSection } from 'basalt-ui'
113
131
 
114
132
  ```ts
115
133
  // vite.config.ts
116
- import { basaltViteConfig } from 'basalt-ui/vite'
134
+ import react from '@vitejs/plugin-react'
135
+ import { basaltAppPlugin, basaltViteConfig } from 'basalt-ui/vite'
136
+ import { defineConfig } from 'vite'
117
137
 
118
- export default basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' })
138
+ export default defineConfig({
139
+ ...basaltViteConfig({ port: 5173, apiTarget: 'http://localhost:3000' }),
140
+ plugins: [react(), ...basaltAppPlugin({ name: 'MyApp', description: '…' })],
141
+ })
119
142
  ```
120
143
 
144
+ `basaltViteConfig` stays config-only (no `plugins`, by contract); `basaltAppPlugin` is the plugin
145
+ half — see the `./vite` adapter battery under [Adapter batteries](#adapter-batteries) below.
146
+
121
147
  > **Local consumption (sibling checkouts).** Developing against an unpublished / `file:`-linked
122
148
  > basalt-ui from a sibling repo? Build `dist/` first — `bunx basalt-ui` always resolves
123
149
  > `bin/basalt-ui.mjs` → `dist/cli/index.js`, even though the _runtime_ import can ride
@@ -158,7 +184,7 @@ scanned files. Other `"basalt"` config keys (`exempt`,
158
184
  | `./charts` | **free** | visx chart primitives, sparklines, hooks, and token re-exports |
159
185
  | `./tokens` | **free** | `VX` token refs, `buildPaletteCss`, `defineSeries`, `seriesTokens`, `groupTokens`, `alpha`, `ColorPair` / `SeriesMap` types |
160
186
  | `./theme-lab` | coupled | `ThemeLabControls`, `applyOverrides`, `loadOverrides`, `COLOR_GROUPS` for live theme inspection |
161
- | `./vite` | — | `basaltViteConfig(opts)` — Vite preset for basalt-ui consumer apps |
187
+ | `./vite` | — | `basaltViteConfig(opts)` — Vite preset for basalt-ui consumer apps; `basaltAppPlugin(opts)` — PWA head, manifest, and icon metadata derived from the token palette |
162
188
  | `./guard` | **free** | `checkSource`, `GUARD_RULES`, `Finding` types — the headless theme-guard core |
163
189
  | `./query` | **free** | `createBasaltQueryClient`, transport-agnostic `unwrap`, lazy `BasaltQueryDevtools` |
164
190
  | `./router-tanstack` | **free** | TanStack Router bridge: `useBasaltNav` (active route) + `useRouterBreadcrumbs` |
@@ -428,6 +454,22 @@ function Inbox() {
428
454
  distilled `{ title, summary }` outcome, never the raw prompt or thinking. See
429
455
  `agent/rules/basalt-agent.md` for the full doctrine.
430
456
 
457
+ ### `./vite` — PWA / head metadata (optional peer)
458
+
459
+ `basaltAppPlugin` (see [Wire the runtime](#wire-the-runtime) above) needs no install by default —
460
+ its `serviceWorker` option is the only part with an optional peer, and it's `false` unless you opt
461
+ in:
462
+
463
+ ```bash
464
+ bun add -D vite-plugin-pwa workbox-build workbox-window # only if serviceWorker is enabled
465
+ ```
466
+
467
+ Without the peer installed, `serviceWorker: true` degrades to a one-line console warning (no
468
+ service worker, no crash) — everything else (theme-color meta, anti-FOUC background,
469
+ `site.webmanifest`, favicon/apple-touch-icon links, OG/Twitter defaults) works with zero extra
470
+ dependencies. Full doctrine, plugin ordering, and the bring-your-own icon filenames:
471
+ `agent/rules/basalt-app.md`.
472
+
431
473
  ---
432
474
 
433
475
  ## Type seam (`BasaltRegister`)
@@ -460,7 +502,7 @@ bunx basalt-ui init # scaffold doctrine into a consumer repo
460
502
  bunx basalt-ui sync # three-way diff against .basalt/manifest.json after a basalt-ui upgrade
461
503
  bunx basalt-ui sync --check # CI drift gate — non-zero exit on any managed-file drift
462
504
  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)
505
+ 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
506
  bunx basalt-ui info # human-readable surface map: subpath, layer, rule, skills, optional peers
465
507
  bunx basalt-ui info --json # same map as stable JSON (InfoOutput shape)
466
508
  ```
@@ -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'
@@ -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,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACtC,KAAK,EAAE,MAAM,CAAA;CACd,KAAK,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;AAExB,MAAM,MAAM,qBAAqB,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI,CAAC,KAAK,EAAE;IAC/E,IAAI,EAAE,OAAO,CAAC,KA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S,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,CAAA;IACjC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,GACR,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAoFtC"}
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,CAAA;IACjC,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,SAAS,EACT,SAAS,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,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAiBrC"}
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;AAmGjB;;;;;;;;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,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAiBrC"}
@@ -25,14 +25,17 @@ const MICRO_LABEL_STYLE = {
25
25
  function TextRenderer({ part }) {
26
26
  return /* @__PURE__ */ jsx(Markdown, { streaming: true, density: "chat", children: part.text });
27
27
  }
28
- const RAIL_STYLE = { borderLeft: `2px solid ${VX.divider}`, paddingLeft: 10 };
28
+ const RAIL_STYLE = {
29
+ borderLeft: `2px solid ${VX.divider}`,
30
+ paddingLeft: "var(--vx-space-agent-rail-inset-x)"
31
+ };
29
32
  const CODE_BLOCK_STYLE = {
30
33
  margin: 0,
31
- marginTop: 6,
34
+ marginTop: "var(--vx-space-agent-part-gap-top)",
32
35
  fontFamily: "var(--basalt-font-mono)",
33
36
  backgroundColor: alpha(VX.ink, 0.06),
34
- borderRadius: 8,
35
- padding: 8,
37
+ borderRadius: "var(--vx-radius-card)",
38
+ padding: "var(--vx-space-agent-code-inset)",
36
39
  whiteSpace: "pre-wrap",
37
40
  overflowWrap: "anywhere"
38
41
  };
@@ -90,7 +93,7 @@ function MessageBlock({
90
93
  Box,
91
94
  {
92
95
  style: {
93
- padding: "10px 12px",
96
+ padding: "var(--vx-space-agent-message-inset-y) var(--vx-space-agent-message-inset-x)",
94
97
  backgroundColor: author === "user" ? VX.surface.subtle : VX.surface.panel,
95
98
  borderRadius: VX.radiusCard,
96
99
  boxShadow: VX.shadowCard
@@ -59,12 +59,12 @@ function OutcomeBody({ thread }) {
59
59
  Badge,
60
60
  {
61
61
  size: "xs",
62
- radius: 6,
63
62
  styles: {
64
63
  root: {
65
64
  backgroundColor: alpha(badge.statusToken, 0.13),
66
- padding: "2px 7px",
67
- height: "auto"
65
+ padding: "var(--vx-space-badge-inset-y) var(--vx-space-badge-inset-x)",
66
+ height: "auto",
67
+ borderRadius: "var(--vx-radius-ctrl)"
68
68
  },
69
69
  label: {
70
70
  fontFamily: "var(--basalt-font-mono)",
@@ -49,7 +49,7 @@ function ThreadWorkspace({
49
49
  if (store.activeId === null) return;
50
50
  runs.retry(store.activeId);
51
51
  };
52
- const feed = /* @__PURE__ */ jsxs(Box, { style: { display: "flex", flexDirection: "column", height: "100%", overflow: "hidden" }, children: [
52
+ const feed = /* @__PURE__ */ jsxs(Flex, { direction: "column", h: "100%", style: { overflow: "hidden" }, children: [
53
53
  /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0 }, children: store.threads.length === 0 ? emptyState ?? /* @__PURE__ */ jsx(FeedEmptyState, {}) : /* @__PURE__ */ jsx(ThreadFeed, { threads, activeId: store.activeId, onSelect: handleSelect }) }),
54
54
  /* @__PURE__ */ jsx(Divider, { color: "var(--vx-divider)" }),
55
55
  /* @__PURE__ */ jsx(Box, { p: "sm", children: /* @__PURE__ */ jsx(
@@ -106,6 +106,7 @@ function LegendSwatch({ item, idPrefix }) {
106
106
  width: 11,
107
107
  height: 11,
108
108
  borderRadius: 3,
109
+ // theme-allow: sub-scale legend-swatch corner, below the 4px radius floor
109
110
  backgroundColor: item.color,
110
111
  opacity: item.fillOpacity ?? 0.7,
111
112
  flexShrink: 0
@@ -144,6 +145,7 @@ function LegendChildSwatch({ item }) {
144
145
  width: 10,
145
146
  height: 10,
146
147
  borderRadius: 2,
148
+ // theme-allow: sub-scale legend-swatch corner, below the 4px radius floor
147
149
  backgroundColor: item.color,
148
150
  opacity: item.fillOpacity ?? 0.7,
149
151
  flexShrink: 0
@@ -6,7 +6,7 @@ const TOOLTIP_STYLES = {
6
6
  pointerEvents: "none",
7
7
  zIndex: 9999,
8
8
  backgroundColor: VX.surface.panel,
9
- borderRadius: 8,
9
+ borderRadius: "var(--vx-radius-floating)",
10
10
  padding: "0",
11
11
  fontSize: VX.text.xs,
12
12
  lineHeight: "18px",
@@ -110,6 +110,7 @@ function TooltipRow({
110
110
  width: 8,
111
111
  height: 8,
112
112
  borderRadius: 2,
113
+ // theme-allow: sub-scale tooltip micro-corner, below the 4px radius floor
113
114
  backgroundColor: color,
114
115
  flexShrink: 0
115
116
  }