@betterinternship/components 1.7.0 → 2.0.1
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/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/icons.js.map +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/hooks/useClientProcess.js.map +1 -1
- package/dist/index.d.ts +19 -20
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +228 -226
- package/theme.css +223 -0
- package/dist/components/Accordion.d.ts +0 -7
- package/dist/components/Avatar.d.ts +0 -6
- package/dist/components/Badge.d.ts +0 -21
- package/dist/components/Button.d.ts +0 -12
- package/dist/components/Button.js +0 -77
- package/dist/components/Button.js.map +0 -1
- package/dist/components/Calendar.d.ts +0 -7
- package/dist/components/Input.d.ts +0 -3
- package/dist/components/ui/calendar.js +0 -51
- package/dist/components/ui/calendar.js.map +0 -1
- package/dist/index.css.js +0 -7
- package/dist/index.css.js.map +0 -1
- package/dist/index.esm.js +0 -3761
- package/dist/index.esm.js.map +0 -1
- package/dist/node_modules/@date-fns/tz/date/index.js +0 -84
- package/dist/node_modules/@date-fns/tz/date/index.js.map +0 -1
- package/dist/node_modules/@date-fns/tz/date/mini.js +0 -451
- package/dist/node_modules/@date-fns/tz/date/mini.js.map +0 -1
- package/dist/node_modules/@date-fns/tz/tzName/index.js +0 -40
- package/dist/node_modules/@date-fns/tz/tzName/index.js.map +0 -1
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +0 -57
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +0 -8
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +0 -8
- package/dist/node_modules/date-fns/_lib/defaultOptions.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/format/formatters.js +0 -776
- package/dist/node_modules/date-fns/_lib/format/formatters.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +0 -95
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +0 -67
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +0 -32
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +0 -12
- package/dist/node_modules/date-fns/_lib/normalizeDates.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +0 -9
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js.map +0 -1
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +0 -26
- package/dist/node_modules/date-fns/_lib/protectedTokens.js.map +0 -1
- package/dist/node_modules/date-fns/addDays.js +0 -61
- package/dist/node_modules/date-fns/addDays.js.map +0 -1
- package/dist/node_modules/date-fns/addMonths.js +0 -76
- package/dist/node_modules/date-fns/addMonths.js.map +0 -1
- package/dist/node_modules/date-fns/addWeeks.js +0 -34
- package/dist/node_modules/date-fns/addWeeks.js.map +0 -1
- package/dist/node_modules/date-fns/addYears.js +0 -34
- package/dist/node_modules/date-fns/addYears.js.map +0 -1
- package/dist/node_modules/date-fns/constants.js +0 -47
- package/dist/node_modules/date-fns/constants.js.map +0 -1
- package/dist/node_modules/date-fns/constructFrom.js +0 -50
- package/dist/node_modules/date-fns/constructFrom.js.map +0 -1
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +0 -63
- package/dist/node_modules/date-fns/differenceInCalendarDays.js.map +0 -1
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +0 -43
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js.map +0 -1
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +0 -66
- package/dist/node_modules/date-fns/eachMonthOfInterval.js.map +0 -1
- package/dist/node_modules/date-fns/eachYearOfInterval.js +0 -66
- package/dist/node_modules/date-fns/eachYearOfInterval.js.map +0 -1
- package/dist/node_modules/date-fns/endOfISOWeek.js +0 -36
- package/dist/node_modules/date-fns/endOfISOWeek.js.map +0 -1
- package/dist/node_modules/date-fns/endOfMonth.js +0 -38
- package/dist/node_modules/date-fns/endOfMonth.js.map +0 -1
- package/dist/node_modules/date-fns/endOfWeek.js +0 -54
- package/dist/node_modules/date-fns/endOfWeek.js.map +0 -1
- package/dist/node_modules/date-fns/endOfYear.js +0 -38
- package/dist/node_modules/date-fns/endOfYear.js.map +0 -1
- package/dist/node_modules/date-fns/format.js +0 -424
- package/dist/node_modules/date-fns/format.js.map +0 -1
- package/dist/node_modules/date-fns/getDayOfYear.js +0 -35
- package/dist/node_modules/date-fns/getDayOfYear.js.map +0 -1
- package/dist/node_modules/date-fns/getDaysInMonth.js +0 -37
- package/dist/node_modules/date-fns/getDaysInMonth.js.map +0 -1
- package/dist/node_modules/date-fns/getISOWeek.js +0 -41
- package/dist/node_modules/date-fns/getISOWeek.js.map +0 -1
- package/dist/node_modules/date-fns/getISOWeekYear.js +0 -53
- package/dist/node_modules/date-fns/getISOWeekYear.js.map +0 -1
- package/dist/node_modules/date-fns/getMonth.js +0 -30
- package/dist/node_modules/date-fns/getMonth.js.map +0 -1
- package/dist/node_modules/date-fns/getWeek.js +0 -55
- package/dist/node_modules/date-fns/getWeek.js.map +0 -1
- package/dist/node_modules/date-fns/getWeekYear.js +0 -76
- package/dist/node_modules/date-fns/getWeekYear.js.map +0 -1
- package/dist/node_modules/date-fns/getYear.js +0 -30
- package/dist/node_modules/date-fns/getYear.js.map +0 -1
- package/dist/node_modules/date-fns/isAfter.js +0 -26
- package/dist/node_modules/date-fns/isAfter.js.map +0 -1
- package/dist/node_modules/date-fns/isBefore.js +0 -26
- package/dist/node_modules/date-fns/isBefore.js.map +0 -1
- package/dist/node_modules/date-fns/isDate.js +0 -42
- package/dist/node_modules/date-fns/isDate.js.map +0 -1
- package/dist/node_modules/date-fns/isSameDay.js +0 -47
- package/dist/node_modules/date-fns/isSameDay.js.map +0 -1
- package/dist/node_modules/date-fns/isSameMonth.js +0 -44
- package/dist/node_modules/date-fns/isSameMonth.js.map +0 -1
- package/dist/node_modules/date-fns/isSameYear.js +0 -36
- package/dist/node_modules/date-fns/isSameYear.js.map +0 -1
- package/dist/node_modules/date-fns/isValid.js +0 -40
- package/dist/node_modules/date-fns/isValid.js.map +0 -1
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +0 -11
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js.map +0 -1
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +0 -65
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js.map +0 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +0 -60
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js.map +0 -1
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +0 -23
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +0 -104
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +0 -42
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +0 -14
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +0 -190
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +0 -135
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js.map +0 -1
- package/dist/node_modules/date-fns/locale/en-US.js +0 -29
- package/dist/node_modules/date-fns/locale/en-US.js.map +0 -1
- package/dist/node_modules/date-fns/max.js +0 -50
- package/dist/node_modules/date-fns/max.js.map +0 -1
- package/dist/node_modules/date-fns/min.js +0 -50
- package/dist/node_modules/date-fns/min.js.map +0 -1
- package/dist/node_modules/date-fns/setMonth.js +0 -47
- package/dist/node_modules/date-fns/setMonth.js.map +0 -1
- package/dist/node_modules/date-fns/setYear.js +0 -41
- package/dist/node_modules/date-fns/setYear.js.map +0 -1
- package/dist/node_modules/date-fns/startOfDay.js +0 -36
- package/dist/node_modules/date-fns/startOfDay.js.map +0 -1
- package/dist/node_modules/date-fns/startOfISOWeek.js +0 -36
- package/dist/node_modules/date-fns/startOfISOWeek.js.map +0 -1
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +0 -43
- package/dist/node_modules/date-fns/startOfISOWeekYear.js.map +0 -1
- package/dist/node_modules/date-fns/startOfMonth.js +0 -38
- package/dist/node_modules/date-fns/startOfMonth.js.map +0 -1
- package/dist/node_modules/date-fns/startOfWeek.js +0 -54
- package/dist/node_modules/date-fns/startOfWeek.js.map +0 -1
- package/dist/node_modules/date-fns/startOfWeekYear.js +0 -65
- package/dist/node_modules/date-fns/startOfWeekYear.js.map +0 -1
- package/dist/node_modules/date-fns/startOfYear.js +0 -37
- package/dist/node_modules/date-fns/startOfYear.js.map +0 -1
- package/dist/node_modules/date-fns/toDate.js +0 -47
- package/dist/node_modules/date-fns/toDate.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +0 -347
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +0 -123
- package/dist/node_modules/react-day-picker/dist/esm/UI.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +0 -34
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +0 -600
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +0 -24
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +0 -32
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +0 -22
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +0 -8
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +0 -74
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +0 -96
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +0 -23
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +0 -29
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +0 -34
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +0 -60
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +0 -20
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +0 -34
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +0 -25
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +0 -47
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +0 -18
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +0 -54
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +0 -34
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +0 -70
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +0 -32
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +0 -41
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +0 -37
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +0 -38
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +0 -27
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +0 -37
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +0 -32
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +0 -12
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +0 -28
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +0 -21
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +0 -23
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +0 -14
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +0 -17
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +0 -16
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +0 -19
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +0 -15
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +0 -68
- package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/noonDateLib.js +0 -164
- package/dist/node_modules/react-day-picker/dist/esm/noonDateLib.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +0 -58
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +0 -64
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +0 -45
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +0 -174
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +0 -114
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +0 -26
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +0 -57
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +0 -32
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +0 -96
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +0 -62
- package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +0 -63
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +0 -31
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +0 -75
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +0 -36
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +0 -22
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +0 -17
- package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js.map +0 -1
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +0 -67
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js.map +0 -1
- package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -29
- package/dist/node_modules/style-inject/dist/style-inject.es.js.map +0 -1
- package/dist/src/components/ui/accordion.d.ts +0 -7
- package/dist/src/components/ui/avatar.d.ts +0 -6
- package/dist/src/components/ui/badge.d.ts +0 -22
- package/dist/src/components/ui/button.d.ts +0 -13
- package/dist/src/components/ui/calendar.d.ts +0 -7
- package/dist/src/components/ui/card.d.ts +0 -9
- package/dist/src/components/ui/checkbox.d.ts +0 -4
- package/dist/src/components/ui/dialog.d.ts +0 -18
- package/dist/src/components/ui/icons.d.ts +0 -10
- package/dist/src/components/ui/input.d.ts +0 -3
- package/dist/src/components/ui/label.d.ts +0 -4
- package/dist/src/components/ui/popover.d.ts +0 -7
- package/dist/src/components/ui/separator.d.ts +0 -4
- package/dist/src/components/ui/skeleton.d.ts +0 -2
- package/dist/src/components/ui/switch.d.ts +0 -4
- package/dist/src/components/ui/table.d.ts +0 -10
- package/dist/src/components/ui/textarea.d.ts +0 -3
- package/dist/src/components/ui/tooltip.d.ts +0 -9
- package/dist/src/config.d.ts +0 -6
- package/dist/src/hooks/useClientProcess.d.ts +0 -69
- package/dist/src/index.d.ts +0 -21
- package/dist/src/utils.d.ts +0 -2
- package/dist/utilities/Icons.d.ts +0 -33
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.setup.d.ts +0 -1
- /package/dist/{src/components → components}/ui/button.test.d.ts +0 -0
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { useEffect, useMemo } from 'react';
|
|
2
|
-
import { getDates } from './helpers/getDates.js';
|
|
3
|
-
import { getDays } from './helpers/getDays.js';
|
|
4
|
-
import { getDisplayMonths } from './helpers/getDisplayMonths.js';
|
|
5
|
-
import { getInitialMonth } from './helpers/getInitialMonth.js';
|
|
6
|
-
import { getMonths } from './helpers/getMonths.js';
|
|
7
|
-
import { getNavMonths } from './helpers/getNavMonth.js';
|
|
8
|
-
import { getNextMonth } from './helpers/getNextMonth.js';
|
|
9
|
-
import { getPreviousMonth } from './helpers/getPreviousMonth.js';
|
|
10
|
-
import { getWeeks } from './helpers/getWeeks.js';
|
|
11
|
-
import { useControlledValue } from './helpers/useControlledValue.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Provides the calendar object to work with the calendar in custom components.
|
|
15
|
-
*
|
|
16
|
-
* @private
|
|
17
|
-
* @param props - The DayPicker props related to calendar configuration.
|
|
18
|
-
* @param dateLib - The date utility library instance.
|
|
19
|
-
* @returns The calendar object containing displayed days, weeks, months, and
|
|
20
|
-
* navigation methods.
|
|
21
|
-
*/
|
|
22
|
-
function useCalendar(props, dateLib) {
|
|
23
|
-
const [navStart, navEnd] = getNavMonths(props, dateLib);
|
|
24
|
-
const { startOfMonth, endOfMonth } = dateLib;
|
|
25
|
-
const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
26
|
-
const [firstMonth, setFirstMonth] = useControlledValue(initialMonth,
|
|
27
|
-
// initialMonth is always computed from props.month if provided
|
|
28
|
-
props.month ? initialMonth : undefined);
|
|
29
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: change the initial month when the time zone changes.
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);
|
|
32
|
-
setFirstMonth(newInitialMonth);
|
|
33
|
-
}, [props.timeZone]);
|
|
34
|
-
/** The months displayed in the calendar. */
|
|
35
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.
|
|
36
|
-
const { months, weeks, days, previousMonth, nextMonth } = useMemo(() => {
|
|
37
|
-
const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);
|
|
38
|
-
const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {
|
|
39
|
-
ISOWeek: props.ISOWeek,
|
|
40
|
-
fixedWeeks: props.fixedWeeks,
|
|
41
|
-
broadcastCalendar: props.broadcastCalendar,
|
|
42
|
-
}, dateLib);
|
|
43
|
-
const months = getMonths(displayMonths, dates, {
|
|
44
|
-
broadcastCalendar: props.broadcastCalendar,
|
|
45
|
-
fixedWeeks: props.fixedWeeks,
|
|
46
|
-
ISOWeek: props.ISOWeek,
|
|
47
|
-
reverseMonths: props.reverseMonths,
|
|
48
|
-
}, dateLib);
|
|
49
|
-
const weeks = getWeeks(months);
|
|
50
|
-
const days = getDays(months);
|
|
51
|
-
const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);
|
|
52
|
-
const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);
|
|
53
|
-
return {
|
|
54
|
-
months,
|
|
55
|
-
weeks,
|
|
56
|
-
days,
|
|
57
|
-
previousMonth,
|
|
58
|
-
nextMonth,
|
|
59
|
-
};
|
|
60
|
-
}, [
|
|
61
|
-
dateLib,
|
|
62
|
-
firstMonth.getTime(),
|
|
63
|
-
navEnd?.getTime(),
|
|
64
|
-
navStart?.getTime(),
|
|
65
|
-
props.disableNavigation,
|
|
66
|
-
props.broadcastCalendar,
|
|
67
|
-
props.endMonth?.getTime(),
|
|
68
|
-
props.fixedWeeks,
|
|
69
|
-
props.ISOWeek,
|
|
70
|
-
props.numberOfMonths,
|
|
71
|
-
props.pagedNavigation,
|
|
72
|
-
props.reverseMonths,
|
|
73
|
-
]);
|
|
74
|
-
const { disableNavigation, onMonthChange } = props;
|
|
75
|
-
const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));
|
|
76
|
-
const goToMonth = (date) => {
|
|
77
|
-
if (disableNavigation) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
let newMonth = startOfMonth(date);
|
|
81
|
-
// if month is before start, use the first month instead
|
|
82
|
-
if (navStart && newMonth < startOfMonth(navStart)) {
|
|
83
|
-
newMonth = startOfMonth(navStart);
|
|
84
|
-
}
|
|
85
|
-
// if month is after endMonth, use the last month instead
|
|
86
|
-
if (navEnd && newMonth > startOfMonth(navEnd)) {
|
|
87
|
-
newMonth = startOfMonth(navEnd);
|
|
88
|
-
}
|
|
89
|
-
setFirstMonth(newMonth);
|
|
90
|
-
onMonthChange?.(newMonth);
|
|
91
|
-
};
|
|
92
|
-
const goToDay = (day) => {
|
|
93
|
-
// is this check necessary?
|
|
94
|
-
if (isDayInCalendar(day)) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
goToMonth(day.date);
|
|
98
|
-
};
|
|
99
|
-
const calendar = {
|
|
100
|
-
months,
|
|
101
|
-
weeks,
|
|
102
|
-
days,
|
|
103
|
-
navStart,
|
|
104
|
-
navEnd,
|
|
105
|
-
previousMonth,
|
|
106
|
-
nextMonth,
|
|
107
|
-
goToMonth,
|
|
108
|
-
goToDay,
|
|
109
|
-
};
|
|
110
|
-
return calendar;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export { useCalendar };
|
|
114
|
-
//# sourceMappingURL=useCalendar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCalendar.js","sources":["../../../../../node_modules/react-day-picker/dist/esm/useCalendar.js"],"sourcesContent":["import { useEffect, useMemo } from \"react\";\nimport { getDates } from \"./helpers/getDates.js\";\nimport { getDays } from \"./helpers/getDays.js\";\nimport { getDisplayMonths } from \"./helpers/getDisplayMonths.js\";\nimport { getInitialMonth } from \"./helpers/getInitialMonth.js\";\nimport { getMonths } from \"./helpers/getMonths.js\";\nimport { getNavMonths } from \"./helpers/getNavMonth.js\";\nimport { getNextMonth } from \"./helpers/getNextMonth.js\";\nimport { getPreviousMonth } from \"./helpers/getPreviousMonth.js\";\nimport { getWeeks } from \"./helpers/getWeeks.js\";\nimport { useControlledValue } from \"./helpers/useControlledValue.js\";\n/**\n * Provides the calendar object to work with the calendar in custom components.\n *\n * @private\n * @param props - The DayPicker props related to calendar configuration.\n * @param dateLib - The date utility library instance.\n * @returns The calendar object containing displayed days, weeks, months, and\n * navigation methods.\n */\nexport function useCalendar(props, dateLib) {\n const [navStart, navEnd] = getNavMonths(props, dateLib);\n const { startOfMonth, endOfMonth } = dateLib;\n const initialMonth = getInitialMonth(props, navStart, navEnd, dateLib);\n const [firstMonth, setFirstMonth] = useControlledValue(initialMonth, \n // initialMonth is always computed from props.month if provided\n props.month ? initialMonth : undefined);\n // biome-ignore lint/correctness/useExhaustiveDependencies: change the initial month when the time zone changes.\n useEffect(() => {\n const newInitialMonth = getInitialMonth(props, navStart, navEnd, dateLib);\n setFirstMonth(newInitialMonth);\n }, [props.timeZone]);\n /** The months displayed in the calendar. */\n // biome-ignore lint/correctness/useExhaustiveDependencies: We want to recompute only when specific props change.\n const { months, weeks, days, previousMonth, nextMonth } = useMemo(() => {\n const displayMonths = getDisplayMonths(firstMonth, navEnd, { numberOfMonths: props.numberOfMonths }, dateLib);\n const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, {\n ISOWeek: props.ISOWeek,\n fixedWeeks: props.fixedWeeks,\n broadcastCalendar: props.broadcastCalendar,\n }, dateLib);\n const months = getMonths(displayMonths, dates, {\n broadcastCalendar: props.broadcastCalendar,\n fixedWeeks: props.fixedWeeks,\n ISOWeek: props.ISOWeek,\n reverseMonths: props.reverseMonths,\n }, dateLib);\n const weeks = getWeeks(months);\n const days = getDays(months);\n const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);\n const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);\n return {\n months,\n weeks,\n days,\n previousMonth,\n nextMonth,\n };\n }, [\n dateLib,\n firstMonth.getTime(),\n navEnd?.getTime(),\n navStart?.getTime(),\n props.disableNavigation,\n props.broadcastCalendar,\n props.endMonth?.getTime(),\n props.fixedWeeks,\n props.ISOWeek,\n props.numberOfMonths,\n props.pagedNavigation,\n props.reverseMonths,\n ]);\n const { disableNavigation, onMonthChange } = props;\n const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));\n const goToMonth = (date) => {\n if (disableNavigation) {\n return;\n }\n let newMonth = startOfMonth(date);\n // if month is before start, use the first month instead\n if (navStart && newMonth < startOfMonth(navStart)) {\n newMonth = startOfMonth(navStart);\n }\n // if month is after endMonth, use the last month instead\n if (navEnd && newMonth > startOfMonth(navEnd)) {\n newMonth = startOfMonth(navEnd);\n }\n setFirstMonth(newMonth);\n onMonthChange?.(newMonth);\n };\n const goToDay = (day) => {\n // is this check necessary?\n if (isDayInCalendar(day)) {\n return;\n }\n goToMonth(day.date);\n };\n const calendar = {\n months,\n weeks,\n days,\n navStart,\n navEnd,\n previousMonth,\n nextMonth,\n goToMonth,\n goToDay,\n };\n return calendar;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE;AAC5C,IAAI,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC;AAC3D,IAAI,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,OAAO;AAChD,IAAI,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;AAC1E,IAAI,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,kBAAkB,CAAC,YAAY;AACvE;AACA,IAAI,KAAK,CAAC,KAAK,GAAG,YAAY,GAAG,SAAS,CAAC;AAC3C;AACA,IAAI,SAAS,CAAC,MAAM;AACpB,QAAQ,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;AACjF,QAAQ,aAAa,CAAC,eAAe,CAAC;AACtC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACxB;AACA;AACA,IAAI,MAAM,EAAE,MAAM,EA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MAAM,OAAO,GAAG,CAAC,GAAG,KAAK;AAC7B;AACA,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE;AAClC,YAAY;AACZ,QAAQ;AACR,QAAQ,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC;AAC3B,IAAI,CAAC;AACL,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,MAAM;AACd,QAAQ,KAAK;AACb,QAAQ,IAAI;AACZ,QAAQ,QAAQ;AAChB,QAAQ,MAAM;AACd,QAAQ,aAAa;AACrB,QAAQ,SAAS;AACjB,QAAQ,SAAS;AACjB,QAAQ,OAAO;AACf,KAAK;AACL,IAAI,OAAO,QAAQ;AACnB;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
/** @ignore */
|
|
4
|
-
const dayPickerContext = createContext(undefined);
|
|
5
|
-
/**
|
|
6
|
-
* Provides access to the DayPicker context, which includes properties and
|
|
7
|
-
* methods to interact with the DayPicker component. This hook must be used
|
|
8
|
-
* within a custom component.
|
|
9
|
-
*
|
|
10
|
-
* @template T - Use this type to refine the returned context type with a
|
|
11
|
-
* specific selection mode.
|
|
12
|
-
* @returns The context to work with DayPicker.
|
|
13
|
-
* @throws {Error} If the hook is used outside of a DayPicker provider.
|
|
14
|
-
* @group Hooks
|
|
15
|
-
* @see https://daypicker.dev/guides/custom-components
|
|
16
|
-
*/
|
|
17
|
-
function useDayPicker() {
|
|
18
|
-
const context = useContext(dayPickerContext);
|
|
19
|
-
if (context === undefined) {
|
|
20
|
-
throw new Error("useDayPicker() must be used within a custom component.");
|
|
21
|
-
}
|
|
22
|
-
return context;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export { dayPickerContext, useDayPicker };
|
|
26
|
-
//# sourceMappingURL=useDayPicker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDayPicker.js","sources":["../../../../../node_modules/react-day-picker/dist/esm/useDayPicker.js"],"sourcesContent":["import { createContext, useContext } from \"react\";\n/** @ignore */\nexport const dayPickerContext = createContext(undefined);\n/**\n * Provides access to the DayPicker context, which includes properties and\n * methods to interact with the DayPicker component. This hook must be used\n * within a custom component.\n *\n * @template T - Use this type to refine the returned context type with a\n * specific selection mode.\n * @returns The context to work with DayPicker.\n * @throws {Error} If the hook is used outside of a DayPicker provider.\n * @group Hooks\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function useDayPicker() {\n const context = useContext(dayPickerContext);\n if (context === undefined) {\n throw new Error(\"useDayPicker() must be used within a custom component.\");\n }\n return context;\n}\n"],"names":[],"mappings":";;AACA;AACY,MAAC,gBAAgB,GAAG,aAAa,CAAC,SAAS;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,GAAG;AAC/B,IAAI,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC;AAChD,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE;AAC/B,QAAQ,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC;AACjF,IAAI;AACJ,IAAI,OAAO,OAAO;AAClB;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { calculateFocusTarget } from './helpers/calculateFocusTarget.js';
|
|
3
|
-
import { getNextFocus } from './helpers/getNextFocus.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Manages focus behavior for the DayPicker component, including setting,
|
|
7
|
-
* moving, and blurring focus on calendar days.
|
|
8
|
-
*
|
|
9
|
-
* @template T - The type of DayPicker props.
|
|
10
|
-
* @param props - The DayPicker props.
|
|
11
|
-
* @param calendar - The calendar object containing the displayed days and
|
|
12
|
-
* months.
|
|
13
|
-
* @param getModifiers - A function to retrieve modifiers for a given day.
|
|
14
|
-
* @param isSelected - A function to check if a date is selected.
|
|
15
|
-
* @param dateLib - The date utility library instance.
|
|
16
|
-
* @returns An object containing focus-related methods and the currently focused
|
|
17
|
-
* day.
|
|
18
|
-
*/
|
|
19
|
-
function useFocus(props, calendar, getModifiers, isSelected, dateLib) {
|
|
20
|
-
const { autoFocus } = props;
|
|
21
|
-
const [lastFocused, setLastFocused] = useState();
|
|
22
|
-
const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);
|
|
23
|
-
const [focusedDay, setFocused] = useState(autoFocus ? focusTarget : undefined);
|
|
24
|
-
const blur = () => {
|
|
25
|
-
setLastFocused(focusedDay);
|
|
26
|
-
setFocused(undefined);
|
|
27
|
-
};
|
|
28
|
-
const moveFocus = (moveBy, moveDir) => {
|
|
29
|
-
if (!focusedDay)
|
|
30
|
-
return;
|
|
31
|
-
const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);
|
|
32
|
-
if (!nextFocus)
|
|
33
|
-
return;
|
|
34
|
-
if (props.disableNavigation) {
|
|
35
|
-
const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));
|
|
36
|
-
if (!isNextInCalendar) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
calendar.goToDay(nextFocus);
|
|
41
|
-
setFocused(nextFocus);
|
|
42
|
-
};
|
|
43
|
-
const isFocusTarget = (day) => {
|
|
44
|
-
return Boolean(focusTarget?.isEqualTo(day));
|
|
45
|
-
};
|
|
46
|
-
const useFocus = {
|
|
47
|
-
isFocusTarget,
|
|
48
|
-
setFocused,
|
|
49
|
-
focused: focusedDay,
|
|
50
|
-
blur,
|
|
51
|
-
moveFocus,
|
|
52
|
-
};
|
|
53
|
-
return useFocus;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { useFocus };
|
|
57
|
-
//# sourceMappingURL=useFocus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFocus.js","sources":["../../../../../node_modules/react-day-picker/dist/esm/useFocus.js"],"sourcesContent":["import { useState } from \"react\";\nimport { calculateFocusTarget } from \"./helpers/calculateFocusTarget.js\";\nimport { getNextFocus } from \"./helpers/getNextFocus.js\";\n/**\n * Manages focus behavior for the DayPicker component, including setting,\n * moving, and blurring focus on calendar days.\n *\n * @template T - The type of DayPicker props.\n * @param props - The DayPicker props.\n * @param calendar - The calendar object containing the displayed days and\n * months.\n * @param getModifiers - A function to retrieve modifiers for a given day.\n * @param isSelected - A function to check if a date is selected.\n * @param dateLib - The date utility library instance.\n * @returns An object containing focus-related methods and the currently focused\n * day.\n */\nexport function useFocus(props, calendar, getModifiers, isSelected, dateLib) {\n const { autoFocus } = props;\n const [lastFocused, setLastFocused] = useState();\n const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);\n const [focusedDay, setFocused] = useState(autoFocus ? focusTarget : undefined);\n const blur = () => {\n setLastFocused(focusedDay);\n setFocused(undefined);\n };\n const moveFocus = (moveBy, moveDir) => {\n if (!focusedDay)\n return;\n const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);\n if (!nextFocus)\n return;\n if (props.disableNavigation) {\n const isNextInCalendar = calendar.days.some((day) => day.isEqualTo(nextFocus));\n if (!isNextInCalendar) {\n return;\n }\n }\n calendar.goToDay(nextFocus);\n setFocused(nextFocus);\n };\n const isFocusTarget = (day) => {\n return Boolean(focusTarget?.isEqualTo(day));\n };\n const useFocus = {\n isFocusTarget,\n setFocused,\n focused: focusedDay,\n blur,\n moveFocus,\n };\n return useFocus;\n}\n"],"names":[],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE;AAC7E,IAAI,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK;AAC/B,IAA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,MAAM,QAAQ,GAAG;AACrB,QAAQ,aAAa;AACrB,QAAQ,UAAU;AAClB,QAAQ,OAAO,EAAE,UAAU;AAC3B,QAAQ,IAAI;AACZ,QAAQ,SAAS;AACjB,KAAK;AACL,IAAI,OAAO,QAAQ;AACnB;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useMulti } from './selection/useMulti.js';
|
|
2
|
-
import { useRange } from './selection/useRange.js';
|
|
3
|
-
import { useSingle } from './selection/useSingle.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Determines the appropriate selection hook to use based on the selection mode
|
|
7
|
-
* and returns the corresponding selection object.
|
|
8
|
-
*
|
|
9
|
-
* @template T - The type of DayPicker props.
|
|
10
|
-
* @param props - The DayPicker props.
|
|
11
|
-
* @param dateLib - The date utility library instance.
|
|
12
|
-
* @returns The selection object for the specified mode, or `undefined` if no
|
|
13
|
-
* mode is set.
|
|
14
|
-
*/
|
|
15
|
-
function useSelection(props, dateLib) {
|
|
16
|
-
const single = useSingle(props, dateLib);
|
|
17
|
-
const multi = useMulti(props, dateLib);
|
|
18
|
-
const range = useRange(props, dateLib);
|
|
19
|
-
switch (props.mode) {
|
|
20
|
-
case "single":
|
|
21
|
-
return single;
|
|
22
|
-
case "multiple":
|
|
23
|
-
return multi;
|
|
24
|
-
case "range":
|
|
25
|
-
return range;
|
|
26
|
-
default:
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { useSelection };
|
|
32
|
-
//# sourceMappingURL=useSelection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSelection.js","sources":["../../../../../node_modules/react-day-picker/dist/esm/useSelection.js"],"sourcesContent":["import { useMulti } from \"./selection/useMulti.js\";\nimport { useRange } from \"./selection/useRange.js\";\nimport { useSingle } from \"./selection/useSingle.js\";\n/**\n * Determines the appropriate selection hook to use based on the selection mode\n * and returns the corresponding selection object.\n *\n * @template T - The type of DayPicker props.\n * @param props - The DayPicker props.\n * @param dateLib - The date utility library instance.\n * @returns The selection object for the specified mode, or `undefined` if no\n * mode is set.\n */\nexport function useSelection(props, dateLib) {\n const single = useSingle(props, dateLib);\n const multi = useMulti(props, dateLib);\n const range = useRange(props, dateLib);\n switch (props.mode) {\n case \"single\":\n return single;\n case \"multiple\":\n return multi;\n case \"range\":\n return range;\n default:\n return undefined;\n }\n}\n"],"names":[],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC;AAC5C,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;AAC1C,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;AAC1C,IAAI,QAAQ,KAAK,CAAC,IAAI;AACtB,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAO,MAAM;AACzB,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,KAAK;AACxB,QAAQ,KAAK,OAAO;AACpB,YAAY,OAAO,KAAK;AACxB,QAAQ;AACR,YAAY,OAAO,SAAS;AAC5B;AACA;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { defaultDateLib } from '../classes/DateLib.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Adds a date to an existing range, considering constraints like minimum and
|
|
5
|
-
* maximum range size.
|
|
6
|
-
*
|
|
7
|
-
* @param date - The date to add to the range.
|
|
8
|
-
* @param initialRange - The initial range to which the date will be added.
|
|
9
|
-
* @param min - The minimum number of days in the range.
|
|
10
|
-
* @param max - The maximum number of days in the range.
|
|
11
|
-
* @param required - Whether the range must always include at least one date.
|
|
12
|
-
* @param dateLib - The date utility library instance.
|
|
13
|
-
* @returns The updated date range, or `undefined` if the range is cleared.
|
|
14
|
-
* @group Utilities
|
|
15
|
-
*/
|
|
16
|
-
function addToRange(date, initialRange, min = 0, max = 0, required = false, dateLib = defaultDateLib) {
|
|
17
|
-
const { from, to } = initialRange || {};
|
|
18
|
-
const { isSameDay, isAfter, isBefore } = dateLib;
|
|
19
|
-
let range;
|
|
20
|
-
if (!from && !to) {
|
|
21
|
-
// the range is empty, add the date
|
|
22
|
-
range = { from: date, to: min > 0 ? undefined : date };
|
|
23
|
-
}
|
|
24
|
-
else if (from && !to) {
|
|
25
|
-
// adding date to an incomplete range
|
|
26
|
-
if (isSameDay(from, date)) {
|
|
27
|
-
// adding a date equal to the start of the range
|
|
28
|
-
if (min === 0) {
|
|
29
|
-
range = { from, to: date };
|
|
30
|
-
}
|
|
31
|
-
else if (required) {
|
|
32
|
-
range = { from, to: undefined };
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
range = undefined;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
else if (isBefore(date, from)) {
|
|
39
|
-
// adding a date before the start of the range
|
|
40
|
-
range = { from: date, to: from };
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
// adding a date after the start of the range
|
|
44
|
-
range = { from, to: date };
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
else if (from && to) {
|
|
48
|
-
// adding date to a complete range
|
|
49
|
-
if (isSameDay(from, date) && isSameDay(to, date)) {
|
|
50
|
-
// adding a date that is equal to both start and end of the range
|
|
51
|
-
if (required) {
|
|
52
|
-
range = { from, to };
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
range = undefined;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else if (isSameDay(from, date)) {
|
|
59
|
-
// adding a date equal to the the start of the range
|
|
60
|
-
range = { from, to: min > 0 ? undefined : date };
|
|
61
|
-
}
|
|
62
|
-
else if (isSameDay(to, date)) {
|
|
63
|
-
// adding a dare equal to the end of the range
|
|
64
|
-
range = { from: date, to: min > 0 ? undefined : date };
|
|
65
|
-
}
|
|
66
|
-
else if (isBefore(date, from)) {
|
|
67
|
-
// adding a date before the start of the range
|
|
68
|
-
range = { from: date, to: to };
|
|
69
|
-
}
|
|
70
|
-
else if (isAfter(date, from)) {
|
|
71
|
-
// adding a date after the start of the range
|
|
72
|
-
range = { from, to: date };
|
|
73
|
-
}
|
|
74
|
-
else if (isAfter(date, to)) {
|
|
75
|
-
// adding a date after the end of the range
|
|
76
|
-
range = { from, to: date };
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
throw new Error("Invalid range");
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
// check for min / max
|
|
83
|
-
if (range?.from && range?.to) {
|
|
84
|
-
const diff = dateLib.differenceInCalendarDays(range.to, range.from);
|
|
85
|
-
if (max > 0 && diff > max) {
|
|
86
|
-
range = { from: date, to: undefined };
|
|
87
|
-
}
|
|
88
|
-
else if (min > 1 && diff < min) {
|
|
89
|
-
range = { from: date, to: undefined };
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return range;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export { addToRange };
|
|
96
|
-
//# sourceMappingURL=addToRange.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addToRange.js","sources":["../../../../../../node_modules/react-day-picker/dist/esm/utils/addToRange.js"],"sourcesContent":["import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Adds a date to an existing range, considering constraints like minimum and\n * maximum range size.\n *\n * @param date - The date to add to the range.\n * @param initialRange - The initial range to which the date will be added.\n * @param min - The minimum number of days in the range.\n * @param max - The maximum number of days in the range.\n * @param required - Whether the range must always include at least one date.\n * @param dateLib - The date utility library instance.\n * @returns The updated date range, or `undefined` if the range is cleared.\n * @group Utilities\n */\nexport function addToRange(date, initialRange, min = 0, max = 0, required = false, dateLib = defaultDateLib) {\n const { from, to } = initialRange || {};\n const { isSameDay, isAfter, isBefore } = dateLib;\n let range;\n if (!from && !to) {\n // the range is empty, add the date\n range = { from: date, to: min > 0 ? undefined : date };\n }\n else if (from && !to) {\n // adding date to an incomplete range\n if (isSameDay(from, date)) {\n // adding a date equal to the start of the range\n if (min === 0) {\n range = { from, to: date };\n }\n else if (required) {\n range = { from, to: undefined };\n }\n else {\n range = undefined;\n }\n }\n else if (isBefore(date, from)) {\n // adding a date before the start of the range\n range = { from: date, to: from };\n }\n else {\n // adding a date after the start of the range\n range = { from, to: date };\n }\n }\n else if (from && to) {\n // adding date to a complete range\n if (isSameDay(from, date) && isSameDay(to, date)) {\n // adding a date that is equal to both start and end of the range\n if (required) {\n range = { from, to };\n }\n else {\n range = undefined;\n }\n }\n else if (isSameDay(from, date)) {\n // adding a date equal to the the start of the range\n range = { from, to: min > 0 ? undefined : date };\n }\n else if (isSameDay(to, date)) {\n // adding a dare equal to the end of the range\n range = { from: date, to: min > 0 ? undefined : date };\n }\n else if (isBefore(date, from)) {\n // adding a date before the start of the range\n range = { from: date, to: to };\n }\n else if (isAfter(date, from)) {\n // adding a date after the start of the range\n range = { from, to: date };\n }\n else if (isAfter(date, to)) {\n // adding a date after the end of the range\n range = { from, to: date };\n }\n else {\n throw new Error(\"Invalid range\");\n }\n }\n // check for min / max\n if (range?.from && range?.to) {\n const diff = dateLib.differenceInCalendarDays(range.to, range.from);\n if (max > 0 && diff > max) {\n range = { from: date, to: undefined };\n }\n else if (min > 1 && diff < min) {\n range = { from: date, to: undefined };\n }\n }\n return range;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,GAAG,cAAc,EAAE;AAC7G,IAAI,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,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AG,GAAG,EAAE;AACnC,YAAY,KAAK,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE;AACjD,QAAQ;AACR,aAAa,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,GAAG,EAAE;AACxC,YAAY,KAAK,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE;AACjD,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import '../../../../@date-fns/tz/date/mini.js';
|
|
2
|
-
import { toTimeZone } from './toTimeZone.js';
|
|
3
|
-
import { isDateRange, isDateInterval, isDateAfterType, isDateBeforeType } from './typeguards.js';
|
|
4
|
-
|
|
5
|
-
function toZoneNoon(date, timeZone, noonSafe) {
|
|
6
|
-
return toTimeZone(date, timeZone);
|
|
7
|
-
}
|
|
8
|
-
function convertMatcher(matcher, timeZone, noonSafe) {
|
|
9
|
-
if (typeof matcher === "boolean" || typeof matcher === "function") {
|
|
10
|
-
return matcher;
|
|
11
|
-
}
|
|
12
|
-
if (matcher instanceof Date) {
|
|
13
|
-
return toZoneNoon(matcher, timeZone);
|
|
14
|
-
}
|
|
15
|
-
if (Array.isArray(matcher)) {
|
|
16
|
-
return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone) : value);
|
|
17
|
-
}
|
|
18
|
-
if (isDateRange(matcher)) {
|
|
19
|
-
return {
|
|
20
|
-
...matcher,
|
|
21
|
-
from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,
|
|
22
|
-
to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
if (isDateInterval(matcher)) {
|
|
26
|
-
return {
|
|
27
|
-
before: toZoneNoon(matcher.before, timeZone),
|
|
28
|
-
after: toZoneNoon(matcher.after, timeZone),
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
if (isDateAfterType(matcher)) {
|
|
32
|
-
return {
|
|
33
|
-
after: toZoneNoon(matcher.after, timeZone),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
if (isDateBeforeType(matcher)) {
|
|
37
|
-
return {
|
|
38
|
-
before: toZoneNoon(matcher.before, timeZone),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return matcher;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Convert any {@link Matcher} or array of matchers to the specified time zone.
|
|
45
|
-
*
|
|
46
|
-
* @param matchers - The matcher or matchers to convert.
|
|
47
|
-
* @param timeZone - The target IANA time zone.
|
|
48
|
-
* @returns The converted matcher(s).
|
|
49
|
-
* @group Utilities
|
|
50
|
-
*/
|
|
51
|
-
function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {
|
|
52
|
-
if (!matchers) {
|
|
53
|
-
return matchers;
|
|
54
|
-
}
|
|
55
|
-
if (Array.isArray(matchers)) {
|
|
56
|
-
return matchers.map((matcher) => convertMatcher(matcher, timeZone));
|
|
57
|
-
}
|
|
58
|
-
return convertMatcher(matchers, timeZone);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { convertMatchersToTimeZone };
|
|
62
|
-
//# sourceMappingURL=convertMatchersToTimeZone.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convertMatchersToTimeZone.js","sources":["../../../../../../node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js"],"sourcesContent":["import { TZDate } from \"@date-fns/tz\";\nimport { toTimeZone } from \"./toTimeZone.js\";\nimport { isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, } from \"./typeguards.js\";\nfunction toZoneNoon(date, timeZone, noonSafe) {\n if (!noonSafe)\n return toTimeZone(date, timeZone);\n const zoned = toTimeZone(date, timeZone);\n const noonZoned = new TZDate(zoned.getFullYear(), zoned.getMonth(), zoned.getDate(), 12, 0, 0, timeZone);\n return new Date(noonZoned.getTime());\n}\nfunction convertMatcher(matcher, timeZone, noonSafe) {\n if (typeof matcher === \"boolean\" || typeof matcher === \"function\") {\n return matcher;\n }\n if (matcher instanceof Date) {\n return toZoneNoon(matcher, timeZone, noonSafe);\n }\n if (Array.isArray(matcher)) {\n return matcher.map((value) => value instanceof Date ? toZoneNoon(value, timeZone, noonSafe) : value);\n }\n if (isDateRange(matcher)) {\n return {\n ...matcher,\n from: matcher.from ? toTimeZone(matcher.from, timeZone) : matcher.from,\n to: matcher.to ? toTimeZone(matcher.to, timeZone) : matcher.to,\n };\n }\n if (isDateInterval(matcher)) {\n return {\n before: toZoneNoon(matcher.before, timeZone, noonSafe),\n after: toZoneNoon(matcher.after, timeZone, noonSafe),\n };\n }\n if (isDateAfterType(matcher)) {\n return {\n after: toZoneNoon(matcher.after, timeZone, noonSafe),\n };\n }\n if (isDateBeforeType(matcher)) {\n return {\n before: toZoneNoon(matcher.before, timeZone, noonSafe),\n };\n }\n return matcher;\n}\n/**\n * Convert any {@link Matcher} or array of matchers to the specified time zone.\n *\n * @param matchers - The matcher or matchers to convert.\n * @param timeZone - The target IANA time zone.\n * @returns The converted matcher(s).\n * @group Utilities\n */\nexport function convertMatchersToTimeZone(matchers, timeZone, noonSafe) {\n if (!matchers) {\n return matchers;\n }\n if (Array.isArray(matchers)) {\n return matchers.map((matcher) => convertMatcher(matcher, timeZone, noonSafe));\n }\n return convertMatcher(matchers, timeZone, noonSafe);\n}\n"],"names":[],"mappings":";;;;AAGA,SAAS,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE;AAC9C,IACQ,OAAO,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC;AAIzC;AACA,SAAS,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACrD,IAAI,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AACvE,QAAQ,OAAO,OAAO;AAC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;AAClE,SAAS;AACT,IAAI;AACJ,IAAI,OAAO,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE;AACxE,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;AACjC,QAAQ,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,cAAc,CAAC,OAAO,EAAE,QAAkB,CAAC,CAAC;AACrF,IAAI;AACJ,IAAI,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAkB,CAAC;AACvD;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { defaultDateLib } from '../classes/DateLib.js';
|
|
2
|
-
import { rangeIncludesDate } from './rangeIncludesDate.js';
|
|
3
|
-
import { isDatesArray, isDateRange, isDayOfWeekType, isDateInterval, isDateAfterType, isDateBeforeType } from './typeguards.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Checks if a given date matches at least one of the specified {@link Matcher}.
|
|
7
|
-
*
|
|
8
|
-
* @param date - The date to check.
|
|
9
|
-
* @param matchers - The matchers to check against.
|
|
10
|
-
* @param dateLib - The date utility library instance.
|
|
11
|
-
* @returns `true` if the date matches any of the matchers, otherwise `false`.
|
|
12
|
-
* @group Utilities
|
|
13
|
-
*/
|
|
14
|
-
function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {
|
|
15
|
-
const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;
|
|
16
|
-
const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;
|
|
17
|
-
return matchersArr.some((matcher) => {
|
|
18
|
-
if (typeof matcher === "boolean") {
|
|
19
|
-
return matcher;
|
|
20
|
-
}
|
|
21
|
-
if (dateLib.isDate(matcher)) {
|
|
22
|
-
return isSameDay(date, matcher);
|
|
23
|
-
}
|
|
24
|
-
if (isDatesArray(matcher, dateLib)) {
|
|
25
|
-
return matcher.some((matcherDate) => isSameDay(date, matcherDate));
|
|
26
|
-
}
|
|
27
|
-
if (isDateRange(matcher)) {
|
|
28
|
-
return rangeIncludesDate(matcher, date, false, dateLib);
|
|
29
|
-
}
|
|
30
|
-
if (isDayOfWeekType(matcher)) {
|
|
31
|
-
if (!Array.isArray(matcher.dayOfWeek)) {
|
|
32
|
-
return matcher.dayOfWeek === date.getDay();
|
|
33
|
-
}
|
|
34
|
-
return matcher.dayOfWeek.includes(date.getDay());
|
|
35
|
-
}
|
|
36
|
-
if (isDateInterval(matcher)) {
|
|
37
|
-
const diffBefore = differenceInCalendarDays(matcher.before, date);
|
|
38
|
-
const diffAfter = differenceInCalendarDays(matcher.after, date);
|
|
39
|
-
const isDayBefore = diffBefore > 0;
|
|
40
|
-
const isDayAfter = diffAfter < 0;
|
|
41
|
-
const isClosedInterval = isAfter(matcher.before, matcher.after);
|
|
42
|
-
if (isClosedInterval) {
|
|
43
|
-
return isDayAfter && isDayBefore;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return isDayBefore || isDayAfter;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (isDateAfterType(matcher)) {
|
|
50
|
-
return differenceInCalendarDays(date, matcher.after) > 0;
|
|
51
|
-
}
|
|
52
|
-
if (isDateBeforeType(matcher)) {
|
|
53
|
-
return differenceInCalendarDays(matcher.before, date) > 0;
|
|
54
|
-
}
|
|
55
|
-
if (typeof matcher === "function") {
|
|
56
|
-
return matcher(date);
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { dateMatchModifiers };
|
|
63
|
-
//# sourceMappingURL=dateMatchModifiers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dateMatchModifiers.js","sources":["../../../../../../node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js"],"sourcesContent":["import { defaultDateLib } from \"../classes/DateLib.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\nimport { isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDatesArray, isDayOfWeekType, } from \"./typeguards.js\";\n/**\n * Checks if a given date matches at least one of the specified {@link Matcher}.\n *\n * @param date - The date to check.\n * @param matchers - The matchers to check against.\n * @param dateLib - The date utility library instance.\n * @returns `true` if the date matches any of the matchers, otherwise `false`.\n * @group Utilities\n */\nexport function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {\n const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;\n const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;\n return matchersArr.some((matcher) => {\n if (typeof matcher === \"boolean\") {\n return matcher;\n }\n if (dateLib.isDate(matcher)) {\n return isSameDay(date, matcher);\n }\n if (isDatesArray(matcher, dateLib)) {\n return matcher.some((matcherDate) => isSameDay(date, matcherDate));\n }\n if (isDateRange(matcher)) {\n return rangeIncludesDate(matcher, date, false, dateLib);\n }\n if (isDayOfWeekType(matcher)) {\n if (!Array.isArray(matcher.dayOfWeek)) {\n return matcher.dayOfWeek === date.getDay();\n }\n return matcher.dayOfWeek.includes(date.getDay());\n }\n if (isDateInterval(matcher)) {\n const diffBefore = differenceInCalendarDays(matcher.before, date);\n const diffAfter = differenceInCalendarDays(matcher.after, date);\n const isDayBefore = diffBefore > 0;\n const isDayAfter = diffAfter < 0;\n const isClosedInterval = isAfter(matcher.before, matcher.after);\n if (isClosedInterval) {\n return isDayAfter && isDayBefore;\n }\n else {\n return isDayBefore || isDayAfter;\n }\n }\n if (isDateAfterType(matcher)) {\n return differenceInCalendarDays(date, matcher.after) > 0;\n }\n if (isDateBeforeType(matcher)) {\n return differenceInCalendarDays(matcher.before, date) > 0;\n }\n if (typeof matcher === \"function\") {\n return matcher(date);\n }\n return false;\n });\n}\n"],"names":[],"mappings":";;;;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AAc,CAAC,OAAO,CAAC,EAAE;AACrC,YAAY,MAAM,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;AAC7E,YAAY,MAAM,SAAS,GAAG,wBAAwB,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;AAC3E,YAAY,MAAM,WAAW,GAAG,UAAU,GAAG,CAAC;AAC9C,YAAY,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC;AAC5C,YAAY,MAAM,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC;AAC3E,YAAY,IAAI,gBAAgB,EAAE;AAClC,gBAAgB,OAAO,UAAU,IAAI,WAAW;AAChD,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,OAAO,WAAW,IAAI,UAAU;AAChD,YAAY;AACZ,QAAQ;AACR,QAAQ,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE;AACtC,YAAY,OAAO,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;AACpE,QAAQ;AACR,QAAQ,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE;AACvC,YAAY,OAAO,wBAAwB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC;AACrE,QAAQ;AACR,QAAQ,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AAC3C,YAAY,OAAO,OAAO,CAAC,IAAI,CAAC;AAChC,QAAQ;AACR,QAAQ,OAAO,KAAK;AACpB,IAAI,CAAC,CAAC;AACN;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defaultDateLib } from '../classes/DateLib.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Checks if a date range contains one or more specified days of the week.
|
|
5
|
-
*
|
|
6
|
-
* @since 9.2.2
|
|
7
|
-
* @param range - The date range to check.
|
|
8
|
-
* @param dayOfWeek - The day(s) of the week to check for (`0-6`, where `0` is
|
|
9
|
-
* Sunday).
|
|
10
|
-
* @param dateLib - The date utility library instance.
|
|
11
|
-
* @returns `true` if the range contains the specified day(s) of the week,
|
|
12
|
-
* otherwise `false`.
|
|
13
|
-
* @group Utilities
|
|
14
|
-
*/
|
|
15
|
-
function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = defaultDateLib) {
|
|
16
|
-
const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;
|
|
17
|
-
let date = range.from;
|
|
18
|
-
const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
|
|
19
|
-
// iterate at maximum one week or the total days if the range is shorter than one week
|
|
20
|
-
const totalDaysLimit = Math.min(totalDays, 6);
|
|
21
|
-
for (let i = 0; i <= totalDaysLimit; i++) {
|
|
22
|
-
if (dayOfWeekArr.includes(date.getDay())) {
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
date = dateLib.addDays(date, 1);
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { rangeContainsDayOfWeek };
|
|
31
|
-
//# sourceMappingURL=rangeContainsDayOfWeek.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rangeContainsDayOfWeek.js","sources":["../../../../../../node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js"],"sourcesContent":["import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Checks if a date range contains one or more specified days of the week.\n *\n * @since 9.2.2\n * @param range - The date range to check.\n * @param dayOfWeek - The day(s) of the week to check for (`0-6`, where `0` is\n * Sunday).\n * @param dateLib - The date utility library instance.\n * @returns `true` if the range contains the specified day(s) of the week,\n * otherwise `false`.\n * @group Utilities\n */\nexport function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = defaultDateLib) {\n const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;\n let date = range.from;\n const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);\n // iterate at maximum one week or the total days if the range is shorter than one week\n const totalDaysLimit = Math.min(totalDays, 6);\n for (let i = 0; i <= totalDaysLimit; i++) {\n if (dayOfWeekArr.includes(date.getDay())) {\n return true;\n }\n date = dateLib.addDays(date, 1);\n }\n return false;\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,GAAG,cAAc,EAAE;AACnF,IAAI,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,SAAS;AAC5E,IAAI,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI;AACzB,IAAI,MAAM,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC;AAC5E;AACA,IAAI,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;AACjD,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,cAAc,EAAE,CAAC,EAAE,EAAE;AAC9C,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE;AAClD,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,QAAQ,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AACvC,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { defaultDateLib } from '../classes/DateLib.js';
|
|
2
|
-
import { dateMatchModifiers } from './dateMatchModifiers.js';
|
|
3
|
-
import { rangeContainsDayOfWeek } from './rangeContainsDayOfWeek.js';
|
|
4
|
-
import { rangeIncludesDate } from './rangeIncludesDate.js';
|
|
5
|
-
import { rangeOverlaps } from './rangeOverlaps.js';
|
|
6
|
-
import { isDatesArray, isDateRange, isDayOfWeekType, isDateInterval, isDateAfterType, isDateBeforeType } from './typeguards.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Checks if a date range contains dates that match the given modifiers.
|
|
10
|
-
*
|
|
11
|
-
* @since 9.2.2
|
|
12
|
-
* @param range - The date range to check.
|
|
13
|
-
* @param modifiers - The modifiers to match against.
|
|
14
|
-
* @param dateLib - The date utility library instance.
|
|
15
|
-
* @returns `true` if the range contains matching dates, otherwise `false`.
|
|
16
|
-
* @group Utilities
|
|
17
|
-
*/
|
|
18
|
-
function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {
|
|
19
|
-
const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];
|
|
20
|
-
// Defer function matchers evaluation as they are the least performant.
|
|
21
|
-
const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== "function");
|
|
22
|
-
const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {
|
|
23
|
-
if (typeof matcher === "boolean")
|
|
24
|
-
return matcher;
|
|
25
|
-
if (dateLib.isDate(matcher)) {
|
|
26
|
-
return rangeIncludesDate(range, matcher, false, dateLib);
|
|
27
|
-
}
|
|
28
|
-
if (isDatesArray(matcher, dateLib)) {
|
|
29
|
-
return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));
|
|
30
|
-
}
|
|
31
|
-
if (isDateRange(matcher)) {
|
|
32
|
-
if (matcher.from && matcher.to) {
|
|
33
|
-
return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);
|
|
34
|
-
}
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
if (isDayOfWeekType(matcher)) {
|
|
38
|
-
return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);
|
|
39
|
-
}
|
|
40
|
-
if (isDateInterval(matcher)) {
|
|
41
|
-
const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);
|
|
42
|
-
if (isClosedInterval) {
|
|
43
|
-
return rangeOverlaps(range, {
|
|
44
|
-
from: dateLib.addDays(matcher.after, 1),
|
|
45
|
-
to: dateLib.addDays(matcher.before, -1),
|
|
46
|
-
}, dateLib);
|
|
47
|
-
}
|
|
48
|
-
return (dateMatchModifiers(range.from, matcher, dateLib) ||
|
|
49
|
-
dateMatchModifiers(range.to, matcher, dateLib));
|
|
50
|
-
}
|
|
51
|
-
if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {
|
|
52
|
-
return (dateMatchModifiers(range.from, matcher, dateLib) ||
|
|
53
|
-
dateMatchModifiers(range.to, matcher, dateLib));
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
});
|
|
57
|
-
if (nonFunctionMatchersResult) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
const functionMatchers = matchers.filter((matcher) => typeof matcher === "function");
|
|
61
|
-
if (functionMatchers.length) {
|
|
62
|
-
let date = range.from;
|
|
63
|
-
const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);
|
|
64
|
-
for (let i = 0; i <= totalDays; i++) {
|
|
65
|
-
if (functionMatchers.some((matcher) => matcher(date))) {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
date = dateLib.addDays(date, 1);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return false;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export { rangeContainsModifiers };
|
|
75
|
-
//# sourceMappingURL=rangeContainsModifiers.js.map
|