Add harness workflow and Material showcase design system

This commit is contained in:
2026-03-23 17:30:30 +08:00
parent c570431dba
commit 5d02bf9df4
46 changed files with 3343 additions and 1068 deletions
+6
View File
@@ -34,6 +34,12 @@ export const motionRecipes = {
overlayExit: "motion-overlay-exit",
exitFade: "motion-exit-fade",
exitDrop: "motion-exit-drop",
float: "motion-float",
floatDelayed: "motion-float-delayed",
floatHero: "motion-float-hero",
breathe: "motion-breathe",
drift: "motion-drift",
glimmer: "motion-glimmer",
ring: "motion-ring"
} as const;
+4 -4
View File
@@ -9,16 +9,16 @@ describe("skin contract", () => {
});
it("sets the document root skin when no target element is provided", () => {
setSkin("glass");
setSkin("material");
expect(document.documentElement.dataset.skin).toBe("glass");
expect(document.documentElement.dataset.skin).toBe("material");
});
it("sets the provided target element instead of the document root", () => {
const target = document.createElement("div");
setSkin("pixel", target);
setSkin("material", target);
expect(target.dataset.skin).toBe("pixel");
expect(target.dataset.skin).toBe("material");
});
});
+5 -13
View File
@@ -1,20 +1,12 @@
export const skinNames = ["minimal", "glass", "pixel"] as const;
export const skinNames = ["material"] as const;
export type SkinName = (typeof skinNames)[number];
export const defaultSkin: SkinName = "minimal";
export const defaultSkin: SkinName = "material";
export const skinDetails = {
minimal: {
label: "Minimal",
note: "Restrained surfaces and low-ornament defaults"
},
glass: {
label: "Glass",
note: "Translucent layers, brighter edges, and blurred panels"
},
pixel: {
label: "Pixel",
note: "Hard edges, crisp borders, and stepped shadows"
material: {
label: "Material",
note: "One tonal, rounded, dynamic-color-first component language"
}
} as const satisfies Record<SkinName, { label: string; note: string }>;