"use client";
import { useEnvironmentContext } from "../../providers/environment/use-environment-context.js";
import { useLocaleContext } from "../../providers/locale/use-locale-context.js";
import * as floatingPanel from "@zag-js/floating-panel";
import { useId } from "react";
import { normalizeProps, useMachine } from "@zag-js/react";
//#region src/components/floating-panel/use-floating-panel.ts
var useFloatingPanel = (props = {}) => {
	const { getRootNode } = useEnvironmentContext();
	const { dir } = useLocaleContext();
	const context = {
		id: useId(),
		dir,
		getRootNode,
		...props
	};
	const service = useMachine(floatingPanel.machine, context);
	return floatingPanel.connect(service, normalizeProps);
};
//#endregion
export { useFloatingPanel };
