basalt-ui 2.11.1 → 2.13.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 (151) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +39 -0
  3. package/MIGRATING.md +51 -12
  4. package/README.md +2 -0
  5. package/agent/rules/basalt-mantine.md +1 -1
  6. package/agent/rules/basalt-state.md +1 -1
  7. package/agent/skills/basalt-app/SKILL.md +2 -2
  8. package/agent/templates/main.tpl +1 -0
  9. package/dist/cli/basalt-install.d.ts +10 -0
  10. package/dist/cli/basalt-install.d.ts.map +1 -0
  11. package/dist/cli/basalt-install.js +0 -0
  12. package/dist/cli/check-theme.js +1 -1
  13. package/dist/cli/doctor-upgrade.d.ts +5 -6
  14. package/dist/cli/doctor-upgrade.d.ts.map +1 -1
  15. package/dist/cli/doctor-upgrade.js +85 -56
  16. package/dist/cli/doctor.js +3 -3
  17. package/dist/cli/index.d.ts +5 -27
  18. package/dist/cli/index.d.ts.map +1 -1
  19. package/dist/cli/index.js +12 -49
  20. package/dist/cli/provider-tags.d.ts +12 -0
  21. package/dist/cli/provider-tags.d.ts.map +1 -0
  22. package/dist/cli/provider-tags.js +28 -0
  23. package/dist/cli/render-imports.d.ts +24 -0
  24. package/dist/cli/render-imports.d.ts.map +1 -0
  25. package/dist/cli/render-imports.js +74 -0
  26. package/dist/cli/router-wiring.d.ts +12 -0
  27. package/dist/cli/router-wiring.d.ts.map +1 -1
  28. package/dist/cli/router-wiring.js +18 -0
  29. package/dist/cli/source-text.d.ts +7 -0
  30. package/dist/cli/source-text.d.ts.map +1 -1
  31. package/dist/cli/source-text.js +34 -0
  32. package/dist/cli/sync.d.ts.map +1 -1
  33. package/dist/cli/sync.js +19 -13
  34. package/dist/commands/command-stash.d.ts +15 -0
  35. package/dist/commands/command-stash.d.ts.map +1 -0
  36. package/dist/commands/command-stash.js +31 -0
  37. package/dist/commands/define-commands.d.ts +2 -3
  38. package/dist/commands/define-commands.d.ts.map +1 -1
  39. package/dist/commands/define-commands.js +9 -7
  40. package/dist/commands/define-overlays.d.ts +6 -12
  41. package/dist/commands/define-overlays.d.ts.map +1 -1
  42. package/dist/commands/define-overlays.js +28 -34
  43. package/dist/commands/projectors.js +1 -1
  44. package/dist/guard/fonts-hint.d.ts +3 -0
  45. package/dist/guard/fonts-hint.d.ts.map +1 -0
  46. package/dist/guard/fonts-hint.js +4 -0
  47. package/dist/guard/index.d.ts +1 -1
  48. package/dist/guard/index.d.ts.map +1 -1
  49. package/dist/guard/index.js +2 -1
  50. package/dist/index.d.ts +3 -3
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +3 -1
  53. package/dist/provider/create-router.d.ts +57 -10
  54. package/dist/provider/create-router.d.ts.map +1 -1
  55. package/dist/provider/create-router.js +28 -17
  56. package/dist/provider/hotkeys.d.ts +2 -6
  57. package/dist/provider/hotkeys.d.ts.map +1 -1
  58. package/dist/provider/hotkeys.js +10 -15
  59. package/dist/provider/index.d.ts +7 -5
  60. package/dist/provider/index.d.ts.map +1 -1
  61. package/dist/provider/index.js +35 -42
  62. package/dist/provider/modals-mount.d.ts +16 -0
  63. package/dist/provider/modals-mount.d.ts.map +1 -0
  64. package/dist/provider/modals-mount.js +42 -0
  65. package/dist/provider/notifier.d.ts +22 -0
  66. package/dist/provider/notifier.d.ts.map +1 -0
  67. package/dist/provider/notifier.js +36 -0
  68. package/dist/provider/route-transition.d.ts +1 -1
  69. package/dist/provider/route-transition.d.ts.map +1 -1
  70. package/dist/provider/route-transition.js +1 -1
  71. package/dist/provider/slots.d.ts +25 -0
  72. package/dist/provider/slots.d.ts.map +1 -0
  73. package/dist/provider/slots.js +29 -0
  74. package/dist/provider/spotlight-actions.d.ts +1 -1
  75. package/dist/provider/spotlight-actions.d.ts.map +1 -1
  76. package/dist/provider/spotlight-actions.js +2 -3
  77. package/dist/provider/spotlight-mount.d.ts +3 -0
  78. package/dist/provider/spotlight-mount.d.ts.map +1 -0
  79. package/dist/provider/spotlight-mount.js +26 -0
  80. package/dist/query-client.d.ts +2 -62
  81. package/dist/query-client.d.ts.map +1 -1
  82. package/dist/query-client.js +13 -18
  83. package/dist/router-tanstack/nav-stash.d.ts +24 -0
  84. package/dist/router-tanstack/nav-stash.d.ts.map +1 -0
  85. package/dist/router-tanstack/nav-stash.js +23 -0
  86. package/dist/router-tanstack/nav.d.ts +5 -15
  87. package/dist/router-tanstack/nav.d.ts.map +1 -1
  88. package/dist/router-tanstack/nav.js +6 -16
  89. package/dist/router-tanstack/search-store-warnings.d.ts +33 -0
  90. package/dist/router-tanstack/search-store-warnings.d.ts.map +1 -0
  91. package/dist/router-tanstack/search-store-warnings.js +77 -0
  92. package/dist/router-tanstack/search-store.d.ts +2 -5
  93. package/dist/router-tanstack/search-store.d.ts.map +1 -1
  94. package/dist/router-tanstack/search-store.js +111 -110
  95. package/dist/router-tanstack/use-nav.js +1 -1
  96. package/dist/surfaces.d.ts +1 -1
  97. package/dist/surfaces.js +1 -1
  98. package/dist/telemetry.d.ts +31 -2
  99. package/dist/telemetry.d.ts.map +1 -1
  100. package/dist/telemetry.js +32 -12
  101. package/dist/theme/ctl-theme.d.ts.map +1 -1
  102. package/dist/theme/ctl-theme.js +17 -30
  103. package/dist/theme/extend.d.ts +18 -0
  104. package/dist/theme/extend.d.ts.map +1 -0
  105. package/dist/theme/extend.js +6 -0
  106. package/dist/theme/index.d.ts.map +1 -1
  107. package/dist/theme/index.js +44 -84
  108. package/dist/unwrap.d.ts +29 -0
  109. package/dist/unwrap.d.ts.map +1 -0
  110. package/dist/unwrap.js +18 -0
  111. package/llms.txt +11 -7
  112. package/package.json +2 -2
  113. package/src/cli/basalt-install.ts +9 -0
  114. package/src/cli/check-theme.ts +1 -1
  115. package/src/cli/doctor-upgrade.ts +117 -72
  116. package/src/cli/doctor.ts +3 -3
  117. package/src/cli/index.ts +15 -70
  118. package/src/cli/provider-tags.ts +38 -0
  119. package/src/cli/render-imports.ts +104 -0
  120. package/src/cli/router-wiring.ts +23 -0
  121. package/src/cli/source-text.ts +39 -0
  122. package/src/cli/sync.ts +28 -22
  123. package/src/commands/command-stash.ts +44 -0
  124. package/src/commands/define-commands.ts +10 -17
  125. package/src/commands/define-overlays.ts +40 -68
  126. package/src/commands/projectors.ts +1 -1
  127. package/src/guard/fonts-hint.ts +2 -0
  128. package/src/guard/index.ts +2 -2
  129. package/src/index.ts +4 -2
  130. package/src/provider/create-router.tsx +103 -39
  131. package/src/provider/hotkeys.ts +14 -22
  132. package/src/provider/index.tsx +55 -61
  133. package/src/provider/modals-mount.tsx +66 -0
  134. package/src/provider/notifier.ts +52 -0
  135. package/src/provider/route-transition.ts +1 -1
  136. package/src/provider/slots.ts +59 -0
  137. package/src/provider/spotlight-actions.tsx +3 -4
  138. package/src/provider/spotlight-mount.tsx +33 -0
  139. package/src/query-client.ts +20 -78
  140. package/src/router-tanstack/nav-stash.ts +41 -0
  141. package/src/router-tanstack/nav.ts +11 -31
  142. package/src/router-tanstack/search-store-warnings.ts +120 -0
  143. package/src/router-tanstack/search-store.ts +200 -206
  144. package/src/router-tanstack/use-nav.ts +1 -1
  145. package/src/surfaces.ts +1 -1
  146. package/src/telemetry.ts +71 -13
  147. package/src/theme/__snapshots__/plain-theme.test.ts.snap +2354 -0
  148. package/src/theme/ctl-theme.tsx +20 -19
  149. package/src/theme/extend.ts +18 -0
  150. package/src/theme/index.ts +50 -49
  151. package/src/unwrap.ts +44 -0
@@ -48,9 +48,11 @@ type ChatAttrs = {
48
48
  export type BasaltEvent = Ok<'route.navigate', RouteAttrs> | Err<'route.error', {
49
49
  'basalt.route.id': string;
50
50
  }> | Err<'query.error', {
51
+ /** `groupingId(queryHash)`: an opaque grouping id, not the key. */
51
52
  'basalt.query.hash': string;
52
53
  'basalt.query.failure_count': number;
53
54
  }> | Err<'mutation.error', {
55
+ /** `groupingId(JSON.stringify(key))`: an opaque grouping id, not the key. */
54
56
  'basalt.mutation.key': string;
55
57
  }> | Err<'render.error', {
56
58
  'basalt.error.boundary': 'root';
@@ -117,6 +119,17 @@ export type Telemetry = ((event: BasaltEvent) => void) & {
117
119
  readonly startChatTurn?: ((turn: ChatTurnInit) => ChatTurnTrace | undefined) | undefined;
118
120
  };
119
121
  export declare const now: () => number;
122
+ /**
123
+ * An opaque grouping id (32-bit djb2, hex) for a query or mutation key, so events from one key group
124
+ * together and the key's segments (ids, slugs) stay out of the event. NOT a privacy guarantee: it is
125
+ * non-cryptographic and a short or guessable key can be recovered by trying candidates.
126
+ */
127
+ export declare function groupingId(value: string): string;
128
+ /**
129
+ * The sink an unset `telemetry` gets outside production: query and mutation failures, which nothing
130
+ * else surfaces (route, render and window errors already log themselves). Ids and error names only.
131
+ */
132
+ export declare const devConsoleSink: Telemetry;
120
133
  /** `error.name`, `'Error'` for a non-`Error` throw. */
121
134
  export declare const errorName: (error: unknown) => string;
122
135
  /**
@@ -130,7 +143,23 @@ export declare function createLiveEmitter(read: () => Telemetry | undefined): Te
130
143
  * `chat.turn`). `undefined` outside a `BasaltProvider`, where such a hook emits nothing.
131
144
  */
132
145
  export declare const TelemetryContext: import("react").Context<Telemetry | undefined>;
133
- export declare function bindRouterTelemetry(router: object, emit: Telemetry): () => void;
134
- export declare function routerTelemetry(router: object): Telemetry;
146
+ /**
147
+ * On `context.__basalt` of a `basaltRouterOptions` router: where its `defaultOnCatch` reports to.
148
+ * The factory and `bindRouteError` are the only two places that know this key.
149
+ */
150
+ export type RouterHook = {
151
+ onRouteError?: ((error: unknown) => void) | undefined;
152
+ };
153
+ /**
154
+ * Points the router's `route.error` hook at `handler` (the provider's emitter); returns the unbind.
155
+ * The binding happens in the provider's effect, so a route error thrown before the first provider
156
+ * effect (a loader failing during the initial load) reaches the console only, never the sink. A
157
+ * router without the hook was not built with `basaltRouterOptions`: nothing is bound and it warns.
158
+ */
159
+ export declare function bindRouteError(router: {
160
+ options: {
161
+ context?: unknown;
162
+ };
163
+ }, handler: (error: unknown) => void): () => void;
135
164
  export {};
136
165
  //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AO,OAAO,KAAG,MAAyD,CAAA;AAEpG;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,CAiB9E;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,gDAAkD,CAAA;AAE/E;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;CAAE,CAAA;AAYlF;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE;IAAE,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,EAC1C,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAChC,MAAM,IAAI,CAcZ"}
package/dist/telemetry.js CHANGED
@@ -1,5 +1,14 @@
1
1
  import { createContext } from "react";
2
2
  const now = () => performance.timeOrigin + performance.now();
3
+ function groupingId(value) {
4
+ let h = 5381;
5
+ for (let i = 0; i < value.length; i++) h = h * 33 ^ value.charCodeAt(i);
6
+ return (h >>> 0).toString(16);
7
+ }
8
+ const devConsoleSink = (event) => {
9
+ if (event.type === "query.error" || event.type === "mutation.error")
10
+ console.error(`[basalt] ${event.type}`, event.attributes);
11
+ };
3
12
  const errorName = (error) => error instanceof Error ? error.name : "Error";
4
13
  function createLiveEmitter(read) {
5
14
  const emit = (event) => {
@@ -18,24 +27,35 @@ function createLiveEmitter(read) {
18
27
  }
19
28
  });
20
29
  }
21
- function noop() {
22
- }
23
30
  const TelemetryContext = createContext(void 0);
24
- const routerSinks = /* @__PURE__ */ new WeakMap();
25
- function bindRouterTelemetry(router, emit) {
26
- routerSinks.set(router, emit);
31
+ function hookOf(context) {
32
+ if (typeof context !== "object" || context === null || !("__basalt" in context)) return void 0;
33
+ const hook = context.__basalt;
34
+ return typeof hook === "object" && hook !== null ? hook : void 0;
35
+ }
36
+ const MISSING_HOOK = "[basalt] route.error telemetry is off: the router was not built with `basaltRouterOptions()` (or `createBasaltRouter`).";
37
+ let warnedMissingHook = false;
38
+ function bindRouteError(router, handler) {
39
+ const hook = hookOf(router.options.context);
40
+ if (!hook) {
41
+ if (process.env.NODE_ENV !== "production" || !warnedMissingHook) {
42
+ warnedMissingHook = true;
43
+ console.warn(MISSING_HOOK);
44
+ }
45
+ return () => {
46
+ };
47
+ }
48
+ hook.onRouteError = handler;
27
49
  return () => {
28
- if (routerSinks.get(router) === emit) routerSinks.delete(router);
50
+ if (hook.onRouteError === handler) hook.onRouteError = void 0;
29
51
  };
30
52
  }
31
- function routerTelemetry(router) {
32
- return routerSinks.get(router) ?? noop;
33
- }
34
53
  export {
35
54
  TelemetryContext,
36
- bindRouterTelemetry,
55
+ bindRouteError,
37
56
  createLiveEmitter,
57
+ devConsoleSink,
38
58
  errorName,
39
- now,
40
- routerTelemetry
59
+ groupingId,
60
+ now
41
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ctl-theme.d.ts","sourceRoot":"","sources":["../../src/theme/ctl-theme.tsx"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAe,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAA+B,CAAA;AAEzE;;iGAEiG;AACjG,eAAO,MAAM,SAAS,EAAE,oBA+BvB,CAAA;AAoCD,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAA;IACnB;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;CACxB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAY,EAAE,EAAE,YAAY,GAAG,SAAS,CAQ3E"}
1
+ {"version":3,"file":"ctl-theme.d.ts","sourceRoot":"","sources":["../../src/theme/ctl-theme.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAMV,oBAAoB,EAQrB,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAA+B,CAAA;AAEzE;;iGAEiG;AACjG,eAAO,MAAM,SAAS,EAAE,oBA+BvB,CAAA;AAoCD,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAA;IACnB;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;CACxB,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAY,EAAE,EAAE,YAAY,GAAG,SAAS,CAQ3E"}
@@ -1,33 +1,20 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import {
3
- ActionIcon,
4
- Box,
5
- Button,
6
- Checkbox,
7
- Input,
8
- MantineThemeProvider,
9
- MultiSelect,
10
- NativeSelect,
11
- Radio,
12
- SegmentedControl,
13
- Select,
14
- Switch,
15
- TextInput
16
- } from "@mantine/core";
2
+ import { Box, MantineThemeProvider } from "@mantine/core";
3
+ import { ext } from "./extend.js";
17
4
  const HIT_ATTR = { "data-basalt-hit": true };
18
5
  const CTL_THEME = {
19
6
  components: {
20
- Button: Button.extend({ defaultProps: { size: "ctl" } }),
21
- ActionIcon: ActionIcon.extend({ defaultProps: { size: "ctl" } }),
22
- Input: Input.extend({ defaultProps: { size: "ctl" } }),
23
- TextInput: TextInput.extend({ defaultProps: { size: "ctl" } }),
24
- Select: Select.extend({ defaultProps: { size: "ctl" } }),
25
- MultiSelect: MultiSelect.extend({ defaultProps: { size: "ctl" } }),
26
- SegmentedControl: SegmentedControl.extend({ defaultProps: { size: "ctl" } }),
27
- NativeSelect: NativeSelect.extend({ defaultProps: { size: "ctl" } }),
7
+ Button: ext({ defaultProps: { size: "ctl" } }),
8
+ ActionIcon: ext({ defaultProps: { size: "ctl" } }),
9
+ Input: ext({ defaultProps: { size: "ctl" } }),
10
+ TextInput: ext({ defaultProps: { size: "ctl" } }),
11
+ Select: ext({ defaultProps: { size: "ctl" } }),
12
+ MultiSelect: ext({ defaultProps: { size: "ctl" } }),
13
+ SegmentedControl: ext({ defaultProps: { size: "ctl" } }),
14
+ NativeSelect: ext({ defaultProps: { size: "ctl" } }),
28
15
  // The theme keys are the component names Mantine's own `useProps` looks up — `RadioGroup`, not
29
16
  // `Radio.Group` (`RadioGroup.mjs`: `useProps("RadioGroup", …)`).
30
- Radio: Radio.extend({
17
+ Radio: ext({
31
18
  defaultProps: { size: "ctl", attributes: { label: HIT_ATTR } }
32
19
  }),
33
20
  // Mantine types `RadioGroup.size` as a CLOSED `MantineSize`, while `Radio`, `Checkbox`,
@@ -36,20 +23,20 @@ const CTL_THEME = {
36
23
  // upstream inconsistency, not a statement that `RadioGroup` cannot take a custom tier. At
37
24
  // runtime `getSize` interpolates the string identically for all six. The cast restores what
38
25
  // every sibling type already allows; it widens nothing.
39
- RadioGroup: Radio.Group.extend({ defaultProps: { size: "ctl" } }),
40
- Checkbox: Checkbox.extend({
26
+ RadioGroup: ext({ defaultProps: { size: "ctl" } }),
27
+ Checkbox: ext({
41
28
  defaultProps: { size: "ctl", attributes: { label: HIT_ATTR } }
42
29
  }),
43
- CheckboxGroup: Checkbox.Group.extend({ defaultProps: { size: "ctl" } }),
44
- Switch: Switch.extend({
30
+ CheckboxGroup: ext({ defaultProps: { size: "ctl" } }),
31
+ Switch: ext({
45
32
  defaultProps: { size: "ctl", attributes: { track: HIT_ATTR } }
46
33
  }),
47
- SwitchGroup: Switch.Group.extend({ defaultProps: { size: "ctl" } })
34
+ SwitchGroup: ext({ defaultProps: { size: "ctl" } })
48
35
  }
49
36
  };
50
37
  const WIDGET_THEME = {
51
38
  components: {
52
- ActionIcon: ActionIcon.extend({ defaultProps: { size: "icon" } })
39
+ ActionIcon: ext({ defaultProps: { size: "icon" } })
53
40
  }
54
41
  };
55
42
  function CtlSlot({ children, tier = "ctl" }) {
@@ -0,0 +1,18 @@
1
+ import type { MantineThemeComponent } from '@mantine/core';
2
+ /** The input type of a Mantine component's `.extend()`: `defaultProps` / `classNames` / `styles` /
3
+ * `vars` typed against THAT component, taken from the component type alone. */
4
+ type ExtendInput<C> = C extends {
5
+ extend: (input: infer I) => unknown;
6
+ } ? I : never;
7
+ /**
8
+ * Typed identity standing in for `Component.extend({...})`. Mantine's `extend` is `identity` at
9
+ * runtime (it exists for typing), but calling it is a VALUE use of the component, which drags the
10
+ * whole component module into every bundle that imports the theme. Pass the component as a type
11
+ * argument (`ext<typeof Card>({...})`, imported with `import type`) and the same compile-time
12
+ * checking applies with nothing emitted.
13
+ */
14
+ export declare function ext<C extends {
15
+ extend: (input: never) => unknown;
16
+ }>(input: ExtendInput<C>): MantineThemeComponent;
17
+ export {};
18
+ //# sourceMappingURL=extend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../src/theme/extend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAE1D;+EAC+E;AAC/E,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,OAAO,CAAA;CAAE,GAAG,CAAC,GAAG,KAAK,CAAA;AAEnF;;;;;;GAMG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAA;CAAE,EACjE,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,GACpB,qBAAqB,CAEvB"}
@@ -0,0 +1,6 @@
1
+ function ext(input) {
2
+ return input;
3
+ }
4
+ export {
5
+ ext
6
+ };
@@ -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,
12
- Chip,
13
- Code,
14
- Combobox,
15
2
  createTheme,
16
3
  defaultVariantColorsResolver,
17
- Drawer,
18
4
  getPrimaryShade,
19
- Indicator,
20
- Input,
21
- Kbd,
22
- Menu,
23
5
  mergeThemeOverrides,
24
- Modal,
25
- NavLink,
26
- Notification,
27
- NumberInput,
28
- Pagination,
29
- PaginationControl,
30
- Paper,
31
- PasswordInput,
32
- PillsInput,
33
- Popover,
34
- Progress,
35
- Radio,
36
- RadioCard,
37
- rem,
38
- Select,
39
- SegmentedControl,
40
- Stepper,
41
- Switch,
42
- Table,
43
- Tabs,
44
- Textarea,
45
- TextInput,
46
- Timeline,
47
- Tooltip
6
+ rem
48
7
  } from "@mantine/core";
49
8
  import {
50
9
  BP,
@@ -63,6 +22,7 @@ import navLinkClasses from "./nav-link.module.css";
63
22
  import segmentedControlClasses from "./segmented-control.module.css";
64
23
  import timelineClasses from "./timeline.module.css";
65
24
  import { HIT_ATTR } from "./ctl-theme.js";
25
+ import { ext } from "./extend.js";
66
26
  import { useBasaltSpacing } from "./use-basalt-spacing.js";
67
27
  import { CTL_THEME, CtlSlot } from "./ctl-theme.js";
68
28
  function hexToRgb(h) {
@@ -275,7 +235,7 @@ function buildTheme(data, options = {}) {
275
235
  // • radius → `--vx-radius-card` (7px).
276
236
  // This is the single source the user's "strict surface across components" demands; the
277
237
  // `raw-surface` guard then stops consumers re-overriding any of it inline.
278
- Card: Card.extend({
238
+ Card: ext({
279
239
  styles: {
280
240
  root: {
281
241
  backgroundColor: "var(--vx-surface-panel)",
@@ -284,7 +244,7 @@ function buildTheme(data, options = {}) {
284
244
  }
285
245
  }
286
246
  }),
287
- Paper: Paper.extend({
247
+ Paper: ext({
288
248
  styles: {
289
249
  root: {
290
250
  backgroundColor: "var(--vx-surface-panel)",
@@ -296,12 +256,12 @@ function buildTheme(data, options = {}) {
296
256
  // Mantine's default Badge radius is a full 1000px pill; the spec's delta/status badges sit at
297
257
  // radius 6 (docs/DESIGN-SPEC.md §4/§5). Count badges (radius 5) are a distinct, smaller-radius
298
258
  // usage left to the call site (`radius={5}` prop) since Badge has no state to key off here.
299
- Badge: Badge.extend({ defaultProps: { radius: radius.ctrl } }),
259
+ Badge: ext({ defaultProps: { radius: radius.ctrl } }),
300
260
  // Alert renders its title in the body font by default; bring it onto the head-font idiom
301
261
  // (docs/DESIGN-SPEC.md §5) like every other titled surface. Radius/padding/color tint are
302
262
  // already on-system (defaultRadius 'md' control tier + the variant color resolver), so only
303
263
  // the title font is overridden.
304
- Alert: Alert.extend({
264
+ Alert: ext({
305
265
  styles: {
306
266
  title: {
307
267
  fontFamily: "var(--basalt-font-head)",
@@ -319,7 +279,7 @@ function buildTheme(data, options = {}) {
319
279
  // Cast: `AppShellCssVariables` declares only `--app-shell-transition-duration` /
320
280
  // `-timing-function`, yet Mantine's OWN AppShell.css sets `--app-shell-border-color` on the
321
281
  // same root.
322
- AppShell: AppShell.extend({
282
+ AppShell: ext({
323
283
  vars: () => ({ root: { "--app-shell-border-color": "var(--vx-divider)" } })
324
284
  }),
325
285
  // "Ink earns its color" — a nav selection is UI state, not the identity accent on the LABEL.
@@ -337,7 +297,7 @@ function buildTheme(data, options = {}) {
337
297
  // set at ink-6% by higher-specificity `:not([data-active])` rules in `nav-link.module.css` /
338
298
  // `app-sidebar.module.css` — so it exists to keep the active row responding to the pointer
339
299
  // now that its rest state sits in the same tint family as an inactive hover.
340
- NavLink: NavLink.extend({
300
+ NavLink: ext({
341
301
  vars: () => ({
342
302
  root: {
343
303
  "--nl-bg": "color-mix(in srgb, var(--vx-ink) 9%, transparent)",
@@ -384,7 +344,7 @@ function buildTheme(data, options = {}) {
384
344
  // legal home for the shadow's ring. Theming the base `Input` covers
385
345
  // TextInput/NumberInput/PasswordInput/Select/Textarea, which all render it internally (only
386
346
  // `size` needs per-component defaults, since each resolves its own).
387
- Input: Input.extend({
347
+ Input: ext({
388
348
  defaultProps: { size: "md" },
389
349
  // Density coupling: Input's OWN `varsResolver` sets `--input-height` to
390
350
  // `getSize(props.size, 'input-height')` (`@mantine/core/esm/components/Input/Input.mjs`),
@@ -415,20 +375,20 @@ function buildTheme(data, options = {}) {
415
375
  }),
416
376
  classNames: { wrapper: controlsClasses.inputWrapper, input: controlsClasses.input }
417
377
  }),
418
- TextInput: TextInput.extend({ defaultProps: { size: "md" } }),
378
+ TextInput: ext({ defaultProps: { size: "md" } }),
419
379
  // The stepper chevrons sit ~15px apart, so neither can own a 44px overlay; the coarse
420
380
  // `.input` min-height floor (theme/controls.module.css) is the touch floor.
421
- NumberInput: NumberInput.extend({ defaultProps: { size: "md" } }),
422
- PasswordInput: PasswordInput.extend({ defaultProps: { size: "md" } }),
423
- Select: Select.extend({ defaultProps: { size: "md" } }),
424
- Textarea: Textarea.extend({ defaultProps: { size: "md" } }),
381
+ NumberInput: ext({ defaultProps: { size: "md" } }),
382
+ PasswordInput: ext({ defaultProps: { size: "md" } }),
383
+ Select: ext({ defaultProps: { size: "md" } }),
384
+ Textarea: ext({ defaultProps: { size: "md" } }),
425
385
  // PillsInput (MultiSelect/TagsInput's outer field) renders `InputBase` internally but under
426
386
  // its OWN `__staticSelector: 'PillsInput'`, so it never reads `theme.components.Input` — the
427
387
  // field idiom above never reached it. `PillsInput.classes === InputBase.classes`, so the SAME
428
388
  // part names apply here; reusing both control classes picks up the exact `[data-variant]` rules
429
389
  // in controls.module.css for free, no new CSS needed. Both slots are required — `wrapper` alone
430
390
  // would land the vars but leave the field flat, since the depth lives on `input`.
431
- PillsInput: PillsInput.extend({
391
+ PillsInput: ext({
432
392
  classNames: { wrapper: controlsClasses.inputWrapper, input: controlsClasses.input }
433
393
  }),
434
394
  // Button / ActionIcon: depth for EVERY variant that owns a box (docs/DESIGN-SPEC.md §5's
@@ -456,7 +416,7 @@ function buildTheme(data, options = {}) {
456
416
  // anchor's doc in `tokens/palette.ts`), so the two can never drift. Scoped to `size === 'md'`,
457
417
  // same rationale as Input's override: `undefined` leaves an explicitly different size (e.g.
458
418
  // `size="xs"`) on Mantine's own static height.
459
- Button: Button.extend({
419
+ Button: ext({
460
420
  classNames: { root: controlsClasses.buttonRoot },
461
421
  vars: (_theme, props) => ({
462
422
  root: {
@@ -464,7 +424,7 @@ function buildTheme(data, options = {}) {
464
424
  }
465
425
  })
466
426
  }),
467
- ActionIcon: ActionIcon.extend({
427
+ ActionIcon: ext({
468
428
  classNames: { root: controlsClasses.actionIconRoot },
469
429
  vars: (_theme, props) => ({
470
430
  root: {
@@ -484,10 +444,10 @@ function buildTheme(data, options = {}) {
484
444
  // Neither component sets a background of its own, so panel bg is added alongside the shadow —
485
445
  // the same panel-bg + depth + no-border triad as Card/Paper — on `shadow-raised`, the shared
486
446
  // CONTROL depth, not Card/Paper's `shadow-card`: a selection card is something you click.
487
- CheckboxCard: CheckboxCard.extend({
447
+ CheckboxCard: ext({
488
448
  classNames: { card: controlsClasses.checkboxCardRoot }
489
449
  }),
490
- RadioCard: RadioCard.extend({
450
+ RadioCard: ext({
491
451
  classNames: { card: controlsClasses.radioCardRoot }
492
452
  }),
493
453
  // Chip: unlike Button/Input, Chip has no literal `variant="default"` — its OWN default (no
@@ -497,7 +457,7 @@ function buildTheme(data, options = {}) {
497
457
  // no shadow) — borderless but flat, the same symptom as CheckboxCard/RadioCard above. The class
498
458
  // is wired conditionally (function-form `classNames`, same pattern as the `vars` on-color
499
459
  // re-points below) so it NEVER reaches a consumer-chosen `light`/`outline` Chip.
500
- Chip: Chip.extend({
460
+ Chip: ext({
501
461
  classNames: (_theme, props) => (props.variant ?? "filled") === "filled" ? { label: controlsClasses.chipLabel } : {}
502
462
  }),
503
463
  // Track = ink-6% tint, radius 7, 2px padding; active segment = an ink-mixed panel fill +
@@ -532,7 +492,7 @@ function buildTheme(data, options = {}) {
532
492
  // `tokens/palette.ts`), and `radius.card`/`RADIUS_STEP.tight` two lines below already track the
533
493
  // RADIUS knob together, so the inset between them must stay fixed at exactly 2 regardless of
534
494
  // density.
535
- SegmentedControl: SegmentedControl.extend({
495
+ SegmentedControl: ext({
536
496
  defaultProps: { radius: radius.card },
537
497
  classNames: {
538
498
  label: segmentedControlClasses.label,
@@ -608,7 +568,7 @@ function buildTheme(data, options = {}) {
608
568
  })
609
569
  }),
610
570
  // Track = ink-8%; leader/section fill colors are a per-usage `color` prop (left to consumers).
611
- Progress: Progress.extend({
571
+ Progress: ext({
612
572
  // `size` is a NUMBER, not a `var()` string — same rem()-comma-trap reasoning as Timeline's
613
573
  // `bulletSize`/`lineWidth` below, so it reads the resolved `spacing.step.progressBarSize`
614
574
  // (density-tracking) rather than a hand-typed literal.
@@ -627,7 +587,7 @@ function buildTheme(data, options = {}) {
627
587
  // live in `timeline.module.css` instead. `TimelineItem` renders through the PARENT Timeline's
628
588
  // style context (`ctx.getStyles`), so `item`/`itemBullet`/`itemTitle`/`itemContent` are all
629
589
  // themed from this ONE extend — no separate `TimelineItem` override needed.
630
- Timeline: Timeline.extend({
590
+ Timeline: ext({
631
591
  // NUMBERS, not `var()` strings: `bulletSize`/`lineWidth` land through Timeline's own
632
592
  // `rem()` conversion (`@mantine/core/esm/core/utils/units-converters/rem.mjs` splits on `,`
633
593
  // and ` ` before checking numerics), which passes a bare `var(--x)` through intact but
@@ -661,7 +621,7 @@ function buildTheme(data, options = {}) {
661
621
  // by the resolver below, so dropdown and arrow always share the same edge color.)
662
622
  // Tooltip is a standalone floating primitive (not Popover-based) — themed directly. Its arrow
663
623
  // ships border-less (`border: 0`), so the same edge is applied inline to keep the ring closed.
664
- Tooltip: Tooltip.extend({
624
+ Tooltip: ext({
665
625
  defaultProps: { radius: radius.floating },
666
626
  styles: {
667
627
  tooltip: {
@@ -675,7 +635,7 @@ function buildTheme(data, options = {}) {
675
635
  }),
676
636
  // Popover is the shared floating primitive underneath Menu (Menu renders `<Popover>`
677
637
  // internally with no `radius`/`shadow` of its own), so theming it here covers both.
678
- Popover: Popover.extend({
638
+ Popover: ext({
679
639
  defaultProps: { radius: radius.floating },
680
640
  styles: {
681
641
  dropdown: {
@@ -689,7 +649,7 @@ function buildTheme(data, options = {}) {
689
649
  // stripped from `styles` objects, and Menu's internal Popover does NOT consume
690
650
  // `components.Popover.styles`, so the dropdown surface is repeated here). Menu.Label = the
691
651
  // mono micro-label idiom; dividers use the layout-divider token.
692
- Menu: Menu.extend({
652
+ Menu: ext({
693
653
  classNames: { item: floatingClasses.menuItem },
694
654
  styles: {
695
655
  dropdown: {
@@ -715,7 +675,7 @@ function buildTheme(data, options = {}) {
715
675
  }),
716
676
  // Combobox is the floating primitive underneath Select/Autocomplete/MultiSelect — like Menu,
717
677
  // it doesn't consume `components.Popover.styles`, so the overlay dropdown idiom is repeated.
718
- Combobox: Combobox.extend({
678
+ Combobox: ext({
719
679
  styles: {
720
680
  dropdown: {
721
681
  backgroundColor: "var(--vx-surface-overlay)",
@@ -732,7 +692,7 @@ function buildTheme(data, options = {}) {
732
692
  // background moves back to opaque, matching the content box it sits above rather than the page
733
693
  // behind it. Title = head font; close button = the ghost idiom (floating.module.css). Below the
734
694
  // `medium` size class the Modal is a bottom sheet (floating.module.css `sheet*`).
735
- Modal: Modal.extend({
695
+ Modal: ext({
736
696
  defaultProps: { radius: radius.floating, closeButtonProps: { ...HIT_ATTR } },
737
697
  classNames: {
738
698
  close: floatingClasses.closeButton,
@@ -753,7 +713,7 @@ function buildTheme(data, options = {}) {
753
713
  }
754
714
  }
755
715
  }),
756
- Drawer: Drawer.extend({
716
+ Drawer: ext({
757
717
  classNames: { close: floatingClasses.closeButton },
758
718
  styles: {
759
719
  content: {
@@ -772,7 +732,7 @@ function buildTheme(data, options = {}) {
772
732
  // count-badge bg: ink 6–8%") — mono, ink-7% bg, radius 5.
773
733
  // Flat mono chip (mock's ⌘K badge) — Mantine's default Kbd draws a 3px "keyboard key" bottom
774
734
  // border that reads as a heavy off-system rule, so the border goes entirely.
775
- Kbd: Kbd.extend({
735
+ Kbd: ext({
776
736
  styles: {
777
737
  root: {
778
738
  backgroundColor: "color-mix(in srgb, var(--vx-ink) 7%, transparent)",
@@ -782,7 +742,7 @@ function buildTheme(data, options = {}) {
782
742
  }
783
743
  }
784
744
  }),
785
- Code: Code.extend({
745
+ Code: ext({
786
746
  styles: {
787
747
  root: {
788
748
  backgroundColor: "color-mix(in srgb, var(--vx-ink) 7%, transparent)",
@@ -799,7 +759,7 @@ function buildTheme(data, options = {}) {
799
759
  // rows) is not expressible by it at all. `height` on a table cell behaves as a MINIMUM, so a
800
760
  // wrapping cell still grows; `verticalSpacing` keeps working on top of it for a consumer that
801
761
  // wants a denser or looser table than the tier.
802
- Table: Table.extend({
762
+ Table: ext({
803
763
  classNames: { table: controlsClasses.tableRoot },
804
764
  styles: {
805
765
  th: {
@@ -820,7 +780,7 @@ function buildTheme(data, options = {}) {
820
780
  // `track` is the Switch's <label>, so the invisible `--vx-hit` overlay (`data-basalt-hit`)
821
781
  // still toggles it. Checkbox/Radio boxes are bare <input>s under a plain <div> — an overlay
822
782
  // there would swallow clicks, so only their `label` (a real <label>) carries it.
823
- Switch: Switch.extend({
783
+ Switch: ext({
824
784
  defaultProps: {
825
785
  withThumbIndicator: false,
826
786
  attributes: { track: HIT_ATTR }
@@ -830,7 +790,7 @@ function buildTheme(data, options = {}) {
830
790
  // control chrome — it reads the divider token instead of the heavy gray-3/dark-4 line
831
791
  // (controls.module.css; custom properties are stripped from `styles` objects). The active tab
832
792
  // underline keeps `--tabs-color` (accent) untouched.
833
- Tabs: Tabs.extend({
793
+ Tabs: ext({
834
794
  classNames: { root: controlsClasses.tabsRoot },
835
795
  // The on-color re-point (see below). Cast: Mantine's `TabsCssVariables` type declares only
836
796
  // `--tabs-color` / `--tabs-radius`, yet Tabs' OWN varsResolver writes `--tabs-text-color` —
@@ -844,7 +804,7 @@ function buildTheme(data, options = {}) {
844
804
  // foreground var. Theme `vars` merge AFTER a component's own `varsResolver` (Mantine
845
805
  // `useStyles`), so re-pointing that var here wins on every render path. Without this, a dark-mode
846
806
  // Checkbox/Radio paints a white checkmark on the light accent fill — invisible.
847
- Checkbox: Checkbox.extend({
807
+ Checkbox: ext({
848
808
  defaultProps: { attributes: { label: HIT_ATTR } },
849
809
  vars: (theme, props) => ({
850
810
  root: {
@@ -854,7 +814,7 @@ function buildTheme(data, options = {}) {
854
814
  }
855
815
  })
856
816
  }),
857
- Radio: Radio.extend({
817
+ Radio: ext({
858
818
  defaultProps: { attributes: { label: HIT_ATTR } },
859
819
  vars: (theme, props) => ({
860
820
  root: {
@@ -862,7 +822,7 @@ function buildTheme(data, options = {}) {
862
822
  }
863
823
  })
864
824
  }),
865
- Pagination: Pagination.extend({
825
+ Pagination: ext({
866
826
  vars: (theme, props) => ({
867
827
  root: { "--pagination-active-color": onColorFor(theme, props) }
868
828
  })
@@ -870,28 +830,28 @@ function buildTheme(data, options = {}) {
870
830
  // `Pagination`'s own controls (prev/next/page buttons) resolve `PaginationControl`'s
871
831
  // defaultProps independently of the parent — `data-basalt-hit` here is what closes the
872
832
  // gap Switch/Checkbox/Radio already close at their own theme entries.
873
- PaginationControl: PaginationControl.extend({
833
+ PaginationControl: ext({
874
834
  defaultProps: { ...HIT_ATTR }
875
835
  }),
876
- Stepper: Stepper.extend({
836
+ Stepper: ext({
877
837
  vars: (theme, props) => ({ root: { "--stepper-icon-color": onColorFor(theme, props) } })
878
838
  }),
879
- Indicator: Indicator.extend({
839
+ Indicator: ext({
880
840
  vars: (theme, props) => ({ root: { "--indicator-text-color": onColorFor(theme, props) } })
881
841
  }),
882
842
  // Accordion (default variant): hairline separators between items only — the color retune AND
883
843
  // the last item's outer border-bottom drop both live in controls.module.css.
884
- Accordion: Accordion.extend({ classNames: { item: controlsClasses.accordionItem } }),
844
+ Accordion: ext({ classNames: { item: controlsClasses.accordionItem } }),
885
845
  // Parents faint, separator line-colored — the current-page treatment (head font, weight) is a
886
846
  // shell-level concern (AppBreadcrumbs), not this generic Mantine primitive.
887
- Breadcrumbs: Breadcrumbs.extend({
847
+ Breadcrumbs: ext({
888
848
  styles: {
889
849
  breadcrumb: { color: "var(--vx-faint)" },
890
850
  separator: { color: "var(--vx-surface-border)" }
891
851
  }
892
852
  }),
893
853
  // Card idiom — same panel + shadow-card as every other surface.
894
- Notification: Notification.extend({
854
+ Notification: ext({
895
855
  defaultProps: { radius: radius.floating },
896
856
  styles: {
897
857
  root: {
@@ -1015,7 +975,7 @@ function buildCssVariablesResolver(data) {
1015
975
  // Links: Mantine reads the accent FILL shade (4.38:1 on the light page, under WCAG AA); the hover
1016
976
  // accent is the next step darker and clears 4.5:1 on every light text surface.
1017
977
  "--mantine-color-anchor": "var(--vx-accent-hover)",
1018
- // `--app-shell-border-color` is set by `components.AppShell.extend({ vars })` above — this
978
+ // `--app-shell-border-color` is set by `components.AppShell` `vars` above — this
1019
979
  // entry was dead (an element-level declaration always beats an inherited `:root` value).
1020
980
  // THE strict-surface lever. Mantine components do NOT chain border/surface colors through
1021
981
  // `--mantine-color-default-*`; each hardcodes a RAW ramp step (`--mantine-color-gray-{2,3,4}`