{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "popover",
  "title": "popover",
  "dependencies": [
    "@radix-ui/react-popover",
    "class-variance-authority@^0.7"
  ],
  "registryDependencies": [
    "@dwellir/dwellir-theme",
    "@dwellir/utils",
    "@dwellir/portal-container",
    "@dwellir/touch-focus"
  ],
  "files": [
    {
      "path": "components/ui/popover.tsx",
      "content": "'use client';\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps } from 'react';\nimport { PortalContainer } from '@/lib/portal-container';\nimport { focusContentOnTouch } from '@/lib/touch-focus';\nimport { cn } from '@/lib/utils';\n\nfunction Popover(props: ComponentProps<typeof PopoverPrimitive.Root>) {\n  return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger(props: ComponentProps<typeof PopoverPrimitive.Trigger>) {\n  return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverAnchor(props: ComponentProps<typeof PopoverPrimitive.Anchor>) {\n  return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nconst popoverContentVariants = cva('z-popover outline-hidden', {\n  variants: {\n    variant: {\n      default:\n        'ui-popup-motion max-h-(--radix-popover-content-available-height) w-72 max-w-popover origin-(--radix-popover-content-transform-origin) overflow-y-auto rounded-2xl border border-border bg-popover p-5 text-popover-foreground shadow-popover data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',\n      /*\n       * No surface: a row of chips under its anchor, as wide as the anchor. Only\n       * the chips take the pointer, so a click between them reaches the page.\n       */\n      bare: 'pointer-events-none w-(--radix-popover-trigger-width) [&_button]:pointer-events-auto',\n    },\n  },\n  defaultVariants: { variant: 'default' },\n});\n\nfunction PopoverContent({\n  className,\n  variant,\n  container,\n  align = 'center',\n  sideOffset = 6,\n  collisionPadding = 12,\n  onOpenAutoFocus,\n  children,\n  ...props\n}: ComponentProps<typeof PopoverPrimitive.Content> &\n  VariantProps<typeof popoverContentVariants> &\n  /* The element to render into; the page body by default. */\n  Pick<ComponentProps<typeof PopoverPrimitive.Portal>, 'container'>) {\n  return (\n    <PopoverPrimitive.Portal container={container}>\n      <PopoverPrimitive.Content\n        data-slot=\"popover-content\"\n        data-variant={variant ?? 'default'}\n        align={align}\n        sideOffset={sideOffset}\n        collisionPadding={collisionPadding}\n        className={cn(popoverContentVariants({ variant }), className)}\n        {...props}\n        /* A touch opens the popover without the keyboard: a picker's search field waits for a tap. */\n        onOpenAutoFocus={focusContentOnTouch(onOpenAutoFocus)}\n      >\n        {/* A modal popover hides the page: popups opened inside go to the body. */}\n        <PortalContainer id={null}>{children}</PortalContainer>\n      </PopoverPrimitive.Content>\n    </PopoverPrimitive.Portal>\n  );\n}\n\nfunction PopoverHeader({ className, ...props }: ComponentProps<'div'>) {\n  return (\n    <div data-slot=\"popover-header\" className={cn('flex flex-col gap-2', className)} {...props} />\n  );\n}\n\n/* A div, as upstream, so a popover adds no heading to the page outline. */\nfunction PopoverTitle({ className, ...props }: ComponentProps<'div'>) {\n  return (\n    <div\n      data-slot=\"popover-title\"\n      className={cn('font-display text-lg leading-tight font-bold text-title', className)}\n      {...props}\n    />\n  );\n}\n\nfunction PopoverDescription({ className, ...props }: ComponentProps<'p'>) {\n  return (\n    <p\n      data-slot=\"popover-description\"\n      className={cn('text-sm text-muted-foreground', className)}\n      {...props}\n    />\n  );\n}\n\nexport {\n  Popover,\n  PopoverAnchor,\n  PopoverContent,\n  PopoverDescription,\n  PopoverHeader,\n  PopoverTitle,\n  PopoverTrigger,\n};\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}