"use client";
import { createSplitProps } from "../../utils/create-split-props.js";
import { ark } from "../factory.js";
import { useDatePickerContext } from "./use-date-picker-context.js";
import { useDatePickerViewPropsContext } from "./use-date-picker-view-props-context.js";
import { DatePickerTablePropsProvider } from "./use-date-picker-table-props-context.js";
import { forwardRef, useId } from "react";
import { mergeProps } from "@zag-js/react";
import { jsx } from "react/jsx-runtime";
//#region src/components/date-picker/date-picker-table.tsx
var splitTableProps = createSplitProps();
var DatePickerTable = forwardRef((props, ref) => {
	const [{ columns }, localProps] = splitTableProps(props, ["columns"]);
	const datePicker = useDatePickerContext();
	const viewProps = useDatePickerViewPropsContext();
	const tableProps = {
		columns,
		id: useId(),
		...viewProps
	};
	const mergedProps = mergeProps(datePicker.getTableProps(tableProps), localProps);
	return /* @__PURE__ */ jsx(DatePickerTablePropsProvider, {
		value: tableProps,
		children: /* @__PURE__ */ jsx(ark.table, {
			...mergedProps,
			ref
		})
	});
});
DatePickerTable.displayName = "DatePickerTable";
//#endregion
export { DatePickerTable };
