{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-accordion",
  "title": "RetroAccordion",
  "description": "A Mac OS 9 styled accordion with disclosure triangle, bevel separator, and height morph, built on UI SDK Accordion.",
  "dependencies": [
    "@ui-sdk/core@0.1.0-beta.1",
    "@ui-sdk/react@0.1.0-beta.1"
  ],
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/retro-accordion.tsx",
      "content": "\"use client\"\n\n/*\n * RetroAccordion on UI SDK Accordion.\n *\n * Crafted moments:\n *  - The disclosure triangle turns in two hard frames through 45°, the way\n *    the Finder's did. Both flairs.\n *  - Sections morph their height open and shut (220ms open, 180ms close), so\n *    the sections below slide rather than jump. Classic flair and reduced\n *    motion pop them at once.\n *\n * Keeps the shadcn API: `type=\"single\" | \"multiple\"`, `collapsible`, and a\n * string value in single mode (UI SDK itself always uses an array).\n */\n\nimport * as React from \"react\"\nimport {\n  Accordion as AccordionPrimitive,\n  AccordionHeader as AccordionHeaderPrimitive,\n  AccordionItem as AccordionItemPrimitive,\n  AccordionPanel as AccordionPanelPrimitive,\n  AccordionTrigger as AccordionTriggerPrimitive,\n} from \"@ui-sdk/react/accordion\"\n\nimport { cn } from \"@/lib/utils\"\n\ntype Common = { className?: string; children?: React.ReactNode }\n\n/* ------------------------------------------------------------------ */\n/*  RetroAccordion (root)                                              */\n/* ------------------------------------------------------------------ */\n\ntype AccordionBaseProps = Omit<\n  React.ComponentProps<typeof AccordionPrimitive>,\n  \"className\" | \"children\" | \"value\" | \"defaultValue\" | \"onValueChange\" | \"multiple\" | \"collapsible\"\n> &\n  Common\n\ntype RetroAccordionSingleProps = AccordionBaseProps & {\n  type?: \"single\"\n  value?: string\n  defaultValue?: string\n  onValueChange?: (value: string) => void\n  /** Whether the open item can be closed again. Defaults to false. */\n  collapsible?: boolean\n}\n\ntype RetroAccordionMultipleProps = AccordionBaseProps & {\n  type: \"multiple\"\n  value?: string[]\n  defaultValue?: string[]\n  onValueChange?: (value: string[]) => void\n  collapsible?: never\n}\n\ntype RetroAccordionProps = RetroAccordionSingleProps | RetroAccordionMultipleProps\n\nconst toArray = (v: string | string[] | undefined) =>\n  v === undefined ? undefined : Array.isArray(v) ? v : v ? [v] : []\n\nfunction RetroAccordion({\n  className,\n  type = \"single\",\n  value,\n  defaultValue,\n  onValueChange,\n  collapsible,\n  ...props\n}: RetroAccordionProps) {\n  const multiple = type === \"multiple\"\n  return (\n    <AccordionPrimitive\n      multiple={multiple}\n      collapsible={multiple ? undefined : (collapsible ?? false)}\n      value={toArray(value)}\n      defaultValue={toArray(defaultValue)}\n      onValueChange={\n        onValueChange &&\n        ((next: string[]) => {\n          if (multiple) (onValueChange as (v: string[]) => void)(next)\n          else (onValueChange as (v: string) => void)(next[0] ?? \"\")\n        })\n      }\n      className={cn(\"flex flex-col\", className)}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  RetroAccordionItem                                                 */\n/* ------------------------------------------------------------------ */\n\nfunction RetroAccordionItem({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof AccordionItemPrimitive>, \"className\" | \"children\"> & Common) {\n  return (\n    <AccordionItemPrimitive\n      className={cn(\n        /* Bevel separator: 1px dark + 1px light */\n        \"border-b border-b-[var(--os9-gray-700)]\",\n        \"shadow-[0_1px_0_var(--os9-white)]\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  RetroAccordionTrigger                                              */\n/* ------------------------------------------------------------------ */\n\nfunction RetroAccordionTrigger({\n  className,\n  children,\n  ...props\n}: Omit<React.ComponentProps<typeof AccordionTriggerPrimitive>, \"className\" | \"children\"> &\n  Common) {\n  return (\n    <AccordionHeaderPrimitive className=\"m-0 flex\">\n      <AccordionTriggerPrimitive\n        className={cn(\n          \"group/accordion-trigger\",\n          \"flex w-full flex-row items-center justify-between\",\n          \"py-[6px]\",\n          \"cursor-pointer select-none\",\n          \"font-[family-name:var(--os9-font-heading)] text-[12px] tracking-[0.42px]\",\n          \"text-os9-black\",\n          \"hover:bg-[var(--os9-lavender)]\",\n          \"focus-visible:os9-focus-ring\",\n          \"transition-none\",\n          \"data-disabled:cursor-default data-disabled:text-os9-gray-600 data-disabled:hover:bg-transparent\",\n          \"[&>svg]:shrink-0\",\n          className\n        )}\n        {...props}\n      >\n        <span className=\"flex items-center gap-[6px]\">\n          {/* Disclosure triangle: 0° → 45° → 90° in two frames */}\n          <svg\n            width=\"8\"\n            height=\"8\"\n            viewBox=\"0 0 8 8\"\n            fill=\"currentColor\"\n            aria-hidden=\"true\"\n            className={cn(\n              \"transition-transform duration-[110ms] [transition-timing-function:steps(2,end)]\",\n              \"motion-reduce:transition-none\",\n              /* Scoped to this trigger so nested accordions rotate independently */\n              \"group-data-open/accordion-trigger:rotate-90\"\n            )}\n          >\n            <polygon points=\"1,0 7,4 1,8\" />\n          </svg>\n          {children}\n        </span>\n      </AccordionTriggerPrimitive>\n    </AccordionHeaderPrimitive>\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  RetroAccordionContent                                              */\n/* ------------------------------------------------------------------ */\n\nfunction RetroAccordionContent({\n  className,\n  children,\n  ...props\n}: Omit<React.ComponentProps<typeof AccordionPanelPrimitive>, \"className\" | \"children\"> & Common) {\n  return (\n    <AccordionPanelPrimitive\n      className={cn(\n        \"h-(--accordion-panel-height) overflow-hidden\",\n        \"font-[family-name:var(--os9-font-sans)] text-[10px]\",\n        \"text-os9-black\",\n        \"transition-[height] duration-220 ease-[cubic-bezier(0.23,1,0.32,1)]\",\n        \"data-starting-style:h-0 data-ending-style:h-0 data-ending-style:duration-180\",\n        \"in-data-[flair=classic]:transition-none motion-reduce:transition-none\",\n        className\n      )}\n      {...props}\n    >\n      <div className=\"pb-[8px] pl-[16px] pr-0 pt-0\">{children}</div>\n    </AccordionPanelPrimitive>\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  Exports                                                            */\n/* ------------------------------------------------------------------ */\n\nexport { RetroAccordion, RetroAccordionItem, RetroAccordionTrigger, RetroAccordionContent }\nexport type { RetroAccordionProps }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}