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