@stackvibe-studio/motion 0.1.0 → 0.2.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/README.md +35 -0
- package/dist/components/fade-in.d.ts +8 -0
- package/dist/index.cjs +38 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +38 -11
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @stackvibe-studio/motion
|
|
2
|
+
|
|
3
|
+
Motion primitives and reveal patterns for premium product experiences.
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
|
|
7
|
+
- Scroll-aware reveal sections
|
|
8
|
+
- Spotlight cards with soft glow lighting
|
|
9
|
+
- Clean text reveal utilities
|
|
10
|
+
- New in v0.2.0: FadeInSection for storytelling and landing pages
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @stackvibe-studio/motion
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { FadeInSection, SpotlightCard } from '@stackvibe-studio/motion';
|
|
22
|
+
|
|
23
|
+
export function Example() {
|
|
24
|
+
return (
|
|
25
|
+
<FadeInSection>
|
|
26
|
+
<SpotlightCard className="p-6">Premium motion without the bloat.</SpotlightCard>
|
|
27
|
+
</FadeInSection>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Related packages
|
|
33
|
+
|
|
34
|
+
- @stackvibe-studio/ui
|
|
35
|
+
- @stackvibe-studio/three
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLMotionProps } from 'motion/react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface FadeInSectionProps extends HTMLMotionProps<'section'> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
delay?: number;
|
|
6
|
+
y?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function FadeInSection({ children, delay, y, className, ...props }: FadeInSectionProps): import("react").JSX.Element;
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -20,14 +21,39 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
21
|
// src/index.ts
|
|
21
22
|
var index_exports = {};
|
|
22
23
|
__export(index_exports, {
|
|
24
|
+
FadeInSection: () => FadeInSection,
|
|
23
25
|
SpotlightCard: () => SpotlightCard,
|
|
24
26
|
TextReveal: () => TextReveal
|
|
25
27
|
});
|
|
26
28
|
module.exports = __toCommonJS(index_exports);
|
|
27
29
|
|
|
28
|
-
// src/components/
|
|
30
|
+
// src/components/fade-in.tsx
|
|
29
31
|
var import_react = require("motion/react");
|
|
30
32
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
33
|
+
function FadeInSection({
|
|
34
|
+
children,
|
|
35
|
+
delay = 0,
|
|
36
|
+
y = 24,
|
|
37
|
+
className = "",
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
41
|
+
import_react.motion.section,
|
|
42
|
+
{
|
|
43
|
+
...props,
|
|
44
|
+
initial: { opacity: 0, y },
|
|
45
|
+
whileInView: { opacity: 1, y: 0 },
|
|
46
|
+
viewport: { once: true, amount: 0.2 },
|
|
47
|
+
transition: { duration: 0.5, delay, ease: "easeOut" },
|
|
48
|
+
className,
|
|
49
|
+
children
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/components/spotlight-card.tsx
|
|
55
|
+
var import_react2 = require("motion/react");
|
|
56
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
31
57
|
function SpotlightCard({
|
|
32
58
|
children,
|
|
33
59
|
glowColor = "#8b5cf6",
|
|
@@ -36,8 +62,8 @@ function SpotlightCard({
|
|
|
36
62
|
className = "",
|
|
37
63
|
...props
|
|
38
64
|
}) {
|
|
39
|
-
return /* @__PURE__ */ (0,
|
|
40
|
-
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
66
|
+
import_react2.motion.div,
|
|
41
67
|
{
|
|
42
68
|
...props,
|
|
43
69
|
whileHover: { scale: 1.01, y: -4 },
|
|
@@ -48,8 +74,8 @@ function SpotlightCard({
|
|
|
48
74
|
background: "linear-gradient(135deg, rgba(15,23,42,0.78), rgba(15,23,42,0.42))"
|
|
49
75
|
},
|
|
50
76
|
children: [
|
|
51
|
-
/* @__PURE__ */ (0,
|
|
52
|
-
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
78
|
+
import_react2.motion.div,
|
|
53
79
|
{
|
|
54
80
|
"aria-hidden": "true",
|
|
55
81
|
className: "pointer-events-none absolute inset-0 opacity-90",
|
|
@@ -60,33 +86,34 @@ function SpotlightCard({
|
|
|
60
86
|
}
|
|
61
87
|
}
|
|
62
88
|
),
|
|
63
|
-
/* @__PURE__ */ (0,
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "relative z-10", children })
|
|
64
90
|
]
|
|
65
91
|
}
|
|
66
92
|
);
|
|
67
93
|
}
|
|
68
94
|
|
|
69
95
|
// src/components/text-reveal.tsx
|
|
70
|
-
var
|
|
71
|
-
var
|
|
96
|
+
var import_react3 = require("motion/react");
|
|
97
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
72
98
|
function TextReveal({
|
|
73
99
|
as: Component = "h1",
|
|
74
100
|
children,
|
|
75
101
|
className = "",
|
|
76
102
|
...props
|
|
77
103
|
}) {
|
|
78
|
-
return /* @__PURE__ */ (0,
|
|
79
|
-
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
105
|
+
import_react3.motion.div,
|
|
80
106
|
{
|
|
81
107
|
initial: { opacity: 0, y: 18 },
|
|
82
108
|
animate: { opacity: 1, y: 0 },
|
|
83
109
|
transition: { duration: 0.5, ease: "easeOut" },
|
|
84
|
-
children: /* @__PURE__ */ (0,
|
|
110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Component, { ...props, className, children })
|
|
85
111
|
}
|
|
86
112
|
);
|
|
87
113
|
}
|
|
88
114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
89
115
|
0 && (module.exports = {
|
|
116
|
+
FadeInSection,
|
|
90
117
|
SpotlightCard,
|
|
91
118
|
TextReveal
|
|
92
119
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/fade-in.tsx
|
|
2
4
|
import { motion } from "motion/react";
|
|
3
|
-
import { jsx
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
function FadeInSection({
|
|
7
|
+
children,
|
|
8
|
+
delay = 0,
|
|
9
|
+
y = 24,
|
|
10
|
+
className = "",
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
motion.section,
|
|
15
|
+
{
|
|
16
|
+
...props,
|
|
17
|
+
initial: { opacity: 0, y },
|
|
18
|
+
whileInView: { opacity: 1, y: 0 },
|
|
19
|
+
viewport: { once: true, amount: 0.2 },
|
|
20
|
+
transition: { duration: 0.5, delay, ease: "easeOut" },
|
|
21
|
+
className,
|
|
22
|
+
children
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/components/spotlight-card.tsx
|
|
28
|
+
import { motion as motion2 } from "motion/react";
|
|
29
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
4
30
|
function SpotlightCard({
|
|
5
31
|
children,
|
|
6
32
|
glowColor = "#8b5cf6",
|
|
@@ -10,7 +36,7 @@ function SpotlightCard({
|
|
|
10
36
|
...props
|
|
11
37
|
}) {
|
|
12
38
|
return /* @__PURE__ */ jsxs(
|
|
13
|
-
|
|
39
|
+
motion2.div,
|
|
14
40
|
{
|
|
15
41
|
...props,
|
|
16
42
|
whileHover: { scale: 1.01, y: -4 },
|
|
@@ -21,8 +47,8 @@ function SpotlightCard({
|
|
|
21
47
|
background: "linear-gradient(135deg, rgba(15,23,42,0.78), rgba(15,23,42,0.42))"
|
|
22
48
|
},
|
|
23
49
|
children: [
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
-
|
|
50
|
+
/* @__PURE__ */ jsx2(
|
|
51
|
+
motion2.div,
|
|
26
52
|
{
|
|
27
53
|
"aria-hidden": "true",
|
|
28
54
|
className: "pointer-events-none absolute inset-0 opacity-90",
|
|
@@ -33,32 +59,33 @@ function SpotlightCard({
|
|
|
33
59
|
}
|
|
34
60
|
}
|
|
35
61
|
),
|
|
36
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ jsx2("div", { className: "relative z-10", children })
|
|
37
63
|
]
|
|
38
64
|
}
|
|
39
65
|
);
|
|
40
66
|
}
|
|
41
67
|
|
|
42
68
|
// src/components/text-reveal.tsx
|
|
43
|
-
import { motion as
|
|
44
|
-
import { jsx as
|
|
69
|
+
import { motion as motion3 } from "motion/react";
|
|
70
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
45
71
|
function TextReveal({
|
|
46
72
|
as: Component = "h1",
|
|
47
73
|
children,
|
|
48
74
|
className = "",
|
|
49
75
|
...props
|
|
50
76
|
}) {
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
77
|
+
return /* @__PURE__ */ jsx3(
|
|
78
|
+
motion3.div,
|
|
53
79
|
{
|
|
54
80
|
initial: { opacity: 0, y: 18 },
|
|
55
81
|
animate: { opacity: 1, y: 0 },
|
|
56
82
|
transition: { duration: 0.5, ease: "easeOut" },
|
|
57
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ jsx3(Component, { ...props, className, children })
|
|
58
84
|
}
|
|
59
85
|
);
|
|
60
86
|
}
|
|
61
87
|
export {
|
|
88
|
+
FadeInSection,
|
|
62
89
|
SpotlightCard,
|
|
63
90
|
TextReveal
|
|
64
91
|
};
|