UNPKG

react-box-tools

Version:

Box tools react components, utils and hooks

82 lines (68 loc) 2.28 kB
import { CSSProperties } from 'react'; import { JSX } from 'react/jsx-runtime'; import { ReactNode } from 'react'; declare type CalendarMonthToday = { show?: boolean; format?: DateFormat; }; export declare type DateFormat = 'ddd, dd mmm yyyy' | 'dd/mm/yyyy' | 'mm/dd/yyyy' | 'yyyy-mm-dd' | 'dd mmm, yyyy'; export declare function dateFormat(date: Date, format: DateFormat, lang?: string): string; export declare const DatePicker: (props: DatePikerProps) => JSX.Element; export declare type DatePickerIcons = { calendar?: ReactNode; prev?: ReactNode; next?: ReactNode; }; export declare type DatePikerProps = { monthsToShow?: MonthKey; monthDropDown?: DropdownBase; yearDropDown?: DropdownBase; refilldays?: boolean; range?: boolean; culture?: string; format?: DateFormat; arrow?: boolean; show?: boolean; style?: CSSProperties; className?: string; contentClass?: string; direction?: DropdownDirection; width?: DropdownWidth; mode?: DropdownMode; offset?: number; onFirstOpen?: () => void; onOpen?: () => void; onClose?: () => void; intersect?: boolean; todayText?: CalendarMonthToday; value?: Date | DateRange; minDate?: Date; maxDate?: Date; onSelected?: (date: Date) => void; onSelectedRange?: ({}: DateRange) => void; icons?: DatePickerIcons; }; declare type DateRange = { from: Date; to: Date; }; declare interface DropdownBase { arrow?: boolean; show?: boolean; style?: CSSProperties; className?: string; contentClass?: string; direction?: DropdownDirection; width?: DropdownWidth; mode?: DropdownMode; offset?: number; onFirstOpen?: () => void; onOpen?: () => void; onClose?: () => void; intersect?: boolean; } declare type DropdownDirection = 'down' | 'down-left' | 'down-right' | 'left' | 'left-top' | 'left-bottom' | 'up' | 'up-left' | 'up-right' | 'right' | 'right-top' | 'right-bottom'; declare type DropdownMode = 'hover' | 'click' | 'toggle'; declare type DropdownWidth = 'full' | 'auto' | 'target'; declare type MonthKey = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; export { }