import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { cn } from "@stigmer/theme";
import { Popover } from "@base-ui/react/popover";
export function ContextPopover({ icon, label, count, children, disabled, open, onOpenChange, hideLabel, }) {
    return (_jsxs(Popover.Root, { open: open, onOpenChange: onOpenChange, children: [_jsxs(Popover.Trigger, { disabled: disabled, className: cn("inline-flex items-center gap-1 rounded-md px-2 py-1.5 text-xs transition-colors", "text-muted-foreground hover:text-foreground hover:bg-accent-hover", "disabled:pointer-events-none disabled:opacity-50"), children: [icon, _jsx("span", { className: cn(hideLabel && "max-sm:hidden"), children: label }), count > 0 && (_jsx("span", { className: "rounded-full bg-primary-subtle px-1.5 text-[0.6rem] font-medium text-primary", children: count }))] }), _jsx(Popover.Portal, { children: _jsx(Popover.Positioner, { sideOffset: 8, align: "start", children: _jsx(Popover.Popup, { className: [
                            "z-popover overflow-x-hidden overflow-y-auto rounded-lg border border-border",
                            "bg-popover p-3 shadow-md text-popover-foreground",
                            "max-h-[80vh]",
                        ].join(" "), children: children }) }) })] }));
}
//# sourceMappingURL=ContextPopover.js.map