@brightsoftware/date-np
Version:
Simple & minimal Nepali date picker that just works.
62 lines (61 loc) • 1.77 kB
TypeScript
import { type ComponentProps } from "react";
import PickerInput from "./Components/picker-input";
import { type tdirectionAwareContainerProps } from "./Components/helpers/direction-aware-container";
import "./index.css";
type tpickerWithoutInput = {
/**
* Note:
* You should have `shouldShowInput` set to true inorder to
* give input props
*/
inputProps?: never;
shouldShowInput?: false;
};
type tpickerWithInput = {
/**
* customize input with input specific props.
* visit: #docs for more information on this.
*/
inputProps?: ComponentProps<typeof PickerInput>;
/**
* Specify whethere to show the picker input or not
* @defaults to true
*/
shouldShowInput?: boolean;
};
export type tpickerProps = {
/**
* min date for the picker
*/
minDate?: Date | import("./NepaliDate").NepaliDate;
/**
* max date for the picker
*/
maxDate?: Date | import("./NepaliDate").NepaliDate;
/**
* className for styling the main picker
*/
className?: string;
/**
* Provide individual styling to different components.
*/
classNames?: {};
/**
* onSelect callback function called when date selection is complete
*/
onSelect?: (selectedDate: Date | import("./NepaliDate").NepaliDate | null) => void;
/**
* Control how and where you show the Picker containerp
*/
dAwareConProps?: tdirectionAwareContainerProps;
/**
* label for the picker
*/
label?: string;
/**
* description for the picker
*/
description?: string;
} & (tpickerWithInput | tpickerWithoutInput);
declare const Picker: (props: tpickerProps) => import("react/jsx-runtime").JSX.Element;
export default Picker;