-
Notifications
You must be signed in to change notification settings - Fork 95
/
align-horizontal.json
21 lines (21 loc) · 2.18 KB
/
align-horizontal.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"name": "align-horizontal",
"type": "registry:ui",
"registryDependencies": [],
"dependencies": [
"motion"
],
"devDependencies": [],
"tailwind": {},
"cssVars": {
"light": {},
"dark": {}
},
"files": [
{
"path": "align-horizontal.tsx",
"content": "'use client';\n\nimport type { Transition } from 'motion/react';\nimport { motion, useAnimation } from 'motion/react';\n\nconst defaultTransition: Transition = {\n type: 'spring',\n stiffness: 160,\n damping: 17,\n mass: 1,\n};\n\nconst AlignHorizontalIcon = () => {\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.rect\n variants={{\n normal: { scaleX: 1 },\n animate: { scaleX: 0.85 },\n }}\n animate={controls}\n transition={defaultTransition}\n width={6}\n height={10}\n x={9}\n y={7}\n rx={2}\n />\n <motion.path\n d=\"M4 22V2\"\n variants={{\n normal: { translateX: 0, scaleY: 1 },\n animate: {\n translateX: 2,\n scaleY: 0.9,\n },\n }}\n animate={controls}\n transition={defaultTransition}\n />\n <motion.path\n d=\"M20 22V2\"\n variants={{\n normal: { translateX: 0, scaleY: 1 },\n animate: {\n translateX: -2,\n scaleY: 0.9,\n },\n }}\n animate={controls}\n transition={defaultTransition}\n />\n </svg>\n </div>\n );\n};\n\nexport { AlignHorizontalIcon };\n",
"type": "registry:ui"
}
]
}