fix: enforce handbook scrollbar and reduced motion contracts

This commit is contained in:
maoyingjie
2026-10-27 21:10:51 +08:00
parent b1344d8a4c
commit 202e3a5b5d
23 changed files with 702 additions and 23 deletions
+14
View File
@@ -17,6 +17,20 @@ for (const id of process.argv.slice(2)) {
assert(css.includes(token), `Missing CSS ${token}`);
for (const name of spec.absent ?? [])
assert(!(name in lib), `Private component exposed: ${name}`);
if (id === "handbook-styles") {
const extended = lib.tv({
extend: lib.buttonVariants,
variants: { intent: { quiet: "audit-quiet" } },
});
const classes = extended({ intent: "quiet", size: "sm" });
assert(
classes.includes("hv-button--sm") && classes.includes("audit-quiet"),
);
// This proves final CSS packaging; computed style and lifecycle assertions
// run separately in apps/playground/src/HandbookLab.vue.
for (const mode of ["none", "default", "thin"])
assert(new RegExp(`\\[data-scrollbar=["']?${mode}["']?\\]`).test(css));
}
if (id === "b02-pickers") {
assert(
lib