@timmbr/ui 1.17.7 → 1.18.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.
Files changed (196) hide show
  1. package/dist/components/Calendar/Calendar.d.ts +4 -0
  2. package/dist/components/Calendar/Calendar.d.ts.map +1 -0
  3. package/dist/components/Calendar/Calendar.helpers.d.ts +31 -0
  4. package/dist/components/Calendar/Calendar.helpers.d.ts.map +1 -0
  5. package/dist/components/Calendar/Calendar.helpers.js +153 -0
  6. package/dist/components/Calendar/Calendar.js +188 -0
  7. package/dist/components/Calendar/Calendar.styles.d.ts +7 -0
  8. package/dist/components/Calendar/Calendar.styles.d.ts.map +1 -0
  9. package/dist/components/Calendar/Calendar.styles.js +15 -0
  10. package/dist/components/Calendar/Calendar.types.d.ts +83 -0
  11. package/dist/components/Calendar/Calendar.types.d.ts.map +1 -0
  12. package/dist/components/Calendar/index.d.ts +5 -0
  13. package/dist/components/Calendar/index.d.ts.map +1 -0
  14. package/dist/components/Calendar/subcomponents/CalendarMonthYearPickers.d.ts +21 -0
  15. package/dist/components/Calendar/subcomponents/CalendarMonthYearPickers.d.ts.map +1 -0
  16. package/dist/components/Calendar/subcomponents/CalendarMonthYearPickers.js +185 -0
  17. package/dist/components/DatePicker/DatePicker.d.ts +4 -0
  18. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
  19. package/dist/components/DatePicker/DatePicker.helpers.d.ts +8 -0
  20. package/dist/components/DatePicker/DatePicker.helpers.d.ts.map +1 -0
  21. package/dist/components/DatePicker/DatePicker.helpers.js +52 -0
  22. package/dist/components/DatePicker/DatePicker.js +236 -0
  23. package/dist/components/DatePicker/DatePicker.styles.d.ts +4 -0
  24. package/dist/components/DatePicker/DatePicker.styles.d.ts.map +1 -0
  25. package/dist/components/DatePicker/DatePicker.styles.js +15 -0
  26. package/dist/components/DatePicker/DatePicker.types.d.ts +67 -0
  27. package/dist/components/DatePicker/DatePicker.types.d.ts.map +1 -0
  28. package/dist/components/DatePicker/index.d.ts +5 -0
  29. package/dist/components/DatePicker/index.d.ts.map +1 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +6 -0
  33. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/date/index.js +83 -0
  34. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/date/mini.js +450 -0
  35. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/tzName/index.js +39 -0
  36. package/dist/node_modules/.pnpm/@date-fns_tz@1.5.0/node_modules/@date-fns/tz/tzOffset/index.js +56 -0
  37. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  38. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  39. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.js +775 -0
  40. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.js +94 -0
  41. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.js +66 -0
  42. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +31 -0
  43. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  44. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
  45. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.js +25 -0
  46. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addDays.js +60 -0
  47. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addMonths.js +75 -0
  48. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addWeeks.js +33 -0
  49. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/addYears.js +33 -0
  50. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js +46 -0
  51. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js +49 -0
  52. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.js +62 -0
  53. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarMonths.js +42 -0
  54. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/eachMonthOfInterval.js +65 -0
  55. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/eachYearOfInterval.js +65 -0
  56. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfISOWeek.js +35 -0
  57. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfMonth.js +37 -0
  58. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfWeek.js +53 -0
  59. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/endOfYear.js +37 -0
  60. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.js +423 -0
  61. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.js +34 -0
  62. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDaysInMonth.js +36 -0
  63. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.js +40 -0
  64. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.js +52 -0
  65. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getMonth.js +29 -0
  66. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.js +54 -0
  67. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.js +75 -0
  68. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getYear.js +29 -0
  69. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isAfter.js +25 -0
  70. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isBefore.js +25 -0
  71. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.js +41 -0
  72. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isSameDay.js +46 -0
  73. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isSameMonth.js +43 -0
  74. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isSameYear.js +35 -0
  75. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.js +39 -0
  76. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +10 -0
  77. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +64 -0
  78. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +59 -0
  79. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +22 -0
  80. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +103 -0
  81. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +41 -0
  82. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +13 -0
  83. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.js +189 -0
  84. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.js +134 -0
  85. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.js +28 -0
  86. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/max.js +49 -0
  87. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/min.js +49 -0
  88. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/setMonth.js +46 -0
  89. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/setYear.js +40 -0
  90. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.js +35 -0
  91. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.js +35 -0
  92. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.js +42 -0
  93. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfMonth.js +37 -0
  94. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.js +53 -0
  95. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.js +64 -0
  96. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.js +36 -0
  97. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js +46 -0
  98. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/DayPicker.js +346 -0
  99. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/UI.js +122 -0
  100. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +33 -0
  101. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +14 -0
  102. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +13 -0
  103. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/classes/DateLib.js +599 -0
  104. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +13 -0
  105. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -0
  106. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Day.js +18 -0
  107. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/DayButton.js +19 -0
  108. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Dropdown.js +23 -0
  109. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +13 -0
  110. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Footer.js +13 -0
  111. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Month.js +15 -0
  112. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +14 -0
  113. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +13 -0
  114. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Months.js +13 -0
  115. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +15 -0
  116. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Nav.js +31 -0
  117. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +13 -0
  118. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Option.js +13 -0
  119. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +13 -0
  120. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Root.js +14 -0
  121. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Select.js +13 -0
  122. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Week.js +14 -0
  123. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +14 -0
  124. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +13 -0
  125. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Weekday.js +13 -0
  126. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Weekdays.js +14 -0
  127. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/Weeks.js +13 -0
  128. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +15 -0
  129. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/components/custom-components.js +25 -0
  130. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +20 -0
  131. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +19 -0
  132. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +18 -0
  133. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +21 -0
  134. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +13 -0
  135. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +19 -0
  136. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +17 -0
  137. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/formatters/index.js +7 -0
  138. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +73 -0
  139. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +95 -0
  140. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +22 -0
  141. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +28 -0
  142. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +33 -0
  143. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +20 -0
  144. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +27 -0
  145. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDates.js +59 -0
  146. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDays.js +19 -0
  147. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +33 -0
  148. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +24 -0
  149. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +46 -0
  150. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +17 -0
  151. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +27 -0
  152. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +53 -0
  153. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +33 -0
  154. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +69 -0
  155. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +31 -0
  156. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +40 -0
  157. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +36 -0
  158. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +37 -0
  159. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +27 -0
  160. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +26 -0
  161. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +14 -0
  162. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +36 -0
  163. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +27 -0
  164. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +31 -0
  165. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/index.js +11 -0
  166. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +27 -0
  167. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +20 -0
  168. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +22 -0
  169. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +14 -0
  170. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelNav.js +13 -0
  171. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelNext.js +16 -0
  172. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +15 -0
  173. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +15 -0
  174. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +14 -0
  175. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +18 -0
  176. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +14 -0
  177. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/locale/en-US.js +67 -0
  178. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/noonDateLib.js +163 -0
  179. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/selection/useMulti.js +57 -0
  180. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/selection/useRange.js +63 -0
  181. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/selection/useSingle.js +44 -0
  182. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useAnimation.js +173 -0
  183. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useCalendar.js +113 -0
  184. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useDayPicker.js +25 -0
  185. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useFocus.js +64 -0
  186. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/useSelection.js +31 -0
  187. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/addToRange.js +95 -0
  188. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +61 -0
  189. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +62 -0
  190. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +30 -0
  191. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +74 -0
  192. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +35 -0
  193. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +21 -0
  194. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +16 -0
  195. package/dist/node_modules/.pnpm/react-day-picker@10.0.2_@types_react@19.3.0_react@19.3.0/node_modules/react-day-picker/dist/esm/utils/typeguards.js +66 -0
  196. package/package.json +13 -11
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ export { Avatar } from './components/Avatar/Avatar.js';
16
16
  export { Badge } from './components/Badge/Badge.js';
17
17
  export { Breadcrumb } from './components/Breadcrumb/Breadcrumb.js';
18
18
  export { Button } from './components/Button/Button.js';
19
+ export { Calendar } from './components/Calendar/Calendar.js';
19
20
  export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from './components/Card/Card.js';
20
21
  export { Center } from './components/Center/Center.js';
21
22
  export { Checkbox } from './components/Checkbox/Checkbox.js';
@@ -31,6 +32,7 @@ export { DEFAULT_H_COLLAPSED, DEFAULT_H_MAX, DEFAULT_H_MIN, DEFAULT_H_SIZE, DEFA
31
32
  export { DEFAULT_STORAGE_KEY, isNavItemActive, isRouteActive, readStoredCollapsed, writeStoredCollapsed } from './components/SideBarNavigation/SideBarNavigation.helpers.js';
32
33
  export { DataList, DataListAction, DataListItem, DataListLabel, DataListValue } from './components/DataList/DataList.js';
33
34
  export { DataTable } from './components/DataTable/DataTable.js';
35
+ export { DatePicker } from './components/DatePicker/DatePicker.js';
34
36
  export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from './components/Dialog/Dialog.js';
35
37
  export { Divider } from './components/Divider/Divider.js';
36
38
  export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './components/Drawer/Drawer.js';
@@ -142,15 +144,19 @@ export { authModalBannerVariants, authModalCardVariants, authModalContainerVaria
142
144
  export { avatarRootVariants, avatarStatusVariants } from './components/Avatar/Avatar.styles.js';
143
145
  export { badgeVariants } from './components/Badge/Badge.styles.js';
144
146
  export { breadcrumbCurrentVariants, breadcrumbItemVariants, breadcrumbLinkVariants, breadcrumbListVariants, breadcrumbSeparatorVariants } from './components/Breadcrumb/Breadcrumb.styles.js';
147
+ export { buildCalendarClassNames, buildCalendarComponents, resolveCaptionDefaults } from './components/Calendar/Calendar.helpers.js';
145
148
  export { buttonVariants } from './components/Button/Button.styles.js';
149
+ export { calendarRootVariants } from './components/Calendar/Calendar.styles.js';
146
150
  export { cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardSectionFooterPadding, cardSectionPadding, cardTitleVariants, cardVariants } from './components/Card/Card.styles.js';
147
151
  export { centerVariants } from './components/Center/Center.styles.js';
148
152
  export { charCountVariants, editorWrapperVariants, proseEditorStyles, proseViewerStyles, toolbarVariants } from './components/RichTextEditor/RichTextEditor.styles.js';
149
153
  export { checkboxIndicatorVariants, checkboxVariants } from './components/Checkbox/Checkbox.styles.js';
150
154
  export { chipVariants } from './components/Chip/Chip.styles.js';
155
+ export { clearSelection, formatDateValue, formatSelectionLabel, hasSelection, shouldCloseOnSelect } from './components/DatePicker/DatePicker.helpers.js';
151
156
  export { colsMap, gridVariants, lgColsMap, mdColsMap, smColsMap, spanClassMap, templateClassMap, xlColsMap } from './components/Grid/Grid.styles.js';
152
157
  export { containerVariants } from './components/Container/Container.styles.js';
153
158
  export { dataListActionVariants, dataListInsetPadding, dataListItemVariants, dataListLabelVariants, dataListValueVariants, dataListVariants } from './components/DataList/DataList.styles.js';
159
+ export { datePickerValueVariants } from './components/DatePicker/DatePicker.styles.js';
154
160
  export { dialogBodyVariants, dialogContentVariants, dialogDescriptionVariants, dialogFooterVariants, dialogHeaderVariants, dialogOverlayVariants, dialogTitleVariants } from './components/Dialog/Dialog.styles.js';
155
161
  export { dividerVariants } from './components/Divider/Divider.styles.js';
156
162
  export { drawerBodyVariants, drawerContentVariants, drawerDescriptionVariants, drawerFooterVariants, drawerHeaderVariants, drawerOverlayVariants, drawerTitleVariants } from './components/Drawer/Drawer.styles.js';
@@ -0,0 +1,83 @@
1
+ import { tzName } from '../tzName/index.js';
2
+ import { TZDateMini } from './mini.js';
3
+
4
+ class TZDate extends TZDateMini {
5
+ //#region static
6
+
7
+ static tz(tz, ...args) {
8
+ return args.length ? new TZDate(...args, tz) : new TZDate(Date.now(), tz);
9
+ }
10
+
11
+ //#endregion
12
+
13
+ //#region representation
14
+
15
+ toISOString() {
16
+ const [sign, hours, minutes] = this.tzComponents();
17
+ const tz = `${sign}${hours}:${minutes}`;
18
+ return this.internal.toISOString().slice(0, -1) + tz;
19
+ }
20
+ toString() {
21
+ // "Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)";
22
+ return `${this.toDateString()} ${this.toTimeString()}`;
23
+ }
24
+ toDateString() {
25
+ // toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
26
+ const [day, date, month, year] = this.internal.toUTCString().split(" ");
27
+ // "Tue Aug 13 2024"
28
+ return `${day?.slice(0, -1) /* Remove "," */} ${month} ${date} ${year}`;
29
+ }
30
+ toTimeString() {
31
+ // toUTCString returns RFC 7231 ("Mon, 12 Aug 2024 23:36:08 GMT")
32
+ const time = this.internal.toUTCString().split(" ")[4];
33
+ const [sign, hours, minutes] = this.tzComponents();
34
+ // "07:42:23 GMT+0800 (Singapore Standard Time)"
35
+ return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;
36
+ }
37
+ toLocaleString(locales, options) {
38
+ return Date.prototype.toLocaleString.call(this, locales, {
39
+ ...options,
40
+ timeZone: options?.timeZone || this.timeZone
41
+ });
42
+ }
43
+ toLocaleDateString(locales, options) {
44
+ return Date.prototype.toLocaleDateString.call(this, locales, {
45
+ ...options,
46
+ timeZone: options?.timeZone || this.timeZone
47
+ });
48
+ }
49
+ toLocaleTimeString(locales, options) {
50
+ return Date.prototype.toLocaleTimeString.call(this, locales, {
51
+ ...options,
52
+ timeZone: options?.timeZone || this.timeZone
53
+ });
54
+ }
55
+
56
+ //#endregion
57
+
58
+ //#region private
59
+
60
+ tzComponents() {
61
+ const offset = this.getTimezoneOffset();
62
+ const sign = offset > 0 ? "-" : "+";
63
+ const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, "0");
64
+ const minutes = String(Math.abs(offset) % 60).padStart(2, "0");
65
+ return [sign, hours, minutes];
66
+ }
67
+
68
+ //#endregion
69
+
70
+ withTimeZone(timeZone) {
71
+ return new TZDate(+this, timeZone);
72
+ }
73
+
74
+ //#region date-fns integration
75
+
76
+ [Symbol.for("constructDateFrom")](date) {
77
+ return new TZDate(+new Date(date), this.timeZone);
78
+ }
79
+
80
+ //#endregion
81
+ }
82
+
83
+ export { TZDate };
@@ -0,0 +1,450 @@
1
+ import { tzOffset } from '../tzOffset/index.js';
2
+
3
+ // TZDate stores time in two `Date` objects because native `Date` can only
4
+ // expose local fields in the system time zone.
5
+ //
6
+ // The external date (`this`) stores the real timestamp. It is the value used by
7
+ // `getTime()`, `valueOf()`, UTC getters/setters, comparisons, and arithmetic.
8
+ // Its local getters are not used for target-zone fields because they would read
9
+ // the timestamp through the system time zone.
10
+ //
11
+ // The internal date (`this.internal`) stores the target-zone wall-clock fields.
12
+ // We read and write those fields through UTC getters/setters so the host system
13
+ // time zone cannot reinterpret them. For example, `getHours()` returns
14
+ // `internal.getUTCHours()`, and `setHours()` writes `internal.setUTCHours(...)`.
15
+ //
16
+ // Syncing moves data between the two representations:
17
+ //
18
+ // - `syncToInternal` starts from the external timestamp and rebuilds internal
19
+ // wall-clock fields using `this.timeZone` offset.
20
+ //
21
+ // - `syncFromInternal` starts from internal wall-clock fields, writes them into
22
+ // the external date, then adjusts that timestamp for the system/target offset
23
+ // difference and DST edge cases.
24
+ //
25
+ // The public TZDate value is the combination of both: external is the instant,
26
+ // internal is the wall-clock view of that instant in `this.timeZone`.
27
+
28
+ class TZDateMini extends Date {
29
+ //#region static
30
+
31
+ constructor(...args) {
32
+ super();
33
+
34
+ // Time zone string is always the last string argument unless date string
35
+ // is passed (as a single argument).
36
+ if (args.length > 1 && typeof args[args.length - 1] === "string") {
37
+ this.timeZone = args.pop();
38
+ }
39
+ this.internal = new Date();
40
+
41
+ // Validate the time zone by checking its offset.
42
+ if (isNaN(tzOffset(this.timeZone, this))) {
43
+ this.setTime(NaN);
44
+ } else {
45
+ if (!args.length) {
46
+ // No arguments passed: use current time
47
+ this.setTime(Date.now());
48
+ } else if (typeof args[0] === "number" && (args.length === 1 || args.length === 2 && typeof args[1] !== "number")) {
49
+ // Timestamp passed: use it as is
50
+ this.setTime(args[0]);
51
+ } else if (typeof args[0] === "string") {
52
+ // `Date` string passed: parse it as external date
53
+ this.setTime(+new Date(args[0]));
54
+ } else if (args[0] instanceof Date) {
55
+ // `Date` passed: use its timestamp
56
+ this.setTime(+args[0]);
57
+ } else {
58
+ // `Date` values passed:
59
+
60
+ // Set it as external date.
61
+ this.setTime(+new Date(...args));
62
+
63
+ // Adjust internal and external dates considering that we might have
64
+ // landed on the DST hour.
65
+ adjustToSystemTZ(this, args);
66
+ }
67
+ }
68
+ }
69
+ static tz(tz, ...args) {
70
+ return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);
71
+ }
72
+
73
+ //#endregion
74
+
75
+ //#region time zone
76
+
77
+ withTimeZone(timeZone) {
78
+ return new TZDateMini(+this, timeZone);
79
+ }
80
+ getTimezoneOffset() {
81
+ const offset = -tzOffset(this.timeZone, this);
82
+ // Remove the seconds offset using `Math.floor` for negative UTC time zones
83
+ // and `Math.ceil` for positive UTC time zones.
84
+ return offset > 0 ? Math.floor(offset) : Math.ceil(offset);
85
+ }
86
+
87
+ //#endregion
88
+
89
+ //#region time
90
+
91
+ setTime(_time) {
92
+ // Use the native `setTime` to the external date time.
93
+ Date.prototype.setTime.apply(this, arguments);
94
+
95
+ // Then apply it to the internal date adjusting to the timezone offset.
96
+ syncToInternal(this);
97
+ return +this;
98
+ }
99
+
100
+ //#endregion
101
+
102
+ //#region date-fns integration
103
+
104
+ [Symbol.for("constructDateFrom")](date) {
105
+ return new TZDateMini(+new Date(date), this.timeZone);
106
+ }
107
+
108
+ //#endregion
109
+ }
110
+
111
+ // Assign getters and setters
112
+ const re = /^(get|set)(?!UTC)/;
113
+ Object.getOwnPropertyNames(Date.prototype).forEach(method => {
114
+ if (!re.test(method)) return;
115
+ const utcMethod = method.replace(re, "$1UTC");
116
+ // Filter out methods without UTC counterparts
117
+ if (!TZDateMini.prototype[utcMethod]) return;
118
+ if (method.startsWith("get")) {
119
+ // Delegate to internal date's UTC method
120
+ TZDateMini.prototype[method] = function () {
121
+ return this.internal[utcMethod]();
122
+ };
123
+ } else {
124
+ // Assign regular setter
125
+ TZDateMini.prototype[method] = function () {
126
+ Date.prototype[utcMethod].apply(this.internal, arguments);
127
+ syncFromInternal(this);
128
+ return +this;
129
+ };
130
+
131
+ // Assign UTC setter
132
+ TZDateMini.prototype[utcMethod] = function () {
133
+ Date.prototype[utcMethod].apply(this, arguments);
134
+ syncToInternal(this);
135
+ return +this;
136
+ };
137
+ }
138
+ });
139
+
140
+ /**
141
+ * @internal
142
+ * Function syncs time to internal date, applying the current time zone offset.
143
+ *
144
+ * @param {Date} date - `Date` to sync
145
+ */
146
+ function syncToInternal(date) {
147
+ // Start internal from the same real timestamp as external.
148
+ date.internal.setTime(+date);
149
+
150
+ // Shift internal by the target offset so its UTC fields become the target-zone
151
+ // wall-clock fields for the external timestamp.
152
+ //
153
+ // o internal UTC fields: 2024-02-11 00:00
154
+ // |
155
+ // | + Asia/Singapore offset (+08:00)
156
+ // v
157
+ // x internal UTC fields: 2024-02-11 08:00
158
+ //
159
+ date.internal.setUTCSeconds(date.internal.getUTCSeconds() -
160
+ // Round after converting minutes to seconds to avoid fractional offset
161
+ // precision errors from historical offsets.
162
+ Math.round(-tzOffset(date.timeZone, date) * 60));
163
+ }
164
+
165
+ /**
166
+ * @internal
167
+ * Function syncs internal wall-clock fields into the external date.
168
+ *
169
+ * @param {Date} date - The date to sync
170
+ */
171
+ function syncFromInternal(date) {
172
+ // Copy target-zone wall-clock fields from internal into external using native
173
+ // local setters. At this point external holds the right field values but they
174
+ // are interpreted in the system time zone; `adjustToSystemTZ` fixes that.
175
+ Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());
176
+ Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());
177
+
178
+ // Now we have to adjust the date to the system time zone
179
+ adjustToSystemTZ(date);
180
+ }
181
+
182
+ /**
183
+ * @internal
184
+ * Function adjusts the date to the system time zone. It uses the time zone
185
+ * differences to calculate the offset and adjust the date.
186
+ *
187
+ * We use it when constructing `TZDate` and syncing the external date from
188
+ * the internal one.
189
+ *
190
+ * @param {TZDate} date - `TZDate` to adjust.
191
+ */
192
+ function adjustToSystemTZ(date, constructorArgs) {
193
+ // Keep the intended target-zone wall-clock value before native Date/system
194
+ // time zone normalization can move it. Later corrections compare against this
195
+ // value to distinguish intended DST normalization from accidental drift.
196
+ const expectedInternalTime = Array.isArray(constructorArgs) ? constructorArgsToInternalTime(constructorArgs) : +date.internal;
197
+ //#region Initial offset calculation
198
+
199
+ // Current target time zone offset at the native timestamp. It may include
200
+ // historical offset seconds, which we preserve for the seconds adjustment.
201
+ const offsetWithSeconds = tzOffset(date.timeZone, date);
202
+
203
+ // Minute-precision target offset used by minute-based timestamp adjustments.
204
+ // Historical offsets can contain seconds, so we strip the fractional minute
205
+ // here and handle remaining seconds in the seconds adjustment below.
206
+ const offset = offsetWithSeconds > 0 ? Math.floor(offsetWithSeconds) : Math.ceil(offsetWithSeconds);
207
+
208
+ //#endregion
209
+
210
+ //#region System DST adjustment
211
+
212
+ // Native `Date` may normalize the requested wall time when the system time
213
+ // zone skips that hour for DST.
214
+ //
215
+ // We compare the system wall-clock hour represented by the external date with
216
+ // the wall-clock hour stored in the internal date. If they differ, the next
217
+ // offset-diff calculation may need the previous system offset, because the
218
+ // current external timestamp is already after the system DST jump.
219
+
220
+ // Previous-hour reference used to detect whether the system offset changed
221
+ // immediately before the current native timestamp.
222
+ const prevHour = new Date(+date);
223
+
224
+ // Use UTC math so subtracting one hour cannot be normalized back into the
225
+ // same missing local DST hour.
226
+ prevHour.setUTCHours(prevHour.getUTCHours() - 1);
227
+
228
+ // Current system offset at the native timestamp.
229
+ const systemOffset = -new Date(+date).getTimezoneOffset();
230
+
231
+ // System offset one real hour before the native timestamp.
232
+ const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();
233
+
234
+ // Non-zero when the system offset changed between `prevHour` and `date`.
235
+ const systemDSTChange = systemOffset - prevHourSystemOffset;
236
+
237
+ // System offset to use in the later system-target offset difference.
238
+ // Defaults to the current system offset and switches to the previous offset
239
+ // only when native `Date` normalized a missing system wall time.
240
+ let systemOffsetForDiff = systemOffset;
241
+ if (systemDSTChange && systemOffset !== offset) {
242
+ // System wall-clock hour represented by the current external timestamp.
243
+ const systemHour = Date.prototype.getHours.apply(date);
244
+
245
+ // Target wall-clock hour currently stored in internal fields. Constructors
246
+ // get it from arguments because internal may have already been synced from
247
+ // the normalized external timestamp; setters get it directly from internal.
248
+ const expectedHour = Array.isArray(constructorArgs) ? constructorArgs[3] || 0 : date.internal.getUTCHours();
249
+ if (systemHour !== expectedHour) {
250
+ // Check whether using the current system offset would keep the target
251
+ // offset unchanged. If so, the only DST jump we crossed is the system
252
+ // one, so the diff should use the pre-DST system offset.
253
+ const testDate = new Date(+date);
254
+
255
+ // Difference that the later offset-diff step would apply with the
256
+ // current system offset.
257
+ const testOffsetDiff = systemOffset - offset;
258
+ if (testOffsetDiff) testDate.setUTCMinutes(testDate.getUTCMinutes() + testOffsetDiff);
259
+
260
+ // Target offset after applying the current system offset difference.
261
+ const testOffsetWithSeconds = tzOffset(date.timeZone, testDate);
262
+
263
+ // Target offset without historical seconds, matching `offset`.
264
+ const testOffset = testOffsetWithSeconds > 0 ? Math.floor(testOffsetWithSeconds) : Math.ceil(testOffsetWithSeconds);
265
+ if (testOffset === offset) systemOffsetForDiff = prevHourSystemOffset;
266
+ }
267
+ }
268
+
269
+ //#endregion
270
+
271
+ //#region System diff adjustment
272
+
273
+ // Move external from the system-zone interpretation of internal fields toward
274
+ // the timestamp that represents those fields in the target time zone.
275
+ //
276
+ // At this point native `Date` has treated the internal wall-clock fields as if
277
+ // they belonged to the system zone. The system-target offset difference moves
278
+ // external by the distance between that system interpretation and the target
279
+ // interpretation.
280
+
281
+ // Difference between the system offset selected above and the minute-precision
282
+ // target offset. Positive values move external forward; negative values move
283
+ // it backward.
284
+ const offsetDiff = systemOffsetForDiff - offset;
285
+ if (offsetDiff)
286
+ // Apply the system-target minute difference to external. Internal is
287
+ // rebuilt from the final external timestamp after all adjustments are
288
+ // complete.
289
+ //
290
+ // o external as target: 2023-01-31 23:00
291
+ // |
292
+ // | add `offsetDiff`
293
+ // v
294
+ // x external as target: 2023-02-01 12:00
295
+ //
296
+ Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);
297
+
298
+ //#endregion
299
+
300
+ //#region Seconds system diff adjustment
301
+
302
+ // Historical time zone offsets can include seconds, but the minute-based
303
+ // offset adjustment above intentionally used minute precision.
304
+ //
305
+ // This adjustment applies the remaining seconds difference to external. For
306
+ // example, historical Singapore used UTC+06:55:25, while ISO formatting shows
307
+ // only `+06:55`; without the seconds correction, setter paths keep the wrong
308
+ // wall-clock seconds.
309
+
310
+ // Clone external as a native `Date` so we can inspect how the system time zone
311
+ // represents the same timestamp.
312
+ const systemDate = new Date(+date);
313
+
314
+ // Zero UTC seconds before reading system seconds. Any remaining local seconds
315
+ // then come from the system time zone offset rather than from the timestamp's
316
+ // own seconds value.
317
+ systemDate.setUTCSeconds(0);
318
+
319
+ // Seconds part contributed by the system time zone offset. Negative offsets
320
+ // need wrapping because `Date#getSeconds()` returns values in the 0..59 range.
321
+ const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;
322
+
323
+ // Seconds part contributed by the target time zone offset.
324
+ const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;
325
+ if (secondsOffset || systemSecondsOffset)
326
+ // Apply the remaining second-level system-target difference to external.
327
+ //
328
+ // o external as Asia/Singapore: 1900-01-01 00:00:56
329
+ // |
330
+ // | + `secondsOffset`
331
+ // | + `systemSecondsOffset`
332
+ // v
333
+ // x external as Asia/Singapore: 1900-01-01 00:00:31
334
+ //
335
+ Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);
336
+
337
+ //#endregion
338
+
339
+ //#region Post-adjustment DST fix
340
+
341
+ // The first system-target offset move can cross a target-zone DST boundary.
342
+ //
343
+ // When that happens, the target offset at the new external timestamp differs
344
+ // from the target offset used for `offsetDiff`. We compare the original move
345
+ // with the move that would be calculated at the new timestamp, then apply the
346
+ // difference to external.
347
+
348
+ // Target offset at the current external timestamp, including historical
349
+ // seconds for the later seconds adjustment.
350
+ const postOffsetWithSeconds = tzOffset(date.timeZone, date);
351
+
352
+ // Minute-precision target offset at the current external timestamp.
353
+ const postOffset = postOffsetWithSeconds > 0 ? Math.floor(postOffsetWithSeconds) : Math.ceil(postOffsetWithSeconds);
354
+
355
+ // System offset at the current external timestamp.
356
+ const postSystemOffset = -new Date(+date).getTimezoneOffset();
357
+
358
+ // System-target offset difference at the current external timestamp.
359
+ const postOffsetDiff = postSystemOffset - postOffset;
360
+
361
+ // Whether the target offset changed after the first offset move.
362
+ const offsetChanged = postOffset !== offset;
363
+
364
+ // Difference between the current offset move and the move already applied.
365
+ const postDiff = postOffsetDiff - offsetDiff;
366
+
367
+ // If the first offset move already normalized a target DST gap forward, the
368
+ // generic post-DST correction below would undo that valid normalization. This
369
+ // happens, for example, with America/New_York 02:00 during spring-forward when
370
+ // the system zone also changes offset around the same instant.
371
+ const targetDSTShift = postOffset - offset;
372
+
373
+ // Candidate timestamp that would represent the requested wall-clock time with
374
+ // the post-transition target offset. If it still does not round-trip to the
375
+ // requested wall-clock fields, the requested time is inside a target DST gap.
376
+ const postOffsetCandidate = expectedInternalTime - postOffset * 60 * 1000;
377
+
378
+ // Only positive target offset shifts are spring-forward gaps. Negative shifts
379
+ // are fall-back overlaps and still need the regular post-adjustment path.
380
+ const normalizedTargetDSTGap = targetDSTShift > 0 && targetInternalTime(date) - expectedInternalTime === targetDSTShift * 60 * 1000 && targetInternalTime(date, postOffsetCandidate) !== expectedInternalTime;
381
+ if (offsetChanged && postDiff && !normalizedTargetDSTGap) {
382
+ // Apply the target-DST correction to external. In the backward-crossing case
383
+ // shown here, this lands on an intermediate value that needs `offsetChange`
384
+ // below.
385
+ //
386
+ // o external as America/New_York: 2023-03-12 03:00 EDT
387
+ // |
388
+ // | + `postDiff`
389
+ // v
390
+ // x external as America/New_York: 2023-03-12 01:00 EST
391
+ //
392
+ Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);
393
+
394
+ // Target offset after applying `postDiff`. It may change again if the
395
+ // correction itself crosses a target-zone DST boundary.
396
+ const newOffsetWithSeconds = tzOffset(date.timeZone, date);
397
+
398
+ // Minute-precision target offset after applying `postDiff`.
399
+ const newOffset = newOffsetWithSeconds > 0 ? Math.floor(newOffsetWithSeconds) : Math.ceil(newOffsetWithSeconds);
400
+
401
+ // Offset change caused by the `postDiff` move itself.
402
+ const offsetChange = postOffset - newOffset;
403
+
404
+ // If the correction moved external backward across the target DST boundary,
405
+ // apply the boundary change so external lands on the valid target-zone
406
+ // timestamp. Forward crossings are already normalized by native Date, and
407
+ // applying this correction there would undo the valid post-DST result.
408
+ if (offsetChange && postDiff < 0) {
409
+ // Apply the second target-DST correction to external.
410
+ //
411
+ // o external as America/New_York: 2023-03-12 01:00 EST
412
+ // |
413
+ // | + `offsetChange`
414
+ // v
415
+ // x external as America/New_York: 2023-03-12 03:00 EDT
416
+ //
417
+ Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);
418
+ }
419
+ }
420
+
421
+ //#endregion
422
+
423
+ // Rebuild internal wall-clock fields from the final external timestamp.
424
+ syncToInternal(date);
425
+
426
+ // Native Date can normalize historical system offsets with minute and second
427
+ // precision before we adjust to the target time zone. Correct only small
428
+ // historical drift so DST gap normalization (usually one hour) remains intact.
429
+ const expectedTime = constructorArgs ? expectedInternalTime : expectedInternalTime + secondsOffset * 1000;
430
+ const drift = expectedTime - +date.internal;
431
+ if (drift && Math.abs(drift) < 30 * 60 * 1000) {
432
+ Date.prototype.setTime.call(date, +date + drift);
433
+ syncToInternal(date);
434
+ }
435
+ }
436
+ function constructorArgsToInternalTime(args) {
437
+ // Mirror Date's date-value constructor defaults while preserving explicit
438
+ // `undefined` behavior. Missing month/day default, but passed `undefined`
439
+ // should remain invalid just like `Date.UTC(year, undefined, ...)`.
440
+ return Date.UTC(args[0], args.length > 1 ? args[1] : 0, args.length > 2 ? args[2] : 1, ...args.slice(3));
441
+ }
442
+ function targetInternalTime(date, time) {
443
+ // Compute the target-zone wall-clock representation for a timestamp without
444
+ // mutating the TZDate. This mirrors syncToInternal for temporary checks.
445
+ const internal = new Date(time ?? +date);
446
+ internal.setUTCSeconds(internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, internal) * 60));
447
+ return +internal;
448
+ }
449
+
450
+ export { TZDateMini };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Time zone name format.
3
+ */
4
+
5
+ /**
6
+ * The function returns the time zone name for the given date in the specified
7
+ * time zone.
8
+ *
9
+ * It uses the `Intl.DateTimeFormat` API and by default outputs the time zone
10
+ * name in a long format, e.g. "Pacific Standard Time" or
11
+ * "Singapore Standard Time".
12
+ *
13
+ * It is possible to specify the format as the third argument using one of the following options
14
+ *
15
+ * - "short": e.g. "EDT" or "GMT+8".
16
+ * - "long": e.g. "Eastern Daylight Time".
17
+ * - "shortGeneric": e.g. "ET" or "Singapore Time".
18
+ * - "longGeneric": e.g. "Eastern Time" or "Singapore Standard Time".
19
+ *
20
+ * These options correspond to TR35 tokens `z..zzz`, `zzzz`, `v`, and `vvvv` respectively: https://www.unicode.org/reports/tr35/tr35-dates.html#dfst-zone
21
+ *
22
+ * @param timeZone - Time zone name (IANA or UTC offset)
23
+ * @param date - Date object to get the time zone name for
24
+ * @param format - Optional format of the time zone name. Defaults to "long". Can be "short", "long", "shortGeneric", or "longGeneric".
25
+ *
26
+ * @returns Time zone name (e.g. "Singapore Standard Time")
27
+ */
28
+ function tzName(timeZone, date, format = "long") {
29
+ return new Intl.DateTimeFormat("en-US", {
30
+ // Enforces engine to render the time. Without the option JavaScriptCore omits it.
31
+ hour: "numeric",
32
+ timeZone: timeZone,
33
+ timeZoneName: format
34
+ }).format(date).split(/\s/g) // Format.JS uses non-breaking spaces
35
+ .slice(2) // Skip the hour and AM/PM parts
36
+ .join(" ");
37
+ }
38
+
39
+ export { tzName };
@@ -0,0 +1,56 @@
1
+ const offsetFormatCache = {};
2
+ const offsetCache = {};
3
+
4
+ /**
5
+ * The function returns UTC offset in minutes for the given date in specified
6
+ * time zone.
7
+ *
8
+ * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value
9
+ * mirrored to the sign of the offset in the time zone. For Asia/Singapore
10
+ * (UTC+8), `tzOffset` returns `480`, while `getTimezoneOffset` returns `-480`.
11
+ *
12
+ * It uses `Intl.DateTimeFormat` internally to access otherwise unavailable
13
+ * runtime's time zone data, and falls back to basic manual parsing if Intl API
14
+ * is not supported (e.g., older Node.js versions, React Native's Hermes, etc.).
15
+ *
16
+ * @param timeZone - Time zone name (IANA or UTC offset).
17
+ * @param date - Date to check the offset for.
18
+ *
19
+ * @returns UTC offset in minutes (e.g., `480` for date in UTC+8).
20
+ */
21
+ function tzOffset(timeZone, date) {
22
+ try {
23
+ // Create `Intl.DateTimeFormat` with `"longOffset"` that gives us consistent
24
+ // date strings like `"5/19/2026, GMT-08:00"`.
25
+ const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat("en-US", {
26
+ timeZone,
27
+ timeZoneName: "longOffset"
28
+ }).format;
29
+
30
+ // Get `"-08:00"`.
31
+ const offsetStr = format(date).split("GMT")[1];
32
+
33
+ // Avoid parsing the same offset string.
34
+ if (offsetStr in offsetCache) return offsetCache[offsetStr];
35
+
36
+ // Calculate offset from `["-08", "00"]` and cache it.
37
+ return calcOffset(offsetStr, offsetStr.split(":"));
38
+ } catch {
39
+ // Fallback to manual parsing if the runtime doesn't support
40
+ // `±HH:MM/±HHMM/±HH`. See: https://github.com/nodejs/node/issues/53419.
41
+ if (timeZone in offsetCache) return offsetCache[timeZone];
42
+ const captures = timeZone?.match(offsetRe);
43
+ if (captures) return calcOffset(timeZone, captures.slice(1));
44
+ return NaN;
45
+ }
46
+ }
47
+ const offsetRe = /([+-]\d\d):?(\d\d)?/;
48
+ function calcOffset(cacheStr, values) {
49
+ const hours = +(values[0] || 0);
50
+ const minutes = +(values[1] || 0);
51
+ // Convert seconds to minutes by dividing by 60 to keep the function return in minutes.
52
+ const seconds = +(values[2] || 0) / 60;
53
+ return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;
54
+ }
55
+
56
+ export { tzOffset };
@@ -0,0 +1,7 @@
1
+ function addLeadingZeros(number, targetLength) {
2
+ const sign = number < 0 ? "-" : "";
3
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
4
+ return sign + output;
5
+ }
6
+
7
+ export { addLeadingZeros };