import { type ChangeEventHandler, type FocusEventHandler, type HTMLAttributes, type ReactNode } from "react"; import { type BaseSchema } from "valibot"; import { type ValidationProps } from "../../../hook/useInputValidation"; import { type InputProps } from "../input"; import { type SelectProps } from "../select"; /** * Context provided by the DateInput to its child components (Day, Month, Year). */ export type DateInputContext = { /** The currently selected year. */ year: number | null; /** Updates the year. */ setYear: (year: number | null) => void; /** The currently selected month (0-indexed). */ month: number | null; /** Updates the month. */ setMonth: (month: number | null) => void; /** The currently selected day of the month. */ day: number | null; /** Updates the day. */ setDay: (day: number | null) => void; }; /** * Props for the {@link DateInput} component. * * @remarks * Extends standard HTML div attributes (as the wrapper) and adds validation and value control properties. */ export type DateInputProps> = Omit, "defaultValue" | "onChange" | "children"> & ValidationProps & { /** Initial date value as an ISO string (YYYY-MM-DD). */ defaultValue?: string; /** Controlled date value as an ISO string (YYYY-MM-DD). */ value?: string; /** Name attribute for the hidden input. */ name?: string; /** Callback when the hidden input value changes. */ onChange?: ChangeEventHandler; /** Child components (Day, Month, Year). */ children?: ReactNode; /** Whether the date input is required. */ required?: boolean; /** Callback when the input is blurred. */ onBlur?: FocusEventHandler; }; /** * A compound component for selecting a date using separate inputs for day, month, and year. * * @remarks * This component manages the state of three separate inputs and combines them into a single * ISO date string (YYYY-MM-DD) in a hidden input for form submission. * It uses a reducer to manage internal state and synchronizes with the `value` prop. * * @param props - The component props. * @returns The rendered date input wrapper. * * @example * ```tsx * import { DateInput, Day, MonthSelect, Year } from './date_input'; * * function BirthdayField() { * return ( * * * * * * ); * } * ``` */ export declare function DateInput>({ children, name, onChange, defaultValue, value, id, onValidationError, validate, required, onBlur, ...props }: DateInputProps): import("react").JSX.Element; declare let createDaySchema: (numberOfDays: number) => import("valibot").SchemaWithPipe, undefined>, import("valibot").TransformAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>; /** * A specialized input for entering the day of the month. * * @remarks * Validates that the entered day is valid for the currently selected month and year. * * @param props - Standard input props (excluding value/onChange). * @returns The rendered day input. */ export declare function Day({ ...props }: Omit>, "value" | "onChange" | "type" | "min" | "max" | "validate">): import("react").JSX.Element; /** * A select component for choosing the month. * * @param props - Standard select props (excluding value/required/onChange). * @returns The rendered month select. */ export declare function MonthSelect>(props: Omit, "value" | "required" | "onChange">): import("react").JSX.Element; declare let MonthSchema: import("valibot").SchemaWithPipe, undefined>, import("valibot").TransformAction, import("valibot").MinValueAction, import("valibot").MaxValueAction]>; /** * A numeric input for entering the month (1-12). * * @param props - Standard input props (excluding value/onChange). * @returns The rendered month input. */ export declare let MonthInput: (props: Omit, "value" | "onChange" | "type" | "min" | "max">) => import("react").JSX.Element; /** * A numeric input for entering the year. * * @param props - Standard input props (excluding value/onChange). * @returns The rendered year input. */ export declare function Year>(props: Omit, "value" | "onChange" | "type" | "required">): import("react").JSX.Element; export {};