{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sheet",
  "title": "Sheet",
  "description": "Slide-in panel on radix-ui Dialog with 4 sides (right, left, top, bottom), 3 sizes (sm, md, lg) that set the panel width for the left/right sides, and directional slide animations using ai2 motion tokens.",
  "dependencies": [
    "class-variance-authority@^0.7.1",
    "radix-ui@^1.6.1",
    "lucide-react@^1.23.0",
    "tw-animate-css@^1.4.0"
  ],
  "registryDependencies": [
    "@ai2/tokens",
    "@ai2/primitives"
  ],
  "files": [
    {
      "path": "registry/ai2/ui/sheet.tsx",
      "content": "\"use client\"\n\nimport type * as React from \"react\"\nimport { X } from \"lucide-react\"\nimport { Dialog as SheetPrimitive } from \"@/registry/ai2/ui/primitives\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Sheet(props: React.ComponentProps<typeof SheetPrimitive.Root>) {\n  return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger(props: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n  return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose(props: React.ComponentProps<typeof SheetPrimitive.Close>) {\n  return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\nconst sheetVariants = cva(\n  \"fixed z-50 flex flex-col gap-4 bg-popover text-popover-foreground shadow-lg transition-transform duration-(--motion-base) ease-(--motion-ease) data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none\",\n  {\n    variants: {\n      side: {\n        right: \"inset-y-0 right-0 h-full w-3/4 border-l border-border data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\",\n        left: \"inset-y-0 left-0 h-full w-3/4 border-r border-border data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\",\n        top: \"inset-x-0 top-0 h-auto border-b border-border data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n        bottom: \"inset-x-0 bottom-0 h-auto border-t border-border data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n      },\n      size: {\n        sm: \"\",\n        md: \"\",\n        lg: \"\",\n      },\n    },\n    compoundVariants: [\n      { side: [\"right\", \"left\"], size: \"sm\", class: \"sm:max-w-xs\" },\n      { side: [\"right\", \"left\"], size: \"md\", class: \"sm:max-w-sm\" },\n      { side: [\"right\", \"left\"], size: \"lg\", class: \"sm:max-w-md\" },\n    ],\n    defaultVariants: { side: \"right\", size: \"md\" },\n  }\n)\n\ninterface SheetContentProps\n  extends React.ComponentProps<typeof SheetPrimitive.Content>,\n    VariantProps<typeof sheetVariants> {}\n\nfunction SheetContent({ className, children, side, size, ...props }: SheetContentProps) {\n  return (\n    <SheetPrimitive.Portal>\n      <SheetPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-reduce:animate-none\" />\n      <SheetPrimitive.Content\n        data-slot=\"sheet-content\"\n        data-size={size ?? \"md\"}\n        className={cn(sheetVariants({ side, size }), \"p-6\", className)}\n        {...props}\n      >\n        {/* The scroll container wraps the CONTENT, not the Content element\n            ITSELF. Putting overflow-y-auto on Content would have scrolled the\n            `absolute` Close button below away with the content and hidden it.\n            This way close always stays on screen while the body scrolls.\n            `flex flex-col gap-4`: Content's gap now applies to a single child,\n            so the same spacing moves here and the visual result is identical.\n            `min-h-0`: a flex child's default min-height:auto makes overflow\n            INEFFECTIVE - without this, scrolling does not work. */}\n        <div className=\"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto overscroll-contain\">\n          {children}\n        </div>\n        <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-md opacity-70 outline-none transition-opacity duration-(--motion-fast) after:absolute after:-inset-2 hover:opacity-100 focus-visible:ring-[3px] focus-visible:ring-ring/50 [&_svg]:size-4 [&_i]:text-base [&_i]:leading-none\">\n          <X />\n          <span className=\"sr-only\">Close</span>\n        </SheetPrimitive.Close>\n      </SheetPrimitive.Content>\n    </SheetPrimitive.Portal>\n  )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return <div data-slot=\"sheet-header\" className={cn(\"flex flex-col gap-1.5\", className)} {...props} />\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n  return <div data-slot=\"sheet-footer\" className={cn(\"mt-auto flex flex-col gap-2\", className)} {...props} />\n}\n\nfunction SheetTitle({\n  className,\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n  return (\n    <SheetPrimitive.Title\n      data-slot=\"sheet-title\"\n      className={cn(\"text-lg font-semibold leading-none\", className)}\n      {...props}\n    />\n  )\n}\n\nfunction SheetDescription({\n  className,\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n  return (\n    <SheetPrimitive.Description\n      data-slot=\"sheet-description\"\n      className={cn(\"text-sm text-muted-foreground\", className)}\n      {...props}\n    />\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"
    }
  ],
  "docs": "Set side on SheetContent. Use for navigation drawers (left/right) and mobile filters (bottom).",
  "categories": [
    "overlay"
  ],
  "type": "registry:ui"
}