-
Notifications
You must be signed in to change notification settings - Fork 95
/
file-pen-line.json
21 lines (21 loc) · 2.03 KB
/
file-pen-line.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "file-pen-line",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "file-pen-line.tsx",
"content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst penVariants: Variants = {\n normal: {\n rotate: 0,\n x: 0,\n y: 0,\n },\n animate: {\n rotate: [-0.3, 0.2, -0.4],\n x: [0, -0.5, 1, 0],\n y: [0, 1, -0.5, 0],\n transition: {\n duration: 0.5,\n repeat: 1,\n ease: 'easeInOut',\n },\n },\n};\n\nconst FilePenLineIcon = () => {\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=\"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2\" />\n <motion.path\n d=\"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z\"\n initial=\"normal\"\n animate={controls}\n variants={penVariants}\n />\n <motion.path\n d=\"M8 18h1\"\n variants={{\n normal: { d: 'M8 18h1' },\n animate: { d: 'M8 18h5' },\n }}\n animate={controls}\n transition={{ duration: 0.5 }}\n />\n </svg>\n </div>\n );\n};\n\nexport { FilePenLineIcon };\n",
"type": "registry:ui"
}
]
}