import { ReactNode } from 'react'; export interface DateRange { start: Date | null; end: Date | null; } export interface DateRangePreset { /** Button content. ReactNode so a caller can pass a badge/formatted fragment. */ label: ReactNode; /** Produces the range to apply. Returns a value (unlike DatePickerPreset's * `onSelect` callback) so the component can clamp it to min/max and jump the * grid to it — a fire-and-forget callback could do neither. */ range: () => DateRange; } export interface DateRangePickerProps { value: DateRange; onChange: (range: DateRange) => void; /** * `true` (default) renders the built-in proximity-ordered quick ranges, * `false` renders no column, and an array supplies your own — so a consumer * with a domain-specific shortcut ("Son 6 Ay", "Bu Çeyrek") extends the * control through the API instead of forking it. */ presets?: boolean | DateRangePreset[]; /** * Earliest selectable DAY. Days before it are aria-disabled and presets clamp * to it. Compared on day boundaries, so a time-of-day component never * half-disables its own date. */ min?: Date; /** Latest selectable DAY. Days after it are aria-disabled; presets clamp to it. */ max?: Date; /** * Opens hour:minute selection for BOTH bounds — renders two time boxes * INSIDE the calendar popover (placement chosen via `timeLayout`). * Deliberately not beside the trigger: this is one field carrying two * bounds, and hanging two time boxes off it would break the combined * control's layout (and the 280px filter rail). Where the boxes sit * WITHIN the popover is a separate, revisited decision — see `timeLayout` * (NB-DATETIME-02, LHA-445). * @default false * * Off (the default) a day click emits the raw day `Date` exactly as before. On, * each bound KEEPS its own time across a re-pick (00:00 when unset) and seconds * are always zeroed. * * NOTE: the end bound is NOT rounded to end-of-day, with or without `showTime`. * Consumers compare these as plain instants, so a silent 23:59:59 would change * what the value means; `showTime` lets the user set that themselves. * * A time edit can still never emit an inverted pair: the EDITED bound wins, * and the OTHER bound is dragged along only as far as `start <= end` needs * (on one day with the end at 00:00, typing 09:00 into the start pulls the * end up to 09:00 with it). The typed value is never silently reverted. * (NB-DATETIME-01, revised by NB-DATETIME-03) * * While on, completing the two-click range does NOT close the popover * (NB-DATETIME-03) — the time boxes are part of the same interaction. The * panel still closes the ways it always has otherwise: outside-click, Escape, * Tab-out, or a trigger click. Off, the second click still closes as it * always has. */ showTime?: boolean; /** * NB-DATETIME-02 (LHA-445): where the time input(s) sit while `showTime` is on. * "beside" (default) — a narrow labelled column to the RIGHT of the day grid, * separated by a vertical border: compact, shorter popover (the QA-requested look). * "below" — the previous full-width row UNDER the grid with a top border; pass * this to keep the pre-1.22 layout (e.g. inside a narrow filter rail). * Ignored while `showTime` is off. */ timeLayout?: "beside" | "below"; /** `` step while `showTime` is on, in MINUTES. @default 1 */ minuteStep?: number; disabled?: boolean; /** Marks the field invalid (chrome only — FormField renders the message). */ error?: string; className?: string; /** ARIA forwarding — injected by FormField via cloneElement (mirrors Select) */ "aria-invalid"?: boolean | "true" | "false"; "aria-describedby"?: string; "aria-required"?: boolean | "true" | "false"; id?: string; } /** * DateRangePicker — ONE console-baseline input carrying BOTH bounds * ("start — end"), backed by a single portaled calendar. * * It used to compose two DatePickers side by side with a preset button row * underneath; both bounds now live in one field, and the shortcuts ride a * proximity-ordered column INSIDE the popover (nearest range first), so the * whole control fits a narrow filter rail. * * Selection is two-click: the first day drafts the start (and emits the * half-open range immediately, since a start-only range is a legal filter), * the second closes it — picked backwards, the bounds swap. Hovering between * the two clicks previews the span. * * The panel portals to document.body (NB-POPOVER-01) so no overflow-y-auto * ancestor can clip it, which also puts it OUTSIDE any enclosing focus-trap — * hence it owns its own two-zone keyboard engine (preset column ↔ day grid), * exactly like DatePicker's. * * `min`/`max`/`error` and array-valued `presets` mirror DatePicker's surface so * a range field is as expressible as a single-date one: a consumer bounds the * allowed window, flags the field invalid from its OWN validation (the rule * stays in the consumer — the package only renders the invalid chrome), and * supplies domain shortcuts, all without forking the component. */ export declare function DateRangePicker({ value, onChange, presets, min, max, showTime, timeLayout, minuteStep, disabled, error, className, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedBy, "aria-required": ariaRequired, id, }: DateRangePickerProps): import("react").JSX.Element; //# sourceMappingURL=DateRangePicker.d.ts.map