import type { Dayjs } from "dayjs"; import type React from "react"; import type { TimePickerFormat } from "../TimePicker/types"; export type DateValue = Date | Dayjs; export type DatePickerType = "date" | "range"; export type DatePickerMode = "date" | "day" | "week" | "month" | "year"; export type PopoverSide = "top" | "right" | "bottom" | "left"; export type PopoverAlign = "start" | "center" | "end"; export interface DatePickerProps { /** Current value. Date/Dayjs for single, [Date, Date] for range. */ value?: DateValue | [DateValue | null, DateValue | null] | null; /** Default value (uncontrolled). */ defaultValue?: DateValue | [DateValue | null, DateValue | null]; /** Callback on date change. Returns Dayjs objects for neeto ecosystem compatibility. */ onChange?: (value: Dayjs | [Dayjs | null, Dayjs | null] | null, formatted: string | [string, string]) => void; /** Callback when the trigger input loses focus. */ onBlur?: (e: React.FocusEvent) => void; /** Single date or range selection. */ type?: DatePickerType; /** Display format string (date-fns compatible, e.g. "dd/MM/yyyy"). */ dateFormat?: string; /** Time format string (date-fns compatible, e.g. "HH:mm:ss"). */ timeFormat?: string; /** Show time picker alongside calendar. */ showTime?: boolean; /** Time picker format (12 or 24 hour). */ timePickerFormat?: TimePickerFormat; /** Show seconds in time picker. */ showSeconds?: boolean; /** Minimum selectable date. */ minDate?: DateValue; /** Maximum selectable date. */ maxDate?: DateValue; /** Predicate to disable arbitrary dates beyond minDate/maxDate. */ disabledDate?: (date: Date) => boolean; /** Placeholder text for the trigger input. */ placeholder?: string; /** Label displayed above the picker. */ label?: string; /** Error message displayed below the picker. */ error?: string; /** Help text displayed below the picker. */ helpText?: React.ReactNode; /** Size of the trigger. */ size?: "small" | "medium" | "large"; /** Disabled state. */ disabled?: boolean; /** Show clear button. */ allowClear?: boolean; /** Required field indicator. */ required?: boolean; /** Timezone value (e.g. "utc" or undefined for local). */ timezone?: string; /** Callback when timezone changes. */ onTimezoneChange?: (tz: string | undefined) => void; /** Callback when OK is clicked (showTime mode). */ onOk?: (value: Date | [Date, Date] | null) => void; /** Whether OK button is needed to confirm selection. */ needConfirm?: boolean; /** Controlled popover open state. Omit for uncontrolled. */ open?: boolean; /** Callback when popover opens/closes (fires for both controlled and uncontrolled). */ onOpenChange?: (open: boolean) => void; /** Additional CSS class names. */ className?: string; /** Props forwarded to the label element. */ labelProps?: Record; /** Picker granularity. "date"/"day" shows day calendar; "week"/"month"/"year" show grid pickers. Only honored when type="date". */ picker?: DatePickerMode; /** Side of the trigger to render the popover. */ side?: PopoverSide; /** Alignment of the popover relative to the trigger. */ align?: PopoverAlign; /** Custom trigger element. When provided, replaces the built-in input UI and the popover anchors to this element. */ trigger?: React.ReactNode; /** First day of the week. 0 = Sunday (default), 1 = Monday, etc. */ weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6; }