{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "delete",
  "type": "registry:ui",
  "registryDependencies": [],
  "dependencies": ["motion"],
  "devDependencies": [],
  "files": [
    {
      "path": "delete.tsx",
      "content": "\"use client\";\n\nimport type { Transition, Variants } from \"motion/react\";\nimport { motion, useAnimation } from \"motion/react\";\nimport type { HTMLAttributes } from \"react\";\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface DeleteIconHandle {\n  startAnimation: () => void;\n  stopAnimation: () => void;\n}\n\ninterface DeleteIconProps extends HTMLAttributes<HTMLDivElement> {\n  size?: number;\n}\n\nconst LID_VARIANTS: Variants = {\n  normal: { y: 0 },\n  animate: { y: -1.1 },\n};\n\nconst SPRING_TRANSITION: Transition = {\n  type: \"spring\",\n  stiffness: 500,\n  damping: 30,\n};\n\nconst DeleteIcon = forwardRef<DeleteIconHandle, DeleteIconProps>(\n  ({ onMouseEnter, onMouseLeave, className, size = 28, ...props }, ref) => {\n    const controls = useAnimation();\n    const isControlledRef = useRef(false);\n\n    useImperativeHandle(ref, () => {\n      isControlledRef.current = true;\n\n      return {\n        startAnimation: () => controls.start(\"animate\"),\n        stopAnimation: () => controls.start(\"normal\"),\n      };\n    });\n\n    const handleMouseEnter = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseEnter?.(e);\n        } else {\n          controls.start(\"animate\");\n        }\n      },\n      [controls, onMouseEnter]\n    );\n\n    const handleMouseLeave = useCallback(\n      (e: React.MouseEvent<HTMLDivElement>) => {\n        if (isControlledRef.current) {\n          onMouseLeave?.(e);\n        } else {\n          controls.start(\"normal\");\n        }\n      },\n      [controls, onMouseLeave]\n    );\n\n    return (\n      <div\n        className={cn(className)}\n        onMouseEnter={handleMouseEnter}\n        onMouseLeave={handleMouseLeave}\n        {...props}\n      >\n        <svg\n          fill=\"none\"\n          height={size}\n          stroke=\"currentColor\"\n          strokeLinecap=\"round\"\n          strokeLinejoin=\"round\"\n          strokeWidth=\"2\"\n          viewBox=\"0 0 24 24\"\n          width={size}\n          xmlns=\"http://www.w3.org/2000/svg\"\n        >\n          <motion.g\n            animate={controls}\n            transition={SPRING_TRANSITION}\n            variants={LID_VARIANTS}\n          >\n            <path d=\"M3 6h18\" />\n            <path d=\"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2\" />\n          </motion.g>\n          <motion.path\n            animate={controls}\n            d=\"M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8\"\n            transition={SPRING_TRANSITION}\n            variants={{\n              normal: { d: \"M19 8v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V8\" },\n              animate: { d: \"M19 9v12c0 1-1 2-2 2H7c-1 0-2-1-2-2V9\" },\n            }}\n          />\n          <motion.line\n            animate={controls}\n            transition={SPRING_TRANSITION}\n            variants={{\n              normal: { y1: 11, y2: 17 },\n              animate: { y1: 11.5, y2: 17.5 },\n            }}\n            x1=\"10\"\n            x2=\"10\"\n            y1=\"11\"\n            y2=\"17\"\n          />\n          <motion.line\n            animate={controls}\n            transition={SPRING_TRANSITION}\n            variants={{\n              normal: { y1: 11, y2: 17 },\n              animate: { y1: 11.5, y2: 17.5 },\n            }}\n            x1=\"14\"\n            x2=\"14\"\n            y1=\"11\"\n            y2=\"17\"\n          />\n        </svg>\n      </div>\n    );\n  }\n);\n\nDeleteIcon.displayName = \"DeleteIcon\";\n\nexport { DeleteIcon };\n",
      "type": "registry:ui"
    }
  ]
}
