basalt-ui 1.19.1 → 1.20.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 +15 -1
- package/CHANGELOG.md +20 -0
- package/MIGRATING.md +228 -0
- package/README.md +53 -9
- package/agent/rules/basalt-app.md +43 -0
- package/agent/rules/basalt-charts.md +26 -14
- package/agent/rules/basalt-mantine.md +25 -10
- package/agent/rules/basalt-router.md +22 -10
- package/agent/rules/basalt-tokens.md +75 -6
- package/agent/skills/basalt-app/SKILL.md +42 -6
- package/configs/check.yml +11 -4
- package/configs/lefthook.yml +21 -2
- package/configs/oxlint-plugin.js +515 -25
- package/configs/oxlint-plugin.test.ts +383 -10
- package/configs/oxlint.json +10 -1
- package/dist/agent/stick-to-bottom.js +1 -1
- package/dist/agent-chat/thread-detail-panel.js +1 -1
- package/dist/agent-chat/thread-message.js +2 -2
- package/dist/agent-chat/tool-chip.js +1 -1
- package/dist/charts/kinds/Donut.d.ts.map +1 -1
- package/dist/charts/kinds/Donut.js +1 -1
- package/dist/charts/primitives/ChartLegend.js +2 -2
- package/dist/charts/primitives/ChartTooltip.js +1 -1
- package/dist/cli/index.d.ts +107 -15
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +610 -72
- package/dist/cli/toolchain-wiring.test.d.ts +2 -0
- package/dist/cli/toolchain-wiring.test.d.ts.map +1 -0
- package/dist/dashboard/delta-badge.js +2 -2
- package/dist/dashboard/stat-card.js +1 -1
- package/dist/data/virtual-list.js +5 -5
- package/dist/guard/index.d.ts +56 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +326 -59
- package/dist/guard/types.d.ts +25 -5
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/register.d.ts +25 -0
- package/dist/register.d.ts.map +1 -1
- package/dist/shell/app-mobile-nav.module.css +11 -3
- package/dist/surfaces.d.ts +1 -1
- package/dist/surfaces.js +1 -1
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +2 -0
- package/dist/tokens/palette.d.ts +35 -27
- package/dist/tokens/palette.d.ts.map +1 -1
- package/dist/tokens/palette.js +24 -18
- package/dist/tokens.css +19 -17
- package/dist/vite-color-mix.js +2 -2
- package/llms.txt +3 -3
- package/package.json +4 -3
- package/src/agent/stick-to-bottom.tsx +1 -1
- package/src/agent-chat/thread-detail-panel.tsx +1 -1
- package/src/agent-chat/thread-message.tsx +3 -3
- package/src/agent-chat/tool-chip.tsx +1 -1
- package/src/charts/kinds/Donut.tsx +2 -1
- package/src/charts/primitives/ChartLegend.tsx +2 -2
- package/src/charts/primitives/ChartTooltip.tsx +1 -1
- package/src/cli/index.ts +1070 -99
- package/src/cli/init-sync.test.ts +19 -3
- package/src/cli/tokens-css.test.ts +27 -14
- package/src/cli/toolchain-wiring.test.ts +694 -0
- package/src/dashboard/delta-badge.tsx +3 -3
- package/src/dashboard/stat-card.tsx +1 -1
- package/src/data/virtual-list.tsx +8 -8
- package/src/guard/check-source.test.ts +663 -11
- package/src/guard/index.ts +727 -94
- package/src/guard/types.ts +29 -4
- package/src/register.ts +32 -0
- package/src/shell/app-mobile-nav.module.css +11 -3
- package/src/shell/app-mobile-nav.tsx +1 -1
- package/src/surfaces.ts +1 -1
- package/src/theme/density-relations.test.ts +8 -5
- package/src/theme/spacing.test.ts +2 -0
- package/src/theme-toggle/index.tsx +2 -2
- package/src/tokens/index.ts +5 -3
- package/src/tokens/palette.ts +24 -18
- package/src/vite-color-mix.ts +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolchain-wiring.test.d.ts","sourceRoot":"","sources":["../../src/cli/toolchain-wiring.test.ts"],"names":[],"mappings":""}
|
|
@@ -22,10 +22,10 @@ function DeltaBadge({
|
|
|
22
22
|
},
|
|
23
23
|
label: {
|
|
24
24
|
display: "inline-flex",
|
|
25
|
-
// theme-allow
|
|
25
|
+
// theme-allow inline-display — a Badge `styles.label` part, not a layout node Flex could replace
|
|
26
26
|
alignItems: "center",
|
|
27
27
|
gap: 3,
|
|
28
|
-
// theme-allow
|
|
28
|
+
// theme-allow inline-spacing — sub-scale glyph-to-label gap, below the smallest scale stop
|
|
29
29
|
fontFamily: "var(--basalt-font-mono)",
|
|
30
30
|
fontSize: VX.text.xs,
|
|
31
31
|
fontWeight: 600,
|
|
@@ -30,7 +30,7 @@ function StatCard({
|
|
|
30
30
|
padding: "var(--mantine-spacing-xs) var(--mantine-spacing-sm)",
|
|
31
31
|
minHeight: 118,
|
|
32
32
|
display: "flex",
|
|
33
|
-
// theme-allow
|
|
33
|
+
// theme-allow inline-display — Card root as a flex column; Mantine Card takes no layout props
|
|
34
34
|
flexDirection: "column",
|
|
35
35
|
gap: "var(--vx-space-stat-card-gap)",
|
|
36
36
|
overflow: "hidden",
|
|
@@ -30,9 +30,9 @@ function BasaltVirtualList({
|
|
|
30
30
|
});
|
|
31
31
|
if (isLoading) {
|
|
32
32
|
return (
|
|
33
|
-
// theme-allow — matches the virtualizer's own scroll box below, so the skeleton doesn't reflow.
|
|
33
|
+
// theme-allow raw-scroll-container — matches the virtualizer's own scroll box below, so the skeleton doesn't reflow.
|
|
34
34
|
/* @__PURE__ */ jsx(Box, { style: { height, overflow: "auto" }, children: Array.from({ length: skeletonRows }, (_, i) => /* @__PURE__ */ jsx(
|
|
35
|
-
|
|
35
|
+
Box,
|
|
36
36
|
{
|
|
37
37
|
style: {
|
|
38
38
|
height: estimateSize,
|
|
@@ -57,11 +57,11 @@ function BasaltVirtualList({
|
|
|
57
57
|
ref: parentRef,
|
|
58
58
|
style: {
|
|
59
59
|
height,
|
|
60
|
-
// theme-allow — TanStack Virtual measures this element as the scroll container.
|
|
60
|
+
// theme-allow raw-scroll-container — TanStack Virtual measures this element as the scroll container.
|
|
61
61
|
overflow: "auto"
|
|
62
62
|
},
|
|
63
63
|
children: /* @__PURE__ */ jsx(
|
|
64
|
-
|
|
64
|
+
Box,
|
|
65
65
|
{
|
|
66
66
|
style: {
|
|
67
67
|
height: rowVirtualizer.getTotalSize(),
|
|
@@ -71,7 +71,7 @@ function BasaltVirtualList({
|
|
|
71
71
|
const item = items[virtualItem.index];
|
|
72
72
|
if (item === void 0) return null;
|
|
73
73
|
return /* @__PURE__ */ jsx(
|
|
74
|
-
|
|
74
|
+
Box,
|
|
75
75
|
{
|
|
76
76
|
style: {
|
|
77
77
|
position: "absolute",
|
package/dist/guard/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ./guard — headless policy core. Mantine-free, dependency-free.
|
|
3
3
|
*
|
|
4
|
-
* GUARD_RULES: the closed registry of all
|
|
4
|
+
* GUARD_RULES: the closed registry of all 25 violation kinds.
|
|
5
5
|
* checkSource: pure (text, relPath, cfg) → Finding[]. No FS, no walk, no console.
|
|
6
6
|
*/
|
|
7
7
|
import type { Finding, GuardConfig, GuardKind, GuardSeverity } from './types.js';
|
|
@@ -9,7 +9,31 @@ export type { Finding, GuardConfig, GuardKind, GuardSeverity };
|
|
|
9
9
|
/** Shared default config — CLI and tests import this to avoid duplication. */
|
|
10
10
|
export declare const DEFAULT_GUARD_CONFIG: GuardConfig;
|
|
11
11
|
/**
|
|
12
|
-
* The
|
|
12
|
+
* The exact first line of every stylesheet the CLI emits — the contract between `basalt-ui
|
|
13
|
+
* tokens:css` / `fonts:css` and this scanner, and the single source of truth for it (`src/cli`
|
|
14
|
+
* imports this rather than keeping its own copy, which is how the two used to drift apart).
|
|
15
|
+
*
|
|
16
|
+
* The marker exists because `check-theme` reported the file a sibling command had just written:
|
|
17
|
+
* 116 of rollhook's 117 violations were inside the emitted token stylesheet, which is nothing but
|
|
18
|
+
* hex and `rgba()` by construction.
|
|
19
|
+
*
|
|
20
|
+
* **Command-NEUTRAL by necessity.** Line 1 is compared verbatim, so it cannot name the command
|
|
21
|
+
* that produced the file without needing one accepted marker per command — and a second accepted
|
|
22
|
+
* marker is a second forgery surface. It points at the provenance line instead, which does name
|
|
23
|
+
* the command. It used to say `regenerate with \`bunx basalt-ui tokens:css\`` on a `fonts:css`
|
|
24
|
+
* file too: following that instruction overwrote a font sheet with the palette sheet.
|
|
25
|
+
*/
|
|
26
|
+
export declare const GENERATED_HEADER_LINE = "/* @generated basalt-ui \u2014 do not edit; regenerate with the command on the next line */";
|
|
27
|
+
/**
|
|
28
|
+
* Kinds disabled under `profile: 'tokens-only'` — every kind whose remedy is a Mantine component,
|
|
29
|
+
* a Mantine prop, or the React theme factory. See {@link GuardConfig.profile}.
|
|
30
|
+
*
|
|
31
|
+
* Exported so the CLI can name the profile in `--help`/`doctor` output without re-deriving the
|
|
32
|
+
* list, and so a test can assert the two halves (disabled vs. surviving) partition the registry.
|
|
33
|
+
*/
|
|
34
|
+
export declare const TOKENS_ONLY_DISABLED_KINDS: ReadonlySet<GuardKind>;
|
|
35
|
+
/**
|
|
36
|
+
* The closed registry of all 25 guard kinds. The triad test asserts
|
|
13
37
|
* `surface.guardKinds ⊆ keyof GUARD_RULES` at runtime.
|
|
14
38
|
*
|
|
15
39
|
* raw-surface, raw-html-layout, and sub-16-input-font are handled inline in checkSource
|
|
@@ -151,6 +175,36 @@ export declare const GUARD_RULES: {
|
|
|
151
175
|
readonly appliesTo: (relPath: string) => boolean;
|
|
152
176
|
readonly message: "fontSize below 16 on a form control is dead code — the styles.css iOS floor is `!important` and always wins. Either drop the override, or be honest about 16px in the design.";
|
|
153
177
|
};
|
|
178
|
+
readonly 'theme-allow-unscoped': {
|
|
179
|
+
readonly kind: "theme-allow-unscoped";
|
|
180
|
+
readonly pattern: RegExp;
|
|
181
|
+
readonly message: "theme-allow without a usable rule id and a reason. Write `theme-allow <rule-id> — <why>`: the id scopes the exception to that one kind (a bare comment waives EVERY kind on the line, including ones added later), and the reason is what makes it reviewable in a diff. An id that names no rule is a typo, not a blanket waiver — it suppresses nothing.";
|
|
182
|
+
};
|
|
183
|
+
readonly 'surface-shadow-override': {
|
|
184
|
+
readonly kind: "surface-shadow-override";
|
|
185
|
+
readonly pattern: RegExp;
|
|
186
|
+
readonly enabled: (cfg: GuardConfig) => boolean;
|
|
187
|
+
readonly message: "Token-composed boxShadow that REPLACES card depth — a card whose shadow drops --vx-shadow-card is the one card in the app with no depth. Compose with it (`${VX.shadowCard}, <your ring>`) rather than instead of it.";
|
|
188
|
+
};
|
|
189
|
+
readonly 'css-raw-surface': {
|
|
190
|
+
readonly kind: "css-raw-surface";
|
|
191
|
+
readonly pattern: RegExp;
|
|
192
|
+
readonly enabled: (cfg: GuardConfig) => boolean;
|
|
193
|
+
readonly appliesTo: (relPath: string) => boolean;
|
|
194
|
+
readonly message: "Surface literal in CSS — use var(--vx-radius-card|--vx-radius-md) for a corner and var(--vx-shadow-card) for depth, the same tokens the TSX side is held to.";
|
|
195
|
+
};
|
|
196
|
+
readonly 'hidden-inline-style': {
|
|
197
|
+
readonly kind: "hidden-inline-style";
|
|
198
|
+
readonly pattern: RegExp;
|
|
199
|
+
readonly enabled: (cfg: GuardConfig) => boolean;
|
|
200
|
+
readonly appliesTo: (relPath: string) => boolean;
|
|
201
|
+
readonly message: "Raw HTML element with inline layout/surface styling that the line scan cannot see — the tag is formatted across lines, or the style object is hoisted to a const. Same violation as raw-html-layout: use a Mantine layout primitive (Box/Flex/Grid/Stack/Group). Its own kind for one minor so the widening lands as a warning; it merges into raw-html-layout at the promotion.";
|
|
202
|
+
};
|
|
203
|
+
readonly 'inline-font-size': {
|
|
204
|
+
readonly kind: "inline-font-size";
|
|
205
|
+
readonly pattern: RegExp;
|
|
206
|
+
readonly message: "Raw font-size literal — route through VX.text.* (numbers) / --vx-text-* (CSS), or the Mantine fz token. Same rule the oxlint plugin enforces as basalt/no-raw-font-size; this is the half a check-theme-only CI can see.";
|
|
207
|
+
};
|
|
154
208
|
};
|
|
155
209
|
/**
|
|
156
210
|
* Scan ONE file's text for theme-guard violations. Pure: same (text, relPath, cfg) → same Finding[].
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;AAuW9D,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,WAoBlC,CAAA;AAuVD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,gGACwD,CAAA;AA8F1F;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,SAAS,CAqB5D,CAAA;AA2NF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;gCA0BL,WAAW;;;;;;;gCAcX,WAAW;;;;;gCAMX,WAAW;;;;;;;gCAaX,WAAW;;;;;;;gCAQX,WAAW;;;;;;gCAOX,WAAW;;;;;;;gCASX,WAAW;;;;;;gCAOX,WAAW;;;;;;;gCAaX,WAAW;;;;;;gCAMX,WAAW;;;;;;;gCAaX,WAAW;;;;;;;gCAUX,WAAW;;;;;;;gCAUX,WAAW;;;;;;;gCASX,WAAW;;;;;;;gCASX,WAAW;;;;;;;gCAUX,WAAW;;;;;;;;;;;;gCAgBX,WAAW;;;;;;gCAOX,WAAW;;;;;;;gCASX,WAAW;;;;;;;;;CAWmB,CAAA;AAUjD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,EAAE,CAyVtF"}
|