Fortura/apps/www/public/r/heart-icon.json
2025-08-20 04:12:49 -06:00

28 lines
2.6 KiB
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "heart-icon",
"type": "registry:ui",
"title": "Heart Icon",
"description": "Heart icon component.",
"dependencies": [
"motion"
],
"files": [
{
"path": "registry/icons/heart/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 HeartProps = IconProps<keyof typeof animations>;\n\nconst animations = {\n default: {\n group: {\n initial: {\n scale: 1,\n },\n animate: {\n scale: [1, 0.9, 1.2, 1],\n transition: { duration: 0.6, ease: 'easeInOut' },\n },\n },\n path: {},\n } satisfies Record<string, Variants>,\n fill: {\n group: {\n initial: {\n scale: 1,\n },\n animate: {\n scale: [1, 0.9, 1.2, 1],\n transition: { duration: 0.6, ease: 'easeInOut' },\n },\n },\n path: {\n initial: {\n fill: 'currentColor',\n fillOpacity: 0,\n },\n animate: {\n fillOpacity: 1,\n transition: { delay: 0.2 },\n },\n },\n } satisfies Record<string, Variants>,\n} as const;\n\nfunction IconComponent({ size, ...props }: HeartProps) {\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 variants={variants.group}\n initial=\"initial\"\n animate={controls}\n {...props}\n >\n <motion.path\n d=\"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z\"\n variants={variants.path}\n initial=\"initial\"\n animate={controls}\n />\n </motion.svg>\n );\n}\n\nfunction Heart(props: HeartProps) {\n return <IconWrapper icon={IconComponent} {...props} />;\n}\n\nexport {\n animations,\n Heart,\n Heart as HeartIcon,\n type HeartProps,\n type HeartProps as HeartIconProps,\n};\n",
"type": "registry:ui",
"target": "components/animate-ui/icons/heart.tsx"
}
],
"meta": {
"keywords": [
"like",
"love",
"emotion",
"suit",
"playing",
"cards"
]
}
}