import { CommonProps, Refable, type Styleable } from "@trackunit/react-components"; import { DateRange } from "@trackunit/date-and-time-utils"; import { ReactElement } from "react"; import type { TimeZone } from "../TimeZone"; import { DisabledDaysMatcher } from "./DayPicker"; export interface DayRangePickerProps extends CommonProps, Refable, Styleable { /** * A callback function for when a range is selected */ onRangeSelect?: (range: DateRange | undefined) => void; /** * Define any days which may not be selected */ disabledDays?: DisabledDaysMatcher; /** * Set any days which are selected */ selectedDays?: DateRange; /** * Set the language */ language: string; /** * @deprecated Timezone is now resolved automatically from context. This prop is kept for backwards compatibility. */ timezone?: TimeZone; /** * The label for the cancel button */ cancelButtonLabel?: string; /** * Callback for closing component view */ onClose?: () => void; /** * A custom class name to be attached to the inner calendar element */ classNameCalendar?: string; } /** * DayRangePicker renders an interactive calendar that allows the user to select a start and end date. * It supports disabled days, timezone-aware display, locale configuration, and an optional cancel button. * The selected range is returned via the `onRangeSelect` callback as a `DateRange` object. * * ### When to use * Use DayRangePicker when the user needs a visual calendar to pick a custom date range — for example, * selecting a reporting period or scheduling an event spanning multiple days. * * ### When not to use * Do not use DayRangePicker for quick preset ranges (e.g., "Last 7 days") — use `DayRangeSelect` which includes preset options and a calendar fallback. * Do not use it for time selection — use `TimeRangeField`. * * @example Selecting a date range * ```tsx * import { DayRangePicker } from "@trackunit/react-date-and-time-components"; * * const ReportDatePicker = () => ( * console.log(range)} * /> * ); * ``` * @param {DayRangePickerProps} props - The props for the DayRangePicker component * @returns {ReactElement} DayRangePicker component */ export declare const DayRangePicker: ({ onRangeSelect, selectedDays, disabledDays, "data-testid": dataTestId, language, className, style, classNameCalendar, timezone: _timezone, cancelButtonLabel, onClose, ref, }: DayRangePickerProps) => ReactElement;