"use client";
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
const require_use_environment_context = require("../../providers/environment/use-environment-context.cjs");
const require_use_locale_context = require("../../providers/locale/use-locale-context.cjs");
const require_use_fieldset_context = require("../fieldset/use-fieldset-context.cjs");
let _zag_js_radio_group = require("@zag-js/radio-group");
_zag_js_radio_group = require_runtime.__toESM(_zag_js_radio_group, 1);
let react = require("react");
let _zag_js_react = require("@zag-js/react");
//#region src/components/radio-group/use-radio-group.ts
var useRadioGroup = (props) => {
	const fieldset = require_use_fieldset_context.useFieldsetContext();
	const id = (0, react.useId)();
	const { getRootNode } = require_use_environment_context.useEnvironmentContext();
	const { dir } = require_use_locale_context.useLocaleContext();
	const machineProps = {
		id,
		ids: { label: fieldset?.ids?.legend },
		dir,
		disabled: fieldset?.disabled,
		invalid: fieldset?.invalid,
		getRootNode,
		...props
	};
	const service = (0, _zag_js_react.useMachine)(_zag_js_radio_group.machine, machineProps);
	return _zag_js_radio_group.connect(service, _zag_js_react.normalizeProps);
};
//#endregion
exports.useRadioGroup = useRadioGroup;
