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
@@ -1,10 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { MantineProvider, useComputedColorScheme } from "@mantine/core";
3
- import { Component, useEffect } from "react";
2
+ import { MantineProvider, useComputedColorScheme, useMantineTheme } from "@mantine/core";
3
+ import { Component, useEffect, useMemo } from "react";
4
4
  import { VxThemeProvider } from "../charts/theme.js";
5
5
  import { ConnectivityProvider } from "../connectivity/index.js";
6
- import { createBasaltTheme, cssVariablesResolver } from "../theme/index.js";
7
- import { buildPaletteCss } from "../tokens/index.js";
6
+ import { cssVariablesResolver } from "../theme/index.js";
7
+ import { useLabTheme } from "./lab-theme.js";
8
+ import { buildDensityCss, buildFontsCss, buildPaletteCss, buildRadiusCss } from "../tokens/index.js";
9
+ import { isDefaultDeriveConfig } from "../tokens/derive.js";
10
+ import { buildPaletteData } from "../tokens/palette.js";
8
11
  function defaultOnError(error, ctx) {
9
12
  if (process.env["NODE_ENV"] !== "production") {
10
13
  console.error("[BasaltProvider] unhandled error", ctx.kind, error);
@@ -30,6 +33,9 @@ class BasaltErrorBoundary extends Component {
30
33
  return this.props.children;
31
34
  }
32
35
  }
36
+ function composeInjectedCss(base, fontsCss, radiusCss, densityCss) {
37
+ return [base, fontsCss, radiusCss, densityCss].filter(Boolean).join("\n");
38
+ }
33
39
  function BasaltBridge({
34
40
  children,
35
41
  injectPalette,
@@ -38,6 +44,23 @@ function BasaltBridge({
38
44
  onError
39
45
  }) {
40
46
  const resolved = useComputedColorScheme("dark");
47
+ const theme = useMantineTheme();
48
+ const deriveConfig = theme.other?.basaltDerive;
49
+ const fontsConfig = theme.other?.basaltFonts;
50
+ const radiusConfig = theme.other?.basaltRadius;
51
+ const densityConfig = theme.other?.basaltDensity;
52
+ const paletteCss = useMemo(() => {
53
+ if (!injectPalette) return "";
54
+ const base = deriveConfig === void 0 || isDefaultDeriveConfig(deriveConfig) ? buildPaletteCss(paletteOptions) : (
55
+ // Memoized by `buildPaletteData` (keyed on the config value), so retuning is never a
56
+ // per-render re-derivation once a given config has been built once.
57
+ buildPaletteCss(paletteOptions, buildPaletteData(deriveConfig))
58
+ );
59
+ const fontsCss = buildFontsCss(fontsConfig);
60
+ const radiusCss = buildRadiusCss(radiusConfig);
61
+ const densityCss = buildDensityCss(densityConfig);
62
+ return composeInjectedCss(base, fontsCss, radiusCss, densityCss);
63
+ }, [injectPalette, deriveConfig, fontsConfig, radiusConfig, densityConfig, paletteOptions]);
41
64
  useEffect(() => {
42
65
  if (typeof window === "undefined") return;
43
66
  const handleError = (e) => {
@@ -54,7 +77,7 @@ function BasaltBridge({
54
77
  };
55
78
  }, [onError]);
56
79
  return /* @__PURE__ */ jsxs(VxThemeProvider, { colorScheme: resolved, children: [
57
- injectPalette ? /* @__PURE__ */ jsx("style", { nonce, children: buildPaletteCss(paletteOptions) }) : null,
80
+ injectPalette ? /* @__PURE__ */ jsx("style", { nonce, children: paletteCss }) : null,
58
81
  children
59
82
  ] });
60
83
  }
@@ -72,10 +95,11 @@ function BasaltProvider({
72
95
  ...rest
73
96
  }) {
74
97
  const errorHandler = onError ?? defaultOnError;
98
+ const resolvedTheme = useLabTheme(theme);
75
99
  return /* @__PURE__ */ jsx(
76
100
  MantineProvider,
77
101
  {
78
- theme: createBasaltTheme(theme),
102
+ theme: resolvedTheme,
79
103
  cssVariablesResolver,
80
104
  defaultColorScheme,
81
105
  ...rest,
@@ -102,5 +126,6 @@ function BasaltProvider({
102
126
  }
103
127
  export {
104
128
  BasaltErrorBoundary,
105
- BasaltProvider
129
+ BasaltProvider,
130
+ composeInjectedCss
106
131
  };
@@ -0,0 +1,39 @@
1
+ import type { MantineThemeOverride } from '@mantine/core';
2
+ import type { DeriveOverride } from '../theme-lab/derive-state.js';
3
+ /**
4
+ * The minimal override that carries `base` to `next` — every field `next` sets to something `base`
5
+ * doesn't already say, recursed into nested plain objects (so a single changed `defaultProps` number
6
+ * yields just that one key, not the whole `components` map). Function-valued fields are skipped; see
7
+ * the comment in `deltaOf`.
8
+ *
9
+ * Exported for `lab-theme.test.ts`.
10
+ */
11
+ export declare function themeOverrideDelta(base: MantineThemeOverride, next: MantineThemeOverride): MantineThemeOverride;
12
+ /**
13
+ * Resolve the theme `BasaltProvider` hands to `MantineProvider`: the consumer's theme merged onto
14
+ * the Basalt base as always, plus — when a lab override is active — the delta that override makes
15
+ * against the shipped base.
16
+ *
17
+ * Pure and synchronous so `lab-theme.test.ts` can assert the merge result without a DOM.
18
+ */
19
+ export declare function applyLabOverride(overrides: MantineThemeOverride | undefined, override: DeriveOverride | null): MantineThemeOverride;
20
+ /**
21
+ * Dev build: subscribed to the lab store.
22
+ *
23
+ * `state` is a referentially STABLE snapshot — `createPersistedState` caches the parsed value keyed
24
+ * on the raw localStorage string — so it is a sound memo dep, and one write (a slider drag) is
25
+ * exactly one recompute. The memo matters: `createBasaltTheme`'s non-default paths allocate a fresh
26
+ * theme per call, and an unmemoized result would hand `MantineProvider` a new `theme` reference every
27
+ * render and churn every consumer of Mantine's theme context (the reason `createBasaltTheme`'s own
28
+ * JSDoc says to call it at module scope).
29
+ */
30
+ declare function useLabThemeDev(overrides: MantineThemeOverride | undefined): MantineThemeOverride;
31
+ /**
32
+ * `BasaltProvider`'s theme resolution. Picked at module scope, not per render — both implementations
33
+ * call their hooks unconditionally at their own top level, and which one is bound never changes for
34
+ * the app's lifetime, so the hook order is as stable as a plain function's (a `LAB_ENABLED ? use…()`
35
+ * inline in one function body would be a conditional hook call and a `react/rules-of-hooks` error).
36
+ */
37
+ export declare const useLabTheme: typeof useLabThemeDev;
38
+ export {};
39
+ //# sourceMappingURL=lab-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lab-theme.d.ts","sourceRoot":"","sources":["../../src/provider/lab-theme.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAGzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AA2C/D;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,oBAAoB,EAC1B,IAAI,EAAE,oBAAoB,GACzB,oBAAoB,CAEtB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,oBAAoB,GAAG,SAAS,EAC3C,QAAQ,EAAE,cAAc,GAAG,IAAI,GAC9B,oBAAoB,CAWtB;AAgBD;;;;;;;;;GASG;AACH,iBAAS,cAAc,CAAC,SAAS,EAAE,oBAAoB,GAAG,SAAS,GAAG,oBAAoB,CAGzF;AAOD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,uBAAiD,CAAA"}
@@ -0,0 +1,52 @@
1
+ import { mergeThemeOverrides } from "@mantine/core";
2
+ import { useMemo } from "react";
3
+ import { useDeriveControlsState, toDeriveOverride } from "../theme-lab/derive-state.js";
4
+ import { baseTheme, createBasaltTheme } from "../theme/index.js";
5
+ const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
6
+ function sameLeaf(a, b) {
7
+ if (a === b) return true;
8
+ if (a === void 0 || b === void 0) return false;
9
+ return JSON.stringify(a) === JSON.stringify(b);
10
+ }
11
+ function deltaOf(base, next) {
12
+ const out = {};
13
+ for (const [key, nextValue] of Object.entries(next)) {
14
+ if (nextValue === void 0) continue;
15
+ if (typeof nextValue === "function") continue;
16
+ const baseValue = base[key];
17
+ if (isPlainObject(nextValue) && isPlainObject(baseValue)) {
18
+ const nested = deltaOf(baseValue, nextValue);
19
+ if (Object.keys(nested).length > 0) out[key] = nested;
20
+ continue;
21
+ }
22
+ if (!sameLeaf(baseValue, nextValue)) out[key] = nextValue;
23
+ }
24
+ return out;
25
+ }
26
+ function themeOverrideDelta(base, next) {
27
+ return deltaOf(base, next);
28
+ }
29
+ function applyLabOverride(overrides, override) {
30
+ const theme = createBasaltTheme(overrides);
31
+ if (override === null) return theme;
32
+ const labTheme = createBasaltTheme(void 0, {
33
+ derive: override.config,
34
+ radius: override.radiusLevel,
35
+ density: override.densityLevel
36
+ });
37
+ return mergeThemeOverrides(theme, themeOverrideDelta(baseTheme, labTheme));
38
+ }
39
+ const LAB_ENABLED = process.env["NODE_ENV"] !== "production";
40
+ function useLabThemeDev(overrides) {
41
+ const [state] = useDeriveControlsState();
42
+ return useMemo(() => applyLabOverride(overrides, toDeriveOverride(state)), [overrides, state]);
43
+ }
44
+ function useLabThemeProd(overrides) {
45
+ return useMemo(() => createBasaltTheme(overrides), [overrides]);
46
+ }
47
+ const useLabTheme = LAB_ENABLED ? useLabThemeDev : useLabThemeProd;
48
+ export {
49
+ applyLabOverride,
50
+ themeOverrideDelta,
51
+ useLabTheme
52
+ };
@@ -49,7 +49,7 @@
49
49
  flex-shrink: 0;
50
50
  }
51
51
 
52
- @media (max-width: 47.99em) {
52
+ @media (max-width: 47.99375em) {
53
53
  .bar {
54
54
  flex-wrap: wrap;
55
55
  align-content: center;
@@ -67,7 +67,7 @@
67
67
  .pageActions {
68
68
  order: 3;
69
69
  flex-basis: 100%;
70
- height: 52px;
70
+ height: var(--vx-space-app-header-mobile-actions-height);
71
71
  justify-content: flex-start;
72
72
  }
73
73
  }
@@ -14,7 +14,7 @@
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  justify-content: center;
17
- gap: 3px;
17
+ gap: var(--vx-space-mobile-nav-tab-gap);
18
18
  color: var(--mantine-color-dimmed);
19
19
  }
20
20
 
@@ -1 +1 @@
1
- {"version":3,"file":"app-sidebar-account.d.ts","sourceRoot":"","sources":["../../src/shell/app-sidebar-account.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAqDzD,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAqE/E"}
1
+ {"version":3,"file":"app-sidebar-account.d.ts","sourceRoot":"","sources":["../../src/shell/app-sidebar-account.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAqDzD,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BA2E/E"}
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { Group, Menu, Skeleton, Stack, Text, UnstyledButton } from "@mantine/core";
3
+ import { useBasaltSpacing } from "../theme/index.js";
3
4
  import classes from "./app-sidebar.module.css";
4
5
  function getInitials(name) {
5
6
  const parts = name.trim().split(/\s+/).filter(Boolean);
@@ -32,7 +33,7 @@ function IconUser() {
32
33
  }
33
34
  function AccountSkeleton() {
34
35
  return /* @__PURE__ */ jsxs(Group, { className: classes.accountRow, gap: "sm", wrap: "nowrap", children: [
35
- /* @__PURE__ */ jsx(Skeleton, { height: 28, width: 28, radius: 7 }),
36
+ /* @__PURE__ */ jsx(Skeleton, { height: 28, width: 28, style: { borderRadius: "var(--vx-radius-card)" } }),
36
37
  /* @__PURE__ */ jsxs(Stack, { gap: 4, className: classes.accountText, children: [
37
38
  /* @__PURE__ */ jsx(Skeleton, { height: 10, width: "70%", radius: "sm" }),
38
39
  /* @__PURE__ */ jsx(Skeleton, { height: 9, width: "50%", radius: "sm" })
@@ -40,6 +41,7 @@ function AccountSkeleton() {
40
41
  ] });
41
42
  }
42
43
  function SidebarAccount({ state, actions, showEmail }) {
44
+ const { step } = useBasaltSpacing();
43
45
  if (state.status === "loading") {
44
46
  return /* @__PURE__ */ jsx(AccountSkeleton, {});
45
47
  }
@@ -51,7 +53,7 @@ function SidebarAccount({ state, actions, showEmail }) {
51
53
  }
52
54
  const { identity, role, plan } = state;
53
55
  const canUpgrade = Boolean(plan?.isFree && actions?.onUpgrade);
54
- return /* @__PURE__ */ jsxs(Menu, { position: "right-end", withArrow: true, width: 220, zIndex: 500, children: [
56
+ return /* @__PURE__ */ jsxs(Menu, { position: "right-end", withArrow: true, width: step.sidebarAccountMenuWidth, zIndex: 500, children: [
55
57
  /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsxs(UnstyledButton, { className: classes.accountRow, "aria-label": "Account menu", children: [
56
58
  /* @__PURE__ */ jsx(InitialsBlock, { name: identity.name }),
57
59
  /* @__PURE__ */ jsxs(Stack, { gap: 2, className: classes.accountText, children: [
@@ -1 +1 @@
1
- {"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/app-sidebar.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAA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gB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEzF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAK3D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE;IACJ,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IAChC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACtC,KACE,SAAS,CAAA;AAEd,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,WAAW,CAAA;IAClB,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;;OAGG;IACH,aAAa,CAAC,EAAE,eAAe,CAAA;IAC/B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACtC,mGAAmG;IACnG,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAA;CAC7B,CAAA;AAkWD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,MAAM,GACP,EAAE,eAAe,+BAsLjB"}
@@ -18,6 +18,7 @@ import { useRef, useState } from "react";
18
18
  import { SidebarAccount } from "./app-sidebar-account.js";
19
19
  import { SidebarSearch } from "./sidebar-search.js";
20
20
  import { VX } from "../tokens/index.js";
21
+ import { useBasaltSpacing } from "../theme/index.js";
21
22
  import classes from "./app-sidebar.module.css";
22
23
  function IconCollapse({ collapsed }) {
23
24
  return /* @__PURE__ */ jsxs(
@@ -315,6 +316,7 @@ function AppSidebar({
315
316
  account,
316
317
  search
317
318
  }) {
319
+ const { step } = useBasaltSpacing();
318
320
  const [collapsedSections, setCollapsedSections] = useState(
319
321
  () => Object.fromEntries(sections.map((s) => [s.label, Boolean(s.defaultCollapsed)]))
320
322
  );
@@ -343,7 +345,7 @@ function AppSidebar({
343
345
  ] });
344
346
  const hasSettingsMenu = (settingsMenuItems?.length ?? 0) > 0;
345
347
  const settingsRow = hasSettingsMenu ? /* @__PURE__ */ jsxs(Group, { ...account ? {} : { className: classes.footer }, gap: "xs", wrap: "nowrap", children: [
346
- /* @__PURE__ */ jsxs(Menu, { position: "right-start", withArrow: true, width: 200, zIndex: 500, children: [
348
+ /* @__PURE__ */ jsxs(Menu, { position: "right-start", withArrow: true, width: step.sidebarSettingsMenuWidth, zIndex: 500, children: [
347
349
  /* @__PURE__ */ jsx(Menu.Target, { children: /* @__PURE__ */ jsxs(UnstyledButton, { className: classes.footerBtn, "aria-label": "Settings", children: [
348
350
  /* @__PURE__ */ jsx(IconGear, {}),
349
351
  /* @__PURE__ */ jsx(Text, { className: classes.footerText, fz: VX.text.md, children: "Settings" })
@@ -390,7 +392,7 @@ function AppSidebar({
390
392
  ActionIcon,
391
393
  {
392
394
  variant: "subtle",
393
- size: "md",
395
+ size: 28,
394
396
  visibleFrom: "sm",
395
397
  className: `${classes.collapseBtn} ${classes.ghostIcon}`,
396
398
  onClick: onToggleCollapse,
@@ -17,14 +17,16 @@
17
17
  * a consuming app's bundler — `!important` makes the override deterministic.
18
18
  */
19
19
 
20
- /* Sidebar frame — the ~10px inner horizontal padding every region (brand/nav/footer) sits in. */
20
+ /* Sidebar frame — the ~10px inner horizontal padding every region (brand/nav/footer) sits in.
21
+ * Reuses `SPACE.rowInsetX` (the same horizontal inset a nav/menu row carries) since this IS the
22
+ * master column every region aligns to — see the several `--vx-space-row-inset-x` reuses below. */
21
23
  .root {
22
- padding: 0 10px;
24
+ padding: 0 var(--vx-space-row-inset-x);
23
25
  }
24
26
 
25
27
  .link {
26
28
  font-size: var(--vx-text-md);
27
- border-radius: 6px !important;
29
+ border-radius: var(--vx-radius-ctrl) !important;
28
30
  }
29
31
 
30
32
  .link :global(.mantine-NavLink-label) {
@@ -32,7 +34,7 @@
32
34
  }
33
35
 
34
36
  .link :global(.mantine-NavLink-section[data-position='left']) {
35
- margin-inline-end: 10px;
37
+ margin-inline-end: var(--vx-space-nav-icon-gap);
36
38
  }
37
39
 
38
40
  /* Inactive rows: muted text + faint icon. Active rows keep the theme's ink text (via `--nl-color`)
@@ -68,7 +70,7 @@
68
70
  */
69
71
  .ghostIcon {
70
72
  color: var(--vx-faint) !important;
71
- border-radius: 6px !important;
73
+ border-radius: var(--vx-radius-ctrl) !important;
72
74
  }
73
75
 
74
76
  .ghostIcon:hover {
@@ -82,7 +84,8 @@
82
84
  */
83
85
  .brand {
84
86
  justify-content: space-between;
85
- padding: 3px 8px 12px;
87
+ padding: var(--vx-space-sidebar-brand-inset-top) var(--vx-space-sidebar-brand-inset-x)
88
+ var(--vx-space-sidebar-region-gap);
86
89
  flex-shrink: 0;
87
90
  }
88
91
 
@@ -98,7 +101,7 @@
98
101
  /* No horizontal padding — the field spans the same width as the nav rows below it (both sit at the
99
102
  * `.root` 10px inset), so the search box edge-aligns with the nav column. */
100
103
  .searchSlot {
101
- padding: 0 0 12px;
104
+ padding: 0 0 var(--vx-space-sidebar-region-gap);
102
105
  flex-shrink: 0;
103
106
  }
104
107
 
@@ -122,20 +125,20 @@
122
125
  /* Bleed the scroll root across `.root`'s right inset so the overlay bar draws in that 10px
123
126
  * gutter instead of on top of the rows (it anchors to the root's right edge, which otherwise
124
127
  * lands exactly on the row's own right padding — the bar then crowds the badge column). */
125
- margin-right: -10px;
128
+ margin-right: calc(-1 * var(--vx-space-row-inset-x));
126
129
  }
127
130
 
128
131
  /* Re-apply the bled inset INSIDE the viewport, so rows keep their exact 10px/10px column while the
129
132
  * bar floats clear of them in the gutter. Static padding, not Mantine's `offsetScrollbars`: the
130
133
  * latter pads only while overflowing, which reflows the rows the moment a section expands. */
131
134
  .navViewport {
132
- padding-inline-end: 10px;
135
+ padding-inline-end: var(--vx-space-row-inset-x);
133
136
  }
134
137
 
135
138
  /* Sections separate by SPACING only — 15px between sections, nothing above the first (the brand
136
139
  * row's own bottom padding already opens the region). */
137
140
  .nav > div + div {
138
- margin-top: 15px;
141
+ margin-top: var(--vx-space-sidebar-section-gap);
139
142
  }
140
143
 
141
144
  /*
@@ -155,9 +158,9 @@
155
158
  min-width: 0;
156
159
  display: flex;
157
160
  align-items: center;
158
- gap: 10px;
159
- padding: 6px 10px;
160
- border-radius: 6px;
161
+ gap: var(--vx-space-nav-icon-gap);
162
+ padding: var(--vx-space-row-inset-y) var(--vx-space-row-inset-x);
163
+ border-radius: var(--vx-radius-ctrl);
161
164
  font-size: var(--vx-text-md);
162
165
  color: var(--vx-muted);
163
166
  }
@@ -190,9 +193,10 @@
190
193
  min-width: 0;
191
194
  display: flex;
192
195
  align-items: center;
193
- gap: 10px;
194
- padding: 11px 8px 3px;
195
- border-radius: 6px;
196
+ gap: var(--vx-space-nav-icon-gap);
197
+ padding: var(--vx-space-sidebar-account-inset-top) var(--vx-space-sidebar-account-inset-x)
198
+ var(--vx-space-sidebar-account-inset-bottom);
199
+ border-radius: var(--vx-radius-ctrl);
196
200
  }
197
201
 
198
202
  .accountRow:hover {
@@ -214,9 +218,9 @@
214
218
  display: flex;
215
219
  align-items: center;
216
220
  justify-content: center;
217
- width: 28px;
218
- height: 28px;
219
- border-radius: 7px;
221
+ width: var(--vx-space-sidebar-avatar-size);
222
+ height: var(--vx-space-sidebar-avatar-size);
223
+ border-radius: var(--vx-radius-card);
220
224
  background-color: color-mix(in srgb, var(--vx-ink) 10%, transparent);
221
225
  color: var(--vx-muted);
222
226
  font-family: var(--basalt-font-mono);
@@ -265,8 +269,8 @@
265
269
  align-items: center;
266
270
  justify-content: space-between;
267
271
  width: 100%;
268
- padding: 0 10px;
269
- margin-bottom: 3px;
272
+ padding: 0 var(--vx-space-row-inset-x);
273
+ margin-bottom: var(--vx-space-sidebar-section-label-gap);
270
274
  }
271
275
 
272
276
  .sectionBand > svg {
@@ -293,15 +297,17 @@
293
297
  * `--vx-divider` left guide on the WRAPPER (not per row, so hover tints don't break the line).
294
298
  */
295
299
  .childList {
296
- margin: 2px 0 4px 17px;
300
+ margin: var(--vx-space-sidebar-child-list-gap-top) 0 var(--vx-space-sidebar-child-list-gap-bottom)
301
+ var(--vx-space-sidebar-child-list-indent);
297
302
  border-left: 1px solid var(--vx-divider);
298
303
  }
299
304
 
300
305
  /* Child row geometry — one size smaller than a parent row. The theme sets padding inline
301
306
  * (6px 10px), so the child value needs `!important`. */
302
307
  .childList :global(.mantine-NavLink-root) {
303
- padding: 5px 10px 5px 14px !important;
304
- border-radius: 6px !important;
308
+ padding: var(--vx-space-sidebar-child-row-inset-y) var(--vx-space-row-inset-x)
309
+ var(--vx-space-sidebar-child-row-inset-y) var(--vx-space-sidebar-child-row-indent) !important;
310
+ border-radius: var(--vx-radius-ctrl) !important;
305
311
  }
306
312
 
307
313
  .childList :global(.mantine-NavLink-label) {
@@ -331,7 +337,11 @@
331
337
  }
332
338
  }
333
339
 
334
- /* Subnav popover dropdown — match sidebar density. */
340
+ /* Subnav popover dropdown — match sidebar density. A `min-width`, not a `width`: it only floors the
341
+ * box and grows with content, so — unlike a fixed `width` (see the account/settings `<Menu
342
+ * width={…}>` props in app-sidebar.tsx/app-sidebar-account.tsx, tokenized onto
343
+ * `SPACE_STEP.sidebarAccountMenuWidth`/`.sidebarSettingsMenuWidth`) — a rising density can never
344
+ * squeeze it, so it stays a raw literal on purpose. */
335
345
  .subnavDropdown {
336
346
  min-width: 180px;
337
347
  }
@@ -355,7 +365,7 @@
355
365
  }
356
366
 
357
367
  .root[data-collapsed] .searchSlot {
358
- padding: 0 0 12px;
368
+ padding: 0 0 var(--vx-space-sidebar-region-gap);
359
369
  display: flex;
360
370
  justify-content: center;
361
371
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAI3D,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAElF,+EAA+E;AAC/E,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,KAAK,CA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AgB,EAAE,CAAA;IACtC;;;OAGG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,kGAAkG;IAClG,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAChD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAA;IACzD,oBAAoB;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,sCAsBzD;AA2ED,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,iBAAiB,EACjB,UAAuC,EACvC,SAAS,EAAE,aAAa,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,EAAE,gBAAgB,+BAiFlB"}
@@ -6,6 +6,7 @@ import { MobileNav } from "./app-mobile-nav.js";
6
6
  import { AppBreadcrumbs } from "./app-breadcrumbs.js";
7
7
  import { PageActionsOutlet, PageHeaderProvider } from "./page-header.js";
8
8
  import { VX } from "../tokens/index.js";
9
+ import { useBasaltSpacing } from "../theme/index.js";
9
10
  import headerClasses from "./app-header.module.css";
10
11
  import { AppSidebar as AppSidebar2 } from "./app-sidebar.js";
11
12
  import { SidebarSearch } from "./sidebar-search.js";
@@ -21,7 +22,6 @@ function NavCountBadge({ count }) {
21
22
  Badge,
22
23
  {
23
24
  size: "sm",
24
- radius: 5,
25
25
  styles: {
26
26
  root: {
27
27
  backgroundColor: "color-mix(in srgb, var(--vx-ink) 8%, transparent)",
@@ -31,7 +31,8 @@ function NavCountBadge({ count }) {
31
31
  fontWeight: 500,
32
32
  height: 16,
33
33
  padding: "0 5px",
34
- marginLeft: "auto"
34
+ marginLeft: "auto",
35
+ borderRadius: "var(--vx-radius-tight)"
35
36
  }
36
37
  },
37
38
  children: count
@@ -103,6 +104,7 @@ function BasaltShell({
103
104
  search,
104
105
  children
105
106
  }) {
107
+ const { step } = useBasaltSpacing();
106
108
  const [mobileOpened, { toggle: toggleMobile, close: closeMobile }] = useDisclosure();
107
109
  const [storedCollapsed, setStoredCollapsed] = useLocalStorage({
108
110
  key: storageKey,
@@ -123,9 +125,14 @@ function BasaltShell({
123
125
  {
124
126
  h: "100dvh",
125
127
  layout: "alt",
126
- header: { height: { base: 96, sm: 48 } },
128
+ header: {
129
+ height: { base: step.appShellHeaderMobileHeight, sm: step.appShellHeaderHeight }
130
+ },
127
131
  navbar: {
128
- width: { base: 216, sm: collapsed ? 48 : 216 },
132
+ width: {
133
+ base: step.appShellNavbarWidth,
134
+ sm: collapsed ? step.appShellNavbarRailWidth : step.appShellNavbarWidth
135
+ },
129
136
  breakpoint: "sm",
130
137
  collapsed: { mobile: !mobileOpened }
131
138
  },
@@ -6,10 +6,10 @@
6
6
  .trigger {
7
7
  display: flex;
8
8
  align-items: center;
9
- gap: 8px;
9
+ gap: var(--vx-space-sidebar-search-gap);
10
10
  width: 100%;
11
- height: 32px;
12
- padding: 0 10px;
11
+ height: var(--vx-space-sidebar-search-trigger-height);
12
+ padding: 0 var(--vx-space-row-inset-x);
13
13
  border-radius: var(--vx-radius-ctrl);
14
14
  background-color: var(--vx-surface-panel);
15
15
  box-shadow: var(--vx-shadow-card);
@@ -50,10 +50,22 @@
50
50
  * Collapsed rail button — mirrors app-sidebar.module.css's `.ghostIcon`: faint icon, radius 6,
51
51
  * hover ink-6% + ink. `!important` for the same reason as that rule: it competes with Mantine's
52
52
  * own compiled ActionIcon variant CSS.
53
+ *
54
+ * `--ai-size` is re-pointed at the SAME resolved `sidebarSearchTriggerHeight` the expanded trigger
55
+ * reads (`.trigger`'s `height` below), not the generic control-height anchor the theme's
56
+ * `ActionIcon.extend` `vars` sets for every OTHER `size="md"` ActionIcon (`theme/index.ts`) — that
57
+ * anchor is tuned to match a `size="md"` Input/Button (42px at level 0), a different, larger control
58
+ * than this compact icon-only rail toggle. Without this override the two states of one logical
59
+ * control (expanded trigger vs. collapsed rail icon) would render at different heights AND, at a
60
+ * negative density level, the rail icon would stop tracking the trigger's own WCAG 24px floor
61
+ * (`deriveSpacing`'s doc in `tokens/palette.ts`). `!important` wins over the theme's own inline
62
+ * `--ai-size` (a non-`!important` `vars` declaration, i.e. an inline style) for the same
63
+ * cascade reason the other declarations here need it.
53
64
  */
54
65
  .railBtn {
66
+ --ai-size: var(--vx-space-sidebar-search-trigger-height) !important;
55
67
  color: var(--vx-faint) !important;
56
- border-radius: 6px !important;
68
+ border-radius: var(--vx-radius-ctrl) !important;
57
69
  }
58
70
 
59
71
  .railBtn:hover {
package/dist/styles.css CHANGED
@@ -116,7 +116,7 @@
116
116
 
117
117
  *::-webkit-scrollbar-thumb {
118
118
  background-color: var(--basalt-scrollbar-thumb);
119
- border-radius: 6px;
119
+ border-radius: var(--vx-radius-ctrl);
120
120
  }
121
121
 
122
122
  *::-webkit-scrollbar-thumb:hover {
@@ -6,13 +6,13 @@
6
6
  * RULE_NAMES: derived projection — the deduped set of doctrine rule names (PROJECTION 1).
7
7
  */
8
8
  import type { GuardKind } from './guard/types.js';
9
- /** The 12 on-disk rule names (agent/rules/basalt-{name}.md — the set-equality target).
9
+ /** The 13 on-disk rule names (agent/rules/basalt-{name}.md — the set-equality target).
10
10
  *
11
11
  * @example
12
12
  * const r: RuleName = 'tokens' // ok
13
13
  * // const bad: RuleName = 'overlays' // tsc error — not in the union
14
14
  */
15
- export type RuleName = 'tokens' | 'charts' | 'mantine' | 'router' | 'query' | 'state' | 'forms' | 'notifications' | 'commands' | 'data' | 'agent' | 'content';
15
+ export type RuleName = 'tokens' | 'charts' | 'mantine' | 'router' | 'query' | 'state' | 'forms' | 'notifications' | 'commands' | 'data' | 'agent' | 'content' | 'app';
16
16
  /** The 3 shipped skill names (agent/skills/basalt-{name}/SKILL.md, placed into a consumer's
17
17
  * .claude/skills/ by `basalt-ui init`/`sync` — the same managed path the rules take).
18
18
  *
@@ -73,6 +73,14 @@ type BaseSurface = {
73
73
  readonly shipped: readonly string[];
74
74
  readonly repo: readonly string[];
75
75
  };
76
+ /**
77
+ * Optional peer package names this surface depends on (e.g. '@tanstack/react-query').
78
+ * Single source of truth — read by gen-llms.ts and cli/index.ts; versions resolved from package.json.
79
+ *
80
+ * Lives on the base, not the doctrine triad: an optional peer is a PACKAGING fact, so a tooling
81
+ * surface can carry one too (`./vite` → `vite-plugin-pwa`).
82
+ */
83
+ readonly optionalPeers?: readonly string[];
76
84
  };
77
85
  /**
78
86
  * A doctrine surface owes the full triad (rule + skill[] + guardKinds[]).
@@ -89,11 +97,6 @@ export type DoctrineSpec = BaseSurface & {
89
97
  readonly skill: readonly SkillName[];
90
98
  /** Required, but [] is legal for advisory surfaces (router/query: rule only, no guard). */
91
99
  readonly guardKinds: readonly GuardKind[];
92
- /**
93
- * Optional peer package names this surface depends on (e.g. '@tanstack/react-query').
94
- * Single source of truth — read by gen-llms.ts and cli/index.ts; versions resolved from package.json.
95
- */
96
- readonly optionalPeers?: readonly string[];
97
100
  };
98
101
  /**
99
102
  * A tooling surface owes NO triad — these fields are statically ABSENT (cannot be set).
@@ -166,13 +169,14 @@ export declare const SURFACES: {
166
169
  readonly './theme-lab': {
167
170
  readonly kind: "tooling";
168
171
  readonly layer: "mantine-coupled";
169
- readonly description: "ThemeLabControls, applyOverrides, COLOR_GROUPS for live theme inspection";
172
+ readonly description: "ThemeLabControls, applyOverrides, COLOR_GROUPS — a low-level inspector for the non-derived structural tokens; identity/color tuning lives in DeriveControls";
170
173
  readonly forbiddenImports: readonly [];
171
174
  };
172
175
  readonly './vite': {
173
176
  readonly kind: "tooling";
174
177
  readonly layer: "mantine-coupled";
175
- readonly description: "basaltViteConfig(opts) — Vite preset for basalt-ui consumer apps";
178
+ readonly description: "basaltViteConfig(opts) — Vite preset for basalt-ui consumer apps; basaltAppPlugin(opts) — PWA head, manifest, and icon metadata derived from the token palette";
179
+ readonly optionalPeers: readonly ["vite-plugin-pwa"];
176
180
  readonly forbiddenImports: readonly [];
177
181
  };
178
182
  readonly './guard': {
@@ -342,7 +346,7 @@ export declare const SURFACES: {
342
346
  readonly '#app': {
343
347
  readonly kind: "doctrine";
344
348
  readonly layer: "app-global";
345
- readonly rule: "mantine";
349
+ readonly rule: "app";
346
350
  readonly skill: readonly ["basalt-app"];
347
351
  readonly guardKinds: readonly [];
348
352
  readonly globs: {
@@ -359,7 +363,7 @@ export declare const SURFACES: {
359
363
  };
360
364
  /**
361
365
  * Derived, deduped set of doctrine rule names. Projection 1 of SURFACES.
362
- * → ['mantine', 'charts', 'tokens', 'query', 'router', 'forms', 'notifications', 'commands', 'data', 'agent', 'content', 'state'] (order is insertion order of Set)
366
+ * → ['mantine', 'charts', 'tokens', 'query', 'router', 'forms', 'notifications', 'commands', 'data', 'agent', 'content', 'state', 'app'] (order is insertion order of Set)
363
367
  *
364
368
  * @example
365
369
  * RULE_NAMES.includes('tokens') // true