import { default as React } from 'react'; import { DateRange } from '@mui/x-date-pickers-pro'; import { DateRangePickerCopy } from '@mxenabled/mxui'; export type DateRangeSelectorCopy = { dateRangePickerCopy: DateRangePickerCopy; dateRangeEditApply: string; dateRangeEditTitle: string; dateRangeNextAria: string; dateRangePreviousAria: string; dateRangeCloseAria: string; }; export type CalendarActions = { shouldDisableNext?: boolean; shouldDisablePrevious?: boolean; shouldDisablePicker?: boolean; onRangeChanged: (dateRange: DateRange) => void; /** * Fires only when the user actively selects a timeframe button/tab (3M/6M/9M/1Y). * Unlike onRangeChanged, this does NOT fire on mount, so it's safe for click analytics. */ onTimeframeClick?: (timeframe: number) => void; }; export interface DateRangeSelectorProps { calendarActions: CalendarActions; color?: 'primary' | 'secondary'; copy: DateRangeSelectorCopy; range?: DateRange; shouldShrinkToIcon?: boolean; variant?: 'outlined' | 'text' | 'readonly' | 'timeframebuttons' | 'timeframetabs'; } export type Timeframe = { ariaLabel?: string; label: string; value: number; }; export declare const DEFAULT_TIMEFRAME = 6; /** * Derive the timeframe button/tab that matches a caller-supplied range. * * The timeframe variants own a `timeframe` state that drives the mount effect. * Seeding it from the incoming range keeps the control in sync with the * caller's stored selection, so remounting doesn't reset it to the default * and clobber that selection via onRangeChanged. (MEW-3911) * * Returns DEFAULT_TIMEFRAME when the range doesn't correspond to a button * (e.g. NetWorth, which renders the timeframe variants without passing a * range and relies on the mount emit to seed its own 6M default). */ export declare const getTimeframeFromRange: (range: DateRange) => number; declare const DateRangeSelector: React.FC; export default DateRangeSelector;