-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathdownload.json
21 lines (21 loc) · 1.57 KB
/
download.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "download",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "download.tsx",
"content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst arrowVariants: Variants = {\n normal: { y: 0 },\n animate: {\n y: 2,\n transition: {\n type: 'spring',\n stiffness: 200,\n damping: 10,\n mass: 1,\n },\n },\n};\n\nconst DownloadIcon = () => {\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 <path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\" />\n <motion.g variants={arrowVariants} animate={controls}>\n <polyline points=\"7 10 12 15 17 10\" />\n <line x1=\"12\" x2=\"12\" y1=\"15\" y2=\"3\" />\n </motion.g>\n </svg>\n </div>\n );\n};\n\nexport { DownloadIcon };\n",
"type": "registry:ui"
}
]
}