{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "drawer",
  "type": "registry:ui",
  "title": "Drawer",
  "description": "A drawer component",
  "dependencies": [
    "solid-js",
    "@corvu/drawer"
  ],
  "files": [
    {
      "path": "src/registry/ui/drawer.tsx",
      "content": "import type { Component, ComponentProps, JSX, ValidComponent } from \"solid-js\"\nimport { splitProps } from \"solid-js\"\n\nimport type {\n  ContentProps,\n  DescriptionProps,\n  DynamicProps,\n  LabelProps,\n  OverlayProps\n} from \"@corvu/drawer\"\nimport DrawerPrimitive from \"@corvu/drawer\"\n\nimport { cn } from \"~/lib/utils\"\n\nconst Drawer = DrawerPrimitive\n\nconst DrawerTrigger = DrawerPrimitive.Trigger\n\nconst DrawerPortal = DrawerPrimitive.Portal\n\nconst DrawerClose = DrawerPrimitive.Close\n\ntype DrawerOverlayProps<T extends ValidComponent = \"div\"> = OverlayProps<T> & { class?: string }\n\nconst DrawerOverlay = <T extends ValidComponent = \"div\">(\n  props: DynamicProps<T, DrawerOverlayProps<T>>\n) => {\n  const [, rest] = splitProps(props as DrawerOverlayProps, [\"class\"])\n  const drawerContext = DrawerPrimitive.useContext()\n  return (\n    <DrawerPrimitive.Overlay\n      class={cn(\n        \"fixed inset-0 z-50 data-[transitioning]:transition-colors data-[transitioning]:duration-300\",\n        props.class\n      )}\n      style={{\n        \"background-color\": `rgb(0 0 0 / ${0.8 * drawerContext.openPercentage()})`\n      }}\n      {...rest}\n    />\n  )\n}\n\ntype DrawerContentProps<T extends ValidComponent = \"div\"> = ContentProps<T> & {\n  class?: string\n  children?: JSX.Element\n}\n\nconst DrawerContent = <T extends ValidComponent = \"div\">(\n  props: DynamicProps<T, DrawerContentProps<T>>\n) => {\n  const [, rest] = splitProps(props as DrawerContentProps, [\"class\", \"children\"])\n  return (\n    <DrawerPortal>\n      <DrawerOverlay />\n      <DrawerPrimitive.Content\n        class={cn(\n          \"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background after:absolute after:inset-x-0 after:top-full after:h-1/2 after:bg-inherit data-[transitioning]:transition-transform data-[transitioning]:duration-300 md:select-none\",\n          props.class\n        )}\n        {...rest}\n      >\n        <div class=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n        {props.children}\n      </DrawerPrimitive.Content>\n    </DrawerPortal>\n  )\n}\n\nconst DrawerHeader: Component<ComponentProps<\"div\">> = (props) => {\n  const [, rest] = splitProps(props, [\"class\"])\n  return <div class={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", props.class)} {...rest} />\n}\n\nconst DrawerFooter: Component<ComponentProps<\"div\">> = (props) => {\n  const [, rest] = splitProps(props, [\"class\"])\n  return <div class={cn(\"t-auto flex flex-col gap-2 p-4\", props.class)} {...rest} />\n}\n\ntype DrawerTitleProps<T extends ValidComponent = \"div\"> = LabelProps<T> & { class?: string }\n\nconst DrawerTitle = <T extends ValidComponent = \"div\">(\n  props: DynamicProps<T, DrawerTitleProps<T>>\n) => {\n  const [, rest] = splitProps(props as DrawerTitleProps, [\"class\"])\n  return (\n    <DrawerPrimitive.Label\n      class={cn(\"text-lg font-semibold leading-none tracking-tight\", props.class)}\n      {...rest}\n    />\n  )\n}\n\ntype DrawerDescriptionProps<T extends ValidComponent = \"div\"> = DescriptionProps<T> & {\n  class?: string\n}\n\nconst DrawerDescription = <T extends ValidComponent = \"div\">(\n  props: DynamicProps<T, DrawerDescriptionProps<T>>\n) => {\n  const [, rest] = splitProps(props as DrawerDescriptionProps, [\"class\"])\n  return (\n    <DrawerPrimitive.Description\n      class={cn(\"text-sm text-muted-foreground\", props.class)}\n      {...rest}\n    />\n  )\n}\n\nexport {\n  Drawer,\n  DrawerPortal,\n  DrawerOverlay,\n  DrawerTrigger,\n  DrawerClose,\n  DrawerContent,\n  DrawerHeader,\n  DrawerFooter,\n  DrawerTitle,\n  DrawerDescription\n}\n",
      "type": "registry:ui"
    }
  ]
}