feat(motion): add interactive micro-feedback

This commit is contained in:
2026-03-20 17:44:20 +08:00
parent 142f4a399a
commit 36822f05e0
17 changed files with 144 additions and 62 deletions
+9 -9
View File
@@ -13,23 +13,23 @@ describe("motion contract", () => {
expect(motionModeDetails[defaultMotionMode].label).toBeTruthy();
});
it("sets default motion mode on the document root", () => {
setMotionMode("default");
it("sets interactive motion mode on the document root", () => {
setMotionMode("interactive");
expect(document.documentElement.dataset.motion).toBe("default");
expect(document.documentElement.dataset.motion).toBe("interactive");
});
it("sets reduced motion mode on the document root", () => {
setMotionMode("reduced");
it("sets static motion mode on the document root", () => {
setMotionMode("static");
expect(document.documentElement.dataset.motion).toBe("reduced");
expect(document.documentElement.dataset.motion).toBe("static");
});
it("supports explicit reduced mode on custom roots", () => {
it("supports explicit static mode on custom roots", () => {
const target = document.createElement("div");
setMotionMode("reduced", target);
setMotionMode("static", target);
expect(target.dataset.motion).toBe("reduced");
expect(target.dataset.motion).toBe("static");
});
});