@pelatform/ui 1.6.0 → 2.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/README.md +360 -5
- package/dist/animation.d.ts +6 -379
- package/dist/animation.js +2 -1750
- package/dist/base.d.ts +1 -651
- package/dist/base.js +2 -5554
- package/dist/components.d.ts +1 -2944
- package/dist/components.js +2 -2719
- package/dist/css/color/gray.css +105 -0
- package/dist/css/color/neutral.css +105 -0
- package/dist/css/color/slate.css +105 -0
- package/dist/css/color/stone.css +105 -0
- package/dist/css/color/zinc.css +105 -0
- package/dist/css/styles/style-lyra.css +1335 -0
- package/dist/css/styles/style-maia.css +1360 -0
- package/dist/css/styles/style-mira.css +1362 -0
- package/dist/css/styles/style-nova.css +1360 -0
- package/dist/css/styles/style-vega.css +1356 -0
- package/dist/hooks.d.ts +1 -1172
- package/dist/hooks.js +2 -664
- package/dist/index.d.ts +1 -318
- package/dist/index.js +3 -229
- package/dist/radix.d.ts +1 -0
- package/dist/radix.js +4 -0
- package/dist/style.css +2 -0
- package/package.json +82 -136
- package/LICENSE +0 -21
- package/css/components/apexcharts.css +0 -101
- package/css/components/book.css +0 -19
- package/css/components/extra.css +0 -12
- package/css/components/image-input.css +0 -51
- package/css/components/leaflet.css +0 -25
- package/css/components/patterns.css +0 -34
- package/css/components/rating.css +0 -89
- package/css/components/scrollable.css +0 -118
- package/css/components/theme-transition.css +0 -51
- package/css/theme.css +0 -238
- package/dist/animation.cjs +0 -1752
- package/dist/animation.d.cts +0 -379
- package/dist/aria.cjs +0 -139
- package/dist/aria.d.cts +0 -31
- package/dist/aria.d.ts +0 -31
- package/dist/aria.js +0 -139
- package/dist/badge-BtI4BMea.d.cts +0 -33
- package/dist/badge-BtI4BMea.d.ts +0 -33
- package/dist/base.cjs +0 -5556
- package/dist/base.d.cts +0 -651
- package/dist/chunk-3N75YA6Q.cjs +0 -60
- package/dist/chunk-7472NIIL.cjs +0 -40
- package/dist/chunk-BXUKTDPN.cjs +0 -576
- package/dist/chunk-CD2BCCQU.js +0 -180
- package/dist/chunk-CJXIPSTG.cjs +0 -10
- package/dist/chunk-CTHRAJQZ.js +0 -1522
- package/dist/chunk-D373YKDA.js +0 -196
- package/dist/chunk-EZW5GNS4.js +0 -6
- package/dist/chunk-HILACSFA.cjs +0 -1522
- package/dist/chunk-HR3R6KKM.js +0 -40
- package/dist/chunk-HW52LCWN.js +0 -22
- package/dist/chunk-I46SELBA.cjs +0 -22
- package/dist/chunk-J4JGE3U5.cjs +0 -180
- package/dist/chunk-RQHJBTEU.js +0 -10
- package/dist/chunk-SK6SSJHC.js +0 -9
- package/dist/chunk-T74DBLYY.js +0 -60
- package/dist/chunk-TB6DU23O.js +0 -576
- package/dist/chunk-UP53DCYH.cjs +0 -6
- package/dist/chunk-ZBO5IAMA.cjs +0 -196
- package/dist/chunk-ZDR3OZ7Z.cjs +0 -9
- package/dist/colors-CUDWvz1g.d.cts +0 -42
- package/dist/colors-CUDWvz1g.d.ts +0 -42
- package/dist/components-CidsRcc3.d.cts +0 -46
- package/dist/components-CidsRcc3.d.ts +0 -46
- package/dist/components.cjs +0 -2721
- package/dist/components.d.cts +0 -2944
- package/dist/default.cjs +0 -8931
- package/dist/default.d.cts +0 -1322
- package/dist/default.d.ts +0 -1322
- package/dist/default.js +0 -8931
- package/dist/hooks.cjs +0 -666
- package/dist/hooks.d.cts +0 -1172
- package/dist/index.cjs +0 -230
- package/dist/index.d.cts +0 -318
- package/dist/input-AwYIskrX.d.cts +0 -22
- package/dist/input-AwYIskrX.d.ts +0 -22
- package/dist/menu-GmSRfRGB.d.cts +0 -43
- package/dist/menu-GmSRfRGB.d.ts +0 -43
- package/dist/metafile-cjs.json +0 -1
- package/dist/metafile-esm.json +0 -1
- package/dist/re-export/cva.cjs +0 -6
- package/dist/re-export/cva.d.cts +0 -10
- package/dist/re-export/cva.d.ts +0 -10
- package/dist/re-export/cva.js +0 -6
- package/dist/re-export/motion.cjs +0 -2
- package/dist/re-export/motion.d.cts +0 -1
- package/dist/re-export/motion.d.ts +0 -1
- package/dist/re-export/motion.js +0 -2
- package/dist/re-export/next-themes.cjs +0 -2
- package/dist/re-export/next-themes.d.cts +0 -1
- package/dist/re-export/next-themes.d.ts +0 -1
- package/dist/re-export/next-themes.js +0 -2
- package/dist/re-export/react-day-picker.cjs +0 -2
- package/dist/re-export/react-day-picker.d.cts +0 -1
- package/dist/re-export/react-day-picker.d.ts +0 -1
- package/dist/re-export/react-day-picker.js +0 -2
- package/dist/re-export/react-hook-form.cjs +0 -2
- package/dist/re-export/react-hook-form.d.cts +0 -1
- package/dist/re-export/react-hook-form.d.ts +0 -1
- package/dist/re-export/react-hook-form.js +0 -2
- package/dist/re-export/resolver.cjs +0 -2
- package/dist/re-export/resolver.d.cts +0 -1
- package/dist/re-export/resolver.d.ts +0 -1
- package/dist/re-export/resolver.js +0 -2
- package/dist/re-export/sonner.cjs +0 -2
- package/dist/re-export/sonner.d.cts +0 -1
- package/dist/re-export/sonner.d.ts +0 -1
- package/dist/re-export/sonner.js +0 -2
- package/dist/re-export/tanstack-query.cjs +0 -2
- package/dist/re-export/tanstack-query.d.cts +0 -1
- package/dist/re-export/tanstack-query.d.ts +0 -1
- package/dist/re-export/tanstack-query.js +0 -2
- package/dist/re-export/tanstack-table.cjs +0 -2
- package/dist/re-export/tanstack-table.d.cts +0 -1
- package/dist/re-export/tanstack-table.d.ts +0 -1
- package/dist/re-export/tanstack-table.js +0 -2
- package/dist/re-export/zod.cjs +0 -2
- package/dist/re-export/zod.d.cts +0 -1
- package/dist/re-export/zod.d.ts +0 -1
- package/dist/re-export/zod.js +0 -2
package/dist/chunk-D373YKDA.js
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
cn
|
|
5
|
-
} from "./chunk-RQHJBTEU.js";
|
|
6
|
-
|
|
7
|
-
// src/ui/animation/hover-background.tsx
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import { motion, useMotionValue, useSpring } from "motion/react";
|
|
10
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
function HoverBackground({
|
|
12
|
-
className,
|
|
13
|
-
objectCount = 12,
|
|
14
|
-
children,
|
|
15
|
-
colors = {},
|
|
16
|
-
...props
|
|
17
|
-
}) {
|
|
18
|
-
const {
|
|
19
|
-
background = "bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900",
|
|
20
|
-
objects = [
|
|
21
|
-
"bg-cyan-400/20",
|
|
22
|
-
"bg-purple-400/20",
|
|
23
|
-
"bg-fuchsia-400/20",
|
|
24
|
-
"bg-violet-400/20",
|
|
25
|
-
"bg-blue-400/20",
|
|
26
|
-
"bg-indigo-400/20"
|
|
27
|
-
],
|
|
28
|
-
glow = "shadow-cyan-400/50"
|
|
29
|
-
} = colors;
|
|
30
|
-
const [isHovered, setIsHovered] = React.useState(false);
|
|
31
|
-
const mouseX = useMotionValue(0);
|
|
32
|
-
const mouseY = useMotionValue(0);
|
|
33
|
-
const springX = useSpring(mouseX, {
|
|
34
|
-
stiffness: 300,
|
|
35
|
-
damping: 30,
|
|
36
|
-
// Slower return to center when hover ends
|
|
37
|
-
restSpeed: 0.1,
|
|
38
|
-
restDelta: 0.1
|
|
39
|
-
});
|
|
40
|
-
const springY = useSpring(mouseY, {
|
|
41
|
-
stiffness: 300,
|
|
42
|
-
damping: 30,
|
|
43
|
-
restSpeed: 0.1,
|
|
44
|
-
restDelta: 0.1
|
|
45
|
-
});
|
|
46
|
-
const animatedObjects = React.useMemo(
|
|
47
|
-
() => Array.from({ length: objectCount }, (_, i) => {
|
|
48
|
-
const shape = Math.random() > 0.5 ? "circle" : "square";
|
|
49
|
-
return {
|
|
50
|
-
id: i,
|
|
51
|
-
x: Math.random() * 90 + 5,
|
|
52
|
-
// 5-95% to avoid edges
|
|
53
|
-
y: Math.random() * 90 + 5,
|
|
54
|
-
size: Math.random() * 60 + 20,
|
|
55
|
-
// 20-80px
|
|
56
|
-
color: objects[i % objects.length],
|
|
57
|
-
delay: Math.random() * 2,
|
|
58
|
-
shape,
|
|
59
|
-
floatDirection: Math.random() > 0.5 ? 1 : -1,
|
|
60
|
-
breathDuration: Math.random() * 3 + 3,
|
|
61
|
-
// 3-6 seconds
|
|
62
|
-
parallaxStrength: Math.random() * 0.5 + 0.3,
|
|
63
|
-
// 0.3-0.8 for more varied parallax depth
|
|
64
|
-
baseRotation: Math.random() * 360
|
|
65
|
-
// Random starting rotation offset
|
|
66
|
-
};
|
|
67
|
-
}),
|
|
68
|
-
[objectCount, objects]
|
|
69
|
-
);
|
|
70
|
-
const handleMouseMove = (event) => {
|
|
71
|
-
if (!isHovered) return;
|
|
72
|
-
const rect = event.currentTarget.getBoundingClientRect();
|
|
73
|
-
const centerX = rect.width / 2;
|
|
74
|
-
const centerY = rect.height / 2;
|
|
75
|
-
const x = (event.clientX - rect.left - centerX) / centerX;
|
|
76
|
-
const y = (event.clientY - rect.top - centerY) / centerY;
|
|
77
|
-
mouseX.set(x * 15);
|
|
78
|
-
mouseY.set(y * 15);
|
|
79
|
-
};
|
|
80
|
-
const handleHoverStart = () => {
|
|
81
|
-
setIsHovered(true);
|
|
82
|
-
};
|
|
83
|
-
const handleHoverEnd = () => {
|
|
84
|
-
setIsHovered(false);
|
|
85
|
-
mouseX.set(0);
|
|
86
|
-
mouseY.set(0);
|
|
87
|
-
};
|
|
88
|
-
return /* @__PURE__ */ jsxs(
|
|
89
|
-
motion.div,
|
|
90
|
-
{
|
|
91
|
-
"data-slot": "hover-background",
|
|
92
|
-
className: cn("relative size-full overflow-hidden", background, className),
|
|
93
|
-
onHoverStart: handleHoverStart,
|
|
94
|
-
onHoverEnd: handleHoverEnd,
|
|
95
|
-
onMouseMove: handleMouseMove,
|
|
96
|
-
whileHover: { scale: 1.02 },
|
|
97
|
-
transition: { duration: 0.3, ease: "easeOut" },
|
|
98
|
-
animate: {
|
|
99
|
-
backgroundPosition: ["0% 50%", "100% 50%", "0% 50%"]
|
|
100
|
-
},
|
|
101
|
-
style: {
|
|
102
|
-
backgroundSize: "200% 200%"
|
|
103
|
-
},
|
|
104
|
-
...props,
|
|
105
|
-
children: [
|
|
106
|
-
/* @__PURE__ */ jsx(
|
|
107
|
-
motion.div,
|
|
108
|
-
{
|
|
109
|
-
className: "absolute inset-0 bg-gradient-radial from-white/5 via-transparent to-transparent",
|
|
110
|
-
animate: {
|
|
111
|
-
opacity: [0.3, 0.6, 0.3],
|
|
112
|
-
scale: [1, 1.1, 1]
|
|
113
|
-
},
|
|
114
|
-
transition: {
|
|
115
|
-
duration: 4,
|
|
116
|
-
repeat: Infinity,
|
|
117
|
-
ease: "easeInOut"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
),
|
|
121
|
-
animatedObjects.map((obj) => /* @__PURE__ */ jsx(
|
|
122
|
-
motion.div,
|
|
123
|
-
{
|
|
124
|
-
className: cn(
|
|
125
|
-
"absolute border border-white/10 backdrop-blur-sm",
|
|
126
|
-
obj.color,
|
|
127
|
-
obj.shape === "circle" ? "rounded-full" : "rotate-45 rounded-lg"
|
|
128
|
-
),
|
|
129
|
-
style: {
|
|
130
|
-
left: `${obj.x}%`,
|
|
131
|
-
top: `${obj.y}%`,
|
|
132
|
-
width: obj.size,
|
|
133
|
-
height: obj.size,
|
|
134
|
-
// Apply parallax with individual object strength
|
|
135
|
-
x: springX.get() * obj.parallaxStrength,
|
|
136
|
-
y: springY.get() * obj.parallaxStrength
|
|
137
|
-
},
|
|
138
|
-
initial: {
|
|
139
|
-
scale: 0.6,
|
|
140
|
-
opacity: 0.4,
|
|
141
|
-
rotate: obj.baseRotation
|
|
142
|
-
},
|
|
143
|
-
animate: {
|
|
144
|
-
// Default state animations - breathing with base rotation offset
|
|
145
|
-
scale: [0.6, 0.8, 0.6],
|
|
146
|
-
opacity: [0.4, 0.6, 0.4],
|
|
147
|
-
rotate: obj.shape === "circle" ? [obj.baseRotation, obj.baseRotation + 10, obj.baseRotation] : [obj.baseRotation, obj.baseRotation + 5, obj.baseRotation],
|
|
148
|
-
y: [0, obj.floatDirection * 15, 0],
|
|
149
|
-
x: [0, obj.floatDirection * 8, 0]
|
|
150
|
-
},
|
|
151
|
-
transition: {
|
|
152
|
-
duration: obj.breathDuration,
|
|
153
|
-
delay: obj.delay,
|
|
154
|
-
ease: "easeInOut",
|
|
155
|
-
repeat: Infinity,
|
|
156
|
-
repeatType: "reverse"
|
|
157
|
-
},
|
|
158
|
-
whileHover: {
|
|
159
|
-
scale: 1.5,
|
|
160
|
-
boxShadow: `0 0 30px ${glow.replace("shadow-", "").replace("/50", "")}`
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
obj.id
|
|
164
|
-
)),
|
|
165
|
-
isHovered && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0", children: Array.from({ length: 20 }).map((_, i) => /* @__PURE__ */ jsx(
|
|
166
|
-
motion.div,
|
|
167
|
-
{
|
|
168
|
-
className: "absolute h-1 w-1 rounded-full bg-white/60",
|
|
169
|
-
style: {
|
|
170
|
-
left: `${Math.random() * 100}%`,
|
|
171
|
-
top: `${Math.random() * 100}%`
|
|
172
|
-
},
|
|
173
|
-
initial: { opacity: 0, scale: 0 },
|
|
174
|
-
animate: {
|
|
175
|
-
opacity: [0, 1, 0],
|
|
176
|
-
scale: [0, 1, 0],
|
|
177
|
-
y: [0, -50, -100]
|
|
178
|
-
},
|
|
179
|
-
transition: {
|
|
180
|
-
duration: 3,
|
|
181
|
-
delay: Math.random() * 2,
|
|
182
|
-
repeat: Infinity,
|
|
183
|
-
ease: "easeOut"
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
`particle-${i}`
|
|
187
|
-
)) }),
|
|
188
|
-
/* @__PURE__ */ jsx("div", { className: "relative z-10 size-full", children })
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export {
|
|
195
|
-
HoverBackground
|
|
196
|
-
};
|