{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sheet",
  "type": "registry:ui",
  "title": "Sheet",
  "description": "A sheet component",
  "dependencies": [
    "solid-js",
    "@kobalte/core",
    "class-variance-authority"
  ],
  "files": [
    {
      "path": "src/registry/ui/sheet.tsx",
      "content": "import type { Component, ComponentProps, JSX, ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport * as SheetPrimitive from \"@kobalte/core/dialog\"\nimport type { PolymorphicProps } from \"@kobalte/core/polymorphic\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"~/lib/utils\"\n\nconst Sheet = SheetPrimitive.Root\nconst SheetTrigger = SheetPrimitive.Trigger\nconst SheetClose = SheetPrimitive.CloseButton\n\nconst portalVariants = cva(\"fixed inset-0 z-50 flex\", {\n  variants: {\n    position: {\n      top: \"items-start\",\n      bottom: \"items-end\",\n      left: \"justify-start\",\n      right: \"justify-end\"\n    }\n  },\n  defaultVariants: { position: \"right\" }\n})\n\ntype PortalProps = SheetPrimitive.DialogPortalProps & VariantProps<typeof portalVariants>\n\nconst SheetPortal: Component<PortalProps> = (props) => {\n  const [local, others] = splitProps(props, [\"position\", \"children\"])\n  return (\n    <SheetPrimitive.Portal {...others}>\n      <div class={portalVariants({ position: local.position })}>{local.children}</div>\n    </SheetPrimitive.Portal>\n  )\n}\n\ntype DialogOverlayProps<T extends ValidComponent = \"div\"> = SheetPrimitive.DialogOverlayProps<T> & {\n  class?: string | undefined\n}\n\nconst SheetOverlay = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, DialogOverlayProps<T>>\n) => {\n  const [local, others] = splitProps(props as DialogOverlayProps, [\"class\"])\n  return (\n    <SheetPrimitive.Overlay\n      class={cn(\n        \"fixed inset-0 z-50 bg-black/80 data-[expanded=]:animate-in data-[closed=]:animate-out data-[closed=]:fade-out-0 data-[expanded=]:fade-in-0\",\n        local.class\n      )}\n      {...others}\n    />\n  )\n}\n\nconst sheetVariants = cva(\n  \"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[closed=]:duration-300 data-[expanded=]:duration-500 data-[expanded=]:animate-in data-[closed=]:animate-out\",\n  {\n    variants: {\n      position: {\n        top: \"inset-x-0 top-0 border-b data-[closed=]:slide-out-to-top data-[expanded=]:slide-in-from-top\",\n        bottom:\n          \"inset-x-0 bottom-0 border-t data-[closed=]:slide-out-to-bottom data-[expanded=]:slide-in-from-bottom\",\n        left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[closed=]:slide-out-to-left data-[expanded=]:slide-in-from-left sm:max-w-sm\",\n        right:\n          \"inset-y-0 right-0 h-full w-3/4 border-l data-[closed=]:slide-out-to-right data-[expanded=]:slide-in-from-right sm:max-w-sm\"\n      }\n    },\n    defaultVariants: {\n      position: \"right\"\n    }\n  }\n)\n\ntype DialogContentProps<T extends ValidComponent = \"div\"> = SheetPrimitive.DialogContentProps<T> &\n  VariantProps<typeof sheetVariants> & { class?: string | undefined; children?: JSX.Element }\n\nconst SheetContent = <T extends ValidComponent = \"div\">(\n  props: PolymorphicProps<T, DialogContentProps<T>>\n) => {\n  const [local, others] = splitProps(props as DialogContentProps, [\"position\", \"class\", \"children\"])\n  return (\n    <SheetPortal position={local.position}>\n      <SheetOverlay />\n      <SheetPrimitive.Content\n        class={cn(\n          sheetVariants({ position: local.position }),\n          local.class,\n          \"max-h-screen overflow-y-auto\"\n        )}\n        {...others}\n      >\n        {local.children}\n        <SheetPrimitive.CloseButton class=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n          <svg\n            xmlns=\"http://www.w3.org/2000/svg\"\n            viewBox=\"0 0 24 24\"\n            fill=\"none\"\n            stroke=\"currentColor\"\n            stroke-width=\"2\"\n            stroke-linecap=\"round\"\n            stroke-linejoin=\"round\"\n            class=\"size-4\"\n          >\n            <path d=\"M18 6l-12 12\" />\n            <path d=\"M6 6l12 12\" />\n          </svg>\n          <span class=\"sr-only\">Close</span>\n        </SheetPrimitive.CloseButton>\n      </SheetPrimitive.Content>\n    </SheetPortal>\n  )\n}\n\nconst SheetHeader: Component<ComponentProps<\"div\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div class={cn(\"flex flex-col space-y-2 text-center sm:text-left\", local.class)} {...others} />\n  )\n}\n\nconst SheetFooter: Component<ComponentProps<\"div\">> = (props) => {\n  const [local, others] = splitProps(props, [\"class\"])\n  return (\n    <div\n      class={cn(\"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\", local.class)}\n      {...others}\n    />\n  )\n}\n\ntype DialogTitleProps<T extends ValidComponent = \"h2\"> = SheetPrimitive.DialogTitleProps<T> & {\n  class?: string | undefined\n}\n\nconst SheetTitle = <T extends ValidComponent = \"h2\">(\n  props: PolymorphicProps<T, DialogTitleProps<T>>\n) => {\n  const [local, others] = splitProps(props as DialogTitleProps, [\"class\"])\n  return (\n    <SheetPrimitive.Title\n      class={cn(\"text-lg font-semibold text-foreground\", local.class)}\n      {...others}\n    />\n  )\n}\n\ntype DialogDescriptionProps<T extends ValidComponent = \"p\"> =\n  SheetPrimitive.DialogDescriptionProps<T> & { class?: string | undefined }\n\nconst SheetDescription = <T extends ValidComponent = \"p\">(\n  props: PolymorphicProps<T, DialogDescriptionProps<T>>\n) => {\n  const [local, others] = splitProps(props as DialogDescriptionProps, [\"class\"])\n  return (\n    <SheetPrimitive.Description\n      class={cn(\"text-sm text-muted-foreground\", local.class)}\n      {...others}\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"
    }
  ]
}