@iquji-web/web-motion 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/index.d.ts +67 -0
- package/dist/index.js +62 -0
- package/package.json +34 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Iquji contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Web motion
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@iquji-web/web-motion` 只提供通用 motion 能力,JavaScript、类型声明、必要样式及功能测试随源码交付。
|
|
4
|
+
|
|
5
|
+
安装使用本目录锁文件,运行 `bun install --frozen-lockfile` 和 `bun run check`。正式入口只导出 `dist` 中的 JavaScript、类型声明,不要求消费者编译本包源码。
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { m } from "framer-motion";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export declare const iqujiMotionDuration: {
|
|
4
|
+
readonly control: 0.14;
|
|
5
|
+
readonly overlay: 0.19;
|
|
6
|
+
readonly route: 0.24;
|
|
7
|
+
};
|
|
8
|
+
export declare const iqujiMotionEasing: {
|
|
9
|
+
readonly standard: readonly [0.2, 0, 0, 1];
|
|
10
|
+
readonly enter: readonly [0, 0, 0, 1];
|
|
11
|
+
readonly exit: readonly [0.3, 0, 1, 1];
|
|
12
|
+
};
|
|
13
|
+
export declare const iqujiMotionPresets: {
|
|
14
|
+
readonly control: {
|
|
15
|
+
readonly duration: 0.14;
|
|
16
|
+
readonly ease: readonly [0.2, 0, 0, 1];
|
|
17
|
+
};
|
|
18
|
+
readonly overlay: {
|
|
19
|
+
readonly duration: 0.19;
|
|
20
|
+
readonly ease: readonly [0, 0, 0, 1];
|
|
21
|
+
};
|
|
22
|
+
readonly route: {
|
|
23
|
+
readonly duration: 0.24;
|
|
24
|
+
readonly ease: readonly [0, 0, 0, 1];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const iqujiMotionVariants: {
|
|
28
|
+
readonly route: {
|
|
29
|
+
readonly initial: {
|
|
30
|
+
readonly opacity: 1;
|
|
31
|
+
readonly y: 4;
|
|
32
|
+
};
|
|
33
|
+
readonly enter: {
|
|
34
|
+
readonly opacity: 1;
|
|
35
|
+
readonly y: 0;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly overlay: {
|
|
39
|
+
readonly initial: {
|
|
40
|
+
readonly opacity: 0;
|
|
41
|
+
readonly scale: 0.99;
|
|
42
|
+
};
|
|
43
|
+
readonly enter: {
|
|
44
|
+
readonly opacity: 1;
|
|
45
|
+
readonly scale: 1;
|
|
46
|
+
};
|
|
47
|
+
readonly exit: {
|
|
48
|
+
readonly opacity: 0;
|
|
49
|
+
readonly scale: 0.99;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
readonly item: {
|
|
53
|
+
readonly initial: {
|
|
54
|
+
readonly opacity: 0;
|
|
55
|
+
readonly y: 3;
|
|
56
|
+
};
|
|
57
|
+
readonly enter: {
|
|
58
|
+
readonly opacity: 1;
|
|
59
|
+
readonly y: 0;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export declare const IqujiMotion: typeof m;
|
|
64
|
+
export type IqujiMotionProviderProps = {
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
};
|
|
67
|
+
export declare function IqujiMotionProvider({ children }: IqujiMotionProviderProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// src/index.tsx
|
|
2
|
+
import { domAnimation, LazyMotion, MotionConfig, m } from "framer-motion";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var iqujiMotionDuration = {
|
|
5
|
+
control: 0.14,
|
|
6
|
+
overlay: 0.19,
|
|
7
|
+
route: 0.24
|
|
8
|
+
};
|
|
9
|
+
var iqujiMotionEasing = {
|
|
10
|
+
standard: [0.2, 0, 0, 1],
|
|
11
|
+
enter: [0, 0, 0, 1],
|
|
12
|
+
exit: [0.3, 0, 1, 1]
|
|
13
|
+
};
|
|
14
|
+
var iqujiMotionPresets = {
|
|
15
|
+
control: {
|
|
16
|
+
duration: iqujiMotionDuration.control,
|
|
17
|
+
ease: iqujiMotionEasing.standard
|
|
18
|
+
},
|
|
19
|
+
overlay: {
|
|
20
|
+
duration: iqujiMotionDuration.overlay,
|
|
21
|
+
ease: iqujiMotionEasing.enter
|
|
22
|
+
},
|
|
23
|
+
route: {
|
|
24
|
+
duration: iqujiMotionDuration.route,
|
|
25
|
+
ease: iqujiMotionEasing.enter
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var iqujiMotionVariants = {
|
|
29
|
+
route: {
|
|
30
|
+
initial: { opacity: 1, y: 4 },
|
|
31
|
+
enter: { opacity: 1, y: 0 }
|
|
32
|
+
},
|
|
33
|
+
overlay: {
|
|
34
|
+
initial: { opacity: 0, scale: 0.99 },
|
|
35
|
+
enter: { opacity: 1, scale: 1 },
|
|
36
|
+
exit: { opacity: 0, scale: 0.99 }
|
|
37
|
+
},
|
|
38
|
+
item: {
|
|
39
|
+
initial: { opacity: 0, y: 3 },
|
|
40
|
+
enter: { opacity: 1, y: 0 }
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var IqujiMotion = m;
|
|
44
|
+
function IqujiMotionProvider({ children }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(LazyMotion, {
|
|
46
|
+
features: domAnimation,
|
|
47
|
+
strict: true,
|
|
48
|
+
children: /* @__PURE__ */ jsx(MotionConfig, {
|
|
49
|
+
reducedMotion: "user",
|
|
50
|
+
transition: iqujiMotionPresets.control,
|
|
51
|
+
children
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
iqujiMotionVariants,
|
|
57
|
+
iqujiMotionPresets,
|
|
58
|
+
iqujiMotionEasing,
|
|
59
|
+
iqujiMotionDuration,
|
|
60
|
+
IqujiMotionProvider,
|
|
61
|
+
IqujiMotion
|
|
62
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iquji-web/web-motion",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"README.md",
|
|
9
|
+
"LICENSE"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": "19.2.4",
|
|
20
|
+
"framer-motion": "12.34.0"
|
|
21
|
+
},
|
|
22
|
+
"description": "React 通用动效与 reduced-motion 支持。",
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/haydardsx/iquji-community-web.git",
|
|
30
|
+
"directory": "motion"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://community-web.iquji.com",
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/haydardsx/iquji-community-web/issues"
|
|
35
|
+
}
|
|
36
|
+
}
|