@spark-web/date-picker
Version:
--- title: DatePicker storybookPath: forms-date-picker isExperimentalPackage: true ---
34 lines (33 loc) • 1.53 kB
TypeScript
/// <reference types="react" />
import type { DataAttributeMap } from '@spark-web/utils/internal';
import type { DateInputProps } from "./date-picker-input.js";
/**
* DatePicker
*
* The DatePicker component allows users to either manually enter a date
* in `dd/MM/yyyy` format or use the calendar button to render a month view
* that users can pick from. Clicking on a date will fill in the input for
* that date in the correct format.
*
* @see https://spark.brighte.com.au/package/date-picker
*/
export declare const DatePicker: import("react").ForwardRefExoticComponent<DatePickerInputProps & DatePickerCalendarProps & DatePickerBaseProps & import("react").RefAttributes<HTMLInputElement>>;
declare type DatePickerInputProps = Omit<DateInputProps, 'buttonOnClick' | 'buttonRef' | 'children' | 'onChange' | 'value'>;
declare type DatePickerCalendarProps = {
/** If set, any days before this date will not be selectable. */
minDate?: Date;
/** If set, any days after this date will not be selectable. */
maxDate?: Date;
/** The calendar month to initially show, if no value is set. */
initialMonth?: Date;
};
declare type DatePickerBaseProps = {
/** Map of data attributes. */
data?: DataAttributeMap;
/** The value of the field. */
value: Date | undefined;
/** Function to be fired following a change event. */
onChange: (day: Date | undefined) => void;
};
export declare type DatePickerProps = DatePickerInputProps & DatePickerCalendarProps & DatePickerBaseProps;
export {};