/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
import { PopoverInternalContext } from "./PopoverContext.js";
import { Fragment, isValidElement, useContext } from "react";
import { jsx } from "react/jsx-runtime";
import { PopoverDisclosure } from "@ariakit/react";
//#region src/components/client/Popover/PopoverTrigger.tsx
function PopoverTrigger({ children }) {
	const toggleOnClick = !useContext(PopoverInternalContext)?.isControlled;
	if (isValidElement(children) && children.type !== Fragment) return /* @__PURE__ */ jsx(PopoverDisclosure, {
		render: children,
		toggleOnClick
	});
	return /* @__PURE__ */ jsx(PopoverDisclosure, {
		className: "inline",
		toggleOnClick,
		children
	});
}
PopoverTrigger.displayName = "PopoverTrigger";
//#endregion
export { PopoverTrigger };
