kiban-design-system 3.11.0 → 3.13.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 (183) hide show
  1. package/dist/components/table-search-filters.d.ts +34 -0
  2. package/dist/components/table-search-filters.d.ts.map +1 -0
  3. package/dist/components/table-search-filters.js +222 -0
  4. package/dist/components/totalizer.d.ts +7 -0
  5. package/dist/components/totalizer.d.ts.map +1 -0
  6. package/dist/components/totalizer.js +22 -0
  7. package/dist/components/ui/calendar.d.ts +9 -0
  8. package/dist/components/ui/calendar.d.ts.map +1 -0
  9. package/dist/components/ui/calendar.js +56 -0
  10. package/dist/components/ui/popover.d.ts +11 -0
  11. package/dist/components/ui/popover.d.ts.map +1 -0
  12. package/dist/components/ui/popover.js +81 -0
  13. package/dist/index.d.ts +4 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +104 -90
  16. package/dist/node_modules/@date-fns/tz/date/index.js +61 -0
  17. package/dist/node_modules/@date-fns/tz/date/mini.js +69 -0
  18. package/dist/node_modules/@date-fns/tz/tzName/index.js +11 -0
  19. package/dist/node_modules/@date-fns/tz/tzOffset/index.js +22 -0
  20. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +240 -0
  21. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  22. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  23. package/dist/node_modules/date-fns/_lib/format/formatters.js +548 -0
  24. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +58 -0
  25. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +49 -0
  26. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
  27. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  28. package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
  29. package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
  30. package/dist/node_modules/date-fns/addDays.js +9 -0
  31. package/dist/node_modules/date-fns/addMonths.js +19 -0
  32. package/dist/node_modules/date-fns/addWeeks.js +7 -0
  33. package/dist/node_modules/date-fns/addYears.js +7 -0
  34. package/dist/node_modules/date-fns/constants.js +8 -0
  35. package/dist/node_modules/date-fns/constructFrom.js +7 -0
  36. package/dist/node_modules/date-fns/differenceInCalendarDays.js +15 -0
  37. package/dist/node_modules/date-fns/differenceInCalendarMonths.js +12 -0
  38. package/dist/node_modules/date-fns/eachMonthOfInterval.js +16 -0
  39. package/dist/node_modules/date-fns/eachYearOfInterval.js +16 -0
  40. package/dist/node_modules/date-fns/endOfISOWeek.js +7 -0
  41. package/dist/node_modules/date-fns/endOfMonth.js +8 -0
  42. package/dist/node_modules/date-fns/endOfWeek.js +9 -0
  43. package/dist/node_modules/date-fns/endOfYear.js +8 -0
  44. package/dist/node_modules/date-fns/format.js +57 -0
  45. package/dist/node_modules/date-fns/getDayOfYear.js +10 -0
  46. package/dist/node_modules/date-fns/getDaysInMonth.js +9 -0
  47. package/dist/node_modules/date-fns/getISOWeek.js +11 -0
  48. package/dist/node_modules/date-fns/getISOWeekYear.js +14 -0
  49. package/dist/node_modules/date-fns/getMonth.js +7 -0
  50. package/dist/node_modules/date-fns/getWeek.js +11 -0
  51. package/dist/node_modules/date-fns/getWeekYear.js +15 -0
  52. package/dist/node_modules/date-fns/getYear.js +7 -0
  53. package/dist/node_modules/date-fns/isAfter.js +7 -0
  54. package/dist/node_modules/date-fns/isBefore.js +7 -0
  55. package/dist/node_modules/date-fns/isDate.js +6 -0
  56. package/dist/node_modules/date-fns/isSameDay.js +13 -0
  57. package/dist/node_modules/date-fns/isSameMonth.js +12 -0
  58. package/dist/node_modules/date-fns/isSameYear.js +12 -0
  59. package/dist/node_modules/date-fns/isValid.js +8 -0
  60. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  61. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  62. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  63. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  64. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  65. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  66. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  67. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  68. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  69. package/dist/node_modules/date-fns/locale/en-US.js +20 -0
  70. package/dist/node_modules/date-fns/max.js +13 -0
  71. package/dist/node_modules/date-fns/min.js +13 -0
  72. package/dist/node_modules/date-fns/parseISO.js +121 -0
  73. package/dist/node_modules/date-fns/setMonth.js +12 -0
  74. package/dist/node_modules/date-fns/setYear.js +9 -0
  75. package/dist/node_modules/date-fns/startOfDay.js +8 -0
  76. package/dist/node_modules/date-fns/startOfISOWeek.js +7 -0
  77. package/dist/node_modules/date-fns/startOfISOWeekYear.js +10 -0
  78. package/dist/node_modules/date-fns/startOfMonth.js +8 -0
  79. package/dist/node_modules/date-fns/startOfWeek.js +9 -0
  80. package/dist/node_modules/date-fns/startOfWeekYear.js +11 -0
  81. package/dist/node_modules/date-fns/startOfYear.js +8 -0
  82. package/dist/node_modules/date-fns/toDate.js +7 -0
  83. package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +234 -0
  84. package/dist/node_modules/react-day-picker/dist/esm/UI.js +22 -0
  85. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +19 -0
  86. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +8 -0
  87. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +8 -0
  88. package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +148 -0
  89. package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +7 -0
  90. package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +7 -0
  91. package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -0
  92. package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +8 -0
  93. package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +10 -0
  94. package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +19 -0
  95. package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +7 -0
  96. package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +7 -0
  97. package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +8 -0
  98. package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +8 -0
  99. package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +7 -0
  100. package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +7 -0
  101. package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +9 -0
  102. package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +27 -0
  103. package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +9 -0
  104. package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +7 -0
  105. package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +9 -0
  106. package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +8 -0
  107. package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +7 -0
  108. package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +8 -0
  109. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +8 -0
  110. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +7 -0
  111. package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +7 -0
  112. package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +11 -0
  113. package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +7 -0
  114. package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +9 -0
  115. package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +54 -0
  116. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +9 -0
  117. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +7 -0
  118. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +7 -0
  119. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +7 -0
  120. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +6 -0
  121. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +7 -0
  122. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +9 -0
  123. package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +18 -0
  124. package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +19 -0
  125. package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +42 -0
  126. package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +9 -0
  127. package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +7 -0
  128. package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +7 -0
  129. package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +10 -0
  130. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +16 -0
  131. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +19 -0
  132. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +10 -0
  133. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +16 -0
  134. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +13 -0
  135. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +15 -0
  136. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +10 -0
  137. package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +13 -0
  138. package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +34 -0
  139. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +13 -0
  140. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +24 -0
  141. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +13 -0
  142. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +12 -0
  143. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +12 -0
  144. package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +12 -0
  145. package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +13 -0
  146. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +11 -0
  147. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +7 -0
  148. package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +16 -0
  149. package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +7 -0
  150. package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +8 -0
  151. package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +26 -0
  152. package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +10 -0
  153. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +9 -0
  154. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +8 -0
  155. package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +6 -0
  156. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +6 -0
  157. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +7 -0
  158. package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +6 -0
  159. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +6 -0
  160. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +6 -0
  161. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +7 -0
  162. package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +6 -0
  163. package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +37 -0
  164. package/dist/node_modules/react-day-picker/dist/esm/noonDateLib.js +104 -0
  165. package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +21 -0
  166. package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +18 -0
  167. package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +15 -0
  168. package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +56 -0
  169. package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +75 -0
  170. package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +12 -0
  171. package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +23 -0
  172. package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +19 -0
  173. package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +32 -0
  174. package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +26 -0
  175. package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +26 -0
  176. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +15 -0
  177. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +28 -0
  178. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +9 -0
  179. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +8 -0
  180. package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +8 -0
  181. package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +26 -0
  182. package/dist/style.css +1 -1
  183. package/package.json +7 -3
@@ -0,0 +1,20 @@
1
+ const r = /^D+$/, s = /^Y+$/, a = ["D", "DD", "YY", "YYYY"];
2
+ function i(e) {
3
+ return r.test(e);
4
+ }
5
+ function f(e) {
6
+ return s.test(e);
7
+ }
8
+ function d(e, o, n) {
9
+ const t = c(e, o, n);
10
+ if (console.warn(t), a.includes(e)) throw new RangeError(t);
11
+ }
12
+ function c(e, o, n) {
13
+ const t = e[0] === "Y" ? "years" : "days of the month";
14
+ return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${o}\`) for formatting ${t} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
15
+ }
16
+ export {
17
+ i as isProtectedDayOfYearToken,
18
+ f as isProtectedWeekYearToken,
19
+ d as warnOrThrowProtectedError
20
+ };
@@ -0,0 +1,9 @@
1
+ import { constructFrom as i } from "./constructFrom.js";
2
+ import { toDate as n } from "./toDate.js";
3
+ function s(e, r, o) {
4
+ const t = n(e, o?.in);
5
+ return isNaN(r) ? i(e, NaN) : (r && t.setDate(t.getDate() + r), t);
6
+ }
7
+ export {
8
+ s as addDays
9
+ };
@@ -0,0 +1,19 @@
1
+ import { constructFrom as s } from "./constructFrom.js";
2
+ import { toDate as a } from "./toDate.js";
3
+ function M(n, o, i) {
4
+ const t = a(n, i?.in);
5
+ if (isNaN(o)) return s(n, NaN);
6
+ if (!o)
7
+ return t;
8
+ const r = t.getDate(), e = s(n, t.getTime());
9
+ e.setMonth(t.getMonth() + o + 1, 0);
10
+ const f = e.getDate();
11
+ return r >= f ? e : (t.setFullYear(
12
+ e.getFullYear(),
13
+ e.getMonth(),
14
+ r
15
+ ), t);
16
+ }
17
+ export {
18
+ M as addMonths
19
+ };
@@ -0,0 +1,7 @@
1
+ import { addDays as o } from "./addDays.js";
2
+ function a(r, d, e) {
3
+ return o(r, d * 7, e);
4
+ }
5
+ export {
6
+ a as addWeeks
7
+ };
@@ -0,0 +1,7 @@
1
+ import { addMonths as d } from "./addMonths.js";
2
+ function a(r, o, t) {
3
+ return d(r, o * 12, t);
4
+ }
5
+ export {
6
+ a as addYears
7
+ };
@@ -0,0 +1,8 @@
1
+ const o = 6048e5, n = 864e5, s = 6e4, c = 36e5, t = /* @__PURE__ */ Symbol.for("constructDateFrom");
2
+ export {
3
+ t as constructFromSymbol,
4
+ n as millisecondsInDay,
5
+ c as millisecondsInHour,
6
+ s as millisecondsInMinute,
7
+ o as millisecondsInWeek
8
+ };
@@ -0,0 +1,7 @@
1
+ import { constructFromSymbol as o } from "./constants.js";
2
+ function c(r, n) {
3
+ return typeof r == "function" ? r(n) : r && typeof r == "object" && o in r ? r[o](n) : r instanceof Date ? new r.constructor(n) : new Date(n);
4
+ }
5
+ export {
6
+ c as constructFrom
7
+ };
@@ -0,0 +1,15 @@
1
+ import { getTimezoneOffsetInMilliseconds as r } from "./_lib/getTimezoneOffsetInMilliseconds.js";
2
+ import { normalizeDates as c } from "./_lib/normalizeDates.js";
3
+ import { millisecondsInDay as D } from "./constants.js";
4
+ import { startOfDay as a } from "./startOfDay.js";
5
+ function u(o, n, i) {
6
+ const [m, s] = c(
7
+ i?.in,
8
+ o,
9
+ n
10
+ ), t = a(m), e = a(s), f = +t - r(t), l = +e - r(e);
11
+ return Math.round((f - l) / D);
12
+ }
13
+ export {
14
+ u as differenceInCalendarDays
15
+ };
@@ -0,0 +1,12 @@
1
+ import { normalizeDates as i } from "./_lib/normalizeDates.js";
2
+ function s(n, r, o) {
3
+ const [e, t] = i(
4
+ o?.in,
5
+ n,
6
+ r
7
+ ), a = e.getFullYear() - t.getFullYear(), f = e.getMonth() - t.getMonth();
8
+ return a * 12 + f;
9
+ }
10
+ export {
11
+ s as differenceInCalendarMonths
12
+ };
@@ -0,0 +1,16 @@
1
+ import { normalizeInterval as m } from "./_lib/normalizeInterval.js";
2
+ import { constructFrom as h } from "./constructFrom.js";
3
+ function p(s, a) {
4
+ const { start: e, end: r } = m(a?.in, s);
5
+ let n = +e > +r;
6
+ const c = n ? +e : +r, t = n ? r : e;
7
+ t.setHours(0, 0, 0, 0), t.setDate(1);
8
+ let i = 1;
9
+ const o = [];
10
+ for (; +t <= c; )
11
+ o.push(h(e, t)), t.setMonth(t.getMonth() + i);
12
+ return n ? o.reverse() : o;
13
+ }
14
+ export {
15
+ p as eachMonthOfInterval
16
+ };
@@ -0,0 +1,16 @@
1
+ import { normalizeInterval as i } from "./_lib/normalizeInterval.js";
2
+ import { constructFrom as m } from "./constructFrom.js";
3
+ function p(s, a) {
4
+ const { start: t, end: r } = i(a?.in, s);
5
+ let n = +t > +r;
6
+ const l = n ? +t : +r, e = n ? r : t;
7
+ e.setHours(0, 0, 0, 0), e.setMonth(0, 1);
8
+ let c = 1;
9
+ const o = [];
10
+ for (; +e <= l; )
11
+ o.push(m(t, e)), e.setFullYear(e.getFullYear() + c);
12
+ return n ? o.reverse() : o;
13
+ }
14
+ export {
15
+ p as eachYearOfInterval
16
+ };
@@ -0,0 +1,7 @@
1
+ import { endOfWeek as r } from "./endOfWeek.js";
2
+ function f(e, n) {
3
+ return r(e, { ...n, weekStartsOn: 1 });
4
+ }
5
+ export {
6
+ f as endOfISOWeek
7
+ };
@@ -0,0 +1,8 @@
1
+ import { toDate as r } from "./toDate.js";
2
+ function u(e, o) {
3
+ const t = r(e, o?.in), n = t.getMonth();
4
+ return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
5
+ }
6
+ export {
7
+ u as endOfMonth
8
+ };
@@ -0,0 +1,9 @@
1
+ import { getDefaultOptions as c } from "./_lib/defaultOptions.js";
2
+ import { toDate as f } from "./toDate.js";
3
+ function k(s, e) {
4
+ const n = c(), o = e?.weekStartsOn ?? e?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, t = f(s, e?.in), a = t.getDay(), r = (a < o ? -7 : 0) + 6 - (a - o);
5
+ return t.setDate(t.getDate() + r), t.setHours(23, 59, 59, 999), t;
6
+ }
7
+ export {
8
+ k as endOfWeek
9
+ };
@@ -0,0 +1,8 @@
1
+ import { toDate as n } from "./toDate.js";
2
+ function s(t, r) {
3
+ const e = n(t, r?.in), o = e.getFullYear();
4
+ return e.setFullYear(o + 1, 0, 0), e.setHours(23, 59, 59, 999), e;
5
+ }
6
+ export {
7
+ s as endOfYear
8
+ };
@@ -0,0 +1,57 @@
1
+ import { getDefaultOptions as u } from "./_lib/defaultOptions.js";
2
+ import { formatters as f } from "./_lib/format/formatters.js";
3
+ import { longFormatters as d } from "./_lib/format/longFormatters.js";
4
+ import { isProtectedWeekYearToken as g, isProtectedDayOfYearToken as h, warnOrThrowProtectedError as w } from "./_lib/protectedTokens.js";
5
+ import { isValid as D } from "./isValid.js";
6
+ import { toDate as T } from "./toDate.js";
7
+ import { enUS as O } from "./locale/en-US.js";
8
+ const E = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, v = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, C = /^'([^]*?)'?$/, S = /''/g, R = /[a-zA-Z]/;
9
+ function L(o, a, r) {
10
+ const n = u(), i = r?.locale ?? n.locale ?? O, m = r?.firstWeekContainsDate ?? r?.locale?.options?.firstWeekContainsDate ?? n.firstWeekContainsDate ?? n.locale?.options?.firstWeekContainsDate ?? 1, p = r?.weekStartsOn ?? r?.locale?.options?.weekStartsOn ?? n.weekStartsOn ?? n.locale?.options?.weekStartsOn ?? 0, s = T(o, r?.in);
11
+ if (!D(s))
12
+ throw new RangeError("Invalid time value");
13
+ let c = a.match(v).map((t) => {
14
+ const e = t[0];
15
+ if (e === "p" || e === "P") {
16
+ const l = d[e];
17
+ return l(t, i.formatLong);
18
+ }
19
+ return t;
20
+ }).join("").match(E).map((t) => {
21
+ if (t === "''")
22
+ return { isToken: !1, value: "'" };
23
+ const e = t[0];
24
+ if (e === "'")
25
+ return { isToken: !1, value: W(t) };
26
+ if (f[e])
27
+ return { isToken: !0, value: t };
28
+ if (e.match(R))
29
+ throw new RangeError(
30
+ "Format string contains an unescaped latin alphabet character `" + e + "`"
31
+ );
32
+ return { isToken: !1, value: t };
33
+ });
34
+ i.localize.preprocessor && (c = i.localize.preprocessor(s, c));
35
+ const k = {
36
+ firstWeekContainsDate: m,
37
+ weekStartsOn: p,
38
+ locale: i
39
+ };
40
+ return c.map((t) => {
41
+ if (!t.isToken) return t.value;
42
+ const e = t.value;
43
+ (!r?.useAdditionalWeekYearTokens && g(e) || !r?.useAdditionalDayOfYearTokens && h(e)) && w(e, a, String(o));
44
+ const l = f[e[0]];
45
+ return l(s, e, i.localize, k);
46
+ }).join("");
47
+ }
48
+ function W(o) {
49
+ const a = o.match(C);
50
+ return a ? a[1].replace(S, "'") : o;
51
+ }
52
+ export {
53
+ L as format,
54
+ L as formatDate,
55
+ f as formatters,
56
+ d as longFormatters
57
+ };
@@ -0,0 +1,10 @@
1
+ import { differenceInCalendarDays as a } from "./differenceInCalendarDays.js";
2
+ import { startOfYear as e } from "./startOfYear.js";
3
+ import { toDate as o } from "./toDate.js";
4
+ function s(t, f) {
5
+ const r = o(t, f?.in);
6
+ return a(r, e(r)) + 1;
7
+ }
8
+ export {
9
+ s as getDayOfYear
10
+ };
@@ -0,0 +1,9 @@
1
+ import { constructFrom as a } from "./constructFrom.js";
2
+ import { toDate as c } from "./toDate.js";
3
+ function l(e, n) {
4
+ const t = c(e, n?.in), r = t.getFullYear(), s = t.getMonth(), o = a(t, 0);
5
+ return o.setFullYear(r, s + 1, 0), o.setHours(0, 0, 0, 0), o.getDate();
6
+ }
7
+ export {
8
+ l as getDaysInMonth
9
+ };
@@ -0,0 +1,11 @@
1
+ import { millisecondsInWeek as f } from "./constants.js";
2
+ import { startOfISOWeek as i } from "./startOfISOWeek.js";
3
+ import { startOfISOWeekYear as m } from "./startOfISOWeekYear.js";
4
+ import { toDate as n } from "./toDate.js";
5
+ function c(e, o) {
6
+ const t = n(e, o?.in), r = +i(t) - +m(t);
7
+ return Math.round(r / f) + 1;
8
+ }
9
+ export {
10
+ c as getISOWeek
11
+ };
@@ -0,0 +1,14 @@
1
+ import { constructFrom as s } from "./constructFrom.js";
2
+ import { startOfISOWeek as a } from "./startOfISOWeek.js";
3
+ import { toDate as m } from "./toDate.js";
4
+ function Y(f, n) {
5
+ const e = m(f, n?.in), t = e.getFullYear(), r = s(e, 0);
6
+ r.setFullYear(t + 1, 0, 4), r.setHours(0, 0, 0, 0);
7
+ const u = a(r), o = s(e, 0);
8
+ o.setFullYear(t, 0, 4), o.setHours(0, 0, 0, 0);
9
+ const i = a(o);
10
+ return e.getTime() >= u.getTime() ? t + 1 : e.getTime() >= i.getTime() ? t : t - 1;
11
+ }
12
+ export {
13
+ Y as getISOWeekYear
14
+ };
@@ -0,0 +1,7 @@
1
+ import { toDate as n } from "./toDate.js";
2
+ function r(t, o) {
3
+ return n(t, o?.in).getMonth();
4
+ }
5
+ export {
6
+ r as getMonth
7
+ };
@@ -0,0 +1,11 @@
1
+ import { millisecondsInWeek as f } from "./constants.js";
2
+ import { startOfWeek as m } from "./startOfWeek.js";
3
+ import { startOfWeekYear as i } from "./startOfWeekYear.js";
4
+ import { toDate as n } from "./toDate.js";
5
+ function s(r, t) {
6
+ const e = n(r, t?.in), o = +m(e, t) - +i(e, t);
7
+ return Math.round(o / f) + 1;
8
+ }
9
+ export {
10
+ s as getWeek
11
+ };
@@ -0,0 +1,15 @@
1
+ import { getDefaultOptions as k } from "./_lib/defaultOptions.js";
2
+ import { constructFrom as f } from "./constructFrom.js";
3
+ import { startOfWeek as l } from "./startOfWeek.js";
4
+ import { toDate as m } from "./toDate.js";
5
+ function C(r, e) {
6
+ const s = m(r, e?.in), t = s.getFullYear(), o = k(), i = e?.firstWeekContainsDate ?? e?.locale?.options?.firstWeekContainsDate ?? o.firstWeekContainsDate ?? o.locale?.options?.firstWeekContainsDate ?? 1, a = f(e?.in || r, 0);
7
+ a.setFullYear(t + 1, 0, i), a.setHours(0, 0, 0, 0);
8
+ const c = l(a, e), n = f(e?.in || r, 0);
9
+ n.setFullYear(t, 0, i), n.setHours(0, 0, 0, 0);
10
+ const u = l(n, e);
11
+ return +s >= +c ? t + 1 : +s >= +u ? t : t - 1;
12
+ }
13
+ export {
14
+ C as getWeekYear
15
+ };
@@ -0,0 +1,7 @@
1
+ import { toDate as r } from "./toDate.js";
2
+ function n(t, e) {
3
+ return r(t, e?.in).getFullYear();
4
+ }
5
+ export {
6
+ n as getYear
7
+ };
@@ -0,0 +1,7 @@
1
+ import { toDate as t } from "./toDate.js";
2
+ function f(r, o) {
3
+ return +t(r) > +t(o);
4
+ }
5
+ export {
6
+ f as isAfter
7
+ };
@@ -0,0 +1,7 @@
1
+ import { toDate as o } from "./toDate.js";
2
+ function f(r, t) {
3
+ return +o(r) < +o(t);
4
+ }
5
+ export {
6
+ f as isBefore
7
+ };
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
3
+ }
4
+ export {
5
+ e as isDate
6
+ };
@@ -0,0 +1,13 @@
1
+ import { normalizeDates as m } from "./_lib/normalizeDates.js";
2
+ import { startOfDay as t } from "./startOfDay.js";
3
+ function s(r, a, e) {
4
+ const [o, i] = m(
5
+ e?.in,
6
+ r,
7
+ a
8
+ );
9
+ return +t(o) == +t(i);
10
+ }
11
+ export {
12
+ s as isSameDay
13
+ };
@@ -0,0 +1,12 @@
1
+ import { normalizeDates as o } from "./_lib/normalizeDates.js";
2
+ function i(r, a, n) {
3
+ const [e, t] = o(
4
+ n?.in,
5
+ r,
6
+ a
7
+ );
8
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
9
+ }
10
+ export {
11
+ i as isSameMonth
12
+ };
@@ -0,0 +1,12 @@
1
+ import { normalizeDates as i } from "./_lib/normalizeDates.js";
2
+ function o(e, r, t) {
3
+ const [a, l] = i(
4
+ t?.in,
5
+ e,
6
+ r
7
+ );
8
+ return a.getFullYear() === l.getFullYear();
9
+ }
10
+ export {
11
+ o as isSameYear
12
+ };
@@ -0,0 +1,8 @@
1
+ import { isDate as r } from "./isDate.js";
2
+ import { toDate as i } from "./toDate.js";
3
+ function e(o) {
4
+ return !(!r(o) && typeof o != "number" || isNaN(+i(o)));
5
+ }
6
+ export {
7
+ e as isValid
8
+ };
@@ -0,0 +1,9 @@
1
+ function r(t) {
2
+ return (d = {}) => {
3
+ const n = d.width ? String(d.width) : t.defaultWidth;
4
+ return t.formats[n] || t.formats[t.defaultWidth];
5
+ };
6
+ }
7
+ export {
8
+ r as buildFormatLongFn
9
+ };
@@ -0,0 +1,18 @@
1
+ function c(t) {
2
+ return (l, e) => {
3
+ const u = e?.context ? String(e.context) : "standalone";
4
+ let d;
5
+ if (u === "formatting" && t.formattingValues) {
6
+ const n = t.defaultFormattingWidth || t.defaultWidth, i = e?.width ? String(e.width) : n;
7
+ d = t.formattingValues[i] || t.formattingValues[n];
8
+ } else {
9
+ const n = t.defaultWidth, i = e?.width ? String(e.width) : t.defaultWidth;
10
+ d = t.values[i] || t.values[n];
11
+ }
12
+ const a = t.argumentCallback ? t.argumentCallback(l) : l;
13
+ return d[a];
14
+ };
15
+ }
16
+ export {
17
+ c as buildLocalizeFn
18
+ };
@@ -0,0 +1,31 @@
1
+ function P(t) {
2
+ return (n, e = {}) => {
3
+ const l = e.width, h = l && t.matchPatterns[l] || t.matchPatterns[t.defaultMatchWidth], i = n.match(h);
4
+ if (!i)
5
+ return null;
6
+ const r = i[0], c = l && t.parsePatterns[l] || t.parsePatterns[t.defaultParseWidth], d = Array.isArray(c) ? o(c, (u) => u.test(r)) : (
7
+ // [TODO] -- I challenge you to fix the type
8
+ s(c, (u) => u.test(r))
9
+ );
10
+ let a;
11
+ a = t.valueCallback ? t.valueCallback(d) : d, a = e.valueCallback ? (
12
+ // [TODO] -- I challenge you to fix the type
13
+ e.valueCallback(a)
14
+ ) : a;
15
+ const f = n.slice(r.length);
16
+ return { value: a, rest: f };
17
+ };
18
+ }
19
+ function s(t, n) {
20
+ for (const e in t)
21
+ if (Object.prototype.hasOwnProperty.call(t, e) && n(t[e]))
22
+ return e;
23
+ }
24
+ function o(t, n) {
25
+ for (let e = 0; e < t.length; e++)
26
+ if (n(t[e]))
27
+ return e;
28
+ }
29
+ export {
30
+ P as buildMatchFn
31
+ };
@@ -0,0 +1,15 @@
1
+ function h(t) {
2
+ return (e, c = {}) => {
3
+ const n = e.match(t.matchPattern);
4
+ if (!n) return null;
5
+ const u = n[0], a = e.match(t.parsePattern);
6
+ if (!a) return null;
7
+ let l = t.valueCallback ? t.valueCallback(a[0]) : a[0];
8
+ l = c.valueCallback ? c.valueCallback(l) : l;
9
+ const r = e.slice(u.length);
10
+ return { value: l, rest: r };
11
+ };
12
+ }
13
+ export {
14
+ h as buildMatchPatternFn
15
+ };
@@ -0,0 +1,70 @@
1
+ const a = {
2
+ lessThanXSeconds: {
3
+ one: "less than a second",
4
+ other: "less than {{count}} seconds"
5
+ },
6
+ xSeconds: {
7
+ one: "1 second",
8
+ other: "{{count}} seconds"
9
+ },
10
+ halfAMinute: "half a minute",
11
+ lessThanXMinutes: {
12
+ one: "less than a minute",
13
+ other: "less than {{count}} minutes"
14
+ },
15
+ xMinutes: {
16
+ one: "1 minute",
17
+ other: "{{count}} minutes"
18
+ },
19
+ aboutXHours: {
20
+ one: "about 1 hour",
21
+ other: "about {{count}} hours"
22
+ },
23
+ xHours: {
24
+ one: "1 hour",
25
+ other: "{{count}} hours"
26
+ },
27
+ xDays: {
28
+ one: "1 day",
29
+ other: "{{count}} days"
30
+ },
31
+ aboutXWeeks: {
32
+ one: "about 1 week",
33
+ other: "about {{count}} weeks"
34
+ },
35
+ xWeeks: {
36
+ one: "1 week",
37
+ other: "{{count}} weeks"
38
+ },
39
+ aboutXMonths: {
40
+ one: "about 1 month",
41
+ other: "about {{count}} months"
42
+ },
43
+ xMonths: {
44
+ one: "1 month",
45
+ other: "{{count}} months"
46
+ },
47
+ aboutXYears: {
48
+ one: "about 1 year",
49
+ other: "about {{count}} years"
50
+ },
51
+ xYears: {
52
+ one: "1 year",
53
+ other: "{{count}} years"
54
+ },
55
+ overXYears: {
56
+ one: "over 1 year",
57
+ other: "over {{count}} years"
58
+ },
59
+ almostXYears: {
60
+ one: "almost 1 year",
61
+ other: "almost {{count}} years"
62
+ }
63
+ }, r = (s, n, t) => {
64
+ let e;
65
+ const o = a[s];
66
+ return typeof o == "string" ? e = o : n === 1 ? e = o.one : e = o.other.replace("{{count}}", n.toString()), t?.addSuffix ? t.comparison && t.comparison > 0 ? "in " + e : e + " ago" : e;
67
+ };
68
+ export {
69
+ r as formatDistance
70
+ };
@@ -0,0 +1,33 @@
1
+ import { buildFormatLongFn as t } from "../../_lib/buildFormatLongFn.js";
2
+ const m = {
3
+ full: "EEEE, MMMM do, y",
4
+ long: "MMMM do, y",
5
+ medium: "MMM d, y",
6
+ short: "MM/dd/yyyy"
7
+ }, a = {
8
+ full: "h:mm:ss a zzzz",
9
+ long: "h:mm:ss a z",
10
+ medium: "h:mm:ss a",
11
+ short: "h:mm a"
12
+ }, o = {
13
+ full: "{{date}} 'at' {{time}}",
14
+ long: "{{date}} 'at' {{time}}",
15
+ medium: "{{date}}, {{time}}",
16
+ short: "{{date}}, {{time}}"
17
+ }, e = {
18
+ date: t({
19
+ formats: m,
20
+ defaultWidth: "full"
21
+ }),
22
+ time: t({
23
+ formats: a,
24
+ defaultWidth: "full"
25
+ }),
26
+ dateTime: t({
27
+ formats: o,
28
+ defaultWidth: "full"
29
+ })
30
+ };
31
+ export {
32
+ e as formatLong
33
+ };
@@ -0,0 +1,11 @@
1
+ const t = {
2
+ lastWeek: "'last' eeee 'at' p",
3
+ yesterday: "'yesterday at' p",
4
+ today: "'today at' p",
5
+ tomorrow: "'tomorrow at' p",
6
+ nextWeek: "eeee 'at' p",
7
+ other: "P"
8
+ }, s = (e, a, o, r) => t[e];
9
+ export {
10
+ s as formatRelative
11
+ };