'use client';

// src/components/Popover/Popover.tsx
import * as React from "react";
import { cn } from "@paalan/react-shared/lib";
import * as PopoverPrimitive from "@radix-ui/react-popover";
import { jsx, jsxs } from "react/jsx-runtime";
var PopoverRoot = PopoverPrimitive.Root;
var PopoverTrigger = PopoverPrimitive.Trigger;
var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
  PopoverPrimitive.Content,
  {
    ref,
    align,
    sideOffset,
    className: cn(
      "relative z-50 min-w-[var(--radix-popper-anchor-width)] rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",
      className
    ),
    ...props
  }
) }));
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
var Popover = ({ trigger, triggerClassName, contentClassName, content, ...props }) => {
  return /* @__PURE__ */ jsxs(PopoverRoot, { ...props, children: [
    trigger && /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, className: triggerClassName, children: trigger }),
    content && /* @__PURE__ */ jsx(PopoverContent, { className: contentClassName, children: content })
  ] });
};
Popover.displayName = "Popover";
export {
  Popover,
  PopoverContent,
  PopoverRoot,
  PopoverTrigger
};
