33 lines
3.3 KiB
JSON
33 lines
3.3 KiB
JSON
{
|
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
"name": "plus-icon",
|
|
"type": "registry:ui",
|
|
"title": "Plus Icon",
|
|
"description": "Plus icon component.",
|
|
"dependencies": [
|
|
"motion"
|
|
],
|
|
"files": [
|
|
{
|
|
"path": "registry/icons/plus/index.tsx",
|
|
"content": "'use client';\n\nimport * as React from 'react';\nimport { motion, type Variants } from 'motion/react';\n\nimport {\n getVariants,\n useAnimateIconContext,\n IconWrapper,\n type IconProps,\n} from '@/components/animate-ui/icons/icon';\n\ntype PlusProps = IconProps<keyof typeof animations>;\n\nconst animations = {\n default: {\n line1: {\n initial: {\n rotate: 0,\n transition: { ease: 'easeInOut', duration: 0.4, delay: 0.1 },\n },\n animate: {\n rotate: 90,\n transition: { ease: 'easeInOut', duration: 0.4, delay: 0.1 },\n },\n },\n line2: {\n initial: {\n rotate: 0,\n transition: { ease: 'easeInOut', duration: 0.4 },\n },\n animate: {\n rotate: 90,\n transition: { ease: 'easeInOut', duration: 0.4 },\n },\n },\n } satisfies Record<string, Variants>,\n x: {\n line1: {\n initial: {\n rotate: 0,\n x1: 12,\n y1: 19,\n x2: 12,\n y2: 5,\n transition: { ease: 'easeInOut', duration: 0.3, delay: 0.1 },\n },\n animate: {\n rotate: 45,\n x1: 12,\n y1: 20.5,\n x2: 12,\n y2: 3.5,\n transition: { ease: 'easeInOut', duration: 0.3, delay: 0.1 },\n },\n },\n line2: {\n initial: {\n rotate: 0,\n x1: 5,\n y1: 12,\n x2: 19,\n y2: 12,\n transition: { ease: 'easeInOut', duration: 0.3 },\n },\n animate: {\n rotate: 45,\n x1: 3.5,\n y1: 12,\n x2: 20.5,\n y2: 12,\n transition: { ease: 'easeInOut', duration: 0.3 },\n },\n },\n } satisfies Record<string, Variants>,\n} as const;\n\nfunction IconComponent({ size, ...props }: PlusProps) {\n const { controls } = useAnimateIconContext();\n const variants = getVariants(animations);\n\n return (\n <motion.svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n {...props}\n >\n <motion.line\n x1={12}\n y1={19}\n x2={12}\n y2={5}\n variants={variants.line1}\n initial=\"initial\"\n animate={controls}\n />\n <motion.line\n x1={5}\n y1={12}\n x2={19}\n y2={12}\n variants={variants.line2}\n initial=\"initial\"\n animate={controls}\n />\n </motion.svg>\n );\n}\n\nfunction Plus(props: PlusProps) {\n return <IconWrapper icon={IconComponent} {...props} />;\n}\n\nexport {\n animations,\n Plus,\n Plus as PlusIcon,\n type PlusProps,\n type PlusProps as PlusIconProps,\n};\n",
|
|
"type": "registry:ui",
|
|
"target": "components/animate-ui/icons/plus.tsx"
|
|
}
|
|
],
|
|
"meta": {
|
|
"keywords": [
|
|
"plus",
|
|
"add",
|
|
"sum",
|
|
"addition",
|
|
"math",
|
|
"maths",
|
|
"new",
|
|
"+",
|
|
"increase",
|
|
"positive",
|
|
"calculate"
|
|
]
|
|
}
|
|
} |