basalt-ui 2.7.2 → 2.8.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 (47) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +33 -0
  3. package/MIGRATING.md +101 -15
  4. package/agent/rules/basalt-batteries.md +1 -1
  5. package/agent/rules/basalt-controls.md +1 -1
  6. package/agent/rules/basalt-mantine.md +1 -1
  7. package/agent/skills/basalt-app/SKILL.md +7 -7
  8. package/agent/templates/AGENTS-block.md.tpl +1 -1
  9. package/dist/charts/BandStrip.d.ts +13 -0
  10. package/dist/charts/BandStrip.d.ts.map +1 -1
  11. package/dist/charts/BandStrip.js +142 -44
  12. package/dist/cli/doctor-upgrade.d.ts +11 -0
  13. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  14. package/dist/cli/doctor-upgrade.js +122 -10
  15. package/dist/cli/doctor.d.ts.map +1 -1
  16. package/dist/cli/doctor.js +4 -0
  17. package/dist/cli/help.js +1 -1
  18. package/dist/cli/index.d.ts +5 -0
  19. package/dist/cli/index.d.ts.map +1 -1
  20. package/dist/cli/index.js +12 -0
  21. package/dist/cli/init.d.ts.map +1 -1
  22. package/dist/cli/init.js +7 -4
  23. package/dist/cli/sync.d.ts.map +1 -1
  24. package/dist/cli/sync.js +27 -2
  25. package/dist/content/toc.d.ts +5 -0
  26. package/dist/content/toc.d.ts.map +1 -1
  27. package/dist/provider/index.d.ts +22 -4
  28. package/dist/provider/index.d.ts.map +1 -1
  29. package/dist/provider/index.js +21 -6
  30. package/dist/provider/test-router.d.ts +2 -1
  31. package/dist/provider/test-router.d.ts.map +1 -1
  32. package/dist/provider/test-router.js +6 -7
  33. package/dist/surfaces.d.ts +1 -1
  34. package/dist/surfaces.js +1 -1
  35. package/llms.txt +36 -4
  36. package/package.json +1 -1
  37. package/src/charts/BandStrip.tsx +223 -48
  38. package/src/cli/doctor-upgrade.ts +171 -15
  39. package/src/cli/doctor.ts +4 -0
  40. package/src/cli/help.ts +1 -1
  41. package/src/cli/index.ts +16 -0
  42. package/src/cli/init.ts +7 -6
  43. package/src/cli/sync.ts +29 -2
  44. package/src/content/toc.tsx +5 -0
  45. package/src/provider/index.tsx +65 -15
  46. package/src/provider/test-router.tsx +9 -9
  47. package/src/surfaces.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AAwCA,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mGAAmG;IACnG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrF;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,WAAgB,EAAE,aAAa,GAAE,MAAsB,GAAG,MAAM,CAgM1F"}
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AA2CA,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mGAAmG;IACnG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrF;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ5D;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,WAAgB,EAAE,aAAa,GAAE,MAAsB,GAAG,MAAM,CAwN1F"}
package/dist/cli/sync.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  diffSummary,
11
11
  findBasaltInstall,
12
12
  inspectLefthookGate,
13
+ isStartApp,
13
14
  isStringArray,
14
15
  managedFiles,
15
16
  normalizeForLedger,
@@ -28,9 +29,11 @@ import {
28
29
  reportPrune,
29
30
  resolvePlacement,
30
31
  resolveProjectDir,
32
+ routerSeedDests,
31
33
  rootsNotices,
32
34
  sha256,
33
35
  shippedAssetPath,
36
+ START_APP_NOTE,
34
37
  unitState,
35
38
  writeFileEnsuringDir,
36
39
  writeUnit
@@ -70,7 +73,9 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
70
73
  }
71
74
  if (!existsSync(resolve(cwd, MANIFEST_PATH))) {
72
75
  const elsewhere = findManifestAbove(cwd);
73
- const wouldWrite = managedFiles(resolvePlacement(cwd)).length;
76
+ const refused = resolvePlacement(cwd);
77
+ const startSeeds = isStartApp(cwd, refused.appRel) ? routerSeedDests(refused.appRel) : [];
78
+ const wouldWrite = managedFiles(refused).filter((f) => !startSeeds.includes(f.dest)).length;
74
79
  console.error(
75
80
  `\u2716 basalt-ui sync: no ${MANIFEST_PATH} at ${cwd} \u2014 refusing to scaffold. \`sync\` refreshes an EXISTING basalt install; creating one is \`basalt-ui init\`'s decision, and continuing here would write ${wouldWrite} managed file(s) into this directory.` + (elsewhere === null ? " No manifest exists at any ancestor either \u2014 run `basalt-ui init` here if this package really is meant to be a consumer." : ` ${parentInstallAdvice(cwd, elsewhere, "sync")}`)
76
81
  );
@@ -80,7 +85,9 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
80
85
  const ctx = renderContext(cwd);
81
86
  const manifest = readManifest(cwd);
82
87
  const placement = resolvePlacement(cwd);
83
- const files = managedFiles(placement);
88
+ const startApp = isStartApp(cwd, placement.appRel);
89
+ const skipped = new Set(startApp ? routerSeedDests(placement.appRel) : []);
90
+ const files = managedFiles(placement).filter((f) => !skipped.has(f.dest));
84
91
  let updated = 0;
85
92
  let created = 0;
86
93
  let recreated = 0;
@@ -126,6 +133,24 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
126
133
  force: opts.force === true
127
134
  });
128
135
  staleForCheck += pruned.removed.length + pruned.drifted.length;
136
+ const stale = [...skipped].filter(
137
+ (d) => manifest.files[d] !== void 0 && existsSync(resolve(cwd, d))
138
+ );
139
+ const mounting = stale.filter((d) => !d.endsWith("nav.tsx"));
140
+ const inert = stale.filter((d) => d.endsWith("nav.tsx"));
141
+ const embedded = "Delete them and render <BasaltProvider><Outlet /></BasaltProvider> in the Start root route (embedded mode).";
142
+ if (mounting.length > 0) {
143
+ console.error(
144
+ `\u26A0 basalt-ui sync: ${mounting.join(", ")} mount a second router inside this TanStack Start app; left untouched. ${embedded}`
145
+ );
146
+ }
147
+ if (inert.length > 0) {
148
+ console.error(
149
+ `\u26A0 basalt-ui sync: ${inert.join(", ")} was seeded before this became a Start app; it mounts nothing, so keep or delete it. Left untouched.`
150
+ );
151
+ }
152
+ if (startApp && (!opts.check || syncFlags.includes("--verbose")))
153
+ console.log(`basalt-ui sync: ${START_APP_NOTE}`);
129
154
  const placementSkips = placementNotices(cwd, placement);
130
155
  if (opts.check !== true || syncFlags.includes("--verbose")) {
131
156
  for (const line of placementSkips) console.log(`basalt-ui sync: ${line}`);
@@ -1,6 +1,11 @@
1
1
  /**
2
2
  * TableOfContents — an IntersectionObserver scroll-spy rail (docs/CONTENT-SPEC.md §3/§6).
3
3
  *
4
+ * Contract with `Markdown`: `Markdown` slugs every heading it renders into an `id` (deduped within the
5
+ * one document; per streamed block in `streaming` mode); `containerRef` collects the h2/h3 (`levels`)
6
+ * that already carry an `id` under that single container, on mount and on every childList mutation
7
+ * beneath it — late or lazy-rendered headings are picked up. `Prose` sets no ids; `items` replaces collection.
8
+ *
4
9
  * Headings self-register: pass `items` explicitly, or pass `containerRef` and the component
5
10
  * collects `h2`/`h3` (configurable via `levels`) that already carry an `id` — pair with
6
11
  * `headingSlug`/`SlugTracker` when authoring the headings. Sticky positioning is the consumer's
@@ -1 +1 @@
1
- {"version":3,"file":"toc.d.ts","sourceRoot":"","sources":["../../src/content/toc.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAMlD,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,oEAAoE;IACpE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;IAC1B,8FAA8F;IAC9F,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACrD,wEAAwE;IACxE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AA4BD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,YAAY,EACZ,MAAuB,EACvB,KAAqB,EACrB,UAAU,EACV,SAAS,GACV,EAAE,oBAAoB,sCAgLtB"}
1
+ {"version":3,"file":"toc.d.ts","sourceRoot":"","sources":["../../src/content/toc.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAMlD,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,oEAAoE;IACpE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAA;IAC1B,8FAA8F;IAC9F,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACrD,wEAAwE;IACxE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AA4BD,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,YAAY,EACZ,MAAuB,EACvB,KAAqB,EACrB,UAAU,EACV,SAAS,GACV,EAAE,oBAAoB,sCAgLtB"}
@@ -6,9 +6,7 @@ import type { SizeClass } from '../shell/use-size-class.js';
6
6
  import type { Telemetry } from '../telemetry.js';
7
7
  import type { BasaltRouter } from './create-router.js';
8
8
  import type { FlatNavItem } from '../router-tanstack/nav.js';
9
- export type BasaltProviderProps = {
10
- /** From `createBasaltRouter`; the provider mounts it and reads its `queryClient`. */
11
- router: BasaltRouter;
9
+ type BasaltProviderCommonProps = {
12
10
  /** Theme override merged onto the Basalt base. Defaults to `createBasaltTheme()`. */
13
11
  theme?: MantineProviderProps['theme'];
14
12
  /**
@@ -48,7 +46,27 @@ export type BasaltProviderProps = {
48
46
  * entry with id `nav.<id>` replaces the generated one outright.
49
47
  */
50
48
  navCommandLabel?: (item: FlatNavItem) => string;
49
+ /**
50
+ * Mount Basalt's `<Spotlight>` (Cmd+K) with the generated nav + command actions. Default `true`.
51
+ * Set `false` when the app owns its own palette: neither the component nor its action wiring mounts.
52
+ */
53
+ spotlight?: boolean;
51
54
  } & Omit<MantineProviderProps, 'children' | 'theme' | 'defaultColorScheme' | 'cssVariablesResolver'>;
55
+ /**
56
+ * Two modes, never both: pass a `createBasaltRouter` `router` and the provider mounts it, or pass
57
+ * `children` and render the provider INSIDE a router the app does not own (around the `<Outlet />`
58
+ * of TanStack Start's root route component) — the router then comes from `useRouter()` and must carry
59
+ * `context.queryClient` (its `getRouter()` builds the same context `createBasaltRouter` does).
60
+ */
61
+ export type BasaltProviderProps = BasaltProviderCommonProps & ({
62
+ /** From `createBasaltRouter`; the provider mounts it and reads its `queryClient`. */
63
+ router: BasaltRouter;
64
+ children?: never;
65
+ } | {
66
+ router?: never;
67
+ /** The subtree inside the app's own router; rendered where `<RouterProvider>` would be. */
68
+ children: ReactNode;
69
+ });
52
70
  type RootBoundaryProps = {
53
71
  children: ReactNode;
54
72
  emit: Telemetry;
@@ -83,6 +101,6 @@ export declare function composeInjectedCss(base: string, fontsCss: string, radiu
83
101
  * closes the gap between hydration and the next client paint.
84
102
  */
85
103
  export declare function useHostAttribute(): void;
86
- export declare function BasaltProvider({ router, theme, telemetry, fallback, injectPalette, paletteOptions, defaultColorScheme, nonce, sizeClassHint, navCommandLabel, ...rest }: BasaltProviderProps): import("react").JSX.Element;
104
+ export declare function BasaltProvider({ theme, telemetry, fallback, injectPalette, paletteOptions, defaultColorScheme, nonce, sizeClassHint, navCommandLabel, spotlight, router: mountedRouter, children, ...rest }: BasaltProviderProps): import("react").JSX.Element;
87
105
  export {};
88
106
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/provider/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AASzD,OAAO,EAAE,SAAS,EAAqE,MAAM,OAAO,CAAA;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAStD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAQxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,iBAAiB,CAAA;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAGzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,qFAAqF;IACrF,MAAM,EAAE,YAAY,CAAA;IACpB,qFAAqF;IACrF,KAAK,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAA;IACrC;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,yGAAyG;IACzG,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,SAAS,CAAC,CAAA;IACtD;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAA;IACjC,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;IAC/D;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;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 +4,7 @@ import { ModalsProvider } from "@mantine/modals";
4
4
  import { Notifications } from "@mantine/notifications";
5
5
  import { Spotlight } from "@mantine/spotlight";
6
6
  import { QueryClientProvider } from "@tanstack/react-query";
7
- import { RouterProvider } from "@tanstack/react-router";
7
+ import { RouterProvider, useRouter } from "@tanstack/react-router";
8
8
  import { Component, Suspense, lazy, useCallback, useEffect, useMemo, useRef, useState } from "react";
9
9
  import fallbackClasses from "./error-fallback.module.css";
10
10
  import { cssVariablesResolver } from "../theme/index.js";
@@ -233,13 +233,22 @@ function readQueryClient(router) {
233
233
  const client = router.options.context?.queryClient;
234
234
  if (client === void 0) {
235
235
  throw new Error(
236
- "[basalt] BasaltProvider: the router has no context.queryClient \u2014 create it with createBasaltRouter({ routeTree })."
236
+ "[basalt] BasaltProvider: no context.queryClient \u2014 pass `router` from createBasaltRouter, or with `children` put a QueryClient in the router context."
237
237
  );
238
238
  }
239
239
  return client;
240
240
  }
241
+ function useEffectiveRouter(mounted) {
242
+ const ambient = useRouter({ warn: false });
243
+ const router = mounted ?? ambient;
244
+ if (!router) {
245
+ throw new Error(
246
+ "[basalt] BasaltProvider: no router \u2014 pass `router` to mount one, or `children` inside one."
247
+ );
248
+ }
249
+ return router;
250
+ }
241
251
  function BasaltProvider({
242
- router,
243
252
  theme,
244
253
  telemetry,
245
254
  fallback,
@@ -249,6 +258,9 @@ function BasaltProvider({
249
258
  nonce,
250
259
  sizeClassHint = "compact",
251
260
  navCommandLabel,
261
+ spotlight = true,
262
+ router: mountedRouter,
263
+ children,
252
264
  ...rest
253
265
  }) {
254
266
  useDuplicateProviderGuard();
@@ -261,6 +273,7 @@ function BasaltProvider({
261
273
  useWindowErrors(emit);
262
274
  useRegistryHotkeys();
263
275
  useEffect(() => registerModalsProvider(), []);
276
+ const router = useEffectiveRouter(mountedRouter);
264
277
  const client = readQueryClient(router);
265
278
  useDataTelemetry(router, client, emit);
266
279
  const [devTool, setDevTool] = useState(null);
@@ -269,7 +282,9 @@ function BasaltProvider({
269
282
  () => setActions(buildSpotlightActions(router, setDevTool, navCommandLabel)),
270
283
  [router, navCommandLabel]
271
284
  );
272
- useEffect(refreshActions, [refreshActions]);
285
+ useEffect(() => {
286
+ if (spotlight) refreshActions();
287
+ }, [spotlight, refreshActions]);
273
288
  const resolvedTheme = useLabTheme(theme);
274
289
  return (
275
290
  // `...rest` spreads FIRST so a consumer's `MantineProviderProps` can never shadow the three
@@ -284,7 +299,7 @@ function BasaltProvider({
284
299
  defaultColorScheme,
285
300
  children: /* @__PURE__ */ jsx(RootBoundary, { emit, fallback, children: /* @__PURE__ */ jsx(BasaltBridge, { injectPalette, paletteOptions, nonce, children: /* @__PURE__ */ jsx(TelemetryContext.Provider, { value: emit, children: /* @__PURE__ */ jsxs(SizeClassHintContext.Provider, { value: sizeClassHint, children: [
286
301
  /* @__PURE__ */ jsx(QueryClientProvider, { client, children: /* @__PURE__ */ jsxs(ModalsProvider, { children: [
287
- /* @__PURE__ */ jsx(RouterProvider, { router }),
302
+ mountedRouter === void 0 ? children : /* @__PURE__ */ jsx(RouterProvider, { router: mountedRouter }),
288
303
  process.env.NODE_ENV !== "production" && /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
289
304
  LazyDevDock,
290
305
  {
@@ -295,7 +310,7 @@ function BasaltProvider({
295
310
  ) })
296
311
  ] }) }),
297
312
  /* @__PURE__ */ jsx(Notifications, { position: "bottom-right", autoClose: 4e3, limit: 5 }),
298
- /* @__PURE__ */ jsx(
313
+ spotlight && /* @__PURE__ */ jsx(
299
314
  Spotlight,
300
315
  {
301
316
  actions,
@@ -1,6 +1,7 @@
1
1
  import type { AnyRouter } from '@tanstack/react-router';
2
+ import type { ReactNode } from 'react';
2
3
  import type { BasaltRouterContext } from './create-router.js';
3
4
  /** The router's QueryClient — a plain root route declares no context type, so read it untyped. */
4
5
  export declare const queryClientOf: (router: AnyRouter) => BasaltRouterContext["queryClient"];
5
- export declare function testRouter(text?: string): import("./create-router.js").BasaltRouter<import("@tanstack/router-core").Route<import("@tanstack/router-core").Register, any, "/", "/", string, "__root__", undefined, {}, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, readonly [import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<import("@tanstack/router-core").Register, undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/other", "/other", string, "/other", undefined, import("@tanstack/router-core").ResolveParams<"/other">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>], unknown, unknown, unknown, undefined>>;
6
+ export declare function testRouter(text?: string, wrap?: (children: ReactNode) => ReactNode): import("./create-router.js").BasaltRouter<import("@tanstack/router-core").Route<import("@tanstack/router-core").Register, any, "/", "/", string, "__root__", undefined, {}, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, readonly [import("@tanstack/react-router").Route<unknown, import("@tanstack/react-router").RootRoute<import("@tanstack/router-core").Register, undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>, "/other", "/other", string, "/other", undefined, import("@tanstack/router-core").ResolveParams<"/other">, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown, unknown, unknown, undefined>], unknown, unknown, unknown, undefined>>;
6
7
  //# sourceMappingURL=test-router.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-router.d.ts","sourceRoot":"","sources":["../../src/provider/test-router.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,kGAAkG;AAClG,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,KAAG,mBAAmB,CAAC,aAAa,CACtB,CAAA;AAE7D,wBAAgB,UAAU,CAAC,IAAI,SAAY,i6BAW1C"}
1
+ {"version":3,"file":"test-router.d.ts","sourceRoot":"","sources":["../../src/provider/test-router.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,kGAAkG;AAClG,eAAO,MAAM,aAAa,GAAI,QAAQ,SAAS,KAAG,mBAAmB,CAAC,aAAa,CACtB,CAAA;AAE7D,wBAAgB,UAAU,CAAC,IAAI,SAAY,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,SAAS,i6BAUrF"}
@@ -2,13 +2,12 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Outlet, createRootRoute, createRoute } from "@tanstack/react-router";
3
3
  import { createBasaltRouter } from "./create-router.js";
4
4
  const queryClientOf = (router) => router.options.context.queryClient;
5
- function testRouter(text = "content") {
6
- const root = createRootRoute({
7
- component: () => /* @__PURE__ */ jsxs(Fragment, { children: [
8
- /* @__PURE__ */ jsx("div", { children: text }),
9
- /* @__PURE__ */ jsx(Outlet, {})
10
- ] })
11
- });
5
+ function testRouter(text = "content", wrap) {
6
+ const body = /* @__PURE__ */ jsxs(Fragment, { children: [
7
+ /* @__PURE__ */ jsx("div", { children: text }),
8
+ /* @__PURE__ */ jsx(Outlet, {})
9
+ ] });
10
+ const root = createRootRoute({ component: () => wrap ? wrap(body) : body });
12
11
  const other = createRoute({ getParentRoute: () => root, path: "/other", component: () => null });
13
12
  return createBasaltRouter({ routeTree: root.addChildren([other]) });
14
13
  }
@@ -285,7 +285,7 @@ export declare const SURFACES: {
285
285
  readonly skill: readonly ["basalt-design"];
286
286
  readonly guardKinds: readonly [];
287
287
  readonly pluginRules: readonly [];
288
- readonly description: "Prose (article/chat typography), Callout, TableOfContents, Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY — `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust=\"untrusted\"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering — settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) — the content/prose surface";
288
+ readonly description: "Prose (article/chat typography), Callout, TableOfContents (given a containerRef it collects the id-bearing h2/h3 under that one container — levels changes which — on mount and on every DOM childList change, so it reads the slug ids `Markdown` gives every heading; `Prose` sets no ids and an explicit items list replaces collection), Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY — `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust=\"untrusted\"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering — settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) — the content/prose surface";
289
289
  readonly optionalPeers: readonly ["shiki", "@shikijs/langs", "@shikijs/themes", "beautiful-mermaid", "react-markdown", "remark-gfm", "rehype-sanitize", "remend"];
290
290
  readonly forbiddenImports: readonly [];
291
291
  };
package/dist/surfaces.js CHANGED
@@ -256,7 +256,7 @@ const SURFACES = {
256
256
  skill: ["basalt-design"],
257
257
  guardKinds: [],
258
258
  pluginRules: [],
259
- description: 'Prose (article/chat typography), Callout, TableOfContents, Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY \u2014 `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust="untrusted"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering \u2014 settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) \u2014 the content/prose surface',
259
+ description: 'Prose (article/chat typography), Callout, TableOfContents (given a containerRef it collects the id-bearing h2/h3 under that one container \u2014 levels changes which \u2014 on mount and on every DOM childList change, so it reads the slug ids `Markdown` gives every heading; `Prose` sets no ids and an explicit items list replaces collection), Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY \u2014 `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust="untrusted"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering \u2014 settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) \u2014 the content/prose surface',
260
260
  optionalPeers: [
261
261
  "shiki",
262
262
  "@shikijs/langs",
package/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # basalt-ui v2.7.2
1
+ # basalt-ui v2.8.0
2
2
  # Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets
3
3
  #
4
4
  # Entry points: use the exact import specifier below; do not guess.
@@ -13,7 +13,7 @@
13
13
  # A subpath's `Install:` line is its required peers; `OptionalPeers:` are import()-only, install on use.
14
14
 
15
15
  Package: basalt-ui
16
- Version: 2.7.2
16
+ Version: 2.8.0
17
17
 
18
18
  ## basalt-ui
19
19
  Import: import { ... } from 'basalt-ui'
@@ -21,7 +21,7 @@ Description: Wiring (`BasaltProvider`, `createBasaltTheme`, `createBasaltRouter`
21
21
  Layer: mantine-coupled
22
22
  Rule: basalt-mantine
23
23
  Signature: BasaltProvider(props: BasaltProviderProps): JSX.Element
24
- router: BasaltRouter
24
+ one of: router | children
25
25
  theme?: PartialObjectDeep<MantineTheme, { recurseIntoArrays: false;…
26
26
  telemetry?: Telemetry
27
27
  fallback?: ReactNode | ((error: unknown) => ReactNode)
@@ -31,6 +31,9 @@ Signature: BasaltProvider(props: BasaltProviderProps): JSX.Element
31
31
  nonce?: string
32
32
  sizeClassHint?: "compact" | "medium" | "expanded"
33
33
  navCommandLabel?: (item: FlatNavItem) => string
34
+ spotlight?: boolean
35
+ router: BasaltRouter
36
+ children: ReactNode
34
37
  Signature: BasaltShell(props: BasaltShellProps<G, T>): JSX.Element
35
38
  className?: string
36
39
  style?: CSSProperties
@@ -243,6 +246,7 @@ Signature: BandStrip(props: BandStripProps<T, X>): ReactElement<unknown, string
243
246
  states: readonly BandStripSeries<T>[]
244
247
  getBand: (d: T) => BandSpan
245
248
  fold?: BandFold<T>
249
+ absentState?: string
246
250
  Signature: Bars(props: BarsProps<T, X>): ReactElement<unknown, string | JSXElementConstructor<any>>
247
251
  className?: string
248
252
  style?: CSSProperties
@@ -620,6 +624,28 @@ Signature: ThreadFeed(props: ThreadFeedProps): JSX.Element
620
624
  renderRow?: ((thread: AgentThread) => ReactNode)
621
625
  anchor?: "start" | "end"
622
626
  Signature: ThreadFeedRow(props: ThreadFeedRowProps): JSX.Element
627
+ thread: AgentThread<TranscriptPart>
628
+ expanded: boolean
629
+ onToggle: (id: string) => void
630
+ title?: string
631
+ summary?: string
632
+ headerLeft?: ReactNode
633
+ headerRight?: ReactNode
634
+ messages?: readonly ChatMessage<TranscriptPart>[]
635
+ liveParts?: readonly TranscriptPart[]
636
+ liveStatus?: StreamStatus
637
+ renderers?: Readonly<Record<string, PartRenderer<ForeignPart>>>
638
+ fallbackRenderer?: PartRenderer<ForeignPart>
639
+ affordances?: MessageAffordances
640
+ groupConsecutive?: boolean
641
+ onSend: (payload: ComposerSubmit) => void
642
+ onStop?: (() => void)
643
+ composerProps?: Omit<ComposerProps, "streaming" | "onSubmit" | "onStop">
644
+ virtualize?: false | true | VirtualizeOptions
645
+ height?: string | number
646
+ classNames?: Partial<Record<"root" | "header" | "body", string>>
647
+ className?: string
648
+ style?: CSSProperties
623
649
  Signature: ToolChip(props: ToolChipProps): JSX.Element
624
650
  className?: string
625
651
  style?: CSSProperties
@@ -628,6 +654,12 @@ Signature: ToolChip(props: ToolChipProps): JSX.Element
628
654
  onApprove?: ((approvalId: string) => void)
629
655
  onDeny?: ((approvalId: string, reason?: string) => void)
630
656
  Signature: aiSdkTransport(options: AiSdkTransportOptions): AiSdkTransport<TPart>
657
+ one of: api | transport
658
+ api: string
659
+ transport: ChatTransport<UIMessage<unknown, UIDataTypes, UITools>>
660
+ headers?: Record<string, string> | Headers [with api]
661
+ credentials?: RequestCredentials [with api]
662
+ fetch?: typeof fetch [with api]
631
663
  Signature: parseAgentPart(raw: unknown): AgentPart | null
632
664
  Signature: toAgentError(error: unknown): AgentError
633
665
  Signature: useAgentThreadRuns(props: UseAgentThreadRunsArgs<TPart>): UseAgentThreadRunsReturn<TPart>
@@ -643,7 +675,7 @@ OptionalPeers: use-stick-to-bottom@^1.1.6, @tanstack/react-virtual@>=3.14.0 <4
643
675
 
644
676
  ## basalt-ui/content
645
677
  Import: import { ... } from 'basalt-ui/content'
646
- Description: Prose (article/chat typography), Callout, TableOfContents, Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY — `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust="untrusted"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering — settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) — the content/prose surface
678
+ Description: Prose (article/chat typography), Callout, TableOfContents (given a containerRef it collects the id-bearing h2/h3 under that one container — levels changes which — on mount and on every DOM childList change, so it reads the slug ids `Markdown` gives every heading; `Prose` sets no ids and an explicit items list replaces collection), Markdown (react-markdown + remark-gfm, optional peers; `streaming` is a rendering mode ONLY — `contentTrust` is the independent security input, and any surface rendering agent/model output must pin `contentTrust="untrusted"`, the sole input to the image-origin allowlist; `fenceRenderers` extends fenced-block rendering — settledOnly/FenceRenderer/FenceRenderers; `sanitizeSchema` is an additions-only SanitizeSchemaExtension merged over the default via mergeSanitizeSchema; shiki code blocks, beautiful-mermaid diagrams and the remend streaming repair load lazily from optional peers), ArticleLayout (docs-page frame), GuideLink (contextual-help link) — the content/prose surface
647
679
  Layer: mantine-coupled
648
680
  Rule: basalt-batteries
649
681
  Signature: ArticleLayout(props: ArticleLayoutProps): JSX.Element
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "basalt-ui",
3
- "version": "2.7.2",
3
+ "version": "2.8.0",
4
4
  "description": "Opinionated framework for Mantine-based React apps — theme, app shell, TanStack Charts, toolchain presets",
5
5
  "keywords": [
6
6
  "charts",