@papernote/ui
Version:
A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive
71 lines • 1.97 kB
TypeScript
import React from 'react';
export interface DatePickerHandle {
focus: () => void;
blur: () => void;
open: () => void;
close: () => void;
}
export interface DatePickerProps {
/** Selected date value */
value?: Date | null;
/** Change handler */
onChange?: (date: Date | null) => void;
/** Input label */
label?: string;
/** Placeholder text */
placeholder?: string;
/** Minimum selectable date */
minDate?: Date;
/** Maximum selectable date */
maxDate?: Date;
/** Disabled dates - array or function */
disabledDates?: Date[] | ((date: Date) => boolean);
/** Locale for date formatting (default: 'en-US') */
locale?: string;
/** Date display format */
format?: 'short' | 'medium' | 'long';
/** Validation state */
validationState?: 'error' | 'success' | 'warning' | null;
/** Validation message */
validationMessage?: string;
/** Helper text */
helperText?: string;
/** Required field indicator */
required?: boolean;
/** Disabled state */
disabled?: boolean;
/** Show today button */
showTodayButton?: boolean;
/** Show clear button */
showClearButton?: boolean;
/** Custom className */
className?: string;
/** Size variant */
size?: 'sm' | 'md' | 'lg';
}
/**
* DatePicker component for selecting dates with a calendar dropdown.
*
* Features:
* - Calendar popup with month/year navigation
* - Min/max date constraints
* - Disabled dates support
* - Locale-aware formatting
* - Keyboard navigation
* - Today and clear buttons
* - Validation states
*
* @example
* ```tsx
* <DatePicker
* label="Start Date"
* value={startDate}
* onChange={setStartDate}
* minDate={new Date()}
* required
* />
* ```
*/
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<DatePickerHandle>>;
export default DatePicker;
//# sourceMappingURL=DatePicker.d.ts.map