-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathattach-file.json
21 lines (21 loc) · 1.76 KB
/
attach-file.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "attach-file",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "attach-file.tsx",
"content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst pathVariants: Variants = {\n normal: { pathLength: 1, opacity: 1, pathOffset: 0 },\n animate: {\n opacity: [0, 1],\n pathLength: [0, 1],\n transition: {\n delay: 0.1,\n duration: 0.4,\n opacity: { duration: 0.1, delay: 0.1 },\n },\n },\n};\n\nconst AttachFileIcon = () => {\n const controls = useAnimation();\n\n return (\n <div\n className=\"cursor-pointer select-none p-2 hover:bg-accent rounded-md transition-colors duration-200 flex items-center justify-center\"\n onMouseEnter={() => controls.start('animate')}\n onMouseLeave={() => controls.start('normal')}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <motion.path\n variants={pathVariants}\n initial=\"normal\"\n animate={controls}\n d=\"M6 7.90909V16C6 19.3137 8.68629 22 12 22V22C15.3137 22 18 19.3137 18 16V6C18 3.79086 16.2091 2 14 2V2C11.7909 2 10 3.79086 10 6V15.1818C10 16.2864 10.8954 17.1818 12 17.1818V17.1818C13.1046 17.1818 14 16.2864 14 15.1818V8\"\n />\n </svg>\n </div>\n );\n};\n\nexport { AttachFileIcon };\n",
"type": "registry:ui"
}
]
}