pelatform-ui 1.2.9 → 1.3.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.
Files changed (42) hide show
  1. package/README.md +254 -120
  2. package/css/theme.css +1 -59
  3. package/dist/animation.d.ts +379 -3
  4. package/dist/animation.js +1785 -2
  5. package/dist/badge-Rr33PgV_.d.ts +15 -0
  6. package/dist/base.d.ts +1452 -1
  7. package/dist/base.js +12148 -2
  8. package/dist/button-Bc3N6jWT.d.ts +22 -0
  9. package/dist/chunk-4Z3DBWB6.js +193 -0
  10. package/dist/chunk-NW6KWHKZ.js +22 -0
  11. package/dist/chunk-Q2RH7YQE.js +857 -0
  12. package/dist/{chunk-NOAZYT3J.js → chunk-V3ET2B55.js} +2 -4
  13. package/dist/chunk-XKN6BR2K.js +59 -0
  14. package/dist/components.d.ts +472 -2129
  15. package/dist/components.js +969 -1421
  16. package/dist/hooks.d.ts +1197 -4
  17. package/dist/hooks.js +912 -5
  18. package/dist/index.d.ts +7 -84
  19. package/dist/index.js +1 -623
  20. package/dist/radix.d.ts +1440 -1
  21. package/dist/radix.js +11360 -2
  22. package/package.json +33 -22
  23. package/css/components/apexcharts.css +0 -101
  24. package/css/components/book.css +0 -19
  25. package/css/components/extra.css +0 -12
  26. package/css/components/image-input.css +0 -51
  27. package/css/components/leaflet.css +0 -25
  28. package/css/components/patterns.css +0 -34
  29. package/css/components/rating.css +0 -89
  30. package/css/components/scrollable.css +0 -118
  31. package/css/components/theme-transition.css +0 -51
  32. package/dist/chunk-HW52LCWN.js +0 -22
  33. package/dist/chunk-QEWGMDVY.js +0 -10
  34. package/dist/colors-CUDWvz1g.d.ts +0 -42
  35. package/dist/components-B1rw2xzN.d.ts +0 -46
  36. package/dist/utils.d.ts +0 -6
  37. package/dist/utils.js +0 -14
  38. /package/css/{shadcn → color}/gray.css +0 -0
  39. /package/css/{shadcn → color}/neutral.css +0 -0
  40. /package/css/{shadcn → color}/slate.css +0 -0
  41. /package/css/{shadcn → color}/stone.css +0 -0
  42. /package/css/{shadcn → color}/zinc.css +0 -0
@@ -0,0 +1,22 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as class_variance_authority_types from 'class-variance-authority/types';
3
+ import * as React from 'react';
4
+ import { VariantProps } from 'class-variance-authority';
5
+
6
+ declare const alertVariants: (props?: ({
7
+ variant?: "default" | "destructive" | "info" | "success" | "warning" | "invert" | null | undefined;
8
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
9
+ declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): react_jsx_runtime.JSX.Element;
10
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
11
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
12
+ declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
13
+
14
+ declare const buttonVariants: (props?: ({
15
+ variant?: "link" | "default" | "outline" | "secondary" | "ghost" | "destructive" | null | undefined;
16
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
17
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
18
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
19
+ asChild?: boolean;
20
+ }): react_jsx_runtime.JSX.Element;
21
+
22
+ export { Alert as A, Button as B, AlertAction as a, AlertDescription as b, AlertTitle as c, buttonVariants as d };
@@ -0,0 +1,193 @@
1
+ "use client";
2
+
3
+ // src/ui/animation/hover-background.tsx
4
+ import * as React from "react";
5
+ import { motion, useMotionValue, useSpring } from "motion/react";
6
+ import { cn } from "@pelatform/utils";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ function HoverBackground({
9
+ className,
10
+ objectCount = 12,
11
+ children,
12
+ colors = {},
13
+ ...props
14
+ }) {
15
+ const {
16
+ background = "bg-gradient-to-br from-slate-900 via-purple-900 to-slate-900",
17
+ objects = [
18
+ "bg-cyan-400/20",
19
+ "bg-purple-400/20",
20
+ "bg-fuchsia-400/20",
21
+ "bg-violet-400/20",
22
+ "bg-blue-400/20",
23
+ "bg-indigo-400/20"
24
+ ],
25
+ glow = "shadow-cyan-400/50"
26
+ } = colors;
27
+ const [isHovered, setIsHovered] = React.useState(false);
28
+ const mouseX = useMotionValue(0);
29
+ const mouseY = useMotionValue(0);
30
+ const springX = useSpring(mouseX, {
31
+ stiffness: 300,
32
+ damping: 30,
33
+ // Slower return to center when hover ends
34
+ restSpeed: 0.1,
35
+ restDelta: 0.1
36
+ });
37
+ const springY = useSpring(mouseY, {
38
+ stiffness: 300,
39
+ damping: 30,
40
+ restSpeed: 0.1,
41
+ restDelta: 0.1
42
+ });
43
+ const animatedObjects = React.useMemo(
44
+ () => Array.from({ length: objectCount }, (_, i) => {
45
+ const shape = Math.random() > 0.5 ? "circle" : "square";
46
+ return {
47
+ id: i,
48
+ x: Math.random() * 90 + 5,
49
+ // 5-95% to avoid edges
50
+ y: Math.random() * 90 + 5,
51
+ size: Math.random() * 60 + 20,
52
+ // 20-80px
53
+ color: objects[i % objects.length],
54
+ delay: Math.random() * 2,
55
+ shape,
56
+ floatDirection: Math.random() > 0.5 ? 1 : -1,
57
+ breathDuration: Math.random() * 3 + 3,
58
+ // 3-6 seconds
59
+ parallaxStrength: Math.random() * 0.5 + 0.3,
60
+ // 0.3-0.8 for more varied parallax depth
61
+ baseRotation: Math.random() * 360
62
+ // Random starting rotation offset
63
+ };
64
+ }),
65
+ [objectCount, objects]
66
+ );
67
+ const handleMouseMove = (event) => {
68
+ if (!isHovered) return;
69
+ const rect = event.currentTarget.getBoundingClientRect();
70
+ const centerX = rect.width / 2;
71
+ const centerY = rect.height / 2;
72
+ const x = (event.clientX - rect.left - centerX) / centerX;
73
+ const y = (event.clientY - rect.top - centerY) / centerY;
74
+ mouseX.set(x * 15);
75
+ mouseY.set(y * 15);
76
+ };
77
+ const handleHoverStart = () => {
78
+ setIsHovered(true);
79
+ };
80
+ const handleHoverEnd = () => {
81
+ setIsHovered(false);
82
+ mouseX.set(0);
83
+ mouseY.set(0);
84
+ };
85
+ return /* @__PURE__ */ jsxs(
86
+ motion.div,
87
+ {
88
+ "data-slot": "hover-background",
89
+ className: cn("relative size-full overflow-hidden", background, className),
90
+ onHoverStart: handleHoverStart,
91
+ onHoverEnd: handleHoverEnd,
92
+ onMouseMove: handleMouseMove,
93
+ whileHover: { scale: 1.02 },
94
+ transition: { duration: 0.3, ease: "easeOut" },
95
+ animate: {
96
+ backgroundPosition: ["0% 50%", "100% 50%", "0% 50%"]
97
+ },
98
+ style: {
99
+ backgroundSize: "200% 200%"
100
+ },
101
+ ...props,
102
+ children: [
103
+ /* @__PURE__ */ jsx(
104
+ motion.div,
105
+ {
106
+ className: "absolute inset-0 bg-gradient-radial from-white/5 via-transparent to-transparent",
107
+ animate: {
108
+ opacity: [0.3, 0.6, 0.3],
109
+ scale: [1, 1.1, 1]
110
+ },
111
+ transition: {
112
+ duration: 4,
113
+ repeat: Infinity,
114
+ ease: "easeInOut"
115
+ }
116
+ }
117
+ ),
118
+ animatedObjects.map((obj) => /* @__PURE__ */ jsx(
119
+ motion.div,
120
+ {
121
+ className: cn(
122
+ "absolute border border-white/10 backdrop-blur-sm",
123
+ obj.color,
124
+ obj.shape === "circle" ? "rounded-full" : "rotate-45 rounded-lg"
125
+ ),
126
+ style: {
127
+ left: `${obj.x}%`,
128
+ top: `${obj.y}%`,
129
+ width: obj.size,
130
+ height: obj.size,
131
+ // Apply parallax with individual object strength
132
+ x: springX.get() * obj.parallaxStrength,
133
+ y: springY.get() * obj.parallaxStrength
134
+ },
135
+ initial: {
136
+ scale: 0.6,
137
+ opacity: 0.4,
138
+ rotate: obj.baseRotation
139
+ },
140
+ animate: {
141
+ // Default state animations - breathing with base rotation offset
142
+ scale: [0.6, 0.8, 0.6],
143
+ opacity: [0.4, 0.6, 0.4],
144
+ rotate: obj.shape === "circle" ? [obj.baseRotation, obj.baseRotation + 10, obj.baseRotation] : [obj.baseRotation, obj.baseRotation + 5, obj.baseRotation],
145
+ y: [0, obj.floatDirection * 15, 0],
146
+ x: [0, obj.floatDirection * 8, 0]
147
+ },
148
+ transition: {
149
+ duration: obj.breathDuration,
150
+ delay: obj.delay,
151
+ ease: "easeInOut",
152
+ repeat: Infinity,
153
+ repeatType: "reverse"
154
+ },
155
+ whileHover: {
156
+ scale: 1.5,
157
+ boxShadow: `0 0 30px ${glow.replace("shadow-", "").replace("/50", "")}`
158
+ }
159
+ },
160
+ obj.id
161
+ )),
162
+ isHovered && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0", children: Array.from({ length: 20 }).map((_, i) => /* @__PURE__ */ jsx(
163
+ motion.div,
164
+ {
165
+ className: "absolute h-1 w-1 rounded-full bg-white/60",
166
+ style: {
167
+ left: `${Math.random() * 100}%`,
168
+ top: `${Math.random() * 100}%`
169
+ },
170
+ initial: { opacity: 0, scale: 0 },
171
+ animate: {
172
+ opacity: [0, 1, 0],
173
+ scale: [0, 1, 0],
174
+ y: [0, -50, -100]
175
+ },
176
+ transition: {
177
+ duration: 3,
178
+ delay: Math.random() * 2,
179
+ repeat: Infinity,
180
+ ease: "easeOut"
181
+ }
182
+ },
183
+ `particle-${i}`
184
+ )) }),
185
+ /* @__PURE__ */ jsx("div", { className: "relative z-10 size-full", children })
186
+ ]
187
+ }
188
+ );
189
+ }
190
+
191
+ export {
192
+ HoverBackground
193
+ };
@@ -0,0 +1,22 @@
1
+ "use client";
2
+
3
+ // src/hooks/use-is-mobile.ts
4
+ import * as React from "react";
5
+ var DEFAULT_MOBILE_BREAKPOINT = 1024;
6
+ function useIsMobile(breakpoint = DEFAULT_MOBILE_BREAKPOINT) {
7
+ const [isMobile, setIsMobile] = React.useState(void 0);
8
+ React.useEffect(() => {
9
+ const mql = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
10
+ const onChange = () => {
11
+ setIsMobile(window.innerWidth < breakpoint);
12
+ };
13
+ mql.addEventListener("change", onChange);
14
+ setIsMobile(window.innerWidth < breakpoint);
15
+ return () => mql.removeEventListener("change", onChange);
16
+ }, [breakpoint]);
17
+ return !!isMobile;
18
+ }
19
+
20
+ export {
21
+ useIsMobile
22
+ };