{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "file-uploader",
  "type": "registry:ui",
  "title": "File Uploader",
  "dependencies": [
    "motion",
    "lucide-react"
  ],
  "files": [
    {
      "path": "components/ui/file-uploader.tsx",
      "content": "\"use client\";\n\nimport React, { useRef, useState } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { FileText, Trash2, UploadCloud } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface UploadedFile {\n  name: string;\n  size: string;\n}\n\nexport function FileUploader({ className }: { className?: string }) {\n  const inputRef = useRef<HTMLInputElement>(null);\n  const [dragging, setDragging] = useState(false);\n  const [files, setFiles] = useState<UploadedFile[]>([\n    { name: \"magnetic-button.tsx\", size: \"2.4 KB\" },\n  ]);\n\n  const addFiles = (fileList: FileList | null) => {\n    if (!fileList) return;\n    const added = Array.from(fileList).map((f) => ({\n      name: f.name,\n      size: `${Math.max(1, Math.round(f.size / 1024))} KB`,\n    }));\n    setFiles((prev) => [...prev, ...added]);\n  };\n\n  return (\n    <div className={cn(\"w-full max-w-md space-y-3\", className)}>\n      <motion.div\n        onClick={() => inputRef.current?.click()}\n        onDragOver={(e) => {\n          e.preventDefault();\n          setDragging(true);\n        }}\n        onDragLeave={() => setDragging(false)}\n        onDrop={(e) => {\n          e.preventDefault();\n          setDragging(false);\n          addFiles(e.dataTransfer.files);\n        }}\n        animate={{ scale: dragging ? 1.02 : 1 }}\n        className={cn(\n          \"flex flex-col items-center justify-center rounded-2xl border border-dashed p-6 text-center cursor-pointer transition-colors\",\n          dragging\n            ? \"border-blue-400 bg-blue-500/10\"\n            : \"border-white/15 bg-zinc-900/60 hover:border-white/30\"\n        )}\n      >\n        <input\n          ref={inputRef}\n          type=\"file\"\n          multiple\n          className=\"hidden\"\n          onChange={(e) => addFiles(e.target.files)}\n        />\n        <div className=\"mb-2 flex h-10 w-10 items-center justify-center rounded-xl border border-white/10 bg-zinc-800 text-zinc-300\">\n          <UploadCloud className=\"h-5 w-5\" />\n        </div>\n        <p className=\"text-xs font-medium text-zinc-200\">\n          Drop files here or click to browse\n        </p>\n        <p className=\"mt-1 text-[11px] text-zinc-500\">\n          TSX, JSON, SVG up to 10MB\n        </p>\n      </motion.div>\n\n      <AnimatePresence>\n        {files.map((file, idx) => (\n          <motion.div\n            key={`${file.name}-${idx}`}\n            initial={{ opacity: 0, y: 6 }}\n            animate={{ opacity: 1, y: 0 }}\n            exit={{ opacity: 0, x: -16 }}\n            className=\"flex items-center justify-between rounded-xl border border-white/10 bg-zinc-900/80 px-3 py-2 text-xs\"\n          >\n            <div className=\"flex items-center gap-2.5 truncate\">\n              <FileText className=\"h-4 w-4 shrink-0 text-blue-400\" />\n              <span className=\"truncate text-zinc-200\">{file.name}</span>\n              <span className=\"text-[10px] text-zinc-500\">{file.size}</span>\n            </div>\n            <button\n              onClick={() => setFiles((f) => f.filter((_, i) => i !== idx))}\n              className=\"text-zinc-500 hover:text-red-400 cursor-pointer transition-colors\"\n            >\n              <Trash2 className=\"h-3.5 w-3.5\" />\n            </button>\n          </motion.div>\n        ))}\n      </AnimatePresence>\n    </div>\n  );\n}\n\n",
      "type": "registry:ui"
    }
  ]
}