UNPKG

@yamada-ui/calendar

Version:

Yamada UI calendar component

50 lines (47 loc) 2.16 kB
import * as _yamada_ui_popover from '@yamada-ui/popover'; import * as _yamada_ui_core from '@yamada-ui/core'; import { CSSUIObject, PropGetter } from '@yamada-ui/core'; import { CalendarProps as CalendarProps$1 } from './calendar.mjs'; import * as react from 'react'; import { UseCalendarProps } from './use-calendar.mjs'; import { UseCalendarPickerProps } from './use-calendar-picker.mjs'; import './calendar-header.mjs'; import '@yamada-ui/button'; import '@yamada-ui/icon'; import './use-calendar-header.mjs'; import './month.mjs'; import './month-list.mjs'; import './year-list.mjs'; import 'dayjs'; import '@yamada-ui/form-control'; interface DatePickerContext { [key: string]: CSSUIObject | undefined; } declare const DatePickerProvider: react.Provider<DatePickerContext>; declare const useDatePickerContext: () => DatePickerContext; interface CalendarProps extends Omit<UseCalendarProps<Date | undefined>, "enableMultiple" | "enableRange" | "nextRef" | "prevRef" | "typeRef"> { } interface UseDatePickerOptions { /** * If `true`, the calendar component will be closed when value is selected. * * @default true */ closeOnSelect?: boolean; } interface UseDatePickerProps extends UseCalendarPickerProps<CalendarProps>, UseDatePickerOptions { } declare const useDatePicker: ({ closeOnSelect, defaultValue, placeholder, value: valueProp, onChange: onChangeProp, ...rest }: UseDatePickerProps) => { value: Date | undefined; getCalendarProps: (props?: CalendarProps$1) => CalendarProps$1; getContainerProps: PropGetter<"div", undefined>; getFieldProps: PropGetter<"div", undefined>; getIconProps: _yamada_ui_core.RequiredPropGetter<{ clear: boolean; } & _yamada_ui_core.HTMLProps, _yamada_ui_core.HTMLProps>; getInputProps: PropGetter<"input", undefined>; getPopoverProps: (props?: _yamada_ui_popover.PopoverProps) => _yamada_ui_popover.PopoverProps; onClose: (...args: any[]) => Promise<void> | void; }; type UseDatePickerReturn = ReturnType<typeof useDatePicker>; export { DatePickerProvider, type UseDatePickerProps, type UseDatePickerReturn, useDatePicker, useDatePickerContext };