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

25 lines
2.9 KiB
JSON

{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "copy-icon",
"type": "registry:ui",
"title": "Copy Icon",
"description": "Copy icon component.",
"dependencies": [
"motion"
],
"files": [
{
"path": "registry/icons/copy/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 CopyProps = IconProps<keyof typeof animations>;\n\nconst animations = {\n default: {\n rect: {\n initial: {\n y: 0,\n x: 0,\n },\n animate: {\n y: -3,\n x: -3,\n transition: {\n duration: 0.3,\n ease: 'easeInOut',\n },\n },\n },\n path: {\n initial: {\n y: 0,\n x: 0,\n },\n animate: {\n y: 3,\n x: 3,\n transition: {\n duration: 0.3,\n ease: 'easeInOut',\n },\n },\n },\n } satisfies Record<string, Variants>,\n 'default-loop': {\n rect: {\n initial: {\n y: 0,\n x: 0,\n },\n animate: {\n y: [0, -3, 0],\n x: [0, -3, 0],\n transition: {\n duration: 0.6,\n ease: 'easeInOut',\n },\n },\n },\n path: {\n initial: {\n y: 0,\n x: 0,\n },\n animate: {\n y: [0, 3, 0],\n x: [0, 3, 0],\n transition: {\n duration: 0.6,\n ease: 'easeInOut',\n },\n },\n },\n } satisfies Record<string, Variants>,\n} as const;\n\nfunction IconComponent({ size, ...props }: CopyProps) {\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.rect\n width={14}\n height={14}\n x={8}\n y={8}\n rx={2}\n ry={2}\n variants={variants.rect}\n initial=\"initial\"\n animate={controls}\n />\n <motion.path\n d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"\n variants={variants.path}\n initial=\"initial\"\n animate={controls}\n />\n </motion.svg>\n );\n}\n\nfunction Copy(props: CopyProps) {\n return <IconWrapper icon={IconComponent} {...props} />;\n}\n\nexport {\n animations,\n Copy,\n Copy as CopyIcon,\n type CopyProps,\n type CopyProps as CopyIconProps,\n};\n",
"type": "registry:ui",
"target": "components/animate-ui/icons/copy.tsx"
}
],
"meta": {
"keywords": [
"clone",
"duplicate",
"multiple"
]
}
}