import { type FocusEvent, type ReactElement } from "react"; import { BaseInputProps } from "../../BaseInput/BaseInput"; import { type DateFieldPickerCloseReason } from "./utils/useDatePickerController"; export type { DateFieldPickerCloseReason } from "./utils/useDatePickerController"; type BaseInputExposedProps = Omit; export interface DateBaseInputProps extends BaseInputExposedProps { /** * A min value with type Date added */ min?: Date | string | number; /** * A max value with type Date added */ max?: Date | string | number; /** * A default value with type Date added */ defaultValue?: Date | string | number; /** * A value with type Date added */ value?: Date | string | number; /** * Optional override for the BCP-47 locale used for placeholder, display formatting, and * locale-aware parsing of typed input. * * When omitted (recommended for production), the locale resolves via `useDateFieldLocale`, * which prefers the browser's region-qualified `navigator.language` and falls back to the * user-selected Manager UI language. Pass an explicit value (e.g. `"en-GB"`, `"da-DK"`, * `"ja-JP"`) only for deliberate overrides — for example, embedded reports that require a * fixed format, or Storybook/locale showcase stories. */ locale?: string; /** * Called when the calendar popover closes, regardless of how it was dismissed. * * Receives a synthetic `FocusEvent` whose `target.value` is the canonical `YYYY-MM-DD` value * currently committed to the input (or `""` when empty). The `reason` argument distinguishes * Apply / Clear / Cancel from the new "outside" auto-apply, so consumers can opt out of * server-side validation when the user explicitly cancelled. * * Use this as a middle ground between `onChange` (fires per keystroke / per pick) and * `onBlur` (fires when the input itself loses focus, which may be much later or never if the * user only interacts with the popover). */ onPickerClose?: (event: FocusEvent, reason: DateFieldPickerCloseReason) => void; /** * When `true`, the calendar popover opens automatically the moment the input gains focus * (for example, by tabbing into the field). The popover trigger (calendar icon, Space, or * Enter on the icon) continues to work as before. * * Focus events that originate from the popover closing — Floating UI's `returnFocus` * placing focus back on the input after Cancel/Apply/Escape/outside-press — are ignored, * so the picker does not loop open immediately after closing. * * @default false */ openOnFocus?: boolean; } /** * A wrapper around BaseInput with a pop-up day picker using the same calendar UI as DayPicker. * * The value is formatted to an ISO date string (YYYY-MM-DD) * * NOTE: If shown with a label, please use the `DateField` component instead. */ export declare const DateBaseInput: ({ min, max, defaultValue, value, ref, onChange, onBlur, onPickerClose, openOnFocus, locale: localeProp, suffix: suffixProp, "data-testid": dataTestId, ...rest }: DateBaseInputProps) => ReactElement;