react-day-picker 9.6.7 → 9.7.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/README.md +9 -1
- package/dist/cjs/DayPicker.d.ts +4 -2
- package/dist/cjs/DayPicker.js +59 -8
- package/dist/cjs/DayPicker.js.map +1 -1
- package/dist/cjs/UI.d.ts +11 -23
- package/dist/cjs/UI.js +6 -8
- package/dist/cjs/UI.js.map +1 -1
- package/dist/cjs/classes/CalendarDay.d.ts +17 -14
- package/dist/cjs/classes/CalendarDay.js +9 -6
- package/dist/cjs/classes/CalendarDay.js.map +1 -1
- package/dist/cjs/classes/CalendarMonth.d.ts +8 -3
- package/dist/cjs/classes/CalendarMonth.js +6 -1
- package/dist/cjs/classes/CalendarMonth.js.map +1 -1
- package/dist/cjs/classes/CalendarWeek.d.ts +6 -2
- package/dist/cjs/classes/CalendarWeek.js +5 -1
- package/dist/cjs/classes/CalendarWeek.js.map +1 -1
- package/dist/cjs/classes/DateLib.d.ts +53 -52
- package/dist/cjs/classes/DateLib.js +26 -22
- package/dist/cjs/classes/DateLib.js.map +1 -1
- package/dist/cjs/components/Day.d.ts +4 -4
- package/dist/cjs/components/Day.js +4 -4
- package/dist/cjs/components/DayButton.d.ts +2 -2
- package/dist/cjs/components/DayButton.js +1 -1
- package/dist/cjs/components/Dropdown.d.ts +4 -6
- package/dist/cjs/components/Dropdown.js +1 -1
- package/dist/cjs/components/Dropdown.js.map +1 -1
- package/dist/cjs/components/DropdownNav.d.ts +1 -1
- package/dist/cjs/components/DropdownNav.js +1 -1
- package/dist/cjs/components/Footer.d.ts +1 -1
- package/dist/cjs/components/Footer.js +1 -1
- package/dist/cjs/components/Month.d.ts +3 -3
- package/dist/cjs/components/Month.js +1 -1
- package/dist/cjs/components/MonthCaption.d.ts +3 -3
- package/dist/cjs/components/MonthCaption.js +1 -1
- package/dist/cjs/components/MonthGrid.d.ts +1 -1
- package/dist/cjs/components/MonthGrid.js +1 -1
- package/dist/cjs/components/Months.d.ts +1 -1
- package/dist/cjs/components/Months.js +1 -1
- package/dist/cjs/components/MonthsDropdown.d.ts +1 -1
- package/dist/cjs/components/MonthsDropdown.js +1 -1
- package/dist/cjs/components/Nav.d.ts +5 -1
- package/dist/cjs/components/Nav.js +1 -1
- package/dist/cjs/components/Nav.js.map +1 -1
- package/dist/cjs/components/NextMonthButton.d.ts +1 -1
- package/dist/cjs/components/NextMonthButton.js +1 -1
- package/dist/cjs/components/Option.d.ts +1 -1
- package/dist/cjs/components/Option.js +1 -1
- package/dist/cjs/components/PreviousMonthButton.d.ts +1 -1
- package/dist/cjs/components/PreviousMonthButton.js +1 -1
- package/dist/cjs/components/Root.d.ts +2 -2
- package/dist/cjs/components/Root.js +1 -1
- package/dist/cjs/components/Select.d.ts +1 -1
- package/dist/cjs/components/Select.js +1 -1
- package/dist/cjs/components/Week.d.ts +2 -1
- package/dist/cjs/components/Week.js +1 -1
- package/dist/cjs/components/Week.js.map +1 -1
- package/dist/cjs/components/WeekNumber.d.ts +2 -2
- package/dist/cjs/components/WeekNumber.js +1 -1
- package/dist/cjs/components/WeekNumberHeader.d.ts +1 -1
- package/dist/cjs/components/WeekNumberHeader.js +1 -1
- package/dist/cjs/components/Weekday.d.ts +1 -1
- package/dist/cjs/components/Weekday.js +1 -1
- package/dist/cjs/components/Weekdays.d.ts +1 -1
- package/dist/cjs/components/Weekdays.js +1 -1
- package/dist/cjs/components/Weeks.d.ts +1 -1
- package/dist/cjs/components/Weeks.js +1 -1
- package/dist/cjs/components/YearsDropdown.d.ts +1 -1
- package/dist/cjs/components/YearsDropdown.js +1 -1
- package/dist/cjs/formatters/formatCaption.d.ts +7 -2
- package/dist/cjs/formatters/formatCaption.js +7 -2
- package/dist/cjs/formatters/formatCaption.js.map +1 -1
- package/dist/cjs/formatters/formatDay.d.ts +7 -2
- package/dist/cjs/formatters/formatDay.js +7 -2
- package/dist/cjs/formatters/formatDay.js.map +1 -1
- package/dist/cjs/formatters/formatMonthDropdown.d.ts +6 -2
- package/dist/cjs/formatters/formatMonthDropdown.js +6 -2
- package/dist/cjs/formatters/formatMonthDropdown.js.map +1 -1
- package/dist/cjs/formatters/formatWeekNumber.d.ts +7 -3
- package/dist/cjs/formatters/formatWeekNumber.js +10 -5
- package/dist/cjs/formatters/formatWeekNumber.js.map +1 -1
- package/dist/cjs/formatters/formatWeekNumberHeader.d.ts +3 -2
- package/dist/cjs/formatters/formatWeekNumberHeader.js +3 -2
- package/dist/cjs/formatters/formatWeekNumberHeader.js.map +1 -1
- package/dist/cjs/formatters/formatWeekdayName.d.ts +7 -2
- package/dist/cjs/formatters/formatWeekdayName.js +7 -2
- package/dist/cjs/formatters/formatWeekdayName.js.map +1 -1
- package/dist/cjs/formatters/formatYearDropdown.d.ts +5 -1
- package/dist/cjs/formatters/formatYearDropdown.js +5 -1
- package/dist/cjs/formatters/formatYearDropdown.js.map +1 -1
- package/dist/cjs/helpers/calculateFocusTarget.d.ts +14 -0
- package/dist/cjs/helpers/calculateFocusTarget.js +24 -1
- package/dist/cjs/helpers/calculateFocusTarget.js.map +1 -1
- package/dist/cjs/helpers/createGetModifiers.d.ts +16 -0
- package/dist/cjs/{useGetModifiers.js → helpers/createGetModifiers.js} +13 -7
- package/dist/cjs/helpers/createGetModifiers.js.map +1 -0
- package/dist/cjs/helpers/endOfBroadcastWeek.d.ts +7 -1
- package/dist/cjs/helpers/endOfBroadcastWeek.js +7 -1
- package/dist/cjs/helpers/endOfBroadcastWeek.js.map +1 -1
- package/dist/cjs/helpers/getBroadcastWeeksInMonth.d.ts +8 -1
- package/dist/cjs/helpers/getBroadcastWeeksInMonth.js +8 -1
- package/dist/cjs/helpers/getBroadcastWeeksInMonth.js.map +1 -1
- package/dist/cjs/helpers/getClassNamesForModifiers.d.ts +12 -0
- package/dist/cjs/helpers/getClassNamesForModifiers.js +12 -0
- package/dist/cjs/helpers/getClassNamesForModifiers.js.map +1 -1
- package/dist/cjs/helpers/getComponents.d.ts +10 -0
- package/dist/cjs/helpers/getComponents.js +10 -0
- package/dist/cjs/helpers/getComponents.js.map +1 -1
- package/dist/cjs/helpers/getDataAttributes.d.ts +9 -1
- package/dist/cjs/helpers/getDataAttributes.js +11 -2
- package/dist/cjs/helpers/getDataAttributes.js.map +1 -1
- package/dist/cjs/helpers/getDates.d.ts +12 -1
- package/dist/cjs/helpers/getDates.js +13 -2
- package/dist/cjs/helpers/getDates.js.map +1 -1
- package/dist/cjs/helpers/getDays.d.ts +4 -0
- package/dist/cjs/helpers/getDays.js +4 -1
- package/dist/cjs/helpers/getDays.js.map +1 -1
- package/dist/cjs/helpers/getDefaultClassNames.d.ts +5 -1
- package/dist/cjs/helpers/getDefaultClassNames.js +5 -1
- package/dist/cjs/helpers/getDefaultClassNames.js.map +1 -1
- package/dist/cjs/helpers/getDisplayMonths.d.ts +10 -0
- package/dist/cjs/helpers/getDisplayMonths.js +10 -0
- package/dist/cjs/helpers/getDisplayMonths.js.map +1 -1
- package/dist/cjs/helpers/getFocusableDate.d.ts +16 -1
- package/dist/cjs/helpers/getFocusableDate.js +17 -2
- package/dist/cjs/helpers/getFocusableDate.js.map +1 -1
- package/dist/cjs/helpers/getFormatters.d.ts +7 -1
- package/dist/cjs/helpers/getFormatters.js +7 -1
- package/dist/cjs/helpers/getFormatters.js.map +1 -1
- package/dist/cjs/helpers/getInitialMonth.d.ts +11 -1
- package/dist/cjs/helpers/getInitialMonth.js +14 -7
- package/dist/cjs/helpers/getInitialMonth.js.map +1 -1
- package/dist/cjs/helpers/getLabels.d.ts +6 -1
- package/dist/cjs/helpers/getLabels.js +6 -1
- package/dist/cjs/helpers/getLabels.js.map +1 -1
- package/dist/cjs/helpers/getMonthOptions.d.ts +15 -1
- package/dist/cjs/helpers/getMonthOptions.js +15 -1
- package/dist/cjs/helpers/getMonthOptions.js.map +1 -1
- package/dist/cjs/helpers/getMonths.d.ts +15 -8
- package/dist/cjs/helpers/getMonths.js +16 -9
- package/dist/cjs/helpers/getMonths.js.map +1 -1
- package/dist/cjs/helpers/getNavMonth.d.ts +7 -1
- package/dist/cjs/helpers/getNavMonth.js +7 -1
- package/dist/cjs/helpers/getNavMonth.js.map +1 -1
- package/dist/cjs/helpers/getNextFocus.d.ts +18 -3
- package/dist/cjs/helpers/getNextFocus.js +19 -5
- package/dist/cjs/helpers/getNextFocus.js.map +1 -1
- package/dist/cjs/helpers/getNextMonth.d.ts +13 -5
- package/dist/cjs/helpers/getNextMonth.js +13 -6
- package/dist/cjs/helpers/getNextMonth.js.map +1 -1
- package/dist/cjs/helpers/getPreviousMonth.d.ts +13 -5
- package/dist/cjs/helpers/getPreviousMonth.js +13 -5
- package/dist/cjs/helpers/getPreviousMonth.js.map +1 -1
- package/dist/cjs/helpers/getStyleForModifiers.d.ts +11 -0
- package/dist/cjs/helpers/getStyleForModifiers.js +11 -0
- package/dist/cjs/helpers/getStyleForModifiers.js.map +1 -1
- package/dist/cjs/helpers/getWeekdays.d.ts +9 -9
- package/dist/cjs/helpers/getWeekdays.js +9 -9
- package/dist/cjs/helpers/getWeekdays.js.map +1 -1
- package/dist/cjs/helpers/getWeeks.d.ts +6 -1
- package/dist/cjs/helpers/getWeeks.js +6 -1
- package/dist/cjs/helpers/getWeeks.js.map +1 -1
- package/dist/cjs/helpers/getYearOptions.d.ts +13 -1
- package/dist/cjs/helpers/getYearOptions.js +13 -1
- package/dist/cjs/helpers/getYearOptions.js.map +1 -1
- package/dist/cjs/helpers/startOfBroadcastWeek.d.ts +8 -1
- package/dist/cjs/helpers/startOfBroadcastWeek.js +8 -1
- package/dist/cjs/helpers/startOfBroadcastWeek.js.map +1 -1
- package/dist/cjs/helpers/useControlledValue.d.ts +10 -6
- package/dist/cjs/helpers/useControlledValue.js +10 -6
- package/dist/cjs/helpers/useControlledValue.js.map +1 -1
- package/dist/cjs/labels/labelDayButton.d.ts +9 -6
- package/dist/cjs/labels/labelDayButton.js +9 -6
- package/dist/cjs/labels/labelDayButton.js.map +1 -1
- package/dist/cjs/labels/labelGrid.d.ts +7 -3
- package/dist/cjs/labels/labelGrid.js +7 -3
- package/dist/cjs/labels/labelGrid.js.map +1 -1
- package/dist/cjs/labels/labelGridcell.d.ts +7 -4
- package/dist/cjs/labels/labelGridcell.js +7 -4
- package/dist/cjs/labels/labelGridcell.js.map +1 -1
- package/dist/cjs/labels/labelMonthDropdown.d.ts +3 -1
- package/dist/cjs/labels/labelMonthDropdown.js +3 -1
- package/dist/cjs/labels/labelMonthDropdown.js.map +1 -1
- package/dist/cjs/labels/labelNav.d.ts +2 -1
- package/dist/cjs/labels/labelNav.js +2 -1
- package/dist/cjs/labels/labelNav.js.map +1 -1
- package/dist/cjs/labels/labelNext.d.ts +5 -4
- package/dist/cjs/labels/labelNext.js +5 -4
- package/dist/cjs/labels/labelNext.js.map +1 -1
- package/dist/cjs/labels/labelPrevious.d.ts +5 -4
- package/dist/cjs/labels/labelPrevious.js +5 -4
- package/dist/cjs/labels/labelPrevious.js.map +1 -1
- package/dist/cjs/labels/labelWeekNumber.d.ts +4 -1
- package/dist/cjs/labels/labelWeekNumber.js +4 -1
- package/dist/cjs/labels/labelWeekNumber.js.map +1 -1
- package/dist/cjs/labels/labelWeekNumberHeader.d.ts +3 -1
- package/dist/cjs/labels/labelWeekNumberHeader.js +3 -1
- package/dist/cjs/labels/labelWeekNumberHeader.js.map +1 -1
- package/dist/cjs/labels/labelWeekday.d.ts +5 -1
- package/dist/cjs/labels/labelWeekday.js +5 -1
- package/dist/cjs/labels/labelWeekday.js.map +1 -1
- package/dist/cjs/labels/labelYearDropdown.d.ts +3 -1
- package/dist/cjs/labels/labelYearDropdown.js +3 -1
- package/dist/cjs/labels/labelYearDropdown.js.map +1 -1
- package/dist/cjs/persian.d.ts +15 -2
- package/dist/cjs/persian.js +15 -2
- package/dist/cjs/persian.js.map +1 -1
- package/dist/cjs/selection/useMulti.d.ts +9 -0
- package/dist/cjs/selection/useMulti.js +9 -0
- package/dist/cjs/selection/useMulti.js.map +1 -1
- package/dist/cjs/selection/useRange.d.ts +9 -0
- package/dist/cjs/selection/useRange.js +9 -0
- package/dist/cjs/selection/useRange.js.map +1 -1
- package/dist/cjs/selection/useSingle.d.ts +9 -0
- package/dist/cjs/selection/useSingle.js +9 -0
- package/dist/cjs/selection/useSingle.js.map +1 -1
- package/dist/cjs/types/deprecated.d.ts +8 -8
- package/dist/cjs/types/deprecated.js +1 -1
- package/dist/cjs/types/props.d.ts +57 -13
- package/dist/cjs/types/selection.d.ts +25 -0
- package/dist/cjs/types/shared.d.ts +29 -78
- package/dist/cjs/useAnimation.d.ts +11 -1
- package/dist/cjs/useAnimation.js +11 -1
- package/dist/cjs/useAnimation.js.map +1 -1
- package/dist/cjs/useCalendar.d.ts +9 -1
- package/dist/cjs/useCalendar.js +9 -1
- package/dist/cjs/useCalendar.js.map +1 -1
- package/dist/cjs/useDayPicker.d.ts +4 -6
- package/dist/cjs/useDayPicker.js +4 -6
- package/dist/cjs/useDayPicker.js.map +1 -1
- package/dist/cjs/useFocus.d.ts +14 -1
- package/dist/cjs/useFocus.js +14 -1
- package/dist/cjs/useFocus.js.map +1 -1
- package/dist/cjs/useSelection.d.ts +10 -0
- package/dist/cjs/useSelection.js +10 -0
- package/dist/cjs/useSelection.js.map +1 -1
- package/dist/cjs/utc.d.ts +6 -0
- package/dist/cjs/utc.js +6 -0
- package/dist/cjs/utc.js.map +1 -1
- package/dist/cjs/utils/addToRange.d.ts +10 -11
- package/dist/cjs/utils/addToRange.js +10 -11
- package/dist/cjs/utils/addToRange.js.map +1 -1
- package/dist/cjs/utils/dateMatchModifiers.d.ts +5 -15
- package/dist/cjs/utils/dateMatchModifiers.js +5 -15
- package/dist/cjs/utils/dateMatchModifiers.js.map +1 -1
- package/dist/cjs/utils/rangeContainsDayOfWeek.d.ts +7 -9
- package/dist/cjs/utils/rangeContainsDayOfWeek.js +7 -9
- package/dist/cjs/utils/rangeContainsDayOfWeek.js.map +1 -1
- package/dist/cjs/utils/rangeContainsModifiers.d.ts +5 -14
- package/dist/cjs/utils/rangeContainsModifiers.js +5 -14
- package/dist/cjs/utils/rangeContainsModifiers.js.map +1 -1
- package/dist/cjs/utils/rangeIncludesDate.d.ts +7 -4
- package/dist/cjs/utils/rangeIncludesDate.js +7 -4
- package/dist/cjs/utils/rangeIncludesDate.js.map +1 -1
- package/dist/cjs/utils/rangeOverlaps.d.ts +5 -1
- package/dist/cjs/utils/rangeOverlaps.js +5 -1
- package/dist/cjs/utils/rangeOverlaps.js.map +1 -1
- package/dist/cjs/utils/typeguards.d.ts +19 -6
- package/dist/cjs/utils/typeguards.js +19 -6
- package/dist/cjs/utils/typeguards.js.map +1 -1
- package/dist/esm/DayPicker.d.ts +4 -2
- package/dist/esm/DayPicker.js +59 -8
- package/dist/esm/DayPicker.js.map +1 -1
- package/dist/esm/UI.d.ts +11 -23
- package/dist/esm/UI.js +6 -8
- package/dist/esm/UI.js.map +1 -1
- package/dist/esm/classes/CalendarDay.d.ts +17 -14
- package/dist/esm/classes/CalendarDay.js +9 -6
- package/dist/esm/classes/CalendarDay.js.map +1 -1
- package/dist/esm/classes/CalendarMonth.d.ts +8 -3
- package/dist/esm/classes/CalendarMonth.js +6 -1
- package/dist/esm/classes/CalendarMonth.js.map +1 -1
- package/dist/esm/classes/CalendarWeek.d.ts +6 -2
- package/dist/esm/classes/CalendarWeek.js +5 -1
- package/dist/esm/classes/CalendarWeek.js.map +1 -1
- package/dist/esm/classes/DateLib.d.ts +53 -52
- package/dist/esm/classes/DateLib.js +26 -22
- package/dist/esm/classes/DateLib.js.map +1 -1
- package/dist/esm/components/Day.d.ts +4 -4
- package/dist/esm/components/Day.js +4 -4
- package/dist/esm/components/DayButton.d.ts +2 -2
- package/dist/esm/components/DayButton.js +1 -1
- package/dist/esm/components/Dropdown.d.ts +4 -6
- package/dist/esm/components/Dropdown.js +1 -1
- package/dist/esm/components/Dropdown.js.map +1 -1
- package/dist/esm/components/DropdownNav.d.ts +1 -1
- package/dist/esm/components/DropdownNav.js +1 -1
- package/dist/esm/components/Footer.d.ts +1 -1
- package/dist/esm/components/Footer.js +1 -1
- package/dist/esm/components/Month.d.ts +3 -3
- package/dist/esm/components/Month.js +1 -1
- package/dist/esm/components/MonthCaption.d.ts +3 -3
- package/dist/esm/components/MonthCaption.js +1 -1
- package/dist/esm/components/MonthGrid.d.ts +1 -1
- package/dist/esm/components/MonthGrid.js +1 -1
- package/dist/esm/components/Months.d.ts +1 -1
- package/dist/esm/components/Months.js +1 -1
- package/dist/esm/components/MonthsDropdown.d.ts +1 -1
- package/dist/esm/components/MonthsDropdown.js +1 -1
- package/dist/esm/components/Nav.d.ts +5 -1
- package/dist/esm/components/Nav.js +1 -1
- package/dist/esm/components/Nav.js.map +1 -1
- package/dist/esm/components/NextMonthButton.d.ts +1 -1
- package/dist/esm/components/NextMonthButton.js +1 -1
- package/dist/esm/components/Option.d.ts +1 -1
- package/dist/esm/components/Option.js +1 -1
- package/dist/esm/components/PreviousMonthButton.d.ts +1 -1
- package/dist/esm/components/PreviousMonthButton.js +1 -1
- package/dist/esm/components/Root.d.ts +2 -2
- package/dist/esm/components/Root.js +1 -1
- package/dist/esm/components/Select.d.ts +1 -1
- package/dist/esm/components/Select.js +1 -1
- package/dist/esm/components/Week.d.ts +2 -1
- package/dist/esm/components/Week.js +1 -1
- package/dist/esm/components/Week.js.map +1 -1
- package/dist/esm/components/WeekNumber.d.ts +2 -2
- package/dist/esm/components/WeekNumber.js +1 -1
- package/dist/esm/components/WeekNumberHeader.d.ts +1 -1
- package/dist/esm/components/WeekNumberHeader.js +1 -1
- package/dist/esm/components/Weekday.d.ts +1 -1
- package/dist/esm/components/Weekday.js +1 -1
- package/dist/esm/components/Weekdays.d.ts +1 -1
- package/dist/esm/components/Weekdays.js +1 -1
- package/dist/esm/components/Weeks.d.ts +1 -1
- package/dist/esm/components/Weeks.js +1 -1
- package/dist/esm/components/YearsDropdown.d.ts +1 -1
- package/dist/esm/components/YearsDropdown.js +1 -1
- package/dist/esm/formatters/formatCaption.d.ts +7 -2
- package/dist/esm/formatters/formatCaption.js +7 -2
- package/dist/esm/formatters/formatCaption.js.map +1 -1
- package/dist/esm/formatters/formatDay.d.ts +7 -2
- package/dist/esm/formatters/formatDay.js +7 -2
- package/dist/esm/formatters/formatDay.js.map +1 -1
- package/dist/esm/formatters/formatMonthDropdown.d.ts +6 -2
- package/dist/esm/formatters/formatMonthDropdown.js +6 -2
- package/dist/esm/formatters/formatMonthDropdown.js.map +1 -1
- package/dist/esm/formatters/formatWeekNumber.d.ts +7 -3
- package/dist/esm/formatters/formatWeekNumber.js +10 -5
- package/dist/esm/formatters/formatWeekNumber.js.map +1 -1
- package/dist/esm/formatters/formatWeekNumberHeader.d.ts +3 -2
- package/dist/esm/formatters/formatWeekNumberHeader.js +3 -2
- package/dist/esm/formatters/formatWeekNumberHeader.js.map +1 -1
- package/dist/esm/formatters/formatWeekdayName.d.ts +7 -2
- package/dist/esm/formatters/formatWeekdayName.js +7 -2
- package/dist/esm/formatters/formatWeekdayName.js.map +1 -1
- package/dist/esm/formatters/formatYearDropdown.d.ts +5 -1
- package/dist/esm/formatters/formatYearDropdown.js +5 -1
- package/dist/esm/formatters/formatYearDropdown.js.map +1 -1
- package/dist/esm/helpers/calculateFocusTarget.d.ts +14 -0
- package/dist/esm/helpers/calculateFocusTarget.js +24 -1
- package/dist/esm/helpers/calculateFocusTarget.js.map +1 -1
- package/dist/esm/helpers/createGetModifiers.d.ts +16 -0
- package/dist/esm/{useGetModifiers.js → helpers/createGetModifiers.js} +12 -6
- package/dist/esm/helpers/createGetModifiers.js.map +1 -0
- package/dist/esm/helpers/endOfBroadcastWeek.d.ts +7 -1
- package/dist/esm/helpers/endOfBroadcastWeek.js +7 -1
- package/dist/esm/helpers/endOfBroadcastWeek.js.map +1 -1
- package/dist/esm/helpers/getBroadcastWeeksInMonth.d.ts +8 -1
- package/dist/esm/helpers/getBroadcastWeeksInMonth.js +8 -1
- package/dist/esm/helpers/getBroadcastWeeksInMonth.js.map +1 -1
- package/dist/esm/helpers/getClassNamesForModifiers.d.ts +12 -0
- package/dist/esm/helpers/getClassNamesForModifiers.js +12 -0
- package/dist/esm/helpers/getClassNamesForModifiers.js.map +1 -1
- package/dist/esm/helpers/getComponents.d.ts +10 -0
- package/dist/esm/helpers/getComponents.js +10 -0
- package/dist/esm/helpers/getComponents.js.map +1 -1
- package/dist/esm/helpers/getDataAttributes.d.ts +9 -1
- package/dist/esm/helpers/getDataAttributes.js +11 -2
- package/dist/esm/helpers/getDataAttributes.js.map +1 -1
- package/dist/esm/helpers/getDates.d.ts +12 -1
- package/dist/esm/helpers/getDates.js +13 -2
- package/dist/esm/helpers/getDates.js.map +1 -1
- package/dist/esm/helpers/getDays.d.ts +4 -0
- package/dist/esm/helpers/getDays.js +4 -1
- package/dist/esm/helpers/getDays.js.map +1 -1
- package/dist/esm/helpers/getDefaultClassNames.d.ts +5 -1
- package/dist/esm/helpers/getDefaultClassNames.js +5 -1
- package/dist/esm/helpers/getDefaultClassNames.js.map +1 -1
- package/dist/esm/helpers/getDisplayMonths.d.ts +10 -0
- package/dist/esm/helpers/getDisplayMonths.js +10 -0
- package/dist/esm/helpers/getDisplayMonths.js.map +1 -1
- package/dist/esm/helpers/getFocusableDate.d.ts +16 -1
- package/dist/esm/helpers/getFocusableDate.js +17 -2
- package/dist/esm/helpers/getFocusableDate.js.map +1 -1
- package/dist/esm/helpers/getFormatters.d.ts +7 -1
- package/dist/esm/helpers/getFormatters.js +7 -1
- package/dist/esm/helpers/getFormatters.js.map +1 -1
- package/dist/esm/helpers/getInitialMonth.d.ts +11 -1
- package/dist/esm/helpers/getInitialMonth.js +14 -7
- package/dist/esm/helpers/getInitialMonth.js.map +1 -1
- package/dist/esm/helpers/getLabels.d.ts +6 -1
- package/dist/esm/helpers/getLabels.js +6 -1
- package/dist/esm/helpers/getLabels.js.map +1 -1
- package/dist/esm/helpers/getMonthOptions.d.ts +15 -1
- package/dist/esm/helpers/getMonthOptions.js +15 -1
- package/dist/esm/helpers/getMonthOptions.js.map +1 -1
- package/dist/esm/helpers/getMonths.d.ts +15 -8
- package/dist/esm/helpers/getMonths.js +16 -9
- package/dist/esm/helpers/getMonths.js.map +1 -1
- package/dist/esm/helpers/getNavMonth.d.ts +7 -1
- package/dist/esm/helpers/getNavMonth.js +7 -1
- package/dist/esm/helpers/getNavMonth.js.map +1 -1
- package/dist/esm/helpers/getNextFocus.d.ts +18 -3
- package/dist/esm/helpers/getNextFocus.js +19 -5
- package/dist/esm/helpers/getNextFocus.js.map +1 -1
- package/dist/esm/helpers/getNextMonth.d.ts +13 -5
- package/dist/esm/helpers/getNextMonth.js +13 -6
- package/dist/esm/helpers/getNextMonth.js.map +1 -1
- package/dist/esm/helpers/getPreviousMonth.d.ts +13 -5
- package/dist/esm/helpers/getPreviousMonth.js +13 -5
- package/dist/esm/helpers/getPreviousMonth.js.map +1 -1
- package/dist/esm/helpers/getStyleForModifiers.d.ts +11 -0
- package/dist/esm/helpers/getStyleForModifiers.js +11 -0
- package/dist/esm/helpers/getStyleForModifiers.js.map +1 -1
- package/dist/esm/helpers/getWeekdays.d.ts +9 -9
- package/dist/esm/helpers/getWeekdays.js +9 -9
- package/dist/esm/helpers/getWeekdays.js.map +1 -1
- package/dist/esm/helpers/getWeeks.d.ts +6 -1
- package/dist/esm/helpers/getWeeks.js +6 -1
- package/dist/esm/helpers/getWeeks.js.map +1 -1
- package/dist/esm/helpers/getYearOptions.d.ts +13 -1
- package/dist/esm/helpers/getYearOptions.js +13 -1
- package/dist/esm/helpers/getYearOptions.js.map +1 -1
- package/dist/esm/helpers/startOfBroadcastWeek.d.ts +8 -1
- package/dist/esm/helpers/startOfBroadcastWeek.js +8 -1
- package/dist/esm/helpers/startOfBroadcastWeek.js.map +1 -1
- package/dist/esm/helpers/useControlledValue.d.ts +10 -6
- package/dist/esm/helpers/useControlledValue.js +10 -6
- package/dist/esm/helpers/useControlledValue.js.map +1 -1
- package/dist/esm/labels/labelDayButton.d.ts +9 -6
- package/dist/esm/labels/labelDayButton.js +9 -6
- package/dist/esm/labels/labelDayButton.js.map +1 -1
- package/dist/esm/labels/labelGrid.d.ts +7 -3
- package/dist/esm/labels/labelGrid.js +7 -3
- package/dist/esm/labels/labelGrid.js.map +1 -1
- package/dist/esm/labels/labelGridcell.d.ts +7 -4
- package/dist/esm/labels/labelGridcell.js +7 -4
- package/dist/esm/labels/labelGridcell.js.map +1 -1
- package/dist/esm/labels/labelMonthDropdown.d.ts +3 -1
- package/dist/esm/labels/labelMonthDropdown.js +3 -1
- package/dist/esm/labels/labelMonthDropdown.js.map +1 -1
- package/dist/esm/labels/labelNav.d.ts +2 -1
- package/dist/esm/labels/labelNav.js +2 -1
- package/dist/esm/labels/labelNav.js.map +1 -1
- package/dist/esm/labels/labelNext.d.ts +5 -4
- package/dist/esm/labels/labelNext.js +5 -4
- package/dist/esm/labels/labelNext.js.map +1 -1
- package/dist/esm/labels/labelPrevious.d.ts +5 -4
- package/dist/esm/labels/labelPrevious.js +5 -4
- package/dist/esm/labels/labelPrevious.js.map +1 -1
- package/dist/esm/labels/labelWeekNumber.d.ts +4 -1
- package/dist/esm/labels/labelWeekNumber.js +4 -1
- package/dist/esm/labels/labelWeekNumber.js.map +1 -1
- package/dist/esm/labels/labelWeekNumberHeader.d.ts +3 -1
- package/dist/esm/labels/labelWeekNumberHeader.js +3 -1
- package/dist/esm/labels/labelWeekNumberHeader.js.map +1 -1
- package/dist/esm/labels/labelWeekday.d.ts +5 -1
- package/dist/esm/labels/labelWeekday.js +5 -1
- package/dist/esm/labels/labelWeekday.js.map +1 -1
- package/dist/esm/labels/labelYearDropdown.d.ts +3 -1
- package/dist/esm/labels/labelYearDropdown.js +3 -1
- package/dist/esm/labels/labelYearDropdown.js.map +1 -1
- package/dist/esm/persian.d.ts +15 -2
- package/dist/esm/persian.js +15 -2
- package/dist/esm/persian.js.map +1 -1
- package/dist/esm/selection/useMulti.d.ts +9 -0
- package/dist/esm/selection/useMulti.js +9 -0
- package/dist/esm/selection/useMulti.js.map +1 -1
- package/dist/esm/selection/useRange.d.ts +9 -0
- package/dist/esm/selection/useRange.js +9 -0
- package/dist/esm/selection/useRange.js.map +1 -1
- package/dist/esm/selection/useSingle.d.ts +9 -0
- package/dist/esm/selection/useSingle.js +9 -0
- package/dist/esm/selection/useSingle.js.map +1 -1
- package/dist/esm/types/deprecated.d.ts +8 -8
- package/dist/esm/types/deprecated.js +1 -1
- package/dist/esm/types/props.d.ts +57 -13
- package/dist/esm/types/selection.d.ts +25 -0
- package/dist/esm/types/shared.d.ts +29 -78
- package/dist/esm/useAnimation.d.ts +11 -1
- package/dist/esm/useAnimation.js +11 -1
- package/dist/esm/useAnimation.js.map +1 -1
- package/dist/esm/useCalendar.d.ts +9 -1
- package/dist/esm/useCalendar.js +9 -1
- package/dist/esm/useCalendar.js.map +1 -1
- package/dist/esm/useDayPicker.d.ts +4 -6
- package/dist/esm/useDayPicker.js +4 -6
- package/dist/esm/useDayPicker.js.map +1 -1
- package/dist/esm/useFocus.d.ts +14 -1
- package/dist/esm/useFocus.js +14 -1
- package/dist/esm/useFocus.js.map +1 -1
- package/dist/esm/useSelection.d.ts +10 -0
- package/dist/esm/useSelection.js +10 -0
- package/dist/esm/useSelection.js.map +1 -1
- package/dist/esm/utc.d.ts +6 -0
- package/dist/esm/utc.js +6 -0
- package/dist/esm/utc.js.map +1 -1
- package/dist/esm/utils/addToRange.d.ts +10 -11
- package/dist/esm/utils/addToRange.js +10 -11
- package/dist/esm/utils/addToRange.js.map +1 -1
- package/dist/esm/utils/dateMatchModifiers.d.ts +5 -15
- package/dist/esm/utils/dateMatchModifiers.js +5 -15
- package/dist/esm/utils/dateMatchModifiers.js.map +1 -1
- package/dist/esm/utils/rangeContainsDayOfWeek.d.ts +7 -9
- package/dist/esm/utils/rangeContainsDayOfWeek.js +7 -9
- package/dist/esm/utils/rangeContainsDayOfWeek.js.map +1 -1
- package/dist/esm/utils/rangeContainsModifiers.d.ts +5 -14
- package/dist/esm/utils/rangeContainsModifiers.js +5 -14
- package/dist/esm/utils/rangeContainsModifiers.js.map +1 -1
- package/dist/esm/utils/rangeIncludesDate.d.ts +7 -4
- package/dist/esm/utils/rangeIncludesDate.js +7 -4
- package/dist/esm/utils/rangeIncludesDate.js.map +1 -1
- package/dist/esm/utils/rangeOverlaps.d.ts +5 -1
- package/dist/esm/utils/rangeOverlaps.js +5 -1
- package/dist/esm/utils/rangeOverlaps.js.map +1 -1
- package/dist/esm/utils/typeguards.d.ts +19 -6
- package/dist/esm/utils/typeguards.js +19 -6
- package/dist/esm/utils/typeguards.js.map +1 -1
- package/package.json +1 -1
- package/src/DayPicker.test.tsx +34 -0
- package/src/DayPicker.tsx +105 -6
- package/src/UI.ts +11 -23
- package/src/classes/CalendarDay.ts +17 -14
- package/src/classes/CalendarMonth.ts +8 -3
- package/src/classes/CalendarWeek.ts +8 -2
- package/src/classes/DateLib.ts +65 -76
- package/src/components/Day.tsx +4 -4
- package/src/components/DayButton.tsx +2 -2
- package/src/components/Dropdown.tsx +4 -6
- package/src/components/DropdownNav.tsx +1 -1
- package/src/components/Footer.tsx +1 -1
- package/src/components/Month.tsx +3 -3
- package/src/components/MonthCaption.tsx +3 -3
- package/src/components/MonthGrid.tsx +1 -1
- package/src/components/Months.tsx +1 -1
- package/src/components/MonthsDropdown.tsx +1 -1
- package/src/components/Nav.tsx +5 -1
- package/src/components/NextMonthButton.tsx +1 -1
- package/src/components/Option.tsx +1 -1
- package/src/components/PreviousMonthButton.tsx +1 -1
- package/src/components/Root.tsx +2 -2
- package/src/components/Select.tsx +1 -1
- package/src/components/Week.tsx +2 -1
- package/src/components/WeekNumber.tsx +2 -2
- package/src/components/WeekNumberHeader.tsx +1 -1
- package/src/components/Weekday.tsx +1 -1
- package/src/components/Weekdays.tsx +1 -1
- package/src/components/Weeks.tsx +1 -1
- package/src/components/YearsDropdown.tsx +1 -1
- package/src/formatters/formatCaption.ts +7 -2
- package/src/formatters/formatDay.ts +7 -2
- package/src/formatters/formatMonthDropdown.ts +6 -2
- package/src/formatters/formatWeekNumber.test.ts +11 -0
- package/src/formatters/formatWeekNumber.ts +11 -5
- package/src/formatters/formatWeekNumberHeader.ts +3 -2
- package/src/formatters/formatWeekdayName.ts +7 -2
- package/src/formatters/formatYearDropdown.ts +5 -1
- package/src/helpers/calculateFocusTarget.ts +25 -2
- package/src/{useGetModifiers.test.tsx → helpers/createGetModifiers.test.ts} +7 -8
- package/src/{useGetModifiers.tsx → helpers/createGetModifiers.ts} +13 -7
- package/src/helpers/endOfBroadcastWeek.ts +7 -1
- package/src/helpers/getBroadcastWeeksInMonth.ts +8 -1
- package/src/helpers/getClassNamesForModifiers.ts +13 -1
- package/src/helpers/getComponents.ts +10 -0
- package/src/helpers/getDataAttributes.tsx +11 -2
- package/src/helpers/getDates.ts +13 -2
- package/src/helpers/getDays.ts +4 -1
- package/src/helpers/getDefaultClassNames.ts +5 -1
- package/src/helpers/getDisplayMonths.ts +11 -1
- package/src/helpers/getFocusableDate.ts +17 -2
- package/src/helpers/getFormatters.ts +7 -1
- package/src/helpers/getInitialMonth.ts +14 -9
- package/src/helpers/getLabels.ts +6 -1
- package/src/helpers/getMonthOptions.ts +15 -1
- package/src/helpers/getMonths.ts +16 -5
- package/src/helpers/getNavMonth.ts +7 -1
- package/src/helpers/getNextFocus.tsx +18 -2
- package/src/helpers/getNextMonth.ts +13 -6
- package/src/helpers/getPreviousMonth.ts +13 -5
- package/src/helpers/getStyleForModifiers.ts +12 -1
- package/src/helpers/getWeekdays.ts +8 -5
- package/src/helpers/getWeeks.ts +6 -1
- package/src/helpers/getYearOptions.ts +13 -1
- package/src/helpers/startOfBroadcastWeek.ts +8 -1
- package/src/helpers/useControlledValue.ts +10 -6
- package/src/labels/labelDayButton.ts +8 -4
- package/src/labels/labelGrid.ts +7 -3
- package/src/labels/labelGridcell.ts +6 -2
- package/src/labels/labelMonthDropdown.ts +3 -1
- package/src/labels/labelNav.ts +2 -1
- package/src/labels/labelNext.ts +5 -5
- package/src/labels/labelPrevious.ts +5 -5
- package/src/labels/labelWeekNumber.ts +4 -1
- package/src/labels/labelWeekNumberHeader.ts +3 -1
- package/src/labels/labelWeekday.ts +5 -1
- package/src/labels/labelYearDropdown.ts +3 -1
- package/src/persian.tsx +15 -2
- package/src/selection/useMulti.tsx +9 -0
- package/src/selection/useRange.tsx +9 -0
- package/src/selection/useSingle.tsx +9 -0
- package/src/style.css +29 -0
- package/src/style.module.css +29 -0
- package/src/types/deprecated.ts +8 -8
- package/src/types/props.ts +58 -13
- package/src/types/selection.ts +25 -0
- package/src/types/shared.ts +29 -78
- package/src/useAnimation.ts +11 -1
- package/src/useCalendar.ts +9 -1
- package/src/useDayPicker.ts +4 -6
- package/src/useFocus.ts +14 -1
- package/src/useSelection.ts +10 -0
- package/src/utc.tsx +6 -0
- package/src/utils/addToRange.ts +9 -7
- package/src/utils/dateMatchModifiers.ts +5 -15
- package/src/utils/rangeContainsDayOfWeek.ts +7 -9
- package/src/utils/rangeContainsModifiers.ts +5 -14
- package/src/utils/rangeIncludesDate.ts +6 -2
- package/src/utils/rangeOverlaps.ts +5 -1
- package/src/utils/typeguards.ts +19 -6
- package/dist/cjs/useGetModifiers.d.ts +0 -10
- package/dist/cjs/useGetModifiers.js.map +0 -1
- package/dist/esm/useGetModifiers.d.ts +0 -10
- package/dist/esm/useGetModifiers.js.map +0 -1
- /package/src/helpers/{getPossibleFocusDate.test.ts → getFocusableDate.test.ts} +0 -0
package/src/helpers/getLabels.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as defaultLabels from "../labels/index.js";
|
|
2
2
|
import type { DayPickerProps, Labels } from "../types/index.js";
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Merges custom labels from the props with the default labels.
|
|
6
|
+
*
|
|
7
|
+
* @param customLabels The custom labels provided in the DayPicker props.
|
|
8
|
+
* @returns The merged labels object.
|
|
9
|
+
*/
|
|
5
10
|
export function getLabels(customLabels: DayPickerProps["labels"]): Labels {
|
|
6
11
|
return {
|
|
7
12
|
...defaultLabels,
|
|
@@ -2,7 +2,21 @@ import { type DateLib } from "../classes/DateLib.js";
|
|
|
2
2
|
import { DropdownOption } from "../components/Dropdown.js";
|
|
3
3
|
import type { Formatters } from "../types/index.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Returns the months to show in the dropdown.
|
|
7
|
+
*
|
|
8
|
+
* This function generates a list of months for the current year, formatted
|
|
9
|
+
* using the provided formatter, and determines whether each month should be
|
|
10
|
+
* disabled based on the navigation range.
|
|
11
|
+
*
|
|
12
|
+
* @param displayMonth The currently displayed month.
|
|
13
|
+
* @param navStart The start date for navigation.
|
|
14
|
+
* @param navEnd The end date for navigation.
|
|
15
|
+
* @param formatters The formatters to use for formatting the month labels.
|
|
16
|
+
* @param dateLib The date library to use for date manipulation.
|
|
17
|
+
* @returns An array of dropdown options representing the months, or `undefined`
|
|
18
|
+
* if no months are available.
|
|
19
|
+
*/
|
|
6
20
|
export function getMonthOptions(
|
|
7
21
|
displayMonth: Date,
|
|
8
22
|
navStart: Date | undefined,
|
package/src/helpers/getMonths.ts
CHANGED
|
@@ -2,13 +2,23 @@ import type { DateLib } from "../classes/DateLib.js";
|
|
|
2
2
|
import { CalendarWeek, CalendarDay, CalendarMonth } from "../classes/index.js";
|
|
3
3
|
import type { DayPickerProps } from "../types/index.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Returns the months to display in the calendar.
|
|
7
|
+
*
|
|
8
|
+
* This function generates `CalendarMonth` objects for each month to be
|
|
9
|
+
* displayed, including their weeks and days, based on the provided display
|
|
10
|
+
* months and dates.
|
|
11
|
+
*
|
|
12
|
+
* @param displayMonths The months (as dates) to display in the calendar.
|
|
13
|
+
* @param dates The dates to display in the calendar.
|
|
14
|
+
* @param props Options from the DayPicker props context.
|
|
15
|
+
* @param dateLib The date library to use for date manipulation.
|
|
16
|
+
* @returns An array of `CalendarMonth` objects representing the months to
|
|
17
|
+
* display.
|
|
18
|
+
*/
|
|
6
19
|
export function getMonths(
|
|
7
|
-
/** The months (as dates) to display in the calendar. */
|
|
8
20
|
displayMonths: Date[],
|
|
9
|
-
/** The dates to display in the calendar. */
|
|
10
21
|
dates: Date[],
|
|
11
|
-
/** Options from the props context. */
|
|
12
22
|
props: Pick<
|
|
13
23
|
DayPickerProps,
|
|
14
24
|
"broadcastCalendar" | "fixedWeeks" | "ISOWeek" | "reverseMonths"
|
|
@@ -27,6 +37,7 @@ export function getMonths(
|
|
|
27
37
|
startOfISOWeek,
|
|
28
38
|
startOfWeek
|
|
29
39
|
} = dateLib;
|
|
40
|
+
|
|
30
41
|
const dayPickerMonths = displayMonths.reduce<CalendarMonth[]>(
|
|
31
42
|
(months, month) => {
|
|
32
43
|
const firstDateOfFirstWeek = props.broadcastCalendar
|
|
@@ -36,7 +47,7 @@ export function getMonths(
|
|
|
36
47
|
: startOfWeek(month);
|
|
37
48
|
|
|
38
49
|
const lastDateOfLastWeek = props.broadcastCalendar
|
|
39
|
-
? endOfBroadcastWeek(month
|
|
50
|
+
? endOfBroadcastWeek(month)
|
|
40
51
|
: props.ISOWeek
|
|
41
52
|
? endOfISOWeek(endOfMonth(month))
|
|
42
53
|
: endOfWeek(endOfMonth(month));
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { type DateLib } from "../classes/DateLib.js";
|
|
2
2
|
import type { DayPickerProps } from "../types/index.js";
|
|
3
3
|
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Returns the start and end months for calendar navigation.
|
|
6
|
+
*
|
|
7
|
+
* @param props The DayPicker props, including navigation and layout options.
|
|
8
|
+
* @param dateLib The date library to use for date manipulation.
|
|
9
|
+
* @returns A tuple containing the start and end months for navigation.
|
|
10
|
+
*/
|
|
5
11
|
export function getNavMonths(
|
|
6
12
|
props: Pick<
|
|
7
13
|
DayPickerProps,
|
|
@@ -9,10 +9,26 @@ import { dateMatchModifiers } from "../utils/dateMatchModifiers.js";
|
|
|
9
9
|
|
|
10
10
|
import { getFocusableDate } from "./getFocusableDate.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Determines the next focusable day in the calendar.
|
|
14
|
+
*
|
|
15
|
+
* This function recursively calculates the next focusable day based on the
|
|
16
|
+
* movement direction and modifiers applied to the days.
|
|
17
|
+
*
|
|
18
|
+
* @param moveBy The unit of movement (e.g., "day", "week").
|
|
19
|
+
* @param moveDir The direction of movement ("before" or "after").
|
|
20
|
+
* @param refDay The currently focused day.
|
|
21
|
+
* @param calendarStartMonth The earliest month the user can navigate to.
|
|
22
|
+
* @param calendarEndMonth The latest month the user can navigate to.
|
|
23
|
+
* @param props The DayPicker props, including modifiers and configuration
|
|
24
|
+
* options.
|
|
25
|
+
* @param dateLib The date library to use for date manipulation.
|
|
26
|
+
* @param attempt The current recursion attempt (used to limit recursion depth).
|
|
27
|
+
* @returns The next focusable day, or `undefined` if no focusable day is found.
|
|
28
|
+
*/
|
|
12
29
|
export function getNextFocus(
|
|
13
30
|
moveBy: MoveFocusBy,
|
|
14
31
|
moveDir: MoveFocusDir,
|
|
15
|
-
/** The date that is currently focused. */
|
|
16
32
|
refDay: CalendarDay,
|
|
17
33
|
calendarStartMonth: Date | undefined,
|
|
18
34
|
calendarEndMonth: Date | undefined,
|
|
@@ -31,7 +47,7 @@ export function getNextFocus(
|
|
|
31
47
|
const focusableDate = getFocusableDate(
|
|
32
48
|
moveBy,
|
|
33
49
|
moveDir,
|
|
34
|
-
refDay.date,
|
|
50
|
+
refDay.date,
|
|
35
51
|
calendarStartMonth,
|
|
36
52
|
calendarEndMonth,
|
|
37
53
|
props,
|
|
@@ -2,13 +2,21 @@ import type { DateLib } from "../classes/DateLib.js";
|
|
|
2
2
|
import type { DayPickerProps } from "../types/index.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* options.
|
|
5
|
+
* Returns the next month the user can navigate to, based on the given options.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
7
|
+
* The next month is not always the next calendar month:
|
|
9
8
|
*
|
|
10
|
-
* - If after the `calendarEndMonth
|
|
11
|
-
* - If
|
|
9
|
+
* - If it is after the `calendarEndMonth`, it returns `undefined`.
|
|
10
|
+
* - If paged navigation is enabled, it skips forward by the number of displayed
|
|
11
|
+
* months.
|
|
12
|
+
*
|
|
13
|
+
* @param firstDisplayedMonth The first month currently displayed in the
|
|
14
|
+
* calendar.
|
|
15
|
+
* @param calendarEndMonth The latest month the user can navigate to.
|
|
16
|
+
* @param options Navigation options, including `numberOfMonths` and
|
|
17
|
+
* `pagedNavigation`.
|
|
18
|
+
* @param dateLib The date library to use for date manipulation.
|
|
19
|
+
* @returns The next month, or `undefined` if navigation is not possible.
|
|
12
20
|
*/
|
|
13
21
|
export function getNextMonth(
|
|
14
22
|
firstDisplayedMonth: Date,
|
|
@@ -40,6 +48,5 @@ export function getNextMonth(
|
|
|
40
48
|
return undefined;
|
|
41
49
|
}
|
|
42
50
|
|
|
43
|
-
// Jump forward as the number of months when paged navigation
|
|
44
51
|
return addMonths(month, offset);
|
|
45
52
|
}
|
|
@@ -2,14 +2,22 @@ import type { DateLib } from "../classes/DateLib.js";
|
|
|
2
2
|
import type { DayPickerProps } from "../types/index.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Returns the previous month the user can navigate to, based on the given
|
|
6
6
|
* options.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* month:
|
|
8
|
+
* The previous month is not always the previous calendar month:
|
|
10
9
|
*
|
|
11
|
-
* - If before the `calendarStartMonth
|
|
12
|
-
* - If
|
|
10
|
+
* - If it is before the `calendarStartMonth`, it returns `undefined`.
|
|
11
|
+
* - If paged navigation is enabled, it skips back by the number of displayed
|
|
12
|
+
* months.
|
|
13
|
+
*
|
|
14
|
+
* @param firstDisplayedMonth The first month currently displayed in the
|
|
15
|
+
* calendar.
|
|
16
|
+
* @param calendarStartMonth The earliest month the user can navigate to.
|
|
17
|
+
* @param options Navigation options, including `numberOfMonths` and
|
|
18
|
+
* `pagedNavigation`.
|
|
19
|
+
* @param dateLib The date library to use for date manipulation.
|
|
20
|
+
* @returns The previous month, or `undefined` if navigation is not possible.
|
|
13
21
|
*/
|
|
14
22
|
export function getPreviousMonth(
|
|
15
23
|
firstDisplayedMonth: Date,
|
|
@@ -3,11 +3,22 @@ import type { CSSProperties } from "react";
|
|
|
3
3
|
import { UI } from "../UI.js";
|
|
4
4
|
import type { Modifiers, ModifiersStyles, Styles } from "../types/index.js";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Returns the computed style for a day based on its modifiers.
|
|
8
|
+
*
|
|
9
|
+
* This function merges the base styles for the day with any styles associated
|
|
10
|
+
* with active modifiers.
|
|
11
|
+
*
|
|
12
|
+
* @param dayModifiers The modifiers applied to the day.
|
|
13
|
+
* @param styles The base styles for the calendar elements.
|
|
14
|
+
* @param modifiersStyles The styles associated with specific modifiers.
|
|
15
|
+
* @returns The computed style for the day.
|
|
16
|
+
*/
|
|
6
17
|
export function getStyleForModifiers(
|
|
7
18
|
dayModifiers: Modifiers,
|
|
8
19
|
styles: Partial<Styles> = {},
|
|
9
20
|
modifiersStyles: Partial<ModifiersStyles> = {}
|
|
10
|
-
) {
|
|
21
|
+
): CSSProperties {
|
|
11
22
|
let style: CSSProperties = { ...styles?.[UI.Day] };
|
|
12
23
|
Object.entries(dayModifiers)
|
|
13
24
|
.filter(([, active]) => active === true)
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { DateLib } from "../classes/DateLib.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Generates a series of 7 days, starting from the beginning of the week, to use
|
|
5
|
+
* for formatting weekday names (e.g., Monday, Tuesday, etc.).
|
|
6
|
+
*
|
|
7
|
+
* @param dateLib The date library to use for date manipulation.
|
|
8
|
+
* @param ISOWeek Whether to use ISO week numbering (weeks start on Monday).
|
|
9
|
+
* @param broadcastCalendar Whether to use the broadcast calendar (weeks start
|
|
10
|
+
* on Monday, but may include adjustments for broadcast-specific rules).
|
|
11
|
+
* @returns An array of 7 dates representing the weekdays.
|
|
6
12
|
*/
|
|
7
13
|
export function getWeekdays(
|
|
8
|
-
/** The date library. */
|
|
9
14
|
dateLib: DateLib,
|
|
10
|
-
/** Use ISOWeek instead of locale/ */
|
|
11
15
|
ISOWeek?: boolean | undefined,
|
|
12
|
-
/** @since 9.4.0 */
|
|
13
16
|
broadcastCalendar?: boolean | undefined
|
|
14
17
|
): Date[] {
|
|
15
18
|
const today = dateLib.today();
|
package/src/helpers/getWeeks.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { CalendarMonth, CalendarWeek } from "../classes/index.js";
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Returns an array of calendar weeks from an array of calendar months.
|
|
5
|
+
*
|
|
6
|
+
* @param months The array of calendar months.
|
|
7
|
+
* @returns An array of calendar weeks.
|
|
8
|
+
*/
|
|
4
9
|
export function getWeeks(months: CalendarMonth[]) {
|
|
5
10
|
const initialWeeks: CalendarWeek[] = [];
|
|
6
11
|
return months.reduce((weeks, month) => {
|
|
@@ -2,7 +2,19 @@ import type { DateLib } from "../classes/DateLib.js";
|
|
|
2
2
|
import { DropdownOption } from "../components/Dropdown.js";
|
|
3
3
|
import type { Formatters } from "../types/index.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* Returns the years to display in the dropdown.
|
|
7
|
+
*
|
|
8
|
+
* This function generates a list of years between the navigation start and end
|
|
9
|
+
* dates, formatted using the provided formatter.
|
|
10
|
+
*
|
|
11
|
+
* @param navStart The start date for navigation.
|
|
12
|
+
* @param navEnd The end date for navigation.
|
|
13
|
+
* @param formatters The formatters to use for formatting the year labels.
|
|
14
|
+
* @param dateLib The date library to use for date manipulation.
|
|
15
|
+
* @returns An array of dropdown options representing the years, or `undefined`
|
|
16
|
+
* if `navStart` or `navEnd` is not provided.
|
|
17
|
+
*/
|
|
6
18
|
export function getYearOptions(
|
|
7
19
|
navStart: Date | undefined,
|
|
8
20
|
navEnd: Date | undefined,
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { DateLib } from "../classes/index.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Returns the start date of the week in the broadcast calendar.
|
|
5
|
+
*
|
|
6
|
+
* The broadcast week starts on Monday. If the first day of the month is not a
|
|
7
|
+
* Monday, this function calculates the previous Monday as the start of the
|
|
8
|
+
* broadcast week.
|
|
5
9
|
*
|
|
6
10
|
* @since 9.4.0
|
|
11
|
+
* @param date The date for which to calculate the start of the broadcast week.
|
|
12
|
+
* @param dateLib The date library to use for date manipulation.
|
|
13
|
+
* @returns The start date of the broadcast week.
|
|
7
14
|
*/
|
|
8
15
|
export function startOfBroadcastWeek(date: Date, dateLib: DateLib): Date {
|
|
9
16
|
const firstOfMonth = dateLib.startOfMonth(date);
|
|
@@ -5,6 +5,10 @@ export type DispatchStateAction<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
|
5
5
|
/**
|
|
6
6
|
* A custom hook for managing both controlled and uncontrolled component states.
|
|
7
7
|
*
|
|
8
|
+
* This hook allows a component to support both controlled and uncontrolled
|
|
9
|
+
* states by determining whether the `controlledValue` is provided. If it is
|
|
10
|
+
* undefined, the hook falls back to using the internal state.
|
|
11
|
+
*
|
|
8
12
|
* @example
|
|
9
13
|
* // Uncontrolled usage
|
|
10
14
|
* const [value, setValue] = useControlledValue(0, undefined);
|
|
@@ -13,12 +17,12 @@ export type DispatchStateAction<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
|
13
17
|
* const [value, setValue] = useControlledValue(0, props.value);
|
|
14
18
|
*
|
|
15
19
|
* @template T - The type of the value.
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
*
|
|
19
|
-
* @returns
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* @param defaultValue The initial value for the uncontrolled state.
|
|
21
|
+
* @param controlledValue The value for the controlled state. If undefined, the
|
|
22
|
+
* component will use the uncontrolled state.
|
|
23
|
+
* @returns A tuple where the first element is the current value (either
|
|
24
|
+
* controlled or uncontrolled) and the second element is a setter function to
|
|
25
|
+
* update the value.
|
|
22
26
|
*/
|
|
23
27
|
export function useControlledValue<T>(
|
|
24
28
|
defaultValue: T,
|
|
@@ -2,18 +2,22 @@ import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
|
|
|
2
2
|
import type { Modifiers } from "../types/index.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Generates the ARIA label for a day button.
|
|
6
6
|
*
|
|
7
|
-
* Use the `modifiers` argument to
|
|
8
|
-
*
|
|
7
|
+
* Use the `modifiers` argument to provide additional context for the label,
|
|
8
|
+
* such as indicating if the day is "today" or "selected."
|
|
9
9
|
*
|
|
10
10
|
* @defaultValue The formatted date.
|
|
11
|
+
* @param date - The date to format.
|
|
12
|
+
* @param modifiers - The modifiers providing context for the day.
|
|
13
|
+
* @param options - Optional configuration for the date formatting library.
|
|
14
|
+
* @param dateLib - An optional instance of the date formatting library.
|
|
15
|
+
* @returns The ARIA label for the day button.
|
|
11
16
|
* @group Labels
|
|
12
17
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
13
18
|
*/
|
|
14
19
|
export function labelDayButton(
|
|
15
20
|
date: Date,
|
|
16
|
-
/** The modifiers for the day. */
|
|
17
21
|
modifiers: Modifiers,
|
|
18
22
|
options?: DateLibOptions,
|
|
19
23
|
dateLib?: DateLib
|
package/src/labels/labelGrid.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* grid.
|
|
4
|
+
* Generates the ARIA label for the month grid, which is announced when entering
|
|
5
|
+
* the grid.
|
|
6
6
|
*
|
|
7
|
-
* @defaultValue `LLLL y` (e.g
|
|
7
|
+
* @defaultValue `LLLL y` (e.g., "November 2022").
|
|
8
|
+
* @param date - The date representing the month.
|
|
9
|
+
* @param options - Optional configuration for the date formatting library.
|
|
10
|
+
* @param dateLib - An optional instance of the date formatting library.
|
|
11
|
+
* @returns The ARIA label for the month grid.
|
|
8
12
|
* @group Labels
|
|
9
13
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
10
14
|
*/
|
|
@@ -2,14 +2,18 @@ import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
|
|
|
2
2
|
import type { Modifiers } from "../types/index.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Generates the label for a day grid cell when the calendar is not interactive.
|
|
6
6
|
*
|
|
7
|
+
* @param date - The date to format.
|
|
8
|
+
* @param modifiers - Optional modifiers providing context for the day.
|
|
9
|
+
* @param options - Optional configuration for the date formatting library.
|
|
10
|
+
* @param dateLib - An optional instance of the date formatting library.
|
|
11
|
+
* @returns The label for the day grid cell.
|
|
7
12
|
* @group Labels
|
|
8
13
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
9
14
|
*/
|
|
10
15
|
export function labelGridcell(
|
|
11
16
|
date: Date,
|
|
12
|
-
/** The modifiers for the day. */
|
|
13
17
|
modifiers?: Modifiers,
|
|
14
18
|
options?: DateLibOptions,
|
|
15
19
|
dateLib?: DateLib
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { DateLibOptions } from "../classes/DateLib.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Generates the ARIA label for the months dropdown.
|
|
5
5
|
*
|
|
6
6
|
* @defaultValue `"Choose the Month"`
|
|
7
|
+
* @param options - Optional configuration for the date formatting library.
|
|
8
|
+
* @returns The ARIA label for the months dropdown.
|
|
7
9
|
* @group Labels
|
|
8
10
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
9
11
|
*/
|
package/src/labels/labelNav.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Generates the ARIA label for the navigation toolbar.
|
|
3
3
|
*
|
|
4
4
|
* @defaultValue `""`
|
|
5
|
+
* @returns The ARIA label for the navigation toolbar.
|
|
5
6
|
* @group Labels
|
|
6
7
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7
8
|
*/
|
package/src/labels/labelNext.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Generates the ARIA label for the "next month" button.
|
|
3
3
|
*
|
|
4
4
|
* @defaultValue `"Go to the Next Month"`
|
|
5
|
+
* @param month - The date representing the next month, or `undefined` if there
|
|
6
|
+
* is no next month.
|
|
7
|
+
* @returns The ARIA label for the "next month" button.
|
|
5
8
|
* @group Labels
|
|
6
9
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7
10
|
*/
|
|
8
|
-
export function labelNext(
|
|
9
|
-
/** `undefined` where there's no next month to navigate to. */
|
|
10
|
-
month: Date | undefined
|
|
11
|
-
) {
|
|
11
|
+
export function labelNext(month: Date | undefined) {
|
|
12
12
|
return "Go to the Next Month";
|
|
13
13
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Generates the ARIA label for the "previous month" button.
|
|
3
3
|
*
|
|
4
4
|
* @defaultValue `"Go to the Previous Month"`
|
|
5
|
+
* @param month - The date representing the previous month, or `undefined` if
|
|
6
|
+
* there is no previous month.
|
|
7
|
+
* @returns The ARIA label for the "previous month" button.
|
|
5
8
|
* @group Labels
|
|
6
9
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
7
10
|
*/
|
|
8
|
-
export function labelPrevious(
|
|
9
|
-
/** Undefined where there's no previous month to navigate to. */
|
|
10
|
-
month: Date | undefined
|
|
11
|
-
) {
|
|
11
|
+
export function labelPrevious(month: Date | undefined) {
|
|
12
12
|
return "Go to the Previous Month";
|
|
13
13
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { DateLibOptions } from "../classes/DateLib.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Generates the ARIA label for the week number cell (the first cell in a row).
|
|
5
5
|
*
|
|
6
6
|
* @defaultValue `Week ${weekNumber}`
|
|
7
|
+
* @param weekNumber - The number of the week.
|
|
8
|
+
* @param options - Optional configuration for the date formatting library.
|
|
9
|
+
* @returns The ARIA label for the week number cell.
|
|
7
10
|
* @group Labels
|
|
8
11
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
9
12
|
*/
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { DateLibOptions } from "../classes/DateLib.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Generates the ARIA label for the week number header element.
|
|
5
5
|
*
|
|
6
6
|
* @defaultValue `"Week Number"`
|
|
7
|
+
* @param options - Optional configuration for the date formatting library.
|
|
8
|
+
* @returns The ARIA label for the week number header.
|
|
7
9
|
* @group Labels
|
|
8
10
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
9
11
|
*/
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Generates the ARIA label for a weekday column header.
|
|
5
5
|
*
|
|
6
6
|
* @defaultValue `"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"`
|
|
7
|
+
* @param date - The date representing the weekday.
|
|
8
|
+
* @param options - Optional configuration for the date formatting library.
|
|
9
|
+
* @param dateLib - An optional instance of the date formatting library.
|
|
10
|
+
* @returns The ARIA label for the weekday column header.
|
|
7
11
|
* @group Labels
|
|
8
12
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
9
13
|
*/
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { DateLibOptions } from "../classes/DateLib.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Generates the ARIA label for the years dropdown.
|
|
5
5
|
*
|
|
6
6
|
* @defaultValue `"Choose the Year"`
|
|
7
|
+
* @param options - Optional configuration for the date formatting library.
|
|
8
|
+
* @returns The ARIA label for the years dropdown.
|
|
7
9
|
* @group Labels
|
|
8
10
|
* @see https://daypicker.dev/docs/translation#aria-labels
|
|
9
11
|
*/
|
package/src/persian.tsx
CHANGED
|
@@ -15,8 +15,16 @@ export const faIR = locales.faIR;
|
|
|
15
15
|
export const enUS = locales.enUS;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Renders the Persian calendar using the DayPicker component.
|
|
19
19
|
*
|
|
20
|
+
* @defaultValue
|
|
21
|
+
* - `locale`: `faIR`
|
|
22
|
+
* - `dir`: `rtl`
|
|
23
|
+
* - `dateLib`: `jalaliDateLib` from `date-fns-jalali`
|
|
24
|
+
* - `numerals`: `arabext` (Eastern Arabic-Indic)
|
|
25
|
+
* @param props - The props for the Persian calendar, including locale, text
|
|
26
|
+
* direction, date library, and numeral system.
|
|
27
|
+
* @returns The Persian calendar component.
|
|
20
28
|
* @see https://daypicker.dev/docs/localization#persian-calendar
|
|
21
29
|
*/
|
|
22
30
|
export function DayPicker(
|
|
@@ -80,7 +88,12 @@ export function DayPicker(
|
|
|
80
88
|
);
|
|
81
89
|
}
|
|
82
90
|
|
|
83
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* Returns the date library used in the Persian calendar.
|
|
93
|
+
*
|
|
94
|
+
* @param options - Optional configuration for the date library.
|
|
95
|
+
* @returns The date library instance.
|
|
96
|
+
*/
|
|
84
97
|
export const getDateLib = (options?: DateLibOptions) => {
|
|
85
98
|
return new DateLib(options, dateFnsJalali);
|
|
86
99
|
};
|
|
@@ -9,6 +9,15 @@ import type {
|
|
|
9
9
|
Selection
|
|
10
10
|
} from "../types/index.js";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Hook to manage multiple-date selection in the DayPicker component.
|
|
14
|
+
*
|
|
15
|
+
* @template T - The type of DayPicker props.
|
|
16
|
+
* @param props - The DayPicker props.
|
|
17
|
+
* @param dateLib - The date utility library instance.
|
|
18
|
+
* @returns An object containing the selected dates, a function to select dates,
|
|
19
|
+
* and a function to check if a date is selected.
|
|
20
|
+
*/
|
|
12
21
|
export function useMulti<T extends DayPickerProps>(
|
|
13
22
|
props: T,
|
|
14
23
|
dateLib: DateLib
|
|
@@ -11,6 +11,15 @@ import type {
|
|
|
11
11
|
import { addToRange, rangeContainsModifiers } from "../utils/index.js";
|
|
12
12
|
import { rangeIncludesDate } from "../utils/rangeIncludesDate.js";
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Hook to manage range selection in the DayPicker component.
|
|
16
|
+
*
|
|
17
|
+
* @template T - The type of DayPicker props.
|
|
18
|
+
* @param props - The DayPicker props.
|
|
19
|
+
* @param dateLib - The date utility library instance.
|
|
20
|
+
* @returns An object containing the selected range, a function to select a
|
|
21
|
+
* range, and a function to check if a date is within the range.
|
|
22
|
+
*/
|
|
14
23
|
export function useRange<T extends DayPickerProps>(
|
|
15
24
|
props: T,
|
|
16
25
|
dateLib: DateLib
|
|
@@ -17,6 +17,15 @@ export type UseSingle<T extends DayPickerProps> = {
|
|
|
17
17
|
selected: SelectedValue<T>;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Hook to manage single-date selection in the DayPicker component.
|
|
22
|
+
*
|
|
23
|
+
* @template T - The type of DayPicker props.
|
|
24
|
+
* @param props - The DayPicker props.
|
|
25
|
+
* @param dateLib - The date utility library instance.
|
|
26
|
+
* @returns An object containing the selected date, a function to select a date,
|
|
27
|
+
* and a function to check if a date is selected.
|
|
28
|
+
*/
|
|
20
29
|
export function useSingle<T extends DayPickerProps>(
|
|
21
30
|
props: DayPickerProps,
|
|
22
31
|
dateLib: DateLib
|
package/src/style.css
CHANGED
|
@@ -198,6 +198,35 @@
|
|
|
198
198
|
font-size: large;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
.rdp-root[data-nav-layout="around"] .rdp-month,
|
|
202
|
+
.rdp-root[data-nav-layout="after"] .rdp-month {
|
|
203
|
+
position: relative;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.rdp-root[data-nav-layout="around"] .rdp-month_caption {
|
|
207
|
+
justify-content: center;
|
|
208
|
+
margin-inline-start: var(--rdp-nav_button-width);
|
|
209
|
+
margin-inline-end: var(--rdp-nav_button-width);
|
|
210
|
+
position: relative;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.rdp-root[data-nav-layout="around"] .rdp-button_previous {
|
|
214
|
+
position: absolute;
|
|
215
|
+
inset-inline-start: 0;
|
|
216
|
+
top: 0;
|
|
217
|
+
height: var(--rdp-nav-height);
|
|
218
|
+
display: inline-flex;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.rdp-root[data-nav-layout="around"] .rdp-button_next {
|
|
222
|
+
position: absolute;
|
|
223
|
+
inset-inline-end: 0;
|
|
224
|
+
top: 0;
|
|
225
|
+
height: var(--rdp-nav-height);
|
|
226
|
+
display: inline-flex;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
}
|
|
229
|
+
|
|
201
230
|
.rdp-months {
|
|
202
231
|
position: relative;
|
|
203
232
|
display: flex;
|