"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useDateInput } from "./use-date-input.js";
import { DateInputProvider } from "./use-date-input-context.js";
import { forwardRef } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/date-input/date-input-root.tsx
var splitRootProps = createSplitProps();
var DateInputRoot = forwardRef((props, ref) => {
	const [useDateInputProps, localProps] = splitRootProps(props, [
		"dir",
		"disabled",
		"getRootNode",
		"id",
		"ids",
		"invalid",
		"locale",
		"max",
		"min",
		"name",
		"form",
		"onFocusChange",
		"onPlaceholderChange",
		"onValueChange",
		"readOnly",
		"required",
		"selectionMode",
		"timeZone",
		"hideTimeZone",
		"translations",
		"value",
		"defaultValue",
		"hourCycle",
		"granularity",
		"shouldForceLeadingZeros",
		"allSegments",
		"formatter",
		"placeholderValue",
		"defaultPlaceholderValue",
		"format",
		"createCalendar",
		"isDateUnavailable"
	]);
	const dateInput = useDateInput(useDateInputProps);
	const mergedProps = mergeProps(dateInput.getRootProps(), localProps);
	return /* @__PURE__ */ jsx(DateInputProvider, {
		value: dateInput,
		children: /* @__PURE__ */ jsx(ark.div, {
			...mergedProps,
			ref
		})
	});
});
DateInputRoot.displayName = "DateInputRoot";
//#endregion
export { DateInputRoot };
