kiban-design-system 3.12.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 (180) 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/ui/calendar.d.ts +9 -0
  5. package/dist/components/ui/calendar.d.ts.map +1 -0
  6. package/dist/components/ui/calendar.js +56 -0
  7. package/dist/components/ui/popover.d.ts +11 -0
  8. package/dist/components/ui/popover.d.ts.map +1 -0
  9. package/dist/components/ui/popover.js +81 -0
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +99 -87
  13. package/dist/node_modules/@date-fns/tz/date/index.js +61 -0
  14. package/dist/node_modules/@date-fns/tz/date/mini.js +69 -0
  15. package/dist/node_modules/@date-fns/tz/tzName/index.js +11 -0
  16. package/dist/node_modules/@date-fns/tz/tzOffset/index.js +22 -0
  17. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +240 -0
  18. package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
  19. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  20. package/dist/node_modules/date-fns/_lib/format/formatters.js +548 -0
  21. package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +58 -0
  22. package/dist/node_modules/date-fns/_lib/format/longFormatters.js +49 -0
  23. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
  24. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  25. package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
  26. package/dist/node_modules/date-fns/_lib/protectedTokens.js +20 -0
  27. package/dist/node_modules/date-fns/addDays.js +9 -0
  28. package/dist/node_modules/date-fns/addMonths.js +19 -0
  29. package/dist/node_modules/date-fns/addWeeks.js +7 -0
  30. package/dist/node_modules/date-fns/addYears.js +7 -0
  31. package/dist/node_modules/date-fns/constants.js +8 -0
  32. package/dist/node_modules/date-fns/constructFrom.js +7 -0
  33. package/dist/node_modules/date-fns/differenceInCalendarDays.js +15 -0
  34. package/dist/node_modules/date-fns/differenceInCalendarMonths.js +12 -0
  35. package/dist/node_modules/date-fns/eachMonthOfInterval.js +16 -0
  36. package/dist/node_modules/date-fns/eachYearOfInterval.js +16 -0
  37. package/dist/node_modules/date-fns/endOfISOWeek.js +7 -0
  38. package/dist/node_modules/date-fns/endOfMonth.js +8 -0
  39. package/dist/node_modules/date-fns/endOfWeek.js +9 -0
  40. package/dist/node_modules/date-fns/endOfYear.js +8 -0
  41. package/dist/node_modules/date-fns/format.js +57 -0
  42. package/dist/node_modules/date-fns/getDayOfYear.js +10 -0
  43. package/dist/node_modules/date-fns/getDaysInMonth.js +9 -0
  44. package/dist/node_modules/date-fns/getISOWeek.js +11 -0
  45. package/dist/node_modules/date-fns/getISOWeekYear.js +14 -0
  46. package/dist/node_modules/date-fns/getMonth.js +7 -0
  47. package/dist/node_modules/date-fns/getWeek.js +11 -0
  48. package/dist/node_modules/date-fns/getWeekYear.js +15 -0
  49. package/dist/node_modules/date-fns/getYear.js +7 -0
  50. package/dist/node_modules/date-fns/isAfter.js +7 -0
  51. package/dist/node_modules/date-fns/isBefore.js +7 -0
  52. package/dist/node_modules/date-fns/isDate.js +6 -0
  53. package/dist/node_modules/date-fns/isSameDay.js +13 -0
  54. package/dist/node_modules/date-fns/isSameMonth.js +12 -0
  55. package/dist/node_modules/date-fns/isSameYear.js +12 -0
  56. package/dist/node_modules/date-fns/isValid.js +8 -0
  57. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  58. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  59. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  60. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  61. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  62. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  63. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  64. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  65. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  66. package/dist/node_modules/date-fns/locale/en-US.js +20 -0
  67. package/dist/node_modules/date-fns/max.js +13 -0
  68. package/dist/node_modules/date-fns/min.js +13 -0
  69. package/dist/node_modules/date-fns/parseISO.js +121 -0
  70. package/dist/node_modules/date-fns/setMonth.js +12 -0
  71. package/dist/node_modules/date-fns/setYear.js +9 -0
  72. package/dist/node_modules/date-fns/startOfDay.js +8 -0
  73. package/dist/node_modules/date-fns/startOfISOWeek.js +7 -0
  74. package/dist/node_modules/date-fns/startOfISOWeekYear.js +10 -0
  75. package/dist/node_modules/date-fns/startOfMonth.js +8 -0
  76. package/dist/node_modules/date-fns/startOfWeek.js +9 -0
  77. package/dist/node_modules/date-fns/startOfWeekYear.js +11 -0
  78. package/dist/node_modules/date-fns/startOfYear.js +8 -0
  79. package/dist/node_modules/date-fns/toDate.js +7 -0
  80. package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +234 -0
  81. package/dist/node_modules/react-day-picker/dist/esm/UI.js +22 -0
  82. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +19 -0
  83. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +8 -0
  84. package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +8 -0
  85. package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +148 -0
  86. package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +7 -0
  87. package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +7 -0
  88. package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -0
  89. package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +8 -0
  90. package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +10 -0
  91. package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +19 -0
  92. package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +7 -0
  93. package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +7 -0
  94. package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +8 -0
  95. package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +8 -0
  96. package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +7 -0
  97. package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +7 -0
  98. package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +9 -0
  99. package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +27 -0
  100. package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +9 -0
  101. package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +7 -0
  102. package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +9 -0
  103. package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +8 -0
  104. package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +7 -0
  105. package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +8 -0
  106. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +8 -0
  107. package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +7 -0
  108. package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +7 -0
  109. package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +11 -0
  110. package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +7 -0
  111. package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +9 -0
  112. package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +54 -0
  113. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +9 -0
  114. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +7 -0
  115. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +7 -0
  116. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +7 -0
  117. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +6 -0
  118. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +7 -0
  119. package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +9 -0
  120. package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +18 -0
  121. package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +19 -0
  122. package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +42 -0
  123. package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +9 -0
  124. package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +7 -0
  125. package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +7 -0
  126. package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +10 -0
  127. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +16 -0
  128. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +19 -0
  129. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +10 -0
  130. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +16 -0
  131. package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +13 -0
  132. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +15 -0
  133. package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +10 -0
  134. package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +13 -0
  135. package/dist/node_modules/react-day-picker/dist/esm/helpers/getLabels.js +34 -0
  136. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +13 -0
  137. package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +24 -0
  138. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +13 -0
  139. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +12 -0
  140. package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +12 -0
  141. package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +12 -0
  142. package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +13 -0
  143. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +11 -0
  144. package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +7 -0
  145. package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +16 -0
  146. package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +7 -0
  147. package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +8 -0
  148. package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +26 -0
  149. package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +10 -0
  150. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +9 -0
  151. package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +8 -0
  152. package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +6 -0
  153. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +6 -0
  154. package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +7 -0
  155. package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +6 -0
  156. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +6 -0
  157. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +6 -0
  158. package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +7 -0
  159. package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +6 -0
  160. package/dist/node_modules/react-day-picker/dist/esm/locale/en-US.js +37 -0
  161. package/dist/node_modules/react-day-picker/dist/esm/noonDateLib.js +104 -0
  162. package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +21 -0
  163. package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +18 -0
  164. package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +15 -0
  165. package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +56 -0
  166. package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +75 -0
  167. package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +12 -0
  168. package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +23 -0
  169. package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +19 -0
  170. package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +32 -0
  171. package/dist/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.js +26 -0
  172. package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +26 -0
  173. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +15 -0
  174. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +28 -0
  175. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +9 -0
  176. package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +8 -0
  177. package/dist/node_modules/react-day-picker/dist/esm/utils/toTimeZone.js +8 -0
  178. package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +26 -0
  179. package/dist/style.css +1 -1
  180. package/package.json +7 -3
@@ -0,0 +1,7 @@
1
+ function n(s, e) {
2
+ const t = e.startOfMonth(s), r = t.getDay();
3
+ return r === 1 ? t : r === 0 ? e.addDays(t, -6) : e.addDays(t, -1 * (r - 1));
4
+ }
5
+ export {
6
+ n as startOfBroadcastWeek
7
+ };
@@ -0,0 +1,8 @@
1
+ import { useState as o } from "react";
2
+ function a(t, e) {
3
+ const [u, n] = o(t);
4
+ return [e === void 0 ? u : e, n];
5
+ }
6
+ export {
7
+ a as useControlledValue
8
+ };
@@ -0,0 +1,26 @@
1
+ import { labelDay as o, labelDayButton as l } from "./labelDayButton.js";
2
+ import { labelCaption as t, labelGrid as b } from "./labelGrid.js";
3
+ import { labelGridcell as m } from "./labelGridcell.js";
4
+ import { labelMonthDropdown as f } from "./labelMonthDropdown.js";
5
+ import { labelNav as n } from "./labelNav.js";
6
+ import { labelNext as u } from "./labelNext.js";
7
+ import { labelPrevious as N } from "./labelPrevious.js";
8
+ import { labelWeekday as y } from "./labelWeekday.js";
9
+ import { labelWeekNumber as v } from "./labelWeekNumber.js";
10
+ import { labelWeekNumberHeader as G } from "./labelWeekNumberHeader.js";
11
+ import { labelYearDropdown as h } from "./labelYearDropdown.js";
12
+ export {
13
+ t as labelCaption,
14
+ o as labelDay,
15
+ l as labelDayButton,
16
+ b as labelGrid,
17
+ m as labelGridcell,
18
+ f as labelMonthDropdown,
19
+ n as labelNav,
20
+ u as labelNext,
21
+ N as labelPrevious,
22
+ v as labelWeekNumber,
23
+ G as labelWeekNumberHeader,
24
+ y as labelWeekday,
25
+ h as labelYearDropdown
26
+ };
@@ -0,0 +1,10 @@
1
+ import { DateLib as n } from "../classes/DateLib.js";
2
+ function r(a, t, l, o) {
3
+ let e = (o ?? new n(l)).format(a, "PPPP");
4
+ return t.today && (e = `Today, ${e}`), t.selected && (e = `${e}, selected`), e;
5
+ }
6
+ const c = r;
7
+ export {
8
+ c as labelDay,
9
+ r as labelDayButton
10
+ };
@@ -0,0 +1,9 @@
1
+ import { DateLib as r } from "../classes/DateLib.js";
2
+ function e(t, o, n) {
3
+ return (n ?? new r(o)).formatMonthYear(t);
4
+ }
5
+ const l = e;
6
+ export {
7
+ l as labelCaption,
8
+ e as labelGrid
9
+ };
@@ -0,0 +1,8 @@
1
+ import { DateLib as a } from "../classes/DateLib.js";
2
+ function f(t, l, o, r) {
3
+ let e = (r ?? new a(o)).format(t, "PPPP");
4
+ return l?.today && (e = `Today, ${e}`), e;
5
+ }
6
+ export {
7
+ f as labelGridcell
8
+ };
@@ -0,0 +1,6 @@
1
+ function n(o) {
2
+ return "Choose the Month";
3
+ }
4
+ export {
5
+ n as labelMonthDropdown
6
+ };
@@ -0,0 +1,6 @@
1
+ function e() {
2
+ return "";
3
+ }
4
+ export {
5
+ e as labelNav
6
+ };
@@ -0,0 +1,7 @@
1
+ const t = "Go to the Next Month";
2
+ function n(o, e) {
3
+ return t;
4
+ }
5
+ export {
6
+ n as labelNext
7
+ };
@@ -0,0 +1,6 @@
1
+ function t(o) {
2
+ return "Go to the Previous Month";
3
+ }
4
+ export {
5
+ t as labelPrevious
6
+ };
@@ -0,0 +1,6 @@
1
+ function o(e, n) {
2
+ return `Week ${e}`;
3
+ }
4
+ export {
5
+ o as labelWeekNumber
6
+ };
@@ -0,0 +1,6 @@
1
+ function r(e) {
2
+ return "Week Number";
3
+ }
4
+ export {
5
+ r as labelWeekNumberHeader
6
+ };
@@ -0,0 +1,7 @@
1
+ import { DateLib as c } from "../classes/DateLib.js";
2
+ function a(e, r, t) {
3
+ return (t ?? new c(r)).format(e, "cccc");
4
+ }
5
+ export {
6
+ a as labelWeekday
7
+ };
@@ -0,0 +1,6 @@
1
+ function e(o) {
2
+ return "Choose the Year";
3
+ }
4
+ export {
5
+ e as labelYearDropdown
6
+ };
@@ -0,0 +1,37 @@
1
+ import { enUS as f } from "../../../../date-fns/locale/en-US.js";
2
+ import { format as n } from "../../../../date-fns/format.js";
3
+ const s = {
4
+ ...f,
5
+ labels: {
6
+ labelDayButton: (r, a, o, e) => {
7
+ let t;
8
+ e && typeof e.format == "function" ? t = e.format.bind(e) : t = (m, c) => n(m, c, { locale: f, ...o });
9
+ let l = t(r, "PPPP");
10
+ return a.today && (l = `Today, ${l}`), a.selected && (l = `${l}, selected`), l;
11
+ },
12
+ labelMonthDropdown: "Choose the Month",
13
+ labelNext: "Go to the Next Month",
14
+ labelPrevious: "Go to the Previous Month",
15
+ labelWeekNumber: (r) => `Week ${r}`,
16
+ labelYearDropdown: "Choose the Year",
17
+ labelGrid: (r, a, o) => {
18
+ let e;
19
+ return o && typeof o.format == "function" ? e = o.format.bind(o) : e = (t, l) => n(t, l, { locale: f, ...a }), e(r, "LLLL yyyy");
20
+ },
21
+ labelGridcell: (r, a, o, e) => {
22
+ let t;
23
+ e && typeof e.format == "function" ? t = e.format.bind(e) : t = (m, c) => n(m, c, { locale: f, ...o });
24
+ let l = t(r, "PPPP");
25
+ return a?.today && (l = `Today, ${l}`), l;
26
+ },
27
+ labelNav: "Navigation bar",
28
+ labelWeekNumberHeader: "Week Number",
29
+ labelWeekday: (r, a, o) => {
30
+ let e;
31
+ return o && typeof o.format == "function" ? e = o.format.bind(o) : e = (t, l) => n(t, l, { locale: f, ...a }), e(r, "cccc");
32
+ }
33
+ }
34
+ };
35
+ export {
36
+ s as enUS
37
+ };
@@ -0,0 +1,104 @@
1
+ import { TZDate as c } from "../../../@date-fns/tz/date/index.js";
2
+ import "../../../@date-fns/tz/date/mini.js";
3
+ import { differenceInCalendarMonths as h } from "../../../date-fns/differenceInCalendarMonths.js";
4
+ import { differenceInCalendarDays as O } from "../../../date-fns/differenceInCalendarDays.js";
5
+ import { getISOWeek as k } from "../../../date-fns/getISOWeek.js";
6
+ import { getWeek as w } from "../../../date-fns/getWeek.js";
7
+ function W(o, D = {}) {
8
+ const { weekStartsOn: d, locale: g } = D, l = d ?? g?.options?.weekStartsOn ?? 0, r = (t) => {
9
+ const e = typeof t == "number" || typeof t == "string" ? new Date(t) : t;
10
+ return new c(e.getFullYear(), e.getMonth(), e.getDate(), 12, 0, 0, o);
11
+ }, u = (t) => {
12
+ const e = r(t);
13
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0, 0, 0);
14
+ };
15
+ return {
16
+ today: () => r(c.tz(o)),
17
+ newDate: (t, e, n) => new c(t, e, n, 12, 0, 0, o),
18
+ startOfDay: (t) => r(t),
19
+ startOfWeek: (t, e) => {
20
+ const n = r(t), a = e?.weekStartsOn ?? l, s = (n.getDay() - a + 7) % 7;
21
+ return n.setDate(n.getDate() - s), n;
22
+ },
23
+ startOfISOWeek: (t) => {
24
+ const e = r(t), n = (e.getDay() - 1 + 7) % 7;
25
+ return e.setDate(e.getDate() - n), e;
26
+ },
27
+ startOfMonth: (t) => {
28
+ const e = r(t);
29
+ return e.setDate(1), e;
30
+ },
31
+ startOfYear: (t) => {
32
+ const e = r(t);
33
+ return e.setMonth(0, 1), e;
34
+ },
35
+ endOfWeek: (t, e) => {
36
+ const n = r(t), f = (((e?.weekStartsOn ?? l) + 6) % 7 - n.getDay() + 7) % 7;
37
+ return n.setDate(n.getDate() + f), n;
38
+ },
39
+ endOfISOWeek: (t) => {
40
+ const e = r(t), n = (7 - e.getDay()) % 7;
41
+ return e.setDate(e.getDate() + n), e;
42
+ },
43
+ endOfMonth: (t) => {
44
+ const e = r(t);
45
+ return e.setMonth(e.getMonth() + 1, 0), e;
46
+ },
47
+ endOfYear: (t) => {
48
+ const e = r(t);
49
+ return e.setMonth(11, 31), e;
50
+ },
51
+ eachMonthOfInterval: (t) => {
52
+ const e = r(t.start), n = r(t.end), a = [], s = new c(e.getFullYear(), e.getMonth(), 1, 12, 0, 0, o), f = n.getFullYear() * 12 + n.getMonth();
53
+ for (; s.getFullYear() * 12 + s.getMonth() <= f; )
54
+ a.push(new c(s, o)), s.setMonth(s.getMonth() + 1, 1);
55
+ return a;
56
+ },
57
+ // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
58
+ // mutate the same TZDate, and return it.
59
+ addDays: (t, e) => {
60
+ const n = r(t);
61
+ return n.setDate(n.getDate() + e), n;
62
+ },
63
+ addWeeks: (t, e) => {
64
+ const n = r(t);
65
+ return n.setDate(n.getDate() + e * 7), n;
66
+ },
67
+ addMonths: (t, e) => {
68
+ const n = r(t);
69
+ return n.setMonth(n.getMonth() + e), n;
70
+ },
71
+ addYears: (t, e) => {
72
+ const n = r(t);
73
+ return n.setFullYear(n.getFullYear() + e), n;
74
+ },
75
+ eachYearOfInterval: (t) => {
76
+ const e = r(t.start), n = r(t.end), a = [], s = new c(e.getFullYear(), 0, 1, 12, 0, 0, o);
77
+ for (; s.getFullYear() <= n.getFullYear(); )
78
+ a.push(new c(s, o)), s.setFullYear(s.getFullYear() + 1, 0, 1);
79
+ return a;
80
+ },
81
+ getWeek: (t, e) => {
82
+ const n = u(t);
83
+ return w(n, {
84
+ weekStartsOn: e?.weekStartsOn ?? l,
85
+ firstWeekContainsDate: e?.firstWeekContainsDate ?? g?.options?.firstWeekContainsDate ?? 1
86
+ });
87
+ },
88
+ getISOWeek: (t) => {
89
+ const e = u(t);
90
+ return k(e);
91
+ },
92
+ differenceInCalendarDays: (t, e) => {
93
+ const n = u(t), a = u(e);
94
+ return O(n, a);
95
+ },
96
+ differenceInCalendarMonths: (t, e) => {
97
+ const n = u(t), a = u(e);
98
+ return h(n, a);
99
+ }
100
+ };
101
+ }
102
+ export {
103
+ W as createNoonOverrides
104
+ };
@@ -0,0 +1,21 @@
1
+ import { useControlledValue as x } from "../helpers/useControlledValue.js";
2
+ function C(i, d) {
3
+ const { selected: s, required: f, onSelect: l } = i, [r, m] = x(s, l ? s : void 0), e = l ? s : r, { isSameDay: o } = d, u = (t) => e?.some((c) => o(c, t)) ?? !1, { min: S, max: a } = i;
4
+ return {
5
+ selected: e,
6
+ select: (t, c, h) => {
7
+ let n = [...e ?? []];
8
+ if (u(t)) {
9
+ if (e?.length === S || f && e?.length === 1)
10
+ return;
11
+ n = e?.filter((y) => !o(y, t));
12
+ } else
13
+ e?.length === a ? n = [t] : n = [...n, t];
14
+ return l || m(n), l?.(n, t, c, h), n;
15
+ },
16
+ isSelected: u
17
+ };
18
+ }
19
+ export {
20
+ C as useMulti
21
+ };
@@ -0,0 +1,18 @@
1
+ import { useControlledValue as x } from "../helpers/useControlledValue.js";
2
+ import { rangeIncludesDate as R } from "../utils/rangeIncludesDate.js";
3
+ import { addToRange as y } from "../utils/addToRange.js";
4
+ import { rangeContainsModifiers as C } from "../utils/rangeContainsModifiers.js";
5
+ function b(s, l) {
6
+ const { disabled: c, excludeDisabled: i, selected: d, required: f, onSelect: o } = s, [r, m] = x(d, o ? d : void 0), t = o ? d : r;
7
+ return {
8
+ selected: t,
9
+ select: (n, u, a) => {
10
+ const { min: S, max: p } = s, e = n ? y(n, t, S, p, f, l) : void 0;
11
+ return i && c && e?.from && e.to && C({ from: e.from, to: e.to }, c, l) && (e.from = n, e.to = void 0), o || m(e), o?.(e, n, u, a), e;
12
+ },
13
+ isSelected: (n) => t && R(t, n, !1, l)
14
+ };
15
+ }
16
+ export {
17
+ b as useRange
18
+ };
@@ -0,0 +1,15 @@
1
+ import { useControlledValue as a } from "../helpers/useControlledValue.js";
2
+ function q(u, S) {
3
+ const { selected: c, required: s, onSelect: t } = u, [f, r] = a(c, t ? c : void 0), e = t ? c : f, { isSameDay: d } = S;
4
+ return {
5
+ selected: e,
6
+ select: (n, o, i) => {
7
+ let l = n;
8
+ return !s && e && e && d(n, e) && (l = void 0), t || r(l), t?.(l, n, o, i), l;
9
+ },
10
+ isSelected: (n) => e ? d(e, n) : !1
11
+ };
12
+ }
13
+ export {
14
+ q as useSingle
15
+ };
@@ -0,0 +1,56 @@
1
+ import { useRef as k, useLayoutEffect as z } from "react";
2
+ import { Animation as o } from "./UI.js";
3
+ const l = (e) => e instanceof HTMLElement ? e : null, q = (e) => [
4
+ ...e.querySelectorAll("[data-animated-month]") ?? []
5
+ ], I = (e) => l(e.querySelector("[data-animated-month]")), w = (e) => l(e.querySelector("[data-animated-caption]")), h = (e) => l(e.querySelector("[data-animated-weeks]")), B = (e) => l(e.querySelector("[data-animated-nav]")), P = (e) => l(e.querySelector("[data-animated-weekdays]"));
6
+ function D(e, M, { classNames: s, months: a, focused: b, dateLib: S }) {
7
+ const y = k(null), A = k(a), p = k(!1);
8
+ z(() => {
9
+ const f = A.current;
10
+ if (A.current = a, !M || !e.current || // safety check because the ref can be set to anything by consumers
11
+ !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
12
+ a.length === 0 || f.length === 0 || a.length !== f.length)
13
+ return;
14
+ const g = S.isSameMonth(a[0].date, f[0].date), u = S.isAfter(a[0].date, f[0].date), v = u ? s[o.caption_after_enter] : s[o.caption_before_enter], m = u ? s[o.weeks_after_enter] : s[o.weeks_before_enter], H = y.current, L = e.current.cloneNode(!0);
15
+ if (L instanceof HTMLElement ? (q(L).forEach((t) => {
16
+ if (!(t instanceof HTMLElement))
17
+ return;
18
+ const c = I(t);
19
+ c && t.contains(c) && t.removeChild(c);
20
+ const n = w(t);
21
+ n && n.classList.remove(v);
22
+ const r = h(t);
23
+ r && r.classList.remove(m);
24
+ }), y.current = L) : y.current = null, p.current || g || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
25
+ b)
26
+ return;
27
+ const _ = H instanceof HTMLElement ? q(H) : [], x = q(e.current);
28
+ if (x?.every((i) => i instanceof HTMLElement) && _ && _.every((i) => i instanceof HTMLElement)) {
29
+ p.current = !0, e.current.style.isolation = "isolate";
30
+ const i = B(e.current);
31
+ i && (i.style.zIndex = "1"), x.forEach((t, c) => {
32
+ const n = _[c];
33
+ if (!n)
34
+ return;
35
+ t.style.position = "relative", t.style.overflow = "hidden";
36
+ const r = w(t);
37
+ r && r.classList.add(v);
38
+ const d = h(t);
39
+ d && d.classList.add(m);
40
+ const W = () => {
41
+ p.current = !1, e.current && (e.current.style.isolation = ""), i && (i.style.zIndex = ""), r && r.classList.remove(v), d && d.classList.remove(m), t.style.position = "", t.style.overflow = "", t.contains(n) && t.removeChild(n);
42
+ };
43
+ n.style.pointerEvents = "none", n.style.position = "absolute", n.style.overflow = "hidden", n.setAttribute("aria-hidden", "true");
44
+ const C = P(n);
45
+ C && (C.style.opacity = "0");
46
+ const E = w(n);
47
+ E && (E.classList.add(u ? s[o.caption_before_exit] : s[o.caption_after_exit]), E.addEventListener("animationend", W));
48
+ const T = h(n);
49
+ T && T.classList.add(u ? s[o.weeks_before_exit] : s[o.weeks_after_exit]), t.insertBefore(n, t.firstChild);
50
+ });
51
+ }
52
+ });
53
+ }
54
+ export {
55
+ D as useAnimation
56
+ };
@@ -0,0 +1,75 @@
1
+ import { useEffect as D, useMemo as S } from "react";
2
+ import { getDates as N } from "./helpers/getDates.js";
3
+ import { getDays as w } from "./helpers/getDays.js";
4
+ import { getDisplayMonths as E } from "./helpers/getDisplayMonths.js";
5
+ import { getInitialMonth as c } from "./helpers/getInitialMonth.js";
6
+ import { getMonths as b } from "./helpers/getMonths.js";
7
+ import { getNavMonths as q } from "./helpers/getNavMonth.js";
8
+ import { getNextMonth as F } from "./helpers/getNextMonth.js";
9
+ import { getPreviousMonth as P } from "./helpers/getPreviousMonth.js";
10
+ import { getWeeks as V } from "./helpers/getWeeks.js";
11
+ import { useControlledValue as Z } from "./helpers/useControlledValue.js";
12
+ function _(e, n) {
13
+ const [s, a] = q(e, n), { startOfMonth: i, endOfMonth: g } = n, h = c(e, s, a, n), [m, f] = Z(
14
+ h,
15
+ // initialMonth is always computed from props.month if provided
16
+ e.month ? h : void 0
17
+ );
18
+ D(() => {
19
+ const t = c(e, s, a, n);
20
+ f(t);
21
+ }, [e.timeZone]);
22
+ const { months: l, weeks: M, days: u, previousMonth: k, nextMonth: v } = S(() => {
23
+ const t = E(m, a, { numberOfMonths: e.numberOfMonths }, n), o = N(t, e.endMonth ? g(e.endMonth) : void 0, {
24
+ ISOWeek: e.ISOWeek,
25
+ fixedWeeks: e.fixedWeeks,
26
+ broadcastCalendar: e.broadcastCalendar
27
+ }, n), r = b(t, o, {
28
+ broadcastCalendar: e.broadcastCalendar,
29
+ fixedWeeks: e.fixedWeeks,
30
+ ISOWeek: e.ISOWeek,
31
+ reverseMonths: e.reverseMonths
32
+ }, n), C = V(r), y = w(r), I = P(m, s, e, n), T = F(m, a, e, n);
33
+ return {
34
+ months: r,
35
+ weeks: C,
36
+ days: y,
37
+ previousMonth: I,
38
+ nextMonth: T
39
+ };
40
+ }, [
41
+ n,
42
+ m.getTime(),
43
+ a?.getTime(),
44
+ s?.getTime(),
45
+ e.disableNavigation,
46
+ e.broadcastCalendar,
47
+ e.endMonth?.getTime(),
48
+ e.fixedWeeks,
49
+ e.ISOWeek,
50
+ e.numberOfMonths,
51
+ e.pagedNavigation,
52
+ e.reverseMonths
53
+ ]), { disableNavigation: W, onMonthChange: O } = e, x = (t) => M.some((o) => o.days.some((r) => r.isEqualTo(t))), d = (t) => {
54
+ if (W)
55
+ return;
56
+ let o = i(t);
57
+ s && o < i(s) && (o = i(s)), a && o > i(a) && (o = i(a)), f(o), O?.(o);
58
+ };
59
+ return {
60
+ months: l,
61
+ weeks: M,
62
+ days: u,
63
+ navStart: s,
64
+ navEnd: a,
65
+ previousMonth: k,
66
+ nextMonth: v,
67
+ goToMonth: d,
68
+ goToDay: (t) => {
69
+ x(t) || d(t.date);
70
+ }
71
+ };
72
+ }
73
+ export {
74
+ _ as useCalendar
75
+ };
@@ -0,0 +1,12 @@
1
+ import { createContext as t, useContext as n } from "react";
2
+ const o = t(void 0);
3
+ function c() {
4
+ const e = n(o);
5
+ if (e === void 0)
6
+ throw new Error("useDayPicker() must be used within a custom component.");
7
+ return e;
8
+ }
9
+ export {
10
+ o as dayPickerContext,
11
+ c as useDayPicker
12
+ };
@@ -0,0 +1,23 @@
1
+ import { useState as a } from "react";
2
+ import { calculateFocusTarget as T } from "./helpers/calculateFocusTarget.js";
3
+ import { getNextFocus as v } from "./helpers/getNextFocus.js";
4
+ function I(e, o, r, i, f) {
5
+ const { autoFocus: F } = e, [d, m] = a(), c = T(o.days, r, i || (() => !1), d), [s, u] = a(F ? c : void 0);
6
+ return {
7
+ isFocusTarget: (n) => !!c?.isEqualTo(n),
8
+ setFocused: u,
9
+ focused: s,
10
+ blur: () => {
11
+ m(s), u(void 0);
12
+ },
13
+ moveFocus: (n, l) => {
14
+ if (!s)
15
+ return;
16
+ const t = v(n, l, s, o.navStart, o.navEnd, e, f);
17
+ t && (e.disableNavigation && !o.days.some((g) => g.isEqualTo(t)) || (o.goToDay(t), u(t)));
18
+ }
19
+ };
20
+ }
21
+ export {
22
+ I as useFocus
23
+ };
@@ -0,0 +1,19 @@
1
+ import { useMulti as i } from "./selection/useMulti.js";
2
+ import { useRange as o } from "./selection/useRange.js";
3
+ import { useSingle as s } from "./selection/useSingle.js";
4
+ function f(e, n) {
5
+ const t = s(e, n), r = i(e, n), u = o(e, n);
6
+ switch (e.mode) {
7
+ case "single":
8
+ return t;
9
+ case "multiple":
10
+ return r;
11
+ case "range":
12
+ return u;
13
+ default:
14
+ return;
15
+ }
16
+ }
17
+ export {
18
+ f as useSelection
19
+ };
@@ -0,0 +1,32 @@
1
+ import { defaultDateLib as D } from "../classes/DateLib.js";
2
+ function w(f, g, n = 0, s = 0, l = !1, u = D) {
3
+ const { from: o, to: i } = g || {}, { isSameDay: r, isAfter: m, isBefore: c } = u;
4
+ let e;
5
+ if (!o && !i)
6
+ e = { from: f, to: n > 0 ? void 0 : f };
7
+ else if (o && !i)
8
+ r(o, f) ? n === 0 ? e = { from: o, to: f } : l ? e = { from: o, to: void 0 } : e = void 0 : c(f, o) ? e = { from: f, to: o } : e = { from: o, to: f };
9
+ else if (o && i)
10
+ if (r(o, f) && r(i, f))
11
+ l ? e = { from: o, to: i } : e = void 0;
12
+ else if (r(o, f))
13
+ e = { from: o, to: n > 0 ? void 0 : f };
14
+ else if (r(i, f))
15
+ e = { from: f, to: n > 0 ? void 0 : f };
16
+ else if (c(f, o))
17
+ e = { from: f, to: i };
18
+ else if (m(f, o))
19
+ e = { from: o, to: f };
20
+ else if (m(f, i))
21
+ e = { from: o, to: f };
22
+ else
23
+ throw new Error("Invalid range");
24
+ if (e?.from && e?.to) {
25
+ const t = u.differenceInCalendarDays(e.to, e.from);
26
+ s > 0 && t > s ? e = { from: f, to: void 0 } : n > 1 && t < n && (e = { from: f, to: void 0 });
27
+ }
28
+ return e;
29
+ }
30
+ export {
31
+ w as addToRange
32
+ };
@@ -0,0 +1,26 @@
1
+ import "../../../../@date-fns/tz/date/mini.js";
2
+ import { toTimeZone as i } from "./toTimeZone.js";
3
+ import { isDateRange as e, isDateInterval as p, isDateAfterType as y, isDateBeforeType as D } from "./typeguards.js";
4
+ function n(o, f, u) {
5
+ return i(o, f);
6
+ }
7
+ function t(o, f, u) {
8
+ return typeof o == "boolean" || typeof o == "function" ? o : o instanceof Date ? n(o, f) : Array.isArray(o) ? o.map((r) => r instanceof Date ? n(r, f) : r) : e(o) ? {
9
+ ...o,
10
+ from: o.from ? i(o.from, f) : o.from,
11
+ to: o.to ? i(o.to, f) : o.to
12
+ } : p(o) ? {
13
+ before: n(o.before, f),
14
+ after: n(o.after, f)
15
+ } : y(o) ? {
16
+ after: n(o.after, f)
17
+ } : D(o) ? {
18
+ before: n(o.before, f)
19
+ } : o;
20
+ }
21
+ function T(o, f, u) {
22
+ return o && (Array.isArray(o) ? o.map((r) => t(r, f)) : t(o, f));
23
+ }
24
+ export {
25
+ T as convertMatchersToTimeZone
26
+ };
@@ -0,0 +1,26 @@
1
+ import { defaultDateLib as A } from "../classes/DateLib.js";
2
+ import { rangeIncludesDate as p } from "./rangeIncludesDate.js";
3
+ import { isDatesArray as a, isDateRange as I, isDayOfWeekType as g, isDateInterval as k, isDateAfterType as O, isDateBeforeType as W } from "./typeguards.js";
4
+ function b(f, n, r = A) {
5
+ const t = Array.isArray(n) ? n : [n], { isSameDay: o, differenceInCalendarDays: i, isAfter: D } = r;
6
+ return t.some((e) => {
7
+ if (typeof e == "boolean")
8
+ return e;
9
+ if (r.isDate(e))
10
+ return o(f, e);
11
+ if (a(e, r))
12
+ return e.some((s) => o(f, s));
13
+ if (I(e))
14
+ return p(e, f, !1, r);
15
+ if (g(e))
16
+ return Array.isArray(e.dayOfWeek) ? e.dayOfWeek.includes(f.getDay()) : e.dayOfWeek === f.getDay();
17
+ if (k(e)) {
18
+ const s = i(e.before, f), l = i(e.after, f), y = s > 0, u = l < 0;
19
+ return D(e.before, e.after) ? u && y : y || u;
20
+ }
21
+ return O(e) ? i(f, e.after) > 0 : W(e) ? i(e.before, f) > 0 : typeof e == "function" ? e(f) : !1;
22
+ });
23
+ }
24
+ export {
25
+ b as dateMatchModifiers
26
+ };
@@ -0,0 +1,15 @@
1
+ import { defaultDateLib as f } from "../classes/DateLib.js";
2
+ function y(t, r, e = f) {
3
+ const n = Array.isArray(r) ? r : [r];
4
+ let a = t.from;
5
+ const i = e.differenceInCalendarDays(t.to, t.from), s = Math.min(i, 6);
6
+ for (let o = 0; o <= s; o++) {
7
+ if (n.includes(a.getDay()))
8
+ return !0;
9
+ a = e.addDays(a, 1);
10
+ }
11
+ return !1;
12
+ }
13
+ export {
14
+ y as rangeContainsDayOfWeek
15
+ };
@@ -0,0 +1,28 @@
1
+ import { defaultDateLib as p } from "../classes/DateLib.js";
2
+ import { dateMatchModifiers as s } from "./dateMatchModifiers.js";
3
+ import { rangeContainsDayOfWeek as M } from "./rangeContainsDayOfWeek.js";
4
+ import { rangeIncludesDate as l } from "./rangeIncludesDate.js";
5
+ import { rangeOverlaps as y } from "./rangeOverlaps.js";
6
+ import { isDatesArray as a, isDateRange as A, isDayOfWeekType as C, isDateInterval as I, isDateAfterType as v, isDateBeforeType as F } from "./typeguards.js";
7
+ function d(n, t, f = p) {
8
+ const e = Array.isArray(t) ? t : [t];
9
+ if (e.filter((o) => typeof o != "function").some((o) => typeof o == "boolean" ? o : f.isDate(o) ? l(n, o, !1, f) : a(o, f) ? o.some((r) => l(n, r, !1, f)) : A(o) ? o.from && o.to ? y(n, { from: o.from, to: o.to }, f) : !1 : C(o) ? M(n, o.dayOfWeek, f) : I(o) ? f.isAfter(o.before, o.after) ? y(n, {
10
+ from: f.addDays(o.after, 1),
11
+ to: f.addDays(o.before, -1)
12
+ }, f) : s(n.from, o, f) || s(n.to, o, f) : v(o) || F(o) ? s(n.from, o, f) || s(n.to, o, f) : !1))
13
+ return !0;
14
+ const i = e.filter((o) => typeof o == "function");
15
+ if (i.length) {
16
+ let o = n.from;
17
+ const r = f.differenceInCalendarDays(n.to, n.from);
18
+ for (let u = 0; u <= r; u++) {
19
+ if (i.some((D) => D(o)))
20
+ return !0;
21
+ o = f.addDays(o, 1);
22
+ }
23
+ }
24
+ return !1;
25
+ }
26
+ export {
27
+ d as rangeContainsModifiers
28
+ };