"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { usePresenceContext } from "../presence/use-presence-context.js";
import { useDrawerContext } from "./use-drawer-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/drawer/drawer-trigger.tsx
var splitTriggerProps = createSplitProps();
var DrawerTrigger = forwardRef((props, ref) => {
	const [triggerProps, localProps] = splitTriggerProps(props, ["value"]);
	const drawer = useDrawerContext();
	const presence = usePresenceContext();
	const triggerPropsRaw = drawer.getTriggerProps(triggerProps);
	const mergedProps = mergeProps({
		...triggerPropsRaw,
		"aria-controls": presence.unmounted ? void 0 : triggerPropsRaw["aria-controls"]
	}, localProps);
	return /* @__PURE__ */ jsx(ark.button, {
		...mergedProps,
		ref
	});
});
DrawerTrigger.displayName = "DrawerTrigger";
//#endregion
export { DrawerTrigger };
