basalt-ui 1.2.0 → 1.4.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/CHANGELOG.md +31 -0
- package/README.md +17 -3
- package/agent/rules/basalt-tokens.md +16 -5
- package/configs/lefthook.yml +13 -6
- package/dist/cli/index.d.ts +35 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +136 -19
- package/dist/guard/guard-hook.d.ts.map +1 -1
- package/dist/guard/guard-hook.js +3 -1
- package/dist/guard/index.d.ts +2 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +34 -5
- package/dist/guard/types.d.ts +34 -0
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/styles.css +21 -10
- package/dist/surfaces.d.ts +6 -0
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +6 -0
- package/dist/tokens/index.d.ts +72 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +41 -5
- package/dist/tokens.css +248 -0
- package/llms.txt +11 -2
- package/package.json +18 -2
- package/src/cli/check-theme.test.ts +58 -0
- package/src/cli/index.ts +236 -22
- package/src/cli/tokens-css.test.ts +90 -0
- package/src/guard/check-source.test.ts +224 -11
- package/src/guard/guard-hook.test.ts +30 -0
- package/src/guard/guard-hook.ts +6 -1
- package/src/guard/index.ts +132 -10
- package/src/guard/types.ts +35 -0
- package/src/styles.css +21 -10
- package/src/surfaces.ts +7 -0
- package/src/tokens/index.ts +142 -6
package/dist/guard/types.d.ts
CHANGED
|
@@ -7,6 +7,21 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/** The 19 theme-guard violation kinds. */
|
|
9
9
|
export type GuardKind = 'raw-hex' | 'raw-color-fn' | 'localstorage-theme' | 'off-identity-accent' | 'raw-spacing' | 'raw-radius' | 'raw-surface' | 'card-with-border' | 'off-system-surface-var' | 'raw-html-layout' | 'inline-spacing' | 'inline-display' | 'raw-visx-axis' | 'raw-motion-value' | 'unframed-chart' | 'chart-missing-aria-label' | 'raw-form-control' | 'sub-16-input-font' | 'raw-font-family';
|
|
10
|
+
/**
|
|
11
|
+
* How hard a finding lands. `error` fails the build; `warn` reports and passes.
|
|
12
|
+
*
|
|
13
|
+
* The point of `warn` is the LANDING of a new rule, not a permanent tier. basalt-ui bans majors by
|
|
14
|
+
* design — 1.x absorbs breaks — so a consumer has no semver channel telling them enforcement got
|
|
15
|
+
* stricter, and the guard is the part of the framework that can hard-fail their build. A kind that
|
|
16
|
+
* arrives as an error therefore turns a routine minor upgrade into an unplanned refactor: 1.2.0
|
|
17
|
+
* cost the one real consumer eleven `theme-allow` comments, and 1.3.0 had them delete all eleven
|
|
18
|
+
* again — net zero source change, two commits, two production deploys.
|
|
19
|
+
*
|
|
20
|
+
* So: a change that makes the guard reject code it previously accepted — a new kind, or an existing
|
|
21
|
+
* kind reaching a new file type — ships `warn` for one minor, then promotes. The consumer sees it,
|
|
22
|
+
* schedules it, and upgrades on a green build.
|
|
23
|
+
*/
|
|
24
|
+
export type GuardSeverity = 'warn' | 'error';
|
|
10
25
|
/**
|
|
11
26
|
* A structured finding — the chosen testable surface (§C.4). Replaces the old `Violation` type.
|
|
12
27
|
* `relPath` + `line` + `token` + `kind` uniquely identify the violation.
|
|
@@ -20,6 +35,8 @@ export type Finding = {
|
|
|
20
35
|
readonly line: number;
|
|
21
36
|
readonly token: string;
|
|
22
37
|
readonly kind: GuardKind;
|
|
38
|
+
/** Resolved per kind from {@link GuardConfig.severity} over the shipped default. */
|
|
39
|
+
readonly severity: GuardSeverity;
|
|
23
40
|
};
|
|
24
41
|
/**
|
|
25
42
|
* Everything a single-file scan needs — no walk, no FS. The 3 dynamic regexes (forbiddenAccent,
|
|
@@ -114,5 +131,22 @@ export type GuardConfig = {
|
|
|
114
131
|
* { exemptRules: { 'inline-display': ['agent'] } } // inline-display never fires under src/agent/**
|
|
115
132
|
*/
|
|
116
133
|
readonly exemptRules: Partial<Record<GuardKind, string[]>>;
|
|
134
|
+
/**
|
|
135
|
+
* Per-kind severity override. A kind absent here takes the shipped default, which is `error`
|
|
136
|
+
* for every kind past its grace minor — see {@link GuardSeverity} for why a grace minor exists.
|
|
137
|
+
*
|
|
138
|
+
* Two directions, both legitimate:
|
|
139
|
+
* • `'warn'` on an `error` kind — a consumer who wants to upgrade now and fix later, on their
|
|
140
|
+
* own schedule rather than the release's.
|
|
141
|
+
* • `'error'` on a grace-period kind — a consumer who would rather take the enforcement
|
|
142
|
+
* immediately than carry a warning for a minor.
|
|
143
|
+
*
|
|
144
|
+
* This is severity, NOT an off switch: every kind already has its own boolean in this config,
|
|
145
|
+
* and `exemptRules` scopes a kind to paths. A kind turned down to `warn` still reports.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* { severity: { 'inline-spacing': 'warn' } } // report, don't fail, while we migrate
|
|
149
|
+
*/
|
|
150
|
+
readonly severity: Partial<Record<GuardKind, GuardSeverity>>;
|
|
117
151
|
};
|
|
118
152
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/guard/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,cAAc,GACd,oBAAoB,GACpB,qBAAqB,GACrB,aAAa,GACb,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,wBAAwB,GACxB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,gBAAgB,GAChB,0BAA0B,GAC1B,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,CAAA;AAErB;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,MAA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,EAAE,OAAO,CAAA;IACrC,sGAAsG;IACtG,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,yFAAyF;IACzF,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,kGAAkG;IAClG,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B;;;;;OAKG;IACH,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAA;IACvC;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;IAChC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,CAAA;IAC1D;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAA;CAC7D,CAAA"}
|
package/dist/styles.css
CHANGED
|
@@ -24,6 +24,11 @@
|
|
|
24
24
|
/* Font stack — overridable via the --basalt-font-* custom properties. */
|
|
25
25
|
@layer base {
|
|
26
26
|
:root {
|
|
27
|
+
/* Hubot Sans is a condensed display face; the spec pins it at 88% wherever it lands. A knob
|
|
28
|
+
rather than a literal at the rule below, because that rule reaches BARE h1–h6: a consumer
|
|
29
|
+
that layers its own base type would otherwise have no way to keep its own heading width
|
|
30
|
+
short of out-specifying the framework. `normal` opts out entirely. */
|
|
31
|
+
--basalt-font-head-stretch: 88%;
|
|
27
32
|
--basalt-font-sans:
|
|
28
33
|
'Nunito Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
|
|
29
34
|
Helvetica, Arial, sans-serif;
|
|
@@ -75,7 +80,9 @@
|
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
/* Hubot Sans is a condensed display face — the spec pins it at 88% font-stretch everywhere it
|
|
78
|
-
lands (headings + the Mantine Title component).
|
|
83
|
+
lands (headings + the Mantine Title component). Read from the knob declared above rather than
|
|
84
|
+
hardcoded here, so a consumer retunes it in one declaration instead of fighting these bare
|
|
85
|
+
element selectors with a more specific rule of their own. */
|
|
79
86
|
h1,
|
|
80
87
|
h2,
|
|
81
88
|
h3,
|
|
@@ -83,7 +90,7 @@
|
|
|
83
90
|
h5,
|
|
84
91
|
h6,
|
|
85
92
|
.mantine-Title-root {
|
|
86
|
-
font-stretch: 88
|
|
93
|
+
font-stretch: var(--basalt-font-head-stretch, 88%);
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
/* Scrollbars (docs/DESIGN-SPEC.md §5): 9px, ink-mix thumb (stronger on hover), radius 6,
|
|
@@ -153,14 +160,18 @@
|
|
|
153
160
|
.mantine-ScrollArea-scrollbar:active .mantine-ScrollArea-thumb {
|
|
154
161
|
background-color: var(--basalt-scrollbar-thumb-hover);
|
|
155
162
|
}
|
|
156
|
-
}
|
|
157
163
|
|
|
158
|
-
/* Print: hide the BasaltShell chrome so only page content prints.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
/* Print: hide the BasaltShell chrome so only page content prints.
|
|
165
|
+
Scoped to AppShell's own class hooks, NOT to bare nav/header/footer. The element form matched
|
|
166
|
+
any landmark on the page — a consumer with a real <nav> and no BasaltShell silently printed a
|
|
167
|
+
blank one, and being unlayered with `!important` there was nothing they could do about it
|
|
168
|
+
either. `@layer basalt` already outranks `@layer mantine`, so no `!important` is needed to win
|
|
169
|
+
against the AppShell's own display rules. */
|
|
170
|
+
@media print {
|
|
171
|
+
.mantine-AppShell-navbar,
|
|
172
|
+
.mantine-AppShell-header,
|
|
173
|
+
.mantine-AppShell-footer {
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
165
176
|
}
|
|
166
177
|
}
|
package/dist/surfaces.d.ts
CHANGED
|
@@ -331,6 +331,12 @@ export declare const SURFACES: {
|
|
|
331
331
|
readonly description: "Mandatory CSS import (after the Mantine styles.layer.css bundles) — @layer basalt base styles, iOS input safety net, font stack";
|
|
332
332
|
readonly forbiddenImports: readonly [];
|
|
333
333
|
};
|
|
334
|
+
readonly './tokens.css': {
|
|
335
|
+
readonly kind: "tooling";
|
|
336
|
+
readonly layer: "non-js-asset";
|
|
337
|
+
readonly description: "Prebuilt --vx-* token stylesheet — the default buildPaletteCss() output as a plain file, for a consumer with no bundler, no React and no Mantine; retune the selector or trim the spacing set with `basalt-ui tokens:css`";
|
|
338
|
+
readonly forbiddenImports: readonly [];
|
|
339
|
+
};
|
|
334
340
|
readonly './configs/*': {
|
|
335
341
|
readonly kind: "tooling";
|
|
336
342
|
readonly layer: "non-js-asset";
|
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,GACT,KAAK,CAAA;AAET;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,eAAe,GAAG,eAAe,CAAA;AAExE;;;;GAIG;AACH,MAAM,MAAM,KAAK,G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les) \u2014 @layer basalt base styles, iOS input safety net, font stack",
|
|
245
245
|
forbiddenImports: []
|
|
246
246
|
},
|
|
247
|
+
"./tokens.css": {
|
|
248
|
+
kind: "tooling",
|
|
249
|
+
layer: "non-js-asset",
|
|
250
|
+
description: "Prebuilt --vx-* token stylesheet \u2014 the default buildPaletteCss() output as a plain file, for a consumer with no bundler, no React and no Mantine; retune the selector or trim the spacing set with `basalt-ui tokens:css`",
|
|
251
|
+
forbiddenImports: []
|
|
252
|
+
},
|
|
247
253
|
"./configs/*": {
|
|
248
254
|
kind: "tooling",
|
|
249
255
|
layer: "non-js-asset",
|
package/dist/tokens/index.d.ts
CHANGED
|
@@ -148,12 +148,76 @@ export declare function defineSeries<const T extends SeriesMap>(map: T): T;
|
|
|
148
148
|
export declare function groupTokens<const T extends SeriesMap>(name: string, map: T): {
|
|
149
149
|
[K in keyof T]: string;
|
|
150
150
|
};
|
|
151
|
+
/**
|
|
152
|
+
* The attribute + values the per-scheme blocks key off. Defaults reproduce Mantine's own toggle
|
|
153
|
+
* (`data-mantine-color-scheme` = `dark` / `light`), so a consumer only names the axis it differs
|
|
154
|
+
* on. Supplying this object at all switches the emitter onto the framework-neutral selector shape
|
|
155
|
+
* — see {@link BuildPaletteOpts.scheme}.
|
|
156
|
+
*/
|
|
157
|
+
export type ColorSchemeSelector = {
|
|
158
|
+
attribute?: string;
|
|
159
|
+
darkValue?: string;
|
|
160
|
+
lightValue?: string;
|
|
161
|
+
};
|
|
151
162
|
/** Options for {@link buildPaletteCss}. */
|
|
152
163
|
export type BuildPaletteOpts = {
|
|
153
164
|
/** Extra named series maps to emit under the given prefixes (e.g. `{ '': SERIES, 'activity-': ACTIVITY }`). */
|
|
154
165
|
groups?: Record<string, SeriesMap>;
|
|
155
166
|
/** Theme-independent derived declarations (gradients, semantic fills) emitted once on `:root`. */
|
|
156
167
|
derived?: string[];
|
|
168
|
+
/**
|
|
169
|
+
* Attribute + values the per-scheme blocks key off — for a consumer whose scheme toggle is not
|
|
170
|
+
* Mantine's (a static site on `data-theme`, say). Default: Mantine's own
|
|
171
|
+
* `data-mantine-color-scheme` = `dark` / `light`.
|
|
172
|
+
*
|
|
173
|
+
* Setting ANY of `scheme` / `defaultScheme` / `mediaFallback` moves the emitter off the legacy
|
|
174
|
+
* `html[…]` selector onto `:root[…]`. That is deliberate and load-bearing, NOT cosmetic:
|
|
175
|
+
*
|
|
176
|
+
* `:root[data-theme='dark']` 0-2-0 ← what this path emits
|
|
177
|
+
* `html[data-theme='dark']` 0-1-1
|
|
178
|
+
* `[data-theme='dark']` 0-1-0 ← same as a bare `:root`, so source order decides
|
|
179
|
+
*
|
|
180
|
+
* A light-default site whose own `:root` block happens to come last would beat the third form
|
|
181
|
+
* outright — dark mode silently does nothing. `:root[…]` sits above both a bare `:root` and
|
|
182
|
+
* `html[…]`, and carries no assumption about the element the attribute lands on.
|
|
183
|
+
*
|
|
184
|
+
* The no-options path keeps emitting `html[data-mantine-color-scheme='…']` verbatim, because a
|
|
185
|
+
* basalt consumer may already override `--vx-*` under that exact selector — raising basalt's own
|
|
186
|
+
* specificity would silently win over their override.
|
|
187
|
+
*/
|
|
188
|
+
scheme?: ColorSchemeSelector;
|
|
189
|
+
/**
|
|
190
|
+
* Which scheme rides along on the bare `:root` block — the one that applies when the attribute
|
|
191
|
+
* is absent. Default: `'dark'` (the framework's own default scheme).
|
|
192
|
+
*
|
|
193
|
+
* `'none'` emits no bare-`:root` primitives at all: each scheme gets only its attribute block,
|
|
194
|
+
* and an unattributed document falls back to the theme-independent scalars alone. Pair it with
|
|
195
|
+
* `mediaFallback` unless the consumer always sets the attribute.
|
|
196
|
+
*/
|
|
197
|
+
defaultScheme?: 'dark' | 'light' | 'none';
|
|
198
|
+
/**
|
|
199
|
+
* Also emit an `@media (prefers-color-scheme: …)` block for every scheme that is not the bare
|
|
200
|
+
* `:root` default, so a document with no attribute set follows the OS. Default: `false`.
|
|
201
|
+
*
|
|
202
|
+
* The block is a bare `:root` (0-1-0), so an explicit attribute block (0-2-0) always wins over
|
|
203
|
+
* it regardless of source order — the OS preference is a fallback, never an override.
|
|
204
|
+
*/
|
|
205
|
+
mediaFallback?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* How much of the SPACING set to emit. Default: `'all'` (every one of the 104 `--vx-space-*`
|
|
208
|
+
* declarations the framework's own components read).
|
|
209
|
+
*
|
|
210
|
+
* `'core'` keeps the 9 generic anchors — the stack rhythm, the two control heights, the row
|
|
211
|
+
* insets — and drops the 95 named for a specific basalt component
|
|
212
|
+
* (`--vx-space-agent-transcript-inset`, `--vx-space-toc-sub-indent`, …), taking the emitted set
|
|
213
|
+
* from 197 variables to 102. Nothing outside basalt's own React components reads those, so a
|
|
214
|
+
* framework-free consumer is carrying them for nothing.
|
|
215
|
+
*
|
|
216
|
+
* This is a SPACING filter only: color, radius, shadow, type and status variables are identical
|
|
217
|
+
* in both modes. The partition is derived from the `SPACE` key set rather than a maintained list
|
|
218
|
+
* — see {@link CORE_SPACE_VARS}.
|
|
219
|
+
*/
|
|
220
|
+
only?: 'core' | 'all';
|
|
157
221
|
};
|
|
158
222
|
/**
|
|
159
223
|
* Emit the `--vx-*` stylesheet: a `:root` block of theme-independent scalars, then the
|
|
@@ -170,6 +234,14 @@ export type BuildPaletteOpts = {
|
|
|
170
234
|
*
|
|
171
235
|
* Dark is the default (`:root`) since the framework defaults to dark; the
|
|
172
236
|
* `[data-mantine-color-scheme]` selectors track Mantine's toggle on `<html>`.
|
|
237
|
+
*
|
|
238
|
+
* A non-Mantine consumer retargets all three of those choices — the attribute, which scheme rides
|
|
239
|
+
* the bare `:root`, and whether the OS preference is honoured — via `opts.scheme` /
|
|
240
|
+
* `opts.defaultScheme` / `opts.mediaFallback`. Setting any of them also moves the per-scheme
|
|
241
|
+
* selector from `html[…]` to the framework-neutral, higher-specificity `:root[…]`; see
|
|
242
|
+
* `BuildPaletteOpts.scheme` for why that is not cosmetic. With none of them set the output is
|
|
243
|
+
* byte-identical to what the framework has always emitted (pinned by
|
|
244
|
+
* `tests/palette-css.test.ts`).
|
|
173
245
|
*/
|
|
174
246
|
export declare function buildPaletteCss(opts?: BuildPaletteOpts, data?: PaletteData): string;
|
|
175
247
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAMvE,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAOjC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnF,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAM5D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAO7C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,wFAAwF;AACxF,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvD,8FAA8F;AAC9F,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,GAAG,MAAM,KAAG,MACoB,CAAA;AAsCrE,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsIL,CAAA;AAOV;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,MAA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AA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AASD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAkB1E;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,MAAM,CASvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAGtE"}
|
package/dist/tokens/index.js
CHANGED
|
@@ -347,13 +347,21 @@ function spaceDecls(space) {
|
|
|
347
347
|
// as JS numbers via `useBasaltSpacing()` (Mantine's `<Menu width={…}>` also takes a number).
|
|
348
348
|
];
|
|
349
349
|
}
|
|
350
|
+
const CORE_SPACE_VARS = new Set(
|
|
351
|
+
Object.keys(SPACE).map((key) => `space-${key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`)
|
|
352
|
+
);
|
|
353
|
+
function isCoreSpaceDecl(line) {
|
|
354
|
+
const name = /^ {2}--vx-([\w-]+):/.exec(line)?.[1];
|
|
355
|
+
return name !== void 0 && CORE_SPACE_VARS.has(name);
|
|
356
|
+
}
|
|
350
357
|
const DEFAULT_SPACE_VALUES = {
|
|
351
358
|
anchors: SPACE,
|
|
352
359
|
scale: SPACE_SCALE,
|
|
353
360
|
step: SPACE_STEP,
|
|
354
361
|
rowLineHeight: ROW_LINE_HEIGHT
|
|
355
362
|
};
|
|
356
|
-
function frameworkDerived(data) {
|
|
363
|
+
function frameworkDerived(data, only) {
|
|
364
|
+
const space = spaceDecls(DEFAULT_SPACE_VALUES);
|
|
357
365
|
return [
|
|
358
366
|
decl("radius-card", `${RADIUS.card}px`),
|
|
359
367
|
decl("radius-ctrl", `${RADIUS.ctrl}px`),
|
|
@@ -368,7 +376,7 @@ function frameworkDerived(data) {
|
|
|
368
376
|
// only in this static block, never in `buildRadiusCss`'s dynamic override (see
|
|
369
377
|
// `RADIUS_STEP.pill`'s doc).
|
|
370
378
|
decl("radius-pill", `${RADIUS_STEP.pill}px`),
|
|
371
|
-
...
|
|
379
|
+
...only === "core" ? space.filter(isCoreSpaceDecl) : space,
|
|
372
380
|
// Article-density Prose measure (docs/CONTENT-SPEC.md §5) — theme-independent, like the radii.
|
|
373
381
|
decl("prose-measure", "72ch"),
|
|
374
382
|
// The fill band (see FILL in palette.ts). Emitted on `:root`, NOT per scheme — a filled surface
|
|
@@ -406,10 +414,12 @@ function defineSeries(map) {
|
|
|
406
414
|
function groupTokens(name, map) {
|
|
407
415
|
return seriesTokens(map, `${name}-`);
|
|
408
416
|
}
|
|
417
|
+
const MANTINE_SCHEME_ATTRIBUTE = "data-mantine-color-scheme";
|
|
418
|
+
const indent = (block) => block.split("\n").map((line) => line === "" ? line : ` ${line}`).join("\n");
|
|
409
419
|
function buildPaletteCss(opts = {}, data = buildPaletteData()) {
|
|
410
420
|
const groups = opts.groups ?? {};
|
|
411
421
|
const extraDerived = (opts.derived ?? []).map((d) => ` ${d}`).join("\n");
|
|
412
|
-
const derivedBlock = frameworkDerived(data);
|
|
422
|
+
const derivedBlock = frameworkDerived(data, opts.only ?? "all");
|
|
413
423
|
const derived = extraDerived ? `${derivedBlock}
|
|
414
424
|
${extraDerived}` : derivedBlock;
|
|
415
425
|
const side = (s) => {
|
|
@@ -418,9 +428,11 @@ ${extraDerived}` : derivedBlock;
|
|
|
418
428
|
return extra ? `${framework}
|
|
419
429
|
${extra}` : framework;
|
|
420
430
|
};
|
|
421
|
-
|
|
431
|
+
const rootBlock = `:root {
|
|
422
432
|
${derived}
|
|
423
|
-
}
|
|
433
|
+
}`;
|
|
434
|
+
if (opts.scheme === void 0 && opts.defaultScheme === void 0 && !opts.mediaFallback) {
|
|
435
|
+
return `${rootBlock}
|
|
424
436
|
:root,
|
|
425
437
|
html[data-mantine-color-scheme='dark'] {
|
|
426
438
|
${side("dark")}
|
|
@@ -428,6 +440,30 @@ ${side("dark")}
|
|
|
428
440
|
html[data-mantine-color-scheme='light'] {
|
|
429
441
|
${side("light")}
|
|
430
442
|
}`;
|
|
443
|
+
}
|
|
444
|
+
const attribute = opts.scheme?.attribute ?? MANTINE_SCHEME_ATTRIBUTE;
|
|
445
|
+
const value = {
|
|
446
|
+
dark: opts.scheme?.darkValue ?? "dark",
|
|
447
|
+
light: opts.scheme?.lightValue ?? "light"
|
|
448
|
+
};
|
|
449
|
+
const defaultScheme = opts.defaultScheme ?? "dark";
|
|
450
|
+
const order = defaultScheme === "light" ? ["light", "dark"] : ["dark", "light"];
|
|
451
|
+
const blocks = [rootBlock];
|
|
452
|
+
for (const s of order) {
|
|
453
|
+
const selector = s === defaultScheme ? `:root,
|
|
454
|
+
:root[${attribute}='${value[s]}']` : `:root[${attribute}='${value[s]}']`;
|
|
455
|
+
if (opts.mediaFallback === true && s !== defaultScheme) {
|
|
456
|
+
blocks.push(`@media (prefers-color-scheme: ${s}) {
|
|
457
|
+
:root {
|
|
458
|
+
${indent(side(s))}
|
|
459
|
+
}
|
|
460
|
+
}`);
|
|
461
|
+
}
|
|
462
|
+
blocks.push(`${selector} {
|
|
463
|
+
${side(s)}
|
|
464
|
+
}`);
|
|
465
|
+
}
|
|
466
|
+
return blocks.join("\n");
|
|
431
467
|
}
|
|
432
468
|
const FONT_VAR_NAMES = {
|
|
433
469
|
sans: "--basalt-font-sans",
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--vx-radius-card: 7px;
|
|
3
|
+
--vx-radius-ctrl: 6px;
|
|
4
|
+
--vx-radius-tight: 5px;
|
|
5
|
+
--vx-radius-fine: 4px;
|
|
6
|
+
--vx-radius-floating: 8px;
|
|
7
|
+
--vx-radius-pill: 9999px;
|
|
8
|
+
--vx-space-row-inset-x: 10px;
|
|
9
|
+
--vx-space-row-inset-y: 6px;
|
|
10
|
+
--vx-space-row-line-height: 1.35;
|
|
11
|
+
--vx-space-input-height: 2.625rem;
|
|
12
|
+
--vx-space-control-height: 2.625rem;
|
|
13
|
+
--vx-space-stack-xs: 4px;
|
|
14
|
+
--vx-space-stack-sm: 8px;
|
|
15
|
+
--vx-space-stack-md: 12px;
|
|
16
|
+
--vx-space-stack-lg: 16px;
|
|
17
|
+
--vx-space-stack-xl: 24px;
|
|
18
|
+
--vx-space-sticky-header-clearance: 60px;
|
|
19
|
+
--vx-space-sticky-header-clearance-mobile: 109px;
|
|
20
|
+
--vx-space-nav-icon-gap: 10px;
|
|
21
|
+
--vx-space-sidebar-region-gap: 10px;
|
|
22
|
+
--vx-space-prose-quote-inset-y: 2px;
|
|
23
|
+
--vx-space-prose-quote-indent: 12px;
|
|
24
|
+
--vx-space-prose-inline-code-inset-y: 1.5px;
|
|
25
|
+
--vx-space-prose-inline-code-inset-x: 5px;
|
|
26
|
+
--vx-space-prose-code-block-inset-y: 10px;
|
|
27
|
+
--vx-space-prose-code-block-inset-x: 12px;
|
|
28
|
+
--vx-space-prose-heading-anchor-gap: 6px;
|
|
29
|
+
--vx-space-prose-table-cell-inset-y: 5px;
|
|
30
|
+
--vx-space-prose-table-cell-inset-x: 8px;
|
|
31
|
+
--vx-space-prose-chat-list-gap-bottom: 10px;
|
|
32
|
+
--vx-space-prose-chat-list-indent: 20px;
|
|
33
|
+
--vx-space-prose-chat-list-item-gap: 3px;
|
|
34
|
+
--vx-space-prose-chat-nested-list-gap: 2px;
|
|
35
|
+
--vx-space-prose-chat-heading-gap-top: 14px;
|
|
36
|
+
--vx-space-prose-chat-heading-gap-bottom: 6px;
|
|
37
|
+
--vx-space-prose-article-paragraph-gap: 14px;
|
|
38
|
+
--vx-space-prose-article-list-gap-top: 6px;
|
|
39
|
+
--vx-space-prose-article-list-gap-bottom: 14px;
|
|
40
|
+
--vx-space-prose-article-list-indent: 22px;
|
|
41
|
+
--vx-space-prose-article-h1-gap-top: 6px;
|
|
42
|
+
--vx-space-prose-article-h1-gap-bottom: 14px;
|
|
43
|
+
--vx-space-prose-article-heading-gap-top: 30px;
|
|
44
|
+
--vx-space-prose-article-heading-gap-bottom: 10px;
|
|
45
|
+
--vx-space-prose-article-h2-rule-gap: 6px;
|
|
46
|
+
--vx-space-prose-article-block-gap: 18px;
|
|
47
|
+
--vx-space-article-column-gap: 56px;
|
|
48
|
+
--vx-space-article-toc-rail-width: 220px;
|
|
49
|
+
--vx-space-article-header-gap: 10px;
|
|
50
|
+
--vx-space-article-header-padding-bottom: 20px;
|
|
51
|
+
--vx-space-article-header-margin-bottom: 28px;
|
|
52
|
+
--vx-space-article-meta-row-gap: 6px;
|
|
53
|
+
--vx-space-article-footer-gap: 12px;
|
|
54
|
+
--vx-space-article-footer-margin-top: 40px;
|
|
55
|
+
--vx-space-article-footer-padding-top: 20px;
|
|
56
|
+
--vx-space-article-nav-target-gap: 6px;
|
|
57
|
+
--vx-space-code-block-header-gap: 8px;
|
|
58
|
+
--vx-space-code-block-header-inset-y: 6px;
|
|
59
|
+
--vx-space-code-block-header-inset-right: 10px;
|
|
60
|
+
--vx-space-code-block-content-inset-x: 14px;
|
|
61
|
+
--vx-space-code-block-header-right-gap: 6px;
|
|
62
|
+
--vx-space-code-block-body-inset-y: 10px;
|
|
63
|
+
--vx-space-code-block-floating-copy-offset: 6px;
|
|
64
|
+
--vx-space-callout-inset-y: 10px;
|
|
65
|
+
--vx-space-callout-inset-x: 14px;
|
|
66
|
+
--vx-space-callout-title-row-gap: 8px;
|
|
67
|
+
--vx-space-toc-root-gap: 6px;
|
|
68
|
+
--vx-space-toc-link-inset-y: 4px;
|
|
69
|
+
--vx-space-toc-link-indent: 12px;
|
|
70
|
+
--vx-space-toc-sub-indent: 24px;
|
|
71
|
+
--vx-space-article-card-tags-gap: 4px;
|
|
72
|
+
--vx-space-article-card-tag-inset-y: 1px;
|
|
73
|
+
--vx-space-article-card-tag-inset-x: 6px;
|
|
74
|
+
--vx-space-article-card-meta-gap-top: 2px;
|
|
75
|
+
--vx-space-guide-body-gap-bottom: 8px;
|
|
76
|
+
--vx-space-guide-footer-gap-top: 20px;
|
|
77
|
+
--vx-space-guide-footer-inset-top: 16px;
|
|
78
|
+
--vx-space-sidebar-search-gap: 7px;
|
|
79
|
+
--vx-space-sidebar-search-trigger-height: 32px;
|
|
80
|
+
--vx-space-settings-row-inset-y: 10px;
|
|
81
|
+
--vx-space-settings-row-gap: 16px;
|
|
82
|
+
--vx-space-mermaid-container-inset: 16px;
|
|
83
|
+
--vx-space-sidebar-brand-inset-top: 2px;
|
|
84
|
+
--vx-space-sidebar-brand-inset-x: 7px;
|
|
85
|
+
--vx-space-sidebar-section-gap: 12px;
|
|
86
|
+
--vx-space-sidebar-account-inset-top: 9px;
|
|
87
|
+
--vx-space-sidebar-account-inset-x: 7px;
|
|
88
|
+
--vx-space-sidebar-account-inset-bottom: 2px;
|
|
89
|
+
--vx-space-sidebar-avatar-size: 28px;
|
|
90
|
+
--vx-space-sidebar-section-label-gap: 2px;
|
|
91
|
+
--vx-space-sidebar-child-list-gap-top: 2px;
|
|
92
|
+
--vx-space-sidebar-child-list-gap-bottom: 3px;
|
|
93
|
+
--vx-space-sidebar-child-list-indent: 15px;
|
|
94
|
+
--vx-space-sidebar-child-row-inset-y: 4px;
|
|
95
|
+
--vx-space-sidebar-child-row-indent: 12px;
|
|
96
|
+
--vx-space-app-header-mobile-actions-height: 52px;
|
|
97
|
+
--vx-space-mobile-nav-tab-gap: 3px;
|
|
98
|
+
--vx-space-agent-rail-inset-x: 10px;
|
|
99
|
+
--vx-space-agent-part-gap-top: 6px;
|
|
100
|
+
--vx-space-agent-code-inset: 8px;
|
|
101
|
+
--vx-space-agent-error-inset-y: 8px;
|
|
102
|
+
--vx-space-agent-error-inset-x: 10px;
|
|
103
|
+
--vx-space-agent-scroll-button-gap-top: 8px;
|
|
104
|
+
--vx-space-agent-message-inset-y: 10px;
|
|
105
|
+
--vx-space-agent-message-inset-x: 12px;
|
|
106
|
+
--vx-space-agent-transcript-inset: 16px;
|
|
107
|
+
--vx-space-badge-inset-y: 2px;
|
|
108
|
+
--vx-space-badge-inset-x: 7px;
|
|
109
|
+
--vx-space-stat-card-gap: 8px;
|
|
110
|
+
--vx-space-virtual-row-inset-y: 8px;
|
|
111
|
+
--vx-space-virtual-row-inset-x: 12px;
|
|
112
|
+
--vx-prose-measure: 72ch;
|
|
113
|
+
--vx-fill-gray: #717176;
|
|
114
|
+
--vx-fill-red: #b7514e;
|
|
115
|
+
--vx-fill-pink: #ba4b6c;
|
|
116
|
+
--vx-fill-grape: #9e579c;
|
|
117
|
+
--vx-fill-violet: #9e579c;
|
|
118
|
+
--vx-fill-indigo: #7863bc;
|
|
119
|
+
--vx-fill-cyan: #43769a;
|
|
120
|
+
--vx-fill-teal: #3a7c74;
|
|
121
|
+
--vx-fill-green: #427e3f;
|
|
122
|
+
--vx-fill-lime: #687737;
|
|
123
|
+
--vx-fill-yellow: #8d6c2e;
|
|
124
|
+
--vx-fill-orange: #9a6632;
|
|
125
|
+
--vx-fillHover-gray: color-mix(in srgb, var(--vx-fill-gray) 88%, #000);
|
|
126
|
+
--vx-fillHover-red: color-mix(in srgb, var(--vx-fill-red) 88%, #000);
|
|
127
|
+
--vx-fillHover-pink: color-mix(in srgb, var(--vx-fill-pink) 88%, #000);
|
|
128
|
+
--vx-fillHover-grape: color-mix(in srgb, var(--vx-fill-grape) 88%, #000);
|
|
129
|
+
--vx-fillHover-violet: color-mix(in srgb, var(--vx-fill-violet) 88%, #000);
|
|
130
|
+
--vx-fillHover-indigo: color-mix(in srgb, var(--vx-fill-indigo) 88%, #000);
|
|
131
|
+
--vx-fillHover-cyan: color-mix(in srgb, var(--vx-fill-cyan) 88%, #000);
|
|
132
|
+
--vx-fillHover-teal: color-mix(in srgb, var(--vx-fill-teal) 88%, #000);
|
|
133
|
+
--vx-fillHover-green: color-mix(in srgb, var(--vx-fill-green) 88%, #000);
|
|
134
|
+
--vx-fillHover-lime: color-mix(in srgb, var(--vx-fill-lime) 88%, #000);
|
|
135
|
+
--vx-fillHover-yellow: color-mix(in srgb, var(--vx-fill-yellow) 88%, #000);
|
|
136
|
+
--vx-fillHover-orange: color-mix(in srgb, var(--vx-fill-orange) 88%, #000);
|
|
137
|
+
--vx-text-micro: 11px;
|
|
138
|
+
--vx-text-xs: 12.5px;
|
|
139
|
+
--vx-text-sm: 13.5px;
|
|
140
|
+
--vx-text-md: 15px;
|
|
141
|
+
--vx-text-lg: 16px;
|
|
142
|
+
--vx-text-xl: 18px;
|
|
143
|
+
--vx-text-h2: 21px;
|
|
144
|
+
--vx-text-kpi: 24px;
|
|
145
|
+
--vx-text-h1: 26px;
|
|
146
|
+
--vx-area-top: 22%;
|
|
147
|
+
--vx-area-bottom: 1%;
|
|
148
|
+
--vx-good: color-mix(in srgb, var(--vx-goodSolid) 18%, transparent);
|
|
149
|
+
--vx-goodSoft: color-mix(in srgb, var(--vx-goodSolid) 8%, transparent);
|
|
150
|
+
--vx-bad: color-mix(in srgb, var(--vx-badSolid) 18%, transparent);
|
|
151
|
+
--vx-warn: color-mix(in srgb, var(--vx-warnSolid) 8%, transparent);
|
|
152
|
+
--vx-goodRef: color-mix(in srgb, var(--vx-goodSolid) 30%, transparent);
|
|
153
|
+
--vx-badRef: color-mix(in srgb, var(--vx-badSolid) 30%, transparent);
|
|
154
|
+
--vx-warnRef: color-mix(in srgb, var(--vx-warnSolid) 20%, transparent);
|
|
155
|
+
}
|
|
156
|
+
:root,
|
|
157
|
+
html[data-mantine-color-scheme='dark'] {
|
|
158
|
+
--vx-status-excellent: #43bf4d;
|
|
159
|
+
--vx-status-good: #52c07c;
|
|
160
|
+
--vx-status-warn: #e6a53d;
|
|
161
|
+
--vx-status-bad: #e06761;
|
|
162
|
+
--vx-status-neutral: #a1a1aa;
|
|
163
|
+
--vx-goodSolid: #52c07c;
|
|
164
|
+
--vx-badSolid: #e06761;
|
|
165
|
+
--vx-warnSolid: #e6a53d;
|
|
166
|
+
--vx-neutral: #d4d4d8;
|
|
167
|
+
--vx-line: #e4e4e7;
|
|
168
|
+
--vx-line2: #a1a1aa;
|
|
169
|
+
--vx-axis: rgba(255,255,255,0.6);
|
|
170
|
+
--vx-axisStroke: rgba(255,255,255,0.12);
|
|
171
|
+
--vx-grid: rgba(255,255,255,0.06);
|
|
172
|
+
--vx-crosshair: rgba(255,255,255,0.42);
|
|
173
|
+
--vx-dotStroke: #27272a;
|
|
174
|
+
--vx-tooltipBg: rgba(39,39,42,0.96);
|
|
175
|
+
--vx-tooltipText: rgba(255,255,255,0.88);
|
|
176
|
+
--vx-tooltipMuted: rgba(255,255,255,0.5);
|
|
177
|
+
--vx-tooltipBorder: none;
|
|
178
|
+
--vx-tooltipShadow: 0 2px 8px rgba(0,0,0,0.35);
|
|
179
|
+
--vx-legendText: rgba(255,255,255,0.92);
|
|
180
|
+
--vx-ink: #e5e5e9;
|
|
181
|
+
--vx-ink2: #dddde1;
|
|
182
|
+
--vx-muted: #d4d4d8;
|
|
183
|
+
--vx-faint: #a1a1a4;
|
|
184
|
+
--vx-accent: #a2c3f0;
|
|
185
|
+
--vx-accentHover: #65a2e3;
|
|
186
|
+
--vx-accentFill: #4374a6;
|
|
187
|
+
--vx-accentFillHover: #3c6895;
|
|
188
|
+
--vx-onAccent: #ffffff;
|
|
189
|
+
--vx-divider: color-mix(in srgb, #ffffff 6%, transparent);
|
|
190
|
+
--vx-shadow-card: 0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px color-mix(in srgb, #ffffff 4%, transparent);
|
|
191
|
+
--vx-shadow-ctrl: 0 1px 2px rgba(0,0,0,0.35);
|
|
192
|
+
--vx-shadow-overlay: 0 8px 24px rgba(0,0,0,0.5);
|
|
193
|
+
--vx-surface-bg: #27272a;
|
|
194
|
+
--vx-surface-panel: #2b2b2e;
|
|
195
|
+
--vx-surface-panelHover: #38383b;
|
|
196
|
+
--vx-surface-elevated: #38383b;
|
|
197
|
+
--vx-surface-subtle: #323235;
|
|
198
|
+
--vx-surface-overlay: color-mix(in srgb, #3f3f46 50%, #27272a);
|
|
199
|
+
--vx-surface-field: #27272a;
|
|
200
|
+
--vx-surface-border: #444447;
|
|
201
|
+
--vx-surface-hairline: #4e4e51;
|
|
202
|
+
}
|
|
203
|
+
html[data-mantine-color-scheme='light'] {
|
|
204
|
+
--vx-status-excellent: #29a634;
|
|
205
|
+
--vx-status-good: #327a4d;
|
|
206
|
+
--vx-status-warn: #b07808;
|
|
207
|
+
--vx-status-bad: #b5403d;
|
|
208
|
+
--vx-status-neutral: #71717a;
|
|
209
|
+
--vx-goodSolid: #327a4d;
|
|
210
|
+
--vx-badSolid: #b5403d;
|
|
211
|
+
--vx-warnSolid: #b07808;
|
|
212
|
+
--vx-neutral: #525255;
|
|
213
|
+
--vx-line: #52525c;
|
|
214
|
+
--vx-line2: #71717a;
|
|
215
|
+
--vx-axis: rgba(38, 38, 41, 0.6);
|
|
216
|
+
--vx-axisStroke: rgba(38, 38, 41, 0.12);
|
|
217
|
+
--vx-grid: rgba(38, 38, 41, 0.07);
|
|
218
|
+
--vx-crosshair: rgba(38, 38, 41, 0.32);
|
|
219
|
+
--vx-dotStroke: #ffffff;
|
|
220
|
+
--vx-tooltipBg: #ffffff;
|
|
221
|
+
--vx-tooltipText: rgba(38, 38, 41, 0.88);
|
|
222
|
+
--vx-tooltipMuted: rgba(38, 38, 41, 0.5);
|
|
223
|
+
--vx-tooltipBorder: 1px solid #e4e4e7;
|
|
224
|
+
--vx-tooltipShadow: 0 2px 8px rgba(38, 38, 41, 0.1);
|
|
225
|
+
--vx-legendText: rgba(38, 38, 41, 0.82);
|
|
226
|
+
--vx-ink: #262629;
|
|
227
|
+
--vx-ink2: #404043;
|
|
228
|
+
--vx-muted: #525255;
|
|
229
|
+
--vx-faint: #737376;
|
|
230
|
+
--vx-accent: #4374a6;
|
|
231
|
+
--vx-accentHover: #3c6895;
|
|
232
|
+
--vx-accentFill: #4374a6;
|
|
233
|
+
--vx-accentFillHover: #3c6895;
|
|
234
|
+
--vx-onAccent: #ffffff;
|
|
235
|
+
--vx-divider: color-mix(in srgb, #e5e5e5 65%, transparent);
|
|
236
|
+
--vx-shadow-card: 0 1px 2px rgba(28,25,23,0.05), 0 0 0 1px var(--vx-surface-hairline);
|
|
237
|
+
--vx-shadow-ctrl: 0 1px 2px rgba(28,25,23,0.12);
|
|
238
|
+
--vx-shadow-overlay: 0 8px 24px rgba(28,25,23,0.10);
|
|
239
|
+
--vx-surface-bg: #f2f2f5;
|
|
240
|
+
--vx-surface-panel: #fafafd;
|
|
241
|
+
--vx-surface-panelHover: #ffffff;
|
|
242
|
+
--vx-surface-elevated: #ffffff;
|
|
243
|
+
--vx-surface-subtle: #f4f4f8;
|
|
244
|
+
--vx-surface-overlay: #ffffff;
|
|
245
|
+
--vx-surface-field: #ffffff;
|
|
246
|
+
--vx-surface-border: #e2e2e5;
|
|
247
|
+
--vx-surface-hairline: #eaeaee;
|
|
248
|
+
}
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# basalt-ui v1.
|
|
1
|
+
# basalt-ui v1.4.0
|
|
2
2
|
# Opinionated framework for Mantine-based React apps — theme, app shell, visx charts, toolchain presets
|
|
3
3
|
#
|
|
4
4
|
# basalt-ui is an opinionated framework for Mantine-based React apps.
|
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
# Subpaths: use the exact import specifier below — do not guess.
|
|
14
14
|
# Charts and tokens are Mantine-free; the root (.) is Mantine-coupled.
|
|
15
15
|
# Optional peers are listed per subpath; install only what you use.
|
|
16
|
+
# Every peer is optional: ./tokens, ./charts, ./state and ./guard resolve with
|
|
17
|
+
# no React and no Mantine installed. A consumer with no React at all can take the
|
|
18
|
+
# token system alone — `bunx basalt-ui tokens:css --out tokens.css`, or the prebuilt
|
|
19
|
+
# ./tokens.css subpath. Guide: docs/FRAMEWORK-FREE.md in the repo.
|
|
16
20
|
|
|
17
21
|
Package: basalt-ui
|
|
18
|
-
Version: 1.
|
|
22
|
+
Version: 1.4.0
|
|
19
23
|
|
|
20
24
|
## basalt-ui
|
|
21
25
|
Import: import { ... } from 'basalt-ui'
|
|
@@ -139,6 +143,11 @@ Asset: basalt-ui/styles.css
|
|
|
139
143
|
Description: Mandatory CSS import (after the Mantine styles.layer.css bundles) — @layer basalt base styles, iOS input safety net, font stack
|
|
140
144
|
Layer: non-js-asset
|
|
141
145
|
|
|
146
|
+
## basalt-ui/tokens.css
|
|
147
|
+
Asset: basalt-ui/tokens.css
|
|
148
|
+
Description: Prebuilt --vx-* token stylesheet — the default buildPaletteCss() output as a plain file, for a consumer with no bundler, no React and no Mantine; retune the selector or trim the spacing set with `basalt-ui tokens:css`
|
|
149
|
+
Layer: non-js-asset
|
|
150
|
+
|
|
142
151
|
## basalt-ui/configs/*
|
|
143
152
|
Asset: basalt-ui/configs/*
|
|
144
153
|
Description: Raw toolchain presets for consumer extends: oxlint.json, oxfmt.json, tsconfig.*.json, lefthook.yml, check.yml
|