{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sheet",
  "type": "registry:ui",
  "title": "Sheet",
  "description": "Edge-anchored slide-in panel (top/right/bottom/left) for filters, details, and side forms.",
  "dependencies": [
    "@radix-ui/react-dialog",
    "@saasflare/ui"
  ],
  "files": [
    {
      "path": "components/ui/sheet.tsx",
      "type": "registry:ui",
      "content": "// @toreview\n\"use client\"\n\n/**\n * @fileoverview Sheet primitive — slide-in panel overlay from any edge of the viewport.\n * Built on Radix UI Dialog. Part of the Saasflare base component layer.\n * @module packages/ui/components/ui/sheet\n * @layer core\n *\n * @component\n * @example\n * import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from '@saasflare/ui';\n * <Sheet>\n *   <SheetTrigger>Open</SheetTrigger>\n *   <SheetContent side=\"right\">\n *     <SheetHeader>\n *       <SheetTitle>Sheet Title</SheetTitle>\n *       <SheetDescription>Sheet description text.</SheetDescription>\n *     </SheetHeader>\n *   </SheetContent>\n * </Sheet>\n */\n\nimport * as React from \"react\"\nimport { XIcon } from \"@saasflare/ui\"\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\"\n\nimport { cn } from \"@saasflare/ui\"\nimport { useSaasflareProps, type SaasflareComponentProps } from \"@saasflare/ui\"\n\n/**\n * Slide-in panel overlay that enters from an edge of the viewport. Built on\n * Radix Dialog — owns open state, focus trapping, and dismissal. Compose with\n * {@link SheetTrigger} and {@link SheetContent}; use it for side navigation,\n * filters, or detail panels that should not leave the current page.\n *\n * @component\n * @layer core\n */\nfunction Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n  return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\n/**\n * Button that opens the sheet.\n *\n * @component\n * @layer core\n */\nfunction SheetTrigger({\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n  return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\n/**\n * Button that closes the sheet from anywhere inside it.\n *\n * @component\n * @layer core\n */\nfunction SheetClose({\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n  return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\nfunction SheetPortal({\n  ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n  return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({\n  className,\n  ...props\n}: React.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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\n/**\n * Props for {@link SheetContent}.\n *\n * `side` picks the viewport edge the panel slides in from (default `\"right\"`);\n * `showCloseButton` toggles the built-in top-right close button.\n */\ninterface SheetContentProps\n  extends Omit<React.ComponentProps<typeof SheetPrimitive.Content>, keyof SaasflareComponentProps>,\n    SaasflareComponentProps {\n  side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n  showCloseButton?: boolean\n}\n\n/**\n * The sliding panel itself — portaled behind a dimmed overlay, slides in from\n * the chosen `side`, and renders an optional built-in close button.\n *\n * @component\n * @layer core\n */\nfunction SheetContent({\n  className,\n  children,\n  side = \"right\",\n  showCloseButton = true,\n  surface,\n  radius,\n  animated,\n  iconWeight,\n  ...props\n}: SheetContentProps) {\n  const sf = useSaasflareProps({ surface, radius, animated, iconWeight })\n\n  return (\n    <SheetPortal>\n      <SheetOverlay data-animated={String(sf.animated)} />\n      <SheetPrimitive.Content\n        {...props}\n        data-slot=\"sheet-content\"\n        data-surface={sf.surface}\n        data-radius={sf.radius}\n        data-animated={String(sf.animated)}\n        className={cn(\n          \"fixed z-50 flex flex-col gap-4 surface-card transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500\",\n          side === \"right\" &&\n            \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\",\n          side === \"left\" &&\n            \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n          side === \"top\" &&\n            \"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n          side === \"bottom\" &&\n            \"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n          className\n        )}\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:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary data-[state=open]:text-secondary-foreground\">\n            <XIcon weight={sf.iconWeight} className=\"size-4\" />\n            <span className=\"sr-only\">Close</span>\n          </SheetPrimitive.Close>\n        )}\n      </SheetPrimitive.Content>\n    </SheetPortal>\n  )\n}\n\n/**\n * Sheet header — stacks {@link SheetTitle} and {@link SheetDescription} at the\n * top of the panel.\n *\n * @component\n * @layer core\n */\nfunction SheetHeader({ className, ...props }: React.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\n/**\n * Sheet footer — actions area pinned to the bottom of the panel.\n *\n * @component\n * @layer core\n */\nfunction SheetFooter({ className, ...props }: React.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/**\n * Accessible sheet title — announced to screen readers when the sheet opens.\n *\n * @component\n * @layer core\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(\"font-semibold text-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\n/**\n * Accessible sheet description text below the title.\n *\n * @component\n * @layer core\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  type SheetContentProps,\n}\n",
      "target": "components/ui/sheet.tsx"
    }
  ],
  "$meta": {
    "source": "https://ui.saasflare.io/r/sheet.json"
  }
}
