{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-drawer",
  "title": "RetroDrawer",
  "description": "A Mac OS 9 styled bottom sheet / drawer with pull handle and OS9 window bevel; drag to dismiss. Built on UI SDK Drawer.",
  "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",
    "https://nostalgia-ui.com/r/retro-motion.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/retro-drawer.tsx",
      "content": "\"use client\"\n\n/*\n * RetroDrawer: a Mac OS 9 panel that rises from the bottom edge, on UI SDK's\n * drawer.\n *\n * Crafted moment: it follows the hand. Grab the sheet (or its grip) and it\n * tracks the pointer; let go and it springs home or, flung far enough, away.\n * UI SDK drives the motion; with reduced motion it fades instead of sliding.\n */\n\nimport * as React from \"react\"\nimport {\n  Drawer as DrawerPrimitive,\n  DrawerBackdrop as DrawerBackdropPrimitive,\n  DrawerClose as DrawerClosePrimitive,\n  DrawerContent as DrawerContentPrimitive,\n  DrawerDescription as DrawerDescriptionPrimitive,\n  DrawerTitle as DrawerTitlePrimitive,\n  DrawerTrigger as DrawerTriggerPrimitive,\n} from \"@ui-sdk/react/drawer\"\n\nimport { cn } from \"@/lib/utils\"\nimport { popupClass } from \"@/registry/new-york/lib/retro-motion\"\n\ntype WithClassName<P> = Omit<P, \"className\"> & { className?: string }\n\n/* ------------------------------------------------------------------ */\n/*  Root, Trigger & Close                                              */\n/* ------------------------------------------------------------------ */\n\nfunction RetroDrawer(props: React.ComponentProps<typeof DrawerPrimitive>) {\n  return <DrawerPrimitive {...props} />\n}\n\nfunction RetroDrawerTrigger(props: React.ComponentProps<typeof DrawerTriggerPrimitive>) {\n  return <DrawerTriggerPrimitive {...props} />\n}\n\nfunction RetroDrawerClose(props: React.ComponentProps<typeof DrawerClosePrimitive>) {\n  return <DrawerClosePrimitive {...props} />\n}\n\n/* ------------------------------------------------------------------ */\n/*  Content                                                            */\n/* ------------------------------------------------------------------ */\n\nfunction RetroDrawerContent({\n  className,\n  children,\n  ...props\n}: Omit<React.ComponentProps<typeof DrawerContentPrimitive>, \"className\" | \"children\"> & {\n  className?: string\n  children?: React.ReactNode\n}) {\n  return (\n    <>\n      {/* the drawer drives the backdrop's opacity as it moves */}\n      <DrawerBackdropPrimitive className=\"fixed! inset-0! z-50 bg-black/40!\" />\n      <DrawerContentPrimitive\n        className={popupClass(\n          cn(\n            /* Box properties carry `!` so UI SDK's popup reset can't strip them\n             * in apps that haven't declared `@layer ui-sdk;` first. The drawer\n             * positions and translates the sheet itself. */\n            \"z-50 m-0! p-0! w-full! h-auto! max-h-[calc(100dvh-6rem)]! flex flex-col outline-none\",\n            /* OS9 panel bevel */\n            \"border! border-os9-black! bg-os9-gray-200! text-os9-black!\",\n            \"shadow-[inset_2px_2px_0_rgba(255,255,255,0.6),inset_-2px_-2px_0_rgba(38,38,38,0.4)]\"\n          ),\n          className\n        )}\n        {...props}\n      >\n        {/* Pull grip: the whole sheet drags, this shows where to grab */}\n        <div className=\"mx-auto mt-2 mb-1 flex justify-center\" aria-hidden>\n          <span\n            className=\"block h-[4px] w-[40px]\"\n            style={{\n              backgroundColor: \"var(--os9-gray-400)\",\n              border: \"1px solid var(--os9-black)\",\n              boxShadow:\n                \"inset 1px 1px 0 rgba(255,255,255,0.6), inset -1px -1px 0 rgba(38,38,38,0.4)\",\n            }}\n          />\n        </div>\n        {children}\n      </DrawerContentPrimitive>\n    </>\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  Header                                                             */\n/* ------------------------------------------------------------------ */\n\nfunction RetroDrawerHeader({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n  return (\n    <div\n      className={cn(\"flex flex-col gap-1.5 p-4 text-center\", className)}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  Footer                                                             */\n/* ------------------------------------------------------------------ */\n\nfunction RetroDrawerFooter({\n  className,\n  ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n  return (\n    <div\n      className={cn(\n        \"flex flex-col-reverse gap-2 p-4 sm:flex-row sm:justify-end\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  Title                                                              */\n/* ------------------------------------------------------------------ */\n\nfunction RetroDrawerTitle({ className, ...props }: WithClassName<React.ComponentProps<typeof DrawerTitlePrimitive>>) {\n  return (\n    <DrawerTitlePrimitive\n      className={cn(\n        \"text-[12px] tracking-[0.42px] leading-[0.98]\",\n        \"font-[family-name:var(--os9-font-heading)] text-os9-black\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  Description                                                        */\n/* ------------------------------------------------------------------ */\n\nfunction RetroDrawerDescription({\n  className,\n  ...props\n}: WithClassName<React.ComponentProps<typeof DrawerDescriptionPrimitive>>) {\n  return (\n    <DrawerDescriptionPrimitive\n      className={cn(\n        \"font-[family-name:var(--os9-font-sans)] text-[10px] leading-[1.3] text-os9-gray-700\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/* ------------------------------------------------------------------ */\n/*  Exports                                                            */\n/* ------------------------------------------------------------------ */\n\nexport {\n  RetroDrawer,\n  RetroDrawerTrigger,\n  RetroDrawerClose,\n  RetroDrawerContent,\n  RetroDrawerHeader,\n  RetroDrawerFooter,\n  RetroDrawerTitle,\n  RetroDrawerDescription,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}