react-native-bikram-sambat 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +340 -0
- package/lib/commonjs/accessibility/index.js +25 -0
- package/lib/commonjs/accessibility/index.js.map +1 -0
- package/lib/commonjs/accessibility/labels.js +20 -0
- package/lib/commonjs/accessibility/labels.js.map +1 -0
- package/lib/commonjs/calendar/calendar-types.js +6 -0
- package/lib/commonjs/calendar/calendar-types.js.map +1 -0
- package/lib/commonjs/calendar/get-calendar-month-grid.js +114 -0
- package/lib/commonjs/calendar/get-calendar-month-grid.js.map +1 -0
- package/lib/commonjs/calendar/index.js +13 -0
- package/lib/commonjs/calendar/index.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarDay.js +137 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarDay.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js +116 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarGrid.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js +114 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarHeader.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarWeekdays.js +44 -0
- package/lib/commonjs/components/NepaliCalendar/CalendarWeekdays.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js +288 -0
- package/lib/commonjs/components/NepaliCalendar/NepaliCalendar.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/index.js +13 -0
- package/lib/commonjs/components/NepaliCalendar/index.js.map +1 -0
- package/lib/commonjs/components/NepaliCalendar/types.js +6 -0
- package/lib/commonjs/components/NepaliCalendar/types.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js +185 -0
- package/lib/commonjs/components/NepaliDatePicker/DatePickerModal.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js +148 -0
- package/lib/commonjs/components/NepaliDatePicker/NepaliDatePicker.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/index.js +20 -0
- package/lib/commonjs/components/NepaliDatePicker/index.js.map +1 -0
- package/lib/commonjs/components/NepaliDatePicker/types.js +6 -0
- package/lib/commonjs/components/NepaliDatePicker/types.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js +187 -0
- package/lib/commonjs/components/NepaliRangePicker/NepaliRangePicker.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js +275 -0
- package/lib/commonjs/components/NepaliRangePicker/RangePickerModal.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/index.js +57 -0
- package/lib/commonjs/components/NepaliRangePicker/index.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/range-utils.js +70 -0
- package/lib/commonjs/components/NepaliRangePicker/range-utils.js.map +1 -0
- package/lib/commonjs/components/NepaliRangePicker/types.js +6 -0
- package/lib/commonjs/components/NepaliRangePicker/types.js.map +1 -0
- package/lib/commonjs/core/arithmetic.js +36 -0
- package/lib/commonjs/core/arithmetic.js.map +1 -0
- package/lib/commonjs/core/bsData.js +89 -0
- package/lib/commonjs/core/bsData.js.map +1 -0
- package/lib/commonjs/core/conversion.js +53 -0
- package/lib/commonjs/core/conversion.js.map +1 -0
- package/lib/commonjs/core/dateKey.js +31 -0
- package/lib/commonjs/core/dateKey.js.map +1 -0
- package/lib/commonjs/core/epochDay.js +47 -0
- package/lib/commonjs/core/epochDay.js.map +1 -0
- package/lib/commonjs/core/format/format.js +86 -0
- package/lib/commonjs/core/format/format.js.map +1 -0
- package/lib/commonjs/core/format/index.js +20 -0
- package/lib/commonjs/core/format/index.js.map +1 -0
- package/lib/commonjs/core/format/parse.js +41 -0
- package/lib/commonjs/core/format/parse.js.map +1 -0
- package/lib/commonjs/core/format/tokens.js +9 -0
- package/lib/commonjs/core/format/tokens.js.map +1 -0
- package/lib/commonjs/core/index.js +116 -0
- package/lib/commonjs/core/index.js.map +1 -0
- package/lib/commonjs/core/locale/en.js +15 -0
- package/lib/commonjs/core/locale/en.js.map +1 -0
- package/lib/commonjs/core/locale/index.js +20 -0
- package/lib/commonjs/core/locale/index.js.map +1 -0
- package/lib/commonjs/core/locale/ne.js +15 -0
- package/lib/commonjs/core/locale/ne.js.map +1 -0
- package/lib/commonjs/core/locale/types.js +2 -0
- package/lib/commonjs/core/locale/types.js.map +1 -0
- package/lib/commonjs/core/numerals/index.js +19 -0
- package/lib/commonjs/core/numerals/index.js.map +1 -0
- package/lib/commonjs/core/numerals/nepali-numerals.js +28 -0
- package/lib/commonjs/core/numerals/nepali-numerals.js.map +1 -0
- package/lib/commonjs/core/types.js +2 -0
- package/lib/commonjs/core/types.js.map +1 -0
- package/lib/commonjs/core/validation.js +125 -0
- package/lib/commonjs/core/validation.js.map +1 -0
- package/lib/commonjs/core/validation.test.js +248 -0
- package/lib/commonjs/core/validation.test.js.map +1 -0
- package/lib/commonjs/exports.test.js +133 -0
- package/lib/commonjs/exports.test.js.map +1 -0
- package/lib/commonjs/index.js +94 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/phase2.test.js +446 -0
- package/lib/commonjs/phase2.test.js.map +1 -0
- package/lib/commonjs/phase3.test.js +91 -0
- package/lib/commonjs/phase3.test.js.map +1 -0
- package/lib/commonjs/phase4.test.js +89 -0
- package/lib/commonjs/phase4.test.js.map +1 -0
- package/lib/commonjs/phase5.test.js +246 -0
- package/lib/commonjs/phase5.test.js.map +1 -0
- package/lib/commonjs/phase7.test.js +284 -0
- package/lib/commonjs/phase7.test.js.map +1 -0
- package/lib/commonjs/range-helpers.test.js +182 -0
- package/lib/commonjs/range-helpers.test.js.map +1 -0
- package/lib/commonjs/theme/create-theme.js +37 -0
- package/lib/commonjs/theme/create-theme.js.map +1 -0
- package/lib/commonjs/theme/default-theme.js +99 -0
- package/lib/commonjs/theme/default-theme.js.map +1 -0
- package/lib/commonjs/theme/index.js +26 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/types.js +6 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/utils/date-helpers.js +106 -0
- package/lib/commonjs/utils/date-helpers.js.map +1 -0
- package/lib/commonjs/utils/index.js +49 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/accessibility/index.js +4 -0
- package/lib/module/accessibility/index.js.map +1 -0
- package/lib/module/accessibility/labels.js +15 -0
- package/lib/module/accessibility/labels.js.map +1 -0
- package/lib/module/calendar/calendar-types.js +4 -0
- package/lib/module/calendar/calendar-types.js.map +1 -0
- package/lib/module/calendar/get-calendar-month-grid.js +111 -0
- package/lib/module/calendar/get-calendar-month-grid.js.map +1 -0
- package/lib/module/calendar/index.js +4 -0
- package/lib/module/calendar/index.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarDay.js +132 -0
- package/lib/module/components/NepaliCalendar/CalendarDay.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarGrid.js +111 -0
- package/lib/module/components/NepaliCalendar/CalendarGrid.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarHeader.js +109 -0
- package/lib/module/components/NepaliCalendar/CalendarHeader.js.map +1 -0
- package/lib/module/components/NepaliCalendar/CalendarWeekdays.js +39 -0
- package/lib/module/components/NepaliCalendar/CalendarWeekdays.js.map +1 -0
- package/lib/module/components/NepaliCalendar/NepaliCalendar.js +283 -0
- package/lib/module/components/NepaliCalendar/NepaliCalendar.js.map +1 -0
- package/lib/module/components/NepaliCalendar/index.js +4 -0
- package/lib/module/components/NepaliCalendar/index.js.map +1 -0
- package/lib/module/components/NepaliCalendar/types.js +4 -0
- package/lib/module/components/NepaliCalendar/types.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/DatePickerModal.js +180 -0
- package/lib/module/components/NepaliDatePicker/DatePickerModal.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js +143 -0
- package/lib/module/components/NepaliDatePicker/NepaliDatePicker.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/index.js +5 -0
- package/lib/module/components/NepaliDatePicker/index.js.map +1 -0
- package/lib/module/components/NepaliDatePicker/types.js +4 -0
- package/lib/module/components/NepaliDatePicker/types.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js +182 -0
- package/lib/module/components/NepaliRangePicker/NepaliRangePicker.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/RangePickerModal.js +270 -0
- package/lib/module/components/NepaliRangePicker/RangePickerModal.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/index.js +6 -0
- package/lib/module/components/NepaliRangePicker/index.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/range-utils.js +61 -0
- package/lib/module/components/NepaliRangePicker/range-utils.js.map +1 -0
- package/lib/module/components/NepaliRangePicker/types.js +4 -0
- package/lib/module/components/NepaliRangePicker/types.js.map +1 -0
- package/lib/module/core/arithmetic.js +29 -0
- package/lib/module/core/arithmetic.js.map +1 -0
- package/lib/module/core/bsData.js +82 -0
- package/lib/module/core/bsData.js.map +1 -0
- package/lib/module/core/conversion.js +48 -0
- package/lib/module/core/conversion.js.map +1 -0
- package/lib/module/core/dateKey.js +26 -0
- package/lib/module/core/dateKey.js.map +1 -0
- package/lib/module/core/epochDay.js +39 -0
- package/lib/module/core/epochDay.js.map +1 -0
- package/lib/module/core/format/format.js +82 -0
- package/lib/module/core/format/format.js.map +1 -0
- package/lib/module/core/format/index.js +5 -0
- package/lib/module/core/format/index.js.map +1 -0
- package/lib/module/core/format/parse.js +37 -0
- package/lib/module/core/format/parse.js.map +1 -0
- package/lib/module/core/format/tokens.js +5 -0
- package/lib/module/core/format/tokens.js.map +1 -0
- package/lib/module/core/index.js +13 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/core/locale/en.js +11 -0
- package/lib/module/core/locale/en.js.map +1 -0
- package/lib/module/core/locale/index.js +5 -0
- package/lib/module/core/locale/index.js.map +1 -0
- package/lib/module/core/locale/ne.js +11 -0
- package/lib/module/core/locale/ne.js.map +1 -0
- package/lib/module/core/locale/types.js +2 -0
- package/lib/module/core/locale/types.js.map +1 -0
- package/lib/module/core/numerals/index.js +4 -0
- package/lib/module/core/numerals/index.js.map +1 -0
- package/lib/module/core/numerals/nepali-numerals.js +23 -0
- package/lib/module/core/numerals/nepali-numerals.js.map +1 -0
- package/lib/module/core/types.js +2 -0
- package/lib/module/core/types.js.map +1 -0
- package/lib/module/core/validation.js +115 -0
- package/lib/module/core/validation.js.map +1 -0
- package/lib/module/core/validation.test.js +248 -0
- package/lib/module/core/validation.test.js.map +1 -0
- package/lib/module/exports.test.js +133 -0
- package/lib/module/exports.test.js.map +1 -0
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/phase2.test.js +446 -0
- package/lib/module/phase2.test.js.map +1 -0
- package/lib/module/phase3.test.js +91 -0
- package/lib/module/phase3.test.js.map +1 -0
- package/lib/module/phase4.test.js +89 -0
- package/lib/module/phase4.test.js.map +1 -0
- package/lib/module/phase5.test.js +246 -0
- package/lib/module/phase5.test.js.map +1 -0
- package/lib/module/phase7.test.js +284 -0
- package/lib/module/phase7.test.js.map +1 -0
- package/lib/module/range-helpers.test.js +182 -0
- package/lib/module/range-helpers.test.js.map +1 -0
- package/lib/module/theme/create-theme.js +33 -0
- package/lib/module/theme/create-theme.js.map +1 -0
- package/lib/module/theme/default-theme.js +95 -0
- package/lib/module/theme/default-theme.js.map +1 -0
- package/lib/module/theme/index.js +5 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/types.js +4 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/utils/date-helpers.js +96 -0
- package/lib/module/utils/date-helpers.js.map +1 -0
- package/lib/module/utils/index.js +4 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/src/accessibility/index.d.ts +2 -0
- package/lib/typescript/src/accessibility/index.d.ts.map +1 -0
- package/lib/typescript/src/accessibility/labels.d.ts +6 -0
- package/lib/typescript/src/accessibility/labels.d.ts.map +1 -0
- package/lib/typescript/src/calendar/calendar-types.d.ts +23 -0
- package/lib/typescript/src/calendar/calendar-types.d.ts.map +1 -0
- package/lib/typescript/src/calendar/get-calendar-month-grid.d.ts +3 -0
- package/lib/typescript/src/calendar/get-calendar-month-grid.d.ts.map +1 -0
- package/lib/typescript/src/calendar/index.d.ts +3 -0
- package/lib/typescript/src/calendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarDay.d.ts +23 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarDay.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarGrid.d.ts +25 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarGrid.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarHeader.d.ts +17 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarHeader.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarWeekdays.d.ts +11 -0
- package/lib/typescript/src/components/NepaliCalendar/CalendarWeekdays.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/NepaliCalendar.d.ts +4 -0
- package/lib/typescript/src/components/NepaliCalendar/NepaliCalendar.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/index.d.ts +3 -0
- package/lib/typescript/src/components/NepaliCalendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliCalendar/types.d.ts +52 -0
- package/lib/typescript/src/components/NepaliCalendar/types.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/DatePickerModal.d.ts +4 -0
- package/lib/typescript/src/components/NepaliDatePicker/DatePickerModal.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/NepaliDatePicker.d.ts +4 -0
- package/lib/typescript/src/components/NepaliDatePicker/NepaliDatePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/index.d.ts +4 -0
- package/lib/typescript/src/components/NepaliDatePicker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliDatePicker/types.d.ts +50 -0
- package/lib/typescript/src/components/NepaliDatePicker/types.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/NepaliRangePicker.d.ts +4 -0
- package/lib/typescript/src/components/NepaliRangePicker/NepaliRangePicker.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/RangePickerModal.d.ts +4 -0
- package/lib/typescript/src/components/NepaliRangePicker/RangePickerModal.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/index.d.ts +5 -0
- package/lib/typescript/src/components/NepaliRangePicker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/range-utils.d.ts +13 -0
- package/lib/typescript/src/components/NepaliRangePicker/range-utils.d.ts.map +1 -0
- package/lib/typescript/src/components/NepaliRangePicker/types.d.ts +61 -0
- package/lib/typescript/src/components/NepaliRangePicker/types.d.ts.map +1 -0
- package/lib/typescript/src/core/arithmetic.d.ts +6 -0
- package/lib/typescript/src/core/arithmetic.d.ts.map +1 -0
- package/lib/typescript/src/core/bsData.d.ts +39 -0
- package/lib/typescript/src/core/bsData.d.ts.map +1 -0
- package/lib/typescript/src/core/conversion.d.ts +4 -0
- package/lib/typescript/src/core/conversion.d.ts.map +1 -0
- package/lib/typescript/src/core/dateKey.d.ts +4 -0
- package/lib/typescript/src/core/dateKey.d.ts.map +1 -0
- package/lib/typescript/src/core/epochDay.d.ts +7 -0
- package/lib/typescript/src/core/epochDay.d.ts.map +1 -0
- package/lib/typescript/src/core/format/format.d.ts +8 -0
- package/lib/typescript/src/core/format/format.d.ts.map +1 -0
- package/lib/typescript/src/core/format/index.d.ts +5 -0
- package/lib/typescript/src/core/format/index.d.ts.map +1 -0
- package/lib/typescript/src/core/format/parse.d.ts +7 -0
- package/lib/typescript/src/core/format/parse.d.ts.map +1 -0
- package/lib/typescript/src/core/format/tokens.d.ts +4 -0
- package/lib/typescript/src/core/format/tokens.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +11 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/en.d.ts +3 -0
- package/lib/typescript/src/core/locale/en.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/index.d.ts +4 -0
- package/lib/typescript/src/core/locale/index.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/ne.d.ts +3 -0
- package/lib/typescript/src/core/locale/ne.d.ts.map +1 -0
- package/lib/typescript/src/core/locale/types.d.ts +11 -0
- package/lib/typescript/src/core/locale/types.d.ts.map +1 -0
- package/lib/typescript/src/core/numerals/index.d.ts +2 -0
- package/lib/typescript/src/core/numerals/index.d.ts.map +1 -0
- package/lib/typescript/src/core/numerals/nepali-numerals.d.ts +3 -0
- package/lib/typescript/src/core/numerals/nepali-numerals.d.ts.map +1 -0
- package/lib/typescript/src/core/types.d.ts +14 -0
- package/lib/typescript/src/core/types.d.ts.map +1 -0
- package/lib/typescript/src/core/validation.d.ts +17 -0
- package/lib/typescript/src/core/validation.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +9 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/create-theme.d.ts +6 -0
- package/lib/typescript/src/theme/create-theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/default-theme.d.ts +4 -0
- package/lib/typescript/src/theme/default-theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +4 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/types.d.ts +43 -0
- package/lib/typescript/src/theme/types.d.ts.map +1 -0
- package/lib/typescript/src/utils/date-helpers.d.ts +27 -0
- package/lib/typescript/src/utils/date-helpers.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +2 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/package.json +85 -0
- package/src/accessibility/index.ts +5 -0
- package/src/accessibility/labels.ts +22 -0
- package/src/calendar/calendar-types.ts +25 -0
- package/src/calendar/get-calendar-month-grid.ts +125 -0
- package/src/calendar/index.ts +2 -0
- package/src/components/NepaliCalendar/CalendarDay.tsx +198 -0
- package/src/components/NepaliCalendar/CalendarGrid.tsx +159 -0
- package/src/components/NepaliCalendar/CalendarHeader.tsx +126 -0
- package/src/components/NepaliCalendar/CalendarWeekdays.tsx +49 -0
- package/src/components/NepaliCalendar/NepaliCalendar.tsx +279 -0
- package/src/components/NepaliCalendar/index.ts +6 -0
- package/src/components/NepaliCalendar/types.ts +62 -0
- package/src/components/NepaliDatePicker/DatePickerModal.tsx +220 -0
- package/src/components/NepaliDatePicker/NepaliDatePicker.tsx +171 -0
- package/src/components/NepaliDatePicker/index.ts +3 -0
- package/src/components/NepaliDatePicker/types.ts +70 -0
- package/src/components/NepaliRangePicker/NepaliRangePicker.tsx +206 -0
- package/src/components/NepaliRangePicker/RangePickerModal.tsx +336 -0
- package/src/components/NepaliRangePicker/index.ts +11 -0
- package/src/components/NepaliRangePicker/range-utils.ts +75 -0
- package/src/components/NepaliRangePicker/types.ts +84 -0
- package/src/core/arithmetic.ts +34 -0
- package/src/core/bsData.ts +115 -0
- package/src/core/conversion.ts +73 -0
- package/src/core/dateKey.ts +31 -0
- package/src/core/epochDay.ts +49 -0
- package/src/core/format/format.ts +108 -0
- package/src/core/format/index.ts +4 -0
- package/src/core/format/parse.ts +68 -0
- package/src/core/format/tokens.ts +35 -0
- package/src/core/index.ts +10 -0
- package/src/core/locale/en.ts +23 -0
- package/src/core/locale/index.ts +3 -0
- package/src/core/locale/ne.ts +31 -0
- package/src/core/locale/types.ts +12 -0
- package/src/core/numerals/index.ts +1 -0
- package/src/core/numerals/nepali-numerals.ts +27 -0
- package/src/core/types.ts +15 -0
- package/src/core/validation.test.ts +207 -0
- package/src/core/validation.ts +141 -0
- package/src/exports.test.ts +135 -0
- package/src/index.ts +8 -0
- package/src/phase2.test.ts +424 -0
- package/src/phase3.test.ts +83 -0
- package/src/phase4.test.ts +86 -0
- package/src/phase5.test.ts +257 -0
- package/src/phase7.test.ts +307 -0
- package/src/range-helpers.test.ts +153 -0
- package/src/theme/create-theme.ts +29 -0
- package/src/theme/default-theme.ts +99 -0
- package/src/theme/index.ts +3 -0
- package/src/theme/types.ts +44 -0
- package/src/utils/date-helpers.ts +146 -0
- package/src/utils/index.ts +9 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import {
|
|
2
|
+
adDateToEpochDay,
|
|
3
|
+
createBSDateKey,
|
|
4
|
+
createBSYearOffsets,
|
|
5
|
+
epochDayToADDate,
|
|
6
|
+
epochDayToJSDate,
|
|
7
|
+
getBSMonthLength,
|
|
8
|
+
getSupportedBSRange,
|
|
9
|
+
isValidADDate,
|
|
10
|
+
isValidBSDate,
|
|
11
|
+
jsDateToEpochDay,
|
|
12
|
+
parseBSDateKey,
|
|
13
|
+
toAD,
|
|
14
|
+
toBS,
|
|
15
|
+
SUPPORTED_BS_START_YEAR,
|
|
16
|
+
SUPPORTED_BS_END_YEAR,
|
|
17
|
+
} from './index';
|
|
18
|
+
|
|
19
|
+
describe('BS date validation', () => {
|
|
20
|
+
it('accepts dates inside the available placeholder data range', () => {
|
|
21
|
+
expect(
|
|
22
|
+
isValidBSDate({ calendar: 'BS', year: 2081, month: 1, day: 1 })
|
|
23
|
+
).toBe(true);
|
|
24
|
+
expect(
|
|
25
|
+
isValidBSDate({ calendar: 'BS', year: 2081, month: 4, day: 31 })
|
|
26
|
+
).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('rejects dates outside month lengths or available data', () => {
|
|
30
|
+
expect(
|
|
31
|
+
isValidBSDate({ calendar: 'BS', year: 2081, month: 8, day: 30 })
|
|
32
|
+
).toBe(false);
|
|
33
|
+
expect(
|
|
34
|
+
isValidBSDate({ calendar: 'BS', year: 2082, month: 1, day: 1 })
|
|
35
|
+
).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('rejects dates outside the supported year range', () => {
|
|
39
|
+
expect(
|
|
40
|
+
isValidBSDate({ calendar: 'BS', year: 2080, month: 1, day: 1 })
|
|
41
|
+
).toBe(false);
|
|
42
|
+
expect(
|
|
43
|
+
isValidBSDate({ calendar: 'BS', year: 2082, month: 1, day: 1 })
|
|
44
|
+
).toBe(false);
|
|
45
|
+
expect(
|
|
46
|
+
isValidBSDate({ calendar: 'BS', year: 2000, month: 1, day: 1 })
|
|
47
|
+
).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('returns month lengths for supported BS years', () => {
|
|
51
|
+
expect(getBSMonthLength(2081, 1)).toBe(31);
|
|
52
|
+
expect(getBSMonthLength(2081, 8)).toBe(29);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('throws for unsupported years with range in message', () => {
|
|
56
|
+
expect(() => getBSMonthLength(2082, 1)).toThrow(/2081–2081/);
|
|
57
|
+
expect(() => getBSMonthLength(2080, 1)).toThrow(/2081–2081/);
|
|
58
|
+
expect(() => getBSMonthLength(2081, 0)).toThrow(RangeError);
|
|
59
|
+
expect(() => getBSMonthLength(2081, 13)).toThrow(RangeError);
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('supported BS range', () => {
|
|
64
|
+
it('exports start and end year constants', () => {
|
|
65
|
+
expect(SUPPORTED_BS_START_YEAR).toBe(2081);
|
|
66
|
+
expect(SUPPORTED_BS_END_YEAR).toBe(2081);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('getSupportedBSRange returns correct range', () => {
|
|
70
|
+
const range = getSupportedBSRange();
|
|
71
|
+
expect(range).toEqual({ start: 2081, end: 2081 });
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe('AD date validation', () => {
|
|
76
|
+
it('accepts real AD dates and rejects calendar overflows', () => {
|
|
77
|
+
expect(
|
|
78
|
+
isValidADDate({ calendar: 'AD', year: 2024, month: 2, day: 29 })
|
|
79
|
+
).toBe(true);
|
|
80
|
+
expect(
|
|
81
|
+
isValidADDate({ calendar: 'AD', year: 2023, month: 2, day: 29 })
|
|
82
|
+
).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
it('handles AD years 0 through 99 without Date.UTC remapping', () => {
|
|
86
|
+
expect(isValidADDate({ calendar: 'AD', year: 1, month: 1, day: 1 })).toBe(
|
|
87
|
+
true
|
|
88
|
+
);
|
|
89
|
+
expect(isValidADDate({ calendar: 'AD', year: 1, month: 2, day: 29 })).toBe(
|
|
90
|
+
false
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
describe('BS date keys', () => {
|
|
96
|
+
it('creates stable YYYY-MM-DD keys', () => {
|
|
97
|
+
expect(
|
|
98
|
+
createBSDateKey({ calendar: 'BS', year: 2081, month: 1, day: 3 })
|
|
99
|
+
).toBe('2081-01-03');
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it('parses valid keys', () => {
|
|
103
|
+
expect(parseBSDateKey('2081-01-03')).toEqual({
|
|
104
|
+
calendar: 'BS',
|
|
105
|
+
year: 2081,
|
|
106
|
+
month: 1,
|
|
107
|
+
day: 3,
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('rejects malformed or invalid keys', () => {
|
|
112
|
+
expect(parseBSDateKey('2081-1-03')).toBeNull();
|
|
113
|
+
expect(parseBSDateKey('2081-08-30')).toBeNull();
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
describe('Stage 1 conversion architecture', () => {
|
|
118
|
+
it('round-trips the placeholder anchor date', () => {
|
|
119
|
+
const bs = { calendar: 'BS' as const, year: 2081, month: 1, day: 1 };
|
|
120
|
+
const ad = { calendar: 'AD' as const, year: 2024, month: 4, day: 13 };
|
|
121
|
+
|
|
122
|
+
expect(toAD(bs)).toEqual(ad);
|
|
123
|
+
expect(toBS(ad)).toEqual(bs);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('converts dates at the end of the available placeholder range', () => {
|
|
127
|
+
const bs = { calendar: 'BS' as const, year: 2081, month: 12, day: 30 };
|
|
128
|
+
const ad = toAD(bs);
|
|
129
|
+
|
|
130
|
+
expect(toBS(ad)).toEqual(bs);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it('throws instead of guessing outside the available placeholder range', () => {
|
|
134
|
+
expect(() =>
|
|
135
|
+
toBS({ calendar: 'AD', year: 2024, month: 4, day: 12 })
|
|
136
|
+
).toThrow(RangeError);
|
|
137
|
+
expect(() =>
|
|
138
|
+
toAD({ calendar: 'BS', year: 2082, month: 1, day: 1 })
|
|
139
|
+
).toThrow(RangeError);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it('requires year data to start at the BS anchor year', () => {
|
|
143
|
+
expect(() =>
|
|
144
|
+
createBSYearOffsets({
|
|
145
|
+
anchorBS: { calendar: 'BS', year: 2081, month: 1, day: 1 },
|
|
146
|
+
anchorAD: { calendar: 'AD', year: 2024, month: 4, day: 13 },
|
|
147
|
+
monthLengthsByYear: {
|
|
148
|
+
2082: [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
149
|
+
},
|
|
150
|
+
})
|
|
151
|
+
).toThrow(/contiguous/);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('requires the BS anchor to be the first day of a BS year', () => {
|
|
155
|
+
expect(() =>
|
|
156
|
+
createBSYearOffsets({
|
|
157
|
+
anchorBS: { calendar: 'BS', year: 2081, month: 1, day: 2 },
|
|
158
|
+
anchorAD: { calendar: 'AD', year: 2024, month: 4, day: 14 },
|
|
159
|
+
monthLengthsByYear: {
|
|
160
|
+
2081: [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
161
|
+
},
|
|
162
|
+
})
|
|
163
|
+
).toThrow(/first day/);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
describe('UTC epoch-day utilities', () => {
|
|
168
|
+
it('round-trips AD dates through integer epoch days', () => {
|
|
169
|
+
const ad = { calendar: 'AD' as const, year: 2024, month: 4, day: 13 };
|
|
170
|
+
|
|
171
|
+
expect(
|
|
172
|
+
epochDayToADDate(jsDateToEpochDay(new Date(Date.UTC(2024, 3, 13))))
|
|
173
|
+
).toEqual(ad);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('round-trips AD years 0 through 99 through epoch days', () => {
|
|
177
|
+
const ad = { calendar: 'AD' as const, year: 1, month: 1, day: 1 };
|
|
178
|
+
|
|
179
|
+
expect(epochDayToADDate(adDateToEpochDay(ad))).toEqual(ad);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it('reads JS Date UTC parts without remapping years 0 through 99', () => {
|
|
183
|
+
const value = new Date(0);
|
|
184
|
+
value.setUTCFullYear(1, 0, 1);
|
|
185
|
+
value.setUTCHours(0, 0, 0, 0);
|
|
186
|
+
|
|
187
|
+
expect(epochDayToADDate(jsDateToEpochDay(value))).toEqual({
|
|
188
|
+
calendar: 'AD',
|
|
189
|
+
year: 1,
|
|
190
|
+
month: 1,
|
|
191
|
+
day: 1,
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('returns UTC-midnight Date objects from epoch days', () => {
|
|
196
|
+
const jsDate = epochDayToJSDate(
|
|
197
|
+
jsDateToEpochDay(new Date(Date.UTC(2024, 3, 13, 23, 59, 59)))
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
expect(jsDate.toISOString()).toBe('2024-04-13T00:00:00.000Z');
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it('rejects fractional epoch days', () => {
|
|
204
|
+
expect(() => epochDayToADDate(1.5)).toThrow(RangeError);
|
|
205
|
+
expect(() => epochDayToJSDate(1.5)).toThrow(RangeError);
|
|
206
|
+
});
|
|
207
|
+
});
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { ADDateValue, BSDateValue } from './types';
|
|
2
|
+
import { BS_CALENDAR_DATA, getSupportedBSYearRange } from './bsData';
|
|
3
|
+
import { utcMillisForADDate } from './epochDay';
|
|
4
|
+
|
|
5
|
+
export function getBSMonthLength(year: number, month: number): number {
|
|
6
|
+
const monthLengths = BS_CALENDAR_DATA.monthLengthsByYear[year];
|
|
7
|
+
|
|
8
|
+
if (!monthLengths) {
|
|
9
|
+
const range = getSupportedBSYearRange();
|
|
10
|
+
throw new RangeError(
|
|
11
|
+
`BS year ${year} is outside the supported data range (${range.min}–${range.max}).`
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (!Number.isInteger(month) || month < 1 || month > 12) {
|
|
16
|
+
throw new RangeError(`BS month must be an integer from 1 to 12.`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return monthLengths[month - 1];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function isValidBSDate(date: BSDateValue): boolean {
|
|
23
|
+
if (
|
|
24
|
+
date.calendar !== 'BS' ||
|
|
25
|
+
!Number.isInteger(date.year) ||
|
|
26
|
+
!Number.isInteger(date.month) ||
|
|
27
|
+
!Number.isInteger(date.day) ||
|
|
28
|
+
date.month < 1 ||
|
|
29
|
+
date.month > 12
|
|
30
|
+
) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const range = getSupportedBSYearRange();
|
|
35
|
+
|
|
36
|
+
if (date.year < range.min || date.year > range.max) {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const monthLengths = BS_CALENDAR_DATA.monthLengthsByYear[date.year];
|
|
41
|
+
|
|
42
|
+
if (!monthLengths) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return date.day >= 1 && date.day <= monthLengths[date.month - 1];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function isBSDateInSupportedRange(date: BSDateValue): boolean {
|
|
50
|
+
if (
|
|
51
|
+
date.calendar !== 'BS' ||
|
|
52
|
+
!Number.isInteger(date.year) ||
|
|
53
|
+
!Number.isInteger(date.month) ||
|
|
54
|
+
!Number.isInteger(date.day)
|
|
55
|
+
) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const range = getSupportedBSYearRange();
|
|
60
|
+
return date.year >= range.min && date.year <= range.max;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function clampBSDateToSupportedRange(date: BSDateValue): BSDateValue {
|
|
64
|
+
const range = getSupportedBSYearRange();
|
|
65
|
+
|
|
66
|
+
if (date.year < range.min) {
|
|
67
|
+
return { calendar: 'BS', year: range.min, month: 1, day: 1 };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (date.year > range.max) {
|
|
71
|
+
return { calendar: 'BS', year: range.max, month: 12, day: 30 };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const monthLengths = BS_CALENDAR_DATA.monthLengthsByYear[date.year];
|
|
75
|
+
if (!monthLengths) {
|
|
76
|
+
return { calendar: 'BS', year: range.min, month: 1, day: 1 };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const clampedMonth = Math.max(1, Math.min(12, date.month));
|
|
80
|
+
const maxDay = monthLengths[clampedMonth - 1];
|
|
81
|
+
const clampedDay = Math.max(1, Math.min(maxDay, date.day));
|
|
82
|
+
|
|
83
|
+
return { calendar: 'BS', year: date.year, month: clampedMonth, day: clampedDay };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function getDefaultSupportedBSDate(): BSDateValue {
|
|
87
|
+
const range = getSupportedBSYearRange();
|
|
88
|
+
return { calendar: 'BS', year: range.min, month: 1, day: 1 };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function getSafeCalendarMonth(input?: {
|
|
92
|
+
year?: number;
|
|
93
|
+
month?: number;
|
|
94
|
+
value?: BSDateValue | null;
|
|
95
|
+
defaultValue?: BSDateValue;
|
|
96
|
+
}): { year: number; month: number } {
|
|
97
|
+
const range = getSupportedBSYearRange();
|
|
98
|
+
|
|
99
|
+
if (input?.value && isBSDateInSupportedRange(input.value)) {
|
|
100
|
+
return { year: input.value.year, month: input.value.month };
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (input?.defaultValue && isBSDateInSupportedRange(input.defaultValue)) {
|
|
104
|
+
return { year: input.defaultValue.year, month: input.defaultValue.month };
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (
|
|
108
|
+
input?.year != null &&
|
|
109
|
+
input?.month != null &&
|
|
110
|
+
input.year >= range.min &&
|
|
111
|
+
input.year <= range.max &&
|
|
112
|
+
input.month >= 1 &&
|
|
113
|
+
input.month <= 12
|
|
114
|
+
) {
|
|
115
|
+
return { year: input.year, month: input.month };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return { year: range.min, month: 1 };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function isValidADDate(date: ADDateValue): boolean {
|
|
122
|
+
if (
|
|
123
|
+
date.calendar !== 'AD' ||
|
|
124
|
+
!Number.isInteger(date.year) ||
|
|
125
|
+
!Number.isInteger(date.month) ||
|
|
126
|
+
!Number.isInteger(date.day) ||
|
|
127
|
+
date.month < 1 ||
|
|
128
|
+
date.month > 12 ||
|
|
129
|
+
date.day < 1
|
|
130
|
+
) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const value = new Date(utcMillisForADDate(date));
|
|
135
|
+
|
|
136
|
+
return (
|
|
137
|
+
value.getUTCFullYear() === date.year &&
|
|
138
|
+
value.getUTCMonth() + 1 === date.month &&
|
|
139
|
+
value.getUTCDate() === date.day
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NepaliCalendar,
|
|
3
|
+
type NepaliCalendarProps,
|
|
4
|
+
type CalendarTheme,
|
|
5
|
+
type CalendarMarkedDate,
|
|
6
|
+
type BSDateValue,
|
|
7
|
+
NepaliDatePicker,
|
|
8
|
+
DatePickerModal,
|
|
9
|
+
type NepaliDatePickerProps,
|
|
10
|
+
type DatePickerModalProps,
|
|
11
|
+
NepaliRangePicker,
|
|
12
|
+
RangePickerModal,
|
|
13
|
+
type NepaliRangePickerProps,
|
|
14
|
+
type RangePickerModalProps,
|
|
15
|
+
type DateRangeValue,
|
|
16
|
+
} from './index';
|
|
17
|
+
|
|
18
|
+
describe('root package exports', () => {
|
|
19
|
+
it('exports NepaliCalendar component', () => {
|
|
20
|
+
expect(typeof NepaliCalendar).toBe('function');
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('exports NepaliCalendarProps type (compile-time check)', () => {
|
|
24
|
+
const _props: NepaliCalendarProps = {};
|
|
25
|
+
expect(_props).toBeDefined();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('exports CalendarTheme type (compile-time check)', () => {
|
|
29
|
+
const _theme: CalendarTheme = {
|
|
30
|
+
colors: {
|
|
31
|
+
background: '#fff',
|
|
32
|
+
surface: '#fff',
|
|
33
|
+
text: '#000',
|
|
34
|
+
mutedText: '#666',
|
|
35
|
+
primary: '#2563eb',
|
|
36
|
+
primaryText: '#fff',
|
|
37
|
+
todayBorder: '#2563eb',
|
|
38
|
+
disabledText: '#ccc',
|
|
39
|
+
outsideMonthText: '#ccc',
|
|
40
|
+
border: '#eee',
|
|
41
|
+
marker: '#2563eb',
|
|
42
|
+
overlay: 'rgba(0, 0, 0, 0.5)',
|
|
43
|
+
modalBackground: '#fff',
|
|
44
|
+
fieldBackground: '#fff',
|
|
45
|
+
fieldBorder: '#eee',
|
|
46
|
+
placeholderText: '#999',
|
|
47
|
+
rangeBackground: '#dbeafe',
|
|
48
|
+
rangeText: '#1e40af',
|
|
49
|
+
rangeStartBackground: '#2563eb',
|
|
50
|
+
rangeEndBackground: '#2563eb',
|
|
51
|
+
danger: '#ef4444',
|
|
52
|
+
},
|
|
53
|
+
radius: { day: 20, calendar: 12 },
|
|
54
|
+
spacing: { xs: 4, sm: 8, md: 12, lg: 16 },
|
|
55
|
+
typography: {
|
|
56
|
+
header: { fontSize: 18 },
|
|
57
|
+
weekday: { fontSize: 12 },
|
|
58
|
+
day: { fontSize: 15 },
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
expect(_theme.colors.primary).toBe('#2563eb');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('exports CalendarMarkedDate type (compile-time check)', () => {
|
|
65
|
+
const _marked: CalendarMarkedDate = {
|
|
66
|
+
type: 'holiday',
|
|
67
|
+
label: 'Test',
|
|
68
|
+
color: '#ef4444',
|
|
69
|
+
};
|
|
70
|
+
expect(_marked.type).toBe('holiday');
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('exports BSDateValue type (compile-time check)', () => {
|
|
74
|
+
const _date: BSDateValue = {
|
|
75
|
+
calendar: 'BS',
|
|
76
|
+
year: 2081,
|
|
77
|
+
month: 1,
|
|
78
|
+
day: 1,
|
|
79
|
+
};
|
|
80
|
+
expect(_date.calendar).toBe('BS');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('exports NepaliDatePicker component', () => {
|
|
84
|
+
expect(typeof NepaliDatePicker).toBe('function');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('exports DatePickerModal component', () => {
|
|
88
|
+
expect(typeof DatePickerModal).toBe('function');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it('exports NepaliDatePickerProps type (compile-time check)', () => {
|
|
92
|
+
const _props: NepaliDatePickerProps = {
|
|
93
|
+
placeholder: 'Select date',
|
|
94
|
+
};
|
|
95
|
+
expect(_props.placeholder).toBe('Select date');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('exports DatePickerModalProps type (compile-time check)', () => {
|
|
99
|
+
const _props: DatePickerModalProps = {
|
|
100
|
+
visible: false,
|
|
101
|
+
};
|
|
102
|
+
expect(_props.visible).toBe(false);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('exports NepaliRangePicker component', () => {
|
|
106
|
+
expect(typeof NepaliRangePicker).toBe('function');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('exports RangePickerModal component', () => {
|
|
110
|
+
expect(typeof RangePickerModal).toBe('function');
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('exports NepaliRangePickerProps type (compile-time check)', () => {
|
|
114
|
+
const _props: NepaliRangePickerProps = {
|
|
115
|
+
placeholder: 'Select range',
|
|
116
|
+
};
|
|
117
|
+
expect(_props.placeholder).toBe('Select range');
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('exports RangePickerModalProps type (compile-time check)', () => {
|
|
121
|
+
const _props: RangePickerModalProps = {
|
|
122
|
+
visible: false,
|
|
123
|
+
};
|
|
124
|
+
expect(_props.visible).toBe(false);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('exports DateRangeValue type (compile-time check)', () => {
|
|
128
|
+
const _range: DateRangeValue = {
|
|
129
|
+
start: { calendar: 'BS', year: 2081, month: 1, day: 1 },
|
|
130
|
+
end: { calendar: 'BS', year: 2081, month: 1, day: 15 },
|
|
131
|
+
};
|
|
132
|
+
expect(_range.start?.year).toBe(2081);
|
|
133
|
+
expect(_range.end?.year).toBe(2081);
|
|
134
|
+
});
|
|
135
|
+
});
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './core';
|
|
2
|
+
export * from './calendar';
|
|
3
|
+
export * from './components/NepaliCalendar';
|
|
4
|
+
export * from './components/NepaliDatePicker';
|
|
5
|
+
export * from './components/NepaliRangePicker';
|
|
6
|
+
export * from './theme';
|
|
7
|
+
export * from './accessibility';
|
|
8
|
+
export * from './utils';
|