{
  "$schema": "https://blode.co/ui/schema/registry-item.json",
  "name": "sheet",
  "title": "Sheet",
  "author": "Matthew Blode",
  "description": "A panel that slides in from the edge of the viewport with an overlay.",
  "dependencies": ["@base-ui/react"],
  "files": [
    {
      "path": "ui/sheet.tsx",
      "content": "\"use client\";\n\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\";\nimport { XIcon } from \"blode-icons-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Sheet = ({ ...props }: SheetPrimitive.Root.Props) => (\n  <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n);\n\nconst SheetTrigger = ({\n  asChild,\n  children,\n  ...props\n}: SheetPrimitive.Trigger.Props & {\n  asChild?: boolean;\n}) => {\n  if (asChild && React.isValidElement(children)) {\n    return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" render={children} {...props} />;\n  }\n\n  return (\n    <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props}>\n      {children}\n    </SheetPrimitive.Trigger>\n  );\n};\n\nconst SheetClose = ({\n  asChild,\n  children,\n  ...props\n}: SheetPrimitive.Close.Props & {\n  asChild?: boolean;\n}) => {\n  if (asChild && React.isValidElement(children)) {\n    return <SheetPrimitive.Close data-slot=\"sheet-close\" render={children} {...props} />;\n  }\n\n  return (\n    <SheetPrimitive.Close data-slot=\"sheet-close\" {...props}>\n      {children}\n    </SheetPrimitive.Close>\n  );\n};\n\nconst SheetPortal = ({ ...props }: SheetPrimitive.Portal.Props) => (\n  <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n);\n\nconst SheetOverlay = ({ className, ...props }: SheetPrimitive.Backdrop.Props) => (\n  <SheetPrimitive.Backdrop\n    className={cn(\n      \"data-closed:fade-out-0 data-open:fade-in-0 fixed inset-0 z-50 bg-overlay backdrop-blur-[10px] data-closed:animate-out data-open:animate-in data-closed:duration-300 data-open:duration-500 motion-reduce:transition-none\",\n      className,\n    )}\n    data-slot=\"sheet-overlay\"\n    {...props}\n  />\n);\n\nconst SheetContent = ({\n  className,\n  children,\n  side = \"right\",\n  showCloseButton = true,\n  ...props\n}: SheetPrimitive.Popup.Props & {\n  side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n  showCloseButton?: boolean;\n}) => (\n  <SheetPortal>\n    <SheetOverlay />\n    <SheetPrimitive.Popup\n      className={cn(\n        \"fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-closed:animate-out data-open:animate-in data-closed:duration-300 data-open:duration-500\",\n        side === \"right\" &&\n          \"data-[side=right]:data-closed:slide-out-to-right data-[side=right]:data-open:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n        side === \"left\" &&\n          \"data-[side=left]:data-closed:slide-out-to-left data-[side=left]:data-open:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n        side === \"top\" &&\n          \"data-[side=top]:data-closed:slide-out-to-top data-[side=top]:data-open:slide-in-from-top inset-x-0 top-0 h-auto border-b\",\n        side === \"bottom\" &&\n          \"data-[side=bottom]:data-closed:slide-out-to-bottom data-[side=bottom]:data-open:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t\",\n        className,\n      )}\n      data-side={side}\n      data-slot=\"sheet-content\"\n      {...props}\n    >\n      {children}\n      {showCloseButton && (\n        <SheetPrimitive.Close className=\"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n          <XIcon className=\"size-4\" />\n          <span className=\"sr-only\">Close</span>\n        </SheetPrimitive.Close>\n      )}\n    </SheetPrimitive.Popup>\n  </SheetPortal>\n);\n\nconst SheetHeader = ({ className, ...props }: React.ComponentProps<\"div\">) => (\n  <div className={cn(\"flex flex-col gap-1.5 p-4\", className)} data-slot=\"sheet-header\" {...props} />\n);\n\nconst SheetFooter = ({ className, ...props }: React.ComponentProps<\"div\">) => (\n  <div\n    className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n    data-slot=\"sheet-footer\"\n    {...props}\n  />\n);\n\nconst SheetTitle = ({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Title>) => (\n  <SheetPrimitive.Title\n    className={cn(\"font-semibold text-foreground\", className)}\n    data-slot=\"sheet-title\"\n    {...props}\n  />\n);\n\nconst SheetDescription = ({\n  className,\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) => (\n  <SheetPrimitive.Description\n    className={cn(\"text-muted-foreground text-sm\", className)}\n    data-slot=\"sheet-description\"\n    {...props}\n  />\n);\n\nexport {\n  Sheet,\n  SheetTrigger,\n  SheetClose,\n  SheetContent,\n  SheetHeader,\n  SheetFooter,\n  SheetTitle,\n  SheetDescription,\n};\n",
      "type": "registry:ui",
      "target": ""
    }
  ],
  "type": "registry:ui"
}
