{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "copy-progress",
  "title": "Copy Progress",
  "description": "The Finder “Copy” progress window with items remaining, current file, progress bar, Stop button and an indeterminate “Preparing to copy…” state.",
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json",
    "https://nostalgia-ui.com/r/retro-button.json",
    "https://nostalgia-ui.com/r/retro-icons.json",
    "https://nostalgia-ui.com/r/retro-progress.json",
    "https://nostalgia-ui.com/r/retro-window.json"
  ],
  "files": [
    {
      "path": "registry/new-york/blocks/copy-progress.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { RetroButton } from \"@/registry/new-york/ui/retro-button\"\nimport {\n  RetroIconDocument,\n  RetroIconFolder,\n} from \"@/registry/new-york/ui/retro-icons\"\nimport { RetroProgress } from \"@/registry/new-york/ui/retro-progress\"\nimport { RetroWindow } from \"@/registry/new-york/ui/retro-window\"\n\n/* ------------------------------------------------------------------ */\n/*  Flying-paper animation (folder → folder)                           */\n/* ------------------------------------------------------------------ */\n\nfunction CopyAnimation({ active }: { active: boolean }) {\n  return (\n    <div className=\"relative h-8 w-[88px] shrink-0\" aria-hidden>\n      <RetroIconFolder className=\"absolute left-0 top-0\" />\n      <RetroIconFolder className=\"absolute right-0 top-0\" />\n      {active && (\n        <span className=\"copy-progress-paper absolute left-[20px] top-[4px]\">\n          <RetroIconDocument size=\"sm\" />\n        </span>\n      )}\n      <style href=\"copy-progress-block\" precedence=\"default\">{`\n        @keyframes copy-progress-fly {\n          0%   { transform: translate(0, 6px); opacity: 0; }\n          15%  { opacity: 1; }\n          50%  { transform: translate(24px, -6px); }\n          85%  { opacity: 1; }\n          100% { transform: translate(48px, 6px); opacity: 0; }\n        }\n        .copy-progress-paper {\n          animation: copy-progress-fly 1.2s linear infinite;\n        }\n        @media (prefers-reduced-motion: reduce) {\n          .copy-progress-paper {\n            animation: none;\n            transform: translate(24px, -6px);\n          }\n        }\n      `}</style>\n    </div>\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  CopyProgressBlock                                                  */\n/* ------------------------------------------------------------------ */\n\ninterface CopyProgressBlockProps\n  extends Omit<React.ComponentPropsWithoutRef<typeof RetroWindow>, \"children\" | \"title\"> {\n  /** Number of items still to copy. */\n  itemsRemaining?: number\n  /** Name of the item currently being copied. */\n  currentItem?: string\n  /**\n   * Progress 0–100. Leave undefined (or set `preparing`) for the\n   * indeterminate \"Preparing to copy…\" state.\n   */\n  progress?: number\n  /** Force the indeterminate \"Preparing to copy…\" state. */\n  preparing?: boolean\n  /** Called by the Stop button, Escape, or Command-period. */\n  onStop?: () => void\n  /** Window title. Defaults to \"Copy\". */\n  title?: string\n  /** Verb used in the labels. Defaults to \"copy\" (e.g. \"move\", \"delete\"). */\n  verb?: string\n}\n\nconst CopyProgressBlock = React.forwardRef<\n  HTMLDivElement,\n  CopyProgressBlockProps\n>(function CopyProgressBlock(\n  {\n    itemsRemaining,\n    currentItem,\n    progress,\n    preparing,\n    onStop,\n    title = \"Copy\",\n    verb = \"copy\",\n    className,\n    onKeyDown,\n    ...props\n  },\n  ref\n) {\n  const isPreparing = preparing ?? progress === undefined\n  const Verb = verb.charAt(0).toUpperCase() + verb.slice(1)\n  const gerund = `${Verb.replace(/e$/, \"\")}ing`\n  const statusId = React.useId()\n\n  return (\n    <RetroWindow\n      ref={ref}\n      title={title}\n      role=\"dialog\"\n      aria-label={title}\n      aria-describedby={statusId}\n      className={cn(\"w-full max-w-[420px]\", className)}\n      onKeyDown={(e) => {\n        onKeyDown?.(e)\n        if (e.defaultPrevented) return\n        // Escape and Command-period are the classic Mac \"cancel\" keys\n        if (e.key === \"Escape\" || (e.key === \".\" && (e.metaKey || e.ctrlKey))) {\n          e.preventDefault()\n          onStop?.()\n        }\n      }}\n      {...props}\n    >\n      <div className=\"flex items-start gap-3 p-1\">\n        <CopyAnimation active={!isPreparing} />\n\n        <div className=\"flex min-w-0 flex-1 flex-col gap-2\">\n          <div\n            id={statusId}\n            aria-live=\"polite\"\n            className=\"flex flex-col gap-1 font-[family-name:var(--os9-font-sans)] text-[10px] leading-[1.4] text-os9-black\"\n          >\n            {isPreparing ? (\n              <p>Preparing to {verb}…</p>\n            ) : (\n              <>\n                {itemsRemaining !== undefined && (\n                  <p>\n                    Items remaining to be {verb === \"copy\" ? \"copied\" : `${verb.replace(/e$/, \"\")}ed`}:{\" \"}\n                    <span className=\"tabular-nums\">\n                      {itemsRemaining.toLocaleString(\"en-US\")}\n                    </span>\n                  </p>\n                )}\n                {currentItem && (\n                  <p className=\"flex min-w-0 gap-1\">\n                    <span className=\"shrink-0\">{gerund}:</span>\n                    <span className=\"truncate\" title={currentItem}>\n                      {currentItem}\n                    </span>\n                  </p>\n                )}\n              </>\n            )}\n          </div>\n\n          <RetroProgress\n            value={isPreparing ? 0 : progress}\n            indeterminate={isPreparing}\n            aria-label={isPreparing ? `Preparing to ${verb}` : `${Verb} progress`}\n          />\n\n          <div className=\"flex justify-end pt-1\">\n            <RetroButton type=\"button\" onClick={onStop} className=\"min-w-[70px]\">\n              Stop\n            </RetroButton>\n          </div>\n        </div>\n      </div>\n    </RetroWindow>\n  )\n})\nCopyProgressBlock.displayName = \"CopyProgressBlock\"\n\nexport { CopyProgressBlock }\nexport type { CopyProgressBlockProps }\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:block"
}