import { HTMLAttributes, ReactElement, ReactNode } from 'react'; import { IntlShape } from 'react-intl'; import { DateToFormatOptions } from '@synerise/ds-core'; import { DropdownSharedProps } from '@synerise/ds-dropdown'; import { InputProps } from '@synerise/ds-input'; import { DataAttributes } from '@synerise/ds-utils'; export type QuickPick = { label: ReactNode; value: Date; }; export type DatePickerProps = { autoFocus?: boolean; disabled?: boolean; disabledDates?: (date?: Date) => boolean; disabledHours?: number[]; disabledMinutes?: number[]; disabledSeconds?: number[]; dropdownProps?: Partial>; /** * @deprecated use `valueFormatOptions` instead */ format?: string; valueFormatOptions?: DateToFormatOptions; /** * @deprecated - will be dropped in 1.0 */ intl?: IntlShape; onApply: (date?: Date) => void; onClear?: () => void; onDropdownVisibleChange?: (visible: boolean) => void; onValueChange?: (date?: Date) => void; allowClear?: boolean; error?: boolean; errorText?: ReactNode; popoverPlacement?: 'topLeft' | 'topCenter' | 'topRight' | 'bottomLeft' | 'bottomCenter' | 'bottomRight'; prefixel?: ReactNode; suffixel?: ReactNode; showTime?: boolean; texts?: Partial; renderTrigger?: () => ReactElement; value?: Date; useStartOfDay?: boolean; useEndOfDay?: boolean; hideNow?: boolean; quickPicks?: QuickPick[]; readOnly?: boolean; inputProps?: Pick; overlayHTMLAttributes?: HTMLAttributes & DataAttributes; triggerHTMLAttributes?: HTMLAttributes & DataAttributes; }; export type Props = DatePickerProps; export type State = { mode: string; month: Date; changed: boolean; value?: Date; enteredTo?: Date; visible?: boolean; texts: Texts; }; export type Modifier = { start?: Date; end?: Date; entered?: Date; 'entered-start'?: Date; 'entered-end'?: Date; disabled: boolean; }; export type Texts = { apply: ReactNode; now: ReactNode; inputPlaceholder: string; clearTooltip: ReactNode; quickPicks: ReactNode; };