{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "get-info",
  "title": "Get Info",
  "description": "Mac OS 9 Finder Get Info window with General Information, Sharing and Memory panes, label pop-up, comments, and Locked / Stationery Pad checkboxes.",
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json",
    "https://nostalgia-ui.com/r/retro-checkbox.json",
    "https://nostalgia-ui.com/r/retro-group-box.json",
    "https://nostalgia-ui.com/r/retro-icons.json",
    "https://nostalgia-ui.com/r/retro-input.json",
    "https://nostalgia-ui.com/r/retro-label.json",
    "https://nostalgia-ui.com/r/retro-little-arrows.json",
    "https://nostalgia-ui.com/r/retro-select.json",
    "https://nostalgia-ui.com/r/retro-separator.json",
    "https://nostalgia-ui.com/r/retro-textarea.json",
    "https://nostalgia-ui.com/r/retro-window.json"
  ],
  "files": [
    {
      "path": "registry/new-york/blocks/get-info.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { RetroCheckbox } from \"@/registry/new-york/ui/retro-checkbox\"\nimport { RetroGroupBox } from \"@/registry/new-york/ui/retro-group-box\"\nimport {\n  RetroIconApplication,\n  RetroIconDocument,\n  RetroIconFolder,\n} from \"@/registry/new-york/ui/retro-icons\"\nimport { RetroInput } from \"@/registry/new-york/ui/retro-input\"\nimport { RetroLabel } from \"@/registry/new-york/ui/retro-label\"\nimport { RetroNumberField } from \"@/registry/new-york/ui/retro-little-arrows\"\nimport {\n  RetroSelect,\n  RetroSelectContent,\n  RetroSelectItem,\n  RetroSelectItemIcon,\n  RetroSelectSeparator,\n  RetroSelectTrigger,\n  RetroSelectValue,\n} from \"@/registry/new-york/ui/retro-select\"\nimport { RetroSeparator } from \"@/registry/new-york/ui/retro-separator\"\nimport { RetroTextarea } from \"@/registry/new-york/ui/retro-textarea\"\nimport { RetroWindow } from \"@/registry/new-york/ui/retro-window\"\n\n/* ------------------------------------------------------------------ */\n/*  Types                                                              */\n/* ------------------------------------------------------------------ */\n\ntype GetInfoPane = \"general\" | \"sharing\" | \"memory\"\n\ntype GetInfoLabel =\n  | \"none\"\n  | \"essential\"\n  | \"hot\"\n  | \"in-progress\"\n  | \"cool\"\n  | \"personal\"\n  | \"project-1\"\n  | \"project-2\"\n\ntype GetInfoPrivilege = \"read-write\" | \"read-only\" | \"write-only\" | \"none\"\n\ninterface GetInfoItem {\n  name: string\n  /** Kind line, e.g. \"application program\". */\n  kind: string\n  /** Picks the default icon. Defaults to \"document\". */\n  type?: \"document\" | \"application\" | \"folder\"\n  /** Custom 32px icon. */\n  icon?: React.ReactNode\n  /** Pre-formatted size, e.g. \"668K on disk (681,229 bytes)\". */\n  size?: string\n  /** Enclosing folder path, e.g. \"Macintosh HD: Applications:\". */\n  where?: string\n  /** Pre-formatted dates (pass strings to keep SSR and client identical). */\n  created?: string\n  modified?: string\n  version?: string\n  label?: GetInfoLabel\n  comments?: string\n  locked?: boolean\n  /** Documents only. */\n  stationery?: boolean\n  /** Applications only: enables the Memory pane (values in K). */\n  memory?: { suggested: number; minimum: number; preferred: number }\n  sharing?: {\n    shared: boolean\n    owner: string\n    everyone: GetInfoPrivilege\n  }\n}\n\ninterface GetInfoBlockProps\n  extends Omit<\n    React.ComponentPropsWithoutRef<typeof RetroWindow>,\n    \"title\" | \"children\" | \"onChange\"\n  > {\n  item: GetInfoItem\n  /** Initially shown pane. Defaults to \"general\". */\n  defaultPane?: GetInfoPane\n  /** Fired with the edited item after every change. */\n  onChange?: (item: GetInfoItem) => void\n  /** Window title. Defaults to \"<name> Info\". */\n  title?: string\n  /** Users offered in the Sharing pane Owner pop-up. */\n  users?: string[]\n}\n\n/* ------------------------------------------------------------------ */\n/*  Data                                                               */\n/* ------------------------------------------------------------------ */\n\n/** Finder label colours are user data, so they carry their own values. */\nconst LABELS: { id: GetInfoLabel; name: string; color?: string }[] = [\n  { id: \"none\", name: \"None\" },\n  { id: \"essential\", name: \"Essential\", color: \"#ff6600\" },\n  { id: \"hot\", name: \"Hot\", color: \"#dd0000\" },\n  { id: \"in-progress\", name: \"In Progress\", color: \"#ff0099\" },\n  { id: \"cool\", name: \"Cool\", color: \"#00aaff\" },\n  { id: \"personal\", name: \"Personal\", color: \"#0000cc\" },\n  { id: \"project-1\", name: \"Project 1\", color: \"#009900\" },\n  { id: \"project-2\", name: \"Project 2\", color: \"#663300\" },\n]\n\nconst PRIVILEGES: { id: GetInfoPrivilege; name: string }[] = [\n  { id: \"read-write\", name: \"Read & Write\" },\n  { id: \"read-only\", name: \"Read only\" },\n  { id: \"write-only\", name: \"Write only (Drop Box)\" },\n  { id: \"none\", name: \"None\" },\n]\n\nconst TEXT = \"font-[family-name:var(--os9-font-sans)] text-[10px] leading-[1.4] text-os9-black\"\n\n/* ------------------------------------------------------------------ */\n/*  Pieces                                                             */\n/* ------------------------------------------------------------------ */\n\nfunction InfoRow({\n  label,\n  htmlFor,\n  labelId,\n  children,\n}: {\n  label: string\n  htmlFor?: string\n  labelId?: string\n  children: React.ReactNode\n}) {\n  const cls = \"pt-[1px] text-right font-[family-name:var(--os9-font-sans)] text-[10px] font-bold text-os9-black\"\n  return (\n    <>\n      <dt className={cls}>\n        {htmlFor || labelId ? (\n          <RetroLabel htmlFor={htmlFor} id={labelId} className=\"font-bold\">\n            {label}\n          </RetroLabel>\n        ) : (\n          label\n        )}\n      </dt>\n      <dd className={cn(TEXT, \"min-w-0 break-words\")}>{children}</dd>\n    </>\n  )\n}\n\nfunction Swatch({ color }: { color?: string }) {\n  return (\n    <span\n      aria-hidden=\"true\"\n      className=\"inline-block size-[10px] shrink-0 border border-os9-black\"\n      style={{ background: color ?? \"var(--os9-white)\" }}\n    />\n  )\n}\n\nfunction defaultIcon(type: GetInfoItem[\"type\"]) {\n  if (type === \"application\") return <RetroIconApplication />\n  if (type === \"folder\") return <RetroIconFolder />\n  return <RetroIconDocument />\n}\n\n/* ------------------------------------------------------------------ */\n/*  GetInfoBlock                                                       */\n/* ------------------------------------------------------------------ */\n\nconst GetInfoBlock = React.forwardRef<HTMLDivElement, GetInfoBlockProps>(\n  function GetInfoBlock(\n    {\n      item: itemProp,\n      defaultPane = \"general\",\n      onChange,\n      title,\n      users = [\"Owner\", \"Guest\", \"Kids\"],\n      className,\n      contentClassName,\n      ...props\n    },\n    ref\n  ) {\n    const id = React.useId()\n    const [item, setItem] = React.useState<GetInfoItem>(itemProp)\n    const [prevItemProp, setPrevItemProp] = React.useState(itemProp)\n    if (prevItemProp !== itemProp) {\n      setPrevItemProp(itemProp)\n      setItem(itemProp)\n    }\n\n    const hasMemory = !!item.memory\n    const [pane, setPane] = React.useState<GetInfoPane>(\n      defaultPane === \"memory\" && !itemProp.memory ? \"general\" : defaultPane\n    )\n\n    const update = (patch: Partial<GetInfoItem>) => {\n      const next = { ...item, ...patch }\n      setItem(next)\n      onChange?.(next)\n    }\n\n    const sharing = item.sharing ?? { shared: false, owner: users[0] ?? \"Owner\", everyone: \"read-only\" as const }\n    const isApp = item.type === \"application\"\n    const locked = !!item.locked\n\n    return (\n      <RetroWindow\n        ref={ref}\n        title={title ?? `${itemProp.name} Info`}\n        className={cn(\"w-full max-w-[340px]\", className)}\n        contentClassName={cn(\"flex flex-col gap-[10px] p-[12px]\", contentClassName)}\n        {...props}\n      >\n        {/* Icon + name */}\n        <div className=\"flex items-center gap-3\">\n          <span className=\"flex size-[36px] shrink-0 items-center justify-center\">\n            {item.icon ?? defaultIcon(item.type)}\n          </span>\n          <RetroInput\n            aria-label=\"Name\"\n            value={item.name}\n            readOnly={locked}\n            onChange={(e) => update({ name: e.target.value })}\n            className=\"min-w-0 flex-1\"\n          />\n        </div>\n\n        {/* Show pop-up */}\n        <div className=\"flex items-center gap-2\">\n          <RetroLabel size=\"lg\" id={`${id}-show`} className=\"shrink-0\">\n            Show:\n          </RetroLabel>\n          <RetroSelect value={pane} onValueChange={(v) => setPane(v as GetInfoPane)}>\n            <RetroSelectTrigger aria-labelledby={`${id}-show`} className=\"min-w-0 flex-1\">\n              <RetroSelectValue />\n            </RetroSelectTrigger>\n            <RetroSelectContent>\n              <RetroSelectItem value=\"general\">General Information</RetroSelectItem>\n              <RetroSelectItem value=\"sharing\">Sharing</RetroSelectItem>\n              <RetroSelectItem value=\"memory\" disabled={!hasMemory}>\n                Memory\n              </RetroSelectItem>\n            </RetroSelectContent>\n          </RetroSelect>\n        </div>\n\n        <RetroSeparator />\n\n        {/* ---------------- General ---------------- */}\n        {pane === \"general\" && (\n          <>\n            <dl className=\"grid grid-cols-[76px_minmax(0,1fr)] items-baseline gap-x-2 gap-y-[6px]\">\n              <InfoRow label=\"Kind:\">{item.kind}</InfoRow>\n              {item.size && <InfoRow label=\"Size:\">{item.size}</InfoRow>}\n              {item.where && <InfoRow label=\"Where:\">{item.where}</InfoRow>}\n              {item.created && <InfoRow label=\"Created:\">{item.created}</InfoRow>}\n              {item.modified && <InfoRow label=\"Modified:\">{item.modified}</InfoRow>}\n              {item.version && <InfoRow label=\"Version:\">{item.version}</InfoRow>}\n              <InfoRow label=\"Label:\" labelId={`${id}-label`}>\n                <RetroSelect\n                  value={item.label ?? \"none\"}\n                  onValueChange={(v) => update({ label: v as GetInfoLabel })}\n                >\n                  <RetroSelectTrigger aria-labelledby={`${id}-label`} className=\"w-[150px] max-w-full\">\n                    <RetroSelectValue />\n                  </RetroSelectTrigger>\n                  <RetroSelectContent>\n                    {LABELS.map((l, i) => (\n                      <React.Fragment key={l.id}>\n                        <RetroSelectItem value={l.id}>\n                          <RetroSelectItemIcon>\n                            <Swatch color={l.color} />\n                          </RetroSelectItemIcon>\n                          {l.name}\n                        </RetroSelectItem>\n                        {i === 0 && <RetroSelectSeparator />}\n                      </React.Fragment>\n                    ))}\n                  </RetroSelectContent>\n                </RetroSelect>\n              </InfoRow>\n            </dl>\n\n            <div className=\"flex flex-col gap-1\">\n              <RetroLabel htmlFor={`${id}-comments`} className=\"font-bold\">\n                Comments:\n              </RetroLabel>\n              <RetroTextarea\n                id={`${id}-comments`}\n                size=\"sm\"\n                value={item.comments ?? \"\"}\n                onChange={(e) => update({ comments: e.target.value })}\n                className=\"min-h-[64px] resize-none\"\n              />\n            </div>\n\n            <div className=\"flex flex-wrap items-center gap-x-6 gap-y-2\">\n              <div className=\"flex items-center gap-2\">\n                <RetroCheckbox\n                  id={`${id}-locked`}\n                  checked={locked}\n                  onCheckedChange={(c) => update({ locked: c === true })}\n                />\n                <RetroLabel htmlFor={`${id}-locked`}>Locked</RetroLabel>\n              </div>\n              {!isApp && item.type !== \"folder\" && (\n                <div className=\"flex items-center gap-2\">\n                  <RetroCheckbox\n                    id={`${id}-stationery`}\n                    checked={!!item.stationery}\n                    onCheckedChange={(c) => update({ stationery: c === true })}\n                  />\n                  <RetroLabel htmlFor={`${id}-stationery`}>Stationery Pad</RetroLabel>\n                </div>\n              )}\n            </div>\n          </>\n        )}\n\n        {/* ---------------- Sharing ---------------- */}\n        {pane === \"sharing\" && (\n          <>\n            <dl className=\"grid grid-cols-[76px_minmax(0,1fr)] items-baseline gap-x-2 gap-y-[6px]\">\n              <InfoRow label=\"Kind:\">{item.kind}</InfoRow>\n              {item.where && <InfoRow label=\"Where:\">{item.where}</InfoRow>}\n            </dl>\n            <div className=\"flex items-center gap-2\">\n              <RetroCheckbox\n                id={`${id}-shared`}\n                checked={sharing.shared}\n                onCheckedChange={(c) => update({ sharing: { ...sharing, shared: c === true } })}\n              />\n              <RetroLabel htmlFor={`${id}-shared`}>Share this item and its contents</RetroLabel>\n            </div>\n            <RetroGroupBox\n              title=\"Privilege\"\n              contentClassName={cn(\"flex flex-col gap-2\", !sharing.shared && \"opacity-50\")}\n              aria-disabled={!sharing.shared || undefined}\n            >\n              <div className=\"grid grid-cols-[76px_minmax(0,1fr)] items-center gap-x-2 gap-y-2\">\n                <RetroLabel id={`${id}-owner`} className=\"text-right font-bold\">\n                  Owner:\n                </RetroLabel>\n                <RetroSelect\n                  value={sharing.owner}\n                  disabled={!sharing.shared}\n                  onValueChange={(v) => update({ sharing: { ...sharing, owner: v } })}\n                >\n                  <RetroSelectTrigger aria-labelledby={`${id}-owner`} className=\"h-[20px]\">\n                    <RetroSelectValue />\n                  </RetroSelectTrigger>\n                  <RetroSelectContent>\n                    {users.map((u) => (\n                      <RetroSelectItem key={u} value={u}>\n                        {u}\n                      </RetroSelectItem>\n                    ))}\n                  </RetroSelectContent>\n                </RetroSelect>\n                <RetroLabel id={`${id}-everyone`} className=\"text-right font-bold\">\n                  Everyone:\n                </RetroLabel>\n                <RetroSelect\n                  value={sharing.everyone}\n                  disabled={!sharing.shared}\n                  onValueChange={(v) =>\n                    update({ sharing: { ...sharing, everyone: v as GetInfoPrivilege } })\n                  }\n                >\n                  <RetroSelectTrigger aria-labelledby={`${id}-everyone`} className=\"h-[20px]\">\n                    <RetroSelectValue />\n                  </RetroSelectTrigger>\n                  <RetroSelectContent>\n                    {PRIVILEGES.map((p) => (\n                      <RetroSelectItem key={p.id} value={p.id}>\n                        {p.name}\n                      </RetroSelectItem>\n                    ))}\n                  </RetroSelectContent>\n                </RetroSelect>\n              </div>\n            </RetroGroupBox>\n          </>\n        )}\n\n        {/* ---------------- Memory ---------------- */}\n        {pane === \"memory\" && item.memory && (\n          <>\n            <dl className=\"grid grid-cols-[76px_minmax(0,1fr)] items-baseline gap-x-2 gap-y-[6px]\">\n              <InfoRow label=\"Kind:\">{item.kind}</InfoRow>\n            </dl>\n            <RetroGroupBox title=\"Memory Requirements\" contentClassName=\"flex flex-col gap-2\">\n              <div className=\"grid grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-x-2 gap-y-2\">\n                <span className={cn(TEXT, \"text-right\")}>Suggested Size:</span>\n                <span className={cn(TEXT, \"w-[60px] pr-[18px] text-right tabular-nums\")}>\n                  {item.memory.suggested.toLocaleString(\"en-US\")}\n                </span>\n                <span className={TEXT}>K</span>\n\n                <RetroLabel htmlFor={`${id}-min`} className=\"text-right\">\n                  Minimum Size:\n                </RetroLabel>\n                <RetroNumberField\n                  id={`${id}-min`}\n                  size=\"sm\"\n                  min={128}\n                  max={item.memory.preferred}\n                  step={128}\n                  disabled={locked}\n                  value={item.memory.minimum}\n                  onValueChange={(v) => update({ memory: { ...item.memory!, minimum: v } })}\n                  inputClassName=\"w-[60px] text-right\"\n                />\n                <span className={TEXT}>K</span>\n\n                <RetroLabel htmlFor={`${id}-pref`} className=\"text-right\">\n                  Preferred Size:\n                </RetroLabel>\n                <RetroNumberField\n                  id={`${id}-pref`}\n                  size=\"sm\"\n                  min={item.memory.minimum}\n                  max={999_999}\n                  step={128}\n                  disabled={locked}\n                  value={item.memory.preferred}\n                  onValueChange={(v) => update({ memory: { ...item.memory!, preferred: v } })}\n                  inputClassName=\"w-[60px] text-right\"\n                />\n                <span className={TEXT}>K</span>\n              </div>\n            </RetroGroupBox>\n            <p className={cn(TEXT, \"text-os9-gray-800\")}>\n              Note: This program may require more memory if virtual memory is\n              turned off in the Memory control panel.\n            </p>\n          </>\n        )}\n      </RetroWindow>\n    )\n  }\n)\nGetInfoBlock.displayName = \"GetInfoBlock\"\n\nexport { GetInfoBlock }\nexport type { GetInfoBlockProps, GetInfoItem, GetInfoLabel, GetInfoPane, GetInfoPrivilege }\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:block"
}