{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "drawer",
  "type": "registry:ui",
  "title": "Drawer",
  "description": "Mobile bottom-sheet built on Base UI's native swipe-to-dismiss engine.",
  "dependencies": [
    "@base-ui/react",
    "motion"
  ],
  "registryDependencies": [
    "https://seamui.dev/r/utils.json",
    "https://seamui.dev/r/motion.json"
  ],
  "files": [
    {
      "path": "registry/seam/ui/drawer.tsx",
      "content": "\"use client\"\n\nimport type * as React from \"react\"\nimport { Drawer as BaseDrawer } from \"@base-ui/react/drawer\"\n\nimport { cn } from \"@/lib/utils\"\nimport { condense } from \"@/lib/motion\"\n\n// The Drawer leans on Base UI's native drawer engine for swipe-to-dismiss and\n// the backdrop that dims as you drag — that physics IS the seam mobile-depth\n// philosophy. The non-gesture open/close was the one gap: seam adds the sheet\n// condense (translate + fade) for it, self-suppressed while dragging.\n\nfunction Drawer(props: React.ComponentProps<typeof BaseDrawer.Root>) {\n  return <BaseDrawer.Root {...props} />\n}\n\nfunction DrawerTrigger(props: React.ComponentProps<typeof BaseDrawer.Trigger>) {\n  return <BaseDrawer.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\n/**\n * Width of the sheet where there's room for it — the sheet is full-bleed on\n * a phone and centers once the viewport outgrows the cap. Height stays\n * content-driven under the 90vh ceiling, same as Dialog.\n */\nconst DRAWER_SIZES = {\n  sm: \"max-w-sm\",\n  default: \"max-w-md\",\n  lg: \"max-w-2xl\",\n} as const\n\nfunction DrawerContent({\n  className,\n  children,\n  size = \"default\",\n  ...props\n}: React.ComponentProps<typeof BaseDrawer.Popup> & {\n  size?: keyof typeof DRAWER_SIZES\n}) {\n  return (\n    <BaseDrawer.Portal>\n      <BaseDrawer.Backdrop\n        data-slot=\"drawer-backdrop\"\n        className={cn(\"fixed inset-0 z-50 bg-black/50\", condense.backdrop)}\n      />\n      <BaseDrawer.Popup\n        data-slot=\"drawer-content\"\n        className={cn(\n          \"bg-popover text-popover-foreground fixed inset-x-0 bottom-0 z-50 mx-auto flex max-h-[90vh] w-full flex-col gap-4 rounded-t-2xl squircle border-t p-6 shadow-modal outline-none\",\n          DRAWER_SIZES[size],\n          // seam condense: the sheet slides up and fades in, falls back on\n          // dismiss (Base UI awaits it); suppressed mid-swipe so drag is 1:1.\n          condense.sheet,\n          className\n        )}\n        {...props}\n      >\n        <div\n          aria-hidden\n          className=\"bg-muted mx-auto h-1.5 w-10 shrink-0 rounded-full\"\n        />\n        {children}\n      </BaseDrawer.Popup>\n    </BaseDrawer.Portal>\n  )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"drawer-header\"\n      className={cn(\n        \"flex flex-col gap-1.5 text-center sm:text-left\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"drawer-footer\"\n      className={cn(\"mt-auto flex flex-col gap-2\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction DrawerTitle({\n  className,\n  ...props\n}: React.ComponentProps<typeof BaseDrawer.Title>) {\n  return (\n    <BaseDrawer.Title\n      data-slot=\"drawer-title\"\n      className={cn(\"text-lg font-semibold\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction DrawerDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof BaseDrawer.Description>) {\n  return (\n    <BaseDrawer.Description\n      data-slot=\"drawer-description\"\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction DrawerClose(props: React.ComponentProps<typeof BaseDrawer.Close>) {\n  return <BaseDrawer.Close data-slot=\"drawer-close\" {...props} />\n}\n\nexport {\n  Drawer,\n  DrawerTrigger,\n  DrawerContent,\n  DrawerHeader,\n  DrawerFooter,\n  DrawerTitle,\n  DrawerDescription,\n  DrawerClose,\n}\n",
      "type": "registry:ui",
      "target": "components/ui/drawer.tsx"
    }
  ]
}