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
package/dist/agent/coalesce.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isDev } from "../common/is-dev.js";
|
|
2
1
|
function isTextLikeType(type) {
|
|
3
2
|
return type === "text" || type === "reasoning";
|
|
4
3
|
}
|
|
@@ -84,7 +83,7 @@ function mergeToolPart(existing, next) {
|
|
|
84
83
|
default: {
|
|
85
84
|
const unhandled = next;
|
|
86
85
|
const fallback = unhandled;
|
|
87
|
-
if (
|
|
86
|
+
if (process.env.NODE_ENV !== "production") {
|
|
88
87
|
console.warn(
|
|
89
88
|
`[basalt] coalesceParts: unrecognized tool state ${JSON.stringify(fallback.state)} \u2014 kept, merged best-effort`
|
|
90
89
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/agent/merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/agent/merge.ts"],"names":[],"mappings":"AAkCA;iGACiG;AACjG,MAAM,MAAM,QAAQ,GAAG;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAoDrE,wBAAgB,SAAS,CAAC,KAAK,SAAS,QAAQ,EAAE,KAAK,EAAE,SAAS,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,EAAE,CAyB/F"}
|
package/dist/agent/merge.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isDev } from "../common/is-dev.js";
|
|
2
1
|
function isTextLikeType(type) {
|
|
3
2
|
return type === "text" || type === "reasoning";
|
|
4
3
|
}
|
|
@@ -8,7 +7,7 @@ function spliceText(existingText, next) {
|
|
|
8
7
|
}
|
|
9
8
|
function clampOffset(offset, length) {
|
|
10
9
|
const clamped = Number.isFinite(offset) ? Math.min(Math.max(offset, 0), length) : length;
|
|
11
|
-
if (clamped !== offset &&
|
|
10
|
+
if (clamped !== offset && process.env.NODE_ENV !== "production") {
|
|
12
11
|
console.warn(
|
|
13
12
|
`[basalt] mergePart: text offset ${offset} out of range [0, ${length}] \u2014 clamped to ${clamped}`
|
|
14
13
|
);
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* formatRelativeTime — dependency-free relative-time formatting (no date-fns).
|
|
3
|
+
*
|
|
4
|
+
* Shared between `ThreadOutcomeCard` (inbox row timestamps) and `ThreadTranscript` (per-message
|
|
5
|
+
* timestamps). 'en'-hardcoded for now — see the module-level note below for the deferred locale
|
|
6
|
+
* seam.
|
|
7
|
+
*
|
|
8
|
+
* Internal to `agent-chat/` — not part of the public barrel.
|
|
9
|
+
*/
|
|
1
10
|
/**
|
|
2
11
|
* Formats an epoch-ms timestamp as a short relative string ("3 hours ago", "just now").
|
|
3
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative-time.d.ts","sourceRoot":"","sources":["../../src/agent-chat/relative-time.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"relative-time.d.ts","sourceRoot":"","sources":["../../src/agent-chat/relative-time.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAc5D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isDev } from "../common/is-dev.js";
|
|
2
1
|
const RELATIVE_TIME_FORMAT = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
3
2
|
const RELATIVE_TIME_UNITS = [
|
|
4
3
|
{ unit: "year", ms: 31536e6 },
|
|
@@ -10,7 +9,7 @@ const RELATIVE_TIME_UNITS = [
|
|
|
10
9
|
];
|
|
11
10
|
function formatRelativeTime(timestamp) {
|
|
12
11
|
if (!Number.isFinite(timestamp)) {
|
|
13
|
-
if (
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
14
13
|
console.warn(
|
|
15
14
|
`[basalt] formatRelativeTime: non-finite timestamp ${String(timestamp)} \u2014 rendering empty string`
|
|
16
15
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-message.d.ts","sourceRoot":"","sources":["../../src/agent-chat/thread-message.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,EAEV,kBAAkB,EAClB,WAAW,EAEX,WAAW,EACX,YAAY,EACZ,aAAa,EAGb,YAAY,EAGZ,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAMlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAI/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"thread-message.d.ts","sourceRoot":"","sources":["../../src/agent-chat/thread-message.tsx"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,EAEV,kBAAkB,EAClB,WAAW,EAEX,WAAW,EACX,YAAY,EACZ,aAAa,EAGb,YAAY,EAGZ,cAAc,EACf,MAAM,UAAU,CAAA;AAGjB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAMlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAA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AAU,CAAC,EAAE,YAAY,CAAA;IAClC,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;IAClC;iGAC6F;IAC7F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;IACrD;;0CAEsC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IACzC;;uBAEmB;IACnB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,eAAe,CAAA;AA2C1E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CA6I1E"}
|
|
@@ -22,7 +22,6 @@ import { DEFAULT_AFFORDANCES } from "./message-affordances.js";
|
|
|
22
22
|
import { formatRelativeTime } from "./relative-time.js";
|
|
23
23
|
import { ToolChip } from "./tool-chip.js";
|
|
24
24
|
import { resolveVirtualize } from "./virtualize.js";
|
|
25
|
-
import { isDev } from "../common/is-dev.js";
|
|
26
25
|
const MICRO_LABEL_STYLE = {
|
|
27
26
|
fontFamily: "var(--basalt-font-mono)",
|
|
28
27
|
fontSize: VX.text.micro,
|
|
@@ -67,7 +66,7 @@ const threadPartRenderers = {
|
|
|
67
66
|
function UnknownPartChip({ part }) {
|
|
68
67
|
return /* @__PURE__ */ jsx(Box, { style: RAIL_STYLE, children: /* @__PURE__ */ jsx(Text, { style: MICRO_LABEL_STYLE, children: `Unknown part: ${part.type}` }) });
|
|
69
68
|
}
|
|
70
|
-
const DEFAULT_FALLBACK_RENDERER = ({ part }) =>
|
|
69
|
+
const DEFAULT_FALLBACK_RENDERER = ({ part }) => process.env.NODE_ENV !== "production" ? /* @__PURE__ */ jsx(UnknownPartChip, { part }) : null;
|
|
71
70
|
function resolveSegments(parts, renderers, fallbackRenderer) {
|
|
72
71
|
const segments = [];
|
|
73
72
|
let buffer = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BandStrip.d.ts","sourceRoot":"","sources":["../../../src/charts/kinds/BandStrip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAIrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"BandStrip.d.ts","sourceRoot":"","sources":["../../../src/charts/kinds/BandStrip.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAIrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAI/D;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,WAAW,GAAG;IAC7C;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EA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OAAO,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;IACtC,MAAM,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAAA;IAClC;;;;;wEAKoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAC7B;iDAC6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;4FACwF;IACxF,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAAA;AA2CD;;;;;;;;;;;;;GAaG;AACH,iBAAS,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,+BAwBlD;AA+OD,eAAO,MAAM,SAAS,EAAoB,OAAO,cAAc,CAAA"}
|
|
@@ -10,7 +10,6 @@ import { Crosshair } from "../primitives/Crosshair.js";
|
|
|
10
10
|
import { HatchPattern, hatchFill, hatchSizeFor } from "../primitives/HatchPattern.js";
|
|
11
11
|
import { fmtAxisDate } from "../utils/format.js";
|
|
12
12
|
import { BandAxisOverlay, BandTooltip, clampFraction } from "./band-chrome.js";
|
|
13
|
-
import { isDev } from "../../common/is-dev.js";
|
|
14
13
|
const DEFAULT_MARKER_INSET = 6;
|
|
15
14
|
const NO_READING = "\u2014";
|
|
16
15
|
const UNKNOWN_MARK = {
|
|
@@ -93,7 +92,8 @@ function BandStripPlot(props) {
|
|
|
93
92
|
const style = styleByKey.get(span.state);
|
|
94
93
|
const x = i * step;
|
|
95
94
|
if (style === void 0) {
|
|
96
|
-
if (
|
|
95
|
+
if (process.env.NODE_ENV !== "production")
|
|
96
|
+
throw unknownStateError("BandSpan.state", span.state, styleByKey.keys());
|
|
97
97
|
out.push(
|
|
98
98
|
/* @__PURE__ */ jsx(
|
|
99
99
|
"rect",
|
|
@@ -117,7 +117,7 @@ function BandStripPlot(props) {
|
|
|
117
117
|
const hatchWidth = bandWidth - measuredWidth;
|
|
118
118
|
const markerKey = span.marker?.state ?? span.state;
|
|
119
119
|
const markerColor = styleByKey.get(markerKey)?.color;
|
|
120
|
-
if (span.marker !== void 0 && markerColor === void 0 &&
|
|
120
|
+
if (span.marker !== void 0 && markerColor === void 0 && process.env.NODE_ENV !== "production") {
|
|
121
121
|
throw unknownStateError("BandSpan.marker.state", markerKey, styleByKey.keys());
|
|
122
122
|
}
|
|
123
123
|
const inset = span.marker?.inset ?? DEFAULT_MARKER_INSET;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bars.d.ts","sourceRoot":"","sources":["../../../src/charts/kinds/Bars.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAe,MAAM,8BAA8B,CAAA;AACnG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAe,WAAW,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"Bars.d.ts","sourceRoot":"","sources":["../../../src/charts/kinds/Bars.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,UAA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U,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IAE1C,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;wBAEoB;IACpB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,CAAA;IAC1E,6DAA6D;IAC7D,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACjC;iDAC6C;IAC7C,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,CAAA;IAC1B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;IAEnC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAA;IAC3C,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;IAC7B;4CACwC;IACxC,MAAM,CAAC,EAAE,iBAAiB,GAAG,KAAK,CAAA;IAClC,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gGAAgG;IAChG,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;4FACwF;IACxF,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,+BA2LxC;AAmPD,eAAO,MAAM,IAAI,EAAe,OAAO,SAAS,CAAA"}
|
|
@@ -6,7 +6,6 @@ import { VX } from "../../tokens/index.js";
|
|
|
6
6
|
import { CartesianChart } from "../primitives/CartesianChart.js";
|
|
7
7
|
import { curveFor, LINE_OVERLAY_STROKE_WIDTH } from "../series.js";
|
|
8
8
|
import { padAutoLower } from "../utils/domain.js";
|
|
9
|
-
import { isDev } from "../../common/is-dev.js";
|
|
10
9
|
function BarsInner(props) {
|
|
11
10
|
assertRequiredProps("Bars", props, ["data", "getX", "getValue", "positiveBars"]);
|
|
12
11
|
const {
|
|
@@ -39,7 +38,7 @@ function BarsInner(props) {
|
|
|
39
38
|
className,
|
|
40
39
|
style
|
|
41
40
|
} = props;
|
|
42
|
-
if (
|
|
41
|
+
if (process.env.NODE_ENV !== "production" && barLayout === "stacked" && y?.scale === "log") {
|
|
43
42
|
throw new Error(
|
|
44
43
|
`Bars: stacked bars cannot use a log axis (y.scale: "log") \u2014 the stack sums bar heights, and a log axis has no additive zero to sum from. Use barLayout: 'grouped' instead.`
|
|
45
44
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackedArea.d.ts","sourceRoot":"","sources":["../../../src/charts/kinds/StackedArea.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"StackedArea.d.ts","sourceRoot":"","sources":["../../../src/charts/kinds/StackedArea.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EA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BAAgB,CAAC,CAAC,CAAC,+BA+GtD;AAoED,eAAO,MAAM,WAAW,EAAsB,OAAO,gBAAgB,CAAA"}
|
|
@@ -4,7 +4,6 @@ import { memo, useCallback, useMemo } from "react";
|
|
|
4
4
|
import { assertRequiredProps } from "../../common/validate.js";
|
|
5
5
|
import { CartesianChart } from "../primitives/CartesianChart.js";
|
|
6
6
|
import { curveFor } from "../series.js";
|
|
7
|
-
import { isDev } from "../../common/is-dev.js";
|
|
8
7
|
function rowIsDense(d, bands) {
|
|
9
8
|
return bands.every((s) => s.getValue(d) !== null);
|
|
10
9
|
}
|
|
@@ -29,7 +28,7 @@ function StackedAreaInner(props) {
|
|
|
29
28
|
className,
|
|
30
29
|
style
|
|
31
30
|
} = props;
|
|
32
|
-
if (
|
|
31
|
+
if (process.env.NODE_ENV !== "production" && y?.scale === "log") {
|
|
33
32
|
throw new Error(
|
|
34
33
|
'StackedArea: cannot use a log axis (y.scale: "log") \u2014 the stack sums band heights, and a log axis has no additive zero to sum from.'
|
|
35
34
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legend-disclosure.d.ts","sourceRoot":"","sources":["../../../src/charts/primitives/legend-disclosure.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"legend-disclosure.d.ts","sourceRoot":"","sources":["../../../src/charts/primitives/legend-disclosure.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAyDrD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO;;;wBAQtB,iBAAiB;;;;;;;;;EAuD7C;AAED;wFACwF;AACxF,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,OAAO,CAAC,GAAG;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,SAAS,CAAA;CACpB,sCAoCA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GuardConfig } from '../guard/index.js';
|
|
2
|
-
import type { BasaltConfig } from './
|
|
2
|
+
import type { BasaltConfig } from './config.js';
|
|
3
3
|
/**
|
|
4
4
|
* `check-theme --audit-allows` — list every active waiver and prove, per waiver, whether it still
|
|
5
5
|
* suppresses anything.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-allows.d.ts","sourceRoot":"","sources":["../../src/cli/audit-allows.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAW,WAAW,EAAa,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"audit-allows.d.ts","sourceRoot":"","sources":["../../src/cli/audit-allows.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAW,WAAW,EAAa,MAAM,UAAU,CAAA;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAmB,MAAM,UAAU,CAAA;AAoJ7D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,MAAM,EAAE,GAChB,MAAM,CAsLR"}
|
package/dist/cli/audit-allows.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
neutralizeAllowAnnotation,
|
|
8
8
|
unmatchedExemptPatterns
|
|
9
9
|
} from "../guard/index.js";
|
|
10
|
-
import { exemptRulePaths, exemptRuleReason, resolveRoots } from "./
|
|
10
|
+
import { exemptRulePaths, exemptRuleReason, resolveRoots } from "./config.js";
|
|
11
11
|
function findingKey(f) {
|
|
12
12
|
return `${f.relPath}:${f.line}:${f.kind}`;
|
|
13
13
|
}
|
|
@@ -130,12 +130,12 @@ basalt-ui check-theme --audit-allows \u2014 ${cwd}
|
|
|
130
130
|
waiverLines.push(`${label} suppresses ${[...new Set(revealed)].join(", ")}${suffix}`);
|
|
131
131
|
continue;
|
|
132
132
|
}
|
|
133
|
-
if (site.
|
|
133
|
+
if (site.oxlintRules.length > 0) {
|
|
134
134
|
pluginProbes.push({
|
|
135
135
|
slot: waiverLines.length,
|
|
136
136
|
rel,
|
|
137
137
|
line: site.line,
|
|
138
|
-
|
|
138
|
+
reach: site.bare ? "a bare annotation, waiving every oxlint plugin rule on its line" : `scoped to ${site.oxlintRules.join(", ")}, which oxlint judges`,
|
|
139
139
|
site: label,
|
|
140
140
|
suffix
|
|
141
141
|
});
|
|
@@ -158,7 +158,7 @@ basalt-ui check-theme --audit-allows \u2014 ${cwd}
|
|
|
158
158
|
const revealed = pluginVerdicts?.get(probe.slot);
|
|
159
159
|
if (revealed === void 0) {
|
|
160
160
|
outOfReach++;
|
|
161
|
-
waiverLines[probe.slot] = `${probe.site}
|
|
161
|
+
waiverLines[probe.slot] = `${probe.site} ${probe.reach} \u2014 and oxlint could not be run here, so this audit cannot judge it${probe.suffix}`;
|
|
162
162
|
continue;
|
|
163
163
|
}
|
|
164
164
|
if (revealed.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-theme.d.ts","sourceRoot":"","sources":["../../src/cli/check-theme.ts"],"names":[],"mappings":"AA+
|
|
1
|
+
{"version":3,"file":"check-theme.d.ts","sourceRoot":"","sources":["../../src/cli/check-theme.ts"],"names":[],"mappings":"AA+EA;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,aAAa,GAAE,MAAsB,EACrC,KAAK,GAAE,SAAS,MAAM,EAAO,GAC5B,MAAM,CA6IR"}
|
package/dist/cli/check-theme.js
CHANGED
|
@@ -1,40 +1,58 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
3
|
import {
|
|
4
4
|
checkSource,
|
|
5
|
-
DEFAULT_GUARD_CONFIG,
|
|
6
5
|
guardKindRemedy,
|
|
7
6
|
TOKENS_ONLY_DISABLED_KINDS,
|
|
8
7
|
unmatchedExemptPatterns
|
|
9
8
|
} from "../guard/index.js";
|
|
10
9
|
import { auditAllows } from "./audit-allows.js";
|
|
10
|
+
import { DEFAULT_ROOTS, resolveRoots } from "./config.js";
|
|
11
11
|
import {
|
|
12
|
+
basaltPresetEntry,
|
|
12
13
|
conflictingProfileFlags,
|
|
14
|
+
findRepoRoot,
|
|
13
15
|
declaredProfile,
|
|
14
|
-
DEFAULT_ROOTS,
|
|
15
16
|
hasBasaltKey,
|
|
17
|
+
namesShipped,
|
|
18
|
+
noteRelocation,
|
|
19
|
+
OXLINT_FILES,
|
|
20
|
+
packageRoot,
|
|
21
|
+
parseJsonc,
|
|
16
22
|
readBasaltConfig,
|
|
17
|
-
|
|
23
|
+
readIfExists,
|
|
24
|
+
readSource,
|
|
25
|
+
resolveGuardConfig,
|
|
18
26
|
resolveProjectDir,
|
|
19
|
-
resolveRoots,
|
|
20
27
|
scannableFiles,
|
|
21
28
|
SERIES_MODULE_HINT_RE,
|
|
22
29
|
waiverHintFor
|
|
23
30
|
} from "./index.js";
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
function oxlintLaneAt(dir) {
|
|
32
|
+
const raw = readIfExists(resolve(dir, ".oxlintrc.json"));
|
|
33
|
+
if (raw === null) return "absent";
|
|
34
|
+
const rc = parseJsonc(raw);
|
|
35
|
+
const ownRules = Object.keys(Object(rc?.["rules"])).some((id) => id.startsWith("basalt/"));
|
|
36
|
+
const plugin = ownRules ? [rc?.["jsPlugins"]].flat().find((e) => namesShipped(e, OXLINT_FILES.plugin)) : void 0;
|
|
37
|
+
const entry = basaltPresetEntry(rc?.["extends"]) ?? plugin;
|
|
38
|
+
return entry !== void 0 && existsSync(resolve(dir, entry)) ? "wired" : "unwired";
|
|
39
|
+
}
|
|
40
|
+
function astLaneNotice(cwd) {
|
|
41
|
+
const root = findRepoRoot(cwd);
|
|
42
|
+
for (let dir = cwd; ; dir = dirname(dir)) {
|
|
43
|
+
const lane = oxlintLaneAt(dir);
|
|
44
|
+
if (lane === "wired") return null;
|
|
45
|
+
if (lane === "unwired" || dir === root || dirname(dir) === dir) break;
|
|
30
46
|
}
|
|
47
|
+
const preset = readSource(packageRoot(), OXLINT_FILES.guards);
|
|
48
|
+
const count = preset === null ? `every (${OXLINT_FILES.guards} unreadable, so uncounted)` : String(preset.match(/"basalt\/[\w-]+":/g)?.length ?? 0);
|
|
49
|
+
return `\u2139 basalt-ui check-theme: AST lane not enforced \u2014 ${count} basalt/* rule ids unguarded (incl. the promoted control-outside-home, raw-breakpoint): no .oxlintrc.json up to the repo root extends basalt-ui/configs/oxlint.json (or the guards-only oxlint-basalt.json). \`basalt-ui doctor\` names the fix.`;
|
|
50
|
+
}
|
|
51
|
+
function checkTheme(invocationCwd = process.cwd(), flags = []) {
|
|
52
|
+
if (conflictingProfileFlags("check-theme", flags)) return 1;
|
|
31
53
|
const project = resolveProjectDir(invocationCwd);
|
|
32
54
|
const cwd = project.dir;
|
|
33
|
-
|
|
34
|
-
console.log(
|
|
35
|
-
`basalt-ui check-theme: BASALT_CWD relocated from ${project.relocatedFrom} to ${cwd}.`
|
|
36
|
-
);
|
|
37
|
-
}
|
|
55
|
+
noteRelocation("check-theme", project);
|
|
38
56
|
const cfg = readBasaltConfig(cwd);
|
|
39
57
|
const roots = resolveRoots(cfg);
|
|
40
58
|
const profile = declaredProfile(cfg, flags);
|
|
@@ -43,27 +61,7 @@ function checkTheme(invocationCwd = process.cwd(), flags = []) {
|
|
|
43
61
|
`basalt-ui check-theme: tokens-only profile \u2014 ${TOKENS_ONLY_DISABLED_KINDS.size} Mantine-coupled kinds are off; the color and typography kinds still apply. Pass --framework to force the full set.`
|
|
44
62
|
);
|
|
45
63
|
}
|
|
46
|
-
const guardCfg =
|
|
47
|
-
spacingSteps: cfg.spacingSteps ?? DEFAULT_GUARD_CONFIG.spacingSteps,
|
|
48
|
-
rawRadius: cfg.rawRadius ?? DEFAULT_GUARD_CONFIG.rawRadius,
|
|
49
|
-
forbiddenAccents: cfg.forbiddenAccents ?? DEFAULT_GUARD_CONFIG.forbiddenAccents,
|
|
50
|
-
mantineShadeIndex: cfg.mantineShadeIndex ?? DEFAULT_GUARD_CONFIG.mantineShadeIndex,
|
|
51
|
-
rawSurface: cfg.rawSurface ?? DEFAULT_GUARD_CONFIG.rawSurface,
|
|
52
|
-
cardWithBorder: cfg.cardWithBorder ?? DEFAULT_GUARD_CONFIG.cardWithBorder,
|
|
53
|
-
offSystemSurfaceVar: cfg.offSystemSurfaceVar ?? DEFAULT_GUARD_CONFIG.offSystemSurfaceVar,
|
|
54
|
-
rawHtmlLayout: cfg.rawHtmlLayout ?? DEFAULT_GUARD_CONFIG.rawHtmlLayout,
|
|
55
|
-
inlineSpacing: cfg.inlineSpacing ?? DEFAULT_GUARD_CONFIG.inlineSpacing,
|
|
56
|
-
inlineDisplay: cfg.inlineDisplay ?? DEFAULT_GUARD_CONFIG.inlineDisplay,
|
|
57
|
-
rawVisxAxis: cfg.rawVisxAxis ?? DEFAULT_GUARD_CONFIG.rawVisxAxis,
|
|
58
|
-
rawMotionValue: cfg.rawMotionValue ?? DEFAULT_GUARD_CONFIG.rawMotionValue,
|
|
59
|
-
chartMissingAriaLabel: cfg.chartMissingAriaLabel ?? DEFAULT_GUARD_CONFIG.chartMissingAriaLabel,
|
|
60
|
-
rawFormControl: cfg.rawFormControl ?? DEFAULT_GUARD_CONFIG.rawFormControl,
|
|
61
|
-
sub16InputFont: cfg.sub16InputFont ?? DEFAULT_GUARD_CONFIG.sub16InputFont,
|
|
62
|
-
allowComment: "theme-allow",
|
|
63
|
-
exemptRules: resolveExemptRules(cfg),
|
|
64
|
-
severity: cfg.severity ?? DEFAULT_GUARD_CONFIG.severity,
|
|
65
|
-
...profile === "tokens-only" ? { profile: "tokens-only" } : {}
|
|
66
|
-
};
|
|
64
|
+
const guardCfg = resolveGuardConfig(cfg, profile);
|
|
67
65
|
const findings = [];
|
|
68
66
|
const scanned = scannableFiles(cwd, cfg);
|
|
69
67
|
for (const rel of scanned) {
|
|
@@ -92,6 +90,8 @@ function checkTheme(invocationCwd = process.cwd(), flags = []) {
|
|
|
92
90
|
`\u26A0 basalt-ui check-theme: "basalt.exemptRules" entry ${unmatched.kind}: "${unmatched.pattern}" ` + (unmatched.reason === "unknown-kind" ? "names no guard kind \u2014 it exempts nothing at all (a typo, or a kind that was renamed)." : "matched none of the scanned files \u2014 it suppresses nothing, and reads as coverage in a config review while enforcing as much as an empty object.")
|
|
93
91
|
);
|
|
94
92
|
}
|
|
93
|
+
const notice = profile === "tokens-only" ? null : astLaneNotice(cwd);
|
|
94
|
+
if (notice !== null) console.error(notice);
|
|
95
95
|
if (findings.length === 0) {
|
|
96
96
|
console.log("\u2713 Theme guard: no off-palette colors.");
|
|
97
97
|
return 0;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { GuardKind, GuardSeverity } from '../guard/index.js';
|
|
2
|
+
/** Shape of the optional `"basalt"` key in a consumer's package.json. */
|
|
3
|
+
export type BasaltConfig = {
|
|
4
|
+
/** Source roots to scan. Default: `['src']`. Set explicitly for a monorepo layout. */
|
|
5
|
+
roots?: string[];
|
|
6
|
+
/** Files exempt from the scan (they ARE the palette source). Default: argo's exempt set. */
|
|
7
|
+
exempt?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* Declares this package a tokens-only consumer: it uses the `--vx-*` layer and no Mantine. Turns
|
|
10
|
+
* off every guard kind whose remedy is a Mantine component, a Mantine prop or the React theme
|
|
11
|
+
* factory, leaving the color and typography kinds live. Default: `'mantine'`.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately not inferred from a missing `@mantine/core`: silencing 17 rules (the live count is
|
|
14
|
+
* `TOKENS_ONLY_DISABLED_KINDS.size`, which the check-theme banner prints) is a decision, and
|
|
15
|
+
* a repo that keeps Mantine in a workspace package would otherwise switch off half its own guard
|
|
16
|
+
* without saying so. `basalt-ui doctor` detects the shape and tells you to set this.
|
|
17
|
+
*/
|
|
18
|
+
profile?: 'mantine' | 'tokens-only';
|
|
19
|
+
/**
|
|
20
|
+
* Extra files to scan, named individually and relative to this package — for a design surface
|
|
21
|
+
* that lives outside every root and outside the `index.html` / `public/` conventions the walker
|
|
22
|
+
* already derives. Also the ONLY way a `.json` is ever scanned: the guard understands JSON as
|
|
23
|
+
* markup, but a consumer repo's JSON is overwhelmingly config, fixtures and lockfiles, so
|
|
24
|
+
* blanket-scanning it is a false-positive generator rather than a guard.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* { include: ['app/manifest.json', 'emails/template.html'] }
|
|
28
|
+
*/
|
|
29
|
+
include?: string[];
|
|
30
|
+
/** Named spacing-scale steps (px) flagged when used as a raw spacing prop. Default: 10/12/16/20/32. */
|
|
31
|
+
spacingSteps?: number[];
|
|
32
|
+
/** Per-kind severity override — `'warn'` reports without failing, `'error'` fails the build.
|
|
33
|
+
* See `GuardSeverity` in ../guard/types for the grace-minor doctrine behind it. */
|
|
34
|
+
severity?: Partial<Record<GuardKind, GuardSeverity>>;
|
|
35
|
+
/** Off-identity Mantine accent families forbidden as chrome accents. Default: argo's set. */
|
|
36
|
+
forbiddenAccents?: string[];
|
|
37
|
+
/** Earned accent hue recorded in DESIGN.md `{{ACCENT_HUE}}`. Default: `blue`. */
|
|
38
|
+
accentHue?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Flag any numeric radius prop literal (radius={6}) — use the radius token scale instead.
|
|
41
|
+
* Default: `true` (ON). Set `false` to disable the `raw-radius` check (e.g. a repo that DEFINES
|
|
42
|
+
* the radius primitives).
|
|
43
|
+
*/
|
|
44
|
+
rawRadius?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Flag ad-hoc inline surface styling (`border`/`borderRadius`/`boxShadow` literals in a `style={{}}`)
|
|
47
|
+
* that bypasses the radius-token + `VX.surface.*` + `VX.shadowCard` system. Default: `true` (ON).
|
|
48
|
+
* Set `false` to disable the `raw-surface` check.
|
|
49
|
+
*/
|
|
50
|
+
rawSurface?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Flag `withBorder` on a `Card` / `Paper`. Card depth is `--vx-shadow-card` — a whisper shadow
|
|
53
|
+
* with the 1px ring baked into the SAME value — so `withBorder` draws a SECOND, real border over
|
|
54
|
+
* that ring and the card reads heavy/boxed (docs/DESIGN-SPEC.md doctrine inversion #1).
|
|
55
|
+
* `withBorder={false}` and `<Card.Section withBorder>` (a section divider) both pass.
|
|
56
|
+
* Default: `true` (ON). Set `false` to disable the `card-with-border` check.
|
|
57
|
+
*/
|
|
58
|
+
cardWithBorder?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Flag references to a raw Mantine ramp step used for surface color
|
|
61
|
+
* (`var(--mantine-color-gray-N)` / `var(--mantine-color-dark-N)`) — these bypass the basalt
|
|
62
|
+
* surface tokens. Default: `true` (ON). Set `false` to disable the `off-system-surface-var` check.
|
|
63
|
+
*/
|
|
64
|
+
offSystemSurfaceVar?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Flag a SHADE-PINNED Mantine color — `c="yellow.7"`, `bg="blue.4"`,
|
|
67
|
+
* `var(--mantine-color-red-6)`. A pinned step is one fixed swatch in BOTH color schemes, so it
|
|
68
|
+
* cannot stay legible in either; route a verdict color through `VX.status.*` / `--vx-status-*`,
|
|
69
|
+
* or drop the index (`c="red"`) and let the theme resolve the shade per scheme. `gray-*`/`dark-*`
|
|
70
|
+
* in `var()` form belong to `off-system-surface-var` instead. Default: `true` (ON). Set `false`
|
|
71
|
+
* to disable the `mantine-shade-index` check.
|
|
72
|
+
*/
|
|
73
|
+
mantineShadeIndex?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Flag raw lowercase JSX layout/surface elements (`div`/`span`/`section`/…) carrying an inline
|
|
76
|
+
* `style={{}}` with a layout/surface property — steer to a Mantine layout primitive
|
|
77
|
+
* (`Box`/`Flex`/`Grid`/`Stack`/`Group`/`SimpleGrid`/`Paper`). Default: `true` (ON). Set `false`
|
|
78
|
+
* to disable the `raw-html-layout` check.
|
|
79
|
+
*/
|
|
80
|
+
rawHtmlLayout?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Flag spacing/sizing literals inside an inline `style={{}}` (`padding`/`margin`/`gap`/…) — the
|
|
83
|
+
* `raw-spacing` check only catches the Mantine prop syntax. Default: `true` (ON). Set `false` to
|
|
84
|
+
* disable the `inline-spacing` check.
|
|
85
|
+
*/
|
|
86
|
+
inlineSpacing?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Flag `display: 'flex' | 'grid' | 'inline-flex' | 'inline-grid'` in an inline `style={{}}` —
|
|
89
|
+
* steer to `<Flex>`/`<Grid>`/`<Group>`. Default: `true` (ON). Set `false` to disable the
|
|
90
|
+
* `inline-display` check.
|
|
91
|
+
*/
|
|
92
|
+
inlineDisplay?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Flag raw `<AxisLeft>` / `<AxisBottom>` / `<AxisRight>` visx JSX inside chart files (a path
|
|
95
|
+
* containing `/charts/`) — these bypass the `AxisLeftNumeric` / `AxisBottomDate` /
|
|
96
|
+
* `AxisRightNumeric` primitives that carry the theme tokens + smart ticks. The legitimate wrapper
|
|
97
|
+
* (`Axes.tsx`, which IS the primitive) is exempt. Default: `true` (ON). Set `false` to disable the
|
|
98
|
+
* `raw-visx-axis` check.
|
|
99
|
+
*/
|
|
100
|
+
rawVisxAxis?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Flag a hardcoded duration/spring/ease literal inline in a `transition={{...}}` prop — route it
|
|
103
|
+
* through `MOTION_DURATION` / `MOTION_SPRING` / `MOTION_EASE_STANDARD` instead. Default: `true`
|
|
104
|
+
* (ON). Set `false` to disable the `raw-motion-value` check.
|
|
105
|
+
*/
|
|
106
|
+
rawMotionValue?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Flag a chart entry-point JSX tag (`MultiLine`/`Bars`/`Donut`/`DualPanel`/`Heatmap`/`ZonedLine`/
|
|
109
|
+
* `StackedArea`/`LineSparkline`/`BarSparkline`) missing an `ariaLabel` prop. Default: `true`
|
|
110
|
+
* (ON). Set `false` to disable the `chart-missing-aria-label` check.
|
|
111
|
+
*/
|
|
112
|
+
chartMissingAriaLabel?: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Flag a raw lowercase `<input>`/`<select>`/`<textarea>` JSX element — it bypasses the entire
|
|
115
|
+
* theme, not just the iOS font-size floor. Use the Mantine equivalents (`TextInput`,
|
|
116
|
+
* `NumberInput`, `Select`, `Textarea`, …) instead. Default: `true` (ON). Set `false` to disable
|
|
117
|
+
* the `raw-form-control` check.
|
|
118
|
+
*/
|
|
119
|
+
rawFormControl?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Flag a `fontSize`/`font-size` literal below 16 inside a `style={{…}}` on a raw form control,
|
|
122
|
+
* or a Mantine `styles={{ input: {…} }}` per-part style — the `styles.css` iOS floor is
|
|
123
|
+
* `!important`, so the override is dead code. Default: `true` (ON). Set `false` to disable the
|
|
124
|
+
* `sub-16-input-font` check.
|
|
125
|
+
*/
|
|
126
|
+
sub16InputFont?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Path of the consumer's guard-exempt series file, for DESIGN.md `{{SERIES_MODULE_PATH}}`.
|
|
129
|
+
* Default: `<first basalt.root>/lib/series.ts` — see `resolveSeriesModulePath`.
|
|
130
|
+
*/
|
|
131
|
+
seriesModulePath?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Per-rule, per-path exemptions — complements whole-file `exempt` (which skips ALL rules for a
|
|
134
|
+
* file) and the hardcoded per-kind `appliesTo` scoping (e.g. `raw-visx-axis` → chart files
|
|
135
|
+
* only). Each value is a list of patterns matched against a finding's relative path. A pattern
|
|
136
|
+
* may be a whole path segment (`'agent'` matches `src/agent/x.tsx`, not `src/agenting.ts`), a
|
|
137
|
+
* relative path (`'public/site.webmanifest'`), a directory prefix, or a glob — `*` stops at `/`,
|
|
138
|
+
* `**` does not, and a slash-free glob also matches the basename, so `'*.module.css'` works.
|
|
139
|
+
* A trailing `/` is stripped. An entry that suppresses nothing is reported, and
|
|
140
|
+
* `check-theme --audit-allows` exits 1 on it. Default: `{}` (no exemptions).
|
|
141
|
+
*
|
|
142
|
+
* Two forms per kind. The bare array is paths only. The object form adds the REASON, which is
|
|
143
|
+
* the half a `theme-allow` carries and this key could not: JSON has no comments, so a
|
|
144
|
+
* `.webmanifest` / `.json` finding's only escape is this key, and it was un-reviewable by
|
|
145
|
+
* construction — the rationale ended up in a CLAUDE.md paragraph nobody reads next to the diff.
|
|
146
|
+
* `check-theme --audit-allows` prints the reason (or names its absence) beside what the entry
|
|
147
|
+
* still suppresses. The array form stays supported and unchanged; nothing here is required.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* { exemptRules: { 'inline-display': ['agent'] } } // inline-display never fires under src/agent/**
|
|
151
|
+
* @example
|
|
152
|
+
* { exemptRules: { 'raw-hex': { paths: ['site.webmanifest'],
|
|
153
|
+
* reason: 'a PWA manifest theme_color MUST be a literal hex — JSON cannot reference a CSS var' } } }
|
|
154
|
+
*/
|
|
155
|
+
exemptRules?: Partial<Record<GuardKind, ExemptRuleEntry>>;
|
|
156
|
+
/**
|
|
157
|
+
* Declares an intentional `ai` package major-version skew across workspace packages, exempting
|
|
158
|
+
* `doctor`'s `ai-major-parity` hard check. The value IS the reason — a bare `true` is rejected,
|
|
159
|
+
* because the whole point of this key is that the pairing is written down, not just switched off.
|
|
160
|
+
* A written declaration is the pin `basalt/ai-sdk-major`'s own comment notes is otherwise missing.
|
|
161
|
+
*
|
|
162
|
+
* Semantics: absent (or present but not a non-empty string) → the skew still hard-fails exactly as
|
|
163
|
+
* without this key. A non-empty string with a skew present → `doctor` passes, echoing both the
|
|
164
|
+
* skew and this reason. A non-empty string with NO skew present → `doctor` warns that the
|
|
165
|
+
* exemption is stale and can be deleted (an exemption nobody re-checks is how a real, later skew
|
|
166
|
+
* slips through unnoticed).
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* // apps/api streams on ai@5; apps/dashboard parses on ai@7; a producer-side TransformStream
|
|
170
|
+
* // neutralizes the one enum value that differs between the two majors.
|
|
171
|
+
* { aiMajorSkewReason: 'apps/api pinned to ai@5, apps/dashboard on ai@7 — the skew is neutralized '
|
|
172
|
+
* + 'by a producer-side TransformStream in apps/api/src/stream-transform.ts' }
|
|
173
|
+
*/
|
|
174
|
+
aiMajorSkewReason?: string;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* One `basalt.exemptRules` value: the historical bare path list, or the same list with the reason
|
|
178
|
+
* it exists. See `BasaltConfig.exemptRules`.
|
|
179
|
+
*/
|
|
180
|
+
export type ExemptRuleEntry = string[] | {
|
|
181
|
+
paths: string[];
|
|
182
|
+
reason: string;
|
|
183
|
+
};
|
|
184
|
+
/** The paths half of an exemption entry, whichever form it was written in. */
|
|
185
|
+
export declare function exemptRulePaths(entry: ExemptRuleEntry | undefined): string[];
|
|
186
|
+
/** The recorded reason for an exemption entry, or null for the bare-array form. */
|
|
187
|
+
export declare function exemptRuleReason(entry: ExemptRuleEntry | undefined): string | null;
|
|
188
|
+
export declare const DEFAULT_ROOT = "src";
|
|
189
|
+
export declare const DEFAULT_ROOTS: string[];
|
|
190
|
+
/**
|
|
191
|
+
* The configured source roots, or the built-in default. The ONE resolution every roots-derived seed
|
|
192
|
+
* reads — an empty `roots: []` falls back rather than resolving to nothing, because a bare `??`
|
|
193
|
+
* would let `[]` through and render an empty oxfmt glob into the seeded CI, reproducing the exact
|
|
194
|
+
* "matches zero files" break this derivation exists to prevent.
|
|
195
|
+
*/
|
|
196
|
+
export declare function resolveRoots(cfg: BasaltConfig): string[];
|
|
197
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExD,yEAAyE;AACzE,MAAM,MAAM,YAAY,GAAG;IACzB,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;IACnC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,uGAAuG;IACvG,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB;wFACoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAA;IACpD,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC,CAAA;IACzD;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5E,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,EAAE,CAG5E;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGlF;AAED,eAAO,MAAM,YAAY,QAAQ,CAAA;AACjC,eAAO,MAAM,aAAa,UAAiB,CAAA;AAE3C;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,EAAE,CAExD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function exemptRulePaths(entry) {
|
|
2
|
+
if (entry === void 0) return [];
|
|
3
|
+
return Array.isArray(entry) ? entry : entry.paths;
|
|
4
|
+
}
|
|
5
|
+
function exemptRuleReason(entry) {
|
|
6
|
+
if (entry === void 0 || Array.isArray(entry)) return null;
|
|
7
|
+
return entry.reason.trim().length > 0 ? entry.reason.trim() : null;
|
|
8
|
+
}
|
|
9
|
+
const DEFAULT_ROOT = "src";
|
|
10
|
+
const DEFAULT_ROOTS = [DEFAULT_ROOT];
|
|
11
|
+
function resolveRoots(cfg) {
|
|
12
|
+
return cfg.roots?.length ? cfg.roots : DEFAULT_ROOTS;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
DEFAULT_ROOT,
|
|
16
|
+
DEFAULT_ROOTS,
|
|
17
|
+
exemptRulePaths,
|
|
18
|
+
exemptRuleReason,
|
|
19
|
+
resolveRoots
|
|
20
|
+
};
|
package/dist/cli/doctor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AA8BA,MAAM,MAAM,YAAY,GAAG;IACzB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AA8DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,MAAM,CAAC,aAAa,GAAE,MAAsB,EAAE,KAAK,GAAE,MAAM,EAAO,GAAG,MAAM,CAmO1F"}
|