@stackvibe-studio/motion 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +34 -2
- package/dist/components/fade-in.d.ts +8 -0
- package/dist/components/spotlight-card.d.ts +8 -0
- package/dist/components/text-reveal.d.ts +5 -0
- package/dist/index.cjs +119 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +91 -0
- package/package.json +48 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 StackVibe
|
|
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,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @stackvibe-studio/motion
|
|
2
2
|
|
|
3
|
-
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLMotionProps } from 'motion/react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface SpotlightCardProps extends HTMLMotionProps<'div'> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
glowColor?: string;
|
|
6
|
+
intensity?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function SpotlightCard({ children, glowColor, intensity, style, className, ...props }: SpotlightCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface TextRevealProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
3
|
+
as?: 'h1' | 'h2' | 'h3' | 'p' | 'span';
|
|
4
|
+
}
|
|
5
|
+
export declare function TextReveal({ as: Component, children, className, ...props }: TextRevealProps): import("react").JSX.Element;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var index_exports = {};
|
|
23
|
+
__export(index_exports, {
|
|
24
|
+
FadeInSection: () => FadeInSection,
|
|
25
|
+
SpotlightCard: () => SpotlightCard,
|
|
26
|
+
TextReveal: () => TextReveal
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
|
|
30
|
+
// src/components/fade-in.tsx
|
|
31
|
+
var import_react = require("motion/react");
|
|
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");
|
|
57
|
+
function SpotlightCard({
|
|
58
|
+
children,
|
|
59
|
+
glowColor = "#8b5cf6",
|
|
60
|
+
intensity = 0.6,
|
|
61
|
+
style,
|
|
62
|
+
className = "",
|
|
63
|
+
...props
|
|
64
|
+
}) {
|
|
65
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
66
|
+
import_react2.motion.div,
|
|
67
|
+
{
|
|
68
|
+
...props,
|
|
69
|
+
whileHover: { scale: 1.01, y: -4 },
|
|
70
|
+
transition: { type: "spring", stiffness: 180, damping: 18 },
|
|
71
|
+
className: ["relative overflow-hidden rounded-3xl", className].join(" "),
|
|
72
|
+
style: {
|
|
73
|
+
...style,
|
|
74
|
+
background: "linear-gradient(135deg, rgba(15,23,42,0.78), rgba(15,23,42,0.42))"
|
|
75
|
+
},
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
78
|
+
import_react2.motion.div,
|
|
79
|
+
{
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
className: "pointer-events-none absolute inset-0 opacity-90",
|
|
82
|
+
style: {
|
|
83
|
+
background: `radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), ${glowColor}${Math.round(
|
|
84
|
+
intensity * 255
|
|
85
|
+
).toString(16).padStart(2, "0")}, rgba(255,255,255,0) 38%)`
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "relative z-10", children })
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// src/components/text-reveal.tsx
|
|
96
|
+
var import_react3 = require("motion/react");
|
|
97
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
98
|
+
function TextReveal({
|
|
99
|
+
as: Component = "h1",
|
|
100
|
+
children,
|
|
101
|
+
className = "",
|
|
102
|
+
...props
|
|
103
|
+
}) {
|
|
104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
105
|
+
import_react3.motion.div,
|
|
106
|
+
{
|
|
107
|
+
initial: { opacity: 0, y: 18 },
|
|
108
|
+
animate: { opacity: 1, y: 0 },
|
|
109
|
+
transition: { duration: 0.5, ease: "easeOut" },
|
|
110
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Component, { ...props, className, children })
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
+
0 && (module.exports = {
|
|
116
|
+
FadeInSection,
|
|
117
|
+
SpotlightCard,
|
|
118
|
+
TextReveal
|
|
119
|
+
});
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/fade-in.tsx
|
|
4
|
+
import { motion } from "motion/react";
|
|
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";
|
|
30
|
+
function SpotlightCard({
|
|
31
|
+
children,
|
|
32
|
+
glowColor = "#8b5cf6",
|
|
33
|
+
intensity = 0.6,
|
|
34
|
+
style,
|
|
35
|
+
className = "",
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ jsxs(
|
|
39
|
+
motion2.div,
|
|
40
|
+
{
|
|
41
|
+
...props,
|
|
42
|
+
whileHover: { scale: 1.01, y: -4 },
|
|
43
|
+
transition: { type: "spring", stiffness: 180, damping: 18 },
|
|
44
|
+
className: ["relative overflow-hidden rounded-3xl", className].join(" "),
|
|
45
|
+
style: {
|
|
46
|
+
...style,
|
|
47
|
+
background: "linear-gradient(135deg, rgba(15,23,42,0.78), rgba(15,23,42,0.42))"
|
|
48
|
+
},
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx2(
|
|
51
|
+
motion2.div,
|
|
52
|
+
{
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: "pointer-events-none absolute inset-0 opacity-90",
|
|
55
|
+
style: {
|
|
56
|
+
background: `radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 50%), ${glowColor}${Math.round(
|
|
57
|
+
intensity * 255
|
|
58
|
+
).toString(16).padStart(2, "0")}, rgba(255,255,255,0) 38%)`
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ jsx2("div", { className: "relative z-10", children })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/components/text-reveal.tsx
|
|
69
|
+
import { motion as motion3 } from "motion/react";
|
|
70
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
71
|
+
function TextReveal({
|
|
72
|
+
as: Component = "h1",
|
|
73
|
+
children,
|
|
74
|
+
className = "",
|
|
75
|
+
...props
|
|
76
|
+
}) {
|
|
77
|
+
return /* @__PURE__ */ jsx3(
|
|
78
|
+
motion3.div,
|
|
79
|
+
{
|
|
80
|
+
initial: { opacity: 0, y: 18 },
|
|
81
|
+
animate: { opacity: 1, y: 0 },
|
|
82
|
+
transition: { duration: 0.5, ease: "easeOut" },
|
|
83
|
+
children: /* @__PURE__ */ jsx3(Component, { ...props, className, children })
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
FadeInSection,
|
|
89
|
+
SpotlightCard,
|
|
90
|
+
TextReveal
|
|
91
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackvibe-studio/motion",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Motion primitives for StackVibe UI.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/StackVibe-Studio/stackvibe-ui.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://stackvibe-studio.github.io/stackvibe-ui/",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/StackVibe-Studio/stackvibe-ui/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./package.json": "./package.json"
|
|
24
|
+
},
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public",
|
|
28
|
+
"registry": "https://registry.npmjs.org/"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": ">=18.0.0",
|
|
35
|
+
"react-dom": ">=18.0.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"gsap": "^3.13.1",
|
|
39
|
+
"motion": "^12.23.12"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/react": "^19.0.0",
|
|
43
|
+
"@types/react-dom": "^19.0.0",
|
|
44
|
+
"tsup": "^8.1.0",
|
|
45
|
+
"typescript": "^5.7.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsup src/index.ts --format esm,cjs --clean && tsc --project tsconfig.json --emitDeclarationOnly",
|
|
49
|
+
"typecheck": "tsc --noEmit"
|
|
50
|
+
}
|
|
6
51
|
}
|