{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dropzone-required-packet-slots",
  "title": "Required Packet",
  "description": "Slot-level dropzones for checklist-driven packet collection.",
  "dependencies": [
    "lucide-react@^0.460.0"
  ],
  "registryDependencies": [
    "@retab/dropzone",
    "@retab/file-thumbnail",
    "@retab/utils",
    "@retab/file-size-format"
  ],
  "files": [
    {
      "path": "registry/new-york-v4/blocks/dropzone-required-packet-slots.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport { useDropzone } from \"@/components/ui/dropzone\";\nimport { FileThumbnail } from \"@/components/ui/file-thumbnail\";\n\nimport {\n  RejectionRows,\n  type DropzoneExampleProps,\n} from \"./dropzone-example-shared\";\n\nexport function RequiredPacketSlots({ className }: DropzoneExampleProps) {\n  return (\n    <section className={cn(\"bg-background rounded-lg border p-4\", className)}>\n      <div className=\"mb-4 flex items-start justify-between gap-3\">\n        <div>\n          <div className=\"text-sm font-medium\">Required packet</div>\n          <div className=\"text-muted-foreground mt-1 text-xs\">\n            Slot-level dropzones for checklist-driven uploads.\n          </div>\n        </div>\n        <div className=\"bg-muted/30 text-muted-foreground rounded-full border px-2 py-1 text-xs\">\n          checklist\n        </div>\n      </div>\n      <div className=\"grid gap-3 md:grid-cols-3\">\n        {[\"Identity proof\", \"Bank statement\", \"Board approval\"].map((label) => (\n          <PacketSlot key={label} label={label} />\n        ))}\n      </div>\n    </section>\n  );\n}\n\nfunction PacketSlot({ label }: { label: string }) {\n  const dropzone = useDropzone({\n    accept: \".pdf,.png,.jpg,.jpeg,image/*,application/pdf\",\n    maxFiles: 1,\n  });\n  const selectedFile = dropzone.files[0];\n\n  return (\n    <div\n      {...dropzone.getRootProps({\n        className: cn(\n          \"min-h-44 rounded-md border border-dashed bg-muted/20 p-3 transition-colors\",\n          dropzone.isDragging && \"border-foreground/40 bg-accent/35\",\n        ),\n      })}\n    >\n      <input {...dropzone.getInputProps({ className: \"hidden\" })} />\n      <div className=\"mb-3 flex items-center justify-between gap-2\">\n        <div className=\"text-xs font-medium\">{label}</div>\n        <div\n          className={cn(\n            \"rounded-full px-2 py-0.5 text-[11px]\",\n            selectedFile\n              ? \"bg-foreground text-background\"\n              : \"bg-background text-muted-foreground\",\n          )}\n        >\n          {selectedFile ? \"done\" : \"open\"}\n        </div>\n      </div>\n      {selectedFile ? (\n        <div className=\"text-center\">\n          <FileThumbnail\n            file={selectedFile.file}\n            thumbnailShape=\"square\"\n            thumbnailSize=\"lg\"\n            className=\"bg-background mx-auto\"\n          />\n          <div className=\"mt-2 line-clamp-2 text-xs font-medium break-words\">\n            {selectedFile.file.name}\n          </div>\n          <button\n            type=\"button\"\n            className=\"bg-background text-muted-foreground hover:bg-muted hover:text-foreground mt-3 h-7 rounded-md border px-2 text-xs\"\n            onClick={dropzone.clearFiles}\n          >\n            Clear\n          </button>\n        </div>\n      ) : (\n        <div\n          {...dropzone.getTriggerProps({\n            className:\n              \"grid h-28 cursor-pointer place-items-center rounded-md bg-background text-center text-xs text-muted-foreground outline-none focus-visible:ring-[3px] focus-visible:ring-ring/24\",\n          })}\n        >\n          Drop required file.\n        </div>\n      )}\n      <RejectionRows rejections={dropzone.lastIntake.fileRejections} />\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/blocks/dropzone-required-packet-slots.tsx"
    },
    {
      "path": "registry/new-york-v4/blocks/dropzone-example-shared.tsx",
      "content": "\"use client\";\n\nimport { FileText, X } from \"lucide-react\";\n\nimport type {\n  DropzoneFileItem,\n  DropzoneFileRejection,\n} from \"@/components/ui/dropzone\";\nimport { formatFileSize } from \"@/components/ui/file-size-format\";\n\nexport type DropzoneExampleProps = {\n  className?: string;\n};\n\nexport function InlineFileRows({\n  files,\n  onRemove,\n}: {\n  files: DropzoneFileItem[];\n  onRemove: (fileId: string) => void;\n}) {\n  if (files.length === 0) return null;\n\n  return (\n    <div className=\"mt-3 space-y-1\">\n      {files.map((item) => (\n        <div\n          key={item.id}\n          className=\"bg-background flex min-w-0 items-center gap-2 rounded-md border px-2 py-1.5 text-xs\"\n        >\n          <FileText className=\"text-muted-foreground size-3.5 shrink-0\" />\n          <div className=\"min-w-0 flex-1 truncate\">{item.file.name}</div>\n          <div className=\"text-muted-foreground shrink-0\">\n            {formatFileSize(item.file.size)}\n          </div>\n          <button\n            type=\"button\"\n            aria-label={`Remove ${item.file.name}`}\n            className=\"text-muted-foreground hover:bg-muted hover:text-foreground grid size-5 shrink-0 place-items-center rounded-[4px]\"\n            onClick={() => onRemove(item.id)}\n          >\n            <X className=\"size-3\" aria-hidden />\n          </button>\n        </div>\n      ))}\n    </div>\n  );\n}\n\nexport function RejectionRows({\n  rejections,\n}: {\n  rejections: DropzoneFileRejection[];\n}) {\n  if (rejections.length === 0) return null;\n\n  return (\n    <div className=\"text-destructive mt-3 space-y-1 text-xs\">\n      {rejections.map((rejection) => (\n        <div key={`${rejection.file.name}-${rejection.reason}`}>\n          {rejection.file.name}: {getDropzoneRejectionMessage(rejection)}\n        </div>\n      ))}\n    </div>\n  );\n}\n\nfunction getDropzoneRejectionMessage(rejection: DropzoneFileRejection): string {\n  if (rejection.reason === \"file-invalid-type\") {\n    return \"This file type is not supported here.\";\n  }\n  if (rejection.reason === \"file-too-large\") {\n    return `File must be ${formatFileSize(rejection.maxSize)} or smaller.`;\n  }\n  if (rejection.reason === \"custom\") {\n    return rejection.code;\n  }\n  return rejection.maxFiles === 1\n    ? \"Only one file can be selected.\"\n    : `Only ${rejection.maxFiles} files can be selected.`;\n}\n",
      "type": "registry:component",
      "target": "@components/blocks/dropzone-example-shared.tsx"
    }
  ],
  "categories": [
    "dropzone"
  ],
  "type": "registry:block"
}