import { jsx } from "react/jsx-runtime";
import "react";
import "clsx";
import { useProps } from "../../core/MantineProvider/use-props/use-props.mjs";
import { useDelayedHover } from "../Floating/use-delayed-hover.mjs";
import { Popover } from "../Popover/Popover.mjs";
import { HoverCardContextProvider } from "./HoverCard.context.mjs";
import { HoverCardDropdown } from "./HoverCardDropdown/HoverCardDropdown.mjs";
import { HoverCardTarget } from "./HoverCardTarget/HoverCardTarget.mjs";
import { useDisclosure } from "../../../../../../../@mantine_hooks@7.15.2_react@18.3.1/node_modules/@mantine/hooks/esm/use-disclosure/use-disclosure.mjs";
const defaultProps = {
  openDelay: 0,
  closeDelay: 150,
  initiallyOpened: false
};
function HoverCard(props) {
  const { children, onOpen, onClose, openDelay, closeDelay, initiallyOpened, ...others } = useProps(
    "HoverCard",
    defaultProps,
    props
  );
  const [opened, { open, close }] = useDisclosure(initiallyOpened, { onClose, onOpen });
  const { openDropdown, closeDropdown } = useDelayedHover({ open, close, openDelay, closeDelay });
  return /* @__PURE__ */ jsx(HoverCardContextProvider, { value: { openDropdown, closeDropdown }, children: /* @__PURE__ */ jsx(Popover, { ...others, opened, __staticSelector: "HoverCard", children }) });
}
HoverCard.displayName = "@mantine/core/HoverCard";
HoverCard.Target = HoverCardTarget;
HoverCard.Dropdown = HoverCardDropdown;
HoverCard.extend = (input) => input;
export {
  HoverCard
};
