{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-resizable",
  "title": "RetroResizable",
  "description": "A Mac OS 9 styled resizable panel group for split layouts with raised bevel handle, grip dots, and drag-darkening effect, built on UI SDK Resizable.",
  "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-resizable.tsx",
      "content": "\"use client\"\n\n/*\n * RetroResizable: panes split by an OS 9 beveled divider with grip dots, on\n * UI SDK's Resizable (the WAI-ARIA window splitter). Drag a divider, or\n * focus it and use the arrow keys (Shift for bigger steps, Home and End to\n * the limits, Enter to collapse a collapsible pane and bring it back).\n *\n * Crafted moment: the divider settles. Drags track the pointer one to one,\n * but a key step or a collapse eases the panes to their new sizes (160ms,\n * strong ease-out) instead of jumping, so a keyboard user sees where the\n * divider went. Classic flair and reduced motion: it jumps.\n */\n\nimport * as React from \"react\"\nimport {\n  Resizable as ResizablePrimitive,\n  ResizableHandle as ResizableHandlePrimitive,\n  ResizablePanel as ResizablePanelPrimitive,\n} from \"@ui-sdk/react/resizable\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Panels size by flex-basis (from --resizable-panel-size); ease it except\n * while a divider is being dragged. Scoped to direct children so a nested\n * group follows its own drag state. */\nconst CSS = `\n.os9-resizable:not([data-dragging]) > [data-slot=\"resizable-panel\"] {\n  transition: flex-basis 160ms cubic-bezier(0.23, 1, 0.32, 1);\n}\n[data-flair=\"classic\"] .os9-resizable > [data-slot=\"resizable-panel\"] { transition: none; }\n@media (prefers-reduced-motion: reduce) {\n  .os9-resizable > [data-slot=\"resizable-panel\"] { transition: none; }\n}\n`\n\n/* ── RetroResizablePanelGroup ──────────────────────────── */\n\nfunction RetroResizablePanelGroup({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof ResizablePrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return (\n    <>\n      <style href=\"os9-resizable\" precedence=\"default\">\n        {CSS}\n      </style>\n      <ResizablePrimitive className={cn(\"os9-resizable h-full w-full\", className)} {...props} />\n    </>\n  )\n}\n\n/* ── RetroResizablePanel ───────────────────────────────── */\n\nfunction RetroResizablePanel({\n  className,\n  ...props\n}: Omit<React.ComponentProps<typeof ResizablePanelPrimitive>, \"className\"> & {\n  className?: string\n}) {\n  return <ResizablePanelPrimitive className={className} {...props} />\n}\n\n/* ── GripDots: three 2×2 squares across the divider ────── */\n\nfunction GripDots() {\n  return (\n    <span\n      aria-hidden=\"true\"\n      className={cn(\n        \"pointer-events-none flex items-center justify-center gap-[2px]\",\n        /* a horizontal group has an upright divider, so the dots stack */\n        \"group-data-[orientation=horizontal]/handle:flex-col\",\n        \"group-data-[orientation=vertical]/handle:flex-row\"\n      )}\n    >\n      {[0, 1, 2].map((i) => (\n        <span key={i} className=\"size-[2px] bg-os9-gray-600\" />\n      ))}\n    </span>\n  )\n}\n\n/* ── RetroResizableHandle ──────────────────────────────── */\n\n/**\n * UI SDK puts the group's direction on the handle as `data-orientation`:\n *   horizontal group → an upright divider, 3px wide, light left / dark right\n *   vertical group   → a flat divider, 3px tall, light top / dark bottom\n */\nfunction RetroResizableHandle({\n  withHandle = true,\n  className,\n  children,\n  \"aria-label\": ariaLabel = \"Resize\",\n  ...props\n}: Omit<React.ComponentProps<typeof ResizableHandlePrimitive>, \"className\" | \"children\"> & {\n  className?: string\n  children?: React.ReactNode\n  /** Show the grip dots. */\n  withHandle?: boolean\n}) {\n  return (\n    <ResizableHandlePrimitive\n      aria-label={ariaLabel}\n      className={cn(\n        \"group/handle relative flex shrink-0 items-center justify-center\",\n        \"bg-os9-gray-300 outline-none\",\n        \"data-[orientation=horizontal]:w-[3px] data-[orientation=horizontal]:self-stretch\",\n        \"data-[orientation=horizontal]:border-x data-[orientation=horizontal]:border-l-os9-white data-[orientation=horizontal]:border-r-os9-gray-700\",\n        \"data-[orientation=vertical]:h-[3px] data-[orientation=vertical]:w-full\",\n        \"data-[orientation=vertical]:border-y data-[orientation=vertical]:border-t-os9-white data-[orientation=vertical]:border-b-os9-gray-700\",\n        /* darkens while dragged, like a grabbed OS 9 splitter */\n        \"data-dragging:bg-os9-gray-400\",\n        \"focus-visible:os9-focus-ring focus-visible:z-10\",\n        \"data-disabled:opacity-50\",\n        className\n      )}\n      {...props}\n    >\n      {children ?? (withHandle && <GripDots />)}\n    </ResizableHandlePrimitive>\n  )\n}\n\nexport { RetroResizablePanelGroup, RetroResizablePanel, RetroResizableHandle }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}