import type { Ref } from 'react'; import type { DateValue } from '@react-aria/datepicker'; import type { RangeValue } from '@react-types/shared'; import type { TemporalGranularity, TemporalInputCommonProps, TemporalInputTimeProps } from '../TemporalCore'; interface DateRangeValueProps { /** Controlled value — range with start and end dates. */ value?: RangeValue | null; /** Default value for uncontrolled mode. */ defaultValue?: RangeValue | null; /** Callback fired when the range value changes. Receives `null` on clear. */ onChange?: (value: RangeValue | null) => void; ref?: Ref; } type DateOnlyGranularity = { granularity?: 'day'; showTimeDropdown?: never; timeStep?: never; }; type DateTimeGranularity = { granularity: Exclude; } & TemporalInputTimeProps; export type DateRangeInputProps = TemporalInputCommonProps & DateRangeValueProps & (DateOnlyGranularity | DateTimeGranularity); /** * Flattened shape accepted internally after the discriminated-union cast. * Not exported — callers use `DateRangeInputProps`. */ export type DateRangeInputFlatProps = TemporalInputCommonProps & DateRangeValueProps & { granularity?: TemporalGranularity; } & TemporalInputTimeProps; export {};