-
Notifications
You must be signed in to change notification settings - Fork 95
/
delete.json
21 lines (21 loc) · 2.46 KB
/
delete.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "delete",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "delete.tsx",
"content": "'use client';\n\nimport type { Variants } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst lidVariants: Variants = {\n normal: { y: 0 },\n animate: { y: -1.1 },\n};\n\nconst springTransition = {\n type: 'spring',\n stiffness: 500,\n damping: 30,\n};\n\nconst DeleteIcon = () => {\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.g\n variants={lidVariants}\n animate={controls}\n transition={springTransition}\n >\n <path d=\"M3 6h18\" />\n <path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\" />\n </motion.g>\n <motion.path\n d=\"M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8\"\n variants={{\n normal: { d: 'M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8' },\n animate: { d: 'M19 9v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V9' },\n }}\n animate={controls}\n transition={springTransition}\n />\n <motion.line\n x1=\"10\"\n x2=\"10\"\n y1=\"11\"\n y2=\"17\"\n variants={{\n normal: { y1: 11, y2: 17 },\n animate: { y1: 11.5, y2: 17.5 },\n }}\n animate={controls}\n transition={springTransition}\n />\n <motion.line\n x1=\"14\"\n x2=\"14\"\n y1=\"11\"\n y2=\"17\"\n variants={{\n normal: { y1: 11, y2: 17 },\n animate: { y1: 11.5, y2: 17.5 },\n }}\n animate={controls}\n transition={springTransition}\n />\n </svg>\n </div>\n );\n};\n\nexport { DeleteIcon };\n",
"type": "registry:ui"
}
]
}