@bouku/animate 0.0.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/dist/core/_.d.ts +3 -0
- package/dist/core/_.js +19 -0
- package/dist/core/configs.d.ts +136 -0
- package/dist/core/configs.js +65 -0
- package/dist/core/functions.d.ts +46 -0
- package/dist/core/functions.js +35 -0
- package/dist/core/types.d.ts +5 -0
- package/dist/core/types.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/dist/ui/animation/index.d.ts +14 -0
- package/dist/ui/animation/index.js +13 -0
- package/dist/ui/components/_.d.ts +1 -0
- package/dist/ui/components/_.js +2 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +18 -0
- package/package.json +36 -0
package/dist/core/_.d.ts
ADDED
package/dist/core/_.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./configs"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./functions"), exports);
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export declare const animations: {
|
|
2
|
+
readonly fadeUp: {
|
|
3
|
+
readonly initial: {
|
|
4
|
+
readonly opacity: 0;
|
|
5
|
+
readonly y: 30;
|
|
6
|
+
};
|
|
7
|
+
readonly animate: {
|
|
8
|
+
readonly opacity: 1;
|
|
9
|
+
readonly y: 0;
|
|
10
|
+
readonly transition: {
|
|
11
|
+
readonly duration: 0.3;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly fadeInAndOut: {
|
|
16
|
+
readonly initial: {
|
|
17
|
+
readonly opacity: 0;
|
|
18
|
+
};
|
|
19
|
+
readonly animate: {
|
|
20
|
+
readonly opacity: 1;
|
|
21
|
+
};
|
|
22
|
+
readonly exit: {
|
|
23
|
+
readonly opacity: 0;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly fadeUpAndOut: {
|
|
27
|
+
readonly initial: {
|
|
28
|
+
readonly opacity: 0;
|
|
29
|
+
readonly y: 10;
|
|
30
|
+
};
|
|
31
|
+
readonly animate: {
|
|
32
|
+
readonly opacity: 1;
|
|
33
|
+
readonly y: 0;
|
|
34
|
+
};
|
|
35
|
+
readonly exit: {
|
|
36
|
+
readonly opacity: 1;
|
|
37
|
+
readonly y: -10;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
readonly fadeUpAndOutSlow: {
|
|
41
|
+
readonly initial: {
|
|
42
|
+
readonly opacity: 0;
|
|
43
|
+
readonly y: "-100%";
|
|
44
|
+
};
|
|
45
|
+
readonly animate: {
|
|
46
|
+
readonly opacity: 1;
|
|
47
|
+
readonly y: 0;
|
|
48
|
+
readonly transition: {
|
|
49
|
+
readonly duration: 0.2;
|
|
50
|
+
readonly ease: "easeInOut";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly exit: {
|
|
54
|
+
readonly opacity: 0;
|
|
55
|
+
readonly y: "100%";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly fadeLeft: {
|
|
59
|
+
readonly initial: {
|
|
60
|
+
readonly x: -50;
|
|
61
|
+
readonly opacity: 0;
|
|
62
|
+
};
|
|
63
|
+
readonly animate: {
|
|
64
|
+
readonly x: 0;
|
|
65
|
+
readonly opacity: 1;
|
|
66
|
+
};
|
|
67
|
+
readonly exit: {
|
|
68
|
+
readonly x: 50;
|
|
69
|
+
readonly opacity: 0;
|
|
70
|
+
};
|
|
71
|
+
readonly transition: {
|
|
72
|
+
readonly duration: 0.4;
|
|
73
|
+
readonly ease: "easeOut";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly growUpAndOut: {
|
|
77
|
+
readonly initial: {
|
|
78
|
+
readonly opacity: 0;
|
|
79
|
+
readonly height: 0;
|
|
80
|
+
};
|
|
81
|
+
readonly animate: {
|
|
82
|
+
readonly opacity: 1;
|
|
83
|
+
readonly height: "auto";
|
|
84
|
+
};
|
|
85
|
+
readonly exit: {
|
|
86
|
+
readonly opacity: 0;
|
|
87
|
+
readonly height: 0;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly fadeStagger: {
|
|
91
|
+
readonly initial: {
|
|
92
|
+
readonly opacity: 0;
|
|
93
|
+
};
|
|
94
|
+
readonly animate: {
|
|
95
|
+
readonly opacity: 1;
|
|
96
|
+
readonly transition: {
|
|
97
|
+
readonly staggerChildren: 0.2;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
readonly fadeList: {
|
|
102
|
+
readonly hidden: {
|
|
103
|
+
readonly opacity: 0;
|
|
104
|
+
readonly x: -10;
|
|
105
|
+
readonly y: 5;
|
|
106
|
+
};
|
|
107
|
+
readonly visible: {
|
|
108
|
+
readonly opacity: 1;
|
|
109
|
+
readonly x: 0;
|
|
110
|
+
readonly y: 0;
|
|
111
|
+
readonly transition: {
|
|
112
|
+
readonly type: "spring";
|
|
113
|
+
readonly stiffness: 350;
|
|
114
|
+
readonly damping: 25;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly popUp: {
|
|
119
|
+
readonly initial: {
|
|
120
|
+
readonly opacity: 0;
|
|
121
|
+
readonly scale: 0.9;
|
|
122
|
+
};
|
|
123
|
+
readonly animate: {
|
|
124
|
+
readonly opacity: 1;
|
|
125
|
+
readonly scale: 1;
|
|
126
|
+
};
|
|
127
|
+
readonly exit: {
|
|
128
|
+
readonly opacity: 0;
|
|
129
|
+
readonly scale: 0.9;
|
|
130
|
+
};
|
|
131
|
+
readonly transition: {
|
|
132
|
+
readonly duration: 0.2;
|
|
133
|
+
readonly ease: readonly [0.23, 1, 0.32, 1];
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.animations = void 0;
|
|
4
|
+
exports.animations = {
|
|
5
|
+
"fadeUp": {
|
|
6
|
+
"initial": { "opacity": 0, "y": 30 },
|
|
7
|
+
"animate": {
|
|
8
|
+
"opacity": 1,
|
|
9
|
+
"y": 0,
|
|
10
|
+
"transition": { "duration": 0.3 }
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"fadeInAndOut": {
|
|
14
|
+
"initial": { "opacity": 0 },
|
|
15
|
+
"animate": { "opacity": 1 },
|
|
16
|
+
"exit": { "opacity": 0 }
|
|
17
|
+
},
|
|
18
|
+
"fadeUpAndOut": {
|
|
19
|
+
"initial": { "opacity": 0, "y": 10 },
|
|
20
|
+
"animate": { "opacity": 1, "y": 0 },
|
|
21
|
+
"exit": { "opacity": 1, "y": -10 }
|
|
22
|
+
},
|
|
23
|
+
"fadeUpAndOutSlow": {
|
|
24
|
+
"initial": { "opacity": 0, "y": "-100%" },
|
|
25
|
+
"animate": { "opacity": 1, "y": 0,
|
|
26
|
+
"transition": { "duration": 0.2, "ease": "easeInOut" }
|
|
27
|
+
},
|
|
28
|
+
"exit": { "opacity": 0, "y": "100%" }
|
|
29
|
+
},
|
|
30
|
+
"fadeLeft": {
|
|
31
|
+
"initial": { "x": -50, "opacity": 0 },
|
|
32
|
+
"animate": { "x": 0, "opacity": 1 },
|
|
33
|
+
"exit": { "x": 50, "opacity": 0 },
|
|
34
|
+
"transition": { "duration": 0.4, "ease": "easeOut" }
|
|
35
|
+
},
|
|
36
|
+
"growUpAndOut": {
|
|
37
|
+
"initial": { "opacity": 0, "height": 0 },
|
|
38
|
+
"animate": { "opacity": 1, "height": "auto" },
|
|
39
|
+
"exit": { "opacity": 0, "height": 0 }
|
|
40
|
+
},
|
|
41
|
+
"fadeStagger": {
|
|
42
|
+
"initial": { "opacity": 0 },
|
|
43
|
+
"animate": {
|
|
44
|
+
"opacity": 1,
|
|
45
|
+
"transition": { "staggerChildren": 0.2 }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"fadeList": {
|
|
49
|
+
"hidden": { "opacity": 0, "x": -10, "y": 5 },
|
|
50
|
+
"visible": {
|
|
51
|
+
"opacity": 1, "x": 0, "y": 0,
|
|
52
|
+
"transition": {
|
|
53
|
+
"type": "spring",
|
|
54
|
+
"stiffness": 350,
|
|
55
|
+
"damping": 25
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"popUp": {
|
|
60
|
+
"initial": { "opacity": 0, "scale": 0.9 },
|
|
61
|
+
"animate": { "opacity": 1, "scale": 1 },
|
|
62
|
+
"exit": { "opacity": 0, "scale": 0.9 },
|
|
63
|
+
"transition": { "duration": 0.2, "ease": [0.23, 1, 0.32, 1] }
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { VariantConfig } from "./types";
|
|
2
|
+
export declare function mergeVariants(...variants: VariantConfig[]): VariantConfig;
|
|
3
|
+
export declare const opacity: (x?: number) => {
|
|
4
|
+
initial: {
|
|
5
|
+
opacity: number;
|
|
6
|
+
};
|
|
7
|
+
animate: {
|
|
8
|
+
opacity: number;
|
|
9
|
+
};
|
|
10
|
+
exit: {
|
|
11
|
+
opacity: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const slideX: (x?: number) => {
|
|
15
|
+
initial: {
|
|
16
|
+
x: number;
|
|
17
|
+
};
|
|
18
|
+
animate: {
|
|
19
|
+
x: number;
|
|
20
|
+
};
|
|
21
|
+
exit: {
|
|
22
|
+
x: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare const slideY: (y?: number) => {
|
|
26
|
+
initial: {
|
|
27
|
+
y: number;
|
|
28
|
+
};
|
|
29
|
+
animate: {
|
|
30
|
+
y: number;
|
|
31
|
+
};
|
|
32
|
+
exit: {
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export declare const scale: (x?: number) => {
|
|
37
|
+
initial: {
|
|
38
|
+
scale: number;
|
|
39
|
+
};
|
|
40
|
+
animate: {
|
|
41
|
+
scale: number;
|
|
42
|
+
};
|
|
43
|
+
exit: {
|
|
44
|
+
scale: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.scale = exports.slideY = exports.slideX = exports.opacity = void 0;
|
|
4
|
+
exports.mergeVariants = mergeVariants;
|
|
5
|
+
function mergeVariants(...variants) {
|
|
6
|
+
return variants.reduce((acc, v) => ({
|
|
7
|
+
initial: { ...acc.initial, ...v.initial },
|
|
8
|
+
animate: { ...acc.animate, ...v.animate },
|
|
9
|
+
exit: { ...acc.exit, ...v.exit },
|
|
10
|
+
}), { initial: {}, animate: {}, exit: {} });
|
|
11
|
+
}
|
|
12
|
+
const opacity = (x = 1) => ({
|
|
13
|
+
initial: { opacity: 0 },
|
|
14
|
+
animate: { opacity: x },
|
|
15
|
+
exit: { opacity: 0 }
|
|
16
|
+
});
|
|
17
|
+
exports.opacity = opacity;
|
|
18
|
+
const slideX = (x = 5) => ({
|
|
19
|
+
initial: { x: x },
|
|
20
|
+
animate: { x: 0 },
|
|
21
|
+
exit: { x: -x }
|
|
22
|
+
});
|
|
23
|
+
exports.slideX = slideX;
|
|
24
|
+
const slideY = (y = 5) => ({
|
|
25
|
+
initial: { y: y },
|
|
26
|
+
animate: { y: 0 },
|
|
27
|
+
exit: { y: -y }
|
|
28
|
+
});
|
|
29
|
+
exports.slideY = slideY;
|
|
30
|
+
const scale = (x = 1) => ({
|
|
31
|
+
initial: { scale: 0 },
|
|
32
|
+
animate: { scale: x },
|
|
33
|
+
exit: { scale: 0 }
|
|
34
|
+
});
|
|
35
|
+
exports.scale = scale;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./core/_"), exports);
|
|
18
|
+
__exportStar(require("./ui"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { VariantConfig } from "../../core/types";
|
|
3
|
+
export type Props = {
|
|
4
|
+
variants?: VariantConfig[];
|
|
5
|
+
direction?: "horizontal" | "vertical";
|
|
6
|
+
interval?: number;
|
|
7
|
+
duration?: number;
|
|
8
|
+
style?: string;
|
|
9
|
+
layout?: boolean;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare function Animation({ variants, style, direction, interval, duration, ...props }: Props): import("react").JSX.Element;
|
|
14
|
+
export { AnimatePresence } from "framer-motion";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnimatePresence = void 0;
|
|
4
|
+
exports.Animation = Animation;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const framer_motion_1 = require("framer-motion");
|
|
7
|
+
const functions_1 = require("../../core/functions");
|
|
8
|
+
const style_1 = require("@bouko/style");
|
|
9
|
+
function Animation({ variants = [(0, functions_1.opacity)()], style, direction = "horizontal", interval = 3000, duration = 0.3, ...props }) {
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(framer_motion_1.motion.div, { className: (0, style_1.cn)("w-full", style), transition: { duration: duration }, ...(0, functions_1.mergeVariants)(...variants), ...props }));
|
|
11
|
+
}
|
|
12
|
+
var framer_motion_2 = require("framer-motion");
|
|
13
|
+
Object.defineProperty(exports, "AnimatePresence", { enumerable: true, get: function () { return framer_motion_2.AnimatePresence; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./animation"), exports);
|
|
18
|
+
__exportStar(require("./components/_"), exports);
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bouku/animate",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"author": "",
|
|
14
|
+
"description": "",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./dist/index.js",
|
|
17
|
+
"./styles.css": "./dist/styles.css"
|
|
18
|
+
},
|
|
19
|
+
"engines": {},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": "^19.1.1"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@bouko/style": "^0.2.1",
|
|
28
|
+
"framer-motion": "^12.42.2"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^24.3.1",
|
|
32
|
+
"@types/react": "^19.1.10",
|
|
33
|
+
"react": "^19.1.1",
|
|
34
|
+
"typescript": "^5.9.2"
|
|
35
|
+
}
|
|
36
|
+
}
|