-
Notifications
You must be signed in to change notification settings - Fork 95
/
chart-column-decreasing.json
21 lines (21 loc) · 2.32 KB
/
chart-column-decreasing.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "chart-column-decreasing",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "chart-column-decreasing.tsx",
"content": "'use client';\n\nimport { type Variants, motion, useAnimation } from 'motion/react';\n\nconst frameVariants: Variants = {\n visible: { opacity: 1 },\n hidden: { opacity: 1 },\n};\n\nconst lineVariants: Variants = {\n visible: { pathLength: 1, opacity: 1 },\n hidden: { pathLength: 0, opacity: 0 },\n};\n\nconst ChartColumnDecreasingIcon = () => {\n const controls = useAnimation();\n\n const handleHoverStart = async () => {\n await controls.start((i) => ({\n pathLength: 0,\n opacity: 0,\n transition: { delay: i * 0.1, duration: 0.3 },\n }));\n await controls.start((i) => ({\n pathLength: 1,\n opacity: 1,\n transition: { delay: i * 0.1, duration: 0.3 },\n }));\n };\n\n const handleHoverEnd = () => {\n controls.start('visible');\n };\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={handleHoverStart}\n onMouseLeave={handleHoverEnd}\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={lineVariants}\n initial=\"visible\"\n animate={controls}\n custom={1}\n d=\"M13 17V9\"\n />\n <motion.path\n variants={lineVariants}\n initial=\"visible\"\n animate={controls}\n custom={2}\n d=\"M18 17v-3\"\n />\n <motion.path variants={frameVariants} d=\"M3 3v16a2 2 0 0 0 2 2h16\" />\n <motion.path\n variants={lineVariants}\n initial=\"visible\"\n animate={controls}\n custom={0}\n d=\"M8 17V5\"\n />\n </svg>\n </div>\n );\n};\n\nexport { ChartColumnDecreasingIcon };\n",
"type": "registry:ui"
}
]
}