basalt-ui 1.32.1 → 1.34.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 +1 -1
- package/CHANGELOG.md +65 -0
- package/MIGRATING.md +218 -25
- package/README.md +3 -0
- package/agent/rules/basalt-state.md +2 -2
- package/agent/rules/basalt-tokens.md +1 -1
- package/agent/skills/basalt-app/SKILL.md +5 -3
- package/configs/oxlint-basalt.json +33 -0
- package/configs/oxlint-plugin.js +89 -67
- package/configs/oxlint-plugin.test.ts +224 -19
- package/configs/oxlint.json +2 -30
- package/dist/agent/coalesce.d.ts.map +1 -1
- package/dist/agent/coalesce.js +1 -2
- package/dist/agent/merge.d.ts.map +1 -1
- package/dist/agent/merge.js +1 -2
- package/dist/agent-chat/relative-time.d.ts +9 -0
- package/dist/agent-chat/relative-time.d.ts.map +1 -1
- package/dist/agent-chat/relative-time.js +1 -2
- package/dist/agent-chat/thread-message.d.ts.map +1 -1
- package/dist/agent-chat/thread-message.js +1 -2
- package/dist/charts/kinds/BandStrip.d.ts.map +1 -1
- package/dist/charts/kinds/BandStrip.js +3 -3
- package/dist/charts/kinds/Bars.d.ts.map +1 -1
- package/dist/charts/kinds/Bars.js +1 -2
- package/dist/charts/kinds/StackedArea.d.ts.map +1 -1
- package/dist/charts/kinds/StackedArea.js +1 -2
- package/dist/charts/primitives/legend-disclosure.d.ts.map +1 -1
- package/dist/cli/audit-allows.d.ts +1 -1
- package/dist/cli/audit-allows.d.ts.map +1 -1
- package/dist/cli/audit-allows.js +4 -4
- package/dist/cli/check-theme.d.ts.map +1 -1
- package/dist/cli/check-theme.js +38 -38
- package/dist/cli/config.d.ts +197 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +20 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +4 -6
- package/dist/cli/guard-hook.d.ts.map +1 -1
- package/dist/cli/guard-hook.js +7 -41
- package/dist/cli/index.d.ts +31 -257
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +64 -37
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +7 -16
- package/dist/commands/define-commands.d.ts.map +1 -1
- package/dist/commands/define-commands.js +2 -2
- package/dist/commands/define-overlays.d.ts.map +1 -1
- package/dist/commands/define-overlays.js +1 -2
- package/dist/common/index.d.ts +0 -1
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +0 -2
- package/dist/common/validate.d.ts +2 -2
- package/dist/common/validate.d.ts.map +1 -1
- package/dist/common/validate.js +2 -3
- package/dist/common/vx-families.d.ts +7 -0
- package/dist/common/vx-families.d.ts.map +1 -0
- package/dist/common/vx-families.js +32 -0
- package/dist/common/vx-family.d.ts +11 -0
- package/dist/common/vx-family.d.ts.map +1 -0
- package/dist/common/vx-family.js +12 -0
- package/dist/content/article-card.d.ts.map +1 -1
- package/dist/content/article-card.js +4 -1
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +3 -13
- package/dist/controls/filter-pill.d.ts +8 -0
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +15 -0
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/multi-select-filter.js +3 -13
- package/dist/controls/number-filter.d.ts +3 -0
- package/dist/controls/number-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.js +12 -4
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/range-filter.js +1 -2
- package/dist/data/data-table.d.ts.map +1 -1
- package/dist/data/data-table.js +2 -3
- package/dist/guard/index.d.ts +17 -3
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +62 -23
- package/dist/guard/types.d.ts +3 -3
- package/dist/guard/types.d.ts.map +1 -1
- package/dist/guard/vx-names.d.ts +3 -0
- package/dist/guard/vx-names.d.ts.map +1 -0
- package/dist/guard/vx-names.js +257 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/notifications/mount-guard.d.ts.map +1 -1
- package/dist/notifications/mount-guard.js +1 -2
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +2 -3
- package/dist/provider/lab-theme.d.ts +5 -4
- package/dist/provider/lab-theme.d.ts.map +1 -1
- package/dist/provider/lab-theme.js +1 -3
- package/dist/router-tanstack/search-store.d.ts +18 -0
- package/dist/router-tanstack/search-store.d.ts.map +1 -1
- package/dist/router-tanstack/search-store.js +33 -1
- package/dist/shell/app-mobile-nav.d.ts.map +1 -1
- package/dist/shell/app-mobile-nav.js +2 -1
- package/dist/shell/app-mobile-nav.module.css +12 -0
- package/dist/shell/app-sidebar.d.ts.map +1 -1
- package/dist/shell/app-sidebar.js +32 -36
- package/dist/shell/app-sidebar.module.css +6 -0
- package/dist/shell/index.d.ts +0 -1
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +0 -2
- package/dist/shell/mobile-nav-model.d.ts.map +1 -1
- package/dist/shell/mobile-nav-model.js +3 -4
- package/dist/shell/nav-glyph.d.ts +14 -0
- package/dist/shell/nav-glyph.d.ts.map +1 -0
- package/dist/shell/nav-glyph.js +21 -0
- package/dist/shell/nav-types.d.ts +1 -0
- package/dist/shell/nav-types.d.ts.map +1 -1
- package/dist/shell/page-bar.d.ts.map +1 -1
- package/dist/shell/page-bar.js +1 -2
- package/dist/shell/sidebar-search.d.ts.map +1 -1
- package/dist/shell/sidebar-search.js +1 -3
- package/dist/surfaces.d.ts +3 -3
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +4 -2
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +24 -2
- package/dist/tokens/size-classes.d.ts +25 -0
- package/dist/tokens/size-classes.d.ts.map +1 -1
- package/dist/tokens/size-classes.js +14 -0
- package/llms.txt +4 -4
- package/package.json +1 -1
- package/src/agent/coalesce.ts +1 -2
- package/src/agent/merge.ts +1 -2
- package/src/agent-chat/relative-time.ts +1 -2
- package/src/agent-chat/thread-message.tsx +2 -3
- package/src/charts/kinds/BandStrip.tsx +7 -3
- package/src/charts/kinds/Bars.tsx +1 -2
- package/src/charts/kinds/StackedArea.tsx +4 -2
- package/src/charts/primitives/legend-disclosure.tsx +1 -0
- package/src/cli/audit-allows.ts +10 -9
- package/src/cli/check-theme.ts +61 -39
- package/src/cli/config.ts +209 -0
- package/src/cli/doctor.ts +5 -7
- package/src/cli/guard-hook.ts +9 -42
- package/src/cli/index.ts +101 -294
- package/src/cli/sync.ts +7 -16
- package/src/commands/define-commands.ts +2 -2
- package/src/commands/define-overlays.ts +1 -2
- package/src/common/index.ts +0 -1
- package/src/common/validate.ts +4 -5
- package/src/common/vx-families.ts +36 -0
- package/src/common/vx-family.ts +22 -0
- package/src/content/article-card.tsx +1 -0
- package/src/controls/enum-filter.tsx +3 -13
- package/src/controls/filter-pill.tsx +20 -0
- package/src/controls/multi-select-filter.tsx +3 -13
- package/src/controls/number-filter.tsx +24 -3
- package/src/controls/range-filter.tsx +1 -2
- package/src/data/data-table.tsx +2 -3
- package/src/guard/index.ts +134 -47
- package/src/guard/types.ts +3 -2
- package/src/guard/vx-names.ts +257 -0
- package/src/index.ts +0 -2
- package/src/notifications/mount-guard.ts +1 -2
- package/src/provider/index.tsx +2 -3
- package/src/provider/lab-theme.ts +28 -21
- package/src/router-tanstack/search-store.ts +73 -1
- package/src/shell/app-mobile-nav.module.css +12 -0
- package/src/shell/app-mobile-nav.tsx +8 -1
- package/src/shell/app-sidebar.module.css +6 -0
- package/src/shell/app-sidebar.tsx +52 -50
- package/src/shell/index.tsx +0 -1
- package/src/shell/mobile-nav-model.ts +3 -5
- package/src/shell/nav-glyph.tsx +38 -0
- package/src/shell/nav-types.ts +1 -0
- package/src/shell/page-bar.tsx +1 -4
- package/src/shell/sidebar-search.tsx +1 -5
- package/src/surfaces.ts +4 -2
- package/src/tokens/index.ts +34 -2
- package/src/tokens/size-classes.ts +27 -0
- package/dist/common/is-dev.d.ts +0 -3
- package/dist/common/is-dev.d.ts.map +0 -1
- package/dist/common/is-dev.js +0 -6
- package/dist/shell/use-breakpoint.d.ts +0 -10
- package/dist/shell/use-breakpoint.d.ts.map +0 -1
- package/dist/shell/use-breakpoint.js +0 -11
- package/src/common/is-dev.ts +0 -4
- package/src/shell/use-breakpoint.ts +0 -37
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NumberInput } from "@mantine/core";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { assertRequiredProps } from "../common/validate.js";
|
|
5
5
|
import classes from "./controls.module.css";
|
|
6
6
|
import { EnumFilter } from "./enum-filter.js";
|
|
7
7
|
import { useFilterRegistration, useFilterSurface } from "./filter-context.js";
|
|
8
|
-
import { FilterPill } from "./filter-pill.js";
|
|
8
|
+
import { FilterClearButton, FilterPill } from "./filter-pill.js";
|
|
9
9
|
import { useControlName } from "./filter-sheet.js";
|
|
10
10
|
import { PanelRow } from "./panel-row.js";
|
|
11
11
|
function NumberFilter(props) {
|
|
12
12
|
assertRequiredProps("NumberFilter", props, ["field"], {
|
|
13
13
|
field: "bind it to a store field (`store.field.<name>`), never a value/onChange pair."
|
|
14
14
|
});
|
|
15
|
-
const { field, label, icon, options, step, className, style } = props;
|
|
15
|
+
const { field, label, icon, options, step, clearable, className, style } = props;
|
|
16
16
|
if (options !== void 0) {
|
|
17
17
|
return /* @__PURE__ */ jsx(
|
|
18
18
|
NumberChoice,
|
|
@@ -20,6 +20,7 @@ function NumberFilter(props) {
|
|
|
20
20
|
field,
|
|
21
21
|
label,
|
|
22
22
|
options,
|
|
23
|
+
...clearable === true && { clearable: true },
|
|
23
24
|
...icon !== void 0 && { icon },
|
|
24
25
|
...className !== void 0 && { className },
|
|
25
26
|
...style !== void 0 && { style }
|
|
@@ -32,6 +33,7 @@ function NumberFilter(props) {
|
|
|
32
33
|
{
|
|
33
34
|
field,
|
|
34
35
|
label,
|
|
36
|
+
...clearable === true && { clearable: true },
|
|
35
37
|
...icon !== void 0 && { icon },
|
|
36
38
|
...grain !== void 0 && { step: grain },
|
|
37
39
|
...className !== void 0 && { className },
|
|
@@ -44,6 +46,7 @@ function NumberChoice({
|
|
|
44
46
|
label,
|
|
45
47
|
icon,
|
|
46
48
|
options,
|
|
49
|
+
clearable,
|
|
47
50
|
className,
|
|
48
51
|
style
|
|
49
52
|
}) {
|
|
@@ -70,6 +73,7 @@ function NumberChoice({
|
|
|
70
73
|
label,
|
|
71
74
|
numeric: true,
|
|
72
75
|
options: rows,
|
|
76
|
+
...clearable === true && { clearable: true },
|
|
73
77
|
...icon !== void 0 && { icon },
|
|
74
78
|
...className !== void 0 && { className },
|
|
75
79
|
...style !== void 0 && { style }
|
|
@@ -81,6 +85,7 @@ function NumberStepper({
|
|
|
81
85
|
label,
|
|
82
86
|
icon,
|
|
83
87
|
step,
|
|
88
|
+
clearable,
|
|
84
89
|
className,
|
|
85
90
|
style
|
|
86
91
|
}) {
|
|
@@ -134,7 +139,10 @@ function NumberStepper({
|
|
|
134
139
|
...icon !== void 0 && { icon },
|
|
135
140
|
...className !== void 0 && { className },
|
|
136
141
|
...style !== void 0 && { style },
|
|
137
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ jsxs("div", { className: classes.optionList, children: [
|
|
143
|
+
input,
|
|
144
|
+
clearable === true && !isDefault && /* @__PURE__ */ jsx(FilterClearButton, { onClear: () => field.clear() })
|
|
145
|
+
] })
|
|
138
146
|
}
|
|
139
147
|
);
|
|
140
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-filter.d.ts","sourceRoot":"","sources":["../../src/controls/range-filter.tsx"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAA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AAC,sBAAsB,CAAC,CAAA;CAC9D,CAAA;AAED,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,GAAG,OAAO,EACvE,KAAK,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC5B,SAAS,CA4IX"}
|
|
@@ -2,7 +2,6 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { SegmentedControl, Select, Stack } from "@mantine/core";
|
|
3
3
|
import { useEffect, useRef, useState } from "react";
|
|
4
4
|
import { assertRequiredProps } from "../common/validate.js";
|
|
5
|
-
import { isDev } from "../common/is-dev.js";
|
|
6
5
|
import classes from "./controls.module.css";
|
|
7
6
|
import { useFilterRegistration, useFilterSurface } from "./filter-context.js";
|
|
8
7
|
import { FilterPill } from "./filter-pill.js";
|
|
@@ -14,7 +13,7 @@ const CUSTOM_ROW_LABEL = "Custom range\u2026";
|
|
|
14
13
|
const NUMERIC_LABEL = /^\d/;
|
|
15
14
|
const noPickerWarned = /* @__PURE__ */ new Set();
|
|
16
15
|
function warnCustomWithoutPicker(label, unreachable) {
|
|
17
|
-
if (!unreachable ||
|
|
16
|
+
if (!unreachable || process.env.NODE_ENV === "production" || noPickerWarned.has(label)) return;
|
|
18
17
|
noPickerWarned.add(label);
|
|
19
18
|
console.warn(
|
|
20
19
|
`[basalt-ui] RangeFilter('${label}'): the field declares \`custom: true\` but no \`customPicker\` was injected, so the custom window cannot be reached. Pass \`customPicker={DateRangePicker}\` (\`basalt-ui/controls-dates\`), or drop \`custom: true\` from the field. (dev only)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/data/data-table.tsx"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAEV,SAAS,EACT,kBAAkB,EAElB,eAAe,EAEf,OAAO,EACP,iBAAiB,EACjB,YAA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;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpC,2DAA2D;IAC3D,eAAe,CAAC,EAAE,cAAc,CAAA;IAChC,6DAA6D;IAC7D,iBAAiB,CAAC,EAAE,cAAc,CAAA;IAClC,0FAA0F;IAC1F,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;;;;;;;;;;;OAeG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAgKH;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACpC,GAAG,WAAW,CAAC,MAAM,CAAC,CAiBtB;AAqRD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,+BA0pBhE"}
|
package/dist/data/data-table.js
CHANGED
|
@@ -42,7 +42,6 @@ import {
|
|
|
42
42
|
useRowDisclosure
|
|
43
43
|
} from "./data-table-state.js";
|
|
44
44
|
import { dataQueryBranch } from "./query-branch.js";
|
|
45
|
-
import { isDev } from "../common/is-dev.js";
|
|
46
45
|
import classes from "./data-table.module.css";
|
|
47
46
|
const ALIGNMENTS = /* @__PURE__ */ new Set(["left", "center", "right"]);
|
|
48
47
|
function resolveAlign(column) {
|
|
@@ -104,7 +103,7 @@ function facetMultiHandle(column, facet) {
|
|
|
104
103
|
function resolveFacetColumn(table, facet) {
|
|
105
104
|
const column = table.getColumn(facet.columnId);
|
|
106
105
|
if (column) return column;
|
|
107
|
-
if (
|
|
106
|
+
if (process.env.NODE_ENV !== "production") {
|
|
108
107
|
const knownIds = table.getAllColumns().map((known) => known.id).join(", ");
|
|
109
108
|
throw new Error(
|
|
110
109
|
`BasaltDataTable: facet columnId "${facet.columnId}" matches no column \u2014 known column ids: ${knownIds}.`
|
|
@@ -353,7 +352,7 @@ const reportedBreaches = /* @__PURE__ */ new Set();
|
|
|
353
352
|
function enforceManualPaginationContract(breaches) {
|
|
354
353
|
if (breaches.length === 0) return;
|
|
355
354
|
const message = manualPaginationMessage(breaches);
|
|
356
|
-
if (
|
|
355
|
+
if (process.env.NODE_ENV !== "production") throw new Error(message);
|
|
357
356
|
if (reportedBreaches.has(message)) return;
|
|
358
357
|
reportedBreaches.add(message);
|
|
359
358
|
console.error(message);
|
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 28 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';
|
|
@@ -132,7 +132,7 @@ export declare const GENERATED_HEADER_LINE = "/* @generated basalt-ui \u2014 do
|
|
|
132
132
|
*/
|
|
133
133
|
export declare const TOKENS_ONLY_DISABLED_KINDS: ReadonlySet<GuardKind>;
|
|
134
134
|
/**
|
|
135
|
-
* The closed registry of all
|
|
135
|
+
* The closed registry of all 28 guard kinds. The triad test asserts
|
|
136
136
|
* `surface.guardKinds ⊆ keyof GUARD_RULES` at runtime.
|
|
137
137
|
*
|
|
138
138
|
* raw-surface, raw-html-layout, and sub-16-input-font are handled inline in checkSource
|
|
@@ -204,7 +204,7 @@ export declare const GUARD_RULES: {
|
|
|
204
204
|
readonly pattern: RegExp;
|
|
205
205
|
readonly enabled: (cfg: GuardConfig) => boolean;
|
|
206
206
|
readonly appliesTo: (relPath: string) => boolean;
|
|
207
|
-
readonly message: "withBorder on a Card/Paper double-draws the edge — card depth is --vx-shadow-card, which already bakes a 1px ring into the shadow. Drop the prop (docs/DESIGN-SPEC.md doctrine inversion #1).";
|
|
207
|
+
readonly message: "withBorder on a Card/Paper double-draws the edge — card depth is --vx-shadow-card, which already bakes a 1px ring into the shadow. Drop the prop (docs/DESIGN-SPEC.md doctrine inversion #1) — and fix the inset in the same edit: an explicit p/padding or radius on that Card/Paper is the other half of the idiom, which only the oxlint lane sees (basalt/card-inset); leave both to the theme or use py=\"xs\" px=\"sm\".";
|
|
208
208
|
};
|
|
209
209
|
readonly 'off-system-surface-var': {
|
|
210
210
|
readonly kind: "off-system-surface-var";
|
|
@@ -315,6 +315,11 @@ export declare const GUARD_RULES: {
|
|
|
315
315
|
readonly appliesTo: (relPath: string) => boolean;
|
|
316
316
|
readonly message: `Raw viewport/container breakpoint in CSS \u2014 a width @media belongs to shell/** against SIZE_CLASSES (useSizeClass() is the JS seam); an @container name must be one of ${string}, and a basalt-card or unnamed @container query must sit at a boundary in ${string} (the other declared names have no numeric table yet, so their literals are not judged); and a pointer query other than (pointer: coarse) or (pointer: fine) has no framework meaning. Same law the oxlint plugin enforces as basalt/raw-breakpoint over JSX; this is the CSS half.`;
|
|
317
317
|
};
|
|
318
|
+
readonly 'unknown-vx-token': {
|
|
319
|
+
readonly kind: "unknown-vx-token";
|
|
320
|
+
readonly pattern: RegExp;
|
|
321
|
+
readonly message: `var() names a --vx-* token basalt does not emit, so it resolves to its fallback (or to nothing) with no error anywhere. Judged: every name inside a basalt-owned family (${string}) \u2014 pick the token from basalt-ui/tokens.css; your own series belong in a family of their own (groupTokens warns on one inside basalt's). Removed names and their replacements: ${string}. A name in any other family is never judged, because groupTokens may declare it in a file this scan cannot see.`;
|
|
322
|
+
};
|
|
318
323
|
};
|
|
319
324
|
/**
|
|
320
325
|
* The one-line remedy for `kind`, as a report reads it: `raw-hex: Route color through VX.* / …`.
|
|
@@ -370,6 +375,15 @@ export type AllowAnnotationSite = {
|
|
|
370
375
|
readonly guardKinds: readonly GuardKind[];
|
|
371
376
|
/** The subset of `rules` the oxlint plugin owns — outside `checkSource`'s reach. */
|
|
372
377
|
readonly pluginRules: readonly string[];
|
|
378
|
+
/**
|
|
379
|
+
* Every id an `oxlint` run can prove live: `pluginRules`, plus a guard kind that is ALSO a plugin
|
|
380
|
+
* rule (`in-body-page-title`) or aliases one ({@link WAIVER_ID_ALIASES}). A waiver is live if
|
|
381
|
+
* EITHER lane still needs it — judging only `pluginRules` called rb's live `in-body-page-title`
|
|
382
|
+
* waivers dead, and deleting them made oxlint exit 1. A bare LINE-scope annotation covers every
|
|
383
|
+
* plugin rule (the plugin's `allowCovers`), so it lists all of them; a bare file-scope one waives
|
|
384
|
+
* nothing in either lane and lists none.
|
|
385
|
+
*/
|
|
386
|
+
readonly oxlintRules: readonly string[];
|
|
373
387
|
/** Words that occupied the id slot but name no rule. Their presence makes the parse fail closed. */
|
|
374
388
|
readonly unknownRules: readonly string[];
|
|
375
389
|
/** A written reason follows the ids. */
|
|
@@ -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;
|
|
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;AAK7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAA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SAAS,EAAE,OAAO,CAAA;IAC3B,qGAAqG;IACrG,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,WAAW,GACf,mBAAmB,EAAE,CAqCvB;AAED,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,6BAA6B,CAAA;AAEjE;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAM9F"}
|
package/dist/guard/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { vxFamilyOf } from "../common/vx-family.js";
|
|
2
|
+
import { BASALT_VX_FAMILIES } from "../common/vx-families.js";
|
|
3
|
+
import { BASALT_VX_NAMES } from "./vx-names.js";
|
|
1
4
|
const HEX = /#(?!(?<=&#)\d+;)[0-9a-fA-F]{3,8}\b/g;
|
|
2
5
|
const FUNC = /\b(?:rgba?|hsla?)\((?!\s*\$\{)/g;
|
|
3
6
|
const LOCALSTORAGE_THEME = /localStorage\s*\.\s*getItem\s*\(\s*['"]theme['"]\s*\)/g;
|
|
@@ -48,6 +51,17 @@ function isAllowedCssRadius(value) {
|
|
|
48
51
|
const INLINE_FONT_SIZE = /(?<![\w-;])font-?[Ss]ize\s*:\s*['"]?(\d+(?:\.\d+)?)(?:px)?['"]?(?=[,;\s}]|$)/g;
|
|
49
52
|
const CARD_SURFACE_TAG = /<(?:Card|Paper)(?![\w.])(?:=>|[^>])*?>/g;
|
|
50
53
|
const WITH_BORDER_PROP = /\bwithBorder\b(?!\s*=\s*\{\s*false\s*\})/;
|
|
54
|
+
const VX_VAR_REF = /var\(\s*(--vx-[A-Za-z0-9-]*[A-Za-z0-9])(?![A-Za-z0-9-]|\$\{)/g;
|
|
55
|
+
const VX_LOCAL_DECLARATION = /(?:^|[{;])\s*(--vx-[A-Za-z0-9-]*[A-Za-z0-9])\s*:|[{,]\s*(['"])(--vx-[A-Za-z0-9-]*[A-Za-z0-9])\2\s*:(?!\s*(?:string|number)\b)|\bsetProperty\(\s*['"](--vx-[A-Za-z0-9-]*[A-Za-z0-9])['"]/gm;
|
|
56
|
+
const REMOVED_VX_NAMES = {
|
|
57
|
+
"--vx-space-touch-target": "--vx-hit",
|
|
58
|
+
"--vx-space-touch-control-height": "--vx-hit",
|
|
59
|
+
"--vx-space-app-header-mobile-actions-height": "--vx-space-sticky-header-clearance",
|
|
60
|
+
"--vx-space-sticky-header-clearance-mobile": "--vx-space-sticky-header-clearance",
|
|
61
|
+
"--vx-space-sidebar-brand-inset-top": null
|
|
62
|
+
};
|
|
63
|
+
const KNOWN_VX_NAMES = new Set(BASALT_VX_NAMES);
|
|
64
|
+
const BASALT_VX_FAMILY_SET = new Set(BASALT_VX_FAMILIES);
|
|
51
65
|
const OFF_SYSTEM_SURFACE_VAR = /var\(--mantine-color-(gray|dark)-\d/g;
|
|
52
66
|
const MANTINE_SHADE_INDEX = /\b(?:color|c|bg|backgroundColor|borderColor)\s*=\s*\{?\s*['"][a-z]+\.\d\b|var\(--mantine-color-(?!gray-|dark-)[a-z]+-\d/g;
|
|
53
67
|
const RAW_HTML_TAG_NAME = "<(?:div|span|section|header|nav|footer|aside|main|article|ul|ol)\\b";
|
|
@@ -224,15 +238,10 @@ const DEFAULT_GUARD_CONFIG = {
|
|
|
224
238
|
severity: {}
|
|
225
239
|
};
|
|
226
240
|
const GRACE_PERIOD_KINDS = {
|
|
227
|
-
"
|
|
228
|
-
since: "1.
|
|
229
|
-
promote: "1.
|
|
230
|
-
why: "
|
|
231
|
-
},
|
|
232
|
-
"raw-media-query": {
|
|
233
|
-
since: "1.31.0",
|
|
234
|
-
promote: "1.33.0",
|
|
235
|
-
why: "The CSS-text twin of the oxlint plugin's `basalt/raw-breakpoint` \u2014 ONE LAW, TWO LANES, ONE PROMOTION, so it moves with that rule and never alone (`configs/oxlint-plugin.test.ts` \u203A twin lanes share one promotion pins the pair). New in the wave-11 responsive/touch guards; reaching CSS is a NEW file type for this check, same reasoning as `css-raw-surface`, with incumbents in basalt's own tree at ship time, so it shipped warn. Extended 1.32.0 -> 1.33.0 with its twin: 1.31.0 named no reachable container primitive, and 1.32.0 is the first minor that documents one (`CONTAINER_CLASSES` + the declared `@container` names, MIGRATING \xA7 `basalt/raw-breakpoint`)."
|
|
241
|
+
"unknown-vx-token": {
|
|
242
|
+
since: "1.34.0",
|
|
243
|
+
promote: "1.35.0",
|
|
244
|
+
why: "New kind at 1.33.0 (consumer-loop r2 B3): obsidian lost its 44px touch floor to a removed `var(--vx-space-touch-target)` that nothing reported. WIDENED at 1.34.0 (image-gen r4: `var(--vx-surface-2)` rendered transparent, unreported) to every unemitted name inside a basalt-owned family, so the grace restarts: warn through 1.34.x, error at 1.35.0."
|
|
236
245
|
}
|
|
237
246
|
};
|
|
238
247
|
function severityOf(kind, cfg) {
|
|
@@ -362,6 +371,7 @@ const WAIVER_ID_ALIASES = {
|
|
|
362
371
|
"control-outside-home": ["raw-selection-control"],
|
|
363
372
|
"raw-selection-control": ["control-outside-home"]
|
|
364
373
|
};
|
|
374
|
+
const DUAL_LANE_IDS = /* @__PURE__ */ new Set(["in-body-page-title"]);
|
|
365
375
|
const MIN_ALLOW_REASON_LENGTH = 4;
|
|
366
376
|
function parseAllowAnnotation(rest, scope) {
|
|
367
377
|
const rules = [];
|
|
@@ -787,7 +797,7 @@ const GUARD_RULES = {
|
|
|
787
797
|
enabled: (cfg) => cfg.cardWithBorder,
|
|
788
798
|
// JSX-tag-shaped (`<Card withBorder>`) — never appears in CSS text.
|
|
789
799
|
appliesTo: (relPath) => !relPath.endsWith(".css"),
|
|
790
|
-
message:
|
|
800
|
+
message: 'withBorder on a Card/Paper double-draws the edge \u2014 card depth is --vx-shadow-card, which already bakes a 1px ring into the shadow. Drop the prop (docs/DESIGN-SPEC.md doctrine inversion #1) \u2014 and fix the inset in the same edit: an explicit p/padding or radius on that Card/Paper is the other half of the idiom, which only the oxlint lane sees (basalt/card-inset); leave both to the theme or use py="xs" px="sm".'
|
|
791
801
|
},
|
|
792
802
|
"off-system-surface-var": {
|
|
793
803
|
kind: "off-system-surface-var",
|
|
@@ -933,6 +943,16 @@ const GUARD_RULES = {
|
|
|
933
943
|
// spelling — the AST-side twin of this law is the oxlint plugin's basalt/raw-breakpoint.
|
|
934
944
|
appliesTo: (relPath) => relPath.endsWith(".css"),
|
|
935
945
|
message: `Raw viewport/container breakpoint in CSS \u2014 a width @media belongs to shell/** against SIZE_CLASSES (useSizeClass() is the JS seam); an @container name must be one of ${[...DECLARED_CONTAINER_NAMES].join(" / ")}, and a basalt-card or unnamed @container query must sit at a boundary in ${[...CONTAINER_CLASS_LITERALS_PX].map((px) => `${px}px`).join(" / ")} (the other declared names have no numeric table yet, so their literals are not judged); and a pointer query other than (pointer: coarse) or (pointer: fine) has no framework meaning. Same law the oxlint plugin enforces as basalt/raw-breakpoint over JSX; this is the CSS half.`
|
|
946
|
+
},
|
|
947
|
+
"unknown-vx-token": {
|
|
948
|
+
kind: "unknown-vx-token",
|
|
949
|
+
pattern: VX_VAR_REF,
|
|
950
|
+
// handled inline (basalt-owned families); entry keeps the registry complete
|
|
951
|
+
message: `var() names a --vx-* token basalt does not emit, so it resolves to its fallback (or to nothing) with no error anywhere. Judged: every name inside a basalt-owned family (${[...BASALT_VX_FAMILY_SET].join(", ")}) \u2014 pick the token from basalt-ui/tokens.css; your own series belong in a family of their own (groupTokens warns on one inside basalt's). Removed names and their replacements: ${Object.entries(
|
|
952
|
+
REMOVED_VX_NAMES
|
|
953
|
+
).map(([from, to]) => `${from} \u2192 ${to ?? "(deleted, no replacement)"}`).join(
|
|
954
|
+
"; "
|
|
955
|
+
)}. A name in any other family is never judged, because groupTokens may declare it in a file this scan cannot see.`
|
|
936
956
|
}
|
|
937
957
|
};
|
|
938
958
|
function guardKindRemedy(kind) {
|
|
@@ -1010,6 +1030,16 @@ function checkSource(text, relPath, cfg) {
|
|
|
1010
1030
|
const styleIdentifiers = new Set(
|
|
1011
1031
|
[...codeText.matchAll(STYLE_BOUND_IDENTIFIER)].map((m) => m[1] ?? "")
|
|
1012
1032
|
);
|
|
1033
|
+
const locallyDeclaredVx = new Set(
|
|
1034
|
+
[...codeText.matchAll(VX_LOCAL_DECLARATION)].map((m) => m[1] ?? m[3] ?? m[4] ?? "")
|
|
1035
|
+
);
|
|
1036
|
+
for (const m of codeText.matchAll(VX_VAR_REF)) {
|
|
1037
|
+
const name = m[1] ?? "";
|
|
1038
|
+
if (locallyDeclaredVx.has(name)) continue;
|
|
1039
|
+
if (KNOWN_VX_NAMES.has(name) || !BASALT_VX_FAMILY_SET.has(vxFamilyOf(name))) continue;
|
|
1040
|
+
const at = (m.index ?? 0) + m[0].length - name.length;
|
|
1041
|
+
push("unknown-vx-token", lineStarts.findLastIndex((start) => start <= at) + 1, name);
|
|
1042
|
+
}
|
|
1013
1043
|
for (let i = 0; i < lines.length; i++) {
|
|
1014
1044
|
const line = codeLines[i] ?? "";
|
|
1015
1045
|
for (const m of line.matchAll(GUARD_RULES["raw-hex"].pattern)) {
|
|
@@ -1265,19 +1295,28 @@ function findAllowAnnotations(text, relPath, cfg) {
|
|
|
1265
1295
|
cfg.allowComment,
|
|
1266
1296
|
syntax
|
|
1267
1297
|
);
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1298
|
+
const everyOxlintRule = [...PLUGIN_RULE_IDS, ...DUAL_LANE_IDS];
|
|
1299
|
+
return declared.map(({ line, annotation }) => {
|
|
1300
|
+
const bare = annotation.rules.length === 0 && annotation.unknownRules.length === 0;
|
|
1301
|
+
return {
|
|
1302
|
+
line,
|
|
1303
|
+
scope: annotation.scope,
|
|
1304
|
+
rules: [...annotation.rules],
|
|
1305
|
+
guardKinds: annotation.rules.filter((id) => Object.hasOwn(GUARD_RULES, id)),
|
|
1306
|
+
pluginRules: annotation.rules.filter(
|
|
1307
|
+
(id) => !Object.hasOwn(GUARD_RULES, id) && PLUGIN_RULE_IDS.has(id)
|
|
1308
|
+
),
|
|
1309
|
+
oxlintRules: bare && annotation.scope === "line" ? everyOxlintRule : [
|
|
1310
|
+
...new Set(
|
|
1311
|
+
annotation.rules.flatMap((id) => [id, ...WAIVER_ID_ALIASES[id] ?? []]).filter((id) => PLUGIN_RULE_IDS.has(id) || DUAL_LANE_IDS.has(id))
|
|
1312
|
+
)
|
|
1313
|
+
],
|
|
1314
|
+
unknownRules: [...annotation.unknownRules],
|
|
1315
|
+
hasReason: annotation.hasReason,
|
|
1316
|
+
bare,
|
|
1317
|
+
text: lines[line - 1] ?? ""
|
|
1318
|
+
};
|
|
1319
|
+
});
|
|
1281
1320
|
}
|
|
1282
1321
|
const NEUTRALIZED_ALLOW_TOKEN = "basalt-audit-neutralized";
|
|
1283
1322
|
function neutralizeAllowAnnotation(text, line, cfg) {
|
package/dist/guard/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Guard types — Mantine-free, dependency-free (zero imports beyond TS types).
|
|
3
3
|
*
|
|
4
|
-
* GuardKind is the closed set of
|
|
4
|
+
* GuardKind is the closed set of 28 violation kinds the theme guard can emit — `unframed-chart`
|
|
5
5
|
* retired at the C2 consolidation wave: its only case (a hand-authored `<ChartLegend items={[...]}>`
|
|
6
6
|
* array literal) is fully subsumed by the oxlint plugin's `basalt/chart-legend-literal`, which also
|
|
7
7
|
* catches the `.map()`-over-a-non-series form the regex never could. `'unframed-chart'` stays a
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* Finding is the structured result per violation, replacing the old `Violation` shape.
|
|
11
11
|
* GuardConfig is the per-run configuration that drives checkSource.
|
|
12
12
|
*/
|
|
13
|
-
/** The
|
|
14
|
-
export type GuardKind = 'raw-hex' | 'raw-color-fn' | 'localstorage-theme' | 'off-identity-accent' | 'mantine-shade-index' | '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' | 'chart-missing-aria-label' | 'raw-form-control' | 'sub-16-input-font' | 'raw-font-family' | 'theme-allow-unscoped' | 'surface-shadow-override' | 'css-raw-surface' | 'inline-font-size' | 'hidden-inline-style' | 'in-body-page-title' | 'raw-selection-control' | 'raw-media-query';
|
|
13
|
+
/** The 28 theme-guard violation kinds. */
|
|
14
|
+
export type GuardKind = 'raw-hex' | 'raw-color-fn' | 'localstorage-theme' | 'off-identity-accent' | 'mantine-shade-index' | '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' | 'chart-missing-aria-label' | 'raw-form-control' | 'sub-16-input-font' | 'raw-font-family' | 'theme-allow-unscoped' | 'surface-shadow-override' | 'css-raw-surface' | 'inline-font-size' | 'hidden-inline-style' | 'in-body-page-title' | 'raw-selection-control' | 'raw-media-query' | 'unknown-vx-token';
|
|
15
15
|
/**
|
|
16
16
|
* How hard a finding lands. `error` fails the build; `warn` reports and passes.
|
|
17
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/guard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,cAAc,GACd,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,aAAa,GACb,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,wBAAwB,GACxB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,0BAA0B,GAC1B,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,yBAAyB,GACzB,iBAAiB,GACjB,kBAAkB,GAClB,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GACvB,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/guard/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,cAAc,GACd,oBAAoB,GACpB,qBAAqB,GACrB,qBAAqB,GACrB,aAAa,GACb,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,wBAAwB,GACxB,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,0BAA0B,GAC1B,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,sBAAsB,GACtB,yBAAyB,GACzB,iBAAiB,GACjB,kBAAkB,GAClB,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GACvB,iBAAiB,GACjB,kBAAkB,CAAA;AAEtB;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,CAAA;AAE5C;;;;;;;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,MAAM,CAAA;IACtB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,aAAa,C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