@brightsoftware/date-np
Version:
Simple & minimal Nepali date picker that just works.
103 lines (102 loc) • 3 kB
TypeScript
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, endDate: Date | import("../NepaliDate").NepaliDate) => 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";
/**
* shouldShowSinglePanel
*/
shouldShowSinglePanelProp?: boolean;
/**
* Enable editable date input functionality
* Allows users to type dates directly in ISO format (YYYY-MM-DD)
* @default false
*/
editable?: boolean;
/**
* Lock. locks the locale and removes it.
* @default false
*/
lockLocale?: boolean;
/**
* Required. boolean property to indicate if the range picker is required
* @default false
*/
required?: boolean;
} & (tRangePickerWithInput | tRangePickerWithoutInput);
declare const RangePicker: (props: tRangePickerProps) => import("react/jsx-runtime").JSX.Element;
export default RangePicker;