lucid-icons-animated 1.0.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/filter.txt ADDED
@@ -0,0 +1,247 @@
1
+ "use client";
2
+
3
+ import type { Transition } from "motion/react";
4
+ import { motion, useAnimation } from "motion/react";
5
+ import type { HTMLAttributes } from "react";
6
+ import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
7
+
8
+ import { cn } from "@/lib/utils";
9
+
10
+ export interface SlidersHorizontalIconHandle {
11
+ startAnimation: () => void;
12
+ stopAnimation: () => void;
13
+ }
14
+
15
+ interface SlidersHorizontalIconProps extends HTMLAttributes<HTMLDivElement> {
16
+ size?: number;
17
+ }
18
+
19
+ const DEFAULT_TRANSITION: Transition = {
20
+ type: "spring",
21
+ stiffness: 100,
22
+ damping: 12,
23
+ mass: 0.4,
24
+ };
25
+
26
+ const SlidersHorizontalIcon = forwardRef<
27
+ SlidersHorizontalIconHandle,
28
+ SlidersHorizontalIconProps
29
+ >(({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
30
+ const controls = useAnimation();
31
+ const isControlledRef = useRef(false);
32
+
33
+ useImperativeHandle(ref, () => {
34
+ isControlledRef.current = true;
35
+
36
+ return {
37
+ startAnimation: () => controls.start("animate"),
38
+ stopAnimation: () => controls.start("normal"),
39
+ };
40
+ });
41
+
42
+ const handleMouseEnter = useCallback(
43
+ (e: React.MouseEvent<HTMLDivElement>) => {
44
+ if (isControlledRef.current) {
45
+ onMouseEnter?.(e);
46
+ } else {
47
+ controls.start("animate");
48
+ }
49
+ },
50
+ [controls, onMouseEnter]
51
+ );
52
+
53
+ const handleMouseLeave = useCallback(
54
+ (e: React.MouseEvent<HTMLDivElement>) => {
55
+ if (isControlledRef.current) {
56
+ onMouseLeave?.(e);
57
+ } else {
58
+ controls.start("normal");
59
+ }
60
+ },
61
+ [controls, onMouseLeave]
62
+ );
63
+
64
+ return (
65
+ <div
66
+ className={cn(className)}
67
+ onMouseEnter={handleMouseEnter}
68
+ onMouseLeave={handleMouseLeave}
69
+ {...props}
70
+ >
71
+ <svg
72
+ fill="none"
73
+ height={size}
74
+ stroke="currentColor"
75
+ strokeLinecap="round"
76
+ strokeLinejoin="round"
77
+ strokeWidth="2"
78
+ viewBox="0 0 24 24"
79
+ width={size}
80
+ xmlns="http://www.w3.org/2000/svg"
81
+ >
82
+ <motion.line
83
+ animate={controls}
84
+ initial={false}
85
+ transition={DEFAULT_TRANSITION}
86
+ variants={{
87
+ normal: {
88
+ x2: 14,
89
+ },
90
+ animate: {
91
+ x2: 10,
92
+ },
93
+ }}
94
+ x1="21"
95
+ x2="14"
96
+ y1="4"
97
+ y2="4"
98
+ />
99
+ <motion.line
100
+ animate={controls}
101
+ transition={DEFAULT_TRANSITION}
102
+ variants={{
103
+ normal: {
104
+ x1: 10,
105
+ },
106
+ animate: {
107
+ x1: 5,
108
+ },
109
+ }}
110
+ x1="10"
111
+ x2="3"
112
+ y1="4"
113
+ y2="4"
114
+ />
115
+
116
+ <motion.line
117
+ animate={controls}
118
+ transition={DEFAULT_TRANSITION}
119
+ variants={{
120
+ normal: {
121
+ x2: 12,
122
+ },
123
+ animate: {
124
+ x2: 18,
125
+ },
126
+ }}
127
+ x1="21"
128
+ x2="12"
129
+ y1="12"
130
+ y2="12"
131
+ />
132
+
133
+ <motion.line
134
+ animate={controls}
135
+ transition={DEFAULT_TRANSITION}
136
+ variants={{
137
+ normal: {
138
+ x1: 8,
139
+ },
140
+ animate: {
141
+ x1: 13,
142
+ },
143
+ }}
144
+ x1="8"
145
+ x2="3"
146
+ y1="12"
147
+ y2="12"
148
+ />
149
+
150
+ <motion.line
151
+ animate={controls}
152
+ transition={DEFAULT_TRANSITION}
153
+ variants={{
154
+ normal: {
155
+ x2: 12,
156
+ },
157
+ animate: {
158
+ x2: 4,
159
+ },
160
+ }}
161
+ x1="3"
162
+ x2="12"
163
+ y1="20"
164
+ y2="20"
165
+ />
166
+
167
+ <motion.line
168
+ animate={controls}
169
+ transition={DEFAULT_TRANSITION}
170
+ variants={{
171
+ normal: {
172
+ x1: 16,
173
+ },
174
+ animate: {
175
+ x1: 8,
176
+ },
177
+ }}
178
+ x1="16"
179
+ x2="21"
180
+ y1="20"
181
+ y2="20"
182
+ />
183
+
184
+ <motion.line
185
+ animate={controls}
186
+ transition={DEFAULT_TRANSITION}
187
+ variants={{
188
+ normal: {
189
+ x1: 14,
190
+ x2: 14,
191
+ },
192
+ animate: {
193
+ x1: 9,
194
+ x2: 9,
195
+ },
196
+ }}
197
+ x1="14"
198
+ x2="14"
199
+ y1="2"
200
+ y2="6"
201
+ />
202
+
203
+ <motion.line
204
+ animate={controls}
205
+ transition={DEFAULT_TRANSITION}
206
+ variants={{
207
+ normal: {
208
+ x1: 8,
209
+ x2: 8,
210
+ },
211
+ animate: {
212
+ x1: 14,
213
+ x2: 14,
214
+ },
215
+ }}
216
+ x1="8"
217
+ x2="8"
218
+ y1="10"
219
+ y2="14"
220
+ />
221
+
222
+ <motion.line
223
+ animate={controls}
224
+ transition={DEFAULT_TRANSITION}
225
+ variants={{
226
+ normal: {
227
+ x1: 16,
228
+ x2: 16,
229
+ },
230
+ animate: {
231
+ x1: 8,
232
+ x2: 8,
233
+ },
234
+ }}
235
+ x1="16"
236
+ x2="16"
237
+ y1="18"
238
+ y2="22"
239
+ />
240
+ </svg>
241
+ </div>
242
+ );
243
+ });
244
+
245
+ SlidersHorizontalIcon.displayName = "SlidersHorizontalIcon";
246
+
247
+ export { SlidersHorizontalIcon };
package/logout.txt ADDED
@@ -0,0 +1,105 @@
1
+ "use client";
2
+
3
+ import type { Variants } from "motion/react";
4
+ import { motion, useAnimation } from "motion/react";
5
+ import type { HTMLAttributes } from "react";
6
+ import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
7
+
8
+ import { cn } from "@/lib/utils";
9
+
10
+ export interface LogoutIconHandle {
11
+ startAnimation: () => void;
12
+ stopAnimation: () => void;
13
+ }
14
+
15
+ interface LogoutIconProps extends HTMLAttributes<HTMLDivElement> {
16
+ size?: number;
17
+ }
18
+
19
+ const PATH_VARIANTS: Variants = {
20
+ animate: {
21
+ x: 2,
22
+ translateX: [0, -3, 0],
23
+ transition: {
24
+ duration: 0.4,
25
+ },
26
+ },
27
+ };
28
+
29
+ const LogoutIcon = forwardRef<LogoutIconHandle, LogoutIconProps>(
30
+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
31
+ const controls = useAnimation();
32
+ const isControlledRef = useRef(false);
33
+
34
+ useImperativeHandle(ref, () => {
35
+ isControlledRef.current = true;
36
+
37
+ return {
38
+ startAnimation: () => controls.start("animate"),
39
+ stopAnimation: () => controls.start("normal"),
40
+ };
41
+ });
42
+
43
+ const handleMouseEnter = useCallback(
44
+ (e: React.MouseEvent<HTMLDivElement>) => {
45
+ if (isControlledRef.current) {
46
+ onMouseEnter?.(e);
47
+ } else {
48
+ controls.start("animate");
49
+ }
50
+ },
51
+ [controls, onMouseEnter]
52
+ );
53
+
54
+ const handleMouseLeave = useCallback(
55
+ (e: React.MouseEvent<HTMLDivElement>) => {
56
+ if (isControlledRef.current) {
57
+ onMouseLeave?.(e);
58
+ } else {
59
+ controls.start("normal");
60
+ }
61
+ },
62
+ [controls, onMouseLeave]
63
+ );
64
+
65
+ return (
66
+ <div
67
+ className={cn(className)}
68
+ onMouseEnter={handleMouseEnter}
69
+ onMouseLeave={handleMouseLeave}
70
+ {...props}
71
+ >
72
+ <svg
73
+ fill="none"
74
+ height={size}
75
+ stroke="currentColor"
76
+ strokeLinecap="round"
77
+ strokeLinejoin="round"
78
+ strokeWidth="2"
79
+ viewBox="0 0 24 24"
80
+ width={size}
81
+ xmlns="http://www.w3.org/2000/svg"
82
+ >
83
+ <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" />
84
+ <motion.polyline
85
+ animate={controls}
86
+ points="16 17 21 12 16 7"
87
+ variants={PATH_VARIANTS}
88
+ />
89
+ <motion.line
90
+ animate={controls}
91
+ variants={PATH_VARIANTS}
92
+ x1="21"
93
+ x2="9"
94
+ y1="12"
95
+ y2="12"
96
+ />
97
+ </svg>
98
+ </div>
99
+ );
100
+ }
101
+ );
102
+
103
+ LogoutIcon.displayName = "LogoutIcon";
104
+
105
+ export { LogoutIcon };
package/package.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "lucid-icons-animated",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "",
10
+ "license": "ISC"
11
+ }
package/refresh.txt ADDED
@@ -0,0 +1,83 @@
1
+ "use client";
2
+
3
+ import { motion, useAnimation } from "motion/react";
4
+ import type { HTMLAttributes } from "react";
5
+ import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ export interface RefreshCCWIconWIcon {
10
+ startAnimation: () => void;
11
+ stopAnimation: () => void;
12
+ }
13
+
14
+ interface RefreshCCWIcoWIcon extends HTMLAttributes<HTMLDivElement> {
15
+ size?: number;
16
+ }
17
+
18
+ const RefreshCWIcon = forwardRef<RefreshCCWIconWIcon, RefreshCCWIcoWIcon>(
19
+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
20
+ const controls = useAnimation();
21
+ const isControlledRef = useRef(false);
22
+
23
+ useImperativeHandle(ref, () => {
24
+ isControlledRef.current = true;
25
+ return {
26
+ startAnimation: () => controls.start("animate"),
27
+ stopAnimation: () => controls.start("normal"),
28
+ };
29
+ });
30
+
31
+ const handleMouseEnter = useCallback(
32
+ (e: React.MouseEvent<HTMLDivElement>) => {
33
+ if (isControlledRef.current) onMouseEnter?.(e);
34
+ else controls.start("animate");
35
+ },
36
+ [controls, onMouseEnter]
37
+ );
38
+
39
+ const handleMouseLeave = useCallback(
40
+ (e: React.MouseEvent<HTMLDivElement>) => {
41
+ if (isControlledRef.current) onMouseLeave?.(e);
42
+ else controls.start("normal");
43
+ },
44
+ [controls, onMouseLeave]
45
+ );
46
+
47
+ return (
48
+ <div
49
+ className={cn(className)}
50
+ onMouseEnter={handleMouseEnter}
51
+ onMouseLeave={handleMouseLeave}
52
+ {...props}
53
+ >
54
+ <motion.svg
55
+ animate={controls}
56
+ fill="none"
57
+ height={size}
58
+ stroke="currentColor"
59
+ strokeLinecap="round"
60
+ strokeLinejoin="round"
61
+ strokeWidth="2"
62
+ transition={{ type: "spring", stiffness: 250, damping: 25 }}
63
+ variants={{
64
+ normal: { rotate: "0deg" },
65
+ animate: { rotate: "50deg" },
66
+ }}
67
+ viewBox="0 0 24 24"
68
+ width={size}
69
+ xmlns="http://www.w3.org/2000/svg"
70
+ >
71
+ <path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" />
72
+ <path d="M21 3v5h-5" />
73
+ <path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" />
74
+ <path d="M8 16H3v5" />
75
+ </motion.svg>
76
+ </div>
77
+ );
78
+ }
79
+ );
80
+
81
+ RefreshCWIcon.displayName = "RefreshCWIcon";
82
+
83
+ export { RefreshCWIcon };
package/settins.txt ADDED
@@ -0,0 +1,92 @@
1
+ "use client";
2
+
3
+ import { motion, useAnimation } from "motion/react";
4
+ import type { HTMLAttributes } from "react";
5
+ import { forwardRef, useCallback, useImperativeHandle, useRef } from "react";
6
+
7
+ import { cn } from "@/lib/utils";
8
+
9
+ export interface SettingsIconHandle {
10
+ startAnimation: () => void;
11
+ stopAnimation: () => void;
12
+ }
13
+
14
+ interface SettingsIconProps extends HTMLAttributes<HTMLDivElement> {
15
+ size?: number;
16
+ }
17
+
18
+ const SettingsIcon = forwardRef<SettingsIconHandle, SettingsIconProps>(
19
+ ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {
20
+ const controls = useAnimation();
21
+ const isControlledRef = useRef(false);
22
+
23
+ useImperativeHandle(ref, () => {
24
+ isControlledRef.current = true;
25
+
26
+ return {
27
+ startAnimation: () => controls.start("animate"),
28
+ stopAnimation: () => controls.start("normal"),
29
+ };
30
+ });
31
+
32
+ const handleMouseEnter = useCallback(
33
+ (e: React.MouseEvent<HTMLDivElement>) => {
34
+ if (isControlledRef.current) {
35
+ onMouseEnter?.(e);
36
+ } else {
37
+ controls.start("animate");
38
+ }
39
+ },
40
+ [controls, onMouseEnter]
41
+ );
42
+
43
+ const handleMouseLeave = useCallback(
44
+ (e: React.MouseEvent<HTMLDivElement>) => {
45
+ if (isControlledRef.current) {
46
+ onMouseLeave?.(e);
47
+ } else {
48
+ controls.start("normal");
49
+ }
50
+ },
51
+ [controls, onMouseLeave]
52
+ );
53
+
54
+ return (
55
+ <div
56
+ className={cn(className)}
57
+ onMouseEnter={handleMouseEnter}
58
+ onMouseLeave={handleMouseLeave}
59
+ {...props}
60
+ >
61
+ <motion.svg
62
+ animate={controls}
63
+ fill="none"
64
+ height={size}
65
+ stroke="currentColor"
66
+ strokeLinecap="round"
67
+ strokeLinejoin="round"
68
+ strokeWidth="2"
69
+ transition={{ type: "spring", stiffness: 50, damping: 10 }}
70
+ variants={{
71
+ normal: {
72
+ rotate: 0,
73
+ },
74
+ animate: {
75
+ rotate: 180,
76
+ },
77
+ }}
78
+ viewBox="0 0 24 24"
79
+ width={size}
80
+ xmlns="http://www.w3.org/2000/svg"
81
+ >
82
+ <path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" />
83
+ <circle cx="12" cy="12" r="3" />
84
+ </motion.svg>
85
+ </div>
86
+ );
87
+ }
88
+ );
89
+
90
+ SettingsIcon.displayName = "SettingsIcon";
91
+
92
+ export { SettingsIcon };