{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "about-this-computer",
  "title": "About This Computer",
  "description": "Mac OS 9 About This Computer window with version, built-in/virtual memory, largest unused block and per-application memory bars.",
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json",
    "https://nostalgia-ui.com/r/retro-icons.json",
    "https://nostalgia-ui.com/r/retro-window.json"
  ],
  "files": [
    {
      "path": "registry/new-york/blocks/about-this-computer.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n  RetroIconApplication,\n  RetroIconFinder,\n} from \"@/registry/new-york/ui/retro-icons\"\nimport { RetroWindow } from \"@/registry/new-york/ui/retro-window\"\n\n/* ------------------------------------------------------------------ */\n/*  Types                                                              */\n/* ------------------------------------------------------------------ */\n\ninterface AboutThisComputerApp {\n  name: string\n  /** Memory partition allocated to the app, in MB. */\n  memory: number\n  /** Portion of the partition actually in use, in MB. Defaults to `memory`. */\n  used?: number\n  /** 16px icon. Defaults to the generic application diamond. */\n  icon?: React.ReactNode\n}\n\ninterface AboutThisComputerBlockProps\n  extends Omit<React.ComponentPropsWithoutRef<typeof RetroWindow>, \"children\" | \"title\"> {\n  /** Mac OS version string. Defaults to \"9.2.2\". */\n  version?: string\n  /** Built-in memory in MB. Defaults to 256. */\n  totalMemory?: number\n  /** Virtual memory in MB, or `false` for \"Off\". Defaults to totalMemory + 1. */\n  virtualMemory?: number | false\n  /** Volume hosting the VM file. Defaults to \"Macintosh HD\". */\n  virtualMemoryVolume?: string\n  /** Largest unused block in MB. Defaults to totalMemory minus all partitions. */\n  largestUnusedBlock?: number\n  /** Running applications. */\n  apps?: AboutThisComputerApp[]\n  /** Window title. Defaults to \"About This Computer\". */\n  title?: string\n}\n\nconst DEFAULT_APPS: AboutThisComputerApp[] = [\n  { name: \"Mac OS\", memory: 42.6, used: 38.1 },\n  { name: \"Finder\", memory: 8, used: 3.4 },\n  { name: \"SimpleText\", memory: 1, used: 0.4 },\n]\n\n/* ------------------------------------------------------------------ */\n/*  Helpers                                                            */\n/* ------------------------------------------------------------------ */\n\nfunction formatMB(mb: number) {\n  const rounded = Math.round(mb * 10) / 10\n  return `${rounded.toLocaleString(\"en-US\", { maximumFractionDigits: 1 })} MB`\n}\n\nfunction InfoRow({ label, value }: { label: string; value: React.ReactNode }) {\n  return (\n    <div className=\"flex flex-wrap gap-x-2\">\n      <dt className=\"font-[family-name:var(--os9-font-heading)] text-[12px] tracking-[0.42px] text-os9-black\">\n        {label}:\n      </dt>\n      <dd className=\"font-[family-name:var(--os9-font-sans)] text-[10px] leading-[1.5] text-os9-black\">\n        {value}\n      </dd>\n    </div>\n  )\n}\n\n/** Horizontal memory bar: outline = partition, azul fill = used. */\nfunction MemoryBar({\n  memory,\n  used,\n  scale,\n}: {\n  memory: number\n  used: number\n  scale: number\n}) {\n  const partitionPct = scale > 0 ? Math.max(2, (memory / scale) * 100) : 0\n  const usedPct = memory > 0 ? Math.min(100, Math.max(0, (used / memory) * 100)) : 0\n  return (\n    <div className=\"h-[12px] w-full\" aria-hidden>\n      <div\n        className=\"relative h-full border border-os9-black bg-os9-gray-400 shadow-[inset_1px_1px_0_var(--os9-white),inset_-1px_-1px_0_var(--os9-gray-700)]\"\n        style={{ width: `${partitionPct}%` }}\n      >\n        <div\n          className=\"absolute inset-y-0 left-0 bg-os9-azul shadow-[inset_0_1px_0_var(--os9-focus)]\"\n          style={{ width: `${usedPct}%` }}\n        />\n      </div>\n    </div>\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  AboutThisComputerBlock                                             */\n/* ------------------------------------------------------------------ */\n\nconst AboutThisComputerBlock = React.forwardRef<\n  HTMLDivElement,\n  AboutThisComputerBlockProps\n>(function AboutThisComputerBlock(\n  {\n    version = \"9.2.2\",\n    totalMemory = 256,\n    virtualMemory,\n    virtualMemoryVolume = \"Macintosh HD\",\n    largestUnusedBlock,\n    apps = DEFAULT_APPS,\n    title = \"About This Computer\",\n    className,\n    ...props\n  },\n  ref\n) {\n  const allocated = apps.reduce((sum, a) => sum + a.memory, 0)\n  const unused = largestUnusedBlock ?? Math.max(0, totalMemory - allocated)\n  const vm = virtualMemory ?? totalMemory + 1\n  const scale = Math.max(0, ...apps.map((a) => a.memory))\n\n  return (\n    <RetroWindow\n      ref={ref}\n      title={title}\n      className={cn(\"w-full max-w-[520px]\", className)}\n      {...props}\n    >\n      {/* Summary */}\n      <div className=\"flex flex-wrap items-center gap-x-6 gap-y-3 px-2 pb-3 pt-2\">\n        <div className=\"flex items-center gap-3\">\n          <RetroIconFinder size=\"xl\" />\n          <p className=\"os9-heading whitespace-nowrap text-[24px] text-os9-black\">\n            Mac OS {version.split(\".\")[0]}\n          </p>\n        </div>\n\n        <dl className=\"flex min-w-0 flex-1 basis-[200px] flex-col gap-1\">\n          <InfoRow label=\"Version\" value={`Mac OS ${version}`} />\n          <InfoRow label=\"Built-in Memory\" value={formatMB(totalMemory)} />\n          <InfoRow\n            label=\"Virtual Memory\"\n            value={\n              vm === false\n                ? \"Off\"\n                : `${formatMB(vm)} used on ${virtualMemoryVolume}`\n            }\n          />\n          <InfoRow label=\"Largest Unused Block\" value={formatMB(unused)} />\n        </dl>\n      </div>\n\n      {/* Separator */}\n      <div className=\"h-[2px] border-t border-os9-gray-700 bg-os9-white\" aria-hidden />\n\n      {/* Per-application memory */}\n      <table className=\"mt-2 w-full border-collapse\">\n        <caption className=\"sr-only\">Memory used by open applications</caption>\n        <thead className=\"sr-only\">\n          <tr>\n            <th scope=\"col\">Application</th>\n            <th scope=\"col\">Memory</th>\n            <th scope=\"col\">Usage</th>\n          </tr>\n        </thead>\n        <tbody>\n          {apps.map((app) => {\n            const used = app.used ?? app.memory\n            return (\n              <tr key={app.name}>\n                <th\n                  scope=\"row\"\n                  className=\"py-[3px] pl-2 pr-3 text-left align-middle font-normal\"\n                >\n                  <span className=\"flex min-w-0 items-center gap-2\">\n                    <span className=\"flex size-4 shrink-0 items-center justify-center\">\n                      {app.icon ?? <RetroIconApplication size=\"sm\" />}\n                    </span>\n                    <span className=\"min-w-0 break-words font-[family-name:var(--os9-font-sans)] text-[10px] text-os9-black\">\n                      {app.name}\n                    </span>\n                  </span>\n                </th>\n                <td className=\"whitespace-nowrap py-[3px] pr-3 text-right align-middle font-[family-name:var(--os9-font-sans)] text-[10px] tabular-nums text-os9-black\">\n                  {formatMB(app.memory)}\n                  <span className=\"sr-only\">\n                    {`, ${formatMB(used)} in use`}\n                  </span>\n                </td>\n                <td className=\"w-[45%] py-[3px] pr-2 align-middle\">\n                  <MemoryBar memory={app.memory} used={used} scale={scale} />\n                </td>\n              </tr>\n            )\n          })}\n        </tbody>\n      </table>\n    </RetroWindow>\n  )\n})\nAboutThisComputerBlock.displayName = \"AboutThisComputerBlock\"\n\nexport { AboutThisComputerBlock }\nexport type { AboutThisComputerBlockProps, AboutThisComputerApp }\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:block"
}