"use client";
import { parts } from "./segment-group.anatomy.js";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { SegmentGroupProvider } from "./use-segment-group-context.js";
import { useSegmentGroup } from "./use-segment-group.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/segment-group/segment-group-root.tsx
var splitRootProps = createSplitProps();
var SegmentGroupRoot = forwardRef((props, ref) => {
	const [useSegmentGroupProps, localProps] = splitRootProps(props, [
		"defaultValue",
		"disabled",
		"form",
		"id",
		"ids",
		"invalid",
		"name",
		"onValueChange",
		"orientation",
		"readOnly",
		"required",
		"value"
	]);
	const segmentGroup = useSegmentGroup(useSegmentGroupProps);
	const mergedProps = mergeProps(segmentGroup.getRootProps(), parts.root.attrs, localProps);
	return /* @__PURE__ */ jsx(SegmentGroupProvider, {
		value: segmentGroup,
		children: /* @__PURE__ */ jsx(ark.div, {
			...mergedProps,
			ref
		})
	});
});
SegmentGroupRoot.displayName = "SegmentGroupRoot";
//#endregion
export { SegmentGroupRoot };
