basalt-ui 1.1.0 → 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.
- package/AGENTS.md +2 -2
- package/CHANGELOG.md +37 -0
- package/README.md +47 -5
- package/agent/rules/basalt-app.md +126 -0
- package/agent/rules/basalt-content.md +3 -1
- package/agent/skills/basalt-app/SKILL.md +32 -10
- package/configs/check.yml +3 -1
- package/configs/oxlint.json +1 -1
- package/dist/agent/part-list.d.ts.map +1 -1
- package/dist/agent/part-list.js +17 -7
- package/dist/agent/stick-to-bottom.js +2 -2
- package/dist/agent-chat/thread-detail-panel.d.ts.map +1 -1
- package/dist/agent-chat/thread-detail-panel.js +37 -33
- package/dist/agent-chat/thread-message.d.ts.map +1 -1
- package/dist/agent-chat/thread-message.js +8 -5
- package/dist/agent-chat/thread-outcome-card.js +3 -3
- package/dist/agent-chat/thread-workspace.js +1 -1
- package/dist/charts/primitives/ChartLegend.js +2 -0
- package/dist/charts/primitives/ChartTooltip.js +2 -1
- package/dist/cli/index.d.ts +21 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +50 -12
- package/dist/connectivity/connectivity-indicator.d.ts.map +1 -1
- package/dist/connectivity/connectivity-indicator.js +3 -3
- package/dist/content/article-card.module.css +7 -5
- package/dist/content/article-layout.module.css +16 -12
- package/dist/content/callout.module.css +4 -4
- package/dist/content/code-block.module.css +8 -7
- package/dist/content/guide.module.css +3 -3
- package/dist/content/mermaid.module.css +2 -2
- package/dist/content/prose.module.css +59 -29
- package/dist/content/reading-progress.module.css +2 -0
- package/dist/content/toc.module.css +6 -3
- package/dist/dashboard/delta-badge.d.ts.map +1 -1
- package/dist/dashboard/delta-badge.js +10 -2
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +3 -16
- package/dist/dashboard/settings-section.js +2 -2
- package/dist/dashboard/settings-section.module.css +2 -2
- package/dist/dashboard/stat-card.js +2 -1
- package/dist/data/virtual-list.d.ts.map +1 -1
- package/dist/data/virtual-list.js +12 -2
- package/dist/forms/FormErrorSummary.js +2 -2
- package/dist/guard/index.d.ts +20 -4
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +250 -37
- package/dist/guard/types.d.ts +24 -3
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/provider/index.d.ts +30 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +32 -7
- package/dist/provider/lab-theme.d.ts +39 -0
- package/dist/provider/lab-theme.d.ts.map +1 -0
- package/dist/provider/lab-theme.js +52 -0
- package/dist/shell/app-header.module.css +2 -2
- package/dist/shell/app-mobile-nav.module.css +1 -1
- package/dist/shell/app-sidebar-account.d.ts.map +1 -1
- package/dist/shell/app-sidebar-account.js +4 -2
- package/dist/shell/app-sidebar.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +4 -2
- package/dist/shell/app-sidebar.module.css +36 -26
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +11 -4
- package/dist/shell/sidebar-search.module.css +16 -4
- package/dist/styles.css +1 -1
- package/dist/surfaces.d.ts +16 -12
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +12 -4
- package/dist/theme/controls.module.css +1 -1
- package/dist/theme/floating.module.css +1 -1
- package/dist/theme/index.d.ts +116 -11
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +703 -566
- package/dist/theme/nav-link.module.css +1 -1
- package/dist/theme/use-basalt-spacing.d.ts +3 -0
- package/dist/theme/use-basalt-spacing.d.ts.map +1 -0
- package/dist/theme/use-basalt-spacing.js +8 -0
- package/dist/theme-lab/derive-controls.d.ts +13 -0
- package/dist/theme-lab/derive-controls.d.ts.map +1 -0
- package/dist/theme-lab/derive-controls.js +137 -0
- package/dist/theme-lab/derive-state.d.ts +55 -0
- package/dist/theme-lab/derive-state.d.ts.map +1 -0
- package/dist/theme-lab/derive-state.js +81 -0
- package/dist/theme-lab/index.d.ts +12 -2
- package/dist/theme-lab/index.d.ts.map +1 -1
- package/dist/theme-lab/index.js +13 -62
- package/dist/theme-toggle/index.d.ts.map +1 -1
- package/dist/theme-toggle/index.js +3 -2
- package/dist/tokens/derive.d.ts +89 -0
- package/dist/tokens/derive.d.ts.map +1 -0
- package/dist/tokens/derive.js +250 -0
- package/dist/tokens/hct.d.ts +34 -0
- package/dist/tokens/hct.d.ts.map +1 -0
- package/dist/tokens/hct.js +159 -0
- package/dist/tokens/index.d.ts +71 -7
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +284 -46
- package/dist/tokens/palette.d.ts +984 -167
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +617 -119
- package/dist/vite-color-mix.d.ts +30 -0
- package/dist/vite-color-mix.d.ts.map +1 -0
- package/dist/vite-color-mix.js +80 -0
- package/dist/vite.d.ts +82 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +312 -0
- package/llms.txt +5 -4
- package/package.json +24 -9
- package/src/agent/part-list.tsx +13 -7
- package/src/agent/stick-to-bottom.tsx +2 -2
- package/src/agent-chat/thread-detail-panel.tsx +13 -10
- package/src/agent-chat/thread-message.tsx +8 -5
- package/src/agent-chat/thread-outcome-card.tsx +2 -2
- package/src/agent-chat/thread-workspace.tsx +2 -2
- package/src/charts/primitives/ChartLegend.tsx +2 -2
- package/src/charts/primitives/ChartTooltip.tsx +2 -2
- package/src/cli/check-theme.test.ts +18 -0
- package/src/cli/index.ts +112 -20
- package/src/cli/init-sync.test.ts +68 -0
- package/src/connectivity/connectivity-indicator.tsx +8 -2
- package/src/content/article-card.module.css +7 -5
- package/src/content/article-layout.module.css +16 -12
- package/src/content/callout.module.css +4 -4
- package/src/content/code-block.module.css +8 -7
- package/src/content/guide.module.css +3 -3
- package/src/content/mermaid.module.css +2 -2
- package/src/content/prose.module.css +59 -29
- package/src/content/prose.module.css.test.ts +55 -0
- package/src/content/reading-progress.module.css +2 -0
- package/src/content/toc.module.css +6 -3
- package/src/dashboard/delta-badge.tsx +10 -4
- package/src/dashboard/empty-state.tsx +3 -16
- package/src/dashboard/settings-section.module.css +2 -2
- package/src/dashboard/settings-section.tsx +2 -2
- package/src/dashboard/stat-card.tsx +2 -2
- package/src/data/virtual-list.tsx +12 -2
- package/src/forms/FormErrorSummary.tsx +1 -1
- package/src/guard/check-source.test.ts +416 -5
- package/src/guard/index.ts +367 -45
- package/src/guard/types.ts +24 -2
- package/src/index.ts +1 -0
- package/src/provider/index.test.tsx +100 -0
- package/src/provider/index.tsx +79 -7
- package/src/provider/lab-theme.test.ts +147 -0
- package/src/provider/lab-theme.ts +166 -0
- package/src/shell/app-header.module.css +2 -2
- package/src/shell/app-mobile-nav.module.css +1 -1
- package/src/shell/app-sidebar-account.tsx +9 -2
- package/src/shell/app-sidebar.module.css +36 -26
- package/src/shell/app-sidebar.tsx +12 -2
- package/src/shell/index.tsx +14 -3
- package/src/shell/sidebar-search.module.css +16 -4
- package/src/styles.css +1 -1
- package/src/surfaces.ts +25 -11
- package/src/theme/contrast.test.ts +19 -3
- package/src/theme/controls.module.css +1 -1
- package/src/theme/density-option.test.ts +96 -0
- package/src/theme/density-relations.test.ts +428 -0
- package/src/theme/derive-theme.test.ts +101 -0
- package/src/theme/floating.module.css +1 -1
- package/src/theme/fonts-option.test.ts +69 -0
- package/src/theme/index.ts +930 -563
- package/src/theme/nav-link.module.css +1 -1
- package/src/theme/radius-option.test.ts +86 -0
- package/src/theme/radius.test.ts +132 -0
- package/src/theme/spacing.test.ts +432 -0
- package/src/theme/use-basalt-spacing.test.tsx +51 -0
- package/src/theme/use-basalt-spacing.ts +38 -0
- package/src/theme-lab/derive-controls.test.ts +94 -0
- package/src/theme-lab/derive-controls.tsx +227 -0
- package/src/theme-lab/derive-state.test.ts +71 -0
- package/src/theme-lab/derive-state.ts +163 -0
- package/src/theme-lab/index.tsx +29 -68
- package/src/theme-lab/theme-lab.test.ts +4 -18
- package/src/theme-toggle/index.tsx +9 -4
- package/src/tokens/build-fonts-css.test.ts +51 -0
- package/src/tokens/build-radius-css.test.ts +25 -0
- package/src/tokens/density.test.ts +274 -0
- package/src/tokens/derive-radius.test.ts +62 -0
- package/src/tokens/derive.test.ts +30 -0
- package/src/tokens/derive.ts +481 -0
- package/src/tokens/hct.ts +231 -0
- package/src/tokens/index.ts +395 -45
- package/src/tokens/palette.test.ts +114 -0
- package/src/tokens/palette.ts +1118 -180
- package/src/vite-color-mix.test.ts +46 -0
- package/src/vite-color-mix.ts +137 -0
- package/src/vite.test.ts +192 -0
- package/src/vite.ts +502 -1
package/dist/surfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,eAAe,GACf,UAAU,GACV,MAAM,GACN,OAAO,GACP,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,GACP,OAAO,GACP,OAAO,GACP,eAAe,GACf,UAAU,GACV,MAAM,GACN,OAAO,GACP,SAAS,GACT,KAAK,CAAA;AAET;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,CAAA;AAExE;;;;GA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AM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACzC,OAAO,CAET"}
|
package/dist/surfaces.js
CHANGED
|
@@ -64,13 +64,14 @@ const SURFACES = {
|
|
|
64
64
|
"./theme-lab": {
|
|
65
65
|
kind: "tooling",
|
|
66
66
|
layer: "mantine-coupled",
|
|
67
|
-
description: "ThemeLabControls, applyOverrides, COLOR_GROUPS for
|
|
67
|
+
description: "ThemeLabControls, applyOverrides, COLOR_GROUPS \u2014 a low-level inspector for the non-derived structural tokens; identity/color tuning lives in DeriveControls",
|
|
68
68
|
forbiddenImports: []
|
|
69
69
|
},
|
|
70
70
|
"./vite": {
|
|
71
71
|
kind: "tooling",
|
|
72
72
|
layer: "mantine-coupled",
|
|
73
|
-
description: "basaltViteConfig(opts) \u2014 Vite preset for basalt-ui consumer apps",
|
|
73
|
+
description: "basaltViteConfig(opts) \u2014 Vite preset for basalt-ui consumer apps; basaltAppPlugin(opts) \u2014 PWA head, manifest, and icon metadata derived from the token palette",
|
|
74
|
+
optionalPeers: ["vite-plugin-pwa"],
|
|
74
75
|
forbiddenImports: []
|
|
75
76
|
},
|
|
76
77
|
"./guard": {
|
|
@@ -260,7 +261,7 @@ const SURFACES = {
|
|
|
260
261
|
// synthetic global app-wide ban layer — the src/**+app/** glob
|
|
261
262
|
kind: "doctrine",
|
|
262
263
|
layer: "app-global",
|
|
263
|
-
rule: "
|
|
264
|
+
rule: "app",
|
|
264
265
|
skill: ["basalt-app"],
|
|
265
266
|
guardKinds: [],
|
|
266
267
|
globs: {
|
|
@@ -272,7 +273,14 @@ const SURFACES = {
|
|
|
272
273
|
// so the bans left below (antd, framer-motion) are plain global bans with no narrower
|
|
273
274
|
// override to out-order.
|
|
274
275
|
shipped: ["**/*.{ts,tsx}"],
|
|
275
|
-
|
|
276
|
+
// Repo is packages/basalt-ui/src/** ONLY. apps/playground is deliberately absent: it
|
|
277
|
+
// dogfoods the shipped consumer preset through its own apps/playground/.oxlintrc.json
|
|
278
|
+
// (`extends: ["./node_modules/basalt-ui/configs/oxlint.json"]`, resolved via the workspace
|
|
279
|
+
// symlink), which oxlint honours as a nested config — the nearest config REPLACES this one
|
|
280
|
+
// for that subtree, so listing playground here would be dead glob. That indirection is the
|
|
281
|
+
// point: the playground sees exactly what a real consumer sees, including NOT receiving
|
|
282
|
+
// `basalt/token-layer-boundary` (repo-local by design — see TOKEN_LAYER_BOUNDARY_SURFACES).
|
|
283
|
+
repo: ["packages/basalt-ui/src/**"]
|
|
276
284
|
},
|
|
277
285
|
ruleOverrides: [{ rule: "no-console", level: "off", target: "repo" }],
|
|
278
286
|
// cli/bin/scripts, repo-local only
|
|
@@ -45,7 +45,7 @@ html[data-mantine-color-scheme] .inputWrapper[data-variant='default']:not([data-
|
|
|
45
45
|
* which keep their Mantine semantics and take the focus ring alone.
|
|
46
46
|
*/
|
|
47
47
|
.input {
|
|
48
|
-
--field-depth: 0 0
|
|
48
|
+
--field-depth: 0 0 transparent;
|
|
49
49
|
|
|
50
50
|
box-shadow: var(--field-depth);
|
|
51
51
|
}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,22 +1,127 @@
|
|
|
1
1
|
import type { CSSVariablesResolver, MantineThemeOverride } from '@mantine/core';
|
|
2
|
+
import type { RadiusValues, SpaceValues } from '../tokens/palette.js';
|
|
3
|
+
import type { DeriveConfig } from '../tokens/derive.js';
|
|
4
|
+
import type { BasaltFontsConfig } from '../tokens/index.js';
|
|
2
5
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* 16px. Splitting the two is deliberate: pinning `size: 'lg'` to reach a 16px font would drag a
|
|
8
|
-
* 50px input height along with it. The floor is `max(16px, …)`, so it never clamps a deliberately
|
|
9
|
-
* LARGER input down, and — being a CSS floor on the element rather than a per-component
|
|
10
|
-
* `defaultProps` — it covers every input Mantine ships (Autocomplete, MultiSelect, TagsInput,
|
|
11
|
-
* PinInput, …) plus any consumer that passes an explicit `size="xs"`. Enumerating components in
|
|
12
|
-
* `defaultProps` could never do that; the previous attempt missed seven of them.
|
|
6
|
+
* The `fonts` option's resolved shape — defined in `basalt-ui/tokens` (`BasaltFontsConfig`,
|
|
7
|
+
* paired with its pure builder `buildFontsCss` there); re-exported here since
|
|
8
|
+
* `CreateBasaltThemeOptions.fonts` below is its primary production entry point. See
|
|
9
|
+
* {@link CreateBasaltThemeOptions.fonts}.
|
|
13
10
|
*/
|
|
11
|
+
export type { BasaltFontsConfig } from '../tokens/index.js';
|
|
12
|
+
export { useBasaltSpacing } from './use-basalt-spacing.js';
|
|
13
|
+
declare module '@mantine/core' {
|
|
14
|
+
interface MantineThemeOther {
|
|
15
|
+
basaltDerive?: DeriveConfig;
|
|
16
|
+
basaltFonts?: BasaltFontsConfig;
|
|
17
|
+
basaltRadius?: RadiusValues;
|
|
18
|
+
basaltDensity?: SpaceValues;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** The static, shipped-identity theme — `buildTheme` evaluated once at
|
|
22
|
+
* `DEFAULT_DERIVE_CONFIG` (memoized by `buildPaletteData`), not per import. */
|
|
14
23
|
export declare const baseTheme: MantineThemeOverride;
|
|
24
|
+
/** The static, shipped-identity resolver — `buildCssVariablesResolver` evaluated once at
|
|
25
|
+
* `DEFAULT_DERIVE_CONFIG`. Unchanged call signature (`cssVariablesResolver(theme)`), so it drops
|
|
26
|
+
* straight into `<MantineProvider cssVariablesResolver={cssVariablesResolver}>` as before. */
|
|
15
27
|
export declare const cssVariablesResolver: CSSVariablesResolver;
|
|
28
|
+
/** Options for {@link createBasaltTheme}'s derive-config path. */
|
|
29
|
+
export type CreateBasaltThemeOptions = {
|
|
30
|
+
/**
|
|
31
|
+
* Retune the shipped palette identity from the six-knob derive engine (`basalt-ui/tokens`'s
|
|
32
|
+
* `DeriveConfig`) instead of the shipped `#0077bd` zinc default. Omitted knobs fall back to
|
|
33
|
+
* {@link DEFAULT_DERIVE_CONFIG}'s value for that knob (`resolveDeriveConfig`).
|
|
34
|
+
*
|
|
35
|
+
* This is the ONE place a consumer sets the palette identity — everything else follows: the
|
|
36
|
+
* Mantine color ramps, the on-color contrast measurements, and the CSS-variables resolver
|
|
37
|
+
* fallbacks are all rebuilt from the SAME resolved config, and the config itself is stashed on
|
|
38
|
+
* `theme.other.basaltDerive` so `BasaltProvider` can inject the matching `--vx-*` stylesheet
|
|
39
|
+
* automatically. For live DEV-time tuning instead of a fixed production identity, see
|
|
40
|
+
* `DeriveControls` (`basalt-ui/theme-lab`).
|
|
41
|
+
*/
|
|
42
|
+
derive?: Partial<DeriveConfig>;
|
|
43
|
+
/**
|
|
44
|
+
* Retune the three-font system (`docs/DESIGN-SPEC.md` §3: Nunito Sans body / Hubot Sans
|
|
45
|
+
* condensed headings / JetBrains Mono numerals + micro-labels) instead of the shipped stacks.
|
|
46
|
+
* THIS is the font entry point — a consumer must not set `fontFamily` literals in component code
|
|
47
|
+
* (enforced by the `raw-font-family` guard kind, `./guard`); overriding Mantine's `fontFamily` via
|
|
48
|
+
* `overrides` is unnecessary because the theme already reads `--basalt-font-sans/head/mono`.
|
|
49
|
+
*
|
|
50
|
+
* Each value is a FULL CSS font-family stack string (bring your own fallback chain) —
|
|
51
|
+
* an omitted key keeps the shipped `styles.css` fallback untouched. The resolved value is
|
|
52
|
+
* stashed on `theme.other.basaltFonts` so `BasaltProvider` can inject the matching
|
|
53
|
+
* `--basalt-font-*` declarations — it rides the SAME `<style>` injection as the palette CSS, so
|
|
54
|
+
* `injectPalette={false}` (SSR/head injection) also opts fonts out; a consumer taking over
|
|
55
|
+
* injection must then emit those declarations itself.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* createBasaltTheme(undefined, { fonts: { sans: 'Inter, sans-serif' } })
|
|
59
|
+
*/
|
|
60
|
+
fonts?: BasaltFontsConfig;
|
|
61
|
+
/**
|
|
62
|
+
* Retune the two radius anchors (`card`/`ctrl`, `docs/DESIGN-SPEC.md` §4) and their dependent
|
|
63
|
+
* offsets from a single integer level in `[-5, 5]` (default `0` = the shipped identity: card 7,
|
|
64
|
+
* ctrl 6) — see `deriveRadius` (`basalt-ui/tokens`) for the exact law. Rebuilds every
|
|
65
|
+
* radius-anchored `defaultProps`/`styles` number in the Mantine theme AND the `radius` size-scale
|
|
66
|
+
* from the level's values. The resolved {@link RadiusValues} is stashed on
|
|
67
|
+
* `theme.other.basaltRadius` (only when non-default) so `BasaltProvider` can emit the matching
|
|
68
|
+
* `--vx-radius-*` override declarations — it rides the SAME `<style>` injection as the palette
|
|
69
|
+
* CSS, so `injectPalette={false}` also opts the radius override out.
|
|
70
|
+
*
|
|
71
|
+
* For live DEV-time tuning instead of a fixed production identity, see the "Radius" slider on
|
|
72
|
+
* `DeriveControls` (`basalt-ui/theme-lab`) — that dev-tool path can only move the CSS vars, not
|
|
73
|
+
* the defaultProps numbers baked into the theme object; this option covers both.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* createBasaltTheme(undefined, { radius: 2 })
|
|
77
|
+
*/
|
|
78
|
+
radius?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Retune spacing DENSITY from a single integer level in `[-3, 3]` (default `0` = the shipped
|
|
81
|
+
* identity) — narrower than `radius`'s `[-5, 5]` on purpose (see `deriveSpacing`'s JSDoc,
|
|
82
|
+
* `basalt-ui/tokens`, for why: the same `0.7..1.30` multiplier envelope at fewer, more meaningful
|
|
83
|
+
* notches). The law: a multiplier, `1 + 0.1 * level`, applied to every density-tracking anchor/
|
|
84
|
+
* scale-stop/one-off (rounded, floored at 1), plus an independent additive law for the NavLink row
|
|
85
|
+
* line-height. Rebuilds every
|
|
86
|
+
* density-anchored `defaultProps`/`styles` number in the Mantine theme (Timeline's `bulletSize`,
|
|
87
|
+
* Progress's `size`) AND the `spacing` size-scale from the level's values. The resolved
|
|
88
|
+
* {@link SpaceValues} is stashed on `theme.other.basaltDensity` (only when non-default) so
|
|
89
|
+
* `BasaltProvider` can emit the matching `--vx-space-*` override declarations — it rides the SAME
|
|
90
|
+
* `<style>` injection as the palette CSS, so `injectPalette={false}` also opts the density
|
|
91
|
+
* override out.
|
|
92
|
+
*
|
|
93
|
+
* For live DEV-time tuning instead of a fixed production identity, see the "Density" slider on
|
|
94
|
+
* `DeriveControls` (`basalt-ui/theme-lab`) — that dev-tool path can only move the CSS vars, not
|
|
95
|
+
* the defaultProps numbers baked into the theme object; this option covers both.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* createBasaltTheme(undefined, { density: -2 })
|
|
99
|
+
*/
|
|
100
|
+
density?: number;
|
|
101
|
+
};
|
|
16
102
|
/**
|
|
17
103
|
* Build the Basalt theme, optionally merged with consumer overrides. Overrides win on conflict
|
|
18
104
|
* (Mantine `mergeThemeOverrides` is last-wins), so a consumer can retune any field without
|
|
19
105
|
* forking the base.
|
|
106
|
+
*
|
|
107
|
+
* Pass `{ derive }` to retune the palette identity instead of the shipped default, `{ fonts }` to
|
|
108
|
+
* retune the three-font system, `{ radius }` to retune the two radius anchors, and/or `{ density }`
|
|
109
|
+
* to retune spacing density (see {@link CreateBasaltThemeOptions}); the default (no `options`, or
|
|
110
|
+
* `derive`/`radius`/`density` that resolve back to nothing non-default and a `fonts` that sets no
|
|
111
|
+
* slot — an omitted, empty, or all-`undefined`-keys object) stays on the pre-baked static
|
|
112
|
+
* `baseTheme` — zero extra derivation work, byte-identical to the shipped identity.
|
|
113
|
+
*
|
|
114
|
+
* Call this at MODULE scope, not inline in a component's render — the non-default `{ derive }` /
|
|
115
|
+
* `{ fonts }` / `{ radius }` / `{ density }` paths build a fresh `MantineThemeOverride` object on
|
|
116
|
+
* every call (`mergeThemeOverrides(...)`), so calling it per-render would hand `MantineProvider` a
|
|
117
|
+
* new `theme` reference every render and churn Mantine's theme context (and every consumer
|
|
118
|
+
* subscribed to it) for no reason.
|
|
119
|
+
*
|
|
120
|
+
* `overrides.other` deep-merges onto the derive-produced `other` (Mantine's `mergeThemeOverrides` /
|
|
121
|
+
* `deepMerge` recurse into plain-object values rather than replacing them wholesale), so passing
|
|
122
|
+
* `{ other: { myFlag: true } }` alongside a non-default `derive`/`fonts`/`radius`/`density` still
|
|
123
|
+
* leaves `other.basaltDerive`/`other.basaltFonts`/`other.basaltRadius`/`other.basaltDensity` intact
|
|
124
|
+
* — it is only lost if a consumer's own `overrides.other` explicitly sets that same key.
|
|
20
125
|
*/
|
|
21
|
-
export declare function createBasaltTheme(overrides?: MantineThemeOverride): MantineThemeOverride;
|
|
126
|
+
export declare function createBasaltTheme(overrides?: MantineThemeOverride, options?: CreateBasaltThemeOptions): MantineThemeOverride;
|
|
22
127
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EACV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AA+DA,OAAO,KAAK,EACV,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,eAAe,CAAA;AAStB,OAAO,KAAK,EAAe,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAOlD;;;;;GAKG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAIlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AASvD,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,iBAAiB;QACzB,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,WAAW,CAAC,EAAE,iBAAiB,CAAA;QAC/B,YAAY,CAAC,EAAE,YAAY,CAAA;QAC3B,aAAa,CAAC,EAAE,WAAW,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