{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "popover",
  "title": "Popover",
  "author": "AniBT <https://anibt.net>",
  "description": "AniBT popover: the floating paper anchored to its trigger, with a 14/700 title and a muted description.",
  "dependencies": [
    "radix-ui"
  ],
  "registryDependencies": [
    "@anibt/theme"
  ],
  "files": [
    {
      "path": "registry/anibt/ui/popover.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Popover as PopoverPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\n/**\n * Popover — AniBT 「贴纸手账」: a small panel anchored to its trigger.\n *\n * The floating tier (`anibt-pop`): paper, a 1px edge and the pop shadow on\n * radius 14, 16px of padding, 288 wide. `PopoverHeader` / `PopoverTitle` /\n * `PopoverDescription` give it a 14/700 title over a 12px muted line. Pickers\n * that fill it edge to edge (a command list) pass `className=\"p-0\"`.\n *\n * Export names and props are shadcn's, so this file can replace\n * `components/ui/popover.tsx`.\n */\n\ntype RenderCompat = {\n  /** Base UI's `asChild`: render this element instead, with the part's props. */\n  render?: React.ReactElement\n  /** Base UI compatibility; ignored (Radix decides from the rendered element). */\n  nativeButton?: boolean\n}\n\n/** Maps Base UI's `render` onto Radix's `asChild`. */\nfunction renderAsChild<P extends { asChild?: boolean; children?: React.ReactNode }>({\n  render,\n  nativeButton: _nativeButton,\n  ...props\n}: P & RenderCompat): P {\n  void _nativeButton\n  if (!render) return props as P\n  const children = props.children === undefined ? render : React.cloneElement(render, undefined, props.children)\n  return { ...props, asChild: true, children } as P\n}\n\nfunction Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n  return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger(props: React.ComponentProps<typeof PopoverPrimitive.Trigger> & RenderCompat) {\n  return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...renderAsChild(props)} />\n}\n\nfunction PopoverContent({\n  className,\n  align = \"center\",\n  sideOffset = 6,\n  ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n  return (\n    <PopoverPrimitive.Portal>\n      <PopoverPrimitive.Content\n        data-slot=\"popover-content\"\n        align={align}\n        sideOffset={sideOffset}\n        className={cn(\n          \"anibt-pop z-50 flex w-72 max-w-[calc(100vw-1rem)] origin-(--radix-popover-content-transform-origin) flex-col gap-3 p-4 text-[13px] duration-150 outline-hidden\",\n          \"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 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1\",\n          className\n        )}\n        {...props}\n      />\n    </PopoverPrimitive.Portal>\n  )\n}\n\nfunction PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n  return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />\n}\n\nfunction PopoverHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n  return <div data-slot=\"popover-header\" className={cn(\"flex flex-col gap-1\", className)} {...props} />\n}\n\n/** 14/700 ink. */\nfunction PopoverTitle({ className, ...props }: React.ComponentProps<\"h2\">) {\n  return (\n    <div\n      data-slot=\"popover-title\"\n      className={cn(\"text-[14px] leading-snug font-bold text-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\n/** 12, muted. */\nfunction PopoverDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n  return (\n    <p\n      data-slot=\"popover-description\"\n      className={cn(\"text-[12px] leading-normal text-muted-foreground\", className)}\n      {...props}\n    />\n  )\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor, PopoverHeader, PopoverTitle, PopoverDescription }\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "overlay"
  ],
  "type": "registry:ui"
}