basalt-ui 1.33.0 → 1.34.1
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 +33 -0
- package/MIGRATING.md +115 -15
- package/README.md +3 -0
- package/agent/skills/basalt-app/SKILL.md +5 -3
- package/configs/oxlint-basalt.json +33 -0
- package/configs/oxlint-plugin.js +21 -6
- package/configs/oxlint-plugin.test.ts +98 -10
- package/configs/oxlint.json +2 -30
- package/dist/cli/check-theme.d.ts.map +1 -1
- package/dist/cli/check-theme.js +40 -36
- package/dist/cli/doctor.d.ts +5 -10
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -5
- package/dist/cli/guard-hook.d.ts.map +1 -1
- package/dist/cli/guard-hook.js +6 -34
- package/dist/cli/index.d.ts +45 -83
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +73 -19
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +7 -16
- 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/guard/index.d.ts +2 -2
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +11 -13
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- 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/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/sidebar-search.d.ts.map +1 -1
- package/dist/shell/sidebar-search.js +1 -3
- package/dist/surfaces.d.ts +2 -2
- package/dist/surfaces.js +2 -2
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +17 -1
- package/dist/tokens/size-classes.d.ts +12 -0
- package/dist/tokens/size-classes.d.ts.map +1 -1
- package/dist/tokens/size-classes.js +11 -5
- package/llms.txt +4 -4
- package/package.json +1 -1
- package/src/cli/check-theme.ts +63 -37
- package/src/cli/doctor.ts +12 -15
- package/src/cli/guard-hook.ts +8 -35
- package/src/cli/index.ts +126 -113
- package/src/cli/sync.ts +7 -16
- package/src/common/vx-families.ts +36 -0
- package/src/common/vx-family.ts +22 -0
- package/src/guard/index.ts +22 -25
- package/src/index.ts +0 -2
- 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/nav-glyph.tsx +38 -0
- package/src/shell/nav-types.ts +1 -0
- package/src/shell/sidebar-search.tsx +1 -5
- package/src/surfaces.ts +2 -2
- package/src/tokens/index.ts +28 -1
- package/src/tokens/size-classes.ts +18 -5
- 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/shell/use-breakpoint.ts +0 -37
package/dist/cli/index.js
CHANGED
|
@@ -22,13 +22,40 @@ import { init } from "./init.js";
|
|
|
22
22
|
import { sync } from "./sync.js";
|
|
23
23
|
import { fontsCss, normalizeColorFunctions, tokensCss } from "./tokens-css.js";
|
|
24
24
|
import { DEFAULT_ROOT, exemptRulePaths, resolveRoots } from "./config.js";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
const GUARD_PASSTHROUGH = {
|
|
26
|
+
spacingSteps: true,
|
|
27
|
+
rawRadius: true,
|
|
28
|
+
forbiddenAccents: true,
|
|
29
|
+
mantineShadeIndex: true,
|
|
30
|
+
rawSurface: true,
|
|
31
|
+
cardWithBorder: true,
|
|
32
|
+
offSystemSurfaceVar: true,
|
|
33
|
+
rawHtmlLayout: true,
|
|
34
|
+
inlineSpacing: true,
|
|
35
|
+
inlineDisplay: true,
|
|
36
|
+
rawVisxAxis: true,
|
|
37
|
+
rawMotionValue: true,
|
|
38
|
+
chartMissingAriaLabel: true,
|
|
39
|
+
rawFormControl: true,
|
|
40
|
+
sub16InputFont: true,
|
|
41
|
+
severity: true
|
|
42
|
+
};
|
|
43
|
+
function resolveGuardConfig(cfg, profile) {
|
|
44
|
+
const exemptRules = {};
|
|
45
|
+
for (const [kind, entry] of Object.entries(cfg.exemptRules ?? {})) {
|
|
46
|
+
exemptRules[kind] = exemptRulePaths(entry);
|
|
47
|
+
}
|
|
48
|
+
const from = cfg;
|
|
49
|
+
const set = Object.keys(GUARD_PASSTHROUGH).filter(
|
|
50
|
+
(k) => (from[k] ?? null) !== null
|
|
51
|
+
);
|
|
52
|
+
return {
|
|
53
|
+
...DEFAULT_GUARD_CONFIG,
|
|
54
|
+
...Object.fromEntries(set.map((k) => [k, from[k]])),
|
|
55
|
+
allowComment: "theme-allow",
|
|
56
|
+
exemptRules,
|
|
57
|
+
...profile === "tokens-only" ? { profile: "tokens-only" } : {}
|
|
58
|
+
};
|
|
32
59
|
}
|
|
33
60
|
function resolveSeriesModulePath(cfg) {
|
|
34
61
|
if (cfg.seriesModulePath !== void 0) return cfg.seriesModulePath;
|
|
@@ -154,8 +181,19 @@ function declaredProfile(cfg, flags) {
|
|
|
154
181
|
if (flags.includes("--framework")) return "framework";
|
|
155
182
|
return cfg.profile === "tokens-only" ? "tokens-only" : "framework";
|
|
156
183
|
}
|
|
157
|
-
function conflictingProfileFlags(flags) {
|
|
158
|
-
|
|
184
|
+
function conflictingProfileFlags(command, flags) {
|
|
185
|
+
const both = flags.includes("--tokens-only") && flags.includes("--framework");
|
|
186
|
+
if (both)
|
|
187
|
+
console.error(
|
|
188
|
+
`basalt-ui ${command}: --tokens-only and --framework are alternatives \u2014 pass one.`
|
|
189
|
+
);
|
|
190
|
+
return both;
|
|
191
|
+
}
|
|
192
|
+
function noteRelocation(command, project) {
|
|
193
|
+
if (project.relocatedFrom === null) return;
|
|
194
|
+
console.log(
|
|
195
|
+
`basalt-ui ${command}: BASALT_CWD relocated from ${project.relocatedFrom} to ${project.dir}.`
|
|
196
|
+
);
|
|
159
197
|
}
|
|
160
198
|
function scannableFiles(cwd, cfg) {
|
|
161
199
|
const exempt = new Set(cfg.exempt ?? defaultExempt(cfg));
|
|
@@ -234,7 +272,7 @@ function buildTemplateVars(pkgRoot, cwd, cfg) {
|
|
|
234
272
|
ACCENT_HUE: cfg.accentHue ?? "blue",
|
|
235
273
|
SERIES_MODULE_PATH: resolveSeriesModulePath(cfg),
|
|
236
274
|
ROOTS_GLOBS: resolveRoots(cfg).map(toRootGlob).join(" "),
|
|
237
|
-
OXLINT_PRESET_PATH: shippedAssetPath(install, cwd,
|
|
275
|
+
OXLINT_PRESET_PATH: shippedAssetPath(install, cwd, OXLINT_FILES.preset),
|
|
238
276
|
LEFTHOOK_PRESET_PATH: shippedAssetPath(install, cwd, "configs/lefthook.yml"),
|
|
239
277
|
BASALT_BIN: basaltBinCommand(install, cwd)
|
|
240
278
|
};
|
|
@@ -300,6 +338,14 @@ function findRepoRoot(dir) {
|
|
|
300
338
|
current = parent;
|
|
301
339
|
}
|
|
302
340
|
}
|
|
341
|
+
const OXLINT_NO_BIN = "oxlint config found but no oxlint binary \u2014 the AST lane never runs; add oxlint as a devDependency";
|
|
342
|
+
function oxlintBinResolves(dir) {
|
|
343
|
+
const root = findRepoRoot(dir);
|
|
344
|
+
for (let d = dir; ; d = dirname(d)) {
|
|
345
|
+
if (existsSync(resolve(d, "node_modules/.bin/oxlint"))) return true;
|
|
346
|
+
if (d === root || dirname(d) === d) return false;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
303
349
|
function findFileNamed(dir, filename) {
|
|
304
350
|
let entries;
|
|
305
351
|
try {
|
|
@@ -422,7 +468,7 @@ pre-commit:
|
|
|
422
468
|
const oxlintrc = {
|
|
423
469
|
dest: ".oxlintrc.json",
|
|
424
470
|
mode: "seed",
|
|
425
|
-
source:
|
|
471
|
+
source: OXLINT_FILES.preset,
|
|
426
472
|
render: (ctx) => `{
|
|
427
473
|
"extends": ["${ctx.vars.OXLINT_PRESET_PATH}"]
|
|
428
474
|
}
|
|
@@ -708,12 +754,15 @@ function parseJsonc(text) {
|
|
|
708
754
|
return null;
|
|
709
755
|
}
|
|
710
756
|
}
|
|
757
|
+
const OXLINT_FILES = {
|
|
758
|
+
preset: "configs/oxlint.json",
|
|
759
|
+
guards: "configs/oxlint-basalt.json",
|
|
760
|
+
plugin: "configs/oxlint-plugin.js"
|
|
761
|
+
};
|
|
762
|
+
const namesShipped = (entry, file) => typeof entry === "string" && entry.endsWith(`basalt-ui/${file}`);
|
|
711
763
|
function basaltPresetEntry(entries) {
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
(entry) => typeof entry === "string" && entry.endsWith("basalt-ui/configs/oxlint.json")
|
|
715
|
-
);
|
|
716
|
-
return match ?? null;
|
|
764
|
+
const presets = [OXLINT_FILES.preset, OXLINT_FILES.guards];
|
|
765
|
+
return [entries].flat().find((e) => presets.some((f) => namesShipped(e, f))) ?? null;
|
|
717
766
|
}
|
|
718
767
|
const LEFTHOOK_CONFIG_NAMES = ["lefthook.yml", "lefthook.yaml", ".lefthook.yml", ".lefthook.yaml"];
|
|
719
768
|
function findLefthookConfig(dir) {
|
|
@@ -759,9 +808,9 @@ function mergeOxlintExtends(cwd, presetPath) {
|
|
|
759
808
|
if (raw === null) return "absent";
|
|
760
809
|
const cfg = parseJsonc(raw);
|
|
761
810
|
if (cfg === null) return "unreadable";
|
|
762
|
-
if (
|
|
811
|
+
if ([cfg["extends"]].flat().some((e) => namesShipped(e, OXLINT_FILES.preset))) return "already";
|
|
763
812
|
if (stripJsonc(raw) !== raw) return "has-comments";
|
|
764
|
-
const existing =
|
|
813
|
+
const existing = [cfg["extends"]].flat().filter((e) => typeof e === "string" && !namesShipped(e, OXLINT_FILES.guards));
|
|
765
814
|
const merged = "extends" in cfg ? {} : { extends: [presetPath] };
|
|
766
815
|
for (const [key, value] of Object.entries(cfg)) {
|
|
767
816
|
merged[key] = key === "extends" ? [presetPath, ...existing] : value;
|
|
@@ -896,6 +945,8 @@ function run(argv, cwd = process.cwd()) {
|
|
|
896
945
|
}
|
|
897
946
|
export {
|
|
898
947
|
MANIFEST_PATH,
|
|
948
|
+
OXLINT_FILES,
|
|
949
|
+
OXLINT_NO_BIN,
|
|
899
950
|
ROOT_PLACEMENT,
|
|
900
951
|
RULE_NAMES,
|
|
901
952
|
SERIES_MODULE_HINT_RE,
|
|
@@ -920,8 +971,11 @@ export {
|
|
|
920
971
|
isStringArray,
|
|
921
972
|
managedFiles,
|
|
922
973
|
mergeOxlintExtends,
|
|
974
|
+
namesShipped,
|
|
923
975
|
normalizeColorFunctions,
|
|
924
976
|
normalizeForLedger,
|
|
977
|
+
noteRelocation,
|
|
978
|
+
oxlintBinResolves,
|
|
925
979
|
packageRoot,
|
|
926
980
|
parseJsonc,
|
|
927
981
|
patchPackageJson,
|
|
@@ -936,7 +990,7 @@ export {
|
|
|
936
990
|
relativePosix,
|
|
937
991
|
renderContext,
|
|
938
992
|
reportPrune,
|
|
939
|
-
|
|
993
|
+
resolveGuardConfig,
|
|
940
994
|
resolvePeerFlags,
|
|
941
995
|
resolvePlacement,
|
|
942
996
|
resolveProjectDir,
|
package/dist/cli/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AA8CA,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mGAAmG;IACnG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED;;;;;;;;;GASG;AACH;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrF;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,WAAgB,EAAE,aAAa,GAAE,MAAsB,GAAG,MAAM,CAoM1F"}
|
package/dist/cli/sync.js
CHANGED
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
isStringArray,
|
|
14
14
|
managedFiles,
|
|
15
15
|
normalizeForLedger,
|
|
16
|
+
noteRelocation,
|
|
17
|
+
OXLINT_FILES,
|
|
16
18
|
parseJsonc,
|
|
17
19
|
placementNotices,
|
|
18
20
|
pruneRetiredManagedFiles,
|
|
@@ -35,14 +37,8 @@ import {
|
|
|
35
37
|
writeUnit
|
|
36
38
|
} from "./index.js";
|
|
37
39
|
function readOxlintPresetPlugins(pkgRoot) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
try {
|
|
41
|
-
const plugins = JSON.parse(raw).plugins;
|
|
42
|
-
return isStringArray(plugins) ? plugins : [];
|
|
43
|
-
} catch {
|
|
44
|
-
return [];
|
|
45
|
-
}
|
|
40
|
+
const plugins = parseJsonc(readSource(pkgRoot, OXLINT_FILES.preset) ?? "null")?.["plugins"];
|
|
41
|
+
return isStringArray(plugins) ? plugins : [];
|
|
46
42
|
}
|
|
47
43
|
function parentInstallAdvice(cwd, parent, verb) {
|
|
48
44
|
return `This repo's install is at ${relativePosix(cwd, parent)} (${parent}) \u2014 run ${verb} there, or set BASALT_CWD to it.`;
|
|
@@ -58,15 +54,10 @@ function findManifestAbove(dir) {
|
|
|
58
54
|
}
|
|
59
55
|
function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
60
56
|
const syncFlags = opts.flags ?? [];
|
|
61
|
-
if (conflictingProfileFlags(syncFlags))
|
|
62
|
-
console.error("basalt-ui sync: --tokens-only and --framework are alternatives \u2014 pass one.");
|
|
63
|
-
return 1;
|
|
64
|
-
}
|
|
57
|
+
if (conflictingProfileFlags("sync", syncFlags)) return 1;
|
|
65
58
|
const project = resolveProjectDir(invocationCwd);
|
|
66
59
|
const cwd = project.dir;
|
|
67
|
-
|
|
68
|
-
console.log(`basalt-ui sync: BASALT_CWD relocated from ${project.relocatedFrom} to ${cwd}.`);
|
|
69
|
-
}
|
|
60
|
+
noteRelocation("sync", project);
|
|
70
61
|
if (declaredProfile(readBasaltConfig(cwd), syncFlags) === "tokens-only") {
|
|
71
62
|
console.log(
|
|
72
63
|
`basalt-ui sync: ${MANIFEST_PATH}: n/a \u2014 a tokens-only consumer has no scaffold to reconcile. The token layer is refreshed by re-running \`basalt-ui tokens:css\`, and \`tokens:css --check\` is its drift gate. Pass --framework to force the full profile.`
|
|
@@ -150,7 +141,7 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
|
150
141
|
const oxlintEntry = oxlintrcRaw === null ? null : basaltPresetEntry(parseJsonc(oxlintrcRaw)?.["extends"]);
|
|
151
142
|
if (oxlintEntry !== null && !existsSync(resolve(cwd, oxlintEntry))) {
|
|
152
143
|
console.error(
|
|
153
|
-
`\u26A0 basalt-ui sync: .oxlintrc.json extends "${oxlintEntry}", which does not exist \u2014 oxlint refuses to start on a missing extends target (\`NotFound\`). Repoint it at "${shippedAssetPath(install, cwd,
|
|
144
|
+
`\u26A0 basalt-ui sync: .oxlintrc.json extends "${oxlintEntry}", which does not exist \u2014 oxlint refuses to start on a missing extends target (\`NotFound\`). Repoint it at "${shippedAssetPath(install, cwd, OXLINT_FILES.preset)}".`
|
|
154
145
|
);
|
|
155
146
|
}
|
|
156
147
|
if (opts.check) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The families every emitted `--vx-*` name lives in (`basaltVxFamilies`) — basalt-owned:
|
|
3
|
+
* `unknown-vx-token` judges every name inside one, and `groupTokens`/`seriesTokens` warn on a
|
|
4
|
+
* consumer ref there.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BASALT_VX_FAMILIES: readonly string[];
|
|
7
|
+
//# sourceMappingURL=vx-families.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vx-families.d.ts","sourceRoot":"","sources":["../../src/common/vx-families.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EA4B/C,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const BASALT_VX_FAMILIES = [
|
|
2
|
+
"accent",
|
|
3
|
+
"area",
|
|
4
|
+
"axis",
|
|
5
|
+
"bad",
|
|
6
|
+
"crosshair",
|
|
7
|
+
"divider",
|
|
8
|
+
"dot",
|
|
9
|
+
"faint",
|
|
10
|
+
"fill",
|
|
11
|
+
"good",
|
|
12
|
+
"grid",
|
|
13
|
+
"hit",
|
|
14
|
+
"ink",
|
|
15
|
+
"keyboard",
|
|
16
|
+
"legend",
|
|
17
|
+
"line",
|
|
18
|
+
"muted",
|
|
19
|
+
"neutral",
|
|
20
|
+
"prose",
|
|
21
|
+
"radius",
|
|
22
|
+
"shadow",
|
|
23
|
+
"space",
|
|
24
|
+
"status",
|
|
25
|
+
"surface",
|
|
26
|
+
"text",
|
|
27
|
+
"tooltip",
|
|
28
|
+
"warn"
|
|
29
|
+
];
|
|
30
|
+
export {
|
|
31
|
+
BASALT_VX_FAMILIES
|
|
32
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A `--vx-*` name's FAMILY — its leading lowercase run: `--vx-surface-bg` → `surface`, `--vx-ink2`
|
|
3
|
+
* → `ink`, `--vx-tooltipBg` → `tooltip`, `--vx-fillHover-cyan` → `fill`. Dependency-free, because
|
|
4
|
+
* three sides must agree on it byte for byte: the generator that writes `BASALT_VX_FAMILIES`, the
|
|
5
|
+
* guard that judges every name inside one of those families, and the token factories that refuse a
|
|
6
|
+
* consumer name inside one — the refusal is what makes the guard's judgement honest.
|
|
7
|
+
*/
|
|
8
|
+
export declare function vxFamilyOf(name: string): string;
|
|
9
|
+
/** The basalt-owned families among `names` — run over every name basalt emits (`collectVxNames`). */
|
|
10
|
+
export declare function basaltVxFamilies(names: readonly string[]): string[];
|
|
11
|
+
//# sourceMappingURL=vx-family.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vx-family.d.ts","sourceRoot":"","sources":["../../src/common/vx-family.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAQD,qGAAqG;AACrG,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAGnE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function vxFamilyOf(name) {
|
|
2
|
+
return /^--vx-([a-z]*)/.exec(name)?.[1] ?? "";
|
|
3
|
+
}
|
|
4
|
+
const CONSUMER_EXTENSIBLE_FAMILIES = /* @__PURE__ */ new Set(["on"]);
|
|
5
|
+
function basaltVxFamilies(names) {
|
|
6
|
+
const families = new Set(names.map(vxFamilyOf));
|
|
7
|
+
return [...families].filter((f) => f !== "" && !CONSUMER_EXTENSIBLE_FAMILIES.has(f)).toSorted();
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
basaltVxFamilies,
|
|
11
|
+
vxFamilyOf
|
|
12
|
+
};
|
package/dist/guard/index.d.ts
CHANGED
|
@@ -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";
|
|
@@ -318,7 +318,7 @@ export declare const GUARD_RULES: {
|
|
|
318
318
|
readonly 'unknown-vx-token': {
|
|
319
319
|
readonly kind: "unknown-vx-token";
|
|
320
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.
|
|
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
322
|
};
|
|
323
323
|
};
|
|
324
324
|
/**
|
|
@@ -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,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;AAo0B9D,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,WAmBlC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAUrE,CAAA;AA0GD,sGAAsG;AACtG,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,UAAU,CAAA;CAC7C,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,WAAW,EAChB,eAAe,EAAE,SAAS,MAAM,EAAE,GACjC,sBAAsB,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C,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;IAC/B,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,gDAAgD;IAChD,QAAQ,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,CAAA;IACzC,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,oGAAoG;IACpG,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;IACxC,wCAAwC;IACxC,QAAQ,CAAC,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,5 @@
|
|
|
1
|
+
import { vxFamilyOf } from "../common/vx-family.js";
|
|
2
|
+
import { BASALT_VX_FAMILIES } from "../common/vx-families.js";
|
|
1
3
|
import { BASALT_VX_NAMES } from "./vx-names.js";
|
|
2
4
|
const HEX = /#(?!(?<=&#)\d+;)[0-9a-fA-F]{3,8}\b/g;
|
|
3
5
|
const FUNC = /\b(?:rgba?|hsla?)\((?!\s*\$\{)/g;
|
|
@@ -59,11 +61,7 @@ const REMOVED_VX_NAMES = {
|
|
|
59
61
|
"--vx-space-sidebar-brand-inset-top": null
|
|
60
62
|
};
|
|
61
63
|
const KNOWN_VX_NAMES = new Set(BASALT_VX_NAMES);
|
|
62
|
-
const
|
|
63
|
-
BASALT_VX_NAMES.map((n) => /^(--vx-[A-Za-z0-9]+)-/.exec(n)?.[1]).filter(
|
|
64
|
-
(root) => root !== void 0 && !KNOWN_VX_NAMES.has(root)
|
|
65
|
-
)
|
|
66
|
-
);
|
|
64
|
+
const BASALT_VX_FAMILY_SET = new Set(BASALT_VX_FAMILIES);
|
|
67
65
|
const OFF_SYSTEM_SURFACE_VAR = /var\(--mantine-color-(gray|dark)-\d/g;
|
|
68
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;
|
|
69
67
|
const RAW_HTML_TAG_NAME = "<(?:div|span|section|header|nav|footer|aside|main|article|ul|ol)\\b";
|
|
@@ -241,9 +239,9 @@ const DEFAULT_GUARD_CONFIG = {
|
|
|
241
239
|
};
|
|
242
240
|
const GRACE_PERIOD_KINDS = {
|
|
243
241
|
"unknown-vx-token": {
|
|
244
|
-
since: "1.
|
|
245
|
-
promote: "1.
|
|
246
|
-
why: "New kind (consumer-loop r2 B3): obsidian lost its 44px touch floor to a removed `var(--vx-space-touch-target)` that nothing reported.
|
|
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."
|
|
247
245
|
}
|
|
248
246
|
};
|
|
249
247
|
function severityOf(kind, cfg) {
|
|
@@ -799,7 +797,7 @@ const GUARD_RULES = {
|
|
|
799
797
|
enabled: (cfg) => cfg.cardWithBorder,
|
|
800
798
|
// JSX-tag-shaped (`<Card withBorder>`) — never appears in CSS text.
|
|
801
799
|
appliesTo: (relPath) => !relPath.endsWith(".css"),
|
|
802
|
-
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".'
|
|
803
801
|
},
|
|
804
802
|
"off-system-surface-var": {
|
|
805
803
|
kind: "off-system-surface-var",
|
|
@@ -949,12 +947,12 @@ const GUARD_RULES = {
|
|
|
949
947
|
"unknown-vx-token": {
|
|
950
948
|
kind: "unknown-vx-token",
|
|
951
949
|
pattern: VX_VAR_REF,
|
|
952
|
-
// handled inline (
|
|
953
|
-
message: `var() names a --vx-* token basalt does not emit, so it resolves to its fallback (or to nothing) with no error anywhere.
|
|
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(
|
|
954
952
|
REMOVED_VX_NAMES
|
|
955
953
|
).map(([from, to]) => `${from} \u2192 ${to ?? "(deleted, no replacement)"}`).join(
|
|
956
954
|
"; "
|
|
957
|
-
)}
|
|
955
|
+
)}. A name in any other family is never judged, because groupTokens may declare it in a file this scan cannot see.`
|
|
958
956
|
}
|
|
959
957
|
};
|
|
960
958
|
function guardKindRemedy(kind) {
|
|
@@ -1038,7 +1036,7 @@ function checkSource(text, relPath, cfg) {
|
|
|
1038
1036
|
for (const m of codeText.matchAll(VX_VAR_REF)) {
|
|
1039
1037
|
const name = m[1] ?? "";
|
|
1040
1038
|
if (locallyDeclaredVx.has(name)) continue;
|
|
1041
|
-
if (
|
|
1039
|
+
if (KNOWN_VX_NAMES.has(name) || !BASALT_VX_FAMILY_SET.has(vxFamilyOf(name))) continue;
|
|
1042
1040
|
const at = (m.index ?? 0) + m[0].length - name.length;
|
|
1043
1041
|
push("unknown-vx-token", lineStarts.findLastIndex((start) => start <= at) + 1, name);
|
|
1044
1042
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export { ThemeToggle, type ThemeToggleProps } from './theme/theme-toggle.js';
|
|
|
29
29
|
*/
|
|
30
30
|
export { ActionGroup, type BarAction, type ActionGroupProps, type GlobalAction, } from './controls/actions.js';
|
|
31
31
|
export { MOTION_DURATION, MOTION_SPRING, MOTION_EASE_STANDARD } from './common/motion.js';
|
|
32
|
-
export { BasaltShell, NavCountBadge, type NavCountBadgeProps, AppSidebar, SidebarSearch, type SidebarSearchProps, type SidebarSearchConfig, type SidebarSearchActions, SidebarAccount, MobileNav, type MobileNavProps, projectMobileNav, type ProjectMobileNavOptions, MOBILE_MAX_TABS_DEFAULT, MOBILE_MENU_MAX_DEFAULT, MOBILE_MORE_KEY, AppBreadcrumbs, type AppBreadcrumbsProps, PageBar, type PageBarProps, type PageBarSlot, PageAside, type PageAsideProps, type PageAsideSlot,
|
|
32
|
+
export { BasaltShell, NavCountBadge, type NavCountBadgeProps, AppSidebar, SidebarSearch, type SidebarSearchProps, type SidebarSearchConfig, type SidebarSearchActions, SidebarAccount, MobileNav, type MobileNavProps, projectMobileNav, type ProjectMobileNavOptions, MOBILE_MAX_TABS_DEFAULT, MOBILE_MENU_MAX_DEFAULT, MOBILE_MORE_KEY, AppBreadcrumbs, type AppBreadcrumbsProps, PageBar, type PageBarProps, type PageBarSlot, PageAside, type PageAsideProps, type PageAsideSlot, useSizeClass, type SizeClass, PageTitle, type PageTitleProps, type PageTitleSlot, type SidebarSection, type SidebarItem, type SidebarBlock, type SidebarBlockItem, type SidebarBlockTone, type SidebarListBlock, type SidebarProgressBlock, type SidebarCustomBlock, type NavAnchor, type NavAnchorProps, type NavMobilePlacement, type NavSectionMobile, type MobileNavConfig, type MobileNavGroup, type MobileNavModel, type MobileNavSlot, type MobileNavSurface, type BasaltShellProps, type BrandConfig, type SettingsMenuItem, type AppSidebarProps, type AccountBadgeTone, type BasaltIdentity, type BasaltRole, type BasaltPlan, type AccountMenuItem, type BasaltAccountState, type BasaltAccountActions, type BasaltAccountProps, } from './shell/index.js';
|
|
33
33
|
export { type BasaltRegister, type Slot, type Series, type SeriesKey, type AsyncState, assertNever, type StandardSchemaV1, } from './register.js';
|
|
34
34
|
export { createPersistedState, type PersistedStateOptions, readPersistedValue, createLocalStore, type LocalStore, type AnyField, type BooleanField, type EnumField, type FieldFallback, type FieldHandle, type FieldLane, type FieldOption, type FieldSetOptions, type FieldValue, type MultiField, type NumberField, type RangeField, type RangeParams, type RangePresets, type RangeValue, type RangeWindow, type RangeWindows, type ResolvedLane, type ResolveLane, type SearchValues, type StoredValues, type StringField, } from './state.js';
|
|
35
35
|
export { WidgetHeader, type WidgetHeaderDeltaProps, type WidgetHeaderMetricProps, type WidgetHeaderProps, type WidgetHeaderSlot, type WidgetHeaderTier, type WidgetHeaderTitleProps, DeltaBadge, type DeltaBadgeProps, type DeltaPolarity, Section, type SectionProps, type SectionSlot, StatCard, type StatCardBreakdownRow, type StatCardProps, type StatCardSlot, type StatCardTone, WidgetGrid, type WidgetGridCols, type WidgetGridItemProps, type WidgetGridProps, StatGroup, type StatGroupCols, type StatGroupProps, EmptyState, type EmptyStateProps, type EmptyStateSlot, SettingsSection, type SettingsSectionProps, type SettingsSectionSlot, SettingsRow, type SettingsRowProps, type SettingsRowSlot, DangerZone, type DangerZoneProps, QueryState, type QueryStateProps, type QueryStateLike, type QueryStateSlot, type QueryStateTier, type QueryEmptyCopy, LoadingState, type LoadingStateProps, ErrorState, type ErrorStateProps, } from './dashboard/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,cAAc,EACd,KAAK,mBAAmB,EACxB,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAA;AASnB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,EAAE,EACF,cAAc,EACd,oBAAoB,GACrB,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC5E,YAAY,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAC1E,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACzE;;;;;GAKG;AACH,OAAO,EACL,WAAW,EACX,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACtF,OAAO,EACL,WAAW,EACX,aAAa,EACb,KAAK,kBAAkB,EACvB,UAAU,EACV,aAA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ChB,2BAA2B,EAC3B,kBAAkB,GACnB,MAAM,SAAS,CAAA;AAChB,YAAY,EACV,0BAA0B,EAC1B,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,+BAA+B,EAC/B,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,SAAS,EACT,cAAc,GACf,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
AppBreadcrumbs,
|
|
30
30
|
PageBar,
|
|
31
31
|
PageAside,
|
|
32
|
-
useBreakpoint,
|
|
33
32
|
useSizeClass,
|
|
34
33
|
PageTitle
|
|
35
34
|
} from "./shell/index.js";
|
|
@@ -151,7 +150,6 @@ export {
|
|
|
151
150
|
unwrap,
|
|
152
151
|
useAgentThreadRuns,
|
|
153
152
|
useBasaltSpacing,
|
|
154
|
-
useBreakpoint,
|
|
155
153
|
useConnectivity,
|
|
156
154
|
useSizeClass
|
|
157
155
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-mobile-nav.d.ts","sourceRoot":"","sources":["../../src/shell/app-mobile-nav.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAc,YAAY,EAAa,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EAEd,YAAY,EAKb,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"app-mobile-nav.d.ts","sourceRoot":"","sources":["../../src/shell/app-mobile-nav.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAc,YAAY,EAAa,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,OAAO,KAAK,EACV,eAAe,EAEf,cAAc,EAEd,YAAY,EAKb,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAqB/C,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IACzC,kFAAkF;IAClF,KAAK,EAAE,cAAc,CAAA;IACrB,MAAM,CAAC,EAAE,eAAe,GAAG,SAAS,CAAA;IACpC;;wEAEoE;IACpE,OAAO,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAA;IACxC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAAA;IAClD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAA;CACpC,CAAA;AAwGD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,GAAG,MAAM,CAE/E;AA6ED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,cAAc,GAAG,YAAY,CAiiB/B"}
|
|
@@ -6,6 +6,7 @@ import { cx } from "../common/props.js";
|
|
|
6
6
|
import { assertRequiredProps } from "../common/validate.js";
|
|
7
7
|
import { SCROLLPORT_ATTRIBUTE } from "../common/scroll-parent.js";
|
|
8
8
|
import { NavCountBadge } from "./nav-count-badge.js";
|
|
9
|
+
import { hasIcon, initialGlyph } from "./nav-glyph.js";
|
|
9
10
|
import { SidebarBlockToneDot } from "./sidebar-blocks.js";
|
|
10
11
|
import { sidebarBlockMobile } from "./sidebar-block-model.js";
|
|
11
12
|
import { useBasaltSpacing } from "../theme/index.js";
|
|
@@ -240,7 +241,7 @@ function MobileNav({
|
|
|
240
241
|
const hasCount = (slot) => slot.kind === "link" ? Boolean(slot.item.count) : slot.groups.some((g) => groupHasCount(g.items));
|
|
241
242
|
const tabInner = (slot) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
242
243
|
/* @__PURE__ */ jsxs("span", { className: classes.tabIcon, children: [
|
|
243
|
-
slot.icon
|
|
244
|
+
hasIcon(slot.icon) ? slot.icon : slot.kind !== "link" && slot.isMore ? /* @__PURE__ */ jsx(IconMore, {}) : initialGlyph(slot.short),
|
|
244
245
|
hasCount(slot) ? /* @__PURE__ */ jsx("span", { className: classes.tabDot, "aria-hidden": true }) : null
|
|
245
246
|
] }),
|
|
246
247
|
/* @__PURE__ */ jsx(Text, { className: classes.label, children: slot.short })
|
|
@@ -69,6 +69,18 @@
|
|
|
69
69
|
height: var(--vx-space-mobile-nav-icon-size);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/* The first-letter fallback for an icon-less slot (`nav-glyph.tsx`) sits in the same icon-size box
|
|
73
|
+
* an svg gets, so the pill's height does not depend on the glyph's line box. */
|
|
74
|
+
.tabIcon > [data-nav-glyph] {
|
|
75
|
+
display: inline-flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: var(--vx-space-mobile-nav-icon-size);
|
|
79
|
+
height: var(--vx-space-mobile-nav-icon-size);
|
|
80
|
+
line-height: 1;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
}
|
|
83
|
+
|
|
72
84
|
.tab:active .tabIcon {
|
|
73
85
|
transform: scale(0.9);
|
|
74
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/app-sidebar.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAe,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"app-sidebar.d.ts","sourceRoot":"","sources":["../../src/shell/app-sidebar.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAe,cAAc,EAAE,MAAM,aAAa,CAAA;AAI5E,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAE1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAgBjF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C;;;;OAIG;IACH,KAAK,EAAE,WAAW,GAAG;QAAE,IAAI,CAAC,EAAE,eAAe,EAAE,CAAA;KAAE,CAAA;IACjD,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,SAAS,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACtC;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IACvC;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAA;IAC5B;;;;OAIG;IACH,MAAM,CAAC,EAAE,mBAAmB,GAAG;QAAE,OAAO,CAAC,EAAE,oBAAoB,CAAA;KAAE,CAAA;IACjE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA;AA6SD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,+BAwKhD"}
|
|
@@ -17,6 +17,7 @@ import { useEffect, useRef } from "react";
|
|
|
17
17
|
import { cx } from "../common/props.js";
|
|
18
18
|
import { assertRequiredProps } from "../common/validate.js";
|
|
19
19
|
import { NavCountBadge } from "./nav-count-badge.js";
|
|
20
|
+
import { iconOrInitial } from "./nav-glyph.js";
|
|
20
21
|
import { SidebarAccount } from "./app-sidebar-account.js";
|
|
21
22
|
import { SidebarSearch } from "./sidebar-search.js";
|
|
22
23
|
import {
|
|
@@ -77,12 +78,20 @@ function hasActiveDescendant(item) {
|
|
|
77
78
|
if (item.active) return true;
|
|
78
79
|
return item.children?.some((c) => hasActiveDescendant(c)) ?? false;
|
|
79
80
|
}
|
|
80
|
-
function NavLinkBody({
|
|
81
|
+
function NavLinkBody({
|
|
82
|
+
item,
|
|
83
|
+
active,
|
|
84
|
+
collapsed = false
|
|
85
|
+
}) {
|
|
81
86
|
const Anchor = item.Anchor;
|
|
82
87
|
const shared = {
|
|
83
88
|
classNames: { root: classes.link },
|
|
84
89
|
label: item.label,
|
|
85
|
-
leftSection: item.icon,
|
|
90
|
+
leftSection: iconOrInitial(item.icon, item.label),
|
|
91
|
+
// Only the collapsed rail hides the label (CSS), leaving the icon alone — name the link there.
|
|
92
|
+
// Expanded, the visible text IS the name and carries the count badge; an `aria-label` would
|
|
93
|
+
// override both and drop the count ("Inbox 5" → "Inbox").
|
|
94
|
+
...collapsed && { "aria-label": item.label },
|
|
86
95
|
rightSection: item.badge ?? (item.count ? /* @__PURE__ */ jsx(NavCountBadge, { count: item.count }) : void 0),
|
|
87
96
|
active,
|
|
88
97
|
// Basalt is the one that stamps `aria-current`, not the theme and not a router `<Link>`'s own
|
|
@@ -101,6 +110,20 @@ function NavLinkBody({ item, active }) {
|
|
|
101
110
|
}
|
|
102
111
|
return /* @__PURE__ */ jsx(NavLink, { component: "a", ...item.href !== void 0 && { href: item.href }, ...shared });
|
|
103
112
|
}
|
|
113
|
+
function ChildRow({ child }) {
|
|
114
|
+
if (!child.disabled) {
|
|
115
|
+
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(NavLinkBody, { item: child, active: Boolean(child.active) }) });
|
|
116
|
+
}
|
|
117
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: "Coming soon", position: "right", withArrow: true, children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
118
|
+
NavLink,
|
|
119
|
+
{
|
|
120
|
+
classNames: { root: classes.link },
|
|
121
|
+
label: child.label,
|
|
122
|
+
leftSection: iconOrInitial(child.icon, child.label),
|
|
123
|
+
"data-disabled": true
|
|
124
|
+
}
|
|
125
|
+
) }) });
|
|
126
|
+
}
|
|
104
127
|
function SectionLabel({ children }) {
|
|
105
128
|
return /* @__PURE__ */ jsx(Text, { component: "div", px: 0, mb: 0, className: classes.sectionLabel, children });
|
|
106
129
|
}
|
|
@@ -153,33 +176,20 @@ function NavItemRow({ item, collapsed }) {
|
|
|
153
176
|
{
|
|
154
177
|
classNames: { root: classes.link },
|
|
155
178
|
label: item.label,
|
|
156
|
-
leftSection: item.icon,
|
|
179
|
+
leftSection: iconOrInitial(item.icon, item.label),
|
|
180
|
+
...collapsed && { "aria-label": item.label },
|
|
157
181
|
"data-disabled": true
|
|
158
182
|
}
|
|
159
183
|
) }) }, item.key);
|
|
160
184
|
}
|
|
161
185
|
const active2 = Boolean(item.active);
|
|
162
|
-
return /* @__PURE__ */ jsx(Tooltip, { label: item.label, position: "right", withArrow: true, disabled: !collapsed, children: /* @__PURE__ */ jsx(Box, { className: classes.navItem, children: /* @__PURE__ */ jsx(NavLinkBody, { item, active: active2 }) }) }, item.key);
|
|
186
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: item.label, position: "right", withArrow: true, disabled: !collapsed, children: /* @__PURE__ */ jsx(Box, { className: classes.navItem, children: /* @__PURE__ */ jsx(NavLinkBody, { item, active: active2, collapsed }) }) }, item.key);
|
|
163
187
|
}
|
|
164
188
|
const active = Boolean(item.active);
|
|
165
189
|
if (isExpanded) {
|
|
166
190
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
167
|
-
/* @__PURE__ */ jsx(Tooltip, { label: item.label, position: "right", withArrow: true, disabled: !collapsed, children: /* @__PURE__ */ jsx(Box, { className: classes.navItem, children: /* @__PURE__ */ jsx(NavLinkBody, { item, active }) }) }),
|
|
168
|
-
/* @__PURE__ */ jsx(Stack, { gap: 0, className: classes.childList, children: item.children.map((child) => {
|
|
169
|
-
if (child.disabled) {
|
|
170
|
-
return /* @__PURE__ */ jsx(Tooltip, { label: "Coming soon", position: "right", withArrow: true, children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
171
|
-
NavLink,
|
|
172
|
-
{
|
|
173
|
-
classNames: { root: classes.link },
|
|
174
|
-
label: child.label,
|
|
175
|
-
leftSection: child.icon,
|
|
176
|
-
"data-disabled": true
|
|
177
|
-
}
|
|
178
|
-
) }) }, child.key);
|
|
179
|
-
}
|
|
180
|
-
const childActive = Boolean(child.active);
|
|
181
|
-
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(NavLinkBody, { item: child, active: childActive }) }, child.key);
|
|
182
|
-
}) })
|
|
191
|
+
/* @__PURE__ */ jsx(Tooltip, { label: item.label, position: "right", withArrow: true, disabled: !collapsed, children: /* @__PURE__ */ jsx(Box, { className: classes.navItem, children: /* @__PURE__ */ jsx(NavLinkBody, { item, active, collapsed }) }) }),
|
|
192
|
+
/* @__PURE__ */ jsx(Stack, { gap: 0, className: classes.childList, children: item.children.map((child) => /* @__PURE__ */ jsx(ChildRow, { child }, child.key)) })
|
|
183
193
|
] }, item.key);
|
|
184
194
|
}
|
|
185
195
|
return /* @__PURE__ */ jsxs(
|
|
@@ -202,7 +212,7 @@ function NavItemRow({ item, collapsed }) {
|
|
|
202
212
|
onMouseLeave: scheduleClose,
|
|
203
213
|
onFocus: scheduleOpen,
|
|
204
214
|
onBlur: scheduleClose,
|
|
205
|
-
children: /* @__PURE__ */ jsx(NavLinkBody, { item, active })
|
|
215
|
+
children: /* @__PURE__ */ jsx(NavLinkBody, { item, active, collapsed })
|
|
206
216
|
}
|
|
207
217
|
) }) }),
|
|
208
218
|
/* @__PURE__ */ jsx(
|
|
@@ -214,21 +224,7 @@ function NavItemRow({ item, collapsed }) {
|
|
|
214
224
|
onMouseLeave: scheduleClose,
|
|
215
225
|
onFocus: scheduleOpen,
|
|
216
226
|
onBlur: scheduleClose,
|
|
217
|
-
children: /* @__PURE__ */ jsx(Stack, { gap: 0, children: item.children.map((child) => {
|
|
218
|
-
if (child.disabled) {
|
|
219
|
-
return /* @__PURE__ */ jsx(Tooltip, { label: "Coming soon", position: "right", withArrow: true, children: /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
|
|
220
|
-
NavLink,
|
|
221
|
-
{
|
|
222
|
-
classNames: { root: classes.link },
|
|
223
|
-
label: child.label,
|
|
224
|
-
leftSection: child.icon,
|
|
225
|
-
"data-disabled": true
|
|
226
|
-
}
|
|
227
|
-
) }) }, child.key);
|
|
228
|
-
}
|
|
229
|
-
const childActive = Boolean(child.active);
|
|
230
|
-
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(NavLinkBody, { item: child, active: childActive }) }, child.key);
|
|
231
|
-
}) })
|
|
227
|
+
children: /* @__PURE__ */ jsx(Stack, { gap: 0, children: item.children.map((child) => /* @__PURE__ */ jsx(ChildRow, { child }, child.key)) })
|
|
232
228
|
}
|
|
233
229
|
)
|
|
234
230
|
]
|