UNPKG

@brightsoftware/date-np

Version:

Simple & minimal Nepali date picker that just works.

83 lines (82 loc) 2.5 kB
import { type ComponentProps } from "react"; import RangePickerInput from "./Components/range-picker-input"; import { type tdirectionAwareContainerProps } from "../Components/helpers/direction-aware-container"; import "../index.css"; type tRangePickerWithoutInput = { /** * Note: * You should have `shouldShowInput` set to true in order to * give input props */ inputProps?: never; shouldShowInput?: false; }; type tRangePickerWithInput = { /** * customize input with input specific props. * visit: #docs for more information on this. */ inputProps?: ComponentProps<typeof RangePickerInput>; /** * Specify whether to show the picker input or not * @defaults to true */ shouldShowInput?: boolean; }; export type tRangePickerProps = { /** * className for styling the main picker */ className?: string; /** * Provide individual styling to different components. */ classNames?: { leftPanel?: string; rightPanel?: string; container?: string; }; /** * Control how and where you show the Picker container */ dAwareConProps?: tdirectionAwareContainerProps; /** * Callback function called when date range selection is complete */ onRangeSelect?: (startDate: Date | import("../NepaliDate").NepaliDate | null, endDate: Date | import("../NepaliDate").NepaliDate | null) => void; /** * Callback function called when the picker visibility changes */ onVisibilityChange?: (isVisible: boolean) => void; /** * label for the range picker input */ label?: string; /** * description for the range picker input */ description?: string; /** * Minimum selectable date */ minDate?: Date | import("../NepaliDate").NepaliDate; /** * Maximum selectable date */ maxDate?: Date | import("../NepaliDate").NepaliDate; /** * Default start date for the range picker */ startingDateRange?: Date | import("../NepaliDate").NepaliDate; /** * Default end date for the range picker */ endingDateRange?: Date | import("../NepaliDate").NepaliDate; /** * Default locale for the picker * @default "AD" */ defaultLocale?: "AD" | "BS"; } & (tRangePickerWithInput | tRangePickerWithoutInput); declare const RangePicker: (props: tRangePickerProps) => import("react/jsx-runtime").JSX.Element; export default RangePicker;