{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sheet",
  "title": "Sheet",
  "description": "Dialog that slides in from any edge of the screen, for menus, filters and side panels.",
  "dependencies": [
    "@radix-ui/react-dialog",
    "class-variance-authority",
    "lucide-react"
  ],
  "registryDependencies": [
    "@corsair-ui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/sheet.tsx",
      "content": "\"use client\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { cva } from \"class-variance-authority\";\nimport { XIcon } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/registry/default/lib/utils\";\n\n/**\n * A dialog that slides in from an edge of the screen: navigation menus,\n * filters, detail panels. Focus moves into the panel when it opens, stays\n * trapped inside, and returns to the trigger when it closes; Escape and a\n * click on the overlay close it, and the page behind it does not scroll.\n * Screen readers announce it as a dialog named by `SheetTitle`. With reduced\n * motion it appears and disappears without sliding.\n *\n * @example\n * <Sheet>\n *   <SheetTrigger asChild>\n *     <Button variant=\"outline\">Filters</Button>\n *   </SheetTrigger>\n *   <SheetContent side=\"left\">\n *     <SheetHeader>\n *       <SheetTitle>Filters</SheetTitle>\n *       <SheetDescription>Narrow down the results.</SheetDescription>\n *     </SheetHeader>\n *   </SheetContent>\n * </Sheet>\n */\nfunction Sheet(props: ComponentProps<typeof SheetPrimitive.Root>) {\n  return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />;\n}\n\nfunction SheetTrigger(props: ComponentProps<typeof SheetPrimitive.Trigger>) {\n  return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\n/** Closes the sheet. Wrap a link with `asChild` so following it closes the panel. */\nfunction SheetClose(props: ComponentProps<typeof SheetPrimitive.Close>) {\n  return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nfunction SheetPortal(props: ComponentProps<typeof SheetPrimitive.Portal>) {\n  return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\nfunction SheetOverlay({ className, ...props }: ComponentProps<typeof SheetPrimitive.Overlay>) {\n  return (\n    <SheetPrimitive.Overlay\n      data-slot=\"sheet-overlay\"\n      className={cn(\n        \"fixed inset-0 z-50 bg-black/50\",\n        // animate-in/out sit behind motion-safe: so reduced motion really turns them off.\n        \"motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n        \"motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0\",\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\nconst sheetContentVariants = cva(\n  [\n    \"bg-background fixed z-50 flex flex-col gap-4 shadow-lg outline-none\",\n    \"motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out\",\n  ],\n  {\n    variants: {\n      side: {\n        top: \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b\",\n        right:\n          \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n        bottom:\n          \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t\",\n        left: \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n      },\n    },\n    defaultVariants: {\n      side: \"right\",\n    },\n  }\n);\n\ntype SheetSide = \"top\" | \"right\" | \"bottom\" | \"left\";\n\ninterface SheetContentProps extends ComponentProps<typeof SheetPrimitive.Content> {\n  /** The edge the panel slides in from. */\n  side?: SheetSide;\n  /** Renders an icon button in the top corner that closes the sheet. */\n  showCloseButton?: boolean;\n  /** Accessible name of the close button. */\n  closeLabel?: string;\n  /**\n   * Classes for the overlay behind the panel: opacity, blur, z-index. The\n   * overlay is also `data-slot=\"sheet-overlay\"` for styling from outside.\n   */\n  overlayClassName?: string;\n}\n\n/**\n * The panel itself, rendered in a portal above an overlay. It needs a\n * `SheetTitle`; hide it with `sr-only` if the design has no visible heading.\n */\nfunction SheetContent({\n  className,\n  children,\n  side = \"right\",\n  showCloseButton = true,\n  closeLabel = \"Close\",\n  overlayClassName,\n  ...props\n}: SheetContentProps) {\n  return (\n    <SheetPortal>\n      <SheetOverlay className={overlayClassName} />\n      <SheetPrimitive.Content\n        data-slot=\"sheet-content\"\n        data-side={side}\n        className={cn(sheetContentVariants({ side }), className)}\n        {...props}\n      >\n        {children}\n        {showCloseButton ? (\n          <SheetPrimitive.Close\n            data-slot=\"sheet-close-button\"\n            aria-label={closeLabel}\n            className={cn(\n              \"absolute top-4 right-4 inline-flex size-6 cursor-pointer items-center justify-center rounded-md opacity-70\",\n              \"transition-opacity outline-none hover:opacity-100 motion-reduce:transition-none\",\n              \"focus-visible:ring-ring/50 focus-visible:opacity-100 focus-visible:ring-[3px]\",\n              \"disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n            )}\n          >\n            <XIcon aria-hidden=\"true\" />\n          </SheetPrimitive.Close>\n        ) : null}\n      </SheetPrimitive.Content>\n    </SheetPortal>\n  );\n}\n\nfunction SheetHeader({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sheet-header\"\n      className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction SheetFooter({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"sheet-footer\"\n      className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n      {...props}\n    />\n  );\n}\n\n/** Names the sheet for screen readers. */\nfunction SheetTitle({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>) {\n  return (\n    <SheetPrimitive.Title\n      data-slot=\"sheet-title\"\n      className={cn(\"text-foreground font-semibold\", className)}\n      {...props}\n    />\n  );\n}\n\n/** Read out after the title when the sheet opens. */\nfunction SheetDescription({\n  className,\n  ...props\n}: ComponentProps<typeof SheetPrimitive.Description>) {\n  return (\n    <SheetPrimitive.Description\n      data-slot=\"sheet-description\"\n      className={cn(\"text-muted-foreground text-sm\", className)}\n      {...props}\n    />\n  );\n}\n\nexport {\n  Sheet,\n  SheetClose,\n  SheetContent,\n  SheetDescription,\n  SheetFooter,\n  SheetHeader,\n  SheetOverlay,\n  SheetPortal,\n  SheetTitle,\n  SheetTrigger,\n  type SheetContentProps,\n  type SheetSide,\n};\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}