import React from 'react'; import Input from '../Input'; export interface DatePickerPreset { /** 프리셋 버튼에 표시할 라벨 */ label: string; /** 컴포넌트의 format에 맞는 날짜 문자열 (예: "2026/04/03") */ value: string; } interface BaseDatePickerProps { /** * props.format 의 형식을 따라야 한다. * * NOTE: 빈 값으로 시작하는 controlled 필드는 `undefined`가 아니라 `null`을 넘겨야 한다. * `undefined`를 넘기면 마운트 시점에 uncontrolled로 판정되어 이후 외부에서의 값 변경이 반영되지 않는다. */ value?: string | null; defaultValue?: string; onChange?: (event: { target: { name?: string; value: string; }; }) => void; name?: string; disabled?: boolean; required?: boolean; label?: React.ReactNode; error?: boolean; helperText?: React.ReactNode; minDate?: string; maxDate?: string; disableFuture?: boolean; disablePast?: boolean; /** * value, onChange의 값은 해당 포맷을 따른다. */ format?: string; /** * Input 에 표시되는 값의 포맷을 지정한다. */ displayFormat?: string; /** * 월 이름 표시에 사용할 locale (예: 'en-US', 'ko-KR'). MMM/MMMM 토큰 사용 시 적용된다. */ locale?: string; inputReadOnly?: boolean; hideClearButton?: boolean; /** * Disable specific date. * Warning: This function can be called multiple times (for example when rendering date calendar, checking if focus can be moved to a certain date, etc.). Expensive computations can impact performance. * @param date * @returns If `true` the date will be disabled */ shouldDisableDate?: (date: string) => boolean; /** * 달력 옆에 표시할 프리셋 목록. 각 항목의 value는 format prop의 형식을 따라야 한다. */ presets?: DatePickerPreset[]; } export type DatePickerProps = BaseDatePickerProps & Omit, 'onChange' | 'value' | 'defaultValue'>; declare const DatePicker: React.ForwardRefExoticComponent & React.RefAttributes>; export { DatePicker };