{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sheet",
  "type": "registry:ui",
  "title": "Sheet",
  "description": "A modal panel that slides in from an edge of the screen, with parts for a header, title, description and footer.",
  "categories": [
    "ui"
  ],
  "dependencies": [
    "class-variance-authority",
    "lucide-react",
    "radix-ui"
  ],
  "registryDependencies": [
    "@rivier-ui/theme",
    "@rivier-ui/cn"
  ],
  "files": [
    {
      "path": "registry/ui/sheet.tsx",
      "type": "registry:ui",
      "target": "components/ui/sheet.tsx",
      "content": "\"use client\";\n/**\n * @name sheet\n * @category ui\n * @description A modal panel that slides in from an edge of the screen, with parts for a header, title, description and footer.\n * @when Navigation, filters, details or a longer form beside the page. `side` is \"end\" by default (\"start\" and \"end\" follow the reading direction; \"left\" and \"right\" do not); on phones \"bottom\" is the natural choice, because it is within reach of the thumb. For a short decision in the middle of the screen use dialog. Always give it a SheetTitle (add className=\"sr-only\" to hide it). Opened by state with no SheetTrigger, focus does not return on close: remember the opener (`opener.current = document.activeElement`) and refocus it in `onCloseAutoFocus={(event) => { event.preventDefault(); opener.current?.focus(); }}` on SheetContent.\n * @example\n * <Sheet>\n *   <SheetTrigger asChild><Button variant=\"outline\">Filters</Button></SheetTrigger>\n *   <SheetContent side=\"bottom\">\n *     <SheetHeader>\n *       <SheetTitle>Filters</SheetTitle>\n *       <SheetDescription>Narrow the list of projects.</SheetDescription>\n *     </SheetHeader>\n *     <div className=\"px-5\">…</div>\n *     <SheetFooter>\n *       <SheetClose asChild><Button>Show results</Button></SheetClose>\n *     </SheetFooter>\n *   </SheetContent>\n * </Sheet>\n */\nimport { Dialog as SheetPrimitive } from \"radix-ui\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"@/lib/cn\";\n\nexport const sheetVariants = cva(\n  \"fixed z-50 flex flex-col overflow-y-auto border-border bg-card text-card-foreground ease-out animation-duration-(--duration-base) data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none!\",\n  {\n    variants: {\n      side: {\n        top: \"inset-x-0 top-0 max-h-[calc(100dvh-3rem)] rounded-b-surface border-b slide-in-from-top slide-out-to-top\",\n        bottom:\n          \"inset-x-0 bottom-0 max-h-[calc(100dvh-3rem)] rounded-t-surface border-t pb-[env(safe-area-inset-bottom)] slide-in-from-bottom slide-out-to-bottom\",\n        start: \"inset-y-0 start-0 max-h-dvh w-[calc(100%-3rem)] max-w-sm border-e slide-in-from-start slide-out-to-start\",\n        end: \"inset-y-0 end-0 max-h-dvh w-[calc(100%-3rem)] max-w-sm border-s slide-in-from-end slide-out-to-end\",\n        left: \"inset-y-0 left-0 max-h-dvh w-[calc(100%-3rem)] max-w-sm border-r slide-in-from-left slide-out-to-left\",\n        right: \"inset-y-0 right-0 max-h-dvh w-[calc(100%-3rem)] max-w-sm border-l slide-in-from-right slide-out-to-right\",\n      },\n    },\n    defaultVariants: { side: \"end\" },\n  },\n);\n\nexport type SheetSide = NonNullable<VariantProps<typeof sheetVariants>[\"side\"]>;\n\nexport function Sheet(props: ComponentProps<typeof SheetPrimitive.Root>) {\n  return <SheetPrimitive.Root {...props} />;\n}\n\nexport function SheetTrigger(props: ComponentProps<typeof SheetPrimitive.Trigger>) {\n  return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nexport function SheetClose(props: ComponentProps<typeof SheetPrimitive.Close>) {\n  return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nexport function 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-overlay ease-out animation-duration-(--duration-base) fade-in-0 fade-out-0 data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:animate-none!\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nexport type SheetContentProps = ComponentProps<typeof SheetPrimitive.Content> & {\n  /** The edge it slides from. \"start\" and \"end\" follow the reading direction. */\n  side?: SheetSide;\n  /** The close button in the top corner. Turn it off only when the content has its own way out. */\n  showCloseButton?: boolean;\n  /** The close button's accessible name. Translate it with the rest of the interface. */\n  closeLabel?: string;\n};\n\n/** The panel, with its portal and overlay. Never larger than the viewport: it scrolls inside. */\nexport function SheetContent({ className, children, side = \"end\", showCloseButton = true, closeLabel = \"Close\", ...props }: SheetContentProps) {\n  return (\n    <SheetPrimitive.Portal>\n      <SheetOverlay />\n      <SheetPrimitive.Content data-slot=\"sheet-content\" data-side={side} className={cn(sheetVariants({ side }), className)} {...props}>\n        {children}\n        {showCloseButton ? (\n          <SheetPrimitive.Close\n            data-slot=\"sheet-close-button\"\n            aria-label={closeLabel}\n            className=\"absolute end-2 top-2 inline-flex size-(--control-h) items-center justify-center rounded-control text-muted-foreground transition-[background-color,color] duration-instant ease-out hover:bg-accent hover:text-foreground motion-reduce:transition-none\"\n          >\n            <X aria-hidden=\"true\" strokeWidth={1.5} className=\"size-4\" />\n          </SheetPrimitive.Close>\n        ) : null}\n      </SheetPrimitive.Content>\n    </SheetPrimitive.Portal>\n  );\n}\n\n/** Leaves room at the end for the close button. */\nexport function SheetHeader({ className, ...props }: ComponentProps<\"div\">) {\n  return <div data-slot=\"sheet-header\" className={cn(\"flex flex-col gap-1.5 p-5 pe-14 text-start\", className)} {...props} />;\n}\n\nexport function SheetTitle({ className, ...props }: ComponentProps<typeof SheetPrimitive.Title>) {\n  return <SheetPrimitive.Title data-slot=\"sheet-title\" className={cn(\"text-base font-medium leading-tight\", className)} {...props} />;\n}\n\nexport function SheetDescription({ className, ...props }: ComponentProps<typeof SheetPrimitive.Description>) {\n  return <SheetPrimitive.Description data-slot=\"sheet-description\" className={cn(\"text-sm text-muted-foreground\", className)} {...props} />;\n}\n\n/** Sits at the bottom of the panel when the content is shorter than it. */\nexport function SheetFooter({ className, ...props }: ComponentProps<\"div\">) {\n  return <div data-slot=\"sheet-footer\" className={cn(\"mt-auto flex flex-col gap-2 p-5\", className)} {...props} />;\n}\n"
    }
  ],
  "meta": {
    "category": "ui",
    "when": "Navigation, filters, details or a longer form beside the page. `side` is \"end\" by default (\"start\" and \"end\" follow the reading direction; \"left\" and \"right\" do not); on phones \"bottom\" is the natural choice, because it is within reach of the thumb. For a short decision in the middle of the screen use dialog. Always give it a SheetTitle (add className=\"sr-only\" to hide it). Opened by state with no SheetTrigger, focus does not return on close: remember the opener (`opener.current = document.activeElement`) and refocus it in `onCloseAutoFocus={(event) => { event.preventDefault(); opener.current?.focus(); }}` on SheetContent.",
    "example": "<Sheet>\n  <SheetTrigger asChild><Button variant=\"outline\">Filters</Button></SheetTrigger>\n  <SheetContent side=\"bottom\">\n    <SheetHeader>\n      <SheetTitle>Filters</SheetTitle>\n      <SheetDescription>Narrow the list of projects.</SheetDescription>\n    </SheetHeader>\n    <div className=\"px-5\">…</div>\n    <SheetFooter>\n      <SheetClose asChild><Button>Show results</Button></SheetClose>\n    </SheetFooter>\n  </SheetContent>\n</Sheet>",
    "client": true
  }
}
