@arolariu/components 0.0.39 → 0.0.40
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/CONTRIBUTING.md +371 -371
- package/DEBUGGING.md +401 -401
- package/EXAMPLES.md +1035 -1035
- package/{CHANGELOG.md → changelog.md} +7 -0
- package/dist/cjs/components/ui/bubble-background.cjs +1 -2
- package/dist/cjs/components/ui/bubble-background.cjs.map +1 -1
- package/dist/cjs/components/ui/calendar.cjs.map +1 -1
- package/dist/cjs/components/ui/chart.cjs.map +1 -1
- package/dist/cjs/components/ui/command.cjs +1 -1
- package/dist/cjs/components/ui/drawer.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdrawer.cjs.map +1 -1
- package/dist/cjs/components/ui/input.cjs.map +1 -1
- package/dist/cjs/components/ui/ripple-button.cjs.map +1 -1
- package/dist/cjs/components/ui/scratcher.cjs.map +1 -1
- package/dist/cjs/components/ui/sidebar.cjs +4 -4
- package/dist/cjs/components/ui/sonner.cjs +2 -2
- package/dist/cjs/components/ui/tooltip.cjs +1 -1
- package/dist/cjs/index.cjs +6 -6
- package/dist/cjs/index.css +1 -1
- package/dist/cjs/index.css.map +1 -1
- package/dist/esm/components/ui/bubble-background.js +1 -2
- package/dist/esm/components/ui/bubble-background.js.map +1 -1
- package/dist/esm/components/ui/calendar.js.map +1 -1
- package/dist/esm/components/ui/chart.js.map +1 -1
- package/dist/esm/components/ui/drawer.js.map +1 -1
- package/dist/esm/components/ui/dropdrawer.js.map +1 -1
- package/dist/esm/components/ui/input.js.map +1 -1
- package/dist/esm/components/ui/ripple-button.js.map +1 -1
- package/dist/esm/components/ui/scratcher.js.map +1 -1
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.css.map +1 -1
- package/dist/index.css +1 -1
- package/dist/types/components/ui/bubble-background.d.ts.map +1 -1
- package/package.json +51 -52
- package/{README.md → readme.md} +627 -627
- package/src/components/ui/bubble-background.tsx +189 -187
- package/src/components/ui/calendar.tsx +213 -213
- package/src/components/ui/chart.tsx +380 -380
- package/src/components/ui/drawer.tsx +141 -141
- package/src/components/ui/dropdrawer.tsx +973 -973
- package/src/components/ui/input.tsx +22 -22
- package/src/components/ui/ripple-button.tsx +111 -111
- package/src/components/ui/scratcher.tsx +171 -171
|
@@ -1,187 +1,189 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
motion,
|
|
6
|
-
type SpringOptions,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
React.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
--
|
|
92
|
-
--
|
|
93
|
-
--
|
|
94
|
-
--
|
|
95
|
-
--
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
motion,
|
|
6
|
+
type SpringOptions,
|
|
7
|
+
Transition,
|
|
8
|
+
useMotionValue,
|
|
9
|
+
useSpring,
|
|
10
|
+
} from "motion/react";
|
|
11
|
+
|
|
12
|
+
import { cn } from "@/lib/utils";
|
|
13
|
+
|
|
14
|
+
interface BubbleBackgroundProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
interactive?: boolean;
|
|
16
|
+
transition?: SpringOptions;
|
|
17
|
+
colors?: {
|
|
18
|
+
first: string;
|
|
19
|
+
second: string;
|
|
20
|
+
third: string;
|
|
21
|
+
fourth: string;
|
|
22
|
+
fifth: string;
|
|
23
|
+
sixth: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const BubbleBackground = React.forwardRef<
|
|
28
|
+
HTMLDivElement,
|
|
29
|
+
BubbleBackgroundProps
|
|
30
|
+
>(
|
|
31
|
+
(
|
|
32
|
+
{
|
|
33
|
+
className,
|
|
34
|
+
children,
|
|
35
|
+
interactive = false,
|
|
36
|
+
transition = { stiffness: 100, damping: 20 },
|
|
37
|
+
colors = {
|
|
38
|
+
first: "18,113,255",
|
|
39
|
+
second: "221,74,255",
|
|
40
|
+
third: "0,220,255",
|
|
41
|
+
fourth: "200,50,50",
|
|
42
|
+
fifth: "180,180,50",
|
|
43
|
+
sixth: "140,100,255",
|
|
44
|
+
},
|
|
45
|
+
...props
|
|
46
|
+
},
|
|
47
|
+
ref,
|
|
48
|
+
) => {
|
|
49
|
+
const containerRef = React.useRef<HTMLDivElement>(null);
|
|
50
|
+
React.useImperativeHandle(
|
|
51
|
+
ref,
|
|
52
|
+
() => containerRef.current as HTMLDivElement,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const mouseX = useMotionValue(0);
|
|
56
|
+
const mouseY = useMotionValue(0);
|
|
57
|
+
const springX = useSpring(mouseX, transition);
|
|
58
|
+
const springY = useSpring(mouseY, transition);
|
|
59
|
+
|
|
60
|
+
React.useEffect(() => {
|
|
61
|
+
if (!interactive) return;
|
|
62
|
+
|
|
63
|
+
const currentContainer = containerRef.current;
|
|
64
|
+
if (!currentContainer) return;
|
|
65
|
+
|
|
66
|
+
const handleMouseMove = (e: MouseEvent) => {
|
|
67
|
+
const rect = currentContainer.getBoundingClientRect();
|
|
68
|
+
const centerX = rect.left + rect.width / 2;
|
|
69
|
+
const centerY = rect.top + rect.height / 2;
|
|
70
|
+
mouseX.set(e.clientX - centerX);
|
|
71
|
+
mouseY.set(e.clientY - centerY);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
currentContainer?.addEventListener("mousemove", handleMouseMove);
|
|
75
|
+
return () =>
|
|
76
|
+
currentContainer?.removeEventListener("mousemove", handleMouseMove);
|
|
77
|
+
}, [interactive, mouseX, mouseY]);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div
|
|
81
|
+
ref={containerRef}
|
|
82
|
+
className={cn(
|
|
83
|
+
"relative size-full overflow-hidden bg-gradient-to-br from-violet-900 to-blue-900",
|
|
84
|
+
className,
|
|
85
|
+
)}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
<style>
|
|
89
|
+
{`
|
|
90
|
+
:root {
|
|
91
|
+
--first-color: ${colors.first};
|
|
92
|
+
--second-color: ${colors.second};
|
|
93
|
+
--third-color: ${colors.third};
|
|
94
|
+
--fourth-color: ${colors.fourth};
|
|
95
|
+
--fifth-color: ${colors.fifth};
|
|
96
|
+
--sixth-color: ${colors.sixth};
|
|
97
|
+
}
|
|
98
|
+
`}
|
|
99
|
+
</style>
|
|
100
|
+
|
|
101
|
+
<svg
|
|
102
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
103
|
+
className="absolute top-0 left-0 w-0 h-0"
|
|
104
|
+
>
|
|
105
|
+
<defs>
|
|
106
|
+
<filter id="goo">
|
|
107
|
+
<feGaussianBlur
|
|
108
|
+
in="SourceGraphic"
|
|
109
|
+
stdDeviation="10"
|
|
110
|
+
result="blur"
|
|
111
|
+
/>
|
|
112
|
+
<feColorMatrix
|
|
113
|
+
in="blur"
|
|
114
|
+
mode="matrix"
|
|
115
|
+
values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -8"
|
|
116
|
+
result="goo"
|
|
117
|
+
/>
|
|
118
|
+
<feBlend in="SourceGraphic" in2="goo" />
|
|
119
|
+
</filter>
|
|
120
|
+
</defs>
|
|
121
|
+
</svg>
|
|
122
|
+
|
|
123
|
+
<div
|
|
124
|
+
className="absolute inset-0"
|
|
125
|
+
style={{ filter: "url(#goo) blur(40px)" }}
|
|
126
|
+
>
|
|
127
|
+
<motion.div
|
|
128
|
+
className="absolute rounded-full size-[80%] top-[10%] left-[10%] mix-blend-hard-light bg-[radial-gradient(circle_at_center,rgba(var(--first-color),0.8)_0%,rgba(var(--first-color),0)_50%)]"
|
|
129
|
+
animate={{ y: [-50, 50, -50] }}
|
|
130
|
+
transition={{ duration: 30, ease: "easeInOut", repeat: Infinity }}
|
|
131
|
+
/>
|
|
132
|
+
|
|
133
|
+
<motion.div
|
|
134
|
+
className="absolute inset-0 flex justify-center items-center origin-[calc(50%-400px)]"
|
|
135
|
+
animate={{ rotate: 360 }}
|
|
136
|
+
transition={
|
|
137
|
+
{
|
|
138
|
+
duration: 20,
|
|
139
|
+
ease: "linear",
|
|
140
|
+
repeat: Infinity,
|
|
141
|
+
repeatType: "reverse",
|
|
142
|
+
} satisfies Transition
|
|
143
|
+
}
|
|
144
|
+
>
|
|
145
|
+
<div className="rounded-full size-[80%] top-[10%] left-[10%] mix-blend-hard-light bg-[radial-gradient(circle_at_center,rgba(var(--second-color),0.8)_0%,rgba(var(--second-color),0)_50%)]" />
|
|
146
|
+
</motion.div>
|
|
147
|
+
|
|
148
|
+
<motion.div
|
|
149
|
+
className="absolute inset-0 flex justify-center items-center origin-[calc(50%+400px)]"
|
|
150
|
+
animate={{ rotate: 360 }}
|
|
151
|
+
transition={{ duration: 40, ease: "linear", repeat: Infinity }}
|
|
152
|
+
>
|
|
153
|
+
<div className="absolute rounded-full size-[80%] bg-[radial-gradient(circle_at_center,rgba(var(--third-color),0.8)_0%,rgba(var(--third-color),0)_50%)] mix-blend-hard-light top-[calc(50%+200px)] left-[calc(50%-500px)]" />
|
|
154
|
+
</motion.div>
|
|
155
|
+
|
|
156
|
+
<motion.div
|
|
157
|
+
className="absolute rounded-full size-[80%] top-[10%] left-[10%] mix-blend-hard-light bg-[radial-gradient(circle_at_center,rgba(var(--fourth-color),0.8)_0%,rgba(var(--fourth-color),0)_50%)] opacity-70"
|
|
158
|
+
animate={{ x: [-50, 50, -50] }}
|
|
159
|
+
transition={{ duration: 40, ease: "easeInOut", repeat: Infinity }}
|
|
160
|
+
/>
|
|
161
|
+
|
|
162
|
+
<motion.div
|
|
163
|
+
className="absolute inset-0 flex justify-center items-center origin-[calc(50%_-_800px)_calc(50%_+_200px)]"
|
|
164
|
+
animate={{ rotate: 360 }}
|
|
165
|
+
transition={{ duration: 20, ease: "linear", repeat: Infinity }}
|
|
166
|
+
>
|
|
167
|
+
<div className="absolute rounded-full size-[160%] mix-blend-hard-light bg-[radial-gradient(circle_at_center,rgba(var(--fifth-color),0.8)_0%,rgba(var(--fifth-color),0)_50%)] top-[calc(50%-80%)] left-[calc(50%-80%)]" />
|
|
168
|
+
</motion.div>
|
|
169
|
+
|
|
170
|
+
{interactive && (
|
|
171
|
+
<motion.div
|
|
172
|
+
className="absolute rounded-full size-full mix-blend-hard-light bg-[radial-gradient(circle_at_center,rgba(var(--sixth-color),0.8)_0%,rgba(var(--sixth-color),0)_50%)] opacity-70"
|
|
173
|
+
style={{
|
|
174
|
+
x: springX,
|
|
175
|
+
y: springY,
|
|
176
|
+
}}
|
|
177
|
+
/>
|
|
178
|
+
)}
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
{children}
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
},
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
BubbleBackground.displayName = "BubbleBackground";
|
|
188
|
+
|
|
189
|
+
export { BubbleBackground, type BubbleBackgroundProps };
|