"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useRadioGroupContext } from "./use-radio-group-context.js";
import { RadioGroupItemProvider } from "./use-radio-group-item-context.js";
import { RadioGroupItemPropsProvider } from "./use-radio-group-item-props-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/radio-group/radio-group-item.tsx
var splitItemProps = createSplitProps();
var RadioGroupItem = forwardRef((props, ref) => {
	const [itemProps, localProps] = splitItemProps(props, [
		"value",
		"disabled",
		"invalid"
	]);
	const radioGroup = useRadioGroupContext();
	const mergedProps = mergeProps(radioGroup.getItemProps(itemProps), localProps);
	return /* @__PURE__ */ jsx(RadioGroupItemProvider, {
		value: radioGroup.getItemState(itemProps),
		children: /* @__PURE__ */ jsx(RadioGroupItemPropsProvider, {
			value: itemProps,
			children: /* @__PURE__ */ jsx(ark.label, {
				...mergedProps,
				ref
			})
		})
	});
});
RadioGroupItem.displayName = "RadioGroupItem";
//#endregion
export { RadioGroupItem };
